From sdd
Spec-first bugfix skill: reproduces symptom, triages as regression/spec-bug/gap, writes failing test, applies minimal fix, updates spec. Activates on 'fix {bug}' and similar phrases.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sdd:fixopusThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The **bugfix entry point** — the backbone in miniature, sized for «it's broken», not «build a feature». A bug is treated as **evidence about the spec**, not only about the code: either an acceptance criterion is violated (the code regressed), the AC was ambiguous enough to permit the behaviour (the spec is the root cause), or nothing covers it (a gap). So the fix always lands in two places — th...
The bugfix entry point — the backbone in miniature, sized for «it's broken», not «build a feature». A bug is treated as evidence about the spec, not only about the code: either an acceptance criterion is violated (the code regressed), the AC was ambiguous enough to permit the behaviour (the spec is the root cause), or nothing covers it (a gap). So the fix always lands in two places — the code (RED → GREEN through the same gate implement runs) and the spec (a surgical AC patch) — tied together by a small fix record.
This skill keeps only its own machinery. Question phrasing → ../_shared/ask-style.md; RED-classification semantics → ../implement/references/tdd-loop.md (reused, never duplicated); dispatch policy → ../_shared/agent-roster.md.
The engineer on the bug (drives). PM / Tech Lead is consulted only when triage lands on «spec-bug» or «gap» — changing an AC is a product decision, not a code one.
<slug> — optional; pass it when you know which feature owns the bug, otherwise step 2 finds it from the symptom.docs/features/ with ≥1 spec.md. Absent (a brownfield repo that never ran the backbone) → still run, in no-spec mode: steps 1 → 3 → 4 → record, skip the spec patch, and recommend /sdd:survey in the handoff..claude/sdd.local.md — gate command overrides; otherwise the commands are detected per implement's cascade.No depth dial and no .size here — a fix is one size, and the interview is the bug report itself.
AskUserQuestion (phrasing per ../_shared/ask-style.md), only for what the report doesn't already say: expected vs actual, the steps, the scope (one user? all? since when?). Outcome: a one-line reproduction statement — «doing X, expected Y, got Z». A bug you can't state this way isn't ready to fix.docs/features/*/spec.md (+ the candidate slug's _fixes/ for a recurrence) for the reproduction's domain terms; locate the owning slug and the closest §5 AC. In parallel, dispatch explorer — subagent_type: "sdd:explorer" (fallback Explore / inline per ../_shared/agent-roster.md) — to localize the code path. Three outcomes (decision table → ./references/triage.md):
<!-- added-by-fix: <date> -->.docs/features/ (or no spec plausibly owns the symptom): skip the spec patch, say so in the record, recommend survey.../implement/references/tdd-loop.md — it must be a GOOD red (fails on the assertion that encodes the expected behaviour); quote the failing line. A bug that can't be pinned by a test → STOP and say so — an unverifiable fix is a guess.implement runs: unit + lint + vet (+ integration when available), via the detected commands (detection cascade → ../implement/references/command-detection.md). Red gate → fix it, never commit around it.AskUserQuestion (before/after wording shown). Then write docs/features/<slug>/_fixes/<date>-<short-slug>.md from ./templates/fix-record.md: symptom → root cause → the pinning test → the spec patch (or why there is none).fix: <slug> <short summary> with trailers SDD-Fix: <date>-<short-slug> and SDD-AC: <id> (when an AC was traced). Then emit the stage-handoff block per ../_shared/handoff.md (utility variant — /clear optional): What I did + Review (the diff, _fixes/<date>-<short-slug>.md, the spec patch if any) + Run next: resume what you were doing; when the fix touched >5 files or crossed a module boundary, recommend /sdd:review <slug> — a recommendation, not a gate.docs/features/<slug>/_fixes/<date>-<short-slug>.md exists: symptom, root cause, the test, the spec patch, follow-ups.SDD-Fix: trailer (+ SDD-AC: when traced); any spec change was user-confirmed.survey, never block._fixes/ shows the same symptom was fixed before. That's a recurrence — read the old record and strengthen its test instead../references/triage.md — the symptom→spec trace: grep strategy, the regression / spec-bug / gap decision table, the added-by-fix marker, no-spec mode, the recurrence check../templates/fix-record.md — the fix-record scaffold (symptom → root cause → pinning test → spec patch → follow-ups).../implement/references/tdd-loop.md — RED classification (GOOD red / BAD red / false-pass) — the semantics step 3 reuses.../implement/references/command-detection.md — how the step-4 gate commands are resolved (settings override → Makefile → package scripts → language manifests).../_shared/ask-style.md · ../_shared/agent-roster.md · ../_shared/handoff.md.User: «/sdd:fix — discounts are applied twice when the user clicks pay twice fast» Skill: intake confirms: expected one discount per order, got two on a double-click (all users, since the checkout-discounts release). Trace:
docs/features/checkout-discounts/spec.mdAC-04 says «a discount is applied to an order at most once» → the code violates it → regression.explorerlocalizes the apply-discount handler (no idempotency check). RED: an integration test posting the same apply twice asserts one discount row — fails withgot 2, want 1(GOOD red). GREEN: guard on the existing uniqueness key; gate clean. Spec: nothing to patch (AC-04 was right). Record_fixes/2026-06-12-double-discount.md; commitfix: checkout-discounts double-applied discount+SDD-Fix:/SDD-AC: AC-04trailers. Handoff: 2 files touched → no review push; resume.
npx claudepluginhub genkovich/sdd --plugin sddStep-by-step bug fix workflow: diagnose root cause, implement minimal fix, write regression test. Use when fixing bugs or working on bug report issues.
Diagnoses and fixes bugs using a test-first workflow: reproduce with a failing test, diagnose root cause, then fix. Activates on bug reports, unexpected behavior, or defect investigations.
Fixes bugs using test-first loop: add minimal failing reproduction test, apply smallest fix to affected module, verify full test suite and linters. Use for reported bugs needing verified low-impact fixes.