okstra 0.122.0 → 0.124.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 (108) hide show
  1. package/README.md +5 -2
  2. package/docs/architecture/storage-model.md +15 -1
  3. package/docs/architecture.md +45 -7
  4. package/docs/cli.md +47 -5
  5. package/docs/for-ai/README.md +42 -36
  6. package/docs/for-ai/skills/okstra-brief-gen.md +105 -105
  7. package/docs/for-ai/skills/okstra-container-build.md +61 -61
  8. package/docs/for-ai/skills/okstra-graphify.md +64 -0
  9. package/docs/for-ai/skills/okstra-inspect.md +86 -86
  10. package/docs/for-ai/skills/okstra-manager.md +32 -32
  11. package/docs/for-ai/skills/okstra-memory.md +49 -50
  12. package/docs/for-ai/skills/okstra-pr-gen.md +48 -0
  13. package/docs/for-ai/skills/okstra-rollup.md +58 -58
  14. package/docs/for-ai/skills/okstra-run.md +95 -95
  15. package/docs/for-ai/skills/okstra-schedule-gen.md +320 -0
  16. package/docs/for-ai/skills/okstra-setup.md +63 -64
  17. package/docs/for-ai/skills/okstra-user-response.md +48 -0
  18. package/docs/performance-improvement-plan-v2.md +4 -4
  19. package/docs/pr-template-usage.md +34 -34
  20. package/docs/project-structure-overview.md +92 -70
  21. package/docs/task-process/README.md +33 -33
  22. package/docs/task-process/common-flow.md +26 -26
  23. package/docs/task-process/error-analysis.md +20 -21
  24. package/docs/task-process/final-verification.md +41 -41
  25. package/docs/task-process/implementation-planning.md +52 -28
  26. package/docs/task-process/implementation.md +51 -32
  27. package/docs/task-process/release-handoff.md +46 -46
  28. package/docs/task-process/requirements-discovery.md +22 -23
  29. package/package.json +1 -1
  30. package/runtime/BUILD.json +2 -2
  31. package/runtime/agents/workers/antigravity-worker.md +4 -4
  32. package/runtime/agents/workers/claude-worker.md +2 -2
  33. package/runtime/agents/workers/codex-worker.md +4 -4
  34. package/runtime/agents/workers/report-writer-worker.md +4 -4
  35. package/runtime/bin/lib/okstra/usage.sh +3 -3
  36. package/runtime/prompts/coding-preflight/frameworks/node-server.md +1 -1
  37. package/runtime/prompts/launch.template.md +6 -3
  38. package/runtime/prompts/lead/convergence.md +11 -21
  39. package/runtime/prompts/lead/okstra-lead-contract.md +16 -18
  40. package/runtime/prompts/lead/plan-body-verification.md +47 -18
  41. package/runtime/prompts/lead/report-writer.md +50 -45
  42. package/runtime/prompts/lead/team-contract.md +11 -122
  43. package/runtime/prompts/profiles/_common-contract.md +15 -22
  44. package/runtime/prompts/profiles/_implementation-deliverable.md +4 -2
  45. package/runtime/prompts/profiles/_implementation-executor.md +6 -1
  46. package/runtime/prompts/profiles/_implementation-verifier.md +3 -3
  47. package/runtime/prompts/profiles/error-analysis.md +2 -2
  48. package/runtime/prompts/profiles/final-verification.md +3 -1
  49. package/runtime/prompts/profiles/implementation-planning.md +24 -14
  50. package/runtime/prompts/profiles/implementation.md +1 -1
  51. package/runtime/prompts/profiles/improvement-discovery.md +1 -1
  52. package/runtime/prompts/profiles/release-handoff.md +3 -3
  53. package/runtime/prompts/profiles/requirements-discovery.md +18 -18
  54. package/runtime/prompts/wizard/prompts.ko.json +44 -0
  55. package/runtime/python/okstra_ctl/codex_dispatch.py +23 -1
  56. package/runtime/python/okstra_ctl/design_prep.py +1462 -0
  57. package/runtime/python/okstra_ctl/design_surfaces.py +243 -0
  58. package/runtime/python/okstra_ctl/final_report_schema.py +33 -1
  59. package/runtime/python/okstra_ctl/implementation_stage.py +35 -0
  60. package/runtime/python/okstra_ctl/incremental_carry.py +294 -21
  61. package/runtime/python/okstra_ctl/incremental_scope.py +51 -5
  62. package/runtime/python/okstra_ctl/material.py +1 -1
  63. package/runtime/python/okstra_ctl/model_discovery.py +98 -0
  64. package/runtime/python/okstra_ctl/models.py +8 -3
  65. package/runtime/python/okstra_ctl/render.py +5 -0
  66. package/runtime/python/okstra_ctl/run.py +53 -5
  67. package/runtime/python/okstra_ctl/user_response.py +67 -2
  68. package/runtime/python/okstra_ctl/wizard.py +283 -3
  69. package/runtime/python/okstra_token_usage/report.py +11 -0
  70. package/runtime/schemas/final-report-v1.0.schema.json +336 -0
  71. package/runtime/skills/_fragments/bash-invocation-rule.md +1 -0
  72. package/runtime/skills/_fragments/preflight-outdated-cli.md +1 -0
  73. package/runtime/skills/_fragments/python-bootstrap-note.md +1 -0
  74. package/runtime/skills/okstra-brief-gen/SKILL.md +117 -122
  75. package/runtime/skills/okstra-container-build/SKILL.md +24 -14
  76. package/runtime/skills/okstra-graphify/SKILL.md +12 -4
  77. package/runtime/skills/okstra-inspect/SKILL.md +105 -99
  78. package/runtime/skills/okstra-manager/SKILL.md +1 -1
  79. package/runtime/skills/okstra-memory/SKILL.md +3 -3
  80. package/runtime/skills/okstra-rollup/SKILL.md +12 -6
  81. package/runtime/skills/okstra-run/SKILL.md +49 -88
  82. package/runtime/skills/{okstra-schedule → okstra-schedule-gen}/SKILL.md +38 -32
  83. package/runtime/skills/okstra-setup/SKILL.md +1 -1
  84. package/runtime/skills/okstra-setup/references/project-config.md +17 -16
  85. package/runtime/skills/okstra-usage/SKILL.md +5 -2
  86. package/runtime/skills/okstra-user-response/SKILL.md +23 -9
  87. package/runtime/templates/prd/brief.template.md +92 -92
  88. package/runtime/templates/reports/error-analysis-input.template.md +1 -1
  89. package/runtime/templates/reports/fan-out-unit.template.md +6 -6
  90. package/runtime/templates/reports/final-report.template.md +67 -0
  91. package/runtime/templates/reports/final-verification-input.template.md +6 -6
  92. package/runtime/templates/reports/i18n/en.json +31 -0
  93. package/runtime/templates/reports/i18n/ko.json +31 -0
  94. package/runtime/templates/reports/implementation-input.template.md +1 -1
  95. package/runtime/templates/reports/implementation-planning-input.template.md +1 -1
  96. package/runtime/templates/reports/improvement-discovery-input.template.md +1 -1
  97. package/runtime/templates/reports/quick-input.template.md +1 -1
  98. package/runtime/templates/reports/release-handoff-input.template.md +1 -1
  99. package/runtime/templates/reports/schedule.template.md +22 -22
  100. package/runtime/templates/reports/task-brief.template.md +3 -3
  101. package/runtime/templates/reports/user-response.template.md +20 -20
  102. package/runtime/templates/worker-prompt-preamble.md +111 -13
  103. package/runtime/validators/validate-run.py +426 -5
  104. package/runtime/validators/validate-schedule.py +5 -5
  105. package/src/cli-registry.mjs +7 -0
  106. package/src/commands/inspect/design-prep.mjs +23 -0
  107. package/src/lib/skill-catalog.mjs +2 -1
  108. package/docs/for-ai/skills/okstra-schedule.md +0 -320
@@ -0,0 +1,320 @@
1
+ # okstra-schedule-gen AI Manual
2
+
3
+ ## Source
4
+
5
+ - Skill source: [`skills/okstra-schedule-gen/SKILL.md`](../../../skills/okstra-schedule-gen/SKILL.md)
6
+ - schedule template: [`templates/reports/schedule.template.md`](../../../templates/reports/schedule.template.md)
7
+ - schedule validator: [`validators/validate-schedule.py`](../../../validators/validate-schedule.py)
8
+ - workStatus inference reference: [`skills/okstra-inspect/SKILL.md`](../../../skills/okstra-inspect/SKILL.md)
9
+
10
+ ## Purpose
11
+
12
+ `okstra-schedule-gen` gathers the non-done tasks within a task-group and produces a client-facing work-schedule Markdown. It is not a skill for starting an execution task, and it is not a single-task analysis.
13
+
14
+ Output location:
15
+
16
+ ```text
17
+ <PROJECT_ROOT>/.okstra/tasks/<task-group-segment>/schedule/<task-group-segment>-plan-<YYYY-MM-DD_HH-MM-SS>.md
18
+ ```
19
+
20
+ ## When to Use
21
+
22
+ Use it when:
23
+
24
+ - The user requests a "schedule", "work plan", or work-schedule table for an entire task-group.
25
+ - `.okstra/discovery/task-catalog.json` contains that task-group and it has at least one task that is not `done`.
26
+
27
+ Do not use it when:
28
+
29
+ - Single-task status/analysis: `okstra-inspect status`
30
+ - Actual phase execution: `okstra-run`
31
+ - An already-completed task-group: do not create a file; state that all tasks are done.
32
+
33
+ ## Preflight
34
+
35
+ A single Bash call:
36
+
37
+ ```bash
38
+ okstra preflight --runtime claude-code --json
39
+ ```
40
+
41
+ If there is no runtime or project setup, point the user to `/okstra-setup` and stop.
42
+
43
+ ## Resolving the task-group
44
+
45
+ 1. Read `.okstra/discovery/task-catalog.json`.
46
+ 2. Lowercase the user-supplied task-group and strip characters outside `[a-z0-9]`.
47
+ 3. Apply the same transform to each catalog entry's `taskGroupPathSegment` and compare.
48
+ 4. Do not fall back to the raw `taskGroup`.
49
+ 5. Read each matched task's `task-manifest.json` directly. The catalog may be stale; the manifest is authoritative.
50
+
51
+ On zero matches, output `That task-group could not be found.` and stop.
52
+
53
+ ## workStatus filter
54
+
55
+ Check the workStatus in each manifest. When it is missing or empty, apply `okstra-inspect`'s `status.4` inference table.
56
+
57
+ Exclude:
58
+
59
+ - explicit `done`
60
+ - inferred `done`
61
+
62
+ Include:
63
+
64
+ - `todo`
65
+ - `in-progress`
66
+ - `blocked`
67
+ - `phase-done`
68
+ - other non-done inferred/display states
69
+
70
+ If 0 remain after filtering, do not create a schedule file; output `All tasks in this task-group are done. There is no schedule to generate.`
71
+
72
+ ## per-task data extraction
73
+
74
+ Read from the manifest:
75
+
76
+ - `taskId`, `taskGroup`, `taskKey`
77
+ - `workCategory`
78
+ - `workflow.currentPhase`
79
+ - `workflow.currentPhaseState`
80
+ - `taskType`
81
+ - `workStatus`
82
+ - `latestReportPath`
83
+
84
+ Parse from the report:
85
+
86
+ - Title / Problem statement
87
+ - Solution / Architecture
88
+ - Work Breakdown
89
+ - Verification Commands
90
+ - Rollback strategy
91
+ - Effort, Risk, Priority, Scope, Repos
92
+
93
+ If there is no report or the manifest pointer is stale, fall back:
94
+
95
+ 1. From `taskRootPath`, find the newest-mtime file under `runs/<taskType>/reports/final-report-*.md`.
96
+ 2. If none, also look at `runs/*/reports/final-report-*.md`.
97
+ 3. If found, parse it and put a fallback note in the schedule task block.
98
+ 4. If still nothing, mark it `[NEEDS-OKSTRA-RUN]` and use only the manifest metadata.
99
+
100
+ Mark a specific section's parse failure as `[PARSE-ERROR: <section>]` and continue.
101
+
102
+ ## client-facing audience rule
103
+
104
+ The schedule is a client-facing work plan. Do not surface the internal report's approval, blocking decisions, or items requiring user confirmation in the schedule.
105
+
106
+ Remove from the output:
107
+
108
+ - permission/authority confirmation steps
109
+ - approval waiting buffer
110
+ - stakeholder coordination
111
+ - legal/organizational sign-off
112
+ - `Consolidated User Decision Checklist`
113
+ - `#### Items requiring user confirmation`
114
+ - `Done`, `Ready?`, `Blocking Decisions` column
115
+ - checkbox list/cell
116
+
117
+ effort and Gantt reflect engineering duration only.
118
+
119
+ ## phase classification
120
+
121
+ Default mapping:
122
+
123
+ | workCategory | phase |
124
+ |---|---|
125
+ | `bugfix` | Phase 1 when High/Med-High risk, otherwise Phase 2 |
126
+ | `feature` | Phase 2 |
127
+ | `improvement` | Phase 2 |
128
+ | `refactor` | Phase 3 |
129
+ | `ops` | Phase 3 |
130
+ | `docs` / `doc` | Phase 2 |
131
+ | `unknown` or undefined | Phase 2, add a rationale note |
132
+
133
+ priority override:
134
+
135
+ - `P0`: Phase 1
136
+ - `P1`, `P2`: Phase 2
137
+ - `P3`: Phase 3
138
+
139
+ When ambiguous, place it in the closest phase and write the rationale at the top of the phase section. This rationale is a current validator gap, so the document owns it.
140
+
141
+ ## section contract
142
+
143
+ Follow the template's heading order and spelling. `validate-schedule.py` checks section order, title suffix, metadata, field labels, enum, Gantt axis, and more.
144
+
145
+ top-level contract sections:
146
+
147
+ 1. `## At a Glance`
148
+ 2. `## Executive Summary` (includes the mandatory subsection `### Effort Sizing Criteria` — checked by `validate-schedule.py`)
149
+ 3. `## Task Dependency Graph`
150
+ 4. `## Phase 1: Critical Fixes`
151
+ 5. `## Phase 2: Enhancements`
152
+ 6. `## Phase 3: Architecture`
153
+ 7. `## Execution Priority Matrix`
154
+ 8. `## Cross-Task Dependencies & Shared Concerns`
155
+ 9. `## Risk Mitigation Strategy`
156
+ 10. `## Recommended Immediate Actions`
157
+
158
+ optional sections:
159
+
160
+ - `## Gantt Chart`: between `Task Dependency Graph` and `Phase 1`.
161
+ - `## Glossary`: last section. Use only when opaque codes remain in the body.
162
+
163
+ Keep the heading even when a phase has no task, and write `_none_`.
164
+
165
+ ## top header
166
+
167
+ Shape:
168
+
169
+ ```markdown
170
+ # <Title> — Work Schedule
171
+
172
+ > Generated: <YYYY-MM-DD HH:MM> | Project: <project-id> | Task Group: <task-group>
173
+ > Source: okstra <mode> (<N> tasks included, <M> done excluded)
174
+ ```
175
+
176
+ The validator checks the title suffix `— Work Schedule`. For `<project-id>`, prefer `task-catalog.json`'s top-level `projectId`, and if absent use the first matched manifest's `projectId`. Do not invent a value.
177
+
178
+ ## At a Glance
179
+
180
+ This totals line must be present exactly.
181
+
182
+ ```markdown
183
+ **<N> tasks total / estimated effort: <X.X> ~ <Y.Y> days (Effort sum)**
184
+ ```
185
+
186
+ The Effort-to-day mapping's SSOT is the template's `### Effort Sizing Criteria` table. Build the total day range by summing the lower/upper bounds.
187
+
188
+ enum values:
189
+
190
+ | Field | value |
191
+ |---|---|
192
+ | Effort | `S`, `M`, `L`, `XL`, `XXL` |
193
+ | Priority | `P0`, `P1`, `P2`, `P3` |
194
+ | Risk | `Very Low`, `Low`, `Medium`, `Med-High`, `High` |
195
+ | Phase | `1`, `2`, `3` |
196
+
197
+ `Med-High` is canonical.
198
+
199
+ ## per-task block
200
+
201
+ Every task block has a `| Item | Detail |` table. field row order:
202
+
203
+ 1. `**Category**`
204
+ 2. `**Priority**`
205
+ 3. `**Effort**`
206
+ 4. `**Status**`
207
+ 5. `**Risk**`
208
+ 6. `**Scope**`
209
+ 7. `**Repo**`
210
+
211
+ Then the subsection order:
212
+
213
+ 1. `**Problem**:`
214
+ 2. `**Solution**:`
215
+ 3. `**Work Breakdown**:` — followed by a `| Step | File | Action | Detail |` table
216
+ 4. `**Verification Commands**:` — followed by a ` ```bash ` fenced block
217
+ 5. `**Rollback**:`
218
+
219
+ For a `[NEEDS-OKSTRA-RUN]` or `[PARSE-ERROR: <section>]` task, fill only the available fields but place the marker right below the task heading.
220
+
221
+ ## Task Dependency Graph
222
+
223
+ When there is no dependency, literal:
224
+
225
+ ```markdown
226
+ _none_
227
+ ```
228
+
229
+ When dependencies exist, use a plain fenced block. Do not attach a language tag.
230
+
231
+ ````
232
+ ```
233
+ DEV-1 -> DEV-2, DEV-3
234
+ DEV-2 -> DEV-4
235
+ ```
236
+ ````
237
+
238
+ Use only the ASCII arrow `->`.
239
+
240
+ ## Gantt Chart
241
+
242
+ **directive override (highest priority):** before applying the heuristic below, first check the directive source's `## Directive` section. Resolution order (first hit): (1) the `--directive-file <abs-path>` argument, (2) `<PROJECT_ROOT>/.okstra/tasks/<task-group-segment>/schedule/instruction-set/analysis-material.md`, (3) if none, the heuristic as-is (normal path — no warning·stop). When the directive instructs Gantt render/skip, it overrides the heuristic·skip rules, and leave one line in that section: `> _Per Directive directive: <verbatim short excerpt>._`. When the directive supplies day allocation·phase weight·sub-task decomposition, reflect it verbatim in bar length.
243
+
244
+ By default, render. If there is any day signal, produce a chart even as a rough estimate.
245
+
246
+ Render-condition examples:
247
+
248
+ - 2+ tasks have effort sizing.
249
+ - Even 1 task has an effort range.
250
+ - The source report has Part/Phase/Step decomposition.
251
+ - Total effort is 3 days or more.
252
+
253
+ Skip only when every task is XXL with no decomposition, or when all tasks lack both effort and decomposition. On skip, place the following blockquote at the `Gantt Chart` position.
254
+
255
+ ```markdown
256
+ > _Gantt Chart skipped: <concrete reason referencing the actual data>._
257
+ ```
258
+
259
+ The Gantt is plain fenced ASCII. Do not use Mermaid, PlantUML, Graphviz, or a date axis.
260
+
261
+ ````
262
+ ```
263
+ Day: 1 5 10 15 20
264
+ | | | | |
265
+ Phase 1
266
+ DEV-1 (M) ██████ ! crit
267
+ Phase 2
268
+ DEV-2 (L) ██████░░ est
269
+ ```
270
+ ````
271
+
272
+ The axis uses relative day count only. Do not put in a calendar date, weekday, or "today + N".
273
+
274
+ ## handling opaque code
275
+
276
+ Do not surface internal report codes (`FC-5`, `UC-3`, `M2`, etc.) as-is.
277
+
278
+ Option A: inline replacement with a short description.
279
+
280
+ Option B: when many codes recur, resolve every code in a final `## Glossary`. The glossary table header is exactly `| Code | Description |` (English literal — checked by the validator). Milestone codes (`M1`, `M2` …) also fail the validator when left unresolved in the glossary, just like `FC-N`.
281
+
282
+ Do not put decision-item letter codes (`A1`, `B2`, `C3`, `D4`) in the schedule.
283
+
284
+ ## validation
285
+
286
+ After writing, re-read it and run the validator before the completion message.
287
+
288
+ ```bash
289
+ python3 ~/.okstra/lib/validators/validate-schedule.py <output-path>
290
+ ```
291
+
292
+ If the installed validator is absent, use the repo validator.
293
+
294
+ ```bash
295
+ python3 validators/validate-schedule.py <output-path>
296
+ ```
297
+
298
+ On failure, fix the file and re-validate. Fall back to a manual checklist only when there is no validator.
299
+
300
+ ## completion message
301
+
302
+ ```text
303
+ Schedule generated: <relative-path>
304
+ - Included tasks: N
305
+ - Excluded (done) tasks: M
306
+ - Estimated effort: X.X ~ Y.Y days (Effort sum)
307
+ - Mode: lightweight
308
+ ```
309
+
310
+ ## Forbidden patterns
311
+
312
+ - Translating a heading into Korean/French/etc.
313
+ - Adding `## Cumulative Timeline`.
314
+ - Adding an extra top-level section such as `## Effort-to-Day mapping`.
315
+ - Rendering the Gantt as mermaid.
316
+ - Putting a calendar date on the Gantt axis.
317
+ - Creating a checkbox, Done, Ready, or Blocking Decisions column.
318
+ - Surfacing internal approval/blocker/user-decision items in the client schedule.
319
+ - Excluding a task because it has no report. Include it as `[NEEDS-OKSTRA-RUN]`.
320
+ - Overwriting an existing file on a timestamp collision. Append a `-2`, `-3` suffix.
@@ -1,52 +1,52 @@
1
1
  # okstra-setup AI Manual
2
2
 
3
- ## 원천
3
+ ## Source
4
4
 
5
- - 스킬 원문: [`skills/okstra-setup/SKILL.md`](../../../skills/okstra-setup/SKILL.md)
5
+ - Skill source: [`skills/okstra-setup/SKILL.md`](../../../skills/okstra-setup/SKILL.md)
6
6
  - CLI registry: [`src/cli-registry.mjs`](../../../src/cli-registry.mjs)
7
- - project 등록 구현: `src/commands/lifecycle/setup.mjs`
8
- - install/ensure-installed 구현: `src/commands/lifecycle/install.mjs`
7
+ - project registration impl: `src/commands/lifecycle/setup.mjs`
8
+ - install/ensure-installed impl: `src/commands/lifecycle/install.mjs`
9
9
 
10
- ## 목적
10
+ ## Purpose
11
11
 
12
- `okstra-setup`은 두 가지를 처리한다.
12
+ `okstra-setup` handles two things.
13
13
 
14
- 1. 머신 단위 runtime 설치: `~/.okstra/`, `~/.claude/skills/`, `~/.claude/agents/`
15
- 2. 프로젝트 단위 등록: `<PROJECT_ROOT>/.okstra/project.json`
14
+ 1. Machine-level runtime install: `~/.okstra/`, `~/.claude/skills/`, `~/.claude/agents/`
15
+ 2. Project-level registration: `<PROJECT_ROOT>/.okstra/project.json`
16
16
 
17
- 일상적인 task 실행 스킬이 아니다. task가 이미 준비된 상태면 `okstra-run` 또는 `okstra-inspect`로 라우팅한다.
17
+ It is not a day-to-day task-running skill. If a task is already prepared, route to `okstra-run` or `okstra-inspect`.
18
18
 
19
- ## 사용 조건
19
+ ## When to use
20
20
 
21
- 사용한다:
21
+ Use it when:
22
22
 
23
- - 사용자가 "okstra setup", "setup okstra", "initialize okstra", "okstra init", "처음 설정"을 요청한다.
24
- - `~/.okstra/version`이 없거나 오래된 것으로 보인다.
25
- - 현재 프로젝트에 `.okstra/project.json`이 없다.
23
+ - The user asks for "okstra setup", "setup okstra", "initialize okstra", "okstra init", "first time setup".
24
+ - `~/.okstra/version` is missing or looks stale.
25
+ - The current project has no `.okstra/project.json`.
26
26
 
27
- 사용하지 않는다:
27
+ Do not use it when:
28
28
 
29
- - task run을 시작하려는 경우. 이때는 `okstra-run`.
30
- - status/history/report를 보려는 경우. 이때는 `okstra-inspect`.
31
- - 이미 `.okstra/project.json`이 있고 day-to-day 사용만 필요한 경우.
29
+ - The user wants to start a task run. Use `okstra-run` instead.
30
+ - The user wants to view status/history/report. Use `okstra-inspect` instead.
31
+ - `.okstra/project.json` already exists and only day-to-day usage is needed.
32
32
 
33
- ## 실행 전 확인
33
+ ## Pre-run checks
34
34
 
35
- 사용자에게 Node 18+, Python 3.10+가 필요하다고 알린다. 현재 working directory가 okstra 메타데이터를 둘 프로젝트 안인지 불명확하면, 프로젝트 루트를 먼저 확인한다.
35
+ Tell the user that Node 18+ and Python 3.10+ are required. If it is unclear whether the current working directory is inside the project that will host the okstra metadata, confirm the project root first.
36
36
 
37
- 설치 명령:
37
+ Install command:
38
38
 
39
39
  ```bash
40
40
  npx -y okstra@latest install --runtime claude-code
41
41
  ```
42
42
 
43
- 이 명령은 idempotent로 취급한다. 이미 설치되어 있어도 다시 실행해 runtime, skill, agent payload를 현재 package 버전과 맞춘다(agent payload = `~/.claude/agents/<worker>.md` worker 정의 + `~/.okstra/installed-agents.json` manifest). 실패하면 stderr를 그대로 사용자에게 보여준다. legacy `okstra-install.sh`로 우회하지 않는다.
43
+ Treat this command as idempotent. Even if already installed, re-run it to align the runtime, skill, and agent payload with the current package version (agent payload = the `~/.claude/agents/<worker>.md` worker definitions + the `~/.okstra/installed-agents.json` manifest). If it fails, show the stderr to the user verbatim. Do not fall back to the legacy `okstra-install.sh`.
44
44
 
45
- ## 명령 호출 규칙
45
+ ## Command invocation rule
46
46
 
47
- `okstra install` 이후에는 후속 명령이 모두 `okstra` literal token으로 시작해야 한다.
47
+ After `okstra install`, every subsequent command must begin with the literal `okstra` token.
48
48
 
49
- 허용되는 형태:
49
+ Allowed forms:
50
50
 
51
51
  ```bash
52
52
  okstra check-project --json
@@ -54,87 +54,86 @@ okstra setup --yes --project-root /abs/project --project-id my-project
54
54
  okstra doctor --runtime claude-code
55
55
  ```
56
56
 
57
- 피해야 하는 형태:
57
+ Forms to avoid:
58
58
 
59
59
  - `export PYTHONPATH=...`
60
60
  - `eval "$(okstra paths --shell)"`
61
- - `$PROJECT_ROOT` 같은 shell 변수
61
+ - shell variables like `$PROJECT_ROOT`
62
62
  - `$(...)` command substitution
63
- - `if`, `&&`, `||`로 감싼 okstra 호출
63
+ - okstra calls wrapped in `if`, `&&`, `||`
64
64
 
65
- `okstra <subcmd>`가 자체적으로 Python path를 부트스트랩하므로 `okstra paths --shell`은 이 스킬에서 쓰지 않는다. 경로가 필요하면 `okstra paths --json`을 별도 호출로 실행하고 JSON 값을 읽는다.
65
+ Because `okstra <subcmd>` bootstraps its own Python path, do not use `okstra paths --shell` in this skill. If you need a path, run `okstra paths --json` as a separate call and read the JSON value.
66
66
 
67
- ## 프로젝트 루트 해석
67
+ ## Project root resolution
68
68
 
69
- 먼저 실행:
69
+ Run first:
70
70
 
71
71
  ```bash
72
72
  okstra check-project --json
73
73
  ```
74
74
 
75
- 결과 처리:
75
+ Handle the result:
76
76
 
77
- - `ok: true`: 이미 등록된 프로젝트다. `projectRoot`, `projectJsonPath`, `projectId`를 사용자에게 보여주고 유지 여부를 확인한다.
78
- - `ok: false`, `stage: "resolve"`: 사용자에게 절대 project root를 받아 `okstra check-project --cwd /abs/path --json`을 다시 실행한다.
79
- - `ok: false`, `stage: "project_json_missing"`: 정상 생성 경로로 진행한다.
80
- - 그 외 실패 stage: JSON의 `reason`을 그대로 보여주고, 원문이 지시하는 recovery를 따른다.
77
+ - `ok: true`: already a registered project. Show `projectRoot`, `projectJsonPath`, `projectId` to the user and confirm whether to keep it.
78
+ - `ok: false`, `stage: "resolve"`: get an absolute project root from the user and re-run `okstra check-project --cwd /abs/path --json`.
79
+ - `ok: false`, `stage: "project_json_missing"`: proceed with the normal create path.
80
+ - any other failure stage: show the JSON `reason` verbatim and follow the recovery the source names.
81
81
 
82
- ## project.json 생성 또는 유지
82
+ ## Create or keep project.json
83
83
 
84
- `<PROJECT_ROOT>/.okstra/project.json`이 있으면 `projectId`와 `projectRoot`를 보여주고 유지/덮어쓰기 여부를 확인한다. 기본은 유지다. 기존 `projectId`를 바꾸려면 파일 삭제가 필요하므로 자동으로 덮어쓰지 않는다.
84
+ If `<PROJECT_ROOT>/.okstra/project.json` exists, show `projectId` and `projectRoot` and confirm whether to keep or overwrite. The default is keep. Changing the existing `projectId` requires deleting the file, so do not overwrite automatically.
85
85
 
86
- 파일이 없으면 project id를 물어본다. 답변은 비어 있지 않고 alphanumeric 문자를 하나 이상 포함해야 한다. 빈 값으로 `okstra setup --yes`를 호출하면 실패하므로 다시 묻는다.
86
+ If the file does not exist, ask for a project id. The answer must be non-empty and contain at least one alphanumeric character. Calling `okstra setup --yes` with an empty value fails, so re-ask.
87
87
 
88
- 생성 명령:
88
+ Create command:
89
89
 
90
90
  ```bash
91
91
  okstra setup --yes --project-root /abs/project --project-id my-project
92
92
  ```
93
93
 
94
- ## 선택 설정
94
+ ## Optional configuration
95
95
 
96
- 원문상 Step 3.5 는 사용자가 명시적으로 원할 때만 수행하는 선택 설정이다 — 상세 절차는 스킬 디렉터리의 `references/project-config.md` 를 읽는다. 기본값으로 충분하면 건너뛰고 doctor로 간다.
96
+ Per the source, Step 3.5 is optional configuration performed only when the user explicitly wants it — read `references/project-config.md` in the skill directory for the detailed procedure. If the defaults are enough, skip it and go to doctor.
97
97
 
98
- 선택 설정:
98
+ Optional settings:
99
99
 
100
- - `worktreeSyncDirs`: task worktree에 symlink할 프로젝트 상대 디렉터리 목록. 기본은 `.project-docs`, `.scratch`, `graphify-out`, `.claude`.
101
- - `qaCommands`: implementation verifier가 실행할 check-only lint/format/typecheck/test 명령.
102
- - `qaEnv`: Tier 3 conformance script가 사용할 replica/test DB, local app URL, env file, surface patterns.
100
+ - `worktreeSyncDirs`: a list of project-relative directories to symlink into the task worktree. The default is `.project-docs`, `.scratch`, `graphify-out`, `.claude`.
101
+ - `qaCommands`: check-only lint/format/typecheck/test commands the implementation verifier runs.
102
+ - `qaEnv`: the replica/test DB, local app URL, env file, and surface patterns the Tier 3 conformance script uses.
103
103
  - PR body template: `okstra config set pr-template-path "<path>" --scope project|global`
104
104
  - final report language: `okstra config set report-language <en|ko|auto> --scope project`
105
105
 
106
- `qaCommands.cmd`는 mutation을 암시하는 token을 담으면 verifier가 거부한다. deny-list의 실제 권위는 `scripts/okstra_ctl/qa_commands.py`다.
106
+ If `qaCommands.cmd` contains a token implying mutation, the verifier refuses it. The actual authority for the deny-list is `scripts/okstra_ctl/qa_commands.py`.
107
107
 
108
- ## 자동 Claude 설정 symlink
108
+ ## Automatic Claude settings symlink
109
109
 
110
- `okstra setup`은 `<PROJECT_ROOT>/.claude/settings.local.json`을 `~/.okstra/templates/settings.local.json` symlink로 provision한다. 기존 regular file이 있으면 `.bak.<timestamp>`로 백업한 뒤 symlink를 둔다. 실패 메시지가 나오면 사용자가 기존 project-specific rule을 수동 병합해야 한다.
110
+ `okstra setup` provisions `<PROJECT_ROOT>/.claude/settings.local.json` as a symlink to `~/.okstra/templates/settings.local.json`. If an existing regular file is present, it backs it up as `.bak.<timestamp>` and then places the symlink. If a failure message appears, the user must manually merge the existing project-specific rules.
111
111
 
112
- ## 검증
112
+ ## Verify
113
113
 
114
- 마지막에 실행:
114
+ Run last:
115
115
 
116
116
  ```bash
117
117
  okstra doctor --runtime claude-code
118
118
  ```
119
119
 
120
- 모든 check가 OK면 setup 완료로 보고한다. 실패가 있으면 출력 내용을 그대로 보여주고, 재설치/스킵 여부는 사용자가 결정하게 한다.
120
+ If every check is OK, report setup complete. If any check fails, show the output verbatim and let the user decide whether to reinstall or skip.
121
121
 
122
- ## 완료 메시지
122
+ ## Completion message
123
123
 
124
- 짧게 다음 정보를 포함한다.
124
+ Keep it short and include the following.
125
125
 
126
- - runtime 위치: `~/.okstra` (설치 요약의 `version stamp: x.y.z` 줄을 함께 보여준다)
126
+ - runtime location: `~/.okstra` (also show the `version stamp: x.y.z` line from the install summary)
127
127
  - project metadata: `<PROJECT_ROOT>/.okstra/project.json`
128
128
  - `projectId`
129
- - 다음 단계: `/okstra-run`
129
+ - next step: `/okstra-run`
130
130
 
131
- ## 흔한 실패 처리
131
+ ## Common failure handling
132
132
 
133
- | 증상 | 처리 |
133
+ | Symptom | Handling |
134
134
  |---|---|
135
- | `command not found: npx` | Node 18+ 설치 안내 |
136
- | `--project-id is required` | project id를 다시 물어보고 non-empty 값으로 재실행 |
137
- | `projectId mismatch` | 어떤 id가 canonical인지 사용자에게 확인. 자동 삭제하지 않음 |
138
- | `.okstra/` 쓰기 EACCES | ownership/writability 문제를 설명 |
139
- | `.claude/settings.local.json` symlink warning | 백업 파일과 symlink 상태를 사용자에게 보여주고 수동 병합 안내 |
140
-
135
+ | `command not found: npx` | Point to installing Node 18+ |
136
+ | `--project-id is required` | Re-ask for the project id and re-run with a non-empty value |
137
+ | `projectId mismatch` | Confirm with the user which id is canonical. Do not delete automatically |
138
+ | `.okstra/` write EACCES | Explain the ownership/writability problem |
139
+ | `.claude/settings.local.json` symlink warning | Show the backup file and symlink state to the user and guide a manual merge |
@@ -0,0 +1,48 @@
1
+ # okstra-user-response AI Manual
2
+
3
+ ## Sources
4
+
5
+ - Skill source: [`skills/okstra-user-response/SKILL.md`](../../../skills/okstra-user-response/SKILL.md)
6
+ - Response core (CLI): [`scripts/okstra_ctl/user_response.py`](../../../scripts/okstra_ctl/user_response.py)
7
+ - Node wrapper: [`src/commands/inspect/user-response.mjs`](../../../src/commands/inspect/user-response.mjs)
8
+
9
+ ## Purpose
10
+
11
+ `okstra-user-response` answers the **unresolved clarification questions** an okstra run left behind (the open `C-*` rows under the final report's `## 1. Clarification Items`) **in-session**, and records those answers as a `runs/<type>/user-responses/` sidecar. The next `/okstra-run` auto-attaches this sidecar via `--clarification-response`.
12
+
13
+ **Core principle — the skill never picks an answer for the user.** It only *presents* recommendations and alternatives; every `value` is the user's verbatim input. It does not call `write` until the user has explicitly confirmed (`confirmed`).
14
+
15
+ Distinguish it from starting a run (`okstra-run`), inspecting a finished task (`okstra-inspect`), and generating a brief (`okstra-brief-gen`).
16
+
17
+ ## Sub-commands
18
+
19
+ | Sub-command | What it does |
20
+ |---|---|
21
+ | `list` | List tasks that still have approval-open clarification (newest report first) |
22
+ | `show` | Expand one report's open `C-*` rows (statement + recommended + alternatives + contextRefs) |
23
+ | `write` | Record the collected answers (+ optional approval) as a `user-responses/` sidecar |
24
+
25
+ ## Preflight
26
+
27
+ A single Bash call with the literal `okstra` token (not wrapped):
28
+
29
+ ```bash
30
+ okstra preflight --runtime claude-code --json
31
+ ```
32
+
33
+ `ok:true` → carry `projectRoot` and `projectId` as literals. `ok:false` → point to `/okstra-setup` and stop (retry a specific directory with `--cwd <dir>` — a leading `cd` breaks the permission match). Then resolve home once: `okstra paths --field home` → paste it literally into `--home`.
34
+
35
+ ## Flow
36
+
37
+ 1. **list**: `okstra user-response list --home <home> --project <projectId> --limit 3` → an array of `{taskKey, taskType, seq, reportPath, reportMtime, openApprovalCount, unreadable}`. If the array is empty, stop with "no open clarification". A 3-option picker (top recommendations + the final option always "Enter directly" for pasting a `reportPath`/`task-key` directly). `unreadable:true` is a §1 format drift — flag it with `⚠` and do not proceed (do not fabricate rows).
38
+ 2. **show**: `okstra user-response show --report <reportPath>` → `rows[]` with `resolvedRefs` (the `definition` of internal tokens such as `RB-002`/`§4.7`). **Do not paste the raw `statement` as the question.** For each open row present: (a) a **self-contained question** with internal tokens expanded inline first, (b) `recommended` (only a recommendation) in plain language, (c) `alternatives[]`, (d) the raw `id`+`statement` as a secondary traceability aid. If `definition` is `null`, resolve the report `§`/`path:line` yourself **using Read**.
39
+ 3. **decision (4 branches)**: the user picks one per item — Answer (accept the recommendation / own answer, verbatim), Ask-to-explain (explain only and hand the decision back to the user), Free-form (narrative verbatim), Hold+reframe (`disposition:"reframe"`, does not satisfy the approval gate). Each item's JSON: `{id, kind, value, rationale?, disposition}`.
40
+ 4. **echo → confirmed gate**: before `write`, echo the whole collection (each `id`·`disposition`·`value`·`rationale`·approval) as-is and get explicit confirmation. Never `write` before `confirmed`. On any change, re-echo and re-confirm.
41
+ 5. **approval (optional)**: only when the approval-blocking items are **all filled with an answer** and the user explicitly approved, `--approval '{"approved":true,"implementationOption":"<selected option>"}'`. If any item is unfilled/reframe, do not approve and say the gate is still open.
42
+ 6. **write**: `okstra user-response write --report <reportPath> --answers '<json>' [--approval '<json>'] --task-key <taskKey>` → report the returned `{sidecar:<path>}`. (When a same-named sidecar exists, the same `id` is overwritten with the new value and merged.)
43
+
44
+ ## Output Rules
45
+
46
+ - Concise, in the language the user is using.
47
+ - Give path guidance host-relative (`~/.okstra/...` or relative to `projectRoot`). Use repo paths only when pointing at a code source.
48
+ - **Never hand-edit a rendered report** (`runs/*/reports/*.md` / `*.data.json`). Sidecar recording goes only through the `okstra user-response write` CLI.
@@ -226,13 +226,13 @@ Goals:
226
226
 
227
227
  Cautions:
228
228
 
229
- - Before extracting `agents/workers/_common.md`, confirm that install/packaging paths and skill/agent loaders support includes.
229
+ - Before extracting shared worker text into `agents/workers/_cli-wrapper-template.md`, confirm that install/packaging paths and skill/agent loaders support includes.
230
230
  - Merely moving text into a separate file can increase cost if the runtime does not inline it and the worker must read another file.
231
231
 
232
232
  Change targets:
233
233
 
234
- - `agents/workers/codex-worker.md`
235
- - `agents/workers/antigravity-worker.md`
234
+ - `agents/workers/codex-worker.params.json`
235
+ - `agents/workers/antigravity-worker.params.json`
236
236
  - `prompts/lead/team-contract.md`
237
237
  - Install/build packaging
238
238
 
@@ -253,7 +253,7 @@ Change targets:
253
253
  - `prompts/profiles/requirements-discovery.md`
254
254
  - `scripts/okstra_ctl/workflow.py`
255
255
  - Next-phase selection UI in `skills/okstra-run/SKILL.md`
256
- - `skills/okstra-status/SKILL.md`
256
+ - `skills/okstra-inspect/SKILL.md` (the former `okstra-status` skill folded into `okstra-inspect`)
257
257
  - Validator expectations
258
258
 
259
259
  Caution: