| name | graph-bugs |
| description | Bug discovery + structured fix (5-Whys) with regression test, driven by the `agf` CLI — zero MCP |
| triggers | ["graph-bugs"] |
| version | 2.0.0 |
| author | auto-generated |
| date | "2026-06-16T00:00:00.000Z" |
| category | IMPLEMENT |
| phase | IMPLEMENT |
| tokens | ~594 |
| phases | ["IMPLEMENT"] |
graph-bugs
Bug discovery + structured fix (5-Whys) with regression test. Drive via the agf CLI — zero MCP. Load context with agf context <id> before changing anything.
When to Use
- Incorrect behavior observed
- Before implementing a fix
- Investigating a production incident
Mandatory Flow
agf node add --type bug → agf start → [TDD: red repro → green fix] → agf done <id>
Steps (IMPLEMENT phase)
| Command | Does |
|---|
agf node add --type bug | register bug with repro AC |
agf start | pull bug + context + in_progress |
agf check <id> | validate fix (regression test green first) |
agf done <id> | finish + root-cause memory |
Workflow
- Register —
agf node add --type bug (repro AC: Given-When-Then)
- Start —
agf start (pull, context, in_progress)
- Reproduce — write failing test (RED)
- 5-Whys — drill to root cause (5 levels)
- Fix — minimal correction (GREEN)
- Regression — test passes, nothing else breaks (REFACTOR)
- Check —
agf check <id> (DoD + TDD adherence)
- Done —
agf done <id> (DoD + root-cause memory + next)
Exit
Output Format
Phase: BUGFIX (IMPLEMENT)
Bug: #N registered and fixed
Reproduction: RED → GREEN
5-Whys: root cause identified
Regression: all tests pass
Status: fixed and documented
Loop link: delegate via agf brief <id> → fix → agf submit <id> --result <json> (validate→blast→DoD→done). Spiral: agf savings → agf learning → next.
Anti-Patterns
- No fix without a repro test first — always RED before GREEN
- Don't stop at the symptom — reach the 5th why
- Don't mark done without documenting root cause
- Don't forget the regression test
Related Skills
- $graph-implement —
agf skill show graph-implement
Codex Notes
- In Codex Plan Mode, plan only — don't mutate files.
- During implementation, follow
AGENTS.md and use apply_patch for manual edits.
Token Economy
Economia de tokens. Os levers compartilhados por todas as skills — --select,
agf retrieve-command, agf exec chain, reuso antes de criação — vivem em
_shared.md → Token Economy. Fonte única: um parágrafo repetido
em trinta arquivos é o trigésimo primeiro que envelhece sozinho.