debug

A read-only diagnostic command for investigating one failed task, identified by its full task ID and observed failure.

In plain words
What is it for?
Use it to inspect task records, specifications, test evidence, changes, and relevant history, then produce a diagnostic report and prevention route.
Why use it?
It helps find the confirmed cause of a failure without changing the task's status, scope, permissions, retry budget, or implementation.

Command

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 commands/nicelight/devrails-26/debug
Clone the repo
git clone --depth 1 https://github.com/nicelight/DevRails-26
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,135 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00014 $0.01135
Opus 5 $0.00007 $0.00567
Sonnet 5 $0.00003 $0.00227
Haiku 4.5 $0.00001 $0.00113

Measured yesterday against content hash 69374b4fca36, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug scanned grade A with 0 findings 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/_shared/references/commands/debug.md · 116 lines

How it starts

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

/debug - Diagnose one TASK failure

<input_contract> Expected $ARGUMENTS: one TASK-NNN-TN-FT-NNN-WN with an observed failure bound to the current Execution Attempt and actual change surface.

Read the indexed task card, direct task-linked specs, current-attempt protocol and handoff, functional/semantic verdict evidence, actual changes, and only the callers or boundaries needed to trace the failure. Missing reproduction or evidence is a valid diagnostic input and must remain explicit.

After root-cause confirmation, inspect only relevant prior diagnostic, execution, verification, bug, or repository-history evidence needed to compare the mechanism. Keep missing history explicit. </input_contract>

<hard_invariants>

  • Diagnosis is read-only over implementation, tests, specs, task records, protocols, scheduler state, and external systems. The only allowed write is this command's report under .tasks/<TASK_ID>/.
  • Do not change status, tier, dependencies, scope, Execution Attempt, retry budget, or permissions.
  • Do not issue functional/semantic verdicts, accept product/spec/architecture decisions, implement a correction, or create BUG/follow-up work.
  • Recurrence and prevention are advisory evidence. Do not infer recurrence from similar symptoms or absence of a prior match, create a durable rule without a confirmed material recurring mechanism, or expand current task authority.
  • A probe may mutate only known local isolated or disposable state with safe rerun and cleanup. It grants no production, destructive, privileged, secret, or external permission. When safety or initial state is uncertain, do not run it and keep the diagnosis inconclusive.
  • Keep tracing task-scoped. Neighboring callers and boundaries are evidence, not authority to expand the task. </hard_invariants>

<agent_discretion> Choose the smallest evidence-producing path. Useful tactics include reproducing the symptom with exact inputs/environment, reading the complete failure, tracing symptom -> immediate cause -> caller/source -> first violated invariant, and testing one evidence-backed hypothesis at a time with a distinguishing experiment. Condition-based waiting is usually preferable for async or flaky behavior. No fixed phase model, checklist, script, or mandatory failing test is required. </agent_discretion>

<required_outputs> Write exactly:

.tasks/<TASK_ID>/<TASK_ID>-S-DEBUG-final-report-docs-01.md

Include:

  • symptom and reproduction, or the exact evidence gap;
  • current Execution Attempt and actual change surface;
  • confirmed root cause plus first violated invariant, or inconclusive;
  • experiments and only materially useful rejected hypotheses;
  • minimum recommended correction;
  • suitable regression check;
  • recurrence: repeated_confirmed|no_prior_evidence|unclassified, with inspected evidence scope. repeated_confirmed requires a prior failure with the same causal mechanism and first violated invariant; no_prior_evidence is scoped to inspected history; insufficient evidence is unclassified;
  • for repeated_confirmed, prior evidence locators, the previous correction and why it failed to prevent recurrence, or the exact correction-history gap;
  • for a material repeated_confirmed, one cheapest sufficient prevention guardrail — test, invariant, contract, lint/tooling check, runbook condition, or architecture boundary — with canonical artifact/owner, owning workflow, and adoption check; otherwise no guardrail and the reason;
  • residual uncertainty and next owner;
  • exactly one standalone marker:
DIAGNOSIS: CONFIRMED|INCONCLUSIVE

Read the full file on GitHub · 116 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. yesterday First seen · 116 lines · 14 tokens per session scan A 69374b4fca36

Subscribe to this mod's changes

debug is a command published in the GitHub repository nicelight/DevRails-26 (22 stars, last pushed 4d ago), licensed MIT. It adds 14 tokens to every session and 1,135 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.