plugins/dev-workflow/skills/fixing-code/SKILL.md
Fix code problems with disciplined diagnosis — run checks, build a repro for bugs, rank falsifiable hypotheses, fix one issue at a time, and verify until clean. Use when user says "fix", "debug", "diagnose", "broken", "failing", "throws", "performance regression", "make tests pass", or wants lint/test/build failures resolved.
npx skillsauth add alexei-led/claude-code-config fixing-codeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fix until clean. For hard bugs, diagnose before editing. No guessing. Confirm before any destructive command; never use git reset --hard, git clean, or force push as a fix.
Parse $ARGUMENTS:
diagnose or investigate → hard-bug workflow: feedback loop, repro, hypotheses, probes, regression test.team → parallel analysis agents challenge root causes before fixes.Use TaskCreate / TaskUpdate to track:
For lint/build/test failures, run validation:
make lint 2>&1 | head -150
make test 2>&1 | head -150
No Makefile? Detect language:
golangci-lint run ./... 2>&1 | head -150 && go test -race ./... 2>&1 | head -150ruff check . 2>&1 | head -150 && pytest --tb=short 2>&1 | head -150bun lint 2>&1 | head -150 && bun test 2>&1 | head -150bunx eslint "**/*.js" 2>&1 | head -100 && bunx stylelint "**/*.css" 2>&1 | head -100If all checks pass: report All checks pass and stop.
For reported bugs or diagnose/investigate, build a fast, deterministic pass/fail signal before editing. Try, in order:
git bisect run harness for regressions.Do not proceed to fixes until the loop reproduces the user's symptom. If no loop is possible, stop and ask for access, logs, HAR/core dump, screen recording with timestamps, or permission to add temporary instrumentation.
Read the failing output and relevant files. If claude-mem is available, search for prior gotchas on failing files.
For straightforward check failures, catalog every distinct issue:
For hard bugs, generate 3–5 ranked falsifiable hypotheses before testing any one of them:
If <cause> is true, then <probe/change> will make <specific symptom> disappear or change.
Avoid testing only the first plausible hypothesis; that anchors the fix on guesswork.
If team is set, spawn relevant language QA/test/implementation agents in parallel. Agents analyze only; they must not edit. Ask them for root cause, evidence, suggested fix, priority, and confidence.
Probe one hypothesis at a time.
[DEBUG-a4f2].For each issue, in priority order:
If the only available test seam is too shallow, say so. Do not write a fake-confidence test that only proves a helper works while the real bug path stays uncovered.
If a fix causes new failures, revert or adjust it before touching the next issue.
Required before done:
[DEBUG-...] probes are removed.Run:
make lint && make test
Or language equivalents.
Loop back to Phase 2 if anything still fails.
FIX COMPLETE
============
Mode: standard | diagnose | team | diagnose+team
Issues found: X
Fixed: Y
Remaining: Z
Status: CLEAN | NEEDS ATTENTION
Root cause:
- <short verified cause>
Changes:
- file:line — fix
Verification:
- <command> — pass/fail
If unresolved, state the blocker and the exact artifact/access needed. Do not pretend clean.
tools
Idiomatic shell development for POSIX sh, Bash, Zsh, Fish, hooks, CI shell steps, and scriptable CLI glue. Use when writing or changing `.sh`, `.bash`, `.zsh`, `.fish`, `.bats`, shell functions, shell pipelines, or command-runner recipes. Emphasizes portability, quoting, safe filesystem/process handling, non-TUI CLI tools, ShellCheck, shfmt, Bats, and ShellSpec. NOT for Python, TypeScript, Go, web code, or infrastructure operations.
tools
Use when planning, executing, checkpointing, finishing, or inspecting lightweight spec-driven work. Runs one task at a time using `.spec/` markdown files and the bundled `specctl` helper. NOT for broad product discovery beyond a short requirement interview.
testing
Author, inspect, troubleshoot, and review infrastructure across IaC, Kubernetes, cloud resources, containers, CI/CD, and Linux hosts. Use when changing Terraform/OpenTofu, Kubernetes, Helm, Kustomize, Dockerfiles, GitHub Actions, AWS, GCP, Cloud Run, BigQuery, IAM, logs, instances, or service health. NOT for deploy/apply/rollback workflows (see deploying-infra). NOT for shell scripts or generic command pipelines (see writing-shell).
development
Configure safe git workflow hygiene: pre-commit/pre-push hooks, Gitleaks secret scanning, .gitignore rules, local git config, and guardrails. Use when setting up git hooks, gitleaks/git leaks, staged pre-commit checks, pre-push validation, core.hooksPath, .gitignore, or git config best practices. NOT for creating commits (use committing-code), cleaning branches/worktrees (use cleanup-git), or creating worktrees (use using-git-worktrees).