tdd-protocol
Use when starting implementation work
- License 许可
- MIT
- 最近更新
- 2026-10-13
- Stars
- ★ 4
- Forks
- 1
01 前言 Front Matter
- name
- tdd-protocol
- description
- Use when starting implementation work
- user-invocable
- true
- disable-model-invocation
- true
02 资源文件 1
- 参考文档README.md3.4 KB
03 SKILL.md 正文
TDD Protocol (DORA)
Cycle
Plan → Red → Green → Mutate → Refactor. Never skip phases.
Phases
- Plan: Design doc/plan before any code (brainstorm first)
- Red: Write failing test first. Signal:
[RED]- Define the expected behavior as a test
- Run test — confirm it fails for the right reason
- Only then proceed to Green
- Green: Minimum code to pass. Signal:
[GREEN]- Modify tests and implementation in separate turns
- Write the simplest code that makes the test pass
- No optimization, no cleanup — just pass
- Mutate: After Green, before Refactor. Signal:
[MUTATE]- Mutation-check guards by hand: delete or weaken the guard under test (the condition, the regex, the boundary check) and confirm the suite goes red
- If a mutated/weakened guard still passes the suite, your tests are theater — go back to Red and strengthen them
- For non-guard logic, an automated mutation tool (
gremlinsfor Go, Stryker for TS/JS) can supplement hand-checking when available; skip if tools unavailable
- Refactor: Clean up only after green + mutate. Signal:
[REFACTOR]- Checkpoint first if >3 files or >50 LOC changed
- Improve structure, naming, duplication
- Tests must still pass after refactoring
Rules
- Fitness function: Tests are contracts. Fix the implementation when a test fails (unless the test itself has a genuine bug).
- Batch size: Smallest PR-sized chunks. 1 concern = 1 PR
- Tests define "done". Implementation stops when tests pass
Enforcement
- Discipline-enforced, not hook-enforced: no automated guard blocks implementation writes. Catching yourself writing implementation before a failing test exists means you're in the wrong phase — stop and go back to Red.
- Escalation: When diff exceeds threshold, use isolated subagent contexts — one for Red (test writing), one for Green (implementation). Prevents same-author blind spots where the test writer unconsciously shapes tests to match the implementation they're already imagining.
04 同仓库更多 Skills
update-cursor-settings
Modify Cursor/VSCode user settings in settings.json. Use when you want to change editor settings, preferences, configuration, themes, font size, tab size, format on save, auto save, keybindings, or any settings.json values.
update-cli-config
View and modify Cursor CLI configuration settings in ~/.cursor/cli-config.json. Use when the user wants to change CLI settings, configure permissions, switch approval mode, enable vim mode, toggle display options, configure sandbox, or manage any CLI preferences.
statusline
Configure a custom status line in the CLI. Use when the user mentions status line, statusline, statusLine, CLI status bar, prompt footer customization, or wants to add session context above the prompt.
split-to-prs
Split current work into small reviewable PRs. Use when the user asks to split a chat, set of changes, branch, or PR.
shell
Runs the rest of a /shell request as a literal shell command. Use only when the user explicitly invokes /shell and wants the following text executed directly in the terminal.
sdk
Guide users building apps, scripts, CI pipelines, or automations on top of the Cursor SDK - TypeScript (`@cursor/sdk`) or Python (`cursor-sdk` / `cursor_sdk`). Use when the user mentions integrating, installing, or writing code against the Cursor SDK; says `Agent.create`, `Agent.prompt`, `Agent.resume`, `agent.send`, `run.stream`, `run.messages`, `CursorAgentError`, `@cursor/sdk`, `cursor-sdk`, or `cursor_sdk`; asks to run Cursor agents programmatically from a script, CI/CD pipeline, GitHub Action, backend service, or other code outside the Cursor IDE; wants to pick between local and cloud runtime, configure MCP servers for an SDK agent, or handle streaming, cancellation, or errors; or is wiring Cursor into an automation, bot, or REST `/v1/agents` migration. Use eagerly rather than answering from memory; the SDK surface evolves and this skill is the source of truth for the external packages.