用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/nirecom/agents --skill write-tests命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | write-tests |
| description | Plan and write test cases with high reasoning effort. Test iteration runs in a subagent to minimize confirmations. |
| model | sonnet |
| user-invocable | false |
Write or update tests for the current task.
WT-1. Read:
rules/core-principles.mdskills/_shared/test-design.mdrules/test.md — on-demand-only; never auto-injected, so this Read is mandatory
For parser / regex / allowlist targets, apply the Table-Driven Tests pattern from test-design/parser-regex-tests.md.
WT-2. Identify which source file(s) need tests.
WT-3. Enumerate call paths: For each source file from step WT-2, trace all integration
paths it participates in — what calls it, what it calls, and what format/contract
each boundary expects. For each boundary, list potential failure modes (wrong format,
missing field, wrong type, unexpected value). These become integration-path error
cases in the next step.
WT-4. List all planned test cases by category (include call-path error cases from step WT-3).
Then check via Bash:
bash -c 'cd "$AGENTS_CONFIG_DIR" && bash "$AGENTS_CONFIG_DIR/bin/confirm-off" CONFIRM_TESTS on'OFF: print the planned cases and proceed to step WT-5 without approval wait.ON or ERROR: present the planned cases to the user — do not write code until approved (existing behavior).
WT-5. Determine the subagent's model:bash -c 'node "$AGENTS_CONFIG_DIR/bin/workflow/read-complexity-evaluation" --session "$SESSION_ID"'. If output is not NONE, use the stored level and signals directly (parse level=<v> and signals=<csv>), then derive the model via high→opus, low→sonnet; skip the fallback below.NONE (fail-open for sessions without persisted evaluation): read skills/_shared/judge-task-complexity.md to load the signal table. Evaluate all signals against the task context, source files from steps WT-2–WT-3, and the planned test cases from step WT-4. Do not short-circuit on the first match. Apply the routing rule: 1+ signals → high→opus; 0 signals → low→sonnet; ambiguous → high→opus.Model selected: [opus|sonnet] (signals: [comma-separated triggered signal IDs, or "none"])
WT-6. Launch a subagent (Agent tool, mode: "default", model: <model from step WT-5>) to autonomously:
WT-6a. Write the test file(s).
WT-6b. Run tests with timeout.
WT-6c. Fix failures and re-run until green.
WT-6d. Review test coverage against skills/_shared/test-design.md categories — fix gaps.
WT-6e. Re-run tests until green.
The subagent prompt MUST include these structured fields so verbose output stays in the subagent context:
task_complexity_signals: list of triggered signal IDs from step WT-5 (or "none")source_files: list of source file paths from step WT-2planned_cases: list of planned test cases from step WT-4
The subagent prompt MUST instruct: edit only test files, never modify source code.
The subagent prompt MUST instruct: Read rules/shell-commands.md before the first Bash command — general-purpose dispatch does not inherit auto-injected rules.
The subagent prompt MUST instruct: Read rules/user-escalation.md before any system-state-changing command — general-purpose dispatch does not inherit auto-injected rules.
Note: the Stop-guard silence during dispatch is automatic (PostToolUse marks the step in_progress). Do not emit NEXT_STEP_PAUSE.
The subagent prompt MUST also include: "NEVER present diffs for approval. NEVER wait for user confirmation. Edit and run autonomously until tests pass."While the subagent runs, the orchestrator MAY run the WT-7 CONFIRM_TESTS gate probe (bin/confirm-off) — never read the test files the subagent is still writing (SC-W — skills/_shared/subagent-concurrency.md).
WT-7. Present the final test file content to the user for review — gated by CONFIRM_TESTS gate (post-action review):
bash -c 'cd "$AGENTS_CONFIG_DIR" && bash "$AGENTS_CONFIG_DIR/bin/confirm-off" CONFIRM_TESTS on'
OFF: skip this step; proceed directly to Completion (no user wait).ON or ERROR: present the test file content.After completing this skill:
git add tests/
The commit gate detects staged tests/ changes as evidence of completion.
Emit <<WORKFLOW_MARK_STEP_write_tests_complete>> from the linked worktree CWD (accepted only when staged or committed test evidence exists).
Note: Do not emit from main worktree.
/review-tests auto-backfills write_tests when evidence exists; the sentinel is a fallback for edge cases.If tests are genuinely not needed for this change:
echo "<<WORKFLOW_WRITE_TESTS_NOT_NEEDED: {reason}>>"