Skip to main content
commandsSource-backedReview first Safety Privacy

/test-advanced - Advanced Test Planning Custom Command

User-created Claude Code custom slash command recipe for planning deeper tests around a file or function, including edge cases, property-style invariants, regression cases, and mutation-score gaps where the project already supports those tools.

by JSONbored·added 2025-09-16·
HarnessClaude Code
Invocation:Create .claude/commands/test-advanced.md, then run: /test-advanced <file-or-function>
Review first review before installing

Open the source and read safety notes before installing.

Citation facts

Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.

Source URLs
https://code.claude.com/docs/en/skills, https://github.com/JSONbored/awesome-claude/blob/main/content/commands/test-advanced.mdx
Safety notes
This recipe asks Claude to inspect and draft tests against local project code; review generated tests before committing them., Run the narrowest relevant test command yourself and verify failures before broadening the suite or changing production code., If you add allowed-tools or dynamic shell injection to the command file, scope those permissions narrowly because the command can run local tools.
Privacy notes
The target source file, nearby tests, failures, logs, and command arguments may be sent into the model context., Use synthetic fixtures and redacted logs; do not paste production data, credentials, customer records, or private incident details into generated tests.
Author
JSONbored
Claim status
unclaimed
Last verified
2025-09-16

Decision playbook

Review trust signals before you adopt

Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.

Compare context
Selected

0

Current score

78

Baseline

Delta

No baseline selected

No major trust-signal divergence detected in the current selection.

Source and provenance checks

Complete

Confirm ownership and provenance before trusting install instructions.

  • Source link availableRequired

    Open the canonical repository and verify ownership.

    Done
  • Source provenance statusRequired

    Marked as source-backed.

    Done
  • Metadata reviewed

    Registry metadata indicates a reviewed listing.

    Done

Safety and privacy checks

Complete

Validate risk disclosures before installation or API wiring.

  • Safety notes presentRequired

    Review the listed safety guidance before running commands.

    Done
  • Privacy notes presentRequired

    Review data handling notes before connecting accounts or secrets.

    Done
  • Trust level risk gateRequired

    Trust level does not block evaluation.

    Done

Package and install checks

Needs review

Check package metadata and artifact integrity signals.

  • Install payload available

    Install or copy payload is available for review.

    Done
  • Package verification flag

    No package verification flag provided.

    Pending
  • Checksum metadata

    No checksum provided for downloaded artifact.

    Pending

Compare-driven decision checks

Needs review

Use compare context to validate trade-offs before adoption.

  • Compare tray has multiple entries

    Add at least one more entry to compare trust differences.

    Pending
  • Baseline comparison available

    No baseline peer selected yet.

    Pending
  • Diverging trust signals identified

    No major trust-signal divergence found.

    Pending

Setup at a glance

CLI install

Copy-ready — paste the snippet to get started.

Install command

Provided

Config snippet

Not provided

Copy snippet

Provided

Prerequisites

None

Platforms

1 listed

Difficulty

100/100

Adoption plan

Balanced adoption plan

Current risk score 16/100. Use staged verification before broader rollout.

Risk 16

Pre-adoption checks

Validate source and review signals before any execution.

  • Confirm source provenanceRequired

    Source URL/provenance metadata is present.

    Done
  • Confirm metadata review state

    Listing has review metadata.

    Done
  • Verify install payload

    Install/config payload exists and can be inspected.

    Done

Security checks

Confirm safety, privacy, and package integrity signals.

  • Review safety notesRequired

    Safety notes are present.

    Done
  • Review privacy notesRequired

    Privacy notes are present.

    Done
  • Verify package integrity metadata

    No package verification/checksum metadata.

    Pending

Rollout

Adopt in controlled steps based on the selected plan.

  • Run in isolated sandbox firstRequired

    Use a constrained sandbox and observe behavior across multiple tasks.

    Pending
  • Roll out graduallyRequired

    Roll out to a small cohort before wider usage.

    Pending
  • Set monitoring and fallback

    Define rollback path and monitor errors after adoption.

    Pending

Evidence readiness

Evidence readiness matrix · balanced

Required evidence gates are covered (5/6 signals complete).

Risk 15

Source provenance

Present

Source repository/provenance is listed.

Required in this preset

Metadata review

Present

Review metadata is present.

Required in this preset

Safety notes

Present

Safety notes are present.

Required in this preset

Privacy notes

Present

Privacy notes are present.

Optional in this preset

Package integrity

Missing

Package integrity metadata is missing.

Optional in this preset

Install payload

Present

Install payload is available.

Required in this preset

Required evidence gates are covered for this preset.

Decision timeline

Decision timeline · balanced

5/6 steps complete with no blocking gaps for this preset.

Risk 14

triage

Confirm source provenanceRequired

Source/provenance metadata is available.

Done

triage

Check metadata review statusRequired

Review metadata is available.

Done

verify

Review safety notesRequired

Safety notes are available.

Done

verify

Review privacy notes

Privacy notes are available.

Done

verify

Validate package integrity metadata

Package integrity metadata is missing.

Pending

rollout

Verify install payload and commandsRequired

Install payload is available.

Done

No required blockers for this timeline preset.

Safety & privacy surface

Safety & privacy surface

3 safety and 2 privacy notes across 5 risk areas. Review closely: credentials & tokens, permissions & scopes.

5 areas
  • SafetyGeneralThis recipe asks Claude to inspect and draft tests against local project code; review generated tests before committing them.
  • SafetyExecution & processesRun the narrowest relevant test command yourself and verify failures before broadening the suite or changing production code.
  • SafetyPermissions & scopesIf you add allowed-tools or dynamic shell injection to the command file, scope those permissions narrowly because the command can run local tools.
  • PrivacyLocal filesThe target source file, nearby tests, failures, logs, and command arguments may be sent into the model context.
  • PrivacyCredentials & tokensUse synthetic fixtures and redacted logs; do not paste production data, credentials, customer records, or private incident details into generated tests.

Safety notes

  • This recipe asks Claude to inspect and draft tests against local project code; review generated tests before committing them.
  • Run the narrowest relevant test command yourself and verify failures before broadening the suite or changing production code.
  • If you add allowed-tools or dynamic shell injection to the command file, scope those permissions narrowly because the command can run local tools.

Privacy notes

  • The target source file, nearby tests, failures, logs, and command arguments may be sent into the model context.
  • Use synthetic fixtures and redacted logs; do not paste production data, credentials, customer records, or private incident details into generated tests.

Schema details

Install type
cli
Reading time
6 min
Difficulty score
100
Troubleshooting
Yes
Breaking changes
No
Skill and platform metadata
Retrieval sources
https://code.claude.com/docs/en/skillshttps://platform.claude.com/docs/en/test-and-evaluate/develop-testshttps://jestjs.io/docs/getting-startedhttps://vitest.dev/guide/https://docs.pytest.org/en/stable/
Runtime and command metadata
Command syntax
Create .claude/commands/test-advanced.md, then run: /test-advanced <file-or-function>
Full copyable content
/test-advanced src/utils/parser.ts -- include invariants, edge cases, regression checks, and framework-specific gaps

About this resource

/test-advanced is not a built-in Claude Code command. This entry is a custom command recipe: you create a Markdown file in .claude/commands/, Claude Code exposes it as /test-advanced, and the behavior comes from the prompt you write into that file.

Use it when the simpler /generate-tests style prompt is too broad and you want Claude to plan a test matrix before writing code: current behavior, invariants, edge cases, regression cases, framework conventions, and any advanced gaps your project already has tooling to measure.

Create the command

Create .claude/commands/test-advanced.md:

---
description: Plan and draft deeper tests for a file, function, or behavior
argument-hint: [file-or-function]
---

Plan advanced test coverage for $ARGUMENTS.

First inspect the target code and nearby tests. Then produce:

1. A short behavior summary grounded in the source.
2. Existing test framework and naming conventions.
3. A scenario table covering happy paths, boundaries, invalid input, and
   regression cases.
4. Property-style invariants if the behavior has stable rules worth checking.
5. Integration or contract cases only where existing project tests already use
   those patterns.
6. Mutation-score or coverage gaps only if the repository already has a tool for
   measuring them.
7. The smallest test command to run after the draft is written.

After the plan, draft the minimal tests that fit the project's current test
stack. Do not introduce a new framework unless the project has no test framework
yet and you explain the tradeoff.

Claude Code derives the command name from the filename, so this file creates /test-advanced. Text after the command name is passed through $ARGUMENTS.

Usage

/test-advanced src/utils/parser.ts
/test-advanced "the retry backoff behavior in packages/client/retry.ts"
/test-advanced apps/api/users.test.ts -- focus on regression cases from the current diff

The text after the command is normal prompt input, not a CLI parser. There are no documented built-in flags such as --mutation, --pytest, or --coverage; ask for those focuses in plain language, and only rely on tools that already exist in the repository.

Suggested workflow

  1. Ground the target. Ask Claude to read the target file, adjacent tests, and package configuration before proposing new cases.
  2. Define success criteria. State what behavior should stay true, which failures matter, and what a useful regression test would catch.
  3. Match the project. Reuse the existing test framework, assertion style, fixture pattern, and command names.
  4. Separate plan from edits. Have Claude show the scenario table first, then write the smallest useful tests.
  5. Run narrowly. Use the smallest test command for the touched file or package before running the full suite.

Example output shape

Ask the command to return a compact plan before writing tests:

Area What to check Why it matters
Current behavior Inputs, outputs, thrown errors, and side effects visible in source Keeps tests tied to real code instead of guesses
Boundaries Empty input, nullish input, min/max values, encoding, and rounding Catches common regressions without broad fixture churn
Invariants Relationships that should always hold across valid inputs Good fit for property-style testing when the project already has tooling
Integration Existing API, storage, or component boundaries already covered nearby Avoids inventing integration harnesses in one command
Regression Known bug, diff hunk, or review concern the test should protect Makes the test valuable after the immediate change

Then let Claude draft tests only for cases that can run in the current project. For JavaScript or TypeScript this might mean Jest or Vitest if those configs already exist. For Python this usually means pytest when the repository already uses it.

Source Verification Notes

Verified on 2026-06-19:

  • Claude Code's skills/custom-command documentation says custom commands have been merged into skills, and existing .claude/commands/*.md files still create slash invocations based on the filename.
  • Anthropic's testing guidance recommends defining specific, measurable success criteria and designing evaluations around representative tasks, edge cases, and regression checks.
  • This page applies those mechanics and testing principles to a user-authored /test-advanced recipe. It does not claim an official built-in /test-advanced or /test command.

Duplicate Check

/generate-tests is the simpler broad test-generation recipe. /test-advanced is narrower: it asks Claude to plan a source-grounded test matrix first and only then draft tests that fit the repository's existing framework and tooling.

Troubleshooting

  • If the output invents a framework, tighten the prompt: "Use only the test framework already configured in this repository."
  • If the plan is too broad, ask for the smallest regression-focused case first.
  • If the command cannot find a test script, point it at package.json, pyproject.toml, pytest.ini, vitest.config.*, or the repository docs.

Source citations

Add this badge to your README

Show that /test-advanced - Advanced Test Planning Custom Command is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/commands/test-advanced.svg)](https://heyclau.de/entry/commands/test-advanced)

How it compares

/test-advanced - Advanced Test Planning Custom Command side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.

2 trust signals differ across this comparison (Source provenance, Submitter).

Next steps differ across entries — use the actions in the table below to copy install commands and source links per resource.

Field

User-created Claude Code custom slash command recipe for planning deeper tests around a file or function, including edge cases, property-style invariants, regression cases, and mutation-score gaps where the project already supports those tools.

Open dossier

A user-created custom slash command for Claude Code that turns a file or function into a test suite. You create .claude/commands/generate-tests.md and invoke it with /generate-tests; it is a prompt recipe, not a built-in command, and uses no CLI flags.

Open dossier

Community slash command runbook for adding minimal automated tests around a changed module: inspect the git diff, mirror repository test conventions, and draft focused unit or integration tests using Anthropic develop-tests guidance.

Open dossier

User-created Claude Code custom slash command recipe for drafting project documentation from source files, existing docs, and repository conventions.

Open dossier
Next stepsDiffers
Trust
Review statusReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewedReviewedMaintainer reviewed
Package trustPackage not verifiedPackage not verifiedPackage not verifiedPackage not verified
Source provenanceDiffersSource-backedSource-backedSubmission linkedSource submissionSource-backed
SubmitterDifferskiannidev
Install riskReview firstReview firstReview firstReview first
Notes Safety Privacy Safety Privacy Safety Privacy Safety Privacy
Brand
Categorycommandscommandscommandscommands
Sourcesource-backedsource-backedsource-backedsource-backed
AuthorJSONboredJSONboredkiannidevJSONbored
Added2025-09-162025-09-162026-06-162025-09-16
Platforms
Claude Code
Claude Code
Claude Code
Claude Code
Source repo
Safety notesThis recipe asks Claude to inspect and draft tests against local project code; review generated tests before committing them. Run the narrowest relevant test command yourself and verify failures before broadening the suite or changing production code. If you add allowed-tools or dynamic shell injection to the command file, scope those permissions narrowly because the command can run local tools.The recipe asks Claude to run the test suite, which executes project code and test commands locally; review the source and tests before running, especially in an unfamiliar repository. If you add an allowed-tools field (e.g. Bash(npm test:*)), Claude can run those tool calls without a per-use permission prompt while the command is active. Scope it narrowly. Project-level .claude/commands files are shared via git and run for anyone who trusts the workspace; treat a checked-in command as executable content and review it before trusting the repo.Generated tests are drafts; run the project's test command locally before committing. Do not add network calls, production credentials, or destructive setup to proposed tests.Generated documentation is a draft; verify examples, flags, endpoints, and behavior against the actual source before publishing. Do not let the command invent supported options, output formats, API fields, or guarantees that are not present in the code or official docs. If you add dynamic shell injection or allowed tools to the command file, scope those permissions narrowly because the command can run local commands.
Privacy notesThe target source file, nearby tests, failures, logs, and command arguments may be sent into the model context. Use synthetic fixtures and redacted logs; do not paste production data, credentials, customer records, or private incident details into generated tests.Dynamic-injection lines (!`...`) and @file references send the output of shell commands and the contents of referenced files into the model context; avoid pointing them at files containing secrets, credentials, or other sensitive data.Use synthetic fixtures only; do not copy production logs or customer records into tests.The target source files, existing docs, examples, error messages, and command arguments may be sent into the model context. Do not include private API keys, customer records, unreleased roadmap details, or production logs in generated examples.
Prerequisites— none listed— none listed
  • Git repository with an existing test runner configured in package scripts or docs.
  • A concrete code change or diff hunk to cover with new or updated tests.
— none listed
Install
/test-advanced src/utils/parser.ts
/targeted-test-generation <file-or-symbol>
/docs src/api/users.ts
Config
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed
Open 4 picks in the interactive comparison tool

Related guides

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.