/cc-arsenal:fix-bug [bug_description_or_issue_id] [--branch name] [--interactive]from cc-arsenal
Fixes bugs through test-driven debugging: reproduces the failure with a failing test, locates the root cause with file:line evidence, applies the smallest fix, and verifies with the full test suite before committing.
Ships in cc-arsenal. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Fix the bug the user describes. It might arrive as a plain description, sometimes as an issue ID, occasionally just the name of a failing test. Work test-driven: reproduce the failure first. Track down the root cause with evidence. Apply the smallest fix that resolves it, run the tests, commit.
A fix that "should work" but was never run against a failing test is a guess, not a fix:
Most bugs are a single file, single root cause, fixable and verifiable in one sitting. For those, run Phases 0–5 below yourself, in order, inline: no task chain, no subagent fan-out. That's the default; don't create tasks unless the case below applies.
Use a task chain instead when the bug spans multiple files/components, the root
cause is unclear enough to need a dedicated analysis phase, or the fix will span
multiple sessions and needs progress tracking across them. In that case, before
Phase 0, create six tasks (Discovery, Reproduce & Analyze, Plan, Implement, Verify,
Commit) with a strict sequential chain, each addBlockedBy the one before it:
TaskCreate: { subject: "Phase 0: Discover project workflow", activeForm: "Discovering project workflow" }
TaskCreate: { subject: "Phase 1: Reproduce and analyze bug", activeForm: "Analyzing bug" }
TaskCreate: { subject: "Phase 2: Plan fix", activeForm: "Planning fix" }
TaskCreate: { subject: "Phase 3: Implement fix", activeForm: "Implementing fix" }
TaskCreate: { subject: "Phase 4: Verify quality", activeForm: "Verifying fix quality" }
TaskCreate: { subject: "Phase 5: Final commit", activeForm: "Creating final commit" }
TaskUpdate: { taskId: "2", addBlockedBy: ["1"] }
TaskUpdate: { taskId: "3", addBlockedBy: ["2"] }
TaskUpdate: { taskId: "4", addBlockedBy: ["3"] }
TaskUpdate: { taskId: "5", addBlockedBy: ["4"] }
TaskUpdate: { taskId: "6", addBlockedBy: ["5"] }
TaskUpdate: { taskId: "1", status: "in_progress" }
Task lifecycle rule (applies to every phase below when a chain exists, not
repeated per phase): mark that phase's task in_progress the moment you start it,
and status: "completed" immediately before moving to the next phase, then run
TaskList to confirm the next task unblocked.
Portability: no Task/TaskCreate tools in this environment? Always use the
inline path above: the phases are the methodology, the task tooling is just how
Claude Code tracks and parallelizes them in the multi-file case.
Discover the project's test, lint, and type-check commands before touching anything: guessing wastes a cycle when the wrong command silently no-ops.
If the codebase is large or unfamiliar, offload this to an Explore subagent:
Task tool, Explore agent, model haiku:
"Discover the development workflow for this project:
1. Read CLAUDE.md/AGENTS.md if present — extract debugging/testing conventions.
2. Check task runners: Makefile, justfile, package.json scripts, pyproject.toml.
3. Identify the test command, and how to run a single test/file.
4. Identify the lint and type-check commands.
5. Identify the dev server command if this is a web app.
6. Note pre-commit hooks or other quality gates.
Return a structured summary of all available commands."
Otherwise just check these yourself with Read/Grep. Store what you find, it's used in every later phase.
Goal: understand the bug, locate it in code, reproduce it reliably.
Understand symptoms. If given an issue ID, read it (gh issue view, jira issue view, etc.). Identify expected vs. actual behavior and any error messages.
If the report is too vague to reproduce (no expected/actual behavior, no repro steps, no error message, e.g. "something is broken sometimes"): stop here. Call AskUserQuestion; if that tool isn't available, end your turn with the specific questions in your final message instead: reproduction steps, expected vs. actual behavior, environment/error messages, and go no further. Do not infer a root cause from a code read alone or invent your own repro scaffolding to stand in for a real report. Running in an automated, sandboxed, or non-interactive context is not a reason to guess instead of asking, it's a reason to put the questions in the final message rather than wait for a reply.
Locate or create a failing test. Grep for existing coverage. If none exists, write a minimal test that reproduces the bug, in the location and style the existing test suite uses.
Reproduce it: a hard gate, not prose. Run the reproduction test against the current (unfixed) code with the discovered test command, and show the actual failing output before touching the fix. If the report names a specific symptom (e.g. "double-charges on retry"), confirm the assertion for that symptom is what fails, a suite with some unrelated test failing while the reported-symptom assertion already passes is not a reproduction. If the test passes pre-fix, the reproduction is wrong: stop, don't proceed to Phase 2, and rewrite the test until it actually captures the reported bug. A test that never failed proves nothing about the fix you're about to write.
Find the root cause. For a localized bug, just grep/read the relevant file yourself. Reserve parallel subagents for bugs spanning multiple files or with unclear scope:
Agent 1 (Explore, haiku) — Bug Location:
"Find the exact bug location (file:line), read the buggy code and its
surrounding context, explain why it produces the wrong behavior, and
provide evidence (stack trace, variable values, control flow)."
Agent 2 (Explore, haiku) — Impact Analysis:
"Search the codebase for other code affected by the same issue, similar
patterns with the same bug, related tests that might also fail, and
callers of the buggy code."
Agent 3 (general-purpose, haiku, only if an external library is implicated):
"Search Context7/web for documented solutions or known issues matching
this bug in [LIBRARY_NAME]."
AskUserQuestion before writing a fix on an unconfirmed theory.Goal: a minimal, focused fix that addresses the root cause without side effects.
Design a fix that:
// LEAN-DEBT: <limitation>. Upgrade when <trigger>. rather than silently shipping the gap.Get approval for non-trivial fixes: if the fix touches >3 files, modifies a
public API, has performance implications, or is otherwise breaking, use
AskUserQuestion to present the plan before implementing.
Run all quality checks using the commands discovered in Phase 0, then confirm every line of this checklist: it's the single authoritative copy, used at completion time:
LEAN-DEBT marker (see Phase 2)If any item fails, fix it before proceeding, don't commit broken code, and don't mark the phase complete until every box is checked.
If the git-commit skill is available, use it. Otherwise commit manually:
git add [files modified]
git commit -m "fix: [concise description of what was fixed]
- [Root cause]
- [Solution approach]
- [Issue/ticket reference if applicable]
Closes #[ISSUE_NUMBER]"
Report to the user: bug description, root cause (file:line), the fix, files
modified, test results (previously-failing test, full suite, lint, type-check,
each pulled from the command output you actually ran, never invented), commit
info, and any LEAN-DEBT markers left behind.
--branch, --interactive, --test-only), browser
testing integration, and error-handling patterns (test-still-fails, ambiguous
report, can't reproduce, multiple root causes). Load when you need one of those
specifics; the phases above are sufficient for a standard fix.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mgiovani/ai-arsenal --plugin cc-arsenal52 skills in this plugin
/agent-browserHeadless browser automation CLI optimized for AI agents: drives a real browser via accessibility-tree snapshots and @e1-style refs for ~93% less context than raw DOM tools. Use whenever a task needs to interact with a live web page: click, fill forms, log in, extract text or data, take screenshots, test a running web app, or scrape a site. Triggers on 'automate the browser', 'fill this form', 'click the button', 'take a screenshot of the page', 'log into', 'scrape this site', 'test my web app', 'headless browser'. Not for Playwright test-suite authoring or CDP/service-worker work needing the full JS API: use Playwright directly. Not for driving the user's own already-open, logged-in Chrome tab: use claude-in-chrome for that./anything-to-skillTurns a docs site, local folder, PDF or book, YouTube video, playlist or channel, or a topic into a source-grounded, token-efficient agent skill (hub SKILL.md, sectioned references, INDEX, evals), and can compact it into a lean expert skill. Use for "make a skill from these docs", "turn this channel into a skill". Not for a skill from your own description (use create-skill), improving one (use improve-skill) or finding third-party skills (use find-skills)./ci-generateGenerate a production-ready CI/CD pipeline config (GitHub Actions, GitLab CI, CircleCI, or Jenkins) by discovering the project's actual stack, test/build commands, and dependencies. Use when setting up CI for a new project, adding a missing workflow file, or asked to create/generate a pipeline, workflow, or `.gitlab-ci.yml`/`Jenkinsfile`. Not for writing a Dockerfile itself (see docker-init), this only wires CI stages around one. Not for running existing CI checks locally (use ci-local), this skill only authors the pipeline file itself./ci-localRun the checks a GitHub Actions workflow would run, locally, when Actions is unavailable or out of quota. Parses .github/workflows/*.yml, extracts the jobs/steps that gate merges (lint, typecheck, test, build), translates them to local commands respecting the workflow's pinned node/python versions and env, executes them sequentially, and reports a parity table of what passed locally vs. what can't be replicated (service containers, secrets, matrix dimensions) and why. Activates on "CI quota", "Actions is down/unavailable", "run CI locally", "verify like CI would", "run the pipeline on my machine", or a pre-push request to check a branch the way CI checks it. Not for generating a new workflow file (use ci-generate), not for debugging why a specific CI run failed on GitHub (use fix-bug or review-code), and not for the release/hotfix gating process itself (use gitflow), this skill only produces the local stand-in when the real thing isn't reachable./clotho-researchFind what a change will actually touch before planning it — the existing code that must change, the prior art worth copying, and the risks that will bite. Trigger on "what would this change touch", "research this before we plan it", or an automated pre-planning step. Reports files, sources, and risks; it never proposes an implementation and never edits anything. Not for auditing dependencies (use review-deps), not for writing the plan itself (use project-planner), and not for reviewing code that already exists (use review-code)./codex-imagegenGenerates images and polished raster art (logos, mascots, hero images, icons, characters, sprite sheets, illustrations, product mockups) by driving Codex CLI's $imagegen skill. This is the default image generator, use it for any request to generate or create an image or visual asset, including "generate an image", "create a hero image", "make a mascot", "design a logo", "draw an icon", "generate a sprite sheet", or "make an illustration". Requires the `codex` CLI installed and authenticated (ChatGPT auth). Not for architecture, flow, or sequence diagrams (use docs-diagram).