/cf:fix [issue] --quick|--parallel|--from-debugfrom CafeKit
Fixes bugs, errors, test failures, CI/CD issues, type/lint errors, and UI problems using evidence-first diagnosis before any code change. Supports quick, standard, and incident-depth repair workflows.
Ships in CafeKit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Fix the diagnosed root cause, prove the fix with fresh evidence, and leave no side effects. Evidence first, fix second.
--quick - Reduced-depth path for trivial issues (lint, type errors, syntax); still scout-first--parallel - Fix independent issues concurrently, only through the Delegation Gate below--from-debug - Start from an existing cf:debug report and validate its contract before accepting itDefault: deterministic scout-first fix. There is no initial mode selection step.
Choose the smallest adequate depth from the diagnosed evidence. Depth vocabulary follows cf:debug:
HARD-GATE-RED-BEFORE-FIX) and passing after it.Depth changes evidence breadth, never the gates: scout, diagnosis, before/after proof, and the side-effect gate apply at every depth.
Quick/local does not add a separate framing ceremony when the issue and diagnosis already establish the repaired behavior and proof. For Standard or Incident/deep, or whenever scope or risk remains ambiguous after diagnosis, record four short fields before choosing an implementation:
Derive repository-owned facts from scout and diagnosis. Ask the user only for a missing user-owned decision that could materially change the repair. This frame does not select a solution, widen the issue into feature work, or run before the root cause is proven.
Do not propose or implement a fix before scout and diagnosis complete. A symptom patch without a diagnosed root cause is a failed fix. The exact root-cause contract under Diagnosis is mandatory; answer each field in one concrete sentence. An answer containing 'probably', 'I think', 'something with', or 'maybe' is not an answer; gather evidence instead. If 3+ fix attempts fail, stop, question the architecture, and discuss with the user. Fix always scouts before asking broad clarification questions, forming hypotheses, or changing files. Collect these scout outputs first: the project type, language(s), framework(s), and package/test runner from repo files; the exact file(s) where the symptom surfaces and their direct callers/dependents; related tests covering the affected area; recent commits touching affected files (`git log --oneline -10 -- `); and existing patterns/conventions for this kind of fix. Then state a concise 3-6 bullet codebase-context summary before diagnosis. Do not ask generic questions before this step unless there is no repo, no error text, and no observable artifact to inspect. Before the first change to any non-test file (an edit, a file write, or a shell command that rewrites it), run a test that fails on the unchanged code for the diagnosed reason, and keep its exact command and failing output for verification. For a lint, type, syntax, or build failure, the exact failing check run on the unchanged code stands in for the test. When no existing test fails for that reason, write or update the regression test first, then run it and see it fail. Red shown after the fact does not count: stashing, checking out, reverting, or editing the fix away to make the test fail is not pre-fix evidence. If no automated test or check can reproduce the failure, say so and keep the exact manual reproduction and its observed output instead. This applies at every depth. The fix is not done until verification proves: 1. The original symptom no longer reproduces with the exact pre-fix command/user flow. 2. Modified files and transitively affected modules still pass relevant tests. 3. Blast-radius workflows have no business-logic regression. 4. No new lint/type/build errors were introduced. 5. Public contracts are unchanged unless intentionally called out: function signatures, exported types, response shapes, DB schemas, env vars.If verification reveals a side effect or regression, stop and present 2-4 concrete options to the user:
Dispatch subagents (parallel scouts, hypothesis tests, deep research, or
--parallel fix trees) only when all three conditions hold:
Otherwise continue sequentially in the main agent with focused local evidence. Task-tracking tools are an optional visibility fallback, never a required step; a concise markdown checklist is always sufficient.
Scout. Map the blast radius before any hypothesis, with cf:scout or an equivalent focused local scout (rg plus targeted reads); scout depth follows the depth: Quick/local maps the project type, affected file(s), direct callers/dependents, related tests, and recent commits; Standard and deeper add module boundaries, test coverage, call chains, recent changes, and existing patterns; --parallel runs one independent scout per issue, only through the Delegation Gate.
Diagnosis. Evidence-based root cause analysis; no guessing. Fix applies the cf:debug-style evidence-first diagnosis inline via references/diagnosis-protocol.md, which holds the Fix-local checklist; calling cf:debug is optional, and --from-debug still validates a supplied report. Capture the pre-fix state first: exact error messages, failing test output, stack traces; this is the baseline for verification. When an existing test already fails for the diagnosed reason, its run belongs to this baseline; otherwise the regression test is written and seen failing at the start of implementation under HARD-GATE-RED-BEFORE-FIX. Locate where and when the failure started (git log -p), form 2-3 hypotheses each with confirm/refute evidence and a quick test, test them with focused local reads (in parallel only through the Delegation Gate), and trace symptom → immediate cause → contributing factor → root cause. If 2+ hypotheses fail, apply references/escalation-tactics.md.
Exact root-cause contract (field definitions in references/diagnosis-protocol.md; Expected and Actual may be one field): Symptom, Reproduction, Expected vs actual, Trigger, Root cause (file:line, config, environment, dependency, or data source), Contributing factors, Why now, Evidence chain, Blast radius.
unknownnone evidencedWith --from-debug, validate the report before accepting it:
**Depth:** is incident/deep, Evidence Timeline is present — a skipped timeline is valid in either producer form (Timeline: skipped - <reason> or - skipped: <reason>), as is one line naming the sources checked when none carries timestamps;**Depth:** is incident/deep, Elimination Path records the decisive observation for each removed or retained candidate;quick/local or standard report may omit both; a report with no **Depth:** line is treated as incident/deep;Recurrence-Prevention Handoff, when present, carries evidence-backed candidates only.A report missing required fields routes back to diagnosis (cf:debug); it does not enter implementation.
If any contract field is vague or missing file:line/config/env evidence, keep diagnosing or ask the user for the specific missing artifact. Do not implement.
Depth and frame. Apply the Proportional depth rule above. For 2+ independent issues (or --parallel), evaluate the Delegation Gate; when it is closed, fix the issues sequentially. Track progress with the runtime's task surface when available, or a markdown checklist otherwise. For Standard and Incident/deep, complete the bounded repair frame above. Quick records no separate frame unless scope or risk is still ambiguous.
Implementation. Fix the root cause, not the symptom. Follow diagnosis findings. Minimal changes only; follow existing code patterns. One logical change per commit boundary.
HARD-GATE-RED-BEFORE-FIX, apply the minimal fix from completed scout + diagnosis, run the exact pre-fix command plus typecheck/lint immediately, report before/after proof.HARD-GATE-RED-BEFORE-FIX), then implement the fix, rerun the same test to see it pass, and run the relevant suite.cf:brainstorm to compare 2-3 options against the bounded repair frame, then write a concise staged implementation plan with dependencies and proof per stage. When diagnosis leaves one safe direct repair, skip research and brainstorm, record why it satisfies the frame, and implement it. Delegated research follows the Delegation Gate; implementation starts only after the direction is resolved.Verification and prevention. Iron-law verification: run the exact commands from the pre-fix state capture and compare output. No claims without fresh command output from the current run. The regression proof is the failing run kept under HARD-GATE-RED-BEFORE-FIX and a passing run of the same test after the fix. Full check: typecheck + lint + build + test (see references/parallel-patterns.md Pattern C). Prevention guard (Standard+): see references/prevention-gate.md; consume the debug report's recurrence candidates when present. Side-effect gate: sweep the full blast radius from diagnosis against the five checks in the gate above. Review: trigger cf:code-review; see references/review-cycle.md.
Verification and review report PASS | PASS_WITH_WARNINGS | FAIL | BLOCKED. The definition of PASS defers to cf:code-review. PASS_WITH_WARNINGS routes through the same remediation or user-pause path as FAIL and never auto-accepts. BLOCKED is terminal for the cycle; resolve the blocker instead of retrying. A review-only result is not execution proof; completion claims require fresh command output.
If verification fails: under 3 attempts, return to diagnosis with the new evidence; at 3+ attempts, stop and discuss with the user. Never weaken, delete, or mock a failing assertion to obtain green.
Finalize. If API or behavior changed, update only the affected existing docs through the docs flow. Ask the user before committing; use conventional commits. Inside a vibe run, the vibe-run exception in the state-sync rule applies.
Report: root cause, changes made, files affected, before/after proof, prevention measures, side-effect sweep result, and any remaining limitations.
Use references/workflow-specialized.md as a progressively disclosed overlay after scout for CI/CD failures, test suite failures, TypeScript type errors, UI/visual issues, and application log errors. Load only the matching section. Specialized paths add category-specific evidence and proof; they do not replace these standards, weaken diagnosis, or broaden the repair scope.
Load as needed:
references/diagnosis-protocol.md — Structured root cause analysis and the exact root-cause contractreferences/escalation-tactics.md — What to do when hypotheses fail (Inversion, Scale Game)references/prevention-gate.md — Defense-in-depth validation after fixreferences/review-cycle.md — Review verdict handling and required user-pause conditionsreferences/parallel-patterns.md — Delegation Gate patterns for parallel workreferences/workflow-specialized.md — CI/CD, test, TypeScript, UI-specific workflowsreferences/diagnosis-protocol.md (opens in a new tab)references/escalation-tactics.md (opens in a new tab)references/parallel-patterns.md (opens in a new tab)references/prevention-gate.md (opens in a new tab)references/review-cycle.md (opens in a new tab)references/workflow-specialized.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Invoke to fix a bug or failure with scout-first diagnosis before change.
Three short reads, in order
npx claudepluginhub haposoft/cafekit --plugin cf18 skills in this plugin
/advcf:advInterview until the user and the agent hold the same picture of the outcome, preview it, then deliver honest evidence-backed advice. It writes only its own reports and previews and never implements what it advises./agent-browsercf:agent-browserAI-optimized browser automation CLI with context-efficient snapshots. Use for long autonomous sessions, self-verifying workflows, video recording, and cloud browser testing (Browserbase)./askcf:askAnswer questions with evidence. Use when the user asks about project behavior, source code, specs, docs, configuration, dependencies, or external technical information; inspect the repo first, use internet/current docs when repo evidence is insufficient, and ask back only when the question cannot be answered safely./brainstormcf:brainstormShape an unsettled piece of work into a decided one before anyone builds it. Use when the outcome is already agreed but two or more approaches would each satisfy it with meaningfully different consequences — setup cost, migration, failure behaviour, who carries the work afterwards; use it too when an idea still wants exploring, or when only one approach is viable but the contract and the candidate design still need a decision. It weighs viable approaches against a bounded contract of Outcome, Constraints, Non-goals and Acceptance, records what was chosen and what was rejected and why, and stops there; it writes no code and carries nothing onward by itself. Skip it for a direct factual answer, skip it for a bug or failure that still needs its root cause, and skip it when the request needs a plan and its tasks rather than a choice between designs./code-reviewcf:code-reviewReview a change for correctness, security, and specification compliance without owning execution proof./debugcf:debugUse before fixing any bug, failing test, CI/CD failure, production incident, performance issue, UI regression, flaky test, or unexpected behavior. Diagnostic-only root-cause workflow with evidence, hypotheses, blast-radius mapping, and verification plan.Other plugins' skills for the same job