Automated summary
The /bugfix skill provides an autonomous pipeline to diagnose, plan, and fix software bugs without requiring user context-switching, automatically auditing existing specs and gathering git diff context.
Strengths
- Minimizes user interaction by autonomously diagnosing the root cause
- Integrates spec hygiene to keep project specs organized and up-to-date
- Uses git diff context to inform all subagent tasks for accurate fixes
- Supports both quick fast-path fixes and thorough full-path multi-file changes
Limitations
- Relies on a specific directory structure and custom scripts in .claude/
- Fast path skips detailed planning, which might overlook edge cases
- Only works within environments that support this custom pipeline (primarily Claude Code)
Use when encountering a bug and wanting a thorough, automated investigation and fix with minimal back-and-forth.
Avoid when the bug is trivial and can be fixed manually in seconds, or when you don't have the required pipeline infrastructure set up.
Security analysis
SafeThe skill only instructs running internal project scripts (node commands) and build tools; it doesn't call out to external malicious commands or exfiltrate data. The web search for documentation is standard and non-destructive. No destructive or obfuscated actions are present.
No concerns found
How this analysis is madeExamples
/bugfix TypeError: Cannot read properties of undefined (reading 'foo') in app/services/data.js/bugfix The test 'should return correct sum' fails with expected 5 but got 3/bugfix Module not found: Can't resolve './components/Button' in 'src/pages/index.js'/bugfix - Bug Fix Pipeline
ALWAYS before making any change. Search on the web for the newest documentation and only implement if you are 100% sure it will work.
Trigger
/bugfix <error-description>
Description
Autonomous pipeline to diagnose and fix bugs. Zero context-switch — never ask the user what can be discovered autonomously.
Procedure
Spec Hygiene (automatic, before ANALYZE)
Before starting a new pipeline, audit specs in active/:
- Scan all specs in
.claude/spec/active/*/spec.md - For each spec, read the full header and checklist to extract
Status:,Phase:, and checkbox completion ([x]vs[ ]) - Verify completed/cancelled specs before moving:
- If
Status: completedorStatus: cancelled:- Analyze first: check that ALL checklist items are
[x], no## Concernswith unresolvedBLOCKEDitems, and build/type-check references are satisfied - If analysis confirms done → move from
.claude/spec/active/{name}/to.claude/spec/completed/{name}/, delete.claude/.pipeline-states/{name}.jsonand.diff.mdif they exist, log:[HYGIENE] Verified and moved {name} → completed/ - If analysis finds incomplete items → update
Status: implementing, log:[HYGIENE] {name} marked completed but has {N} unchecked items — reverted to implementing, then treat as in-progress (step 4)
- Analyze first: check that ALL checklist items are
- If
- In-progress specs (
Status: draftorStatus: implementing):- Use
AskUserQuestion: "Found spec in progress: {name} (Status: {status}, Phase: {phase}, {done}/{total} tasks done). Do you want to continue this spec before starting a new one?" - If yes → stop, suggest
/resumeto continue the existing spec - If no → proceed to ANALYZE for the new pipeline (existing spec stays in
active/)
- Use
- No active specs → proceed to ANALYZE normally
This step is silent when there's nothing to audit — no output if active/ is empty.
ANALYZE (diagnose + assess)
- AUTO-SYNC: Run
node .claude/scripts/sync-detect.js. If output shows any subproject withhashChanged: true, then runnode .claude/scripts/sync-registry.js. Otherwise skip sync-registry entirely.
Diff Context (automatic)
Diff snapshot (run once per phase):
Run node .claude/scripts/diff-context.js at the start of ANALYZE and EXECUTE. Save the output to .claude/.pipeline-states/{specName}.diff.md (overwrite each phase).
Inject into every Task dispatch in this pipeline: Prepend the following to EVERY subagent prompt dispatched during the pipeline:
## Current Git State
{contents of .claude/.pipeline-states/{specName}.diff.md}
## Your Task
...original prompt...
If the diff file is empty or missing, skip the Git State header entirely. Never dispatch an agent without attempting interpolation.
- DIAGNOSE: Dispatch Explore agent (≤20 tool uses, ≤3 full file reads):
- Scoped Grep searches with specific path + pattern for the error/symptom
- Trace callers/callees via Grep in relevant directories (prefer Grep over Read)
- Return as soon as root cause is clear — don't exhaustively scan
- Return: root cause file(s), line(s), explanation
- ASSESS — Decision point:
- Explore returns clear root cause in 1-2 files → Fast Path (skip PLAN)
- 3+ files, unclear impact, cross-layer → Full Path (brief spec via PLAN)
Fast Path: Go directly to EXECUTE. No spec, no approval gate (Zero Context-Switch Protocol). If you want to review the fix plan before EXECUTE, force Full Path by listing >5 files in the ANALYZE return.
Full Path: Write brief spec in .claude/spec/active/{date}-{name}/spec.md, then present the full spec to the user before stopping:
-
Read the spec file just written and print its ENTIRE contents verbatim inside a fenced markdown block (
```markdown ... ```). Do NOT summarize — the user asked to read the complete plan before approving. -
After the fenced block, instruct: "Run
/approve(or/approve --resumeto chain inline) to proceed to EXECUTE." -
Fast Path CAN use Task(Explore) ONCE with ≤10 tool uses. Prefer Grep/Glob direct when the root cause location is known.
-
If >5 files surface during DIAGNOSE, RECLASSIFY to Full Path and write a spec before proceeding.
Spec Boundaries
When writing a Full Path spec (or noting files for Fast Path), record which files are in scope under a ## Boundaries section:
## Boundaries
- `path/to/directory/` — directory scope (all files within)
- `path/to/file.ext` — exact file
- `**/*.controller.ts` — glob pattern
Rules:
- List only files the fix intentionally touches (root cause + direct dependants)
- For Fast Path: boundaries are implicit from the ANALYZE output — no spec section required
- Out-of-boundary edits during EXECUTE will surface a
[BOUNDARY WARNING]from guard-verify — re-evaluate scope before proceeding
EXECUTE (fix + validate)
Every agent prompt dispatched in Fast Path MUST include:
Return format cap: ≤50 lines. Apply compact Return Format from .claude/pipeline-config.md strictly.
Dispatch bugfix agent with:
- Root cause from ANALYZE
{subproject}/CLAUDE.md+{subproject}/.claude/commands/guards.mdfor context- Specific files to modify
- Expected behavior after fix
Validate:
- Build check:
dotnet build/pnpm typecheck(as applicable) - Verify fix resolves the reported issue
- No regression in adjacent code
- If build fails: diagnose + fix (max 3 iterations)
Escalation Status Handling
After the bugfix agent returns, check for an escalation status before closing:
CONCERN— record verbatim in the bugfix report under## Concerns; continue to CLOSEBLOCKED— stop immediately; useAskUserQuestionto report the exact blocker; do NOT closePARTIAL— agent fixed some but not all reported issues; resume from the last incomplete fix step (max 2 retries)DEFERRED— agent intentionally left a related issue unfixed with justification; confirm with user before closing
See .claude/pipeline-config.md Escalation Statuses for the full status table.
Retry Compact Advisory
If an agent fails and requires >2 retry attempts during EXECUTE:
- Suggest to user: "Multiple retries detected — stale context may be contributing. Consider
/compactto clear context, then/resumeto continue the pipeline." - This is advisory only — continue fixing if user declines.
Failure Routing (Bugfix)
Before retrying a failed fix attempt, classify the failure:
- Transient? — Would re-running succeed without any change? (flaky test, cache, env) → Retry once immediately.
- Resolvable? — Is the fix clear and patchable in ≤3 lines without new reads? → Apply patch, retry (counts as retry 1).
- Structural? — Did the original ANALYZE misidentify the root cause? → Re-analyze: dispatch a focused Explore on the actual failure point, update root cause, re-dispatch bugfix agent. Does NOT count against the 2-retry cap.
Max 2 retries for Transient + Resolvable. Structural failures trigger a targeted re-ANALYZE, not a blind retry.
CLOSE
node .claude/scripts/sync-registry.js(if entities changed)- Output bugfix report (diagnosis, fix, validation)
Zero Context-Switch Protocol
- NEVER ask "can you show the error?" — find it via logs/Grep
- NEVER ask "which file?" — trace from the error
- NEVER ask "how to fix?" — propose + implement
- CI test fails: read → fix → re-run — without reporting and waiting
- MANDATORY: Follow Visual Output, Pipeline State, Task Tracking rules at each phase
ULTRATHINK
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/bugfix-bug-fix-pipeline-mrwakehe/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/bugfix-bug-fix-pipeline-mrwakehe' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/bugfix-bug-fix-pipeline-mrwakehe/download' --output '.skill-downloads/bugfix-bug-fix-pipeline-mrwakehe/SKILL.md.part' && mv '.skill-downloads/bugfix-bug-fix-pipeline-mrwakehe/SKILL.md.part' '.skill-downloads/bugfix-bug-fix-pipeline-mrwakehe/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
This file does not provide a usable name/description header for this native procedure. It remains available to download and inspect; use the manual method below.
Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/bugfix-bug-fix-pipeline-mrwakehe/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.