debug-phase

A structured method for investigating software errors, finding their underlying causes, fixing them, and recording what happened.

In plain words
What is it for?
Use it to debug syntax, runtime, logic, integration, or performance problems, search past entries in error-log.md, write a failing test first, and document the result.
Why use it?
It replaces trial-and-error fixes with repeatable reproduction, classification, root-cause analysis, and regression testing.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/marcusgoll/spec-flow/debug-phase
Any agent
npx skills add marcusgoll/Spec-Flow --skill debug-phase
Clone the repo
git clone --depth 1 https://github.com/marcusgoll/Spec-Flow

Made for: Claude Code, Codex.

Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,846 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00052 $0.03846
Opus 5 $0.00026 $0.01923
Sonnet 5 $0.00010 $0.00769
Haiku 4.5 $0.00005 $0.00385

Measured 2d ago against content hash 562190153644, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug-phase scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -X POST http://localhost:3000/api/endpoint \
.claude/skills/debug-phase/SKILL.md · 579 lines

How it starts

The opening of the file, as written. The whole thing — 579 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<quick_start> Debug errors systematically:

  1. Reproduce error consistently (100% reliable reproduction)
  2. Classify by type (syntax/runtime/logic/integration/performance) and severity (critical/high/medium/low)
  3. Isolate root cause using binary search, logging, breakpoints, or 5 Whys
  4. Implement fix with failing test first (TDD)
  5. Add regression tests to prevent recurrence
  6. Document in error-log.md with ERR-XXXX ID

Key principle: Fix root causes, not symptoms. Use 5 Whys to drill down. </quick_start>

Check error-log.md for similar historical errors before starting.

Check error-log.md for past occurrences:

# Search by error message
grep -i "connection timeout" error-log.md

# Search by component
grep "Component: StudentProgressService" error-log.md

# Search by error type
grep "Type: Integration" error-log.md

If similar error found:

  • Review previous fix (workaround or root cause?)
  • Check if error recurred (>2 occurrences = need permanent fix)
  • Note patterns (same component, same conditions, timing)

If recurring error: Prioritize permanent fix over workaround.

Create minimal reproduction:

  1. Gather context: error message, stack trace, timestamp, user actions, environment
  2. Create minimal test case that triggers error 100% of time
  3. If intermittent: identify conditions (timing, data state, race conditions)

Example reproduction:

# API error
curl -X POST http://localhost:3000/api/endpoint \
  -H "Content-Type: application/json" \
  -d '{"field": "value"}'

# Frontend error
# 1. Navigate to /dashboard
# 2. Click "Load Data" button
# 3. Error appears in console

Validation: Can trigger error reliably before proceeding.

By type:

  • Syntax: Code doesn't compile/parse (typos, missing brackets, linting errors)
  • Runtime: Code runs but crashes (null pointer, type error, uncaught exception)
  • Logic: Code runs but wrong result (calculation error, wrong branch taken)
  • Integration: External dependency fails (API timeout, database connection, service unavailable)
  • Performance: Code works but too slow (timeout, memory leak, N+1 queries)

By severity:

  • Critical: Data loss, security breach, total system failure
  • High: Feature broken, blocks users from core functionality
  • Medium: Feature degraded, workaround exists
  • Low: Minor UX issue, cosmetic, no functional impact

Example classification:

Type: Integration (API call to external service fails)
Severity: High (dashboard doesn't load, blocks teachers)
Component: StudentProgressService.fetchExternalData()
Frequency: 30% of requests (intermittent)

See references/error-classification.md for detailed matrix.

Use systematic techniques:

Binary search (for large codebases):

  • Add logging at midpoint of suspected code
  • If error before midpoint → investigate first half
  • If error after midpoint → investigate second half
  • Repeat until narrowed to specific function

Increase logging:

# Add debug logs around suspected area
logger.debug(f"Before API call: student_id={student_id}, params={params}")
response = api.fetch_data(student_id)
logger.debug(f"After API call: status={response.status}, data_len={len(response.data)}")

Use breakpoints (interactive debugging):

Read the full file on GitHub · 579 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 579 lines · 52 tokens per session scan A 562190153644

Subscribe to this mod's changes

debug-phase is a skill published in the GitHub repository marcusgoll/Spec-Flow (91 stars, last pushed 4mo ago), licensed MIT. It adds 52 tokens to every session and 3,846 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.