From Code Health
Orchestrates automated bug detection and priority-based fixing with bug-hunter and bug-fixer agents, including quality gates and verification cycles.
How this skill is triggered — by the user, by Claude, or both
Slash command
/code-health:bug-health-inlineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You ARE the orchestrator. Execute this workflow directly without spawning a separate orchestrator agent.
You ARE the orchestrator. Execute this workflow directly without spawning a separate orchestrator agent.
Detection → Validate → Fix by Priority → Verify → Repeat if needed
Max iterations: 3 Priorities: critical → high → medium → low
Setup directories:
mkdir -p .tmp/current/{plans,changes,backups}
Validate environment:
package.json existstype-check and build scripts existInitialize TodoWrite:
[
{"content": "Bug detection", "status": "in_progress", "activeForm": "Detecting bugs"},
{"content": "Fix critical bugs", "status": "pending", "activeForm": "Fixing critical bugs"},
{"content": "Fix high priority bugs", "status": "pending", "activeForm": "Fixing high bugs"},
{"content": "Fix medium priority bugs", "status": "pending", "activeForm": "Fixing medium bugs"},
{"content": "Fix low priority bugs", "status": "pending", "activeForm": "Fixing low bugs"},
{"content": "Verification scan", "status": "pending", "activeForm": "Verifying fixes"}
]
Invoke bug-hunter via Task tool:
subagent_type: "bug-hunter"
description: "Detect all bugs"
prompt: |
Scan the entire codebase for bugs:
- Run type-check and build
- Check for security vulnerabilities
- Find dead code and debug statements
- Categorize by priority (critical/high/medium/low)
Generate: bug-hunting-report.md
Return summary with bug counts per priority.
After bug-hunter returns:
bug-hunting-report.mdRun inline validation:
pnpm type-check
pnpm build
For each priority (critical → high → medium → low):
Check if bugs exist for this priority
Update TodoWrite: mark current priority in_progress
Invoke bug-fixer via Task tool:
subagent_type: "bug-fixer"
description: "Fix {priority} bugs"
prompt: |
Read bug-hunting-report.md and fix all {priority} priority bugs.
For each bug:
1. Backup file before editing
2. Implement fix
3. Log change to .tmp/current/changes/bug-changes.json
Generate/update: bug-fixes-implemented.md
Return: count of fixed bugs, count of failed fixes.
Quality Gate (inline):
pnpm type-check
pnpm build
Update TodoWrite: mark priority complete
Repeat for next priority
After all priorities fixed:
Update TodoWrite: mark verification in_progress
Invoke bug-hunter (verification mode):
subagent_type: "bug-hunter"
description: "Verification scan"
prompt: |
Re-scan codebase after fixes.
Compare with previous bug-hunting-report.md.
Report:
- Bugs fixed (count)
- Bugs remaining (count)
- New bugs introduced (count)
Decision:
Generate summary for user:
## Bug Health Check Complete
**Iterations**: {count}/3
**Status**: {SUCCESS/PARTIAL}
### Results
- Found: {total} bugs
- Fixed: {fixed} ({percentage}%)
- Remaining: {remaining}
### By Priority
- Critical: {fixed}/{total}
- High: {fixed}/{total}
- Medium: {fixed}/{total}
- Low: {fixed}/{total}
### Validation
- Type Check: {status}
- Build: {status}
### Artifacts
- Detection: `bug-hunting-report.md`
- Fixes: `bug-fixes-implemented.md`
If quality gate fails:
Rollback available: .tmp/current/changes/bug-changes.json
To rollback:
1. Read changes log
2. Restore files from .tmp/current/backups/
3. Re-run workflow
If worker fails:
| Old (Orchestrator Agent) | New (Inline Skill) |
|---|---|
| 9+ orchestrator calls | 0 orchestrator calls |
| ~1400 lines (cmd + agent) | ~150 lines |
| Context reload each call | Single session context |
| Plan files for each phase | Direct execution |
| ~10,000+ tokens overhead | ~500 tokens |
See references/worker-prompts.md for detailed prompts.
npx claudepluginhub jhamidun/claude-code-config-pack --plugin code-healthProvides C# and .NET testing patterns using xUnit, FluentAssertions, NSubstitute, Testcontainers, and WebApplicationFactory for unit and integration tests.