bug-investigator
Skill838 starsChanged 5 months agoMITView on GitHub
Use when encountering any bug, test failure, or unexpected behavior during spec-superflow execution, before proposing fixes. Invoked automatically when build-executor hits a blockage.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- GrishaAngelovGH/gemini-cli-agent-skillstheir own version, first seen Jan 8, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- GrishaAngelovGH/gemini-cli-agent-skills★ 16same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- llms.txtllms.txt
- build-executorSkill
- code-reviewerSkill
- contract-builderSkill
- need-explorerSkill
- release-archivistSkill
- spec-mergerSkill
- spec-writerSkill
- workflow-startSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Before executing a CLI line below, replace its leading SSF with node "<plugin-root>/scripts/spec-superflow.mjs".
- Distinctive: line 20
No fixes without root cause investigation first.
- Distinctive: line 24
Use for ANY technical issue: test failures, bugs, unexpected behavior, performance problems, build failures, integration issues.
- Distinctive: line 26
Don't skip because issue "seems simple" or you're "in a hurry" — systematic debugging is faster than thrashing.
- Distinctive: line 37
Multi-component systems: add diagnostic instrumentation at each component boundary.
- Distinctive: line 62
After every failed fix, preserve its failure output in a physical file inside the change directory, then record the distinct attempt:
- Very specific: line 73
Use SSF debug attempt show <change-dir> --json to present the complete attempt ledger.
- Distinctive: line 75
After at least three distinct evidence-backed attempts, stop and discuss the architectural decision with the user.
- Very specific: line 84
Never write dp_5_* through raw SSF state set.
- Distinctive: line 90
All of these mean: STOP. Return to Phase 1: If 3+ fixes failed, question the architecture.
- Very specific: line 103
If truly environmental/timing-dependent/external: document what you investigated, implement appropriate handling (retry, timeout, error …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Bug Investigator
Bundled runtime
Before executing a CLI line below, replace its leading SSF with node "<plugin-root>/scripts/spec-superflow.mjs"; <plugin-root> is the absolute directory two levels above this file. Never run SSF literally or call an ssf from PATH.
Core principle: Find root cause before attempting fixes. Symptom fixes are failure.
New direct/planned changes
Investigate in executing without a phase transition or a separate debug ledger: reproduce, trace the root cause, make one focused repair and verify. Keep useful failure evidence in the existing progress entry. Three failures for the same unresolved issue warrant a decision; unrelated findings do not accumulate a shared budget. No task book or subagent is required. The detailed legacy protocol below is for an existing debugging state or an investigation that needs it.
The Iron Law
No fixes without root cause investigation first. If you haven't completed Phase 1, you cannot propose fixes.
When to Use
Use for ANY technical issue: test failures, bugs, unexpected behavior, performance problems, build failures, integration issues. Especially when under time pressure, "one quick fix" seems obvious, you've already tried multiple fixes, or you don't fully understand the issue.
Don't skip because issue "seems simple" or you're "in a hurry" — systematic debugging is faster than thrashing.
The Four Phases
Complete each phase before proceeding.
Phase 1: Root Cause Investigation
- Read error messages carefully: stack traces, line numbers, file paths, error codes — they often contain the exact solution
- Reproduce consistently: exact steps, every time? If not reproducible → gather more data, don't guess
- Check recent changes: git diff, recent commits, new dependencies, config changes, environment differences
- Multi-component systems: add diagnostic instrumentation at each component boundary. Log what enters and exits each layer. Run once to gather evidence, then analyze which component fails
- Trace data flow: backward tracing — where does the bad value originate? Keep tracing up until you find the source. Fix at source, not symptom
Phase 2: Pattern Analysis
- Find working examples of similar code in the same codebase
- Compare against references — read reference implementation completely
- Identify every difference between working and broken, however small
- Understand dependencies: other components, settings, config, environment, assumptions
Phase 3: Hypothesis and Testing
Scientific method: form a single hypothesis ("I think X is the root cause because Y"), test with the smallest possible change (one variable at a time), verify before continuing. If it didn't work, form a NEW hypothesis — don't add more fixes. When you don't know, say so and ask for help.
Phase 4: Implementation
- Create failing test case — simplest reproduction, automated if possible. Follow TDD rules from build-executor
- Implement single fix — address root cause, one change at a time, no "while I'm here" improvements
- Verify fix — test passes? no regressions? issue resolved?
- If fix doesn't work: count attempts. < 3 → return to Phase 1. ≥ 3 → STOP and question architecture (DP-5)
DP-5: Debug Escalation (3+ Failures)
3+ failed fixes = architectural problem. Each fix revealing new problems elsewhere = wrong architecture.
After every failed fix, preserve its failure output in a physical file inside the change directory, then record the distinct attempt:
Full and legacy Hotfix require a current, valid execution plan before this command; establish one with SSF execution recommend and SSF execution plan if needed. Quick, Tweak, lightweight, and direct Hotfix keep their planless contract: their valid workflow receipt authorizes debugging, and the ledger binds attempts to that receipt plus the current workflow, artifact, and contract hashes. The debug command rejects a missing or replaced receipt or a stale required plan.
SSF debug attempt record <change-dir> \
--id <unique-attempt-id> \
--summary "<what was tried and why it failed>" \
--evidence <change-local-failure-log>Use SSF debug attempt show <change-dir> --json to present the complete attempt ledger. Wave Review repair failures are separate evidence and never count as debugging attempts.
After at least three distinct evidence-backed attempts, stop and discuss the architectural decision with the user. Only after the user explicitly chooses may DP-5 be recorded:
SSF debug escalate <change-dir> \
--decision <continue|abandon> \
--reason "<user-confirmed decision>" \
--confirmNever write dp_5_* through raw SSF state set; those fields are guarded by the debug ledger. If the user chooses abandon, transition to abandoned only after the guarded DP-5 receipt is recorded.
Red Flags — Return to Phase 1
"Quick fix, investigate later" / "Just try changing X" / "Skip the test, I'll verify manually" / "It's probably X, let me fix that" / "I don't fully understand but this might work" / "One more fix attempt" (after 2+) / Proposing solutions before tracing data flow.
All of these mean: STOP. Return to Phase 1. If 3+ fixes failed, question the architecture.
Quick Reference
| Phase | Key Activities | Success Criteria |
| 1. Root Cause | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
| 2. Pattern | Find working examples, compare | Identify differences |
| 3. Hypothesis | Form theory, test minimally | Confirmed or new hypothesis |
| 4. Implementation | Create test, fix, verify | Bug resolved, tests pass |
When No Root Cause Found
If truly environmental/timing-dependent/external: document what you investigated, implement appropriate handling (retry, timeout, error message), add monitoring. But 95% of "no root cause" cases are incomplete investigation.
Exception Handling
- Parse failures: Report raw output, ask for clarification — don't guess
- Missing files: Escalate immediately — not a normal debugging scenario
- User interruption: Re-read investigation report on resume, continue from last completed phase
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

