/cc-arsenal:test-suite [target_files_or_modules] [--coverage] [--framework name]from cc-arsenal
Generates test suites by analyzing coverage gaps, prioritizing untested code paths, and writing tests that match project conventions. Supports pytest, vitest, jest, and other frameworks.
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.
Generate comprehensive test suites with coverage gap analysis and parallel test writing, following testing best practices across any project type and framework.
$ARGUMENTS
Test generation must be grounded in code you actually read and patterns you actually verified: a test for a method that doesn't exist, or a coverage number you didn't measure, is worse than no test at all:
A Stop hook re-runs the discovered test/coverage/lint commands automatically before letting the session end (see frontmatter). Phase 4 below exists only to catch failures before that automatic gate fires, not to duplicate it.
If unsure, default to Small and escalate only if the target turns out to span several modules.
Portability: No Task/TaskCreate tools in this environment? Skip task tracking and the parallel subagent fan-out in Phase 3: do discovery and gap analysis yourself with Read/Grep/Glob, and write the tests for each module group yourself, one group at a time. The phase structure is the contract; parallelism is just a speedup. All Task, Explore and subagent boilerplate lives in references/subagent-template.md.
Copy this checklist and tick it as you go:
- [ ] Phase 0: discover test, coverage and lint commands and 2-3 existing test files
- [ ] Phase 1: run coverage baseline, rank targets
- [ ] Phase 2: user approves the test plan (no approval -> do not start Phase 3)
- [ ] Phase 3: write tests per module group
- new tests fail for the wrong reason (import error, wrong interface) -> back to the Phase 3 writing step, re-read the source
- existing suite breaks -> stop, find the side effect, report before going on
- [ ] Phase 4: run the full test command (max 3 fix rounds, then report what still fails)
- [ ] Phase 5: commit with measured coverage numbers
Create the phase tasks per "Task structure" in references/subagent-template.md, then discover the test workflow with the Haiku Explore prompt in Discovery prompt. Without subagent tools, read CLAUDE.md, the task runner files and 2-3 existing test files yourself.
Store the discovered test, coverage and lint commands plus the style patterns for later phases.
Goal: Identify what code lacks test coverage and prioritize test generation targets.
Run the discovered coverage command to get the current state:
# Examples (use the ACTUAL discovered command):
pytest --cov --cov-report=term-missing
vitest --coverage
jest --coverage
make coverage
Capture the output. If no coverage tooling exists, map untested code with the Gap-analysis prompt, or by comparing source and test file lists yourself.
Rank files/modules for test generation by:
| Priority | Signal |
|---|---|
| 1 | Critical business logic: authentication, payments, data processing |
| 2 | Untested code: files with zero test coverage |
| 3 | Complex code: high cyclomatic complexity, many branches |
| 4 | Recently changed: code modified in recent commits (use git log --oneline -20 --name-only) |
| 5 | Error-prone areas: code with known bugs or frequent changes |
If the user specified target files/modules, prioritize those. Otherwise, use the ranking above.
Goal: Present a test plan for user review before generating tests.
Use AskUserQuestion to present the plan and get approval:
AskUserQuestion:
question: "Here's the test generation plan based on coverage analysis. Which approach do you prefer?"
header: "Test Plan"
options:
- label: "Full coverage (Recommended)"
description: "Generate tests for all [N] identified gaps: [list of modules]. Estimated [M] test files."
- label: "Critical paths only"
description: "Focus on [top modules] with highest business impact. Estimated [K] test files."
- label: "Specific modules"
description: "Let me specify which modules to test."
No AskUserQuestion tool available? Present the same plan as plain text and wait for the user's reply before moving on to Phase 3.
The plan should include, for each target:
| Field | Content |
|---|---|
| File/module path | The path being tested |
| Functions/methods | Which ones to cover |
| Test types | Unit tests, integration tests, edge cases |
| Estimated test count | Per file |
| Test file location | Following project conventions |
Goal: Write tests for each approved module group, in parallel where subagents exist.
Group approved targets into logical units (module, feature area, related files). For each group, create a child task (Parallel child tasks) and spawn a Sonnet subagent with the Test-writer subagent template, spawning independent groups at once. Review each subagent's test files against project conventions as it finishes.
No subagent tool? Take the groups one at a time and write the tests yourself, applying the same template requirements: read the source and existing tests first, follow the Test Quality Principles, run the test command after each group.
Goal: Catch failures before the Stop hook's automatic final check.
Run the discovered test command once:
# Use the ACTUAL discovered command, e.g.:
make test
pytest
npm test
bun test
If a test fails, figure out whether it's a new test (fix the test, it made a wrong assumption about behavior) or an existing test (the new code introduced a side effect, investigate and fix). Re-run until everything passes, at most 3 rounds; then report what still fails instead of looping.
That's it: the Stop hook already re-runs tests, coverage, and lint automatically before the session ends, so don't duplicate a full separate coverage-and-lint pass here. This step exists only so failures surface while you're still working, not at the very last gate.
Use the cc-arsenal:git-commit skill to create the commit where available; otherwise create a conventional commit manually, using the actual coverage numbers from the command you ran in Phase 4/Phase 1, never an estimate:
git add [test files created/modified]
git commit -m "test: add comprehensive tests for [modules]
- [N] test files, [M] test cases added
- Coverage: [X]% → [Y]% (+[diff]%)
- Covers: [brief list of modules/features tested]
- Frameworks: [test framework used]"
Provide a summary including:
| Field | Content |
|---|---|
| Tests generated | Number of test files and test cases |
| Coverage improvement | Baseline to new coverage percentage (from the commands actually run, not estimated) |
| Modules covered | List of modules/files that received new tests |
| Test types | Unit, integration, edge cases breakdown |
| Remaining gaps | What still lacks coverage and recommendations |
| Commit | Reference to the commit created |
Generated tests must follow these principles:
| Principle | Detail |
|---|---|
| Arrange-Act-Assert | Clear structure in every test |
| Single responsibility | Each test verifies one behavior |
| Descriptive names | Test name explains the scenario and expected outcome |
| Independence | Tests do not depend on execution order or shared state |
| Deterministic | Same result every time, no flaky tests |
| Fast | Unit tests run quickly; minimize I/O and external calls |
| Readable | Tests serve as documentation for the code under test |
| Maintainable | Avoid testing implementation details; test behavior and contracts |
| Lean coverage | Over-testing is the failure mode in the other direction. Skip trivial getters and pure pass-throughs, as well as framework-guaranteed behavior. Don't add a snapshot test or an assert-nothing test just to move a coverage number. The one exception: never skip a test for a security or validation path, or one touching data loss, just because it's tedious to set up; that risk is always worth the test. |
AskUserQuestion (or its text fallback) rather than guessing.What SKILL.md sets; muted values are Claude Code's defaults
52 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.npx claudepluginhub mgiovani/ai-arsenal --plugin cc-arsenal