Skip to content
Development
Skill

/debug

Systematic debugging with hypothesis testing. Persistent across sessions.

From plugin
plan-build-run
1847 skills18 agents70 commands

Claude Code

$ npx -y skills add SienkLogic/plan-build-run --skill debug --agent claude-code

SKILL.md

debug.SKILL.md
name: debug
description: "Systematic debugging with hypothesis testing. Persistent across sessions."
allowed-tools: Read, Write, Edit, Bash, Glob, Grep, Task, AskUserQuestion
argument-hint: "[issue description]"

**STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes ~7,600 tokens. Begin executing Step 1 immediately.**

Step 0 — Immediate Output

**Before ANY tool calls**, display this banner:

╔══════════════════════════════════════════════════════════════╗
║  PLAN-BUILD-RUN ► DEBUGGING                                  ║
╚══════════════════════════════════════════════════════════════╝

Then proceed to Step 1.

/pbr:debug — Systematic Debugging

You are running the **debug** skill. Your job is to run a structured, hypothesis-driven debugging session that persists across conversations. You track every hypothesis, test, and finding in a debug file so work is never lost.

This skill **spawns Task(subagent_type: "pbr:debugger")** for investigation work.

---

References

  • `references/questioning.md` — Investigation questioning patterns: progressive depth, exploratory questions, concrete options (not open-ended)
  • `references/ui-brand.md` — Status symbols, banners, error boxes for issue reporting

---

Context Budget

Reference: `skills/shared/context-budget.md` for the universal orchestrator rules. Reference: `skills/shared/agent-type-resolution.md` for agent type fallback when spawning Task() subagents.

Additionally for this skill:

  • **Never** perform investigation work yourself — delegate ALL analysis to the debugger subagent
  • **Minimize** reading debug file content — read only the latest hypothesis and result section
  • **Delegate** all code reading, hypothesis testing, and fix attempts to the debugger subagent

---

Core Principle

**Debug systematically, not randomly.** Every investigation step must have a hypothesis, a test, and a recorded result. No "let me just try this" — every action has a reason and is documented.

---

Flow

Step 1: Ensure Debug Directory Exists

**CRITICAL (no hook) -- DO NOT SKIP: Create debug directory before any file writes.**

Before any file operations, ensure both directories exist by running:

mkdir -p .planning/debug

This handles the case where neither `.planning/` nor `.planning/debug/` exist yet (debug can be run before other skills that create `.planning/`). Do NOT skip this step — writing files to a non-existent directory will fail.

Step 2: Check for Active Debug Sessions

**Load depth profile:** Run `pbr-tools config resolve-depth` to get `debug.max_hypothesis_rounds`. If the command fails (no config.json or CLI error), default to 5 rounds. Initialize a round counter at 0. This counter increments each time a continuation debugger is spawned.

Scan `.planning/debug/` for existing debug files:

.planning/debug/
  {NNN}-{slug}.md     # Each debug session is a file

Read each file's frontmatter to check status:

  • `status: gathering` — collecting symptoms from user
  • `status: investigating` — testing hypotheses
  • `status: fixing` — applying fix
  • `status: verifying` — confirming fix works
  • `status: resolved` — session complete

**If active sessions found:**

**CRITICAL -- DO NOT SKIP**: Present the following choice to the user via AskUserQuestion before proceeding: Use the **debug-session-select** pattern from `skills/shared/gate-prompts.md`: question: "Found active debug sessions. Which would you like?"

Generate options dynamically from active sessions:

  • Each active session becomes an option: label "#{NNN}: {title}", description "Started {date}, last: {last hypothesis}"
  • Always include "New session" as the last option: description "Start a fresh debug investigation"
  • If more than 3 active sessions exist, show only the 3 most recent plus "New session" (max 4 options)

Handle responses:

  • If user selects an existing session: go to **Resume Flow** (Step 3b)
  • If user selects "New session": go to **New Session Flow** (Step 3a)
  • If user types a session number not in the list: look it up and resume it

**If no active sessions found:**

  • Go to **New Session Flow** (Step 3a)

Step 2b: UAT Gap Intake (conditional)

**Trigger:** If `$ARGUMENTS` contains `--from-uat`, OR if no arguments provided and UAT.md gaps exist for the current phase.

When triggered:

1. Read the current phase's VERIFICATION.md (or UAT.md if it exists):

  • Look for `status: gaps_found` in frontmatter
  • Parse the gaps section for individual gap entries

2. For each gap entry, extract:

  • Gap description (symptom)
  • Expected vs. actual behavior
  • Affected files/components

3. Pre-fill the debug session with UAT context:

  • **Issue title**: derived from the first/primary gap description
  • **Symptoms**: populated from gap details (expected, actual, scope)
  • **Category**: set to the gap's category if available (e.g., "test", "integration")
  • **Context**: include the phase context and related plan information

4. Skip the symptom-gathering questions in Step 3a (symptoms are already populated from UAT gaps) 5. Proceed directly to **Generate Session ID** and **Create Debug File** with the pre-filled data

**If `--from-uat` is specified but no gaps exist:**

  • Display: "No UAT/verification gaps found for the current phase. Starting a standard debug session."
  • Fall through to normal Step 3a flow

Step 3a: New Session Flow

Gather Symptoms

If `$ARGUMENTS` is provided and descriptive:

  • Use it as the initial issue description
  • Still ask targeted follow-up questions

If `$ARGUMENTS` is empty or minimal:

  • Ask the user for symptoms

**Symptom gathering questions** (ask as plain text — these are freeform, do NOT use AskUserQuestion):

1. **Expected behavior**: "What should happen?" 2. **Actual behavior**: "What actually happens? Include error messages if any." 3. **Reprodu

Read more
@sienklogic
Ships withplan-build-run

Plan it. Build it. Run it. A Claude Code plugin for structured development with context-engineered agents.

1847 skills18 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
18
Star history of SienkLogic/plan-build-run on GitHub, a chart by star-history.com

Other skills on plan-build-run.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about debug.

Which coding agents can use debug?
debug installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.