| name | initiative-handoff |
| description | 현재 세션의 initiative 맥락을 다음 세션으로 넘기는 핸드오프 문서 작성. Use when the user says "핸드오프", "세션 정리", "다음 세션으로", or session handoff.
|
| spec-version | 2 |
| context | main |
| allowed-tools | ["Read","Write","Edit","Glob","Grep"] |
| argument-hint | [slug] |
Initiative Handoff
세션 연속성의 핵심. index.yml(구조) + handoff(운영 맥락) = 다음 세션 즉시 재개.
WHY
세션이 끊기면 "다음에 뭘 해야 하는가"가 손실된다. index.yml은 구조적 상태(stage, subtopic status)를 담지만, 다음 세션의 첫 액션이나 미결정 사항 같은 운영 맥락은 담지 않는다.
핸드오프 문서(workspace/inbox/prompts/{slug}.md)가 이 갭을 메운다.
Input
Required
- 활성 initiative:
$ARGUMENTS로 slug 지정, 또는 미지정 시 auto-detect
Auto-detect Logic
- 현재 대화에서 언급/작업한 initiative 식별
- 식별 불가 시
workspace/initiatives/active/에서 in_progress subtopic이 있는 initiative 목록 제시 → 사용자 선택
Output
workspace/inbox/prompts/{slug}.md — 핸드오프 문서
- 기존 파일이 있으면 덮어쓰기 (경고 1줄 출력)
STEPS
Step 1: Initiative 식별
$ARGUMENTS가 있으면 workspace/initiatives/active/{slug}/index.yml 로드
- 없으면 auto-detect → 사용자 선택
Step 2: 맥락 수집
index.yml에서 추출:
stage: 현재 단계
subtopics: 각 ST의 status 요약
decisions: 최근 결정 사항
relations: 연관 initiative
대화 맥락에서 추출:
- 이번 세션에서 한 일 (구체적 산출물)
- 다음에 해야 할 첫 번째 액션
- 미결정 사항 (사용자 입력 대기 중인 것)
Step 3: index.yml 맥락 보강
pending/in_progress ST를 순회하며, 대화에서 나왔지만 note에 누락된 맥락을 보강한다.
보강 대상:
- 합의된 방향/접근법이 ST note에 없는 경우
- 발견된 파일 목록, 참조 경로가 빠진 경우
- 실행 순서, 주의사항 등 다음 세션 즉시 필요한 맥락
보강 기준:
- note에 보강하면 핸드오프 문서 없이 index.yml만으로도 재개 가능성이 높아진다
- 이미 충분히 기록된 ST는 건너뛴다
Step 4: 핸드오프 문서 작성
workspace/inbox/prompts/{slug}.md:
# {slug} 세션 핸드오프
## 현재 상태
**Initiative**: `workspace/initiatives/active/{slug}/`
**Stage**: {stage}
**현재 ST**: {current_st} — {st_title}
### 완료된 것
- {이번 세션 산출물}
### 미결정 사항
- {pending_decisions}
## 다음 세션 할 일
1. {specific_first_action}
## 이 initiative 이후
{next_initiative 또는 "미정"}
## 참조
- {key_file_paths}
Step 5: 후속 경로 확인
대부분의 subtopic이 완료 상태인데 next_initiative가 없으면:
Step 6: 재개 프롬프트 출력
다음 세션에서 이렇게 시작하면 됩니다:
\`\`\`
/initiative:resume {slug}
\`\`\`
**다음 할 일**: {ST-XX} — {구체적 첫 번째 액션 1~2줄}
JUDGMENT
| 조건 | 행동 |
|---|
| slug 미지정 + in_progress ST 1개 | 해당 initiative 자동 선택 |
| slug 미지정 + in_progress ST 여러 개 | 목록 제시 → 사용자 선택 |
| slug 미지정 + in_progress ST 0개 | "활성 initiative가 없습니다." |
| 기존 handoff 파일 존재 | 덮어쓰기 + 경고 1줄 |
FLOW
nodes:
- id: identify
type: human
summary: "Initiative 식별 — slug 해석 또는 auto-detect"
- id: gather-context
type: auto
summary: "index.yml + 대화 맥락에서 상태/산출물/미결정 추출"
- id: enrich-index
type: auto
summary: "pending/in_progress ST의 note에 대화 맥락 보강"
side_effects:
- updates: workspace/initiatives/active/{slug}/index.yml
- id: write-handoff
type: auto
summary: "workspace/inbox/prompts/{slug}.md 작성"
side_effects:
- writes: workspace/inbox/prompts/{slug}.md
- id: check-next
type: auto
summary: "후속 경로 확인"
- id: present-resume
type: auto
summary: "재개 프롬프트 출력"
edges:
- from: identify → to: gather-context
- from: gather-context → to: enrich-index
- from: enrich-index → to: write-handoff
- from: write-handoff → to: check-next
- from: check-next → to: present-resume
KNOWLEDGE REFS
| 참조 | 역할 | 로드 시점 |
|---|
해당 initiative index.yml | 상태 추출 + 맥락 보강 대상 | Step 2, Step 3 |
workspace/squads/initiative/policies/stage-transition-rules.md | stage 의미 이해 | Step 2 |