/nlsmdn:test [ (no args = assess) | --review | --generate <target>] [--staged | --unpushed | --changed | --all]from nlsmdn
Assess test state and run the right action (default, no args): run the suite, then find failures, coverage gaps, and quality issues and route into fix, generate, or review. Explicit modes: review (--review, check test quality), generate (--generate TARGET, create tests). Scope: --staged, --changed, --all, or context-based. Use when unsure what the tests need, or for test quality and creation.
Ships in nlsmdn. 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.
Assess, review, and generate tests following consistent principles.
Use only these finding priorities, in descending order:
Grade the demonstrated consequence, realistic reachability, and available recovery against project priorities. A category, missing convention, hypothetical future problem, or confidence that a claim is true does not set its priority. Do not assign automatic severity floors or ceilings. Keep unverified claims in validation gaps, outside the graded finding count; distinguish suggestions from defects. For plans, trace the consequence if implemented and state the assumptions.
Use the short labels Must Fix, Should Fix, and Nice to Have in summaries and ledgers.
Keep effort, verification status, user-facing change size, and tool/vendor diagnostic ratings
separate. When called by code-review, return its requested evidence and impact fields; the parent
owns scoring and final triage. Otherwise apply this rubric directly. Omit empty priority sections.
Bare /test with no mode flag → Assess, over the whole suite. Always.
--review or --generate from conversation context. "We
just finished a feature", "just committed", or "recent changes" do not
narrow a bare /test — assess runs the whole suite and surveys the full state.--review,
--generate). Don't pick one for them.All modes share one lens — compare the tests against the code and the principles — and differ in what they do with the result:
| Mode | Intent | Writes? | Default scope |
|---|---|---|---|
| (no args) — assess | Run the suite, survey failures / gaps / quality, propose & run an action plan | No → plan, then runs your picks | whole suite + code surface |
--review [target] | Check test quality against the principles | No → findings | context (or <target>) |
--generate <target> | Create tests for code that lacks them | Yes — new/extended test files | the target |
Assess is the default — it's what a bare /test runs (see "Which mode runs"
above). It runs the suite, classifies what's required, and routes into the modes
below. The explicit modes are opt-in via their flag.
/test # Assess test state (run suite, find failures/gaps/issues), propose a plan, run your picks (default)
/test --staged # Assess, scoped to what staged changes touch
/test --review # Explicit review mode (quality only)
/test --review --staged # Review staged test files
/test --review --unpushed # Review test files changed across all unpushed commits
/test --review --changed # Review unstaged test files
/test --review --all # Review all tests (parallel agents)
/test --generate <target> # Generate tests for file/module/feature
/test --generate --staged # Generate tests for staged code changes
/test --generate --unpushed # Generate tests for code changed across unpushed commits
/test --generate --changed # Generate tests for unstaged code changes
Both review and generate modes follow these principles. Review checks conformance; generate applies them.
Assert observable outputs and side effects — not internal state or private methods.
Mock third-party services and I/O; keep internal modules real so the test exercises actual code.
Every test must have at least one expect that can fail; a test with no assertions proves nothing.
Never use setTimeout/sleep to wait for async work; wait for the actual condition instead.
Each test must set up its own state and not rely on execution order or shared mutable state.
One concern per test — avoid multi-step flows that test several behaviors in a single it block.
Use named constants for test inputs and expected values so the intent is clear at a glance.
A test that only asserts a constant, config value, or enum member equals its literal (expect(MAX_RETRIES).toBe(3)) duplicates the source and catches no bug. Generate never writes one; review flags each for removal, or for replacement with a test of the behaviour the value drives.
For BAD/GOOD code examples of each principle, see references/principles-examples.md.
--staged, --unpushed, and --changed review filter by filename pattern (*test*, *spec*). A test file in __tests__/payment.ts (no "test" in the filename) is missed by the glob.The no-args entry point. Use it when you don't know what the tests need: it establishes the current state of the suite, classifies what's required, hands you a prioritized action plan, then runs the parts you choose. It never generates or rewrites without your go-ahead — the plan comes first.
Establish the suite state.
package.json scripts,
pyproject.toml/pytest, go test, flutter test, Makefile). Show the
command before running it.Classify into action lanes (priority order):
file:test with the error. Escalate per
policy: after 2 failed fix attempts use second-opinion, after 4 use
hard-fix; for failures waved off as "pre-existing" use pre-existing.Report state + action plan. One categorized, sequentially-numbered list:
## Test Assessment: {scope}
State: {suite green/red — X passed, Y failed} · coverage {Z}% · {N} untested modules in scope
### Fix (failing — do first)
1. {file}:{test} — {error}
### Generate (missing)
2. {code_file}:{fn} — no tests / missing {edge case}
### Review (quality)
3. {test_file} — {smell}
### Healthy
- {what's already solid — so the user knows it was checked}
Always emit this assess report (titled Test Assessment) with every lane present even when empty (write "none — …" with the reason). Don't let a passing suite collapse assess into a plain quality review and skip the Generate (coverage/gaps) lane — checking existing tests is only one lane. Number actionable findings sequentially across tiers so the user can select by number.
Offer to execute. Ask which to run (numbers, all, or none;
multi-select where supported). Generate and Review run the matching
mode's logic from this skill; Fix drives the failing tests back to green
(escalating per the policy above). none → stop. Nothing is generated or
rewritten without a selection.
Defaults to the whole suite + code surface. To bias toward recent work, add
--staged / --unpushed / --changed (assess only what those changes touch —
run just those tests, check coverage/gaps there) or a <target> (assess one
feature/area).
--review)Checks tests against the principles above. (Assess routes here for the quality lane; run it explicitly to review without running the suite first.)
| Flag | Scope | Method |
|---|---|---|
| (none) | Context-related tests | Find tests for recently discussed code |
--staged | Staged test files | git diff --cached --name-only -- '*test*' '*spec*' |
--unpushed | Test files changed across unpushed commits | git diff --name-only $(git rev-list HEAD --not --remotes | tail -1)^..HEAD -- '*test*' '*spec*' |
--changed | Unstaged test files | git diff --name-only -- '*test*' '*spec*' |
--all | All test files | Glob **/*test*.{ts,js,py,dart} etc. |
--unpushed derives its range from git rev-list HEAD --not --remotes (oldest unpushed commit's parent → HEAD). If nothing is unpushed, or there is no remote/upstream (or the range walks back to the root commit) so it can't be determined reliably, stop and ask the user to pick another scope.
git worktree add --detach <scratch dir> HEAD, then apply
git diff HEAD --binary there) and remove it afterwards.For the review checklist, see references/generate-templates.md.
If a coverage script exists, run it to identify gaps:
# Check for coverage scripts
grep -E "coverage|test:cov" package.json 2>/dev/null
cat pyproject.toml 2>/dev/null | grep -A5 "pytest"
Common coverage commands:
npm run test:coverage or npm run coveragepytest --covgo test -coverflutter test --coverageReport uncovered lines/branches for files in scope.
## Test Review: {scope}
### Critical Issues (Must Fix)
- {file}:{test} - {verified consequence}
### Improvements (Should Fix)
- {file}:{test} - {verified consequence}
### Suggestions (Nice to Have)
- {file}:{test} - {small practical benefit}
### Supporting coverage evidence
- {code_file}:{function} - no tests found
- {code_file}:{function} - missing test for error case
- {code_file}:{function} - missing test for edge case: {scenario}
### Coverage Report
(if coverage script available)
- Overall: {X}% statements, {Y}% branches
- Uncovered in scope:
- {file}:{lines} - {description}
### Supporting pattern evidence (--staged)
- {test_file} - setup pattern differs from existing tests
- {test_file} - mocking approach inconsistent with {example_file}
### Supporting test-design evidence
- {file}:{test} - {smell}
--generate)Create tests for code following the principles above.
When generating tests for a bug fix, verify the test actually catches the bug:
Only claim the test is valid if it fails without the fix and passes with it. This prevents tests that pass for unrelated reasons.
| Flag | Scope | Method |
|---|---|---|
<target> | Specific file/function/module | Read the code, generate tests |
--staged | Staged code changes | Generate tests for what changed |
--changed | Unstaged code changes | Generate tests for what changed |
For framework detection rules and cross-framework terminology, see references/framework-mapping.md.
Follow project conventions:
__tests__/ directory (common in JS/TS)*.test.ts or *.spec.ts alongside sourcetest/ directory at project root*_test.py alongside source or in tests/For generate templates (function, component, service, staged changes), see references/generate-templates.md.
Generate test files directly, matching project patterns:
Before generating, show the patterns found:
## Detected Test Patterns
**Location:** `__tests__/` alongside source
**Structure:** `describe` per class/module, `it` per behavior
**Setup:** `beforeEach` with factory functions
**Mocking:** jest.mock for external, DI for internal
**Assertions:** jest matchers, testing-library queries
Generating tests following these patterns...
Not sure what the tests need — just triage them:
/test
Detects the framework, runs the suite, and checks coverage, then reports a numbered plan: failing tests to fix first, untested code to generate tests for, and existing tests with quality smells to review — plus what's already solid. Asks which to run and executes your picks (fixing red tests, generating, or reviewing).
Generate tests for a payment function:
/test --generate lib/services/payment.ts
Detects the project's test framework and patterns, then generates a test file covering happy path (successful charge), error handling (declined card, network failure), and edge cases (zero amount, currency mismatch). Places the file following existing test conventions.
Review staged tests catches over-mocking:
/test --review --staged
Reviews staged test files against the testing principles. Flags tests that mock internal modules instead of only external boundaries, and identifies tests with no meaningful assertions that would pass regardless of behavior.
Solution: Verify the correct test framework was detected by checking the "Detected Test Patterns" output. If imports or setup are wrong, point --generate at an existing passing test file so the generator can match its patterns exactly.
Solution: Ensure a framework config file exists (jest.config.*, vitest.config.*, pytest.ini, or pyproject.toml with pytest section). If the project uses a non-standard setup, run test --generate <target> and specify the framework in your prompt.
Cause: Assess runs the suite to establish state. Solution: Scope it
(/test --staged or a <target>) to run only the relevant tests, let it run in
the background, or — if running isn't safe — tell it to skip the run and do a
static gap/quality assessment instead.
Cause: Misread priority. Solution: The plan orders Fix before Generate for a reason — don't pile new tests on a broken suite. Fix the failures first, then re-assess for gaps.
--review for a
quality pass; --generate <target> for new tests; assess when unsure.--staged before commits to catch issues or generate missing tests--all periodically for comprehensive reviewWhat SKILL.md sets; muted values are Claude Code's defaults
highOther plugins' skills for the same job
65 skills in this plugin
/blind-spotsSurface consequential decisions a plan, design, or research brief left silently assumed, by interviewing the user in dependency order. Use when the user says "blind spots", "grill me", "stress-test this plan", "poke holes in this", "what am I missing", "interrogate this design", "what haven't I decided", or needs a loose idea or research brief clarified before work begins. Do NOT use for a clear factual lookup, to explain a previous reply in more detail (use `huh`), to generate ideas when it is unclear what to build (use `ideation`), or to review an already-written plan with agents (use `review-plan`)./brainstormWork out how to solve a problem the user can already name — interview them with `blind-spots` to understand it, generate structurally different approaches, validate each with an independent critic, then present the survivors with trade-offs and a recommendation. Use when the user says "brainstorm", "brainstorm approaches", "how should we solve/approach/tackle X", "what are our options", "compare approaches", "think this through with me", or wants solutions weighed before committing. Works on any topic, with codebase recon when a repo is involved; `--debate` adds external advisors for high-stakes calls. Do NOT use when stuck on what to build or what the problem is (use `ideation`), to probe an already-chosen plan (use `blind-spots`), or to pick a library or service (use `evaluate-tech`).npx claudepluginhub nielsmadan/skills --plugin nlsmdn