From draft
Runs structured debugging sessions: reproduces bugs, isolates failing code paths, tests hypotheses one at a time, fixes with approval, generates reports. For errors, crashes, stack traces.
npx claudepluginhub mayurpise/draft --plugin draftThis skill uses the workspace's default tool permissions.
You are conducting a structured debugging session following systematic investigation methodology.
Systematically debugs by tracing root causes with predictions before test-first fixes. Use for errors, test failures, GitHub/Linear/Jira issues, stack traces.
Guides root cause debugging for bugs, test failures, and unexpected behavior. Enforces reproduce-investigate-hypothesize-fix process with evidence before fixes. No guessing.
Orchestrates persistent, hypothesis-driven debugging sessions across conversations, delegating analysis to subagents and tracking in debug files.
Share bugs, ideas, or general feedback.
You are conducting a structured debugging session following systematic investigation methodology.
No fixes without root cause investigation first.
Before starting, capture the current git state:
git branch --show-current # Current branch name
git rev-parse --short HEAD # Current commit hash
Store this for the debug report header. The session is scoped to this specific branch/commit.
ls draft/ 2>/dev/null
Debug can run standalone (without draft context) or within a draft track. If draft/ exists, load context for richer investigation.
Read and follow the base procedure in core/shared/draft-context-loading.md.
Key context for debugging:
.ai-context.md — Module boundaries, data flows, invariants (crucial for tracing)tech-stack.md — Language-specific debugging tools and techniquesguardrails.md — Known anti-patterns that may be causing the issuedraft/graph/ (if available) — Load module-graph.jsonl for dependency context, hotspots.jsonl for complexity awareness. Use graph callers query to find all files that include a suspect file, and impact query to understand blast radius of potential fixes. See core/shared/graph-query.md.Check for arguments:
/draft:debug — Interactive: ask what's broken/draft:debug <description> — Start with the described problem/draft:debug track <id> — Debug within a specific track context (load spec.md, plan.md)/draft:debug <JIRA-KEY> — Pull context from Jira ticket via MCPIf a Jira ticket is provided:
get_issue(), get_issue_description(), get_issue_comments()curl/wget to fetch any URLs mentioned (dashboards, error pages, API responses)ssh to access log locations on remote nodes (if paths like /home/log/, node IPs mentioned)Goal: Confirm the bug exists and establish reproduction steps.
Reference core/agents/debugger.md Phase 1 for detailed investigation techniques.
Goal: Narrow the failure to a specific code path.
file:line references| Aspect | Working Case | Failing Case | Difference |
|---|
.ai-context.md module boundaries to scope the investigationReference core/agents/debugger.md Phase 2 for language-specific debugging techniques.
Goal: Confirm root cause with evidence.
file:line because [evidence]"| # | Hypothesis | Test | Prediction | Actual | Result |
|---|---|---|---|---|---|
| 1 | [description] | [test] | [expected] | [actual] | Confirmed/Rejected |
If hypothesis fails: Return to Step 3 with updated understanding. After 3 failed cycles, escalate (see Error Handling).
Reference core/agents/debugger.md Phase 3 and core/agents/rca.md for 5 Whys analysis.
Goal: Fix the root cause with minimal change.
STOP. Before writing any test:
ASK: "Root cause confirmed: [summary]. Want me to write a regression test for this fix? [Y/n]"
MANDATORY: Include YAML frontmatter with git metadata. Follow core/shared/git-report-metadata.md.
Include the report header table immediately after frontmatter:
| Field | Value |
|-------|-------|
| **Branch** | `{LOCAL_BRANCH}` → `{REMOTE/BRANCH}` |
| **Commit** | `{SHORT_SHA}` — {COMMIT_MESSAGE} |
| **Generated** | {ISO_TIMESTAMP} |
| **Synced To** | `{FULL_SHA}` |
Save to:
draft/tracks/<id>/debug-report.mddraft/debug-report-<timestamp>.md with symlink debug-report-latest.mdTIMESTAMP=$(date +%Y-%m-%dT%H%M)
# Example: draft/debug-report-2026-03-15T1430.md
ln -sf debug-report-${TIMESTAMP}.md draft/debug-report-latest.md
/draft:new-track (bug tracks — Offer tier), /draft:implement (blocked tasks — Offer tier)core/agents/rca.md) for 5 Whys and blast radius analysis/draft:new-track spec.md (reproduction and root cause sections via Detect+Auto-Feed)git bisect to find the exact commit that introduced this bug"/draft:new-track to create a bug fix track from these findings"core/shared/jira-sync.mdIf cannot reproduce: Gather more context — check environment differences, ask for additional logs, check if the issue is environment-specific.
If no draft context: Run standalone with generic debugging methodology. Recommend /draft:init for richer context.
After 3 failed hypothesis cycles: Document all findings, list what's been eliminated, escalate — consider architectural review or external input.
If MCP unavailable for Jira: Skip Jira context gathering, proceed with available information.