debug

A structured debugging command that uses several investigation agents to trace a bug, gather file-and-line evidence, and propose a focused fix.

In plain words
What is it for?
Finding root causes, tracking debugging phases, checking relevant development guidance, and applying a small approved fix.
Why use it?
It replaces guesswork with a documented investigation and keeps diagnosis separate from code changes until the proposed fix is approved.

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/joncik91/ucai/debug
Clone the repo
git clone --depth 1 https://github.com/Joncik91/ucai
Per session 6 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,311 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.00006 $0.02311
Opus 5 $0.00003 $0.01156
Sonnet 5 $0.00001 $0.00462
Haiku 4.5 $0.00001 $0.00231

Measured 2d ago against content hash e87857e7c6b4, 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 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.

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.

commands/debug.md · 173 lines

How it starts

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

Debugging

You are helping a developer trace and fix a bug. This command uses parallel investigation agents to find the root cause, then proposes a targeted fix in a single approval gate before autonomous execution.

Core Principles

  • Investigate before guessing: Launch agents to trace the error, not assume the cause
  • Evidence-based diagnosis: Every root cause claim needs file:line references
  • Minimal fix: Address the root cause, not symptoms. Keep changes small
  • Single approval gate: Diagnosis and fix plan are approved together; execution is autonomous after approval
  • Track progress: Write and update tasks/todo.md to track phase completion
  • Sequential todo updates: Mark each phase complete in tasks/todo.md immediately when it finishes. Never batch-mark multiple phases at once.

Skill Loading — MANDATORY

Before starting investigation, you MUST load relevant skills based on the bug's domain.

  1. Determine where the bug lives: backend, frontend, infrastructure, etc.
  2. Load the matching skill: Skill(ucai:backend), Skill(ucai:frontend), Skill(ucai:devops), etc.
  3. If unclear, load Skill(ucai:architect) as a general-purpose choice

You MUST load at least one skill before proceeding. State which skill(s) you loaded and why.


Phase 1: Understand

Goal: Know what's broken.

Input: $ARGUMENTS

Persistent task tracking: Write tasks/todo.md with the debug plan:

---
updated: YYYY-MM-DD
command: /debug
feature: <bug-description>
---

Body: ## Phase N sections with - [ ] items for each step. Create the tasks/ directory if it doesn't exist. Overwrite any previous tasks/todo.md.

Lessons loading: If tasks/lessons.md exists, read it and note any patterns relevant to the current bug. Apply known patterns proactively throughout the debug session. If the file doesn't exist, skip silently.

Actions:

  1. Create todo list with all phases (1–5)
  2. Write tasks/todo.md with YAML frontmatter and checkable phase items (one - [ ] per phase)
  3. If tasks/lessons.md exists, load it and note relevant patterns
  4. Load project context (if available):
    • Check .claude/project.md — read for tech stack and constraints
    • Check CLAUDE.md — read for project conventions
  5. Parse the bug report from $ARGUMENTS:
    • Is there a stack trace or error message?
    • Is there a specific file or function mentioned?
    • Is this a runtime error, wrong behavior, or performance issue?
  6. If the bug is vague, ask:
    • When does it happen? (always, sometimes, specific conditions)
    • Steps to reproduce?
    • Expected vs actual behavior?
    • Any recent changes that might have caused it?
  7. Summarize understanding and confirm with user
  8. Mark Phase 1 complete in tasks/todo.md

Read the full file on GitHub · 173 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. 2d ago First seen · 173 lines · 6 tokens per session scan A e87857e7c6b4

Subscribe to this mod's changes

debug is a command published in the GitHub repository Joncik91/ucai (29 stars, last pushed 6d ago), licensed MIT. It adds 6 tokens to every session and 2,311 once invoked, about $0.0000 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.