com um clique
test
// Generate or run tests. Auto-detects test framework, generates comprehensive tests for source files, or runs existing test suites with failure analysis.
// Generate or run tests. Auto-detects test framework, generates comprehensive tests for source files, or runs existing test suites with failure analysis.
| name | test |
| description | Generate or run tests. Auto-detects test framework, generates comprehensive tests for source files, or runs existing test suites with failure analysis. |
Accepts optional arguments:
run: run the existing test suite and analyze results<quick_start>
<step_1_detect_framework>
Detect the test framework and conventions before doing anything else.
Check these sources in order:
package.json (Node/JS/TS projects):
scripts.test for the test commanddevDependencies for jest, vitest, mocha, ava, tap, node:test, playwright, cypressjest or vitest config keysConfig files:
jest.config.*, vitest.config.*, .mocharc.*, ava.config.*pytest.ini, pyproject.toml (look for [tool.pytest]), setup.cfggo.mod (Go projects use go test by default)Cargo.toml (Rust projects use cargo test)Existing test files:
*.test.*, *.spec.*, *_test.*, test_*.* files__tests__/ vs tests/ vs test/)Record your findings:
</step_1_detect_framework>
<step_2_handle_arguments>
Route based on the argument provided.
generate_testsrun_testssuggest_tests</step_2_handle_arguments>
<generate_tests>
Generate tests for the specified source file.
A. Read and analyze the source file:
B. Read existing test files in the project (1-2 files minimum):
C. Generate tests covering:
D. Place the test file correctly:
.test.ts, .spec.js, _test.go, test_*.py, etc.)E. Run the generated tests immediately to verify they pass.
</generate_tests>
<run_tests>
Run the existing test suite and analyze results.
A. Determine the test command:
package.json scripts.test for Node projectspytest for Python projectsgo test ./... for Go projectscargo test for Rust projectsB. Run the tests:
C. Analyze results:
D. Present a summary:
Test Results: X passed, Y failed, Z skipped
Failures:
1. [test name] - [brief diagnosis]
Fix: [specific suggestion]
2. [test name] - [brief diagnosis]
Fix: [specific suggestion]
</run_tests>
<suggest_tests>
Suggest what to test when no arguments are given.
A. Check recent changes:
Working directory check: if your dispatch context specifies a working directory and
pwddoes not match it, prefix the git commands below with-C <that path>(e.g.git -C /path/to/worktree diff --name-only HEAD~5).
git diff --name-only HEAD~5 to find recently changed filesgit diff --name-only --cached for staged filesB. Check test coverage gaps:
C. Present suggestions:
Suggested files to test (based on recent changes and coverage gaps):
1. [file path] - modified recently, no test file exists
2. [file path] - modified recently, tests exist but may need updating
3. [file path] - no test coverage found
Run `/test <file path>` to generate tests for any of these.
Run `/test run` to run the existing test suite.
</suggest_tests>
</quick_start>
<critical_rules>
</critical_rules>
<success_criteria>
Before completing:
</success_criteria>
Orchestrate GSD (Get Shit Done) projects programmatically via headless CLI. Use when an agent needs to create milestones from specs, execute software development workflows, monitor task progress, check project status, or control GSD execution (pause/stop/skip/steer). Triggers on requests to "run gsd", "create milestone", "execute project", "check gsd status", "orchestrate development", "run headless workflow", or any programmatic interaction with the GSD project management system. Essential for building orchestrators that coordinate multiple GSD workers.
Post-mortem a failed GSD auto-mode run. Traces from symptom to root cause using `.gsd/activity/*.jsonl`, `.gsd/journal/YYYY-MM-DD.jsonl`, `.gsd/metrics.json`, and `.gsd/auto.lock`. Produces a filing-ready bug report with file:line references and a concrete fix suggestion. Use when asked to "forensics", "post-mortem", "why did auto-mode fail", "trace the stuck loop", "debug the crash", after `/gsd forensics` is invoked, or when a session ended in an unexpected terminal state. Reads existing artifacts — does NOT re-run anything.
Build software products autonomously via GSD headless mode. Handles the full lifecycle: write a spec, launch a build, poll for completion, handle blockers, track costs, and verify the result. Use when asked to "build something", "create a project", "run gsd", "check build status", or any task that requires autonomous software development via subprocess.
Create, debug, and iterate on GSD extensions (TypeScript modules that add tools, commands, event hooks, custom UI, and providers to GSD). Use when asked to build an extension, add a tool the LLM can call, register a slash command, hook into GSD events, create custom TUI components, or modify GSD behavior. Triggers on "create extension", "build extension", "add a tool", "register command", "hook into gsd", "custom tool", "gsd plugin", "gsd extension".
Block completion claims until verification evidence has been produced in the current message. Use before marking a task/slice/milestone complete, before creating a commit or PR, before saying "it works" or "tests pass", and any time you are about to claim work is done. The rule is: evidence before claims, always — running the verification must happen now, not "earlier in the session". Fresh output or no claim.
Lint and format code. Auto-detects ESLint, Biome, Prettier, or language-native formatters and runs them with auto-fix. Reports remaining issues with actionable suggestions.