一键导入
test
Intelligent test runner that targets changed code and identifies coverage gaps. Use for running tests, finding coverage gaps, or testing changed code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Intelligent test runner that targets changed code and identifies coverage gaps. Use for running tests, finding coverage gaps, or testing changed code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Safely add a directory to Claude Code's Bash tool PATH. Use when a binary runs in your terminal but is "command not found" inside Claude Code's Bash tool, when adding a directory to PATH for Claude Code, when configuring CLAUDE_ENV_FILE, or when settings.json env.PATH did not work. Explains why env.PATH replaces rather than appends PATH and is not variable-expanded, why ~/.zshrc PATH exports are dropped, and the supported SessionStart hook fix.
Create or improve a Claude Code skill/slash command with best practices for structure, dynamic context, and safety. Use for creating new skills, improving existing ones, or learning skill authoring.
Launch a dynamic Workflow where the top-tier session model (Fable, or Opus when Fable is unavailable) handles planning and orchestration while implementation subagents run on Sonnet for routine tasks and Opus for complex ones. Use when the user wants to orchestrate a build, a dynamic workflow, a model-tiered build, fable or opus planning with sonnet and opus implementation, or tiered agents.
Open a PR, wait for CI to pass, fix failures, address review comments, and loop until fully green. Use when opening a PR, fixing CI, or addressing review feedback.
Manage recurring tasks in the local Argus daemon via its HTTP API. Use when the user wants to schedule a task locally in argus, create a cron-driven task, fire X every weekday/hour/morning, set up a recurring agent that needs local filesystem access (logs in ~/.argus, local databases, dotfiles), list or update existing argus schedules, or run an argus schedule now. Distinct from /schedule, which creates remote cloud routines without local access.
Generate a handoff prompt to pass context to another agent thread. Use when switching repos, handing off work, or sharing context between agents.
| name | test |
| description | Intelligent test runner that targets changed code and identifies coverage gaps. Use for running tests, finding coverage gaps, or testing changed code. |
Analyze recent changes, run targeted tests, identify coverage gaps, and optionally write missing tests.
$ARGUMENTS - Optional: --full for full test suite, --write to auto-write missing tests, or a specific file/directory to testfind . -maxdepth 1 \( -name go.mod -o -name Gemfile -o -name package.json -o -name Cargo.toml -o -name pyproject.toml -o -name setup.py -o -name requirements.txt -o -name pom.xml -o -name build.gradle -o -name Makefile \) 2>/dev/null | head -5git diff --name-only HEAD~1 2>/dev/null | head -50find . -maxdepth 4 \( -name "*_test.*" -o -name "*.test.*" -o -name "*_spec.*" -o -name "test_*" \) 2>/dev/null | head -20git status --shortFrom the project type context above, determine:
| Indicator | Framework | Run Command |
|---|---|---|
go.mod | Go test | go test ./... |
Gemfile | RSpec or Minitest | bundle exec rspec or bundle exec rake test |
package.json | Jest, Vitest, or Mocha | npm test or npx jest or npx vitest |
pyproject.toml / requirements.txt | pytest or unittest | pytest or python -m pytest |
Cargo.toml | cargo test | cargo test |
pom.xml / build.gradle | JUnit | mvn test or gradle test |
If you can't detect a test framework, tell the user and ask how to run tests.
IF $ARGUMENTS contains "--full":
Run the full test suite
ELSE IF $ARGUMENTS contains a specific file or directory:
Run tests for that target only
ELSE:
Analyze changed files and map them to test files:
1. For each changed file, look for corresponding test file:
- Go: foo.go → foo_test.go
- Ruby: app/models/user.rb → spec/models/user_spec.rb
- JS/TS: src/utils.ts → src/utils.test.ts or __tests__/utils.test.ts
- Python: module.py → test_module.py or tests/test_module.py
- Rust: src/lib.rs → tests in same file or tests/ directory
2. Run only the mapped test files
3. If no test files map to the changes, run the full suite
Run the determined tests. Capture output including:
If tests fail, read the failing test files and the source files they test to understand the failures.
First, try to use the project's coverage tool if available:
| Framework | Coverage Command |
|---|---|
| Go | go test -coverprofile=coverage.out ./... && go tool cover -func=coverage.out |
| pytest | pytest --cov --cov-report=term-missing |
| Jest | npx jest --coverage |
| RSpec | Coverage via simplecov (runs automatically if in Gemfile) |
| cargo | cargo tarpaulin (if installed) |
If a coverage tool ran, report the coverage percentage and uncovered lines.
If no coverage tool is available, fall back to manual analysis. Read each changed file and its corresponding test file (if any). Identify:
Report each gap with: file, function/method, what's missing.
IF $ARGUMENTS contains "--write" OR user confirms:
For each coverage gap identified:
1. Write a test following existing test patterns in the project
2. Use the same test framework, naming conventions, and style
3. Run the new test to verify it passes
4. Report what was written
This skill participates in a phase chain (see ~/.claude/skills/_shared/resources/phase-protocol.md).
After tests complete, write a test-{ts}.md artifact to .context/phases/ (create with mkdir -p .context/phases). The Detail section should include pass/fail status, coverage metrics, and failing test details. The Handoff section should state: ready to ship or needs fixes (with specifics).
## Test Results
### Run Summary
- **Framework:** {detected framework}
- **Scope:** {targeted / full suite}
- **Status:** PASS / FAIL
- **Passed:** {N} | **Failed:** {N} | **Skipped:** {N}
### Failures (if any)
| Test | File | Error |
|------|------|-------|
| {test name} | {file:line} | {brief error} |
### Coverage Gaps
| Source File | Function/Method | Gap |
|-------------|-----------------|-----|
| {file} | {function} | {what's missing} |
### New Tests Written (if --write)
| Test File | Tests Added | Covers |
|-----------|-------------|--------|
| {file} | {N} | {what it tests} |
### Recommendation
{1-2 sentences: overall health and what to do next}