tdd-commit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

TDD Commit

TDD Commit

호출 방법

调用方式

/tdd-commit [story-id]
  • 인수 없음
    .tdd-sessions/
    에서 활성 세션 파일을 자동 감지
  • 스토리 ID 제공
    .tdd-sessions/{story-id}.md
    를 직접 사용

/tdd-commit [story-id]
  • 无参数 — 自动检测.tdd-sessions/中的活跃会话文件
  • 提供故事ID — 直接使用
    .tdd-sessions/{story-id}.md
    文件

1단계: 세션 파일 찾기

第1步:查找会话文件

  1. .tdd-sessions/
    내 파일 목록 조회
  2. 디렉토리가 존재하지 않거나 비어 있는 경우:
    "No active TDD session found. Run /tdd-plan to start a new session."
    중단.
  3. 파일이 정확히 하나인 경우: 해당 파일 사용
  4. 파일이 여러 개인 경우:
    "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."
    일시 중지하고 선택을 기다림.

  1. 查询
    .tdd-sessions/
    目录下的文件列表
  2. 目录不存在或为空时:
    "No active TDD session found. Run /tdd-plan to start a new session."
    终止执行。
  3. 目录下仅有一个文件时: 使用该文件
  4. 目录下有多个文件时:
    "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단계: 변경 사항 요약 출력

第2步:输出变更摘要

markdown
undefined
markdown
undefined

Changes Summary

Changes Summary

Story: [ID]: [title] Stack: [stack]
Story: [ID]: [title] Stack: [stack]

Completed Tasks

Completed Tasks

  • ✅ Task 1: [title] — [type]
  • ✅ Task 2: [title] — [type]
  • ⏳ Task 3: [title] — [type] ← skipped / not started
  • ✅ Task 1: [title] — [type]
  • ✅ Task 2: [title] — [type]
  • ⏳ Task 3: [title] — [type] ← skipped / not started

Pending Tasks (not committed)

Pending Tasks (not committed)

  • [list any ⏳ pending tasks, or "none — all tasks complete"]

미완료 태스크가 있는 경우 다음을 표시: "이 태스크들은 완료되지 않았으며 이번 커밋에 포함되지 않습니다."

---
  • [list any ⏳ pending tasks, or "none — all tasks complete"]

如果存在未完成任务,显示:"这些任务尚未完成,不会包含在本次提交中。"

---

3단계: 커밋 메시지 제안

第3步:提供提交消息建议

Conventional Commits 형식 사용:
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
使用Conventional Commits格式:
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
使用功能/领域名称,而非技术层:
上下文范围示例
TypeScript React
user-profile
,
cart
,
checkout
,
auth
Kotlin/Java Spring
payment
,
order
,
user-service
,
notification
Python FastAPI
users
,
products
,
orders
,
auth

타입 선택

类型选择

상황타입
새 기능 (가장 일반적)
feat
버그 수정
fix
리팩토링만, 새로운 동작 없음
refactor

场景类型
新增功能(最常见)
feat
修复Bug
fix
仅重构,无新功能改动
refactor

4단계: 커밋 미리보기 출력 후 일시 중지

第4步:输出提交预览后暂停

markdown
undefined
markdown
undefined

Commit Preview

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

일시 중지하고 기다림.

---
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단계: 커밋 실행

第5步:执行提交

개발자가 확인하면:
  1. 세션의 모든 소스 및 테스트 파일을 스테이징 (스테이징 금지:
    .env
    ,
    .env.*
    ,
    target/
    ,
    build/
    ,
    dist/
    ,
    __pycache__/
    ,
    .gradle/
    등 빌드 아티팩트)
  2. git add [files]
    git commit -m "[message]"
    실행
  3. 결과 커밋 해시 출력:
    ✅ Committed: abc1234 feat(payment): add payment intent creation endpoint

开发者确认后:
  1. 暂存会话期间创建或修改的所有源码和测试文件(禁止暂存:
    .env
    .env.*
    target/
    build/
    dist/
    __pycache__/
    .gradle/
    等构建制品)
  2. 执行
    git add [files]
    后运行
    git commit -m "[message]"
  3. 输出提交哈希结果:
    ✅ Committed: abc1234 feat(payment): add payment intent creation endpoint

6단계: 세션 파일 정리

第6步:清理会话文件

Delete `.tdd-sessions/[filename]`? (yes / no)
→ "yes" — delete the file
→ "no" — keep it (useful if the story spans multiple sessions)
일시 중지하고 기다림. 응답에 따라 실행.
삭제 후
.tdd-sessions/
가 비어 있어도 그대로 두면 됩니다 — 이미 gitignore에 등록되어 있습니다.

Delete `.tdd-sessions/[filename]`? (yes / no)
→ "yes" — 删除文件
→ "no" — 保留文件(适用于故事跨多个会话的场景)
暂停执行,等待用户输入,根据响应执行对应操作。
删除后即使
.tdd-sessions/
目录为空也可保留,该目录已加入gitignore。

레퍼런스 파일

参考文件

파일읽는 시점
.agents/skills/tdd-commit/references/commit-conventions.md
전체 커밋 형식 규칙 및 멀티 세션 전략
文件读取时机
.agents/skills/tdd-commit/references/commit-conventions.md
查看完整提交格式规则及多会话策略