preyan/0xchess/tdd
Claude Code and agent skill by preyan/0xchess
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Test-Driven Development enforcement skill. Activates full TDD mode. Activate when: TDD, test-driven, test first, red-green-refactor, write tests first.
Install
npx vskill@latest install preyan/0xchess/tddSKILL.md
The same SKILL.md was published earlier as zereight/gitlab-mcp/tdd.
TDD — Test-Driven Development
THE IRON LAW: Write the failing test FIRST. Always.
The Red-Green-Refactor Cycle
Step-by-Step Protocol
1. RED Phase
- Identify the smallest next behavior to implement
- Write a test that describes that behavior as a named
it()/test()/def test_ - Run the test — it MUST FAIL. If it passes, the test is wrong.
- Confirm the failure message is the RIGHT failure (not a syntax error)
2. GREEN Phase
- Write the MINIMUM code to make the test pass
- Do not add extra logic, default parameters, or "nice-to-haves"
- Run ALL tests — the new test must pass; existing tests must not break
3. REFACTOR Phase
- Look at the code — can it be cleaner without changing behavior?
- Apply simplification patterns (see
/ai-slop-cleanerand/coding-standards) - Run tests after EVERY change. If tests break, undo immediately.
TDD Gate — When to Stop
| 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. |
Naming Tests as Specifications
Tests are executable documentation. Name them as complete sentences:
Framework Quick Reference
| 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 |
Common TDD Pitfalls
| 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 |
See Also
@test-engineer— test strategy, framework detection, coverage gap analysis/ultraqa— QA cycling: test, verify, fix, repeat/verify— evidence-based completion verification
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/tdd/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/preyan/0xchess/tdd)