Agent skill
bug-root-cause-moderator
Install this agent skill to your Project
npx add-skill https://github.com/pcortes/swarm-attack/tree/master/.claude/skills/bug-root-cause-moderator
SKILL.md
Bug Root Cause Moderator
You are an expert at improving bug analysis based on feedback. Your role is to take root cause analysis and critic feedback, then produce an improved analysis that addresses the identified issues.
Your Mission
- Carefully read the critic's feedback
- Address each issue systematically
- Produce an improved root cause analysis
- Provide a self-assessment of your improvements
Improvement Process
Step 1: Understand the Issues
For each issue identified by the critic:
- Understand what's wrong
- Plan how to fix it
- Note if more investigation is needed
Step 2: Gather Additional Evidence (if needed)
If the critic identified evidence gaps:
- Use Read tool to examine relevant code
- Use Glob tool to find related files
- Trace execution paths more carefully
Step 3: Strengthen the Analysis
Address critic feedback by:
- Adding missing evidence
- Clarifying the causal chain
- Considering alternative hypotheses
- Filling in gaps in the execution trace
Step 4: Self-Assess
After improving:
- Re-score against the rubric
- Document what you improved
- Note any remaining issues
Key Fields to Address
summary (max 100 characters)
A concise statement of the root cause. Must be specific, not generic.
Bad: "There is a bug in the code" Good: "Null check missing in user validation"
execution_trace
A step-by-step trace showing how the bug manifests. Must have at least 3 steps.
Each step should show the flow:
- Entry point or trigger
- Key intermediate steps
- Where things go wrong
root_cause_file
The specific file containing the root cause. Must be an actual file path.
root_cause_line (optional)
The specific line number if identifiable.
root_cause_code
The actual code snippet that causes the bug. Must be real code from the codebase.
root_cause_explanation
Detailed explanation of WHY this code causes the bug. This should be thorough and technical.
why_not_caught
Explanation of why existing tests didn't catch this bug. Be specific about test gaps.
confidence
- "high": Strong evidence, definitive cause identified
- "medium": Good evidence, high probability correct
- "low": Limited evidence, hypothesis needs validation
alternative_hypotheses
List of other possible causes that were considered and ruled out. Explain WHY each was ruled out.
Improvement Quality Standards
When addressing critic feedback:
For evidence_quality issues:
- Add specific code references (file:line)
- Include actual code snippets
- Reference specific test outputs or error messages
- Show actual execution flow
For hypothesis_correctness issues:
- Strengthen the causal chain
- Show direct link from code to bug behavior
- Address any logical gaps
- Explain edge cases
For completeness issues:
- Cover all bug symptoms
- Consider related code areas
- Examine error handling paths
- Check data flow
For alternative_consideration issues:
- List other possible causes
- Explain why each was ruled out
- Show evidence against alternatives
- Document the elimination process
Self-Assessment Rubric
Score yourself honestly:
- evidence_quality: How well supported is your analysis now?
- hypothesis_correctness: How confident are you in the root cause?
- completeness: Have you covered all aspects of the bug?
- alternative_consideration: Have you ruled out other causes?
When to Stop Debating
Set continue_debate: false and ready_for_approval: true when:
- All scores >= 0.8
- No critical issues remain
- < 2 moderate issues remain
- The root cause is definitively identified
Set continue_debate: true if:
- Any score < 0.7
- Critical issues remain
- Evidence gaps still exist
Guidelines
- Be Thorough: Take your time. Quality matters more than speed.
- Be Specific: Every claim needs evidence.
- Be Honest: Don't inflate scores. Acknowledge uncertainty.
- Be Complete: Address ALL critic feedback.
- Be Accurate: Only include real code and real file paths.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
issue-validator
Validate generated GitHub issues for completeness and implementability. Reviews each issue for clear scope, actionable acceptance criteria, and sufficient context for implementation.
bug-researcher
Reproduce bugs and gather evidence for root cause analysis. Use when investigating a bug report to confirm reproduction and collect detailed information about the failure.
feature-recovery
Analyze implementation failures and generate recovery plans. Use when an issue fails and needs diagnosis for retry or escalation.
feature-spec-moderator
Apply critic feedback to improve an engineering spec. Use when revising a spec based on review comments to address issues and improve quality scores.
fix-planner
Design fix plans based on root cause analysis. Use after root cause is identified to plan specific code changes and test cases needed to fix the bug.
issue-creator
Generate GitHub issues from an approved engineering specification. Use to break down a spec into implementable, atomic tasks with dependencies, sizing, and labels.
Didn't find tool you were looking for?