triage-issue
Triage Issue
Investigate a reported problem, find its root cause, and create a markdown issue document with a TDD fix plan. This is a mostly hands-off workflow - minimize questions to the user.
Process
1. Capture the problem
Get a brief description of the issue from the user. If they haven't provided one, ask ONE question: "What's the problem you're seeing?" The user may also provide a Linear issue link, Notion document, or other external reference.
2. Gather external context
If the user provided references to external tools, use the available MCP tools to pull in context before investigating:
- Linear: The user may provide a ticket code (e.g.,
EO-1234) or a URL. Fetch issue details, comments, and status to understand the reported problem, reproduction steps, and any prior triage. - Notion: The user may provide a page title or a URL. Search Notion by title if no URL is given. Fetch documents for related specs or incident notes.
Use this context alongside the user's description. If no external references are provided, skip this step. Do NOT ask follow-up questions — start investigating immediately.
3. Explore and diagnose
Use the Agent tool with subagent_type=Explore to deeply investigate the codebase. Your goal is to find:
- Where the bug manifests (entry points, UI, API responses)
- What code path is involved (trace the flow)
- Why it fails (the root cause, not just the symptom)
- What related code exists (similar patterns, tests, adjacent modules)
Look at:
- Related source files and their dependencies
- Existing tests (what's tested, what's missing)
- Recent changes to affected files (
git logon relevant files) - Error handling in the code path
- Similar patterns elsewhere in the codebase that work correctly
4. Identify the fix approach
Based on your investigation, determine:
- The minimal change needed to fix the root cause
- Which modules/interfaces are affected
- What behaviors need to be verified via tests
- Whether this is a regression, missing feature, or design flaw
5. Design TDD fix plan
Create a concrete, ordered list of RED-GREEN cycles. Each cycle is one vertical slice:
- RED: Describe a specific test that captures the broken/missing behavior
- GREEN: Describe the minimal code change to make that test pass
Rules:
- Tests verify behavior through public interfaces, not implementation details
- One test at a time, vertical slices (NOT all tests first, then all code)
- Each test should survive internal refactors
- Include a final refactor step if needed
- Durability: Only suggest fixes that would survive radical codebase changes. Describe behaviors and contracts, not internal structure. Tests assert on observable outcomes (API responses, UI state, user-visible effects), not internal state. A good suggestion reads like a spec; a bad one reads like a diff.
6. Create the issue document
Ask the user where they'd like this saved. Common destinations:
- GitHub Issue: create it directly with
gh issue create - Local file: save to a path of the user's choice
- Linear: create via Linear MCP tools if available
- Notion / Confluence: create a page via MCP tools if available
Use the template below. Do NOT ask the user to review before creating — just create it and share the link or path.
Problem
A clear description of the bug or issue, including:
- What happens (actual behavior)
- What should happen (expected behavior)
- How to reproduce (if applicable)
Root Cause Analysis
Describe what you found during investigation:
- The code path involved
- Why the current code fails
- Any contributing factors
Do NOT include specific file paths, line numbers, or implementation details that couple to current code layout. Describe modules, behaviors, and contracts instead. The issue should remain useful even after major refactors.
TDD Fix Plan
A numbered list of RED-GREEN cycles:
-
RED: Write a test that [describes expected behavior] GREEN: [Minimal change to make it pass]
-
RED: Write a test that [describes next behavior] GREEN: [Minimal change to make it pass]
...
REFACTOR: [Any cleanup needed after all tests pass]
Acceptance Criteria
- Criterion 1
- Criterion 2
- All new tests pass
- Existing tests still pass
After creating the document, print the file path and a one-line summary of the root cause.
More from evans-sam/skills
grill-me
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
15prd-to-issues
Turn a PRD into independent ticket artifacts — GitHub issues, Linear tickets, local files, or Notion pages — with HITL/AFK tags and dependency links. Each ticket is a tracer-bullet vertical slice. Use when user wants to produce standalone work items from a PRD. Not for a live feature-building workflow.
12write-a-prd
Create a PRD through user interview, codebase exploration, and module design, then save as a local markdown document. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.
12request-refactor-plan
Create a detailed refactor plan with tiny commits via user interview, then save it as a local markdown RFC document. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.
12git-guardrails-claude-code
Set up Claude Code hooks to block dangerous git and gh CLI commands before they execute. Use when user wants to prevent destructive git operations, block dangerous GitHub CLI actions (repo delete, pr merge, secret management, API mutations), or add git/gh safety hooks to Claude Code.
12ubiquitous-language
Extract a DDD-style ubiquitous language glossary from the current conversation, flagging ambiguities and proposing canonical terms. Saves to UBIQUITOUS_LANGUAGE.md. Use when user wants to define domain terms, build a glossary, harden terminology, create a ubiquitous language, or mentions "domain model" or "DDD".
11