okstra 0.20.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/docs/kr/performance-improvement-plan-v2.md +330 -0
  2. package/docs/kr/performance-improvement-plan.md +125 -0
  3. package/docs/project-structure-overview.md +386 -0
  4. package/docs/superpowers/plans/2026-05-14-convergence-queue-pruning.md +1568 -0
  5. package/package.json +1 -1
  6. package/runtime/BUILD.json +2 -2
  7. package/runtime/agents/SKILL.md +7 -1
  8. package/runtime/agents/workers/report-writer-worker.md +4 -0
  9. package/runtime/bin/okstra-codex-exec.sh +31 -0
  10. package/runtime/prompts/profiles/final-verification.md +8 -2
  11. package/runtime/prompts/profiles/implementation-planning.md +1 -1
  12. package/runtime/prompts/profiles/release-handoff.md +26 -28
  13. package/runtime/prompts/profiles/requirements-discovery.md +1 -1
  14. package/runtime/python/okstra_ctl/render.py +78 -4
  15. package/runtime/python/okstra_ctl/run_context.py +5 -0
  16. package/runtime/python/okstra_ctl/workflow.py +8 -7
  17. package/runtime/python/okstra_ctl/worktree.py +155 -12
  18. package/runtime/skills/okstra-brief/SKILL.md +523 -0
  19. package/runtime/skills/okstra-convergence/SKILL.md +149 -37
  20. package/runtime/skills/okstra-report-writer/SKILL.md +8 -6
  21. package/runtime/templates/prd/brief.template.md +12 -0
  22. package/runtime/templates/project-docs/task-index.template.md +12 -0
  23. package/runtime/templates/reports/error-analysis-input.template.md +12 -0
  24. package/runtime/templates/reports/final-report.template.md +39 -12
  25. package/runtime/templates/reports/final-verification-input.template.md +22 -0
  26. package/runtime/templates/reports/implementation-input.template.md +12 -0
  27. package/runtime/templates/reports/implementation-planning-input.template.md +12 -0
  28. package/runtime/templates/reports/quick-input.template.md +12 -0
  29. package/runtime/templates/reports/release-handoff-input.template.md +23 -10
  30. package/runtime/templates/reports/schedule.template.md +12 -0
  31. package/runtime/templates/reports/settings.template.json +83 -30
  32. package/runtime/templates/reports/task-brief.template.md +12 -0
@@ -0,0 +1,386 @@
1
+ # Okstra — 폴더 구조 및 기능 요약
2
+
3
+ > 본 문서는 PRD 작성을 위한 선행 분석 자료다. Okstra 프로젝트 전체의 폴더 구조, 주요 스킬, Python/Node.js 클래스·함수의 용도를 한눈에 정리한다.
4
+
5
+ ---
6
+
7
+ ## 목차
8
+
9
+ - [1. 프로젝트 정체성](#1-프로젝트-정체성)
10
+ - [2. 최상위 폴더 트리 (depth 2-3)](#2-최상위-폴더-트리-depth-2-3)
11
+ - [3. 폴더별 역할 및 주요 파일](#3-폴더별-역할-및-주요-파일)
12
+ - [3.1 `src/` — Node.js CLI 진입점 & 설치/진단](#31-src--nodejs-cli-진입점--설치진단)
13
+ - [3.2 `scripts/` — Python + Bash 런타임 소스](#32-scripts--python--bash-런타임-소스)
14
+ - [3.2.1 `okstra_ctl/` — 오케스트레이션 핵심](#321-scriptsokstra_ctl--오케스트레이션-핵심-python-약-30-모듈)
15
+ - [3.2.2 `okstra_project/` — 프로젝트 메타 리졸버](#322-scriptsokstra_project--프로젝트-메타-리졸버)
16
+ - [3.2.3 `okstra_token_usage/` — 토큰 & 비용 추적](#323-scriptsokstra_token_usage--토큰--비용-추적)
17
+ - [3.2.4 `lib/okstra/` — Bash 헬퍼](#324-scriptslibokstra--bash-헬퍼)
18
+ - [3.2.5 `lib/okstra-ctl/` — Bash CLI 라우팅](#325-scriptslibokstra-ctl--bash-cli-라우팅)
19
+ - [3.2.6 기타 최상위 스크립트](#326-기타-최상위-스크립트)
20
+ - [3.3 `prompts/` — Phase별 프롬프트 템플릿](#33-prompts--phase별-프롬프트-템플릿)
21
+ - [3.4 `templates/` — Render 산출물 템플릿](#34-templates--render-산출물-템플릿)
22
+ - [3.5 `validators/` — Workflow / Schedule 검증](#35-validators--workflow--schedule-검증)
23
+ - [3.6 `agents/` — Lead 정의 & Worker 정의](#36-agents--lead-정의--worker-정의)
24
+ - [3.7 `skills/` — 12개 Claude Code 슬래시 커맨드](#37-skills--12개-claude-code-슬래시-커맨드)
25
+ - [3.8 `bin/okstra` — Node.js CLI](#38-binokstra--nodejs-cli)
26
+ - [3.9 `tools/build.mjs` — 빌드 시스템](#39-toolsbuildmjs--빌드-시스템)
27
+ - [3.10 `tests/`, `tests-e2e/` — 검증](#310-tests-tests-e2e--검증)
28
+ - [3.11 `docs/` — 문서](#311-docs--문서)
29
+ - [4. Python 주요 모듈 · 클래스 요약](#4-python-주요-모듈--클래스-요약)
30
+ - [5. Node.js 주요 모듈 요약](#5-nodejs-주요-모듈-요약)
31
+ - [6. 런타임 저장소 구조 (설치 후)](#6-런타임-저장소-구조-설치-후)
32
+ - [7. 주요 워크플로우](#7-주요-워크플로우)
33
+ - [7.1 새 Task 시작 (`/okstra-run`)](#71-새-task-시작-okstra-run)
34
+ - [7.2 Phase Routing](#72-phase-routing)
35
+ - [7.3 Worker 검증 (Phase 4-5)](#73-worker-검증-phase-4-5)
36
+ - [7.4 최종 보고서 (Phase 6-7)](#74-최종-보고서-phase-6-7)
37
+ - [8. PRD 작성을 위한 다음 단계](#8-prd-작성을-위한-다음-단계)
38
+
39
+ ---
40
+
41
+ ## 1. 프로젝트 정체성
42
+
43
+ **Okstra** (v0.20.1)는 **Claude Code 기반 다중 에이전트 크로스 검증 오케스트레이터 런타임**이다.
44
+
45
+ - **모델**: Lead(사용자) + Worker(Claude / Codex / Gemini) 분업 구조
46
+ - **핵심 원칙**:
47
+ 1. 단일 진입점 — `prepare_task_bundle()` (CLI / Skill 양쪽이 동일 함수 호출)
48
+ 2. 지속적 작업 정체성 — `<project-id>/<task-group>/<task-id>` 키가 모든 phase·session·모델 업그레이드 동안 불변
49
+ 3. 의무적 Lead/Worker 계약 — phase별 허용/금지 산출·행동 규칙
50
+ - **배포 형태**: npm 패키지 `okstra` → 설치 시 `~/.okstra` 런타임 + `~/.claude/skills/` 내 12개 슬래시 커맨드 + 4종 worker 에이전트 자동 등록
51
+ - **Phase 흐름**: requirements-discovery → error-analysis → implementation-planning → implementation → final-verification → release-handoff
52
+
53
+ ---
54
+
55
+ ## 2. 최상위 폴더 트리 (depth 2-3)
56
+
57
+ ```
58
+ okstra/
59
+ ├── bin/okstra Node.js CLI 진입점 (12 sub-command 라우터)
60
+ ├── src/ 설치·진단·경로 해석 (Node.js ES 모듈)
61
+ ├── scripts/ Python + Bash 런타임 소스
62
+ │ ├── okstra.sh 주 CLI 래퍼
63
+ │ ├── okstra_ctl/ 순수 오케스트레이션 로직 (Python)
64
+ │ ├── okstra_project/ 프로젝트 메타 리졸버
65
+ │ ├── okstra_token_usage/ 토큰 / 비용 계산기
66
+ │ ├── lib/okstra/ bash 헬퍼 라이브러리
67
+ │ └── lib/okstra-ctl/ bash 서브커맨드 라우팅
68
+ ├── prompts/ Phase별 프롬프트 + 6개 task-type 프로필
69
+ ├── templates/ Render 산출물 템플릿 (reports, prd, project-docs)
70
+ ├── validators/ Workflow / Schedule / Run 검증 스크립트
71
+ ├── agents/ Lead SKILL.md + 4종 worker 정의
72
+ ├── skills/ 12개 Claude Code 슬래시 커맨드 (markdown)
73
+ ├── runtime/ build 산출물 (gitignored, install 대상)
74
+ ├── tools/build.mjs runtime/ 동기화 빌드 스크립트
75
+ ├── tests/ pytest 단위 테스트 36개
76
+ ├── tests-e2e/ bash E2E 시나리오 4개
77
+ ├── docs/ 한글 아키텍처 + 설계 문서
78
+ ├── package.json npm 메타 (v0.20.1)
79
+ ├── README.md / README.kr.md 영문 / 한글 사용 설명서
80
+ └── CHANGELOG.md / CHANGES.md 변경 이력
81
+ ```
82
+
83
+ ---
84
+
85
+ ## 3. 폴더별 역할 및 주요 파일
86
+
87
+ ### 3.1 `src/` — Node.js CLI 진입점 & 설치/진단
88
+
89
+ 각 모듈은 `run(args: string[]) → Promise<number>` 시그니처를 따른다. `bin/okstra`가 명령별로 동적 로드한다.
90
+
91
+ | 파일 | 용도 |
92
+ |------|------|
93
+ | `version.mjs` | 패키지 버전 조회 |
94
+ | `install.mjs` | `~/.okstra` 자동 프로비저닝, 스킬 MD 등록 |
95
+ | `doctor.mjs` | 런타임 상태 진단 (설치, Python import, 권한) |
96
+ | `paths.mjs` | 런타임 경로 JSON/Shell 출력 (`OKSTRA_*` 환경 변수) |
97
+ | `setup.mjs` | 프로젝트별 `.project-docs/okstra/project.json` 생성 |
98
+ | `check-project.mjs` | 현재 디렉토리가 okstra 프로젝트인지 검증 |
99
+ | `task-list.mjs` | 프로젝트 내 task 목록 JSON 반환 |
100
+ | `task-show.mjs` | 특정 task의 manifest + workflow phase 상태 |
101
+ | `worktree-lookup.mjs` | 작업별 git worktree 경로 조회 |
102
+ | `plan-validate.mjs` | Approved plan 파일의 approval marker 검증 |
103
+ | `render-bundle.mjs` | `prepare_task_bundle()` 산출 미리보기 |
104
+ | `uninstall.mjs` | `~/.okstra` 및 스킬 제거 |
105
+
106
+ **핵심 설계**: 모든 CLI 명령은 `okstra paths --shell` 결과를 환경변수로 로드한 뒤, Python의 단일 진입점 `okstra_ctl.run.prepare_task_bundle`을 호출한다. CLI(`okstra.sh`)와 skill(`okstra-run`)이 같은 Python 함수를 공유하는 **Rule of Two**를 강제한다.
107
+
108
+ ---
109
+
110
+ ### 3.2 `scripts/` — Python + Bash 런타임 소스
111
+
112
+ #### 3.2.1 `scripts/okstra_ctl/` — 오케스트레이션 핵심 (Python, 약 30 모듈)
113
+
114
+ | 모듈 | 주요 클래스 / 함수 |
115
+ |------|-------------------|
116
+ | `run.py` | `prepare_task_bundle(PrepareInputs) → PrepareOutputs` — 단일 권위 진입점 |
117
+ | `render.py` | `_render_*()` — 9개 산출물 (manifest, settings, discovery, brief, input, prompt, team-state, workflow, brief-input) |
118
+ | `workflow.py` | Phase sequence + 허용/금지 산출·행동 규칙 |
119
+ | `paths.py` | `compute_run_paths()` — Run 디렉토리 트리 계산 |
120
+ | `ids.py` | Run ID 조합/파싱, task segment slugify |
121
+ | `index.py` | `~/.okstra/recent.jsonl`, `active.jsonl` 기록 |
122
+ | `reconcile.py` | Active run 상태 수집 / 정규화 (타임아웃 처리) |
123
+ | `listing.py` | Task/run 테이블 포맷팅 |
124
+ | `resolver.py` | Run ID → file path 해석 |
125
+ | `worktree.py` | Git worktree 자동 프로비저닝 및 레지스트리 |
126
+ | `workers.py` | Worker 모델 할당 (Claude/Codex/Gemini) |
127
+ | `backfill.py` | 레거시 run 자동 마이그레이션 |
128
+ | `models.py` | `ModelAssignment`, `PrepareInputs`, `PrepareOutputs` 데이터클래스 |
129
+
130
+ #### 3.2.2 `scripts/okstra_project/` — 프로젝트 메타 리졸버
131
+
132
+ | 모듈 | 역할 |
133
+ |------|------|
134
+ | `resolver.py` | CWD에서 프로젝트 루트 및 `project.json` 찾기 |
135
+ | `state.py` | Project metadata 읽기 / 쓰기 |
136
+
137
+ #### 3.2.3 `scripts/okstra_token_usage/` — 토큰 & 비용 추적
138
+
139
+ | 모듈 | 역할 |
140
+ |------|------|
141
+ | `collect.py` | Claude/Codex/Gemini 세션 집계 |
142
+ | `pricing.py` | 모델별 가격 계산 (USD) |
143
+ | `report.py` | 최종 보고서에 토큰 블록 삽입 |
144
+ | `claude.py`, `codex.py`, `gemini.py` | 각 모델 세션 조회 어댑터 |
145
+
146
+ #### 3.2.4 `scripts/lib/okstra/` — Bash 헬퍼
147
+
148
+ | 파일 | 용도 |
149
+ |------|------|
150
+ | `globals.sh` | 환경 변수, 경로, 기본값 |
151
+ | `cli.sh` | `--task-type`, `--executor`, `--approve`, `--base-ref` 파싱 |
152
+ | `interactive.sh` | 사용자 입력 수집 (project root, task, model) |
153
+ | `project-resolver.sh` | CWD 기반 프로젝트 루트 찾기 (Bash 버전) |
154
+ | `usage.sh` | `okstra.sh --help` 텍스트 |
155
+
156
+ #### 3.2.5 `scripts/lib/okstra-ctl/` — Bash CLI 라우팅
157
+
158
+ `cmd-batch.sh`, `cmd-list.sh`, `cmd-rerun.sh`, `cmd-tail.sh`, `cmd-show.sh`, `cmd-open.sh`, `cmd-reconcile.sh`, `cmd-projects.sh`, `cmd-reindex.sh` 등 12개 서브커맨드.
159
+
160
+ #### 3.2.6 기타 최상위 스크립트
161
+
162
+ | 파일 | 용도 |
163
+ |------|------|
164
+ | `okstra.sh` | 주 CLI 진입점 |
165
+ | `okstra-central.sh` | `record_start` 중앙 lock 관리 |
166
+ | `okstra-codex-exec.sh` | Codex worker executor (live log mirror, tmux trace pane) |
167
+ | `okstra-gemini-exec.sh` | Gemini worker executor |
168
+ | `okstra-error-log.py` | Worker 오류 패턴 분석 |
169
+ | `okstra-spawn-followups.py` | Phase 완료 후 다음 phase dispatch |
170
+ | `okstra-token-usage.py` | Token collection CLI 엔트리 |
171
+
172
+ ---
173
+
174
+ ### 3.3 `prompts/` — Phase별 프롬프트 템플릿
175
+
176
+ | 파일 | 용도 |
177
+ |------|------|
178
+ | `launch.template.md` | Lead 시작 프롬프트 (task brief, worker 할당, 규칙 로드) |
179
+ | `profiles/_common-contract.md` | 모든 phase 공통 Lead/Worker 계약 |
180
+ | `profiles/requirements-discovery.md` | Phase 1: 작업 분류 & 라우팅 |
181
+ | `profiles/error-analysis.md` | Phase 2: 증상 재현 & 근본 원인 |
182
+ | `profiles/implementation-planning.md` | Phase 3: 옵션 검토 & 승인 대기 |
183
+ | `profiles/implementation.md` | Phase 4: 코드 편집 & Worker 검증 |
184
+ | `profiles/final-verification.md` | Phase 5: 최종 verdict |
185
+ | `profiles/release-handoff.md` | Phase 6: Commit/PR/Deploy |
186
+
187
+ ---
188
+
189
+ ### 3.4 `templates/` — Render 산출물 템플릿
190
+
191
+ - `templates/reports/` — task-brief, quick-input, implementation-planning-input, implementation-input, error-analysis-input, final-verification-input, release-handoff-input, final-report, schedule, settings.template.json
192
+ - `templates/prd/` — PRD 스타일 brief
193
+ - `templates/project-docs/` — Project-level task 카탈로그(task-index)
194
+
195
+ ---
196
+
197
+ ### 3.5 `validators/` — Workflow / Schedule 검증
198
+
199
+ | 파일 | 용도 |
200
+ |------|------|
201
+ | `validate-run.py` | Single run 검증 (manifest 스키마, 산출물 존재, phase 규칙) |
202
+ | `validate-schedule.py` | Task Group schedule 가능성 (의존성, 시간 추정) |
203
+ | `validate-workflow.sh` | Phase rule 적용 (forbidden actions 감지) |
204
+ | `lib/validate-*.sh` | 공용 검증 함수 (assets, prompt metadata, tasks) |
205
+
206
+ ---
207
+
208
+ ### 3.6 `agents/` — Lead 정의 & Worker 정의
209
+
210
+ | 파일 | 역할 |
211
+ |------|------|
212
+ | `SKILL.md` (28KB) | **okstra-lead** 에이전트 정의 (Phase 라우팅, Worker roster 검증) |
213
+ | `workers/claude-worker.md` | Claude read-only analyzer (phase 2-5 기본) |
214
+ | `workers/codex-worker.md` | Codex executor (implementation phase) |
215
+ | `workers/gemini-worker.md` | Gemini verifier (선택) |
216
+ | `workers/report-writer-worker.md` | Final report 작성 (phase 6) |
217
+
218
+ ---
219
+
220
+ ### 3.7 `skills/` — 12개 Claude Code 슬래시 커맨드
221
+
222
+ | ID | 이름 | 공개 | 용도 |
223
+ |----|------|------|------|
224
+ | 1 | okstra-run | YES | 새 task 시작 또는 다음 phase 진행 |
225
+ | 2 | okstra-status | YES | 현재 phase / blocker / workStatus 조회·갱신 |
226
+ | 3 | okstra-history | YES | 과거 실행 목록 + 재실행 |
227
+ | 4 | okstra-schedule | YES | Task Group 작업 일정 생성 |
228
+ | 5 | okstra-setup | YES | 프로젝트 첫 등록 (`project.json` 생성) |
229
+ | 6 | okstra-context-loader | NO | Task bundle 경로 / manifest 로드 (자동) |
230
+ | 7 | okstra-team-contract | NO | Lead/Worker 규칙 검증 (자동) |
231
+ | 8 | okstra-convergence | NO | Phase 5.5 consensus 수집 |
232
+ | 9 | okstra-report-writer | NO | Phase 6-7 최종 보고서 작성 |
233
+ | 10 | okstra-report-finder | NO | 보고서 검색 (자동 트리거) |
234
+ | 11 | okstra-time-summary | NO | 소요 시간 분석 |
235
+ | 12 | okstra-logs | YES | 로그 인벤토리·정리 (worker wrapper `*.log` sidecars 조회 및 cleanup 제안) |
236
+
237
+ 각 skill 구조: **Step 0 런타임 검증 → Step 1-N 작업 수행 → 실패 시 사용자 안내**.
238
+
239
+ ---
240
+
241
+ ### 3.8 `bin/okstra` — Node.js CLI
242
+
243
+ 12개 명령(`paths`, `install`, `ensure-installed`, `uninstall`, `doctor`, `setup`, `check-project`, `task-list`, `task-show`, `worktree-lookup`, `plan-validate`, `render-bundle`) 라우터. 명령 파싱 → `src/<cmd>.mjs` 동적 로드 → `run(args)` 호출 → exit code 반환.
244
+
245
+ ---
246
+
247
+ ### 3.9 `tools/build.mjs` — 빌드 시스템
248
+
249
+ `runtime/` 디렉토리를 `scripts/`, `skills/`, `agents/`, `prompts/`, `templates/`, `validators/`에서 동기화. `prepack` hook으로 npm publish 시 자동 실행.
250
+
251
+ ---
252
+
253
+ ### 3.10 `tests/`, `tests-e2e/` — 검증
254
+
255
+ | 종류 | 파일 수 | 용도 |
256
+ |------|--------|------|
257
+ | pytest 단위 | 36개 | `okstra_ctl.*` 모듈 단위 검증 |
258
+ | bash E2E | 4개 | record_start / rerun / lock / agent install |
259
+
260
+ ---
261
+
262
+ ### 3.11 `docs/` — 문서
263
+
264
+ - `docs/kr/architecture.md` — 내부 아키텍처
265
+ - `docs/kr/cli.md` — `okstra.sh` 인자 레퍼런스
266
+ - `docs/superpowers/plans/`, `docs/superpowers/specs/` — 내부 설계
267
+
268
+ ---
269
+
270
+ ## 4. Python 주요 모듈 · 클래스 요약
271
+
272
+ ### 4.1 데이터 클래스 (`okstra_ctl.models`)
273
+
274
+ - `PrepareInputs` — Task 입력 (task-type, brief path, projectId, models, base-ref, executor 등)
275
+ - `PrepareOutputs` — 산출물 경로 + 메타 (run_id, run_dir, manifest_path 등)
276
+ - `ModelAssignment` — Worker 모델 할당 (claude_worker_model / codex_executor_model / gemini_worker_model)
277
+ - `WorktreeEntry`, `WorktreeProvision` — Git worktree 메타
278
+
279
+ ### 4.2 주요 함수
280
+
281
+ - `prepare_task_bundle(inp)` — 단일 권위 진입점
282
+ - `compute_run_paths(ctx)` — Run 디렉토리 구조 계산
283
+ - `render_*()` — 9개 산출물 렌더
284
+ - `workflow_state(task_type, current_phase)` — 다음 phase 추천
285
+ - `reconcile_active(run_id)` — Active run 상태 수집
286
+ - `list_runs(project_root, since, filter)` — 과거 runs 조회
287
+ - `build_run_id(project_id, task_group, task_id, seq)` — Run ID 조합
288
+
289
+ ### 4.3 보조 영역
290
+
291
+ - `okstra_project`: `resolve_project_root(cwd)`, `load_project_meta()`, `upsert_project_meta()`
292
+ - `okstra_token_usage`: `collect()`, `claude_cost_usd()`, `codex_cost_usd()`, `gemini_cost_usd()`, `substitute_final_report()`
293
+
294
+ ---
295
+
296
+ ## 5. Node.js 주요 모듈 요약
297
+
298
+ 모든 ES 모듈은 `(args) → Promise<number>` 시그니처. `bin/okstra`가 동적 import로 라우팅한다.
299
+
300
+ | 카테고리 | 모듈 |
301
+ |---------|------|
302
+ | 설치 | `install.mjs`, `uninstall.mjs` |
303
+ | 진단 | `doctor.mjs`, `paths.mjs`, `version.mjs` |
304
+ | 프로젝트 | `setup.mjs`, `check-project.mjs` |
305
+ | Task 조회 | `task-list.mjs`, `task-show.mjs` |
306
+ | 실행 보조 | `worktree-lookup.mjs`, `plan-validate.mjs`, `render-bundle.mjs` |
307
+
308
+ ---
309
+
310
+ ## 6. 런타임 저장소 구조 (설치 후)
311
+
312
+ ```
313
+ ~/.okstra/
314
+ ├── version
315
+ ├── lib/python/{okstra_ctl, okstra_project, okstra_token_usage, lib/}
316
+ ├── bin/{okstra.sh, okstra-codex-exec.sh, okstra-gemini-exec.sh, *.py}
317
+ ├── recent.jsonl 모든 runs 기록 (최신순)
318
+ ├── active.jsonl 진행 중인 runs
319
+ ├── worktrees/registry.json worktree 레지스트리
320
+ ├── projects/ 프로젝트별 메타 미러
321
+ └── archive/ 완료된 runs
322
+
323
+ ~/.claude/skills/okstra-*/SKILL.md 12개 슬래시 커맨드
324
+ ~/.claude/agents/{claude,codex,gemini,report-writer}-worker.md
325
+
326
+ <PROJECT_ROOT>/.project-docs/okstra/
327
+ ├── project.json {projectId, projectRoot, ...}
328
+ ├── discovery/{task-catalog.json, latest-task.json}
329
+ └── tasks/<task-group>/<task-id>/<seq>/
330
+ ├── task-manifest.json
331
+ ├── run-context.json
332
+ ├── runs/<phase>/ phase별 입력·산출
333
+ ├── reports/final-report.md
334
+ └── sessions/ Lead/Worker transcript
335
+ ```
336
+
337
+ ---
338
+
339
+ ## 7. 주요 워크플로우
340
+
341
+ ### 7.1 새 Task 시작 (`/okstra-run`)
342
+
343
+ 1. **Step 0** — `okstra ensure-installed`, `okstra paths --shell`
344
+ 2. **Step 1** — `okstra check-project --json`로 프로젝트 검증
345
+ 3. **Step 2** — 기존 vs 신규 task 선택
346
+ 4. **Step 3** — 입력 수집 (task-type, brief, model, executor, base-ref)
347
+ 5. **Step 4** — `prepare_task_bundle(PrepareInputs)` 호출
348
+ - Task key 생성 / 검증
349
+ - Git worktree 자동 프로비저닝 (첫 phase)
350
+ - 9개 산출물 렌더
351
+ - `~/.okstra/recent.jsonl` 기록
352
+ 6. **Step 5** — Lead 프롬프트 로드 후 `exec claude`
353
+
354
+ ### 7.2 Phase Routing
355
+
356
+ `requirements-discovery → error-analysis → implementation-planning → implementation → final-verification → release-handoff`
357
+
358
+ 각 phase의 허용/금지 규칙은 `prompts/profiles/<task-type>.md` + `_common-contract.md`로 정의된다.
359
+
360
+ ### 7.3 Worker 검증 (Phase 4-5)
361
+
362
+ - **Codex executor**: worktree 내 코드 편집 + commit
363
+ - **Gemini verifier**: read-only 코드 리뷰 (선택)
364
+ - **Claude verifier**: read-only 최종 검증
365
+ - **Consensus**: Lead가 여러 verifier 판정을 종합 (`okstra-convergence`)
366
+
367
+ ### 7.4 최종 보고서 (Phase 6-7)
368
+
369
+ - **Phase 6 release-handoff**: Commit / PR 초안, 사용자 선택
370
+ - **Phase 7 report-writer**: 최종 보고서 작성 후 archive
371
+
372
+ ---
373
+
374
+ ## 8. PRD 작성을 위한 다음 단계
375
+
376
+ 본 문서는 다음 PRD 작성 단계에서 다음 항목의 입력 자료가 된다:
377
+
378
+ 1. **제품 정의**: §1 정체성 → PRD의 Problem / Solution
379
+ 2. **사용자 흐름**: §7 워크플로우 → User Journey
380
+ 3. **기능 명세**: §3.7 Skills 12종, §3.6 Worker 4종, §4.2 주요 함수 → Feature list
381
+ 4. **시스템 경계**: §6 런타임 저장소 → System Architecture
382
+ 5. **검증 기준**: §3.5 validators, §3.10 tests → Acceptance Criteria
383
+
384
+ ---
385
+
386
+ *작성일: 2026-05-14 · 분석 대상: `claude/objective-einstein-250add` 브랜치 기준 okstra v0.20.1*