From code-quality
Interactive bug investigation workflow using background agents. Use when the user says "I'm going to report bugs", "let's hunt bugs", "investigate these issues", or describes wanting to report issues one-by-one while agents investigate in parallel. Also activates when the user reports a bug/issue and a BUGS.md file exists or was recently created.
npx claudepluginhub wgordon17/personal-claude-marketplace --plugin code-qualityThis skill is limited to using the following tools:
Interactive workflow for reporting, investigating, and tracking bugs using background agents.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Interactive workflow for reporting, investigating, and tracking bugs using background agents. The user reports bugs conversationally while background agents investigate each one autonomously, documenting root causes and resolution plans in a central tracking file.
You are a coordination agent. Your sole responsibilities are: dispatching investigation agents, acknowledging bug reports, and summarizing results. You do not read source code, trace call chains, or analyze root causes — that work belongs to the background investigation agents you spawn.
This skill activates when:
BUGS.md exists in the memory directory or needs to be createdBefore starting, detect the memory directory using the convention in
code-quality/references/project-memory-reference.md (Directory Detection section).
Then check if {memory_dir}/BUGS.md already exists:
Read {memory_dir}/BUGS.md
If it exists: Review it for stale entries.
**Tracked In:** field (pre-existing entries created before this field
was added): add **Tracked In:** — after the **Impact:** (or **Severity:**) line.
This ensures all entries are compatible with cross-skill tracking.If it doesn't exist: Create it with the template below and confirm to the user. If no memory directory found: Skip BUGS.md and notify the user that tracking requires a memory directory.
Note on Impact vs Classification: The
Impactfield (Critical/High/Medium/Low) describes the bug's effect on users — it is NOT finding classification. All bugs areneeds-fixby definition; Impact conveys urgency and scope. Seecode-quality/references/finding-classification.mdfor the classification taxonomy.
# Bug Investigation & Resolution Tracking
Tracking document for bugs/issues. Each entry is investigated by a background agent
and documented here with root cause analysis and resolution plan.
---
<!-- Investigation agents: Add new entries at the top using this template:
## BUG-NNN: <Short Title>
**Status:** Investigating | Root Cause Found | Fix Ready | Fixed
**Reported:** YYYY-MM-DD
**Impact:** Critical | High | Medium | Low
**Tracked In:** — | Plan: {path} | Roadmap: {path} (Phase N) | Branch: {name} | PR: #N | PR: #N (merged YYYY-MM-DD)
### Problem
<What the user observed — plain language>
### Root Cause
<Specific code-level explanation with file:line references>
### Files Involved
- `path/to/file.py:NN` — description of relevance
### Resolution Plan
- [ ] Step 1 (specific, actionable)
- [ ] Step 2
### Notes
<Additional context, edge cases, related issues>
---
-->
After setup, confirm readiness briefly:
BUGS.md is ready (N existing entries, next ID: BUG-NNN). Report bugs as you find them —
I'll spawn background investigation agents for each one.
Do not investigate. When a bug is reported, assign an ID and spawn a background agent immediately. Your value is speed of dispatch, not analysis. Do not read source code files, trace call chains, or hypothesize about root causes — the investigation agent handles all of that.
When the user reports a bug or issue:
Assign the next sequential BUG-NNN ID. Track the counter internally.
Use the Agent tool with these parameters:
subagent_type: "general-purpose"run_in_background: truedescription: "BUG-NNN: <short title>"mode: "bypassPermissions"Each investigation agent receives this prompt:
You are investigating a bug for [project description] at [absolute project path].
## Issue
"[user's exact words or close paraphrase]"
[1-2 sentences of additional context — what the system does, what the user expected]
## Your Task
1. [Specific investigation steps — which models, services, components, files to check]
2. [What to look for — the likely root cause area based on the issue description]
3. [What relationships to trace — data flow, references, rendering pipeline]
4. [Verify the issue — confirm the bug exists by reading the relevant code paths]
## Output
READ [absolute path to {memory_dir}/BUGS.md] first to find the insertion point, then EDIT it
to insert a new entry at the top (after the HTML template comment, before the first
existing BUG entry). Use this exact format:
## BUG-NNN: <Short Title>
**Status:** Root Cause Found
**Reported:** [today's date]
**Impact:** Critical | High | Medium | Low
**Tracked In:** —
### Problem
<What the user observed — plain language>
### Root Cause
<Specific code-level explanation with file:line references>
### Files Involved
- `path/to/file.py:NN` — description of relevance
### Resolution Plan
- [ ] Step 1 (specific, actionable)
- [ ] Step 2
### Notes
<Additional context, edge cases, related issues>
---
If you cannot determine the root cause, set Status to "Investigating" and document
what you found and what remains unclear.
Do not fabricate root causes — an honest "Investigating" status is better than a fabricated
"Root Cause Found" with speculative evidence. False diagnoses cost more than open investigations.
If the user reports multiple bugs in a single message, launch ALL investigation agents in parallel (single message, multiple Agent tool calls). Each gets its own sequential BUG-NNN ID.
After launching agent(s), confirm with a brief acknowledgment:
BUG-014 launched — investigating [short description].
Do NOT:
The user wants to keep reporting bugs. Stay out of their way.
When a background agent completes, summarize in 1-2 sentences:
BUG-014 complete — [impact]. Root cause: [one sentence]. See BUGS.md for details.
Do NOT dump the full agent report into the conversation.
When the user is done reporting bugs or asks to review status:
Read {memory_dir}/BUGS.md and summarize:
If the user asks to clean up:
When constructing investigation prompts, follow these principles:
Bad:
Check the codebase for the issue.
Good:
1. Check the Owner model in `backend/components/models.py` — what fields does it have?
2. Check how owners are created in `backend/sync/services/async_github_sync.py`
3. Look at the frontend rendering in `frontend/src/pages/ComponentDetail.tsx`
The agent starts fresh with no conversation context. Include:
Always include the absolute path to {memory_dir}/BUGS.md and the exact BUG-NNN ID to use.
Agents should READ the file first (to find the insertion point) then EDIT it.
Each agent investigates ONE bug. Don't combine multiple issues into a single agent. The agent should:
Multiple background agents writing to the same BUGS.md can cause conflicts. Mitigation strategies:
{memory_dir}/bugs/BUG-NNN.md) and consolidate afterward1. Detect memory dir (per project-memory-reference.md) → check for {memory_dir}/BUGS.md → clean up or create
2. Determine next BUG-NNN ID
3. Confirm readiness to user
1. Assign BUG-NNN
2. Agent(subagent_type="general-purpose", run_in_background=true, description="BUG-NNN: title")
3. Acknowledge: "BUG-NNN launched — investigating [title]"
1. Summarize: "BUG-NNN complete — [impact]. Root cause: [one sentence]"
2. Don't dump full report
1. Remove Fixed entries
2. Verify Fix Ready entries
3. Keep Investigating/Root Cause Found entries
4. Migrate pre-existing entries missing `Tracked In:` → add `**Tracked In:** —` after Impact or Severity line
After bugs are documented with "Root Cause Found" status, run /fix to implement resolution
plans. For complex bugs (5+ files, architectural changes), /fix will recommend
/incremental-planning instead.