okstra 0.34.1 → 0.36.1
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.
- package/README.kr.md +27 -19
- package/README.md +27 -19
- package/docs/kr/architecture.md +59 -45
- package/docs/kr/cli.md +61 -18
- package/docs/pr-template-usage.md +65 -0
- package/docs/project-structure-overview.md +353 -354
- package/docs/superpowers/plans/2026-05-12-ticket-id-in-reports.md +1 -1
- package/docs/superpowers/plans/2026-05-14-convergence-queue-pruning.md +1 -1
- package/docs/superpowers/plans/2026-05-17-dual-format-final-report.md +1 -1
- package/docs/superpowers/plans/2026-05-20-final-report-language.md +1501 -0
- package/docs/superpowers/plans/2026-05-20-implementation-planning-multi-stage.md +1267 -0
- package/docs/superpowers/plans/2026-05-20-okstra-run-prompt-sot-b1.md +1007 -0
- package/docs/superpowers/plans/2026-05-20-wizard-messages-json-sot.md +720 -0
- package/docs/superpowers/plans/2026-05-20-wizard-prompt-json-sot-a1.md +681 -0
- package/docs/superpowers/plans/2026-05-21-improvement-discovery-task-type.md +1691 -0
- package/docs/superpowers/plans/2026-05-24-implementation-lead-context-slimming.md +1700 -0
- package/docs/superpowers/specs/2026-05-20-final-report-language-design.md +383 -0
- package/docs/superpowers/specs/2026-05-20-implementation-planning-multi-stage-design.md +320 -0
- package/docs/superpowers/specs/2026-05-20-okstra-run-prompt-sot-design.md +299 -0
- package/docs/superpowers/specs/2026-05-21-improvement-discovery-task-type-design.md +335 -0
- package/docs/task-process/README.md +74 -0
- package/docs/task-process/common-flow.md +166 -0
- package/docs/task-process/error-analysis.md +101 -0
- package/docs/task-process/final-verification.md +167 -0
- package/docs/task-process/implementation-planning.md +128 -0
- package/docs/task-process/implementation.md +149 -0
- package/docs/task-process/release-handoff.md +206 -0
- package/docs/task-process/requirements-discovery.md +115 -0
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/agents/SKILL.md +30 -7
- package/runtime/agents/workers/claude-worker.md +31 -6
- package/runtime/agents/workers/codex-worker.md +37 -10
- package/runtime/agents/workers/gemini-worker.md +34 -7
- package/runtime/agents/workers/report-writer-worker.md +19 -10
- package/runtime/bin/okstra-central.sh +6 -6
- package/runtime/bin/okstra-codex-exec.sh +49 -28
- package/runtime/bin/okstra-gemini-exec.sh +39 -21
- package/runtime/bin/okstra-render-final-report.py +13 -2
- package/runtime/bin/okstra-wrapper-status.py +155 -0
- package/runtime/bin/okstra.sh +2 -2
- package/runtime/prompts/launch.template.md +1 -0
- package/runtime/prompts/profiles/_common-contract.md +11 -6
- package/runtime/prompts/profiles/_implementation-deliverable.md +53 -0
- package/runtime/prompts/profiles/_implementation-executor.md +60 -0
- package/runtime/prompts/profiles/_implementation-verifier.md +76 -0
- package/runtime/prompts/profiles/error-analysis.md +3 -7
- package/runtime/prompts/profiles/implementation-planning.md +22 -21
- package/runtime/prompts/profiles/implementation.md +28 -118
- package/runtime/prompts/profiles/improvement-discovery.md +42 -0
- package/runtime/prompts/profiles/release-handoff.md +1 -1
- package/runtime/prompts/profiles/requirements-discovery.md +8 -12
- package/runtime/prompts/wizard/prompts.ko.json +230 -0
- package/runtime/python/lib/okstra/cli.sh +2 -49
- package/runtime/python/lib/okstra/globals.sh +21 -21
- package/runtime/python/lib/okstra/interactive.sh +7 -7
- package/runtime/python/okstra_ctl/clarification_items.py +3 -9
- package/runtime/python/okstra_ctl/consumers.py +53 -0
- package/runtime/python/okstra_ctl/final_report_schema.py +0 -7
- package/runtime/python/okstra_ctl/i18n.py +73 -0
- package/runtime/python/okstra_ctl/improvement_lenses.py +44 -0
- package/runtime/python/okstra_ctl/index.py +1 -1
- package/runtime/python/okstra_ctl/paths.py +26 -20
- package/runtime/python/okstra_ctl/render.py +166 -207
- package/runtime/python/okstra_ctl/render_final_report.py +53 -10
- package/runtime/python/okstra_ctl/run.py +299 -108
- package/runtime/python/okstra_ctl/run_context.py +22 -0
- package/runtime/python/okstra_ctl/seeding.py +186 -0
- package/runtime/python/okstra_ctl/session.py +65 -7
- package/runtime/python/okstra_ctl/wizard.py +348 -127
- package/runtime/python/okstra_ctl/workflow.py +21 -2
- package/runtime/python/okstra_ctl/worktree.py +54 -1
- package/runtime/python/okstra_project/resolver.py +4 -3
- package/runtime/python/okstra_token_usage/report.py +2 -2
- package/runtime/schemas/final-report-v1.0.schema.json +22 -16
- package/runtime/skills/okstra-brief/SKILL.md +102 -218
- package/runtime/skills/okstra-convergence/SKILL.md +2 -3
- package/runtime/skills/okstra-inspect/SKILL.md +581 -0
- package/runtime/skills/okstra-report-writer/SKILL.md +35 -15
- package/runtime/skills/okstra-run/SKILL.md +8 -7
- package/runtime/skills/okstra-schedule/SKILL.md +14 -157
- package/runtime/skills/okstra-setup/SKILL.md +28 -1
- package/runtime/skills/okstra-team-contract/SKILL.md +16 -107
- package/runtime/templates/okstra.CLAUDE.md +104 -0
- package/runtime/templates/reports/brief.template.md +204 -0
- package/runtime/templates/reports/final-report.template.md +93 -98
- package/runtime/templates/reports/i18n/en.json +135 -0
- package/runtime/templates/reports/i18n/ko.json +135 -0
- package/runtime/templates/reports/implementation-planning-input.template.md +18 -0
- package/runtime/templates/reports/improvement-discovery-input.template.md +78 -0
- package/runtime/templates/reports/schedule.template.md +12 -3
- package/runtime/templates/reports/task-brief.template.md +2 -2
- package/runtime/templates/worker-prompt-preamble.md +108 -0
- package/runtime/validators/lib/fixtures.sh +30 -0
- package/runtime/validators/lib/runners.sh +1 -1
- package/runtime/validators/validate-implementation-plan-stages.py +211 -0
- package/runtime/validators/validate-run.py +121 -26
- package/runtime/validators/validate-workflow.sh +2 -2
- package/runtime/validators/validate_improvement_report.py +275 -0
- package/src/config.mjs +18 -0
- package/src/install.mjs +41 -14
- package/src/setup.mjs +133 -1
- package/src/uninstall.mjs +27 -3
- package/runtime/skills/okstra-history/SKILL.md +0 -165
- package/runtime/skills/okstra-logs/SKILL.md +0 -173
- package/runtime/skills/okstra-report-finder/SKILL.md +0 -111
- package/runtime/skills/okstra-status/SKILL.md +0 -246
- package/runtime/skills/okstra-time-summary/SKILL.md +0 -172
|
@@ -1,444 +1,443 @@
|
|
|
1
1
|
# Okstra — 폴더 구조 및 기능 요약
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> 현재 저장소 기준의 living map입니다. 빠른 사용법은 [`README.kr.md`](../README.kr.md), 내부 실행 계약은 [`docs/kr/architecture.md`](kr/architecture.md), CLI 세부 옵션은 [`docs/kr/cli.md`](kr/cli.md)를 함께 보세요.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## 목차
|
|
8
8
|
|
|
9
9
|
- [1. 프로젝트 정체성](#1-프로젝트-정체성)
|
|
10
|
-
- [2. 최상위
|
|
11
|
-
- [3.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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-작성을-위한-다음-단계)
|
|
10
|
+
- [2. 최상위 구조](#2-최상위-구조)
|
|
11
|
+
- [3. Build / install 경계](#3-build--install-경계)
|
|
12
|
+
- [4. 폴더별 역할](#4-폴더별-역할)
|
|
13
|
+
- [5. 주요 런타임 모듈](#5-주요-런타임-모듈)
|
|
14
|
+
- [6. 설치 후 저장소 구조](#6-설치-후-저장소-구조)
|
|
15
|
+
- [7. 핵심 워크플로우](#7-핵심-워크플로우)
|
|
16
|
+
- [8. 문서 유지보수 체크리스트](#8-문서-유지보수-체크리스트)
|
|
17
|
+
- [부록 A. Report / row ID 용어](#부록-a-report--row-id-용어)
|
|
38
18
|
|
|
39
19
|
---
|
|
40
20
|
|
|
41
21
|
## 1. 프로젝트 정체성
|
|
42
22
|
|
|
43
|
-
|
|
23
|
+
`okstra`는 npm package `okstra`로 배포되는 Claude Code용 multi-agent cross-verification runtime입니다. 단발성 reviewer가 아니라 stable task key를 중심으로 lead + worker 모델을 여러 lifecycle phase에 걸쳐 운영합니다.
|
|
44
24
|
|
|
45
|
-
|
|
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
|
|
25
|
+
현재 기준:
|
|
52
26
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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`가 명령별로 동적 로드한다.
|
|
27
|
+
- package version: `0.34.1`
|
|
28
|
+
- Node CLI entrypoint: `bin/okstra`
|
|
29
|
+
- Python orchestration authority: `scripts/okstra_ctl/run.py::prepare_task_bundle`
|
|
30
|
+
- lifecycle: `requirements-discovery → error-analysis → implementation-planning → implementation → final-verification → release-handoff`
|
|
31
|
+
- installed skills: 13개
|
|
32
|
+
- worker agents: `claude`, `codex`, `gemini`, `report-writer`
|
|
33
|
+
- final report SSOT: `schemas/final-report-v1.0.schema.json` + `*.data.json`
|
|
90
34
|
|
|
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
|
-
| `wizard.mjs` | okstra-run 인터랙티브 입력 상태머신 구동 (`init`/`step`/`render-args`/`confirmation`) |
|
|
105
|
-
| `uninstall.mjs` | `~/.okstra` 및 스킬 제거 |
|
|
35
|
+
설계 원칙:
|
|
106
36
|
|
|
107
|
-
|
|
37
|
+
1. **Single prepare authority**: slash skill, Bash CLI, Node preview 모두 `prepare_task_bundle()`로 수렴합니다.
|
|
38
|
+
2. **Stable task identity**: `<project-id>/<task-group>/<task-id>`가 phase, run, worktree, report를 관통합니다.
|
|
39
|
+
3. **Artifact-home rule**: okstra-owned project artifact root는 `<PROJECT_ROOT>/.project-docs/okstra/**` 하나입니다.
|
|
40
|
+
4. **Template/schema/validator lockstep**: `templates/`, `schemas/`, `validators/`, worker/report-writer 계약이 같은 report shape를 강제합니다.
|
|
108
41
|
|
|
109
42
|
---
|
|
110
43
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
#### 3.2.1 `scripts/okstra_ctl/` — 오케스트레이션 핵심 (Python, 약 30 모듈)
|
|
114
|
-
|
|
115
|
-
| 모듈 | 주요 클래스 / 함수 |
|
|
116
|
-
|------|-------------------|
|
|
117
|
-
| `run.py` | `prepare_task_bundle(PrepareInputs) → PrepareOutputs` — 단일 권위 진입점 |
|
|
118
|
-
| `render.py` | `_render_*()` — 9개 산출물 (manifest, settings, discovery, brief, input, prompt, team-state, workflow, brief-input) |
|
|
119
|
-
| `workflow.py` | Phase sequence + 허용/금지 산출·행동 규칙 |
|
|
120
|
-
| `paths.py` | `compute_run_paths()` — Run 디렉토리 트리 계산 |
|
|
121
|
-
| `ids.py` | Run ID 조합/파싱, task segment slugify |
|
|
122
|
-
| `index.py` | `~/.okstra/recent.jsonl`, `active.jsonl` 기록 |
|
|
123
|
-
| `reconcile.py` | Active run 상태 수집 / 정규화 (타임아웃 처리) |
|
|
124
|
-
| `listing.py` | Task/run 테이블 포맷팅 |
|
|
125
|
-
| `resolver.py` | Run ID → file path 해석 |
|
|
126
|
-
| `worktree.py` | Git worktree 자동 프로비저닝 및 레지스트리 |
|
|
127
|
-
| `workers.py` | Worker 모델 할당 (Claude/Codex/Gemini) |
|
|
128
|
-
| `backfill.py` | 레거시 run 자동 마이그레이션 |
|
|
129
|
-
| `models.py` | `ModelAssignment`, `PrepareInputs`, `PrepareOutputs` 데이터클래스 |
|
|
130
|
-
| `wizard.py` | `WizardState`, `Prompt`, `STEPS` — okstra-run 입력 수집 상태머신 (단일 권위) |
|
|
131
|
-
|
|
132
|
-
#### 3.2.2 `scripts/okstra_project/` — 프로젝트 메타 리졸버
|
|
133
|
-
|
|
134
|
-
| 모듈 | 역할 |
|
|
135
|
-
|------|------|
|
|
136
|
-
| `resolver.py` | CWD에서 프로젝트 루트 및 `project.json` 찾기 |
|
|
137
|
-
| `state.py` | Project metadata 읽기 / 쓰기 |
|
|
138
|
-
|
|
139
|
-
#### 3.2.3 `scripts/okstra_token_usage/` — 토큰 & 비용 추적
|
|
140
|
-
|
|
141
|
-
| 모듈 | 역할 |
|
|
142
|
-
|------|------|
|
|
143
|
-
| `collect.py` | Claude/Codex/Gemini 세션 집계 |
|
|
144
|
-
| `pricing.py` | 모델별 가격 계산 (USD) |
|
|
145
|
-
| `report.py` | 최종 보고서에 토큰 블록 삽입 |
|
|
146
|
-
| `claude.py`, `codex.py`, `gemini.py` | 각 모델 세션 조회 어댑터 |
|
|
147
|
-
|
|
148
|
-
#### 3.2.4 `scripts/lib/okstra/` — Bash 헬퍼
|
|
149
|
-
|
|
150
|
-
| 파일 | 용도 |
|
|
151
|
-
|------|------|
|
|
152
|
-
| `globals.sh` | 환경 변수, 경로, 기본값 |
|
|
153
|
-
| `cli.sh` | `--task-type`, `--executor`, `--approve`, `--base-ref` 파싱 |
|
|
154
|
-
| `interactive.sh` | 사용자 입력 수집 (project root, task, model) |
|
|
155
|
-
| `project-resolver.sh` | CWD 기반 프로젝트 루트 찾기 (Bash 버전) |
|
|
156
|
-
| `usage.sh` | `okstra.sh --help` 텍스트 |
|
|
157
|
-
|
|
158
|
-
#### 3.2.5 `scripts/lib/okstra-ctl/` — Bash CLI 라우팅
|
|
159
|
-
|
|
160
|
-
`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개 서브커맨드.
|
|
161
|
-
|
|
162
|
-
#### 3.2.6 기타 최상위 스크립트
|
|
163
|
-
|
|
164
|
-
| 파일 | 용도 |
|
|
165
|
-
|------|------|
|
|
166
|
-
| `okstra.sh` | 주 CLI 진입점 |
|
|
167
|
-
| `okstra-central.sh` | `record_start` 중앙 lock 관리 |
|
|
168
|
-
| `okstra-codex-exec.sh` | Codex worker executor (live log mirror, tmux trace pane) |
|
|
169
|
-
| `okstra-gemini-exec.sh` | Gemini worker executor |
|
|
170
|
-
| `okstra-trace-cleanup.sh` | Claude `/exit` 시 trace pane registry 청소 (`SessionEnd` 훅에서 호출) |
|
|
171
|
-
| `okstra-error-log.py` | Worker 오류 패턴 분석 |
|
|
172
|
-
| `okstra-spawn-followups.py` | Phase 완료 후 다음 phase dispatch |
|
|
173
|
-
| `okstra-token-usage.py` | Token collection CLI 엔트리 |
|
|
44
|
+
## 2. 최상위 구조
|
|
174
45
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
46
|
+
```text
|
|
47
|
+
okstra/
|
|
48
|
+
├── bin/okstra Node CLI router
|
|
49
|
+
├── src/ Node command modules
|
|
50
|
+
├── scripts/ Python + Bash runtime sources
|
|
51
|
+
│ ├── okstra_ctl/ orchestration core
|
|
52
|
+
│ ├── okstra_project/ project root / project.json resolver
|
|
53
|
+
│ ├── okstra_token_usage/ token usage + cost accounting
|
|
54
|
+
│ ├── okstra_vendor/ vendored Jinja2 / MarkupSafe
|
|
55
|
+
│ ├── lib/okstra/ Bash helpers for okstra.sh
|
|
56
|
+
│ └── lib/okstra-ctl/ Bash control-center subcommands
|
|
57
|
+
├── skills/ Claude Code skills (13)
|
|
58
|
+
├── agents/ lead SKILL.md + worker agent specs
|
|
59
|
+
├── prompts/ launch template, phase profiles, wizard prompt JSON
|
|
60
|
+
├── schemas/ JSON schema for final-report data.json
|
|
61
|
+
├── templates/ report, setup, PR, project-doc templates/assets
|
|
62
|
+
├── validators/ run / brief / schedule / view validators
|
|
63
|
+
├── tools/build.mjs source → runtime sync
|
|
64
|
+
├── runtime/ generated install payload; do not edit directly
|
|
65
|
+
├── tests/ pytest unit suite
|
|
66
|
+
├── tests-e2e/ Bash end-to-end scenarios
|
|
67
|
+
├── docs/ architecture, CLI, plans/specs
|
|
68
|
+
├── package.json npm metadata and published file list
|
|
69
|
+
├── README.md / README.kr.md user manuals
|
|
70
|
+
├── CHANGES.md / CHANGELOG.md human-authored and generated changelogs
|
|
71
|
+
└── RELEASING.md release process
|
|
72
|
+
```
|
|
193
73
|
|
|
194
|
-
|
|
195
|
-
- `templates/prd/` — PRD 스타일 brief
|
|
196
|
-
- `templates/project-docs/` — Project-level task 카탈로그(task-index)
|
|
74
|
+
`runtime/` is build output. Source edits go to `scripts/`, `skills/`, `agents/`, `prompts/`, `schemas/`, `templates/`, `validators/`; then `npm run build` syncs them into `runtime/`.
|
|
197
75
|
|
|
198
76
|
---
|
|
199
77
|
|
|
200
|
-
|
|
78
|
+
## 3. Build / install 경계
|
|
201
79
|
|
|
202
|
-
|
|
203
|
-
|------|------|
|
|
204
|
-
| `validate-run.py` | Single run 검증 (manifest 스키마, 산출물 존재, phase 규칙) |
|
|
205
|
-
| `validate-schedule.py` | Task Group schedule 가능성 (의존성, 시간 추정) |
|
|
206
|
-
| `validate-workflow.sh` | Phase rule 적용 (forbidden actions 감지) |
|
|
207
|
-
| `lib/validate-*.sh` | 공용 검증 함수 (assets, prompt metadata, tasks) |
|
|
80
|
+
### 3.1 npm package
|
|
208
81
|
|
|
209
|
-
|
|
82
|
+
`package.json` publishes:
|
|
210
83
|
|
|
211
|
-
|
|
84
|
+
- `bin/`
|
|
85
|
+
- `src/`
|
|
86
|
+
- `runtime/`
|
|
87
|
+
- `docs/`
|
|
88
|
+
- `README.md`
|
|
89
|
+
- `README.kr.md`
|
|
212
90
|
|
|
213
|
-
|
|
214
|
-
|------|------|
|
|
215
|
-
| `SKILL.md` (28KB) | **okstra-lead** 에이전트 정의 (Phase 라우팅, Worker roster 검증) |
|
|
216
|
-
| `workers/claude-worker.md` | Claude read-only analyzer (phase 2-5 기본) |
|
|
217
|
-
| `workers/codex-worker.md` | Codex executor (implementation phase) |
|
|
218
|
-
| `workers/gemini-worker.md` | Gemini verifier (선택) |
|
|
219
|
-
| `workers/report-writer-worker.md` | Final report 작성 (phase 6) |
|
|
91
|
+
So `runtime/` is not the only npm-published content. It is the install payload copied into `~/.okstra`.
|
|
220
92
|
|
|
221
|
-
|
|
93
|
+
### 3.2 Build sync
|
|
222
94
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
| ID | 이름 | 공개 | 용도 |
|
|
226
|
-
|----|------|------|------|
|
|
227
|
-
| 1 | okstra-run | YES | 새 task 시작 또는 다음 phase 진행 |
|
|
228
|
-
| 2 | okstra-status | YES | 현재 phase / blocker / workStatus 조회·갱신 |
|
|
229
|
-
| 3 | okstra-history | YES | 과거 실행 목록 + 재실행 |
|
|
230
|
-
| 4 | okstra-schedule | YES | Task Group 작업 일정 생성 |
|
|
231
|
-
| 5 | okstra-setup | YES | 프로젝트 첫 등록 (`project.json` 생성) |
|
|
232
|
-
| 6 | okstra-context-loader | NO | Task bundle 경로 / manifest 로드 (자동) |
|
|
233
|
-
| 7 | okstra-team-contract | NO | Lead/Worker 규칙 검증 (자동) |
|
|
234
|
-
| 8 | okstra-convergence | NO | Phase 5.5 consensus 수집 |
|
|
235
|
-
| 9 | okstra-report-writer | NO | Phase 6-7 최종 보고서 작성 |
|
|
236
|
-
| 10 | okstra-report-finder | NO | 보고서 검색 (자동 트리거) |
|
|
237
|
-
| 11 | okstra-time-summary | NO | 소요 시간 분석 |
|
|
238
|
-
| 12 | okstra-logs | YES | 로그 인벤토리·정리 (worker wrapper `*.log` sidecars 조회 및 cleanup 제안) |
|
|
239
|
-
| 13 | okstra-brief | YES | 요구사항 문서·티켓·링크·대화로부터 `okstra-run` 입력용 task brief 마크다운 생성 |
|
|
240
|
-
|
|
241
|
-
각 skill 구조: **Step 0 런타임 검증 → Step 1-N 작업 수행 → 실패 시 사용자 안내**.
|
|
95
|
+
`tools/build.mjs` rebuilds `runtime/` from:
|
|
242
96
|
|
|
243
|
-
|
|
97
|
+
| Source | Runtime destination |
|
|
98
|
+
|---|---|
|
|
99
|
+
| `scripts/okstra_project` | `runtime/python/okstra_project` |
|
|
100
|
+
| `scripts/okstra_ctl` | `runtime/python/okstra_ctl` |
|
|
101
|
+
| `scripts/okstra_token_usage` | `runtime/python/okstra_token_usage` |
|
|
102
|
+
| `scripts/okstra_vendor` | `runtime/python/okstra_vendor` |
|
|
103
|
+
| `scripts/lib` | `runtime/python/lib` |
|
|
104
|
+
| selected `scripts/okstra*.sh` / `*.py` entrypoints | `runtime/bin/` |
|
|
105
|
+
| `agents`, `prompts`, `schemas`, `templates`, `validators`, `skills` | same relative tree under `runtime/` |
|
|
244
106
|
|
|
245
|
-
|
|
107
|
+
`npm run build` and `prepack` both run this sync. Never hand-edit `runtime/`.
|
|
246
108
|
|
|
247
|
-
|
|
109
|
+
### 3.3 Install output
|
|
248
110
|
|
|
249
|
-
|
|
111
|
+
`okstra install` copies or symlinks:
|
|
250
112
|
|
|
251
|
-
|
|
113
|
+
- `runtime/python/*` → `~/.okstra/lib/python/`
|
|
114
|
+
- `runtime/bin/*` → `~/.okstra/bin/`
|
|
115
|
+
- `runtime/templates/*` → `~/.okstra/templates/`
|
|
116
|
+
- `runtime/skills/<name>` → `~/.claude/skills/<name>`
|
|
117
|
+
- `runtime/agents/workers/*.md` → `~/.claude/agents/*-worker.md`
|
|
118
|
+
- install manifests → `~/.okstra/installed-skills.json`, `~/.okstra/installed-agents.json`
|
|
119
|
+
- version stamp → `~/.okstra/version`
|
|
252
120
|
|
|
253
|
-
|
|
121
|
+
`--link <repo>` mode is for development and symlinks installed files back to repo sources.
|
|
254
122
|
|
|
255
123
|
---
|
|
256
124
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
125
|
+
## 4. 폴더별 역할
|
|
126
|
+
|
|
127
|
+
### 4.1 `bin/` and `src/` — Node CLI
|
|
128
|
+
|
|
129
|
+
`bin/okstra` is a thin dynamic-import router. Every command module exports `run(args) -> Promise<number>` or a named install/uninstall runner.
|
|
130
|
+
|
|
131
|
+
| Command | Module | Role |
|
|
132
|
+
|---|---|---|
|
|
133
|
+
| `paths` | `src/paths.mjs` | Resolve package/runtime/home paths |
|
|
134
|
+
| `install`, `ensure-installed` | `src/install.mjs` | Install or refresh runtime, skills, agents, templates |
|
|
135
|
+
| `uninstall` | `src/uninstall.mjs` | Remove managed runtime/skills/agents, optionally purge data |
|
|
136
|
+
| `doctor` | `src/doctor.mjs` | Diagnose runtime and Python imports |
|
|
137
|
+
| `setup` | `src/setup.mjs` | Create/update `<PROJECT_ROOT>/.project-docs/okstra/project.json` |
|
|
138
|
+
| `check-project` | `src/check-project.mjs` | Verify project registration |
|
|
139
|
+
| `config` | `src/config.mjs` | Read/write project/global settings such as PR template path |
|
|
140
|
+
| `task-list`, `task-show` | `src/task-list.mjs`, `src/task-show.mjs` | Task/run introspection for skills |
|
|
141
|
+
| `worktree-lookup` | `src/worktree-lookup.mjs` | Look up a task-key's registered worktree |
|
|
142
|
+
| `plan-validate` | `src/plan-validate.mjs` | Check approved-plan approval marker |
|
|
143
|
+
| `render-bundle` | `src/render-bundle.mjs` | Preview `prepare_task_bundle(render_only=True)` |
|
|
144
|
+
| `render-views` | `src/render-views.mjs` | Generate slim MD + self-contained HTML report views |
|
|
145
|
+
| `wizard` | `src/wizard.mjs` | Drive the `okstra-run` interactive state machine |
|
|
146
|
+
| `token-usage` | `src/token-usage.mjs` | Wrap installed Python token usage CLI |
|
|
147
|
+
|
|
148
|
+
`src/_python-helper.mjs` centralizes Node → Python execution so command modules do not duplicate subprocess wiring.
|
|
149
|
+
|
|
150
|
+
### 4.2 `scripts/` — Runtime source
|
|
151
|
+
|
|
152
|
+
Top-level scripts:
|
|
153
|
+
|
|
154
|
+
| File | Role |
|
|
155
|
+
|---|---|
|
|
156
|
+
| `okstra.sh` | Bash CLI wrapper around `prepare_task_bundle`, optionally launches `claude` |
|
|
157
|
+
| `okstra-ctl.sh` | Bash control center for list/show/open/rerun/reconcile/project commands |
|
|
158
|
+
| `okstra-central.sh` | Central run index writer / reconciler entrypoint |
|
|
159
|
+
| `okstra-codex-exec.sh`, `okstra-gemini-exec.sh` | Worker CLI wrappers with log/status sidecars |
|
|
160
|
+
| `okstra-wrapper-status.py` | Heartbeat sidecar writer used by worker wrappers |
|
|
161
|
+
| `okstra-token-usage.py` | Token usage CLI entrypoint |
|
|
162
|
+
| `okstra-render-final-report.py` | Render final-report Markdown from data.json |
|
|
163
|
+
| `okstra-render-report-views.py` | Render slim MD + HTML views from final-report Markdown |
|
|
164
|
+
| `okstra-error-log.py` | Normalize worker/lead error sidecars |
|
|
165
|
+
| `okstra-spawn-followups.py` | Follow-up spawning helper |
|
|
166
|
+
| `okstra-trace-cleanup.sh` | tmux trace pane cleanup |
|
|
167
|
+
|
|
168
|
+
### 4.3 `scripts/okstra_ctl/` — Python orchestration core
|
|
169
|
+
|
|
170
|
+
Important modules:
|
|
171
|
+
|
|
172
|
+
| Module | Role |
|
|
173
|
+
|---|---|
|
|
174
|
+
| `run.py` | `prepare_task_bundle()` single authority and CLI parser |
|
|
175
|
+
| `run_context.py` | Per-task mutex, run context and run-input persistence; `consumers_mutex` helper for atomic `consumers.jsonl` writes |
|
|
176
|
+
| `consumers.py` | Append-only `consumers.jsonl` writer + reader — records which `implementation` runs consumed which `implementation-planning` stage |
|
|
177
|
+
| `paths.py` | Path/sequence computation for task/run artifacts |
|
|
178
|
+
| `render.py` | task manifest, run manifest, timeline, task index, discovery, team-state, prompt/template render |
|
|
179
|
+
| `workflow.py` | Phase sequence, allowed outputs, forbidden actions, next phase |
|
|
180
|
+
| `workers.py`, `models.py` | Worker roster and model metadata resolution |
|
|
181
|
+
| `worktree.py`, `worktree_registry.py` | One worktree per task-key, branch registry, sync dirs/files/snapshots |
|
|
182
|
+
| `project_meta.py`, `resolver.py`, `path_resolve.py` | Project/task/run resolution |
|
|
183
|
+
| `clarification_items.py` | Unified §5 clarification table parser and approval blockers |
|
|
184
|
+
| `qa_commands.py` | QA command deny-list validation for plans |
|
|
185
|
+
| `pr_template.py` | PR body template resolution for release-handoff |
|
|
186
|
+
| `report_views.py`, `render_final_report.py`, `final_report_schema.py` | Final-report data.json → Markdown → slim/HTML pipeline |
|
|
187
|
+
| `wizard.py` | `okstra-run` prompt state machine; user-facing Korean strings live in `prompts/wizard/prompts.ko.json` |
|
|
188
|
+
| `index.py`, `jsonl.py`, `reconcile.py`, `listing.py`, `batch.py`, `backfill.py` | `~/.okstra` run index and history operations |
|
|
189
|
+
| `session.py`, `tmux.py`, `seeding.py`, `locks.py`, `invocation.py`, `sequence.py`, `ids.py`, `material.py` | Supporting lifecycle helpers |
|
|
190
|
+
| `improvement_lenses.py` | improvement-discovery phase 의 lens enum SSOT + cap 상수 (DEFAULT 8, ABSOLUTE 12, MIN/MAX PRIORITY 1/4, SOURCE_WORKERS) |
|
|
191
|
+
|
|
192
|
+
### 4.4 `scripts/okstra_project/`
|
|
193
|
+
|
|
194
|
+
Project resolver and read-only state helpers:
|
|
195
|
+
|
|
196
|
+
- `resolver.py`: locate project root and upsert `project.json`
|
|
197
|
+
- `state.py`: read project metadata, task catalog, task manifest
|
|
198
|
+
|
|
199
|
+
### 4.5 `scripts/okstra_token_usage/`
|
|
200
|
+
|
|
201
|
+
Token/cost accounting:
|
|
202
|
+
|
|
203
|
+
- provider adapters: `claude.py`, `codex.py`, `gemini.py`
|
|
204
|
+
- aggregation: `collect.py`, `blocks.py`, `jsonl_io.py`, `paths.py`
|
|
205
|
+
- pricing: `pricing.py`
|
|
206
|
+
- report substitution: `report.py`
|
|
207
|
+
- CLI: `cli.py` via `scripts/okstra-token-usage.py` and `okstra token-usage`
|
|
208
|
+
|
|
209
|
+
### 4.6 `prompts/`
|
|
210
|
+
|
|
211
|
+
| Path | Role |
|
|
212
|
+
|---|---|
|
|
213
|
+
| `launch.template.md` | Lead prompt template rendered for each run |
|
|
214
|
+
| `profiles/_common-contract.md` | Shared phase contract |
|
|
215
|
+
| `profiles/<task-type>.md` | Phase profiles (single language — runtime always loads from `profiles/`, never a translated mirror) |
|
|
216
|
+
| `wizard/prompts.ko.json` | Korean wizard prompt single source of truth |
|
|
217
|
+
|
|
218
|
+
### 4.7 `templates/`
|
|
219
|
+
|
|
220
|
+
| Path | Role |
|
|
221
|
+
|---|---|
|
|
222
|
+
| `templates/reports/final-report.template.md` | Jinja2 final-report Markdown template |
|
|
223
|
+
| `templates/reports/report.css`, `report.js` | Inline assets for self-contained HTML report view |
|
|
224
|
+
| `templates/reports/*.template.md` | Inputs, schedule, user-response, settings templates |
|
|
225
|
+
| `templates/prd/brief.template.md` | Brief template |
|
|
226
|
+
| `templates/project-docs/task-index.template.md` | Project task index template |
|
|
227
|
+
| `templates/okstra.CLAUDE.md` | Per-project okstra guidance import target |
|
|
228
|
+
|
|
229
|
+
### 4.8 `schemas/`
|
|
230
|
+
|
|
231
|
+
`schemas/final-report-v1.0.schema.json` is the final-report data.json contract. The report-writer worker writes `final-report-<task-type>-<seq>.data.json`; the renderer produces Markdown from that JSON.
|
|
232
|
+
|
|
233
|
+
### 4.9 `validators/`
|
|
234
|
+
|
|
235
|
+
| File | Role |
|
|
236
|
+
|---|---|
|
|
237
|
+
| `validate-run.py` | Run/final-report contract validation |
|
|
238
|
+
| `validate-brief.py`, `validate-brief.sh` | Brief frontmatter/body contract validation |
|
|
239
|
+
| `validate-report-views.py` | Slim/HTML view validation |
|
|
240
|
+
| `validate-schedule.py` | Schedule section/order/code validation |
|
|
241
|
+
| `validate-implementation-plan-stages.py` | Stage Map 구조 강제 — S1–S8 규칙 검사 (`## 4.5 Stage Map` + `## 4.5.<i> Stage <i>` 섹션, stage 당 step ≤ 6 등) |
|
|
242
|
+
| `validate_improvement_report.py` | improvement-discovery final-report 의 11항목 contract 강제. `validate-run.py` 가 `task_type == "improvement-discovery"` 일 때 자동 호출 |
|
|
243
|
+
| `validate-workflow.sh` | End-to-end fixture workflow validation |
|
|
244
|
+
| `lib/*.sh` | Shared shell validator helpers and fixtures |
|
|
245
|
+
|
|
246
|
+
### 4.10 `skills/`
|
|
247
|
+
|
|
248
|
+
13 installed skills:
|
|
249
|
+
|
|
250
|
+
| Skill | User-invocable | Role |
|
|
251
|
+
|---|---:|---|
|
|
252
|
+
| `okstra-brief` | yes | Produce task brief from ticket/doc/link/conversation |
|
|
253
|
+
| `okstra-run` | yes | Start/resume okstra task in current Claude Code session |
|
|
254
|
+
| `okstra-inspect` | yes | Unified read-side — sub-commands `status` (lifecycle + workStatus), `history` (past runs / re-run / resume), `report` (find final-report), `time` (elapsed-time breakdown), `logs` (wrapper log inventory + cleanup) |
|
|
255
|
+
| `okstra-schedule` | yes | Generate task-group schedule |
|
|
256
|
+
| `okstra-setup` | yes | Install/check runtime and register project |
|
|
257
|
+
| `okstra-context-loader` | no | Load task bundle paths/manifests for phase start |
|
|
258
|
+
| `okstra-team-contract` | no | Worker roster/model/rule contract |
|
|
259
|
+
| `okstra-convergence` | no | Cross-worker convergence and plan-body verification |
|
|
260
|
+
| `okstra-report-writer` | no | Final report data.json authoring flow |
|
|
261
|
+
|
|
262
|
+
### 4.11 `agents/`
|
|
263
|
+
|
|
264
|
+
| File | Role |
|
|
265
|
+
|---|---|
|
|
266
|
+
| `agents/SKILL.md` | Lead operating contract |
|
|
267
|
+
| `agents/workers/claude-worker.md` | Claude analyzer/verifier/executor spec |
|
|
268
|
+
| `agents/workers/codex-worker.md` | Codex analyzer/verifier/executor wrapper spec |
|
|
269
|
+
| `agents/workers/gemini-worker.md` | Gemini analyzer/verifier/executor wrapper spec |
|
|
270
|
+
| `agents/workers/report-writer-worker.md` | data.json SSOT author and audit sidecar writer |
|
|
271
|
+
|
|
272
|
+
### 4.12 `tests/` and `tests-e2e/`
|
|
273
|
+
|
|
274
|
+
- `tests/`: 61 pytest modules covering project resolver, run preparation, worktrees, final-report rendering, validators, wizard, token usage, config, wrapper status, etc.
|
|
275
|
+
- `tests-e2e/`: 5 shell scenarios covering record-start/reconcile, rerun, task lock, agent install, and report view rendering.
|
|
263
276
|
|
|
264
277
|
---
|
|
265
278
|
|
|
266
|
-
|
|
279
|
+
## 5. 주요 런타임 모듈
|
|
267
280
|
|
|
268
|
-
|
|
269
|
-
- `docs/kr/cli.md` — `okstra.sh` 인자 레퍼런스
|
|
270
|
-
- `docs/superpowers/plans/`, `docs/superpowers/specs/` — 내부 설계
|
|
281
|
+
### 5.1 Prepare flow
|
|
271
282
|
|
|
272
|
-
|
|
283
|
+
`prepare_task_bundle()` coordinates:
|
|
273
284
|
|
|
274
|
-
|
|
285
|
+
1. Resolve project root and verify/upsert `project.json`.
|
|
286
|
+
2. Resolve profile, required workers, model assignments, executor provider.
|
|
287
|
+
3. Compute task/run paths and persist run context under `runs/<task-type>/manifests/`.
|
|
288
|
+
4. Provision or reuse the task-key worktree.
|
|
289
|
+
5. Materialize `instruction-set/` files and lead prompt snapshot.
|
|
290
|
+
6. Persist run inputs, team state, task manifest, task index, run manifest, timeline, discovery pointers.
|
|
291
|
+
7. Record the run in `~/.okstra/{active,recent}.jsonl` and project index.
|
|
275
292
|
|
|
276
|
-
###
|
|
293
|
+
### 5.2 Worktree model
|
|
277
294
|
|
|
278
|
-
|
|
279
|
-
- `PrepareOutputs` — 산출물 경로 + 메타 (run_id, run_dir, manifest_path 등)
|
|
280
|
-
- `ModelAssignment` — Worker 모델 할당 (claude_worker_model / codex_executor_model / gemini_worker_model)
|
|
281
|
-
- `WorktreeEntry`, `WorktreeProvision` — Git worktree 메타
|
|
295
|
+
One task-key owns one worktree:
|
|
282
296
|
|
|
283
|
-
|
|
297
|
+
```text
|
|
298
|
+
~/.okstra/worktrees/<project-id>/<task-group>/<task-id>/
|
|
299
|
+
```
|
|
284
300
|
|
|
285
|
-
|
|
286
|
-
- `compute_run_paths(ctx)` — Run 디렉토리 구조 계산
|
|
287
|
-
- `render_*()` — 9개 산출물 렌더
|
|
288
|
-
- `workflow_state(task_type, current_phase)` — 다음 phase 추천
|
|
289
|
-
- `reconcile_active(run_id)` — Active run 상태 수집
|
|
290
|
-
- `list_runs(project_root, since, filter)` — 과거 runs 조회
|
|
291
|
-
- `build_run_id(project_id, task_group, task_id, seq)` — Run ID 조합
|
|
301
|
+
Branch name:
|
|
292
302
|
|
|
293
|
-
|
|
303
|
+
```text
|
|
304
|
+
<work-category-prefix>-<task-id-segment>
|
|
305
|
+
```
|
|
294
306
|
|
|
295
|
-
|
|
296
|
-
- `okstra_token_usage`: `collect()`, `claude_cost_usd()`, `codex_cost_usd()`, `gemini_cost_usd()`, `substitute_final_report()`
|
|
307
|
+
The same worktree/branch is reused across all phases. `worktreeSyncDirs`, `worktreeSyncFiles`, and `worktreeSnapshotFiles` provide filesystem continuity only; they do not expand okstra's context/write boundary.
|
|
297
308
|
|
|
298
|
-
|
|
309
|
+
### 5.3 Final report model
|
|
299
310
|
|
|
300
|
-
|
|
311
|
+
Current report pipeline:
|
|
301
312
|
|
|
302
|
-
|
|
313
|
+
1. Analysis workers write worker result files.
|
|
314
|
+
2. Convergence writes `state/convergence-<task-type>-<seq>.json` when applicable.
|
|
315
|
+
3. Report-writer worker writes `reports/final-report-<task-type>-<seq>.data.json`.
|
|
316
|
+
4. `scripts/okstra-render-final-report.py` renders Markdown.
|
|
317
|
+
5. Token usage substitution fills usage/cost cells.
|
|
318
|
+
6. `scripts/okstra-render-report-views.py` emits `.slim.md` and `.html`.
|
|
303
319
|
|
|
304
|
-
|
|
305
|
-
|---------|------|
|
|
306
|
-
| 설치 | `install.mjs`, `uninstall.mjs` |
|
|
307
|
-
| 진단 | `doctor.mjs`, `paths.mjs`, `version.mjs` |
|
|
308
|
-
| 프로젝트 | `setup.mjs`, `check-project.mjs` |
|
|
309
|
-
| Task 조회 | `task-list.mjs`, `task-show.mjs` |
|
|
310
|
-
| 실행 보조 | `worktree-lookup.mjs`, `plan-validate.mjs`, `render-bundle.mjs` |
|
|
311
|
-
| 스킬 구동 | `wizard.mjs` |
|
|
320
|
+
The Markdown is derived, not the authoring source. The schema is the contract.
|
|
312
321
|
|
|
313
322
|
---
|
|
314
323
|
|
|
315
|
-
## 6.
|
|
324
|
+
## 6. 설치 후 저장소 구조
|
|
316
325
|
|
|
317
|
-
```
|
|
326
|
+
```text
|
|
318
327
|
~/.okstra/
|
|
319
328
|
├── version
|
|
320
|
-
├── lib/python/{okstra_ctl,
|
|
321
|
-
├── bin/{okstra.sh,
|
|
322
|
-
├──
|
|
323
|
-
├──
|
|
324
|
-
├──
|
|
325
|
-
├──
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
+
├── lib/python/{okstra_ctl,okstra_project,okstra_token_usage,okstra_vendor,lib/}
|
|
330
|
+
├── bin/{okstra.sh,okstra-codex-exec.sh,okstra-gemini-exec.sh,...}
|
|
331
|
+
├── templates/
|
|
332
|
+
├── installed-skills.json
|
|
333
|
+
├── installed-agents.json
|
|
334
|
+
├── active.jsonl
|
|
335
|
+
├── recent.jsonl
|
|
336
|
+
├── projects/<project-id>/{meta.json,index.jsonl}
|
|
337
|
+
├── worktrees/{registry.json,registry.lock,<project>/<group>/<task>/}
|
|
338
|
+
├── archive/
|
|
339
|
+
└── .locks/
|
|
340
|
+
|
|
341
|
+
~/.claude/skills/okstra-*/SKILL.md
|
|
329
342
|
~/.claude/agents/{claude,codex,gemini,report-writer}-worker.md
|
|
330
343
|
|
|
331
344
|
<PROJECT_ROOT>/.project-docs/okstra/
|
|
332
|
-
├── project.json
|
|
333
|
-
├──
|
|
334
|
-
|
|
345
|
+
├── project.json
|
|
346
|
+
├── CLAUDE.md
|
|
347
|
+
├── glossary.md
|
|
348
|
+
├── decisions/<NNNN>-<slug>.md
|
|
349
|
+
├── discovery/{task-catalog.json,latest-task.json}
|
|
350
|
+
└── tasks/<task-group>/<task-id>/
|
|
335
351
|
├── task-manifest.json
|
|
336
|
-
├──
|
|
337
|
-
├──
|
|
338
|
-
|
|
339
|
-
|
|
352
|
+
├── task-index.md
|
|
353
|
+
├── history/timeline.json
|
|
354
|
+
└── runs/<task-type>/
|
|
355
|
+
├── instruction-set/
|
|
356
|
+
├── manifests/
|
|
357
|
+
├── state/
|
|
358
|
+
├── prompts/
|
|
359
|
+
├── reports/
|
|
360
|
+
├── status/
|
|
361
|
+
├── sessions/
|
|
362
|
+
├── worker-results/
|
|
363
|
+
├── user-responses/
|
|
364
|
+
├── carry/ # implementation 전용: stage-<N>.json evidence sidecar
|
|
365
|
+
├── logs/
|
|
366
|
+
└── (consumers.jsonl) # implementation-planning 전용: impl-run 역링크 누적 파일
|
|
340
367
|
```
|
|
341
368
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
## 7. 주요 워크플로우
|
|
345
|
-
|
|
346
|
-
### 7.1 새 Task 시작 (`/okstra-run`)
|
|
369
|
+
Project-local `<PROJECT_ROOT>/.claude/settings.local.json`, `<PROJECT_ROOT>/.project-docs/okstra/CLAUDE.md`, and `<PROJECT_ROOT>/AGENTS.md` are provisioned as symlink/import helpers so spawned agents can load okstra permissions and guidance.
|
|
347
370
|
|
|
348
|
-
|
|
349
|
-
2. **Step 1** — `okstra check-project --json`로 프로젝트 검증
|
|
350
|
-
3. **Step 2** — 기존 vs 신규 task 선택
|
|
351
|
-
4. **Step 3** — 입력 수집 (task-type, brief, model, executor, base-ref)
|
|
352
|
-
5. **Step 4** — `prepare_task_bundle(PrepareInputs)` 호출
|
|
353
|
-
- Task key 생성 / 검증
|
|
354
|
-
- Git worktree 자동 프로비저닝 (첫 phase)
|
|
355
|
-
- 9개 산출물 렌더
|
|
356
|
-
- `~/.okstra/recent.jsonl` 기록
|
|
357
|
-
6. **Step 5** — Lead 프롬프트 로드 후 `exec claude`
|
|
371
|
+
---
|
|
358
372
|
|
|
359
|
-
|
|
373
|
+
## 7. 핵심 워크플로우
|
|
360
374
|
|
|
361
|
-
|
|
375
|
+
### 7.1 First setup
|
|
362
376
|
|
|
363
|
-
|
|
377
|
+
1. `okstra install`
|
|
378
|
+
2. `okstra doctor`
|
|
379
|
+
3. inside target repo: `okstra setup --project-id <id>` or `/okstra-setup`
|
|
364
380
|
|
|
365
|
-
### 7.
|
|
381
|
+
### 7.2 Brief creation
|
|
366
382
|
|
|
367
|
-
-
|
|
368
|
-
- **Gemini verifier**: read-only 코드 리뷰 (선택)
|
|
369
|
-
- **Claude verifier**: read-only 최종 검증
|
|
370
|
-
- **Consensus**: Lead가 여러 verifier 판정을 종합 (`okstra-convergence`)
|
|
383
|
+
`/okstra-brief` turns source material into a validated task brief. It preserves source material verbatim, labels okstra augmentation, and records reporter confirmations.
|
|
371
384
|
|
|
372
|
-
### 7.
|
|
385
|
+
### 7.3 Task run
|
|
373
386
|
|
|
374
|
-
-
|
|
375
|
-
- **Phase 7 report-writer**: 최종 보고서 작성 후 archive
|
|
387
|
+
`/okstra-run` or `~/.okstra/bin/okstra.sh` collects task inputs and calls `prepare_task_bundle()`. The lead then works from the rendered instruction-set.
|
|
376
388
|
|
|
377
|
-
|
|
389
|
+
### 7.4 Phase flow
|
|
378
390
|
|
|
379
|
-
|
|
391
|
+
| Phase | Purpose | Typical next step |
|
|
392
|
+
|---|---|---|
|
|
393
|
+
| `requirements-discovery` | Classify and route work | `error-analysis` or `implementation-planning` |
|
|
394
|
+
| `error-analysis` | Reproduce and explain failure | `implementation-planning` |
|
|
395
|
+
| `implementation-planning` | Compare options, produce approval-ready plan; 산출은 항상 `## 4.5 Stage Map` + N 개의 `## 4.5.<i> Stage <i>` 섹션 구조. `implementation` 은 stage 단위로 분할 실행 가능 | `implementation` after approval |
|
|
396
|
+
| `implementation` | Executor changes code, verifiers check independently | `final-verification` |
|
|
397
|
+
| `final-verification` | Read-only acceptance verification | `release-handoff` if accepted |
|
|
398
|
+
| `release-handoff` | User-selected commit/PR handoff | done or follow-up |
|
|
380
399
|
|
|
381
|
-
|
|
400
|
+
### 7.5 Report and follow-up
|
|
382
401
|
|
|
383
|
-
|
|
384
|
-
2. **사용자 흐름**: §7 워크플로우 → User Journey
|
|
385
|
-
3. **기능 명세**: §3.7 Skills 12종, §3.6 Worker 4종, §4.2 주요 함수 → Feature list
|
|
386
|
-
4. **시스템 경계**: §6 런타임 저장소 → System Architecture
|
|
387
|
-
5. **검증 기준**: §3.5 validators, §3.10 tests → Acceptance Criteria
|
|
402
|
+
Final report artifacts live under `runs/<task-type>/reports/`. Human responses from the HTML view are saved as `runs/<task-type>/user-responses/user-response-<task-type>-<seq>.md` and can be carried into the next run.
|
|
388
403
|
|
|
389
404
|
---
|
|
390
405
|
|
|
391
|
-
##
|
|
392
|
-
|
|
393
|
-
okstra 가 산출하는 final-report 와 worker-result 의 표·리스트는 섹션별 두-글자 prefix 로 행을 식별합니다. 같은 prefix 는 어느 task / phase / project 에서도 의미가 동일하므로, 한 run 의 `C-005` 를 후속 run 이나 follow-up task 에서 그대로 인용해 cross-reference 할 수 있습니다.
|
|
394
|
-
|
|
395
|
-
### A.1 Final-report 행 ID
|
|
396
|
-
|
|
397
|
-
| Prefix | 의미 | 정의 위치 (template / contract) |
|
|
398
|
-
|--------|------|----------------------------------|
|
|
399
|
-
| `P-NNN` | Problem / Verification Target — 본 run 이 해결하려는 문제·검증 대상 한 줄 요약 | `## Summary of the Problem or Verification Target` |
|
|
400
|
-
| `C-NNN` | Consensus — 모든 worker 가 합의한 결론 | `### 1.1 Consensus` |
|
|
401
|
-
| `D-NNN` | Differences — worker 간 의미 있는 불일치 | `### 1.2 Differences` |
|
|
402
|
-
| `E-NNN` | Primary Evidence — 본 verdict 의 1차 근거 | `### 3.1 Primary Evidence` |
|
|
403
|
-
| `S-NNN` | Secondary Evidence / Alternate Interpretations — 보조 근거·대안 해석 | `### 3.2 Secondary Evidence or Alternate Interpretations` |
|
|
404
|
-
| `R-NNN` | Missing Information / Risks — 누락 정보·인지된 위험 | `## 4. Missing Information and Risks` |
|
|
405
|
-
| `RR-NNN` | Residual Risk — verdict 를 막진 않지만 추적해야 하는 잔여 위험 | `### 4.2 Residual Risk` |
|
|
406
|
-
| `OF-NNN` | Option File-structure rows — implementation-planning 의 옵션별 파일 책임 | `### 4.5.1 Option Candidates` |
|
|
407
|
-
| `DM-NNN` | Dependency / Migration risk — 순서·백필·feature-flag 선행 조건 | `### 4.5.5 Dependency / Migration Risk` |
|
|
408
|
-
| `RB-NNN` | Rollback step — revert 경로·트리거 신호 | `### 4.5.7 Rollback Strategy` |
|
|
409
|
-
| `OQ-NNN` | Open Question — pre-planning 에서 발견된 모호점 | `### 4.5.9 Open Questions` |
|
|
410
|
-
| `FU-NNN` | Follow-up Task — 본 run 범위 밖이지만 후속 처리해야 하는 항목 | `## 7. Follow-up Tasks` |
|
|
411
|
-
| `FU-VNN` | Verifier-harness Follow-up — verifier 환경 결함을 잡는 후속 (okstra 본체 fix) | `## 7.` (lead synthesis, `Origin = manual` 표기) |
|
|
412
|
-
| `A1, A2, …` | Additional materials requested — 다음 run 시작 전 사용자가 채워야 할 자료 요청. **run 사이에 ID 유지**, 답변 완료 시 `Status` 만 갱신 | `### 5.1 추가 자료 요청` |
|
|
413
|
-
| `Q1, Q2, …` | Questions for the user — 동일 규칙으로 run 간 ID 유지 | `### 5.2 사용자 확인 질문` |
|
|
406
|
+
## 8. 문서 유지보수 체크리스트
|
|
414
407
|
|
|
415
|
-
|
|
408
|
+
When changing code, keep these docs in sync:
|
|
416
409
|
|
|
417
|
-
|
|
410
|
+
- New Node command: update `bin/okstra` usage, `README*`, this file, and `docs/kr/cli.md`.
|
|
411
|
+
- New runtime source copied to users: update `tools/build.mjs`, install/uninstall manifests if applicable, and this file.
|
|
412
|
+
- New skill/agent: update `README*`, this file, install/uninstall fallback lists, and `CHANGES.md`.
|
|
413
|
+
- New report field/section: update schema, template, report-writer worker, validator tests, this file's report model if user-visible.
|
|
414
|
+
- New phase/profile behavior: update `prompts/profiles/*`, `docs/kr/architecture.md`, `docs/kr/cli.md`, and `README*` if user-facing.
|
|
418
415
|
|
|
419
|
-
|
|
420
|
-
|--------|------|-------------------|
|
|
421
|
-
| `F-NNN` | Finding — worker 의 핵심 발견 | §1 Findings |
|
|
422
|
-
| `M-NNN` | Missing Information / Assumption — worker 가 인지한 누락 정보·가정 | §2 Missing Information or Assumptions |
|
|
423
|
-
|
|
424
|
-
§3 Safe Areas, §4 Uncertain Points, §5 Recommended Next Actions, §6 Specialization Lens 는 표 형태가 아니라 별도 prefix 가 없습니다.
|
|
425
|
-
|
|
426
|
-
### A.3 Phase / 입력 도메인 약어
|
|
427
|
-
|
|
428
|
-
| 약어 | 의미 |
|
|
429
|
-
|------|------|
|
|
430
|
-
| `AC` | Acceptance Criteria — `final-verification-input.template.md` 의 `## Acceptance Criteria` 섹션에 사용자가 적어두는 합격 기준 (예: `AC1`, `AC2`, … `AC10`). Verifier 는 한 AC 당 한 줄로 `covered` / `not covered` 판정 |
|
|
431
|
-
| `OQ` | Open Question — implementation-planning 의 `### 4.5.9` 행 ID. final-report 의 다른 섹션에서 `OQ-A`, `OQ-D` 처럼 알파벳 인덱스로도 인용됨 |
|
|
432
|
-
| `FU-V` | Follow-up — Verifier harness 카테고리. `okstra-codex-exec.sh`, worktree provisioner 등 okstra 본체의 verifier 환경 결함을 잡는 후속 task |
|
|
433
|
-
|
|
434
|
-
### A.4 Ticket / Verdict 토큰
|
|
416
|
+
---
|
|
435
417
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
|
439
|
-
|
|
440
|
-
| `
|
|
418
|
+
## 부록 A. Report / row ID 용어
|
|
419
|
+
|
|
420
|
+
| Prefix / token | Meaning |
|
|
421
|
+
|---|---|
|
|
422
|
+
| `P-NNN` | Problem / verification target summary |
|
|
423
|
+
| `C-NNN` | Consensus or clarification item, depending on section context |
|
|
424
|
+
| `D-NNN` | Difference between workers |
|
|
425
|
+
| `E-NNN` | Primary evidence |
|
|
426
|
+
| `S-NNN` | Secondary evidence or alternate interpretation |
|
|
427
|
+
| `R-NNN` | Missing information / risk |
|
|
428
|
+
| `RR-NNN` | Residual risk |
|
|
429
|
+
| `P-Opt-*` | Plan option item used by plan-body verification |
|
|
430
|
+
| `P-Step-*` | Plan execution step item |
|
|
431
|
+
| `P-Dep-*` | Plan dependency / migration item |
|
|
432
|
+
| `P-Val-*` | Plan validation checklist item |
|
|
433
|
+
| `P-Rb-*` | Plan rollback item |
|
|
434
|
+
| `FU-NNN` | Follow-up task |
|
|
435
|
+
| `worker:item` | Source item pointer preserved from worker result into final report |
|
|
436
|
+
| `Verdict Token` | `accepted`, `conditional-accept`, `blocked`, `not-applicable` |
|
|
437
|
+
| `Direction` | `continue-investigation`, `begin-implementation`, `approve`, `reject`, `hold` |
|
|
438
|
+
|
|
439
|
+
Clarifications now live in the unified `## 5. Clarification Items` table. Deprecated `5.1` / `5.2` split sections are no longer part of the schema.
|
|
441
440
|
|
|
442
441
|
---
|
|
443
442
|
|
|
444
|
-
|
|
443
|
+
*Updated: 2026-05-20 · Source of truth checked against `package.json`, `bin/okstra`, `tools/build.mjs`, `scripts/`, `skills/`, `agents/`, `templates/`, `schemas/`, `validators/`, and tests.*
|