implementing-with-tdd
테스트 주도 개발로 코드 구현
코드보다 먼저 테스트를 작성하면 신뢰할 수 있고 유지보수하기 쉬운 소프트웨어를 보장할 수 있습니다. 이 스킬은 테스트 작성, red-green-refactor 워크플로, 프로젝트별 테스트 규칙을 포함한 TDD 사이클을 개발자에게 안내합니다.
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“implementing-with-tdd”。 Use implementing-with-tdd to add user authentication feature
预期结果:
- 1. Update task status to in_progress
- 2. Create test in tests/test_auth.py
- 3. Run pytest (expect failure)
- 4. Implement auth logic in tools/cli/bpsai_pair/
- 5. Run pytest (expect pass)
- 6. Refactor if needed
- 7. Complete via managing-task-lifecycle skill
正在使用“implementing-with-tdd”。 Use implementing-with-tdd to fix a payment calculation bug
预期结果:
- 1. Update task to in_progress
- 2. Write test that reproduces the bug
- 3. Run pytest to confirm failure
- 4. Implement fix in payment module
- 5. Run pytest to confirm pass
- 6. Run full CI suite
- 7. Complete task
正在使用“implementing-with-tdd”。 Use implementing-with-tdd to refactor the user model
预期结果:
- 1. Run tests to confirm baseline (all pass)
- 2. Identify refactoring target
- 3. Write or update tests
- 4. Make incremental changes
- 5. Verify tests stay green
- 6. Run ruff check
- 7. Complete via managing-task-lifecycle
安全审计
安全This is a pure prompt-based skill containing only documentation and guidance for test-driven development workflows. The static analyzer flagged documentation text as security issues: 'Hardcoded URL' refers to a metadata source_url field, 'Weak cryptographic algorithm' is a false positive from matching 'TDD' text, and 'Ruby/shell backtick execution' refers to markdown code blocks showing legitimate pytest and ruff commands. No executable code, network requests, or file system modifications exist. Safe to publish.
风险因素
质量评分
你能构建什么
기능 구현
pytest 테스트와 함께 TDD 방법론을 따라 새 기능 추가
버그 수정 검증
수정 전에 실패하는 테스트로 버그를 재현
코드 리뷰 준비
코드 변경에 대한 포괄적인 테스트 커버리지 확보
试试这些提示
Use implementing-with-tdd skill to add a new feature. Start with task update and write failing tests first.
Use implementing-with-tdd skill to fix the bug. Write a test that reproduces the issue before implementing the fix.
Use implementing-with-tdd skill to refactor. Ensure tests pass before and after changes using pytest.
Guide me through a complete TDD cycle: update task status, write failing test, implement code, verify green, refactor, and complete task.
最佳实践
- 각 단계를 검증하기 위해 red-green-refactor 순서로 항상 테스트를 실행
- 프로젝트 규칙에 따라 설명적인 테스트 이름 사용
- 완료로 표시하기 전에 전체 CI 스위트(bpsai-pair ci) 실행
- 단위 테스트에서 외부 서비스를 모킹하여 격리 보장
避免
- 테스트보다 구현 코드를 먼저 작성 (TDD 위반)
- 테스트 실행을 건너뛰고 코드가 동작한다고 가정
- 실패하는 테스트를 코드베이스에 남겨둠
- 구현을 고치지 않고 테스트를 수정해 통과시키기