From claude-structure
Disciplined bug-fix workflow with TDD (diagnose → failing test → minimal fix → full verification). Forces root-cause analysis before writing code, eliminating "fix → fail → re-fix" cycles. Triggers on "fix the bug", "X is broken", "not working", "regression".
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-structure:bugfixThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Disciplined workflow for diagnosing and fixing bugs with TDD. Eliminates the "fix → fail → re-fix" cycle by forcing deep analysis before writing code.
Disciplined workflow for diagnosing and fixing bugs with TDD. Eliminates the "fix → fail → re-fix" cycle by forcing deep analysis before writing code.
When the user reports a bug, says "fix", "broken", "not working", "regression", or describes incorrect behavior.
Toolchain commands are parameterized via environment variables. Defaults assume a Node.js + TypeScript project; override them in CLAUDE.md or your shell:
| Variable | Default |
|---|---|
${TEST_CMD} | npx vitest run |
${TEST_ALL_CMD} | npm test |
${TYPECHECK_CMD} | npx tsc --noEmit |
${LINT_CMD} | npx eslint |
${FORMAT_CMD} | npx prettier --write |
Do NOT write any code yet.
Understand the bug: Read the user's report. If genuinely ambiguous (the symptom could mean two unrelated things), ask for one clarifying question. If the report is workable, proceed.
Locate the relevant code: Use Grep / Glob / Read to find the files involved. Do not assume — read the real code.
Trace the full chain: Follow the data flow from entry point to failure:
display, position, height, overflow, flex for every ancestor.Present the diagnosis inline and continue:
## Diagnosis
**Symptom**: [what the user sees]
**Root cause**: [the real cause, not the symptom]
**Why it happens**: [the causal chain]
**Affected files**: [list with paths]
### Evidence
- [line X of file Y does Z, but should do W]
The diagnosis is for the developer's awareness — Phase 2 starts immediately. The only thing that pauses the workflow is genuine ambiguity surfaced in step 1, or the bug turning out to require an architectural change (in which case escalate to spec-create).
${TEST_CMD} [test-file]
The test must fail for the right reason (the bug), not a setup error.
If a unit test is not possible (visual / CSS bug), document the manual reproduction steps instead.
${TEST_CMD} [test-file]
Run in order:
${TEST_ALL_CMD}
${TYPECHECK_CMD}
${LINT_CMD} [modified files]
${FORMAT_CMD} [modified files]
If anything fails, fix it before reporting.
## Bug Fix Complete
**Bug**: [short description]
**Root cause**: [what caused it]
**Fix**: [what changed and why]
### Modified files
- `path/file.ts`: [what changed]
### Tests
- [N] new, [M] total passing
- typecheck: OK | lint: OK | format: OK
### Regressions verified
- [list of existing tests that still pass]
overflow-hidden or max-height to mask a missing height constraint on an ancestor.fix(scope): description).npx claudepluginhub valdemird/claude-structure --plugin claude-structureGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.