基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Mrlyk/superharness --skill test-driven-development命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Set up superharness in a project: scan the codebase to discover conventions and tech stack, write findings into .superharness/spec/, then distill them into AGENTS.md and CLAUDE.md. Use when the user asks to set up superharness, to scan or re-scan the codebase for conventions, or to generate or refresh AGENTS.md / CLAUDE.md.
Session start guide: explains how to use superharness skills and conventions. Injected by SessionStart hook.
Generate a developer-facing efficiency and focus-area report for a completed Superharness task. Use when the user asks to "生成开发者报告", "开发交接报告", "to-coder", "developer report", or when /superharness:to-coder is invoked.
| name | test-driven-development |
| description | Use when implementing any feature or bugfix, before writing implementation code |
| skill_type | rigid |
TDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good test is, where tests go, the anti-patterns, and the rules of the loop. Every section applies on every cycle — consult them before and during the loop, not after.
When exploring the codebase, read CONTEXT.md (if it exists) so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.
Before RED/GREEN verification, resolve the project's test command in this order:
.superharness/spec/testing/index.md when it exists.package.json, Python manifests, pom.xml, Gradle files, or Package.swift..superharness/spec/testing/index.md when that project convention allows updating the specification.Tests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification — "user can checkout with valid cart" tells you exactly what capability exists — and survives refactors because it doesn't care about internal structure.
See tests.md for examples and mocking.md for mocking guidelines.
A seam is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals.
Test only at pre-agreed seams. No test is written at an unconfirmed seam. You can't test everything — agreeing the seams up front is how testing effort lands on the critical paths and complex logic instead of every edge case.
For Full work, the approved plan task's Public Seams are already confirmed. Do not prompt the user again.
For Lite work, read contract.md Test Seams first; ask the user only when the relevant seam is missing or unclear.
Behavior slices carry a verification mode decided at plan time. Only tested slices enter the red-green loop. A verified slice is covered by its declared gate — run or confirm that gate's evidence; do not write a dedicated test for it. Never downgrade a tested slice on your own: when a slice looks misclassified, stop and return NEEDS_CONTEXT naming the slice instead of silently deviating.
When no mode is declared (legacy plans, direct invocations), treat a slice as tested only when it has an independent expectation source, meaningful error space (branching, boundaries, transformation, state transitions, protocol compatibility), and a failure observable at a public seam; otherwise name the gate that covers it.
expect(add(a, b)).toBe(a + b), a snapshot derived by hand the same way, a constant asserted equal to itself), so it passes by construction and can never disagree with the code. Expected values must come from an independent source of truth — a known-good literal, a worked example, the spec.tested; each verified slice got its gate evidence confirmed, not a new test.