test-driven-development
БесплатноБез исполняемых скриптовНе проверенRed-Green-Refactor: write tests first, then code to make them pass.
от workspace-dex★ 37 звёзд на GitHubОб этом скилле
Test-Driven Development
The Cycle
1. RED → Write failing test
2. GREEN → Write minimal code to pass
3. REFACTOR → Clean up while keeping tests green
When to Use TDD
- New features — define behavior upfront
- Bug fixes — write test that reproduces bug first
- Refactoring — ensure behavior preserved
- API design — tests as spec
How to Write Tests
1. Name Clearly
def test_user_can_login_with_valid_credentials():
...
def test_login_fails_with_wrong_password():
...
2. Test One Thing
- Each test = one behavior
- No multiple assertions that could fail for different reasons
3. AAA Pattern
def test_something():
# Arrange
setup_state()
# Act
result = do_something()
# Assert
assert result == expected
4. Meaningful Assertions
# Bad
assert user.is_valid()
# Good
assert user.has_permission("read")
assert user.email_verified == True
Common Mistakes
- Writing tests after code (not TDD)
- Testing implementation details
- Over-mocking
- Tests that depend on each other
- No edge case coverage
Quick Wins
- Start with edge cases: empty, null, zero
- Test error paths
- Test boundary conditions
Установить test-driven-development в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл test-driven-development?
Red-Green-Refactor: write tests first, then code to make them pass.
Как установить скилл test-driven-development?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл test-driven-development запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic