spec-debug

spec-debug is a command for Claude Code from ronronner02/codepilot-agent. It costs 7 tokens per session (8,340 once invoked), scanned B, original, MIT.

A command for running a specification-first debugging workflow. The description does not explain the workflow's individual steps.

In plain words
What is it for?
Starting the Spec-First debug workflow.
Why use it?
It provides a named debugging process, but there is not enough information to say which problems it addresses.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions CLAUDE.md; names the AskUserQuestion tool; mentions Claude Code.

Good fit Starting the Spec-First debug workflow.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/ronronner02/codepilot-agent/spec-debug
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.

Clone the repo
git clone --depth 1 https://github.com/ronronner02/codepilot-agent

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spec-debug

README.md
[![agentmods](https://agentmods.dev/badge/commands/ronronner02/codepilot-agent/spec-debug/github.svg)](https://agentmods.dev/commands/ronronner02/codepilot-agent/spec-debug)
Your own site
<a href="https://agentmods.dev/commands/ronronner02/codepilot-agent/spec-debug"><img src="https://agentmods.dev/badge/commands/ronronner02/codepilot-agent/spec-debug/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for spec-debug

Your own site · 80×15
<a href="https://agentmods.dev/commands/ronronner02/codepilot-agent/spec-debug"><img src="https://agentmods.dev/badge/commands/ronronner02/codepilot-agent/spec-debug.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 8,340 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00007 $0.08340
Opus 5.5 $0.00003 $0.03336
Sonnet 5.5 $0.00001 $0.01668
Haiku 4.5 $0.00001 $0.00834

Measured 1mo ago against content hash f4a24dc61ae5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

spec-debug scanned grade B 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 1mo 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

**Conditional defense-in-depth** (trigger: grep for the root-cause pattern found it in 3+ other files, OR the bug would have been catastrophic if it reached production): Read `.claude/spec-first/workflows/spec-debug/refe
.claude/commands/spec-debug.md · 395 lines

How it starts

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

Command support root: .claude/spec-first/workflows/spec-debug. Treat it as the loaded skill directory whenever this inlined workflow refers to SKILL_DIR or the directory containing SKILL.md.

Debug and Fix

Find root causes, then fix them. This skill investigates bugs systematically — tracing the full causal chain before proposing a fix — and optionally implements the fix with test-first discipline.

Workflow Contract Summary

  • 输入: 可复现的失败、错误、回归、stack trace、issue 或明确异常行为。
  • 输出: 证据闭合的 causal chain、最小修复、回归验证与结构化 handoff;若未授权修复则只返回诊断。
  • 硬出口: 无法复现且缺 replacement evidence、因果链仍有未验证跳步、target repo/source owner/dirty overlap 未解决,或 required verification 失败时不得声明 root cause/fix complete。
  • 权威: 运行时复现、source、test 与 log 提供事实;LLM 判断因果充分性;诊断、local mutation、commit 与 landing 分别授权。
  • 消费者: 用户、spec-work、spec-code-review、issue/PR owner 与后续知识沉淀流程。

<bug_description> # </bug_description>

Mode

The default mode is interactive. Investigate, present the causal chain, and use the Phase 2 fix-choice gate and Phase 4 handoff as written below.

When the invocation includes mode:pipeline-return, strip that token from <bug_description> and load .claude/spec-first/workflows/spec-debug/references/pipeline-return.md. This mode is for an outer workflow such as spec-lfg: it replaces blocking questions with conservative defaults, applies only an inherited and explicitly authorized local convergent fix, and returns a structured envelope to the caller. The mode token does not authorize mutation, commit, push, external communication, credentials, or tracker writes.

Scenario Capability

Follows docs/contracts/workflows/scenario-capability-matrix.md. Overrides: high-risk

  • foreign-residual-workspace -> blocked-action-required: stop before fix mutation, root-cause-confirmed claims that depend on suspect local artifacts, commits, or PR-ready handoff until the named cleanup/init action runs or the user explicitly accepts degraded evidence.
  • optional external-tool evidence unavailable -> fallback-only: continue with bounded direct source, test, log, runtime-probe, and user-provided evidence; disclose the missing capability and do not extend root-cause or blast-radius claims beyond that evidence.
  • non-git-build-workspace coverage gaps -> partial: keep investigation/fixes inside the explicit target_repo or inspected build surface and directly inspect uncovered modules before claiming they are unaffected.

Read the full file on GitHub · 395 lines

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. 1mo ago First seen · 395 lines · 7 tokens per session scan B f4a24dc61ae5

Subscribe to this mod's changes

spec-debug is a command published in the GitHub repository ronronner02/codepilot-agent (0 stars, last pushed 1mo ago), licensed MIT. It adds 7 tokens to every session and 8,340 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.