一键导入
tdd
Test-Driven Development enforcement skill. Activates full TDD mode. Activate when: TDD, test-driven, test first, red-green-refactor, write tests first.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Test-Driven Development enforcement skill. Activates full TDD mode. Activate when: TDD, test-driven, test first, red-green-refactor, write tests first.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use this skill when working with the GitLab MCP server tools for merge requests, issues, repositories, pipelines, work items, variables, dependency proxy, webhooks, search, CI catalog, and related GitLab workflows.
Clean AI-generated code slop with regression-safe workflow. Activate when user says: deslop, anti-slop, AI slop, cleanup slop, clean up this code, remove bloat.
Cancel any active OMG mode and clean up state. Activate when user says: cancel, stop, cancelomg, stopomg, abort, kill it, stop everything.
Claude-Codex-Gemini tri-model orchestration for multi-perspective analysis. Activate when user says: ccg, tri-model, three models, multi-model, cross-validate, get multiple opinions, compare models.
Canonical cross-language coding standards reference. Shared rules embedded by reviewer agents. Activate when: viewing coding standards, checking naming rules, reviewing style baseline, consulting style guide, what are the rules.
2-stage pipeline: trace (causal investigation) then deep-interview (requirements). Activate when user says: deep dive, deep-dive, investigate deeply, trace and interview.
| name | tdd |
| description | Test-Driven Development enforcement skill. Activates full TDD mode. Activate when: TDD, test-driven, test first, red-green-refactor, write tests first. |
| argument-hint | [feature or function to implement with TDD] |
THE IRON LAW: Write the failing test FIRST. Always.
RED → Write a failing test for the NEXT behavior
GREEN → Write ONLY enough code to make it pass (no extras)
REFACTOR → Clean up code quality (tests must stay green after every change)
REPEAT
it() / test() / def test_// Example: RED — test fails because function doesn't exist yet
it('returns an empty array for an empty input', () => {
const result = parseItems([]);
expect(result).toEqual([]); // FAILS: parseItems is not defined
});
// Example: GREEN — just enough to pass
function parseItems(input: string[]): string[] {
return []; // only enough for the current test
}
/ai-slop-cleaner and /coding-standards)| Situation | Action |
|---|---|
| Code written before test | STOP. Delete production code. Write test first. |
| Test passes on first run (no prior code) | The test is wrong — fix it to fail first. |
| Multiple behaviors in one test | STOP. One test, one behavior. |
| Skipping refactor to go faster | Go back. Clean up before next feature. |
Tests are executable documentation. Name them as complete sentences:
// BAD
it('test1', ...)
it('works with empty', ...)
// GOOD
it('returns empty array when input is empty', ...)
it('throws ValidationError when email is missing @', ...)
it('sends exactly one email when user registers', ...)
| Framework | Failing assertion | Run single test |
|---|---|---|
| Vitest | expect(x).toBe(y) | npx vitest run -t "test name" |
| Jest | expect(x).toBe(y) | npx jest -t "test name" |
| pytest | assert x == y | pytest -k "test_name" |
| cargo test | assert_eq!(x, y) | cargo test test_name |
| go test | t.Errorf(...) | go test -run TestName |
| Pitfall | Fix |
|---|---|
| Testing implementation details | Test behavior (outputs), not internals (private methods) |
| One test for 10 behaviors | Split into atomic test cases |
| Mock everything (over-mocking) | Mock at system boundaries only (DB, HTTP, filesystem) |
| No triangulation | Write 2-3 tests that force the correct implementation to emerge |
| Untriangulated constants | return 42 passes one test — add a second test to force real logic |
@test-engineer — test strategy, framework detection, coverage gap analysis/ultraqa — QA cycling: test, verify, fix, repeat/verify — evidence-based completion verification