okstra 0.202.0 → 0.205.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 (263) hide show
  1. package/README.md +7 -6
  2. package/dist/cli-registry.mjs +7 -7
  3. package/dist/cli-registry.mjs.map +1 -1
  4. package/dist/commands/lifecycle/install.mjs +50 -124
  5. package/dist/commands/lifecycle/install.mjs.map +1 -1
  6. package/dist/commands/memory/memory.mjs +41 -8
  7. package/dist/commands/memory/memory.mjs.map +1 -1
  8. package/dist/lib/install-assets.mjs +3 -0
  9. package/dist/lib/install-assets.mjs.map +1 -1
  10. package/dist/lib/runtime-manifest.mjs +2 -1
  11. package/dist/lib/runtime-manifest.mjs.map +1 -1
  12. package/dist/lib/types.d.mts +2 -1
  13. package/docs/architecture/storage-model.md +14 -11
  14. package/docs/architecture.md +26 -20
  15. package/docs/cli.md +15 -12
  16. package/docs/contributor-change-matrix.md +3 -2
  17. package/docs/performance-improvement-plan-v2.md +3 -9
  18. package/docs/project-structure-overview.md +39 -11
  19. package/docs/task-process/README.md +1 -1
  20. package/docs/task-process/common-flow.md +1 -1
  21. package/docs/task-process/final-verification.md +3 -1
  22. package/docs/task-process/implementation-option-selection.md +1 -1
  23. package/docs/task-process/implementation.md +1 -1
  24. package/docs/task-process/release-handoff.md +36 -39
  25. package/package.json +1 -2
  26. package/runtime/BUILD.json +2 -2
  27. package/runtime/agents/common.json +28 -0
  28. package/runtime/agents/operations/code-review.json +6 -0
  29. package/runtime/agents/operations/report-translation.json +6 -0
  30. package/runtime/agents/operations/schedule-verification.json +6 -0
  31. package/runtime/agents/roles/analyser.json +18 -0
  32. package/runtime/agents/roles/critic.json +18 -0
  33. package/runtime/agents/roles/designer.json +18 -0
  34. package/runtime/agents/roles/implementer.json +20 -0
  35. package/runtime/agents/roles/leader.json +20 -0
  36. package/runtime/agents/roles/planner.json +18 -0
  37. package/runtime/agents/roles/report-writer.json +19 -0
  38. package/runtime/agents/roles/translator.json +19 -0
  39. package/runtime/agents/roles/verifier.json +18 -0
  40. package/runtime/bin/lib/okstra/usage.sh +5 -5
  41. package/runtime/prompts/duties/acceptance-critic.json +32 -0
  42. package/runtime/prompts/duties/acceptance-verifier.json +32 -0
  43. package/runtime/prompts/duties/analysis-worker.json +32 -0
  44. package/runtime/prompts/duties/code-reviewer.json +32 -0
  45. package/runtime/prompts/duties/diagnosis-worker.json +32 -0
  46. package/runtime/prompts/duties/direction-selection-worker.json +32 -0
  47. package/runtime/prompts/duties/discovery-worker.json +32 -0
  48. package/runtime/prompts/duties/implementation-executor.json +32 -0
  49. package/runtime/prompts/duties/implementation-verifier.json +32 -0
  50. package/runtime/prompts/duties/lead.json +32 -0
  51. package/runtime/prompts/duties/planning-worker.json +36 -0
  52. package/runtime/prompts/duties/report-writer.json +32 -0
  53. package/runtime/prompts/duties/reverification-worker.json +32 -0
  54. package/runtime/prompts/duties/schedule-verifier.json +32 -0
  55. package/runtime/prompts/duties/scope-critic.json +32 -0
  56. package/runtime/prompts/duties/technical-verification-worker.json +32 -0
  57. package/runtime/prompts/duties/translator.json +32 -0
  58. package/runtime/prompts/launch.template.md +2 -1
  59. package/runtime/prompts/lead/adapters/cmux.md +1 -1
  60. package/runtime/prompts/lead/convergence.md +4 -4
  61. package/runtime/prompts/lead/okstra-lead-contract.md +115 -6
  62. package/runtime/prompts/lead/plan-body-verification.md +6 -6
  63. package/runtime/prompts/lead/report-writer.md +3 -3
  64. package/runtime/prompts/profiles/_common-contract.md +2 -2
  65. package/runtime/prompts/profiles/_implementation-diff-review.md +1 -1
  66. package/runtime/prompts/profiles/_implementation-executor.md +4 -1
  67. package/runtime/prompts/profiles/_implementation-self-check.md +1 -1
  68. package/runtime/prompts/profiles/_implementation-verifier.md +2 -2
  69. package/runtime/prompts/profiles/change-impact-analysis.json +31 -0
  70. package/runtime/prompts/profiles/change-impact-analysis.md +0 -20
  71. package/runtime/prompts/profiles/error-analysis.json +39 -0
  72. package/runtime/prompts/profiles/error-analysis.md +0 -25
  73. package/runtime/prompts/profiles/feature-analysis.json +31 -0
  74. package/runtime/prompts/profiles/feature-analysis.md +0 -20
  75. package/runtime/prompts/profiles/final-verification.json +30 -0
  76. package/runtime/prompts/profiles/final-verification.md +4 -23
  77. package/runtime/prompts/profiles/forbidden-actions.json +4 -3
  78. package/runtime/prompts/profiles/implementation-option-selection.json +31 -0
  79. package/runtime/prompts/profiles/implementation-option-selection.md +0 -20
  80. package/runtime/prompts/profiles/implementation-planning.json +40 -0
  81. package/runtime/prompts/profiles/implementation-planning.md +4 -29
  82. package/runtime/prompts/profiles/implementation.json +30 -0
  83. package/runtime/prompts/profiles/implementation.md +1 -20
  84. package/runtime/prompts/profiles/improvement-discovery.json +31 -0
  85. package/runtime/prompts/profiles/improvement-discovery.md +0 -20
  86. package/runtime/prompts/profiles/project-analysis.json +31 -0
  87. package/runtime/prompts/profiles/project-analysis.md +0 -20
  88. package/runtime/prompts/profiles/release-handoff.json +5 -0
  89. package/runtime/prompts/profiles/release-handoff.md +74 -74
  90. package/runtime/prompts/profiles/requirements-discovery.json +39 -0
  91. package/runtime/prompts/profiles/requirements-discovery.md +0 -25
  92. package/runtime/prompts/profiles/technical-verification.json +39 -0
  93. package/runtime/prompts/profiles/technical-verification.md +0 -25
  94. package/runtime/prompts/wizard/prompts.ko.json +14 -18
  95. package/runtime/python/okstra_ctl/adapters/hosts/antigravity/relay.md +1 -0
  96. package/runtime/python/okstra_ctl/adapters/hosts/claude-code/adapter.py +3 -0
  97. package/runtime/python/okstra_ctl/adapters/hosts/claude-code/manifest.json +1 -1
  98. package/runtime/python/okstra_ctl/adapters/hosts/claude-code/relay.md +4 -3
  99. package/runtime/python/okstra_ctl/adapters/hosts/claude-code/worker-session.md +108 -0
  100. package/runtime/python/okstra_ctl/adapters/hosts/codex/relay.md +1 -0
  101. package/runtime/python/okstra_ctl/adapters/hosts/grok/relay.md +2 -0
  102. package/runtime/python/okstra_ctl/adapters/hosts/kimi/relay.md +2 -0
  103. package/runtime/python/okstra_ctl/adapters/providers/antigravity/adapter.py +8 -1
  104. package/runtime/python/okstra_ctl/adapters/providers/claude/adapter.py +8 -0
  105. package/runtime/python/okstra_ctl/adapters/providers/codex/adapter.py +23 -6
  106. package/runtime/python/okstra_ctl/adapters/providers/grok/adapter.py +6 -2
  107. package/runtime/python/okstra_ctl/agent/invocation.py +168 -113
  108. package/runtime/python/okstra_ctl/agent/prompt_cli/cli.py +120 -0
  109. package/runtime/python/okstra_ctl/agent/prompt_cli/materialize.py +107 -2
  110. package/runtime/python/okstra_ctl/agent/prompt_cli/run_identity.py +0 -49
  111. package/runtime/python/okstra_ctl/analysis_packet.py +4 -1
  112. package/runtime/python/okstra_ctl/application/open_worker.py +6 -1
  113. package/runtime/python/okstra_ctl/assignment_resolver.py +16 -5
  114. package/runtime/python/okstra_ctl/cmux.py +69 -20
  115. package/runtime/python/okstra_ctl/code_review_target.py +16 -8
  116. package/runtime/python/okstra_ctl/conformance.py +43 -0
  117. package/runtime/python/okstra_ctl/consumers.py +23 -8
  118. package/runtime/python/okstra_ctl/container.py +31 -8
  119. package/runtime/python/okstra_ctl/context_cost.py +11 -15
  120. package/runtime/python/okstra_ctl/contract_refreeze.py +156 -0
  121. package/runtime/python/okstra_ctl/convergence_engine.py +38 -0
  122. package/runtime/python/okstra_ctl/convergence_provenance.py +7 -1
  123. package/runtime/python/okstra_ctl/design_prep.py +34 -1
  124. package/runtime/python/okstra_ctl/dispatch_core.py +53 -27
  125. package/runtime/python/okstra_ctl/domain/host.py +5 -0
  126. package/runtime/python/okstra_ctl/domain/worker_runtime.py +10 -0
  127. package/runtime/python/okstra_ctl/error_report.py +4 -3
  128. package/runtime/python/okstra_ctl/execution_manifest.py +71 -18
  129. package/runtime/python/okstra_ctl/handoff.py +384 -286
  130. package/runtime/python/okstra_ctl/handoff_verification.py +25 -6
  131. package/runtime/python/okstra_ctl/implementation_stage.py +9 -0
  132. package/runtime/python/okstra_ctl/initial_prompt_materialization.py +113 -0
  133. package/runtime/python/okstra_ctl/lead_progress.py +1 -1
  134. package/runtime/python/okstra_ctl/legacy_model_selection.py +2 -2
  135. package/runtime/python/okstra_ctl/manager_cli.py +92 -4
  136. package/runtime/python/okstra_ctl/manager_launch.py +1 -1
  137. package/runtime/python/okstra_ctl/manager_paths.py +14 -3
  138. package/runtime/python/okstra_ctl/manager_store.py +210 -3
  139. package/runtime/python/okstra_ctl/manager_sync.py +4 -1
  140. package/runtime/python/okstra_ctl/manager_view.py +2 -1
  141. package/runtime/python/okstra_ctl/model_discovery.py +30 -0
  142. package/runtime/python/okstra_ctl/model_io/lines.py +14 -1
  143. package/runtime/python/okstra_ctl/model_io/renderers.py +4 -3
  144. package/runtime/python/okstra_ctl/models.py +1 -1
  145. package/runtime/python/okstra_ctl/next_phase.py +16 -6
  146. package/runtime/python/okstra_ctl/operation_invocation.py +86 -0
  147. package/runtime/python/okstra_ctl/option_comparison.py +168 -0
  148. package/runtime/python/okstra_ctl/path_hints.py +9 -0
  149. package/runtime/python/okstra_ctl/paths.py +3 -0
  150. package/runtime/python/okstra_ctl/profile_show.py +42 -1
  151. package/runtime/python/okstra_ctl/registry/host_discovery.py +20 -12
  152. package/runtime/python/okstra_ctl/registry/host_registry.py +11 -0
  153. package/runtime/python/okstra_ctl/render.py +79 -0
  154. package/runtime/python/okstra_ctl/report_contract.py +1 -1
  155. package/runtime/python/okstra_ctl/report_html/view_models/release_handoff.py +21 -3
  156. package/runtime/python/okstra_ctl/report_synthesis_packet.py +177 -17
  157. package/runtime/python/okstra_ctl/report_translation.py +2 -1
  158. package/runtime/python/okstra_ctl/report_translation_dispatch.py +69 -9
  159. package/runtime/python/okstra_ctl/role_requirements.py +142 -129
  160. package/runtime/python/okstra_ctl/rollup.py +3 -1
  161. package/runtime/python/okstra_ctl/run.py +76 -29
  162. package/runtime/python/okstra_ctl/schedule_semantics.py +17 -6
  163. package/runtime/python/okstra_ctl/stage_fix_carry.py +23 -4
  164. package/runtime/python/okstra_ctl/stage_integrate.py +178 -18
  165. package/runtime/python/okstra_ctl/stage_map.py +16 -2
  166. package/runtime/python/okstra_ctl/stage_targets.py +209 -43
  167. package/runtime/python/okstra_ctl/team.py +22 -13
  168. package/runtime/python/okstra_ctl/time_report.py +2 -1
  169. package/runtime/python/okstra_ctl/usage_report.py +3 -1
  170. package/runtime/python/okstra_ctl/wizard/confirmation.py +3 -9
  171. package/runtime/python/okstra_ctl/wizard/ids.py +1 -1
  172. package/runtime/python/okstra_ctl/wizard/registry.py +1 -1
  173. package/runtime/python/okstra_ctl/wizard/state.py +3 -5
  174. package/runtime/python/okstra_ctl/wizard/steps_plan.py +12 -21
  175. package/runtime/python/okstra_ctl/worker_prompt_contract.py +5 -1
  176. package/runtime/python/okstra_ctl/worker_prompt_headers.py +35 -7
  177. package/runtime/python/okstra_ctl/worker_prompt_policy.py +66 -48
  178. package/runtime/python/okstra_ctl/workflow.py +1 -1
  179. package/runtime/python/okstra_ctl/worktree/__init__.py +3 -1
  180. package/runtime/python/okstra_ctl/worktree/naming.py +9 -0
  181. package/runtime/python/okstra_ctl/worktree_registry.py +38 -9
  182. package/runtime/python/okstra_token_usage/pricing.py +6 -4
  183. package/runtime/schemas/agent-common-v1.schema.json +34 -0
  184. package/runtime/schemas/agent-duty-v1.schema.json +38 -0
  185. package/runtime/schemas/agent-operation-v1.schema.json +11 -0
  186. package/runtime/schemas/agent-profile-v1.schema.json +46 -0
  187. package/runtime/schemas/agent-role-v1.schema.json +29 -0
  188. package/runtime/schemas/final-report-v2.0.schema.json +118 -97
  189. package/runtime/schemas/final-report-v3.0.schema.json +118 -97
  190. package/runtime/skills/okstra-brief-gen/SKILL.md +84 -4
  191. package/runtime/skills/okstra-chat/SKILL.md +2 -2
  192. package/runtime/skills/okstra-code-review/SKILL.md +23 -9
  193. package/runtime/skills/okstra-container-build/SKILL.md +10 -10
  194. package/runtime/skills/okstra-inspect/SKILL.md +1 -1
  195. package/runtime/skills/okstra-inspect/facets/cost.md +1 -1
  196. package/runtime/skills/okstra-inspect/facets/error-zip.md +9 -9
  197. package/runtime/skills/okstra-inspect/facets/errors.md +16 -16
  198. package/runtime/skills/okstra-inspect/facets/logs.md +7 -7
  199. package/runtime/skills/okstra-inspect/facets/recap.md +2 -2
  200. package/runtime/skills/okstra-inspect/facets/report.md +1 -1
  201. package/runtime/skills/okstra-inspect/facets/status.md +4 -3
  202. package/runtime/skills/okstra-inspect/facets/time.md +11 -10
  203. package/runtime/skills/okstra-manager/SKILL.md +18 -2
  204. package/runtime/skills/okstra-pr-gen/SKILL.md +6 -5
  205. package/runtime/skills/okstra-rollup/SKILL.md +5 -5
  206. package/runtime/skills/okstra-run/SKILL.md +31 -12
  207. package/runtime/skills/okstra-schedule-gen/SKILL.md +19 -14
  208. package/runtime/skills/okstra-setup/SKILL.md +12 -10
  209. package/runtime/skills/okstra-setup/references/project-config.md +7 -6
  210. package/runtime/skills/okstra-usage/SKILL.md +1 -1
  211. package/runtime/skills/okstra-user-response/SKILL.md +1 -1
  212. package/runtime/templates/manager/view.template.html +1 -0
  213. package/runtime/templates/report-writer-prompt-preamble.md +8 -0
  214. package/runtime/templates/reports/brief.template.md +14 -4
  215. package/runtime/templates/reports/html/i18n/en.json +5 -4
  216. package/runtime/templates/reports/html/i18n/ko.json +5 -4
  217. package/runtime/templates/reports/html/tasks/release-handoff.template.html +8 -5
  218. package/runtime/templates/reports/i18n/en.json +1 -1
  219. package/runtime/templates/reports/md/tasks/release-handoff.template.md +1 -1
  220. package/runtime/templates/reports/release-handoff-input.template.md +6 -4
  221. package/runtime/templates/translator-prompt-preamble.md +36 -0
  222. package/runtime/validators/checks/validate-assets-01.py +7 -8
  223. package/runtime/validators/validate-brief.py +70 -0
  224. package/runtime/validators/validate-implementation-plan-stages.py +2 -1
  225. package/runtime/validators/validate-run.py +72 -15
  226. package/runtime/validators/validate-schedule.py +9 -0
  227. package/docs/for-ai/README.md +0 -68
  228. package/docs/for-ai/skills/okstra-brief-gen.md +0 -262
  229. package/docs/for-ai/skills/okstra-chat.md +0 -34
  230. package/docs/for-ai/skills/okstra-code-review.md +0 -57
  231. package/docs/for-ai/skills/okstra-container-build.md +0 -129
  232. package/docs/for-ai/skills/okstra-inspect.md +0 -262
  233. package/docs/for-ai/skills/okstra-manager.md +0 -86
  234. package/docs/for-ai/skills/okstra-memory.md +0 -126
  235. package/docs/for-ai/skills/okstra-pr-gen.md +0 -49
  236. package/docs/for-ai/skills/okstra-rollup.md +0 -114
  237. package/docs/for-ai/skills/okstra-run.md +0 -250
  238. package/docs/for-ai/skills/okstra-schedule-gen.md +0 -240
  239. package/docs/for-ai/skills/okstra-setup.md +0 -167
  240. package/docs/for-ai/skills/okstra-usage.md +0 -29
  241. package/docs/for-ai/skills/okstra-user-response.md +0 -72
  242. package/runtime/agents/workers/claude-worker.md +0 -128
  243. package/runtime/agents/workers/report-writer-worker.md +0 -37
  244. package/runtime/agents/workers/translator-worker.md +0 -63
  245. package/runtime/prompts/duties/acceptance-critic.md +0 -44
  246. package/runtime/prompts/duties/acceptance-verifier.md +0 -44
  247. package/runtime/prompts/duties/analysis-worker.md +0 -44
  248. package/runtime/prompts/duties/code-reviewer.md +0 -44
  249. package/runtime/prompts/duties/common.md +0 -39
  250. package/runtime/prompts/duties/diagnosis-worker.md +0 -44
  251. package/runtime/prompts/duties/direction-selection-worker.md +0 -44
  252. package/runtime/prompts/duties/discovery-worker.md +0 -44
  253. package/runtime/prompts/duties/implementation-executor.md +0 -44
  254. package/runtime/prompts/duties/implementation-verifier.md +0 -44
  255. package/runtime/prompts/duties/lead.md +0 -44
  256. package/runtime/prompts/duties/planning-worker.md +0 -52
  257. package/runtime/prompts/duties/report-writer.md +0 -44
  258. package/runtime/prompts/duties/reverification-worker.md +0 -44
  259. package/runtime/prompts/duties/schedule-verifier.md +0 -44
  260. package/runtime/prompts/duties/scope-critic.md +0 -44
  261. package/runtime/prompts/duties/technical-verification-worker.md +0 -44
  262. package/runtime/prompts/duties/translator.md +0 -44
  263. package/runtime/python/okstra_ctl/pane_title.py +0 -154
@@ -1,250 +0,0 @@
1
- # okstra-run AI Manual
2
-
3
- ## Source
4
-
5
- - Skill source: [`skills/okstra-run/SKILL.md`](../../../skills/okstra-run/SKILL.md)
6
- - wizard CLI wrapper: [`src/commands/execute/wizard.mjs`](../../../src/commands/execute/wizard.mjs)
7
- - wizard state machine: [`scripts/okstra_ctl/wizard/`](../../../scripts/okstra_ctl/wizard/)
8
- - render-bundle CLI: [`src/commands/execute/render-bundle.mjs`](../../../src/commands/execute/render-bundle.mjs)
9
- - prepare entrypoint: [`scripts/okstra_ctl/run.py`](../../../scripts/okstra_ctl/run.py)
10
-
11
- ## Purpose
12
-
13
- `okstra-run` starts an okstra task run inside the current supported agent host. Input collection is owned entirely by the `okstra wizard` state machine; the skill relays the wizard prompts to the user and then prepares the task bundle via `okstra render-bundle`. Once the bundle is ready, the current Claude Code, Codex, or Antigravity session takes over as the host-native Okstra lead.
14
-
15
- Single authority:
16
-
17
- - Question order: `scripts/okstra_ctl/wizard/registry.py` (`STEPS`); branching: `engine.py`; per-step validation: `steps_*.py`
18
- - task bundle materialization: `prepare_task_bundle()`
19
- - Skill document: thin prompt-relay loop
20
-
21
- ## When to Use
22
-
23
- Use it when:
24
-
25
- - The user wants to start an okstra task in the current session.
26
- - The user wants to continue the next phase of an existing task.
27
- - "okstra run", "okstra start", "start okstra in this session", "run the next phase", etc.
28
-
29
- Do not use it when:
30
-
31
- - The user only wants status: `okstra-inspect status`
32
- - The user wants past runs or a resume command: `okstra-inspect history`
33
- - The user explicitly named a new terminal / new claude process: point them to inspect history/resume
34
-
35
- ## Preflight
36
-
37
- Resolve `<host-runtime>` from the executing harness: Claude Code → `claude-code`, Codex → `codex`, Antigravity CLI → `antigravity`, and another adapter host → `external`. This is a host capability, not a `PATH` inference or worker-provider choice. The lead provider is derived from this value and cannot be selected independently. Then make one Bash call:
38
-
39
- ```bash
40
- okstra preflight --runtime <host-runtime>
41
- ```
42
-
43
- On `Okstra preflight: failed`, show `Reason`, `Recovery`, `Runtime readiness`,
44
- and every repeated `Readiness check` line, then stop. On
45
- `Okstra preflight: ready`, require `Runtime readiness: ready`, carry the fixed
46
- `Project root` line, and read the `Relay contract` path. Do not create an
47
- `export PYTHONPATH`.
48
-
49
- ## Bash invocation rule
50
-
51
- Every okstra call begins with the literal token `okstra`. Read the `--state-file`, `--answer`, path, model, and worker values from the prior JSON/tool output and paste them as literal strings.
52
-
53
- Avoid:
54
-
55
- - `$STATE_FILE`, `$ANSWER`
56
- - `$(...)`
57
- - `VAR=... okstra ...`
58
- - `eval`, `export`
59
- - `okstra ... && okstra ...`
60
-
61
- Do not drop the flag even for an empty answer.
62
-
63
- ```bash
64
- okstra wizard step --state-file /tmp/okstra-wizard/state.json --answer ""
65
- ```
66
-
67
- ## wizard initialization
68
-
69
- Create the state file:
70
-
71
- ```bash
72
- okstra wizard new-state-file
73
- ```
74
-
75
- Carry the printed absolute path verbatim.
76
-
77
- wizard init:
78
-
79
- ```bash
80
- okstra wizard init --state-file /tmp/okstra-wizard/state.json --project-root /abs/project --project-id project-id --host-runtime <host-runtime>
81
- ```
82
-
83
- The result is `{ok, next}` JSON. The first step is `task_pick`.
84
-
85
- ## Interpreting the wizard JSON
86
-
87
- Pick the UI according to `next.kind`.
88
-
89
- | kind | Handling |
90
- |---|---|
91
- | `pick`, `multi: false` | Render every `options[]` verbatim as a selectable choice. Submit the chosen option's `value` |
92
- | `pick`, `multi: true` | Submit all chosen values as a comma-separated string. An empty selection still submits `--answer ""` |
93
- | `pick_group` | Render the wizard's `questions[]` as a single multi-question UI. Build a JSON object of per-step values and submit it in one shot |
94
- | `text` | Show a plain text label without a picker, then submit the user's next message verbatim |
95
- | `done` | Input collection finished. Move to render-args |
96
- | `aborted` | Delete the state file and stop. Do not call render-args/render-bundle |
97
-
98
- `progress.label` is a string the wizard composed. Append it verbatim after the UI prompt; do not compute it yourself.
99
-
100
- ## wizard loop
101
-
102
- 1. Render the prompt.
103
- 2. Submit the user's answer as a literal `--answer`.
104
- 3. `ok: true`: show `result.echo` to the user on one line and advance to the next step.
105
- 4. `ok: false`: show `result.error` verbatim and retry the same step via `result.current`.
106
- 5. `current: null`: a terminal error where the prompt cannot be reconstructed. Show the error and stop.
107
-
108
- Important: never trim, hide, or restructure the wizard-provided options into a "recommended + Enter directly" form. The wizard's `options[]` is the complete choice set.
109
-
110
- ## brief candidate ordering
111
-
112
- The brief selection is handled by the wizard. A new task is asked for its brief right after task-group and **before** the task-type; an existing task is asked only on an entry phase (`requirements-discovery`, `error-analysis`, `improvement-discovery`, `project-analysis`, `feature-analysis`, `change-impact-analysis`).
113
-
114
- - task-group candidates are shown newest-first by combining recent task-catalog use with the recent brief creation/modification times under `.okstra/briefs/<group>/`.
115
- - brief file candidates are chosen from within the selected group's `.okstra/briefs/<task-group>/**/*.md`.
116
- - The brief-file sort key is `max(file created/modified time, task-catalog updatedAt of the task that used this brief)`.
117
- - direct input is always last.
118
- - for a new task the following task-type pick offers entry phases only, and its recommended slot is the selected brief's `Recommended next phase:` line (fallback `requirements-discovery`).
119
-
120
- ## confirm step
121
-
122
- When `next.step == "confirm"`, first fetch the confirmation summary.
123
-
124
- ```bash
125
- okstra wizard confirmation --state-file /tmp/okstra-wizard/state.json
126
- ```
127
-
128
- Show `text` to the user, then render the Proceed/Edit/Abort picker as the final output of that turn — the rendered question is the last thing you emit in that turn, and text emitted after the call renders below the picker. `Edit` rewinds the wizard to an earlier step.
129
-
130
- ## outcome and render-bundle
131
-
132
- When `next.kind == "done"`:
133
-
134
- ```bash
135
- okstra wizard outcome --state-file /tmp/okstra-wizard/state.json
136
- ```
137
-
138
- Run `outcome.persistActions[]` first, then pass each key of the `outcome.renderArgs` object exactly once as an `okstra render-bundle` flag. Pass empty string values explicitly too, and add `--lead-runtime <host-runtime>` from preflight. Do not enumerate provider-specific keys in this manual; the wizard and provider registry own the emitted arguments. Exception: the `chain-stages` key is not a render-bundle flag — it drives the Step 7 unattended-chaining loop, so do not pass it as a flag (`run.py` accepts only `--stage`/`--stages`).
139
-
140
- ```bash
141
- okstra render-bundle \
142
- --lead-runtime <host-runtime> \
143
- --<first-renderArgs-key> "<first-renderArgs-value>" \
144
- --<each-remaining-renderArgs-key> "<corresponding-value>"
145
- ```
146
-
147
- Parse the following labeled lines from stdout.
148
-
149
- - `okstra task root:`
150
- - `okstra instruction-set:`
151
- - optionally `okstra concurrent-run stages:`
152
-
153
- render-bundle calls `prepare_task_bundle()` in render-only mode to prepare the manifests, run context, instruction set, and discovery files, and registers the run as `prepared` in `~/.okstra/recent.jsonl`.
154
-
155
- ## conformance waiver
156
-
157
- Classify the entry before offering a waiver. If `requires` contains `db`,
158
- `http`, or `external`, do not offer a waiver: Okstra still attempts the command,
159
- but any non-PASS or unavailable outcome is an external advisory with a
160
- user-owned rerun method. If `requires=[]`, fail closed as a declaration or
161
- contract defect and do not offer a waiver. Offer the waiver only when
162
- `requires=[io]` and that blocking local conformance command is genuinely
163
- impossible to run in the environment. A waiver requires user approval and a
164
- verbatim reason. Neither the AI lead nor a worker creates a self-exemption.
165
- The resulting blocking/advisory policy is enforced by
166
- `scripts/okstra_ctl/conformance.py::decide_conformance_gate` and
167
- `validators/validate-run.py::_validate_conformance`; the picker restriction is
168
- defined by `prompts/host-orchestration/implementation.md` Step 5.1 (the
169
- `okstra-run` skill body carries a generated copy).
170
-
171
- When chosen, add it to `render-bundle` only.
172
-
173
- ```bash
174
- --qa-waiver "<stageKey>:<reason>"
175
- ```
176
-
177
- Omit the flag entirely when there is no value.
178
-
179
- ## concurrent-run branch
180
-
181
- If `render-bundle` stdout carries `okstra concurrent-run stages:`, the no-team background gate is already reflected in the prompt.
182
-
183
- Give the user three options.
184
-
185
- 1. Proceed as no-team background.
186
- 2. Wait — hold the dispatch, preserve the stage worktree·run context. After the occupying run finishes, print the resume command (`okstra-inspect` history → resume) so the user can resume the same stage.
187
- 3. Enter directly.
188
-
189
- This picker is authored by the skill, so it is separate from the wizard-option-abbreviation ban.
190
-
191
- ## stale git SHA recovery
192
-
193
- When a `PrepareError` such as `Recorded stage SHAs no longer match the git history` appears, do not fix the registry/consumers by hand.
194
-
195
- 1. Run the `okstra git-reconcile ... --check --text` printed in the error message verbatim.
196
- 2. For each confirm item, ask the user for the current branch tip, a different ref, or abort.
197
- 3. Run `okstra git-reconcile ... --apply --stage <N> --use-ref <ref>` with the chosen ref.
198
- 4. Retry the failed render-bundle with the same arguments.
199
-
200
- If the anchor is unresolvable, run `--reset-anchor <ref>` after user confirmation.
201
-
202
- ## PR template persistence
203
-
204
- In release-handoff, when `outcome.persistActions[]` returns a `config.set` / `pr-template-path` action, save the config before render-bundle.
205
-
206
- ```bash
207
- # action.scope == "project"
208
- okstra config set pr-template-path "<path>" --scope project
209
- # action.scope == "global"
210
- okstra config set pr-template-path "<path>" --scope global
211
- ```
212
-
213
- Read the scope and path from the persist action of `okstra wizard outcome`, not from the wizard state file. Do not read the raw state file directly.
214
-
215
- ## Okstra lead takeover
216
-
217
- After render-bundle, read the run manifest's `resources.leadExecutionPromptPath` (project-relative, under `runs/<task-type>/prompts/`), read that file verbatim, and proceed from Phase 1 in that prompt's order. Before any in-run approval or clarification question, follow the lead contract "User confirmation before an approval blocker": read cited plan items, worker findings, and files, then ask in the user's language with each option's outcome.
218
-
219
- Inform the user on one line.
220
-
221
- ```text
222
- Took over as Okstra lead (`<host-runtime>`) for `<taskKey>` (`<task-type>`). Run dir: `<RUN_DIR_RELATIVE_PATH>`. Beginning Phase 1 (context loading).
223
- ```
224
-
225
- For a single-element chain, the end of Step 6 is the end of the run. Step 7 below applies only when the `chain-stages` CSV has 2 or more elements. When the run is over, close with the user's next action — one command they can run now. A prohibition is not a next action. Take it from the `report-finalize` result: `nextCommand` (`{command, note}`) is the table below already applied, and `nextRecommendedPhase` (`phase`, `status`, `rationale`) is what it was applied to — do not re-derive either from the report, and treat `nextRecommendedPhaseError` as "pointer unreadable", said in one line before the `validate-run` branch. After `implementation-planning`: open approval blockers → `/okstra-user-response`; a recorded `accept-risk` / `select` / `answer` is not an open blocker; no open approval blocker → `/okstra-run` → `implementation` or `--approve` (do not start another planning run; do not say `/okstra-inspect`). For every other task type: pointer `ready` → `/okstra-run` for that phase; `validate-run` failed → one-line cause then `/okstra-run`; otherwise `/okstra-inspect status`.
226
-
227
- ## implementation unattended chaining (chain-stages)
228
-
229
- When `task-type == implementation` and the render-args `chain-stages` CSV has 2 or more elements, the current session acts as the orchestrator and runs the stages as an unattended chain in dependency order. Queue = the topologically-sorted stage list from splitting `chain-stages` on `,`. For each stage `N` in the queue, in order:
230
-
231
- 1. Re-call render-bundle with the same arguments but `--stage N` (the base commit is auto-computed by prepare from the predecessor's done `head_commit` — do not pass it by hand). The `io`-only conformance waiver·concurrent-run·git-reconcile gates apply identically to each stage's render-bundle.
232
- 2. As in Step 6, become the host-native Okstra lead and run that stage's Phase 1–7 inline. Phase 6's lead persistence appends that stage's `status:"done"` row to `runs/<plan-task-key>/consumers.jsonl`.
233
- 3. After confirming the `done` row was written, move to the next stage. Clean up context (leftover panes·finished teammates) at each stage boundary. A `status:"failed"` row in place of `done` means the stage ended `FAIL` — stop the queue per the FAIL branch below.
234
- 4. One-line report at each stage start/finish: `stage N start` / `stage N done → next K`.
235
-
236
- Once the whole queue is consumed, end the chain and report completion.
237
-
238
- - **Next stage not yet ready — normal termination:** When a stage in the queue is occupied by another implementation run as started/reserved and render-bundle is rejected with `--stage N already in progress or reserved by another run` (StageTargetError), this is not an exception — **terminate the chain normally** and report the remaining queue (e.g. `remaining queue: stage 4, 5 — resume with okstra-run after occupancy is released`).
239
- - **Stage ended FAIL — stop the queue and report:** When a stage's synthesised verdict is `FAIL`, Phase 6 writes no carry sidecar and appends a `status:"failed"` row instead of `done`. **Stop the queue there** and report the failed stage, its report path, and the remaining queue. Do not continue to the next stage even when it is dependency-independent — later work must not be stacked on a confirmed regression. The `failed` row frees the occupancy, so `--stage <N>` re-enters that stage on its preserved worktree and branch.
240
- - **Exception gate during chaining:** If render-bundle raises a concurrent-run conflict or git stale-SHA reconciliation, **stop the chain at that stage** and present the gate to the user per the Step 5 procedure. Once the user resolves it, resume the remaining queue in place. Data corruption·concurrent-occupancy conflicts are confirmed by a human — this is the safety boundary of unattended chaining.
241
-
242
- ## Forbidden patterns
243
-
244
- - Changing the question order the wizard emitted.
245
- - Hiding wizard options or keeping only the recommendations.
246
- - Turning a `text` prompt into a picker.
247
- - Dropping the `--answer` flag on an empty answer.
248
- - Bypassing the wizard/render-bundle path by calling `okstra.sh`.
249
- - Calling render-args on a state the user aborted before render-bundle.
250
- - Starting phase work arbitrarily before reading the Okstra lead prompt.
@@ -1,240 +0,0 @@
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
- - Stage Map read side: [`scripts/okstra_project/state.py`](../../../scripts/okstra_project/state.py)
9
- - Selection semantics: [`scripts/okstra_ctl/schedule_semantics.py`](../../../scripts/okstra_ctl/schedule_semantics.py)
10
- - Work-category source of truth: [`scripts/okstra_ctl/work_categories.py`](../../../scripts/okstra_ctl/work_categories.py)
11
- - workStatus inference reference: [`skills/okstra-inspect/SKILL.md`](../../../skills/okstra-inspect/SKILL.md)
12
-
13
- ## Purpose and invocation
14
-
15
- `okstra-schedule-gen` gathers non-done tasks in a task group and produces one client-facing work schedule from user-selected unfinished implementation stages.
16
-
17
- Public invocation:
18
-
19
- ```text
20
- /okstra-schedule-gen [task-group]
21
- ```
22
-
23
- This is a host skill, not a schedule-generation shell command. Use `stage-map` and `validate-schedule.py` only as backend contracts inside the skill.
24
-
25
- Output location:
26
-
27
- ```text
28
- <PROJECT_ROOT>/.okstra/tasks/<task-group-segment>/schedule/<task-group-segment>-plan-<YYYY-MM-DD_HH-MM-SS>.md
29
- ```
30
-
31
- Do not use it for single-task status analysis or phase execution. Use `okstra-inspect status` and `okstra-run` for those jobs.
32
-
33
- ## Preflight and task-group resolution
34
-
35
- Run one literal-token preflight call:
36
-
37
- ```bash
38
- okstra preflight --runtime claude-code
39
- ```
40
-
41
- On `Okstra preflight: failed`, show `Reason` and `Recovery`, then stop. On
42
- `Okstra preflight: ready`, carry the fixed `Project root` line. Resolve an
43
- explicit task-group from the invocation or host request. If none is unambiguous,
44
- run `okstra model-io task-selection-input --project-root <projectRoot>` and ask
45
- the user to choose from the fixed `Task` rows; never guess. Then run
46
- `okstra model-io schedule-input --project-root <projectRoot> --task-group <group>`
47
- and use only its fixed task metadata rows.
48
-
49
- On zero matches, report that the task group was not found and do not create a file.
50
-
51
- ## Candidate filter
52
-
53
- `workStatus` is used only to decide which tasks are candidates. When it is missing or empty, use the `okstra-inspect` `status.4` inference table.
54
-
55
- - Exclude resolved `done` tasks.
56
- - Include every other resolved state.
57
- - If no task remains, report that all tasks are done and do not create a file.
58
-
59
- Do not render `workStatus` as the detailed task status. The per-task `Status` value is `<taskType> / <currentPhase>`.
60
-
61
- ## Source-aware Stage Map resolution
62
-
63
- For every candidate task, call:
64
-
65
- ```bash
66
- okstra stage-map <task-key> --text
67
- ```
68
-
69
- The successful fixed response carries `Status`, `Task key`, `Task root`, `State`,
70
- `Source plan path`, and lossless numbered `Stages`, `Done stages`, and `Planning`
71
- count/name/value rows.
72
-
73
- Handle each result explicitly:
74
-
75
- - `Status: ready`, `State: ready`: use exactly `Source plan path`; do not pick a report by mtime or `latestReportRecordPath`. Select only stages not present in the done-stage rows.
76
- - `Status: ready`, `State: missing`: record an empty source and empty stage sets, mark the task `[NEEDS-PLANNING]`, and emit no forward Work Breakdown, Gantt, or day total for it.
77
- - `Status: error` or another state: stop before drafting and report `Failure stage` and `Failure reason`. A corrupt or conflicting source must never fall back to a guessed report.
78
-
79
- A valid selected set is dependency-closed: every transitive prerequisite of a selected stage is either also selected or present in `doneStages`. Completed prerequisites remain evidence only and are never scheduled forward.
80
-
81
- If a ready task has no unfinished stages, render `_Complete — no remaining stage_` and omit forward effort.
82
-
83
- ## Stage selection
84
-
85
- Offer up to three dependency-closed cumulative bundles in topological order, plus all remaining stages. A custom set is accepted only after closing it over unfinished prerequisites; completed prerequisites are preserved separately.
86
-
87
- Skip the picker when the remaining work has only one possible bundle and use all unfinished stages. Record the final stage numbers as `selectedStages`.
88
-
89
- ## Temporary selection contract
90
-
91
- Write a paired draft and selection input with one timestamp:
92
-
93
- ```text
94
- .okstra/tasks/<task-group-segment>/schedule/.draft/<timestamp>.md
95
- .okstra/tasks/<task-group-segment>/schedule/.draft/<timestamp>.selection.json
96
- ```
97
-
98
- The selection file is a temporary verification input. It freezes the exact source, full stage map, completed stages, and user-selected forward work so both validators judge the same facts instead of re-resolving mutable task state.
99
-
100
- Schema version 1:
101
-
102
- ```json
103
- {
104
- "schemaVersion": 1,
105
- "tasks": [
106
- {
107
- "taskKey": "demo:group:DEV-1",
108
- "taskId": "DEV-1",
109
- "state": "ready",
110
- "sourcePlanPath": "/absolute/path/final-report-implementation-planning-001.data.json",
111
- "selectedStages": [2, 3],
112
- "doneStages": [1],
113
- "stages": [
114
- {
115
- "stageNumber": 1,
116
- "title": "Prepare port",
117
- "dependsOn": [],
118
- "stepCount": 2
119
- },
120
- {
121
- "stageNumber": 2,
122
- "title": "Build adapter",
123
- "dependsOn": [1],
124
- "stepCount": 3
125
- },
126
- {
127
- "stageNumber": 3,
128
- "title": "Wire consumer",
129
- "dependsOn": [2],
130
- "stepCount": 2
131
- }
132
- ]
133
- }
134
- ]
135
- }
136
- ```
137
-
138
- Include every candidate task. A `missing` task has an empty `sourcePlanPath`, `selectedStages`, `doneStages`, and `stages`. Convert the CLI stage-row keys to the camel-case selection boundary exactly as shown.
139
-
140
- ## Phase classification
141
-
142
- Only these canonical categories are valid:
143
-
144
- | workCategory | Default phase |
145
- |---|---|
146
- | `bugfix` | Phase 1 for High or Med-High risk; otherwise Phase 2 |
147
- | `feature` | Phase 2 |
148
- | `improvement` | Phase 2 |
149
- | `refactor` | Phase 3 |
150
- | `ops` | Phase 3 |
151
-
152
- Priority overrides category: P0 maps to Phase 1, P1/P2 to Phase 2, and P3 to Phase 3. An unknown or missing raw category falls back to Phase 2 with a one-line rationale naming the raw value. Do not invent another category.
153
-
154
- ## Template contract
155
-
156
- Follow `schedule.template.md` exactly. The required top-level order is:
157
-
158
- 1. `## At a Glance`
159
- 2. `## Executive Summary`
160
- 3. `## Task Dependency Graph`
161
- 4. optional `## Gantt Chart`
162
- 5. `## Phase 1: Critical Fixes`
163
- 6. `## Phase 2: Enhancements`
164
- 7. `## Phase 3: Architecture`
165
- 8. `## Execution Priority Matrix`
166
- 9. `## Cross-Task Dependencies & Shared Concerns`
167
- 10. `## Risk Mitigation Strategy`
168
- 11. `## Recommended Immediate Actions`
169
- 12. optional final `## Glossary`
170
-
171
- Keep an empty required section and render `_none_`. Headings and field labels stay as English template literals; body prose is Korean.
172
-
173
- Each scheduled task uses this stage-level Work Breakdown shape:
174
-
175
- ```markdown
176
- | Stage | Title | Steps | Depends On | Days |
177
- |---:|---|---:|---|---:|
178
- | 2 | Build adapter | 3 | 1 (done) | 2.0 ~ 3.0 |
179
- | 3 | Wire consumer | 2 | 2 | 1.0 ~ 2.0 |
180
- ```
181
-
182
- Use the template's Effort Sizing Criteria values without redefining them. Allocate a task's range across selected stages in `stepCount` proportion: round every stage except the last to 0.5 day and let the last absorb the remainder. The stage ranges must sum to the task range, and finite task ranges must sum to the displayed total. XXL, missing, and complete tasks contribute no forward total.
183
-
184
- An unrepresentable half-day allocation is a validation error. Do not substitute a fallback allocation algorithm; revise the task sizing or selected-stage scope.
185
-
186
- ## Gantt contract
187
-
188
- Render a plain fenced relative-day Gantt when the selected stages have finite day ranges. Every forward row is identified by stage and repeats its Work Breakdown range:
189
-
190
- ```text
191
- DEV-1 Stage 2 ████ days=2.0~3.0
192
- DEV-1 Stage 3 ████ days=1.0~2.0
193
- ```
194
-
195
- A row is labelled `Stage <n>` when exactly one task is scheduled and `<TASK-ID> Stage <n>` when more than one is; the annotation is `days=<lower>~<upper>`. Spell the stage out — `S1` is an opaque code that costs the reader a lookup and saves five characters. Do not emit a row for a completed, unselected, missing, or unknown stage. Bar length is arithmetic: one column is half a day, so a bar runs `lower / 0.5` filled cells `█` then `(upper - lower) / 0.5` open cells `░`.
196
-
197
- Skip the chart only when no forward task has a finite day signal, and state the concrete reason. Do not use calendar dates, Mermaid, PlantUML, Graphviz, or another graph language.
198
-
199
- A host-supplied directive or the first `## Directive` in the configured analysis material may override the render/skip heuristic, but it cannot override stage selection, dependency closure, or validated day arithmetic.
200
-
201
- ## Client-facing boundary
202
-
203
- Assume the team has the required authority. Exclude approval waits, permission checks, stakeholder coordination, decision checklists, and internal blocker codes from forward engineering work. Gantt duration and totals represent engineering work only.
204
-
205
- Resolve opaque source-report codes inline or in the optional final Glossary. Decision-item codes do not belong in the schedule.
206
-
207
- ## Two validation gates
208
-
209
- Run both gates against the same draft and temporary selection contract.
210
-
211
- 1. Deterministic gate:
212
-
213
- ```bash
214
- python3 ~/.okstra/lib/validators/validate-schedule.py <draft> --selection-json <selection>
215
- ```
216
-
217
- 2. Only after that command passes, create a new `.okstra/agent-invocations/schedule-verification/<invocation-id>.instructions.md` with the draft, selection JSON, and checks, but not the lead's reasoning. Run `okstra agent-prompt materialize --purpose schedule-verification --audience schedule-verifier ...` and verify the returned metadata before dispatch. A native host call uses the verified prompt body plus `hostModelValue`; a deterministic provider process uses `okstra worker-dispatch`, the prompt path, and `modelExecutionValue`. The verifier checks narrative coherence, phase rationale, executable order, engineering-only scope, and contradictions with the structured rows.
218
-
219
- Capture the raw verifier return under the purpose directory's `.tmp/`, then run `okstra agent-prompt materialize-result`, `complete`, and `verify-completion` in order. Parse only the verified `returnedBody`; an inline or unverified response cannot pass the narrative gate.
220
-
221
- If either gate finds a defect, revise the same draft in place and restart from the deterministic gate. Allow at most two revision rounds across both gates. Never publish a draft that has not passed both gates in that order.
222
-
223
- After both gates pass:
224
-
225
- 1. Move the same draft content to the collision-safe final path; do not re-render it.
226
- 2. Re-read it and run the installed format validator on the final path, falling back to the repository validator only when needed.
227
- 3. Delete the temporary selection file only after final validation passes.
228
- 4. Report completion in Korean with the output path, included/excluded counts, finite total range, and lead-plus-verifier mode.
229
-
230
- ## Forbidden patterns
231
-
232
- - Guessing a planning report after `stage-map` reports a structured error.
233
- - Treating `workStatus` as the detailed schedule status.
234
- - Scheduling completed or non-selected stages.
235
- - Publishing a Gantt row without its `Stage <n>` label and `days=` range, or abbreviating that label to `S<n>`.
236
- - Drawing stage order in `## Task Dependency Graph` — that graph carries cross-task edges only; stage order lives in the Work Breakdown's `Depends On` column.
237
- - Dispatching narrative validation before deterministic `--selection-json` validation.
238
- - Re-rendering after validation instead of promoting the same draft.
239
- - Deleting the selection contract before final validation.
240
- - Publishing after more than two unsuccessful revision rounds.
@@ -1,167 +0,0 @@
1
- # okstra-setup AI Manual
2
-
3
- ## Source
4
-
5
- - Skill source: [`skills/okstra-setup/SKILL.md`](../../../skills/okstra-setup/SKILL.md)
6
- - CLI registry: [`src/cli-registry.mjs`](../../../src/cli-registry.mjs)
7
- - project registration impl: `src/commands/lifecycle/setup.mjs`
8
- - install/ensure-installed impl: `src/commands/lifecycle/install.mjs`
9
-
10
- ## Purpose
11
-
12
- `okstra-setup` handles two things.
13
-
14
- 1. Machine-level runtime install: `~/.okstra/`, `~/.claude/skills/`, `~/.claude/agents/`
15
- 2. Project-level registration: `<PROJECT_ROOT>/.okstra/project.json`
16
-
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
-
19
- ## When to use
20
-
21
- Use it when:
22
-
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
-
27
- Do not use it when:
28
-
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
-
33
- ## Pre-run checks
34
-
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
-
37
- Install command:
38
-
39
- ```bash
40
- npx -y okstra@latest install --runtime claude-code
41
- ```
42
-
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
-
45
- ## Command invocation rule
46
-
47
- After `okstra install`, every subsequent command must begin with the literal `okstra` token.
48
-
49
- Allowed forms:
50
-
51
- ```bash
52
- okstra preflight
53
- okstra setup --yes --project-root /abs/project --project-id my-project
54
- okstra doctor --runtime claude-code
55
- ```
56
-
57
- Forms to avoid:
58
-
59
- - `export PYTHONPATH=...`
60
- - `eval "$(okstra paths --shell)"`
61
- - shell variables like `$PROJECT_ROOT`
62
- - `$(...)` command substitution
63
- - okstra calls wrapped in `if`, `&&`, `||`
64
-
65
- Because `okstra <subcmd>` bootstraps its own Python path, do not use `okstra paths --shell` in this skill. If you need the okstra home, run `okstra paths --field home` as a separate call and carry the printed path.
66
-
67
- ## Project root resolution
68
-
69
- Run first:
70
-
71
- ```bash
72
- okstra preflight
73
- ```
74
-
75
- Handle the result:
76
-
77
- - `Okstra preflight: ready`: already a registered project. Show `Project root`, `Project JSON`, and `Project ID` to the user and confirm whether to keep it.
78
- - `Okstra preflight: failed` with `Stage: resolve`: get an absolute project root from the user and re-run `okstra preflight --cwd /abs/path`.
79
- - `Okstra preflight: failed` with `Stage: project_json_missing`: proceed with the normal create path.
80
- - any other failure stage: show `Reason` verbatim and follow `Recovery`.
81
-
82
- ## Create or keep project.json
83
-
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
-
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
-
88
- Create command:
89
-
90
- ```bash
91
- okstra setup --yes --project-root /abs/project --project-id my-project
92
- ```
93
-
94
- `okstra setup` also refreshes the okstra-managed citation-guidance block in
95
- `<PROJECT_ROOT>/CLAUDE.md` and `AGENTS.md` when those files already exist (it never
96
- creates them). The block tells agents not to carry okstra-internal references — report
97
- section numbers, `C-NNN` clarification ids, run/stage ids, `.okstra/...` paths — into
98
- writing that is not an okstra report, where the reader cannot resolve them. The command
99
- reports the files it touched in its JSON `citationGuidance` array; a failure there is a
100
- `warning:` line, not a non-zero exit. Tell the user which guidance files were updated so
101
- they can review the appended block.
102
-
103
- ## Optional configuration
104
-
105
- 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.
106
-
107
- Optional settings:
108
-
109
- - `worktreeSyncDirs`: a list of project-relative directories to symlink into the task worktree. The default is `.project-docs`, `.scratch`, `graphify-out`, `.claude`.
110
- - `qaCommands`: check-only lint/format/typecheck/test commands the implementation verifier runs.
111
- - `qaEnv`: the replica/test DB, local app URL, env file, and surface patterns
112
- Okstra uses to attempt Tier 3 automatically; real DB/API verification remains
113
- a user-owned advisory when the environment is unavailable or the result is
114
- non-PASS.
115
- - PR body template: `okstra config set pr-template-path "<path>" --scope project|global`
116
- - final report language: `okstra config set report-language <language-tag> --scope project` (`en`, `ko`, `fr`, `pt-BR`, …; default `en`)
117
- - `architecture.style`: the project's declared architecture — `hexagonal`,
118
- `layered`, or `none` (default `none` when absent, unrecognized, or
119
- unreadable). `okstra setup` never writes it; hand-add it to `project.json`
120
- and the upsert preserves it. Declaring a style promotes that architecture's
121
- placement rules from advisory to a binding planning + verification
122
- constraint — under `hexagonal` an extracted variation point must be a port,
123
- under `layered` the dependency direction is worker-judged with no machine
124
- check. See section F of `references/project-config.md`.
125
- - `reviewRulePacks`: absolute paths to the project's own review rule packs (a
126
- team PR-review skill's `SKILL.md`). Without a declaration a pack applies only
127
- when the task brief cites its exact path; declared here it applies to every
128
- run, and the two channels are a union. Read by `implementation-planning`, the
129
- executor preflight, the implementation verifier, and `final-verification`.
130
- `okstra setup` never writes it. `okstra doctor --phase <phase>` fails when a
131
- declared path is not readable. See section G of
132
- `references/project-config.md`.
133
-
134
- 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`.
135
-
136
- ## Automatic Claude settings symlink
137
-
138
- `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.
139
-
140
- ## Verify
141
-
142
- Run last:
143
-
144
- ```bash
145
- okstra doctor --runtime claude-code
146
- ```
147
-
148
- 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.
149
-
150
- ## Completion message
151
-
152
- Keep it short and include the following.
153
-
154
- - runtime location: `~/.okstra` (also show the `version stamp: x.y.z` line from the install summary)
155
- - project metadata: `<PROJECT_ROOT>/.okstra/project.json`
156
- - `projectId`
157
- - next step: `/okstra-run`
158
-
159
- ## Common failure handling
160
-
161
- | Symptom | Handling |
162
- |---|---|
163
- | `command not found: npx` | Point to installing Node 18+ |
164
- | `--project-id is required` | Re-ask for the project id and re-run with a non-empty value |
165
- | `projectId mismatch` | Confirm with the user which id is canonical. Do not delete automatically |
166
- | `.okstra/` write EACCES | Explain the ownership/writability problem |
167
- | `.claude/settings.local.json` symlink warning | Show the backup file and symlink state to the user and guide a manual merge |