TDD Commit
호출 방법
/tdd-commit [story-id]- 인수 없음 —
.tdd-sessions/에서 활성 세션 파일을 자동 감지 - 스토리 ID 제공 —
.tdd-sessions/{story-id}.md를 직접 사용
1단계: 세션 파일 찾기
.tdd-sessions/내 파일 목록 조회- 디렉토리가 존재하지 않거나 비어 있는 경우:
"No active TDD session found. Create or restore a session file, then try again."중단. - 파일이 정확히 하나인 경우: 해당 파일 사용
- 파일이 여러 개인 경우:
"Multiple sessions found. Which story are you committing? [1] 12345678.md — User Profile Update [2] payment-intent-2026-03-31.md — (no ID) Type the number or story ID."일시 중지하고 선택을 기다림.
2단계: 변경 사항 요약 출력
## Changes Summary
**Story:** [ID]: [title]
**Stack:** [stack]
### Completed Tasks
- ✅ Task 1: [title] — [type]
- ✅ Task 2: [title] — [type]
- ⏳ Task 3: [title] — [type] ← skipped / not started
### Pending Tasks (not committed)
- [list any ⏳ pending tasks, or "none — all tasks complete"]미완료 태스크가 있는 경우 다음을 표시: "이 태스크들은 완료되지 않았으며 이번 커밋에 포함되지 않습니다."
3단계: 커밋 메시지 제안
Conventional Commits 형식 사용:
[#STORY-ID] feat(<scope>): <short description under 72 chars>
Implements [STORY-ID]: [story title]
Tasks completed:
- [task 1 title]: [one-line description of what was implemented]
- [task 2 title]: [one-line description]
- [task N title]: [one-line description]
TDD: ping-pong pair programming session스코프 선택
기술 레이어가 아닌 기능/도메인 이름을 사용:
| 컨텍스트 | 스코프 예시 |
|---|---|
| TypeScript React | user-profile, cart, checkout, auth |
| Kotlin/Java Spring | payment, order, user-service, notification |
| Python FastAPI | users, products, orders, auth |
타입 선택
| 상황 | 타입 |
|---|---|
| 새 기능 (가장 일반적) | feat |
| 버그 수정 | fix |
| 리팩토링만, 새로운 동작 없음 | refactor |
4단계: 커밋 미리보기 출력 후 일시 중지
## Commit Preview
**Message:**[full commit message]
**Files to stage:**
[list source + test files created or modified during the session]
(Build artifacts, .env files, and IDE folders will NOT be staged)
Ready to commit?
→ Type **"commit"** or **"ship it"** to execute
→ Type your preferred message to override it
→ Type **"cancel"** to exit without committing일시 중지하고 기다림.
5단계: 선택적 /context / /compact 안내
개발자가 commit 또는 ship it을 입력하면, 바로 커밋을 진행합니다. /context, /compact는 커밋 후 필요하면 실행하라고 짧게 안내만 남깁니다.
- 에이전트는
/context,/compact를 직접 실행하지 않습니다. - 이 안내 때문에 커밋을 지연하거나, 개발자의 완료 응답을 기다리지 않습니다.
표시:
Optional: after commit, review the relevant context usage with `/context` and compress it with `/compact` in the CLI.6단계: 커밋 실행
개발자가 확인하면 바로:
- 세션의 모든 소스 및 테스트 파일을 스테이징 (스테이징 금지:
.env,.env.*,target/,build/,dist/,__pycache__/,.gradle/등 빌드 아티팩트) git add [files]후git commit -m "[message]"실행- 결과 커밋 해시 출력:
✅ Committed: abc1234 feat(payment): add payment intent creation endpoint
7단계: 세션 파일 정리
- 모든 태스크가 ✅ 완료된 경우에만 세션 파일 삭제 여부를 묻습니다.
- 미완료 태스크가 하나라도 남아 있으면 세션 파일은 자동으로 유지합니다. 이 경우 삭제 여부를 묻지 않습니다.
모든 태스크가 완료된 경우에만 표시:
Delete `.tdd-sessions/[filename]`? (yes / no)
→ "yes" — delete the file
→ "no" — keep it미완료 태스크가 남아 있는 경우 표시:
Session file kept: `.tdd-sessions/[filename]`
Pending tasks remain. Continue this work from the session file when you're ready.삭제 후 .tdd-sessions/가 비어 있어도 그대로 두면 됩니다 — 이미 gitignore에 등록되어 있습니다.
8단계: 커밋 완료 안내
- 모든 태스크가 완료된 경우에만 작업 종료 안내를 짧게 표시합니다.
- 미완료 태스크가 남아 있는 경우에는 새 대화를 권장하지 않고, 같은 작업을 현재 세션 파일 기준으로 이어가도록 안내합니다.
모든 태스크가 완료된 경우 표시:
✅ TDD commit flow complete.
All tasks are complete.미완료 태스크가 남아 있는 경우 표시:
✅ TDD commit flow complete.
Pending tasks remain.
Continue this work in the current session when you're ready.레퍼런스 파일
| 파일 | 읽는 시점 |
|---|---|
references/commit-conventions.md | 전체 커밋 형식 규칙 및 멀티 세션 전략 |