Loading...
Loading...
단일 태스크의 RED-GREEN-REFACTOR TDD 루프를 ping-pong 방식으로 실행합니다. .tdd-sessions/에서 활성 세션 파일을 읽어 현재 태스크를 찾고, 개발자와 함께 전체 사이클을 진행하며 (테스트 작성과 구현을 번갈아가며), 완료 시 세션 파일을 업데이트합니다. 세션 파일을 생성하려면 먼저 /tdd-plan을 실행하세요.
npx skill4agent add junhyunny/skills tdd-task/tdd-task [story-id].tdd-sessions/.tdd-sessions/{story-id}.md.tdd-sessions/"No active TDD session found. Run /tdd-plan first to create a session.""Multiple sessions found. Which story are you working on?
[1] 12345678.md — User Profile Update
[2] user-profile-update-2026-03-31.md — (no ID)
Type the number or story ID.""All tasks in this session are complete. Run /tdd-commit to review and commit."⏳ pending🔄 active.tdd-session.md---
## 🏓 Session State
| Field | Value |
|--------------|-------|
| Story | [ID]: [title] |
| Stack | [stack] |
| Test FW | [framework] |
| E2E FW | [framework] |
| Conventions | [conventions summary] |
| Phase | RED / GREEN / REFACTOR |
| Current Task | [N] of [total]: [task title] |
| Turn | DEV / AI |
| Next Action | [one-line description] |
---
### Task Progress
| # | Title | Type | Status |
|---|-------|------|--------|
| 1 | [title] | unit | ✅ done / 🔄 active / ⏳ pending |
...Task [N]: [title]
Type: [unit/integration/e2e]
The first test will assert: [assertion description]
Who writes the first failing test?
→ **"me"** — I'll write it
→ **"you"** — AI writes it| 개발자 입력 | 효과 |
|---|---|
| AI가 현재 턴을 대신 진행 |
| 현재 태스크를 완료로 표시하고 다음으로 이동 |
| 세션 중지, 완료된 내용을 커밋하려면 /tdd-commit 실행 |
| 현재 태스크 초기화, RED부터 다시 시작 |
test/✏️ 테스트 파일 작성 완료: [정확한 파일 경로]
예상 실패:
[실패 메시지 예시]
테스트를 실행하고 RED 상태(올바른 이유로 실패)를 확인해주세요.
Type **"red confirmed"** or **"failing"** to continue.
(Or type "skip" to have AI write the implementation instead)## 🔴 RED — Your Turn
Task [N]: [task title]
Write a failing test that asserts: [assertion description]
Paste your test code here.
(Or type "skip" to have AI write it instead)✅ Correct RED ❌ Wrong RED (fix first)
─────────────────────────────────────────────────────────────────
TypeError: method is not a function SyntaxError: Cannot find module
AssertionError: expected null to equal {...} ImportError: cannot import name
MockKException: no answer found ClassNotFoundException✏️ 구현 파일 작성 완료: [정확한 파일 경로]
전체 테스트를 실행해주세요.
Type **"green confirmed"** or **"passing"** when all tests pass.
(Paste error output if tests still fail)## 🟢 GREEN — Your Turn
Write the minimum code to make the failing test pass.
No extra features — pass the test only.
Type **"done"** or **"green confirmed"** when all tests pass.
(Or type "skip" to have AI implement it instead)// ✅ Minimum — only what the current test needs
async getUser(id: string) {
return this.repository.findById(id)
}
// ❌ Over-engineering during GREEN
async getUser(id: string) {
const cached = this.cache.get(id) // no test for this yet
if (!cached) throw new Error(...) // no test for this yet
return cached
}**Refactoring suggestion [N]:** [one-line title]
Reason: [why this matters]
Before:
[code block]
After:
[code block]
Apply this refactor? (yes / no / modify)REFACTOR complete. Are all tests still GREEN?
Type **"green"** to continue to the next test..tdd-sessions/{story-id}.md✅ done/tdd-task✅ Task [N] complete: [task title]
Tasks remaining: [list of pending tasks]
→ Run **/tdd-task** to continue with Task [N+1]: [title]
→ Run **/tdd-commit** if you want to commit what's done so far| 파일 | 읽는 시점 |
|---|---|
| 스택별 전체 테스트 패턴 |
| 스택별 컨벤션 추출 |
| 상세 단계 완료 기준 |