/cf-fix
High>2.5K tokens injected into promptQuick bug fix workflow with problem verification.
Context footprint: ⚡⚡⚡ (high) — what does this mean?
The /cf-fix skill streamlines bug fixing by verifying the problem exists, exploring the codebase for context, confirming your approach, implementing a fix with tests, and verifying the solution works.
Usage
/cf-fix [bug description]
Workflow
- Understand the Bug — Read the error or bug description. If vague, asks clarifying questions: what did you expect? what happened instead?
- Verify Problem — Run the failing test or command to reproduce the bug. If no test exists, writes one that demonstrates the failure
- Recall Past Bugs + Explore Code — Searches
docs/memory/bugs/for related past bugs via frontmatter grep, then launches thecf-exploreragent to trace the code path - Locate Root Cause — Traces backward from where the error appears to where it originates. States a hypothesis before fixing
- Confirm Approach — Explains the root cause and proposed fix. Asks for your input if uncertain
- Implement Fix — Dispatches the
cf-implementeragent with strict TDD discipline: write a failing regression test first, then fix the root cause - Verify Results + Retry — Parses the implementer's result signal. On success, confirms the fix addresses the root cause. On failure, retries once with error context. If both attempts fail, escalates to user
- Save Bug Knowledge — If the fix required more than 1 attempt, documents the bug (symptom, root cause, fix, prevention) to
docs/memory/bugs/viacf-writeragent with frontmatter for future recall - Auto-Review — Automatically runs
/cf-reviewafter the fix is verified
Example
/cf-fix Login fails with 401 error when auth token expires
The skill will:
- Reproduce the 401 error with an expired token
- Launch
cf-explorerto trace the auth code path - Identify the root cause (e.g., missing token refresh logic)
- Confirm the fix approach with you
- Dispatch
cf-implementerto write a regression test and implement the fix - Run full test suite to verify no regressions
Quick Checks
Before diving deep, the skill tries these common causes first:
- Typo in variable/function name? Check spelling
- Wrong import path? Check relative vs absolute
- Stale cache/build? Clean and rebuild
- Missing dependency? Check package.json/requirements
- Environment mismatch? Check env vars, node version, etc.
Key Features
- Bug Memory Recall — Searches past bug docs before investigating, leveraging previously solved issues
- TDD Integration — Enforces test-first approach for bug fixes
- Regression Prevention — Runs existing tests to catch side effects
- Knowledge Capture — Non-trivial bugs (multiple attempts) are documented for future reference
- Learn Prompt — After 2 failed attempts, suggests
/cf-learnto capture debugging insights before continuing - Minimal Changes — Focuses on surgical fixes, not rewrites
- Custom Guides — Extend behavior via
.coding-friend/skills/cf-fix-custom/SKILL.md
Escalation
If the bug persists after 2 fix attempts, the skill suggests running /cf-learn to capture debugging insights before the 3rd attempt — so the knowledge gained from investigation isn't lost.
If the bug persists after 3 fix attempts, the skill stops and escalates to the full cf-sys-debug 5-phase diagnostic process — the bug is likely deeper than expected.
When to Use
- Production bugs affecting users
- Flaky tests that fail intermittently
- Unexpected behavior in existing features
- Performance regressions
Output
Fixes include:
- Regression test demonstrating the bug
- Source code changes with comments explaining why
- Test report showing no regressions
Recommended Workflow
After the fix is verified, /cf-review runs automatically:
/cf-fix → (auto) /cf-review → /cf-commit