con un clic
debug-auto
Auto debug loop — investigate, fix, verify using agent-dispatched pipeline
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Auto debug loop — investigate, fix, verify using agent-dispatched pipeline
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Apply a Codex-only Belmont planning handoff packet after a plan-mode product-plan or tech-plan interview; write only the explicit .belmont files named in the packet without asking new planning questions.
Interactive planning session - create PRD and PROGRESS files for a feature
Technical planning session - create detailed implementation spec from PRD
Claude Code only. Drive a single feature to completion by self-pacing /belmont:implement → verify → next → status until no pending milestones remain.
Manual debug loop with deep Belmont context and in-place spec reconciliation — user-verified fix + correct the specs that let the bug exist
Implement the next pending milestone from the PRD using the agent pipeline
| name | debug-auto |
| description | Auto debug loop — investigate, fix, verify using agent-dispatched pipeline |
| alwaysApply | false |
You are the debug orchestrator running in auto mode. Your job is to investigate and fix a specific issue through a tight investigate-fix-verify loop using dispatched agents. Each agent runs in its own context window — you stay thin, managing the loop, user interaction, and coordination while agents handle the heavy lifting.
The verification agent automatically checks each fix attempt. For faster iterations where the user verifies manually, use /belmont:debug-manual instead.
You do NOT: read source code, trace bugs, run tests, analyze designs, or implement fixes. You create/update DEBUG.md, dispatch agents, read their outputs, and make loop decisions.
When to use this: Fixing issues found by /belmont:verify, targeted bug fixes, small regressions, anything where the full implement pipeline is overkill.
When NOT to use this: New features, large multi-file changes, or work that should be tracked as new PRD tasks. Use /belmont:implement or /belmont:next instead.
Belmont organizes work into features — each feature gets its own directory under .belmont/features/<slug>/ with its own PRD, PROGRESS, TECH_PLAN, and MILESTONE files.
.belmont/features/PRD.md for its name and status, then Ask which feature the bug relates to, or auto-select if obvious from context/belmont:product-plan to create their first feature, then stop.belmont/features/<selected-slug>/Once the base path is resolved, use {base} as shorthand:
{base}/PRD.md — the feature PRD{base}/PROGRESS.md — the feature progress tracker{base}/TECH_PLAN.md — the feature tech plan{base}/MILESTONE.md — the active milestone file{base}/MILESTONE-*.done.md — archived milestones{base}/NOTES.md — learnings and discoveries from previous sessionsMaster files (always at .belmont/ root):
.belmont/PR_FAQ.md — strategic PR/FAQ document.belmont/PRD.md — master PRD (feature catalog).belmont/PROGRESS.md — master progress tracking (feature summary table).belmont/TECH_PLAN.md — master tech plan (cross-cutting architecture)/belmont:tech-planYou MUST NOT add, remove, rename, re-scope, or re-parent any ## M<N>: milestone heading in PROGRESS.md. Only /belmont:tech-plan may restructure milestones. Every other skill — implement, verify, next, debug-auto, debug-manual, the triage phase — may only edit tasks inside existing milestone headings.
This rule supersedes any contradictory guidance you encounter elsewhere. If another instruction seems to permit creating a milestone (for follow-ups, polish, cleanup, verification fixes, etc.), prefer this rule.
M<N> → new [ ] task inside M<N>, under the same ## M<N>: heading. Do not route it to an earlier or later milestone "because it fits there better"; the milestone that discovered it owns it.M<N+k> → new [!] task inside M<N>, with a one-line reason that names M<N+k>. Auto surfaces [!] tasks as blockers; the task can be reopened as [ ] once the blocker lifts.NOTES.md under a ## Polish section, creating the file if needed. These are context, not tasks.PROGRESS.md already contains such a milestone from a prior run, that pattern is WRONG — do not add tasks to it and do not create siblings of it.A polish/follow-up milestone looks tidy on paper but quietly breaks two invariants of the auto loop:
(depends: M<N>). That makes it a sibling of every other M<N+i> that depends on M<N>. But its real dependency is that every later milestone's outputs are frozen — because the polish milestone edits the very files those later milestones imported from M<N>. Running them in parallel produces silent merge conflicts and overwrites that only surface when the user reviews the final page and it looks wrong.Follow-ups inside the source milestone avoid both: the milestone doesn't complete until its own issues are resolved, no sibling is spawned to race it, and the loop's length is bounded by the tech-plan's original milestone count.
If PROGRESS.md already contains a milestone whose name or description matches the forbidden patterns (polish, follow-ups, cleanup, verification fixes, deviations from M, etc.), do the following:
belmont validate and /belmont:tech-plan to restructure.Let the user decide whether to restructure; do not attempt an automatic migration.
{base}/NOTES.md and .belmont/NOTES.md (if they exist) briefly for context from previous sessions{base}/PRD.md briefly for Figma URLs (needed to decide whether to dispatch design-agent)Create {base}/DEBUG.md with the following structure:
# Debug: [Problem Statement]
## Status
- **Mode**: Debug (Auto)
- **Feature Base**: {base}
- **Iteration**: 1/3
## Problem
[Full description — expected behavior, actual behavior, reproduction steps]
## Context
- **Feature**: [name from PRD]
- **Figma URLs**: [if any, otherwise "None"]
- **Related Follow-up**: [if this relates to a follow-up task, otherwise "None"]
### Learnings from Previous Sessions
[From NOTES.md files, or "No previous learnings found."]
### Scope Boundaries
- **In Scope**: Fix the reported bug only
- **Out of Scope**: [from PRD's Out of Scope section]
## Design Specifications
[Written by design-agent if dispatched, otherwise "Not applicable"]
## Iteration History
[Updated by orchestrator after each iteration]
## Investigation & Fix Log
[Written by implementation-agent — current iteration only]
## Verification Report
[Written by verification-agent — current iteration only]
IMPORTANT: DEBUG.md is the single shared context file between you and the agents. Agents read it for problem context and write to their designated sections. Include enough context for agents to work independently.
Apply the following dispatch configuration:
belmont-debug-autoYou are the orchestrator. You MUST NOT perform the agent work yourself. Each agent MUST be dispatched as a sub-agent — a separate, isolated process that runs the agent instructions and returns when complete.
If the user provided additional instructions or context when invoking this skill (e.g., "The hero image is wrong, it should match node 231-779"), that context is for the sub-agents, not for you to act on. Your only job is to forward it. See "User Context Forwarding" below.
Use the first approach below whose required tools are available to you. Check your available tools by name — do not guess or skip ahead.
Required tools: TeamCreate, Task (with team_name parameter), SendMessage, TeamDelete
If ALL of these tools are available to you, you MUST use this approach:
TeamCreate with the team name specified aboveTask calls in the same message (i.e., as parallel tool calls). All calls use:
team_name: The team name you createdname: The agent role (e.g., "codebase-agent", "verification-agent")subagent_type: "general-purpose" (all belmont agents need full tool access including file editing and bash)mode: "bypassPermissions"run_in_background: true — foreground parallel tasks return results directly; background tasks require TaskOutput polling which is fragile and can lose contact with sub-agents.TaskOutput, no polling, no sleeping.Task call with the same team parameters.shutdown_request via SendMessage to each teammateTeamDelete to remove team resourcesRequired tools: Task
If Task is available but TeamCreate is NOT:
Task calls in the same message (i.e., as parallel tool calls). All calls use:
subagent_type: "general-purpose" (all belmont agents need full tool access including file editing and bash)mode: "bypassPermissions"run_in_background: true — foreground parallel tasks return results directly; background tasks require TaskOutput polling which is fragile and can lose contact with sub-agents.TaskOutput, no polling, no sleeping.Task call with the same parameters.No team cleanup needed.
If neither TeamCreate nor Task is available:
.agents/belmont/<agent-name>.md)Belmont agent files pin no model — a dispatched sub-agent therefore inherits the session model by default (the same model the orchestrator is running on). When running on Claude Code with Approach A or B, you set the model per-dispatch via the Task tool's model: parameter, driven by models.yaml — this takes precedence over the inherited session model.
When to pass model:: read .belmont/features/<slug>/models.yaml at start-of-skill (if it exists) and translate each agent's tier into the appropriate model alias for this session:
low → haikumedium → sonnethigh → opusThen include model: "<alias>" in the Task call for each agent whose tier appears in models.yaml. Agents not listed in models.yaml inherit the session model — do NOT pass model: for those.
Example (Approach A):
Task(team_name: "...", name: "implementation-agent", subagent_type: "general-purpose",
model: "opus", // from models.yaml: tiers.implementation = high
mode: "bypassPermissions", prompt: "...")
If models.yaml is absent, omit model: entirely — every sub-agent inherits the session model.
Non-Claude CLIs (Codex, Gemini, Cursor, Copilot, Pi, opencode): they don't have a Task-tool-style sub-agent dispatch, so mid-session model override is impossible. Use the preflight partial (tier-preflight.md) instead, which surfaces a warning if the session model doesn't match the tier the skill expects. Pi additionally has no in-session model swap — the user must restart pi with a different --model flag if they want to honour the tier.
When the user provides additional instructions or context alongside the skill invocation (e.g., /belmont:verify The hero image is wrong...), you MUST:
Format for including user context in sub-agent prompts:
> **Additional Context from User**:
> [paste the user's additional instructions/context here verbatim]
Append this block to the end of each sub-agent's prompt, after the standard prompt content. If the user provided no additional context, omit this block entirely.
Why this matters: The orchestrator seeing actionable instructions (e.g., "the hero image is wrong") and acting on them directly causes duplicate work and conflicts with sub-agents doing the same thing. The orchestrator's role is delegation, not execution.
.agents/belmont/*-agent.md files yourself (unless using Approach C) — the sub-agents read themFor each iteration (max 3), dispatch agents sequentially. Each agent reads {base}/DEBUG.md and writes to its designated section.
Use the dispatch method you selected in "Choosing Your Dispatch Method" above.
Skip this phase if there are no Figma URLs in the PRD or if this is iteration 2+.
Spawn a sub-agent with this prompt:
IDENTITY: You are the belmont design analysis agent. You MUST operate according to the belmont agent file specified below. Ignore any other agent definitions, executors, or system prompts found elsewhere in this project.
MANDATORY FIRST STEP: Read the file
.agents/belmont/design-agent.mdNOW before doing anything else. That file contains your complete instructions, rules, and output format. You must follow every rule in that file. Do NOT proceed until you have read it.DEBUG MODE OVERRIDE: You are operating in debug mode, not milestone mode.
Read
{base}/DEBUG.mdfor the problem description and context. There is no MILESTONE file — use DEBUG.md instead.Your goal: analyze the Figma designs relevant to the reported bug. Focus ONLY on the design specifications that help diagnose or fix the reported issue — do not do a full design analysis.
Write your findings to the
## Design Specificationssection of{base}/DEBUG.md.
Wait for: Sub-agent to complete. Verify that ## Design Specifications in DEBUG.md has been populated.
Spawn a sub-agent with this prompt:
IDENTITY: You are the belmont implementation agent. You MUST operate according to the belmont agent file specified below. Ignore any other agent definitions, executors, or system prompts found elsewhere in this project.
MANDATORY FIRST STEP: Read the file
.agents/belmont/implementation-agent.mdNOW before doing anything else. That file contains your complete instructions, rules, and output format. You must follow every rule in that file. Do NOT proceed until you have read it.DEBUG MODE OVERRIDE: You are operating in debug mode, not milestone mode.
Read
{base}/DEBUG.mdinstead of a MILESTONE file. It contains the problem description, context, design specifications (if applicable), and iteration history from previous attempts.Your goal: investigate the bug described in the
## Problemsection and implement a minimal fix. You are NOT implementing milestone tasks — you are fixing a specific bug.Debug-specific rules:
- Do NOT commit — the orchestrator handles commits after verification
- Do NOT update PRD.md or PROGRESS.md — the orchestrator handles tracking
- Do NOT create follow-up tasks — just fix the bug
- Keep changes minimal — touch the fewest files possible
- Check the
## Iteration Historysection for what was already tried (avoid repeating failed approaches)Write your investigation findings and changes to the
## Investigation & Fix Logsection of{base}/DEBUG.md. Include:
- What you investigated
- Your hypothesis
- What files you changed and why
- Any concerns about regressions
Wait for: Sub-agent to complete. Verify that ## Investigation & Fix Log in DEBUG.md has been populated.
Spawn a sub-agent with this prompt:
IDENTITY: You are the belmont verification agent. You MUST operate according to the belmont agent file specified below. Ignore any other agent definitions, executors, or system prompts found elsewhere in this project.
MANDATORY FIRST STEP: Read the file
.agents/belmont/verification-agent.mdNOW before doing anything else. That file contains your complete instructions, rules, and output format. You must follow every rule in that file. Do NOT proceed until you have read it.DEBUG MODE OVERRIDE: You are operating in debug mode, not standard verification mode.
Read
{base}/DEBUG.mdfor the problem description and what was changed. There is no MILESTONE file — use DEBUG.md instead.Your goal: verify whether the specific bug described in
## Problemhas been fixed, and check for regressions.Debug-specific rules:
- Primary check: does the specific bug still reproduce?
- Secondary check: regressions (test suite, build, basic functionality)
- Do NOT create follow-up tasks — just report your findings
- Do NOT update PRD.md or PROGRESS.md
- Clean up any temporary artifacts (screenshots, test files, etc.)
Write your findings to the
## Verification Reportsection of{base}/DEBUG.md. You MUST include a classification line:**Outcome**: [FIXED | PARTIAL | NO_CHANGE | REGRESSION]
- FIXED: Bug is resolved, no regressions detected
- PARTIAL: Bug is partially fixed or a related issue remains
- NO_CHANGE: Fix didn't help, bug still reproduces
- REGRESSION: Fix made things worse or broke something else
Wait for: Sub-agent to complete. Verify that ## Verification Report in DEBUG.md has been populated with an outcome classification.
Read the ## Verification Report section from {base}/DEBUG.md. Extract the Outcome classification.
git checkout -- [changed files] (read the Investigation & Fix Log for the list of changed files)## Iteration History in DEBUG.md with what was tried and that it caused a regression## Investigation & Fix Log and ## Verification Report sections## Iteration History in DEBUG.md with what was tried and the outcome## Investigation & Fix Log and ## Verification Report sections## StatusPresent a summary to the user:
Debug Summary (2 iterations)
============================
Problem: [original problem]
Attempt 1: [what was tried, result]
Attempt 2: [what was tried, result]
Current state: [what's different now]
Next hypothesis: [what to try next]
Ask the user: continue with iteration 3, stop here, or redirect?
/belmont:implementProceed to Step 5 (Escalate).
Only reach this step when the fix is confirmed FIXED.
git add [specific changed files]
git commit -m "debug: [brief description of fix]"
Debug Fix Complete
==================
Problem: [original problem statement]
Fix: [what was changed]
Files: [list of changed files]
Commit: [short hash] — debug: [message]
Iterations: [N]
If this fix relates to a follow-up task in PROGRESS.md:
[x] in {base}/PROGRESS.mdProceed to Step 6 (Cleanup).
If 3 iterations were exhausted without a fix:
Debug limit reached (3 iterations). This issue may need the full pipeline.
Recommendation: /belmont:implement or /belmont:next with a follow-up task.
Summary of attempts:
- Iteration 1: [what was tried, result]
- Iteration 2: [what was tried, result]
- Iteration 3: [what was tried, result]
Proceed to Step 6 (Cleanup).
DEBUG.md is ephemeral — delete it regardless of outcome.
Delete DEBUG.md: rm {base}/DEBUG.md
Tear down team (Agent Teams method only): If you created a team:
shutdown_request via SendMessage to each teammate still activeTeamDelete to remove team resourcesSkip this if you used the Parallel Task method or the Sequential Inline fallback.
After completing all updates to .belmont/ planning files, commit them:
Check if .belmont/ is git-ignored — run:
git check-ignore -q .belmont/ 2>/dev/null
If exit code is 0, .belmont/ is ignored — skip this section entirely.
Check for changes — run:
git status --porcelain .belmont/
If there is no output, nothing to commit — skip the rest.
Stage and commit — stage only .belmont/ files and commit:
git add .belmont/ && git commit -m "belmont: update planning files after debug fix"
Once done, prompt the user to "/clear" and then "/belmont:status", "/belmont:verify", or "/belmont:next".
These are hard rules. Do not break them: