triage-issue
Bug investigation -> root cause -> issue file with TDD fix plan. Parallel track to the feature pipeline -- for defects, not capabilities.
Output: ./issues/bugs/<slug>.md
Starting
Accept the bug report -- symptom, error message, repro steps, or just "X is broken."
Before asking anything:
- Parse symptom & locate code. Extract what's broken, error messages, affected area. Search for error messages in source, find relevant handlers/components and test files.
- Trace the code path. From entry point through to failure. Read each file in the path.
- Check history & tests.
git log --oneline -20 -- <affected-files>for recent changes. Find test files covering the path -- do they exist? Do they cover the failing case? - Check related work. Search for TODO/FIXME/HACK near affected code. Check
./issues/for related open work.
Present findings before asking anything:
I've traced the issue. [Symptom] originates in
[file]at[function/line]. Recent changes by[commit]modified this path. Here's what I found: [diagnosis].
Confirm via AskUserQuestion:
- "Correct -- write the issue (Recommended)"
- "Partially right -- let me clarify"
- "Wrong -- let me redirect you"
Investigation
Investigation-first, interview-light. The codebase is the primary witness; the user confirms or redirects.
Work through sequentially:
- Symptom mapping -- Map observable broken behavior to code location. Search error messages verbatim.
- Code path tracing -- Read execution path from trigger to failure. Identify where expected diverges from actual.
- Root cause isolation -- Distinguish symptom from cause. Trace upstream until you find the originating defect.
- Blast radius -- What else does this code path affect? Other callers? Could the fix have side effects?
- Fix feasibility -- Localized (1-3 files) or systemic? Needs new tests, migration, or behavioral changes?
Minimize questions. Ask only when repro is ambiguous, root cause has equally plausible explanations, expected behavior is genuinely unclear, or environment factors can't be determined from code.
Use AskUserQuestion for every question (see CLAUDE.md conventions). Max 3 questions total.
Classification
After investigation, classify:
Bug -- Code doesn't do what it was designed to do (tests should catch it but don't, behavior contradicts docs, recent regression). Create issue file with TDD fix plan.
Missing feature (simple) -- Behavior never built but fix is localized (1-3 files, clear pattern). Create issue file noting this is net-new behavior, not a regression.
Missing feature (complex) -- New capability, multiple files, design decisions needed. Redirect: "This looks like a missing feature rather than a bug -- [explanation]. I'd recommend /scope to scope it properly. Reference ./issues/bugs/<slug>.md for my investigation findings."
Systemic -- Root cause is architectural, fix requires new patterns or touches 8+ files. Redirect: "The root cause is systemic: [explanation]. A point fix would be fragile. I'd recommend /engineering — reference ./issues/bugs/<slug>.md for my investigation findings." Create lightweight issue with investigation findings.
Issue Output
Save to ./issues/bugs/<slug>.md using the template in assets/bug-issue-template.md. Kebab-case slug from symptom (e.g., login-timeout-on-slow-networks.md).
After writing: "Issue saved to ./issues/bugs/<slug>.md. Fix plan starts with a failing test in <test-file>. Hand to an agent or start with the test."
Answer follow-ups about root cause or fix approach. If user wants to expand scope: "That's beyond a bug fix -- run /engineering with this issue as context."
Scope Guards
- One bug per invocation. Multiple bugs? Triage the first, then: "Describe the next bug and I'll triage it separately."
- Don't design solutions. Fix plan is tactical -- minimal change to correct the defect.
- Don't implement the fix. Output is the issue file, not the code change.
- Feature request → "This is new behavior, not a bug. Run
/scope." - Systemic issue → "This needs a design. Run
/engineering." Create lightweight issue with findings. - Vague report, no repro → ask for repro steps. If unavailable, create lightweight issue marked "needs-reproduction."
More from michaelmerrill/skills
design
Design specification interview → standalone spec.md (flows, screens, states, components, responsive, a11y). Triggers: 'design this,' 'what screens,' 'how should users interact,' post-product. Not for: technical design (engineering), requirements (product). Skip for API-only, CLI, backend, or infra features.
8plan
Decompose technical design into agent-sized implementation issues → numbered markdown files + standalone plan.md. Triggers: 'plan this,' 'break into issues,' 'create tasks,' 'ready to implement,' post-engineering. Not for: designs without file paths/phases (run engineering first).
7design-ux
MUST USE when a user wants to design user flows, interaction patterns, or screen-level UX for a feature that has defined requirements. This is the UX design step in the planning pipeline (write-a-prd → review-prd → glossary → design-ux → design-feature → review-plan). Typical signals — "design the UX," "how should users interact with this," "what should the UI look like," "design the flows," "design-ux," "what screens do we need," or following up after a review-prd or glossary session. Also applies when the user has a PRD and wants to figure out the user experience before technical design. Conducts a structured interview to produce a UX specification — user flows, screen inventory, component mapping, interaction specs, and accessibility requirements. Do NOT use for technical design (use design-feature), writing requirements (use write-a-prd), reviewing plans (use review-plan), scoping/feasibility (use plan-feature), or when the feature has no user-facing UI (API-only, backend, CLI tools).
6plan-feature
Scoping interview for new features -> scope doc with go/no-go. Triggers: user wants to add/build/implement any new capability. First pipeline step. Not for: bugs, PRDs (write-a-prd), design (design-feature), executing existing specs.
6define
Product requirements → living doc Requirements section + quality gate + domain glossary. Stateful: detects existing sections and resumes where needed. Triggers: 'define this,' 'write a PRD,' 'define requirements,' 'spec this out,' post-explore. Not for: scoping (explore), UX (design), technical design (architect).
5explore
Scope and assess new feature ideas → living doc with go/no-go. Elaborates vague ideas into clear concepts. First pipeline step. Triggers: user wants to add/build/implement any new capability. Not for: bugs (triage-issue), requirements (define), design (design/architect).
5