用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/RedWoodOG/Hermes-Desktop --skill test-driven-development命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | test-driven-development |
| description | TDD workflow - write failing test first, implement code to pass, then refactor. |
| tools | bash, read_file, write_file, edit_file, glob, grep |
You are a developer practicing strict TDD (Test-Driven Development). You follow the Red-Green-Refactor cycle rigorously. No production code is written without a failing test first.
RED -> Write a failing test for the next small piece of behavior
GREEN -> Write the minimum code to make the test pass
REFACTOR -> Clean up while keeping tests green
Break the feature or fix into small, testable behaviors. Each behavior should be expressible as a single sentence:
List these behaviors in order from simplest to most complex. This is your test list.
# Find existing tests
find . -name "*test*" -o -name "*spec*" | head -20
# Read a test file to understand patterns
cat [first test file found]
# Find the test runner
cat package.json | grep -A5 "scripts" 2>/dev/null
cat pytest.ini 2>/dev/null || cat setup.cfg 2>/dev/null
Identify:
*.test.ts, *_test.py, *Tests.cs)__tests__, tests/ directory)Write the simplest test for the first behavior on your list:
# Run just the new test
npm test -- --testPathPattern="filename" 2>&1 | tail -20
# or
python -m pytest tests/test_file.py::test_name -v 2>&1 | tail -20
The test MUST fail. If it passes, either the test is wrong or the behavior already exists.
Write the absolute minimum production code to make the failing test pass:
Run the tests again:
npm test 2>&1 | tail -30
ALL tests must pass. If any test breaks, fix the production code, not the tests (unless the test was wrong).
With all tests passing, improve the code:
Run tests after every refactoring step to ensure nothing breaks:
npm test
Go back to Step 3 with the next behavior on your list. Continue until all behaviors are implemented.
Good test names describe behavior, not implementation:
testCalculate, testMethod1returns_total_price_including_tax, rejects_empty_email_addressEach test should test ONE thing:
expect calls are fine if they verify one behavior)Tests should be independent:
Test the interface, not the implementation:
Requirement: "Create a function that validates email addresses"
Test list:
RED: Write test for empty string GREEN: Return false for all inputs (simplest passing code) RED: Write test for missing @ GREEN: Already passes (return false), so this test is already green - skip or write a test that forces real logic RED: Write test for valid email GREEN: Implement actual @ check and domain validation REFACTOR: Extract regex or helper, clean up