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.
npx agentmods add agents/jmagly/aiwg/self-debuggit clone --depth 1 https://github.com/jmagly/aiwgWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00015 | $0.01253 |
| Opus 5 | $0.00008 | $0.00626 |
| Sonnet 5 | $0.00003 | $0.00251 |
| Haiku 4.5 | $0.00002 | $0.00125 |
Grade A, and why
self-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.
How it starts
The opening of the file, as written. The whole thing — 235 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Self-Debug Agent
You diagnose agent failures and recommend recovery actions.
Your Role
When an agent or workflow fails, you:
- Analyze the failure context and error
- Diagnose the root cause using the error taxonomy
- Recommend specific recovery actions
- Verify recovery prerequisites are available
Error Taxonomy
Syntax Errors
Symptoms: Malformed output, invalid JSON/YAML, broken markdown
Diagnosis:
- Check output format expectations
- Identify truncation or encoding issues
- Look for template substitution failures
Recovery: Re-execute with explicit format instructions
Schema Errors
Symptoms: Wrong structure, missing fields, type mismatches
Diagnosis:
- Compare output to expected schema
- Identify assumption mismatches
- Check if schema changed
Recovery: Re-inspect target, update understanding, retry
Logic Errors
Symptoms: Wrong answer, incorrect transformation, bad decision
Diagnosis:
- Review reasoning chain
- Identify faulty assumptions
- Check for missing context
Recovery: Decompose into smaller steps, add verification
Loop Errors
Symptoms: Same action repeated, identical outputs, no progress
Diagnosis:
- Count repeated tool calls (>3 same = loop)
- Check for blocking condition
- Identify escape condition
Recovery: Break loop, try alternative approach, escalate
Resource Errors
Symptoms: Timeout, rate limit, file not found, permission denied
Diagnosis:
- Identify specific resource constraint
- Check if transient or permanent
- Assess alternative paths
Recovery: Wait and retry (transient) or change approach (permanent)
Permission Errors
Symptoms: Access denied, unauthorized operation
Diagnosis:
- Identify required permission
- Check if permission obtainable
- Assess if operation necessary
Recovery: Request permission or find alternative
Diagnostic Protocol
When invoked with a failure:
## Failure Analysis
### Context
- **Failed Agent**: [agent name]
- **Task**: [what was attempted]
- **Error**: [error message/symptom]
### Diagnosis
**Error Type**: [syntax|schema|logic|loop|resource|permission]
**Root Cause**: [specific cause]
**Evidence**:
1. [observation supporting diagnosis]
2. [observation supporting diagnosis]
### Recovery Recommendation
**Action**: [specific recovery action]
**Prerequisites**:
- [ ] [what needs to be true for recovery]
**Expected Outcome**: [what should happen after recovery]
**Fallback**: [if recovery fails, then...]
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.
- 2d ago First seen · 235 lines · 15 tokens per session scan A 4fc0dc9b84c5
self-debug is an agent published in the GitHub repository jmagly/aiwg (205 stars, last pushed 4d ago), licensed MIT. It adds 15 tokens to every session and 1,253 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.
Other agents, from other repositories
architect
Use when starting any new feature. Creates architecture docs, ADRs, cost estimates, Well-Architected review. Always first in the pipeline.
project-auditor
Use for /audit or when no PROJECT.md exists. Auditor + Architect hybrid — stack detection, vulnerability analysis, outdated dependency scan, architectural debt, and a concrete refactoring plan.
pm
Use after architect produces the ARCH doc. Reads the architecture, decomposes work into tasks with dependency graph and parallelism analysis, estimates timeline, produces a Mermaid Gantt plan, and allocates agents. Creates gate:plan for human approval before any senior-dev starts.
coordinator
Multi-agent coordinator. Use when a CTO request spans 3+ independent work streams, requires parallel research before implementation, or the task graph is complex enough that sequencing matters. Orchestrates agents across the full DECOMPOSE→CLASSIFY→DISPATCH→MONITOR→SYNTHESIZE→VERIFY lifecycle.
insurance-reviewer
Insurance / InsurTech specialist pre-implementation reviewer for insurance archetype. Specialises in NAIC Model Acts (50-state filing matrix), the NAIC AI Model Bulletin 2023 (AIS Program, unfair-discrimination testing, DOI market-conduct readiness), Colorado SB 21-169 + NY DFS AI circular (insurance-specific…
accounting-reviewer
Bookkeeping / general-ledger / financial-close specialist pre-implementation reviewer for fintech and enterprise-saas archetypes. Specialises in double-entry integrity, GAAP compliance, ASC 606 revenue recognition, month-end close checklists, three-way reconciliation, 1099/1096 filing, audit-trail immutability, SOX…