okstra 0.123.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.
- package/README.md +1 -0
- package/docs/architecture/storage-model.md +1 -1
- package/docs/architecture.md +11 -1
- package/docs/cli.md +2 -0
- package/docs/for-ai/README.md +41 -35
- package/docs/for-ai/skills/okstra-brief-gen.md +105 -105
- package/docs/for-ai/skills/okstra-container-build.md +61 -61
- package/docs/for-ai/skills/okstra-graphify.md +64 -0
- package/docs/for-ai/skills/okstra-inspect.md +86 -86
- package/docs/for-ai/skills/okstra-manager.md +32 -32
- package/docs/for-ai/skills/okstra-memory.md +49 -50
- package/docs/for-ai/skills/okstra-pr-gen.md +48 -0
- package/docs/for-ai/skills/okstra-rollup.md +58 -58
- package/docs/for-ai/skills/okstra-run.md +95 -95
- package/docs/for-ai/skills/okstra-schedule-gen.md +106 -106
- package/docs/for-ai/skills/okstra-setup.md +63 -64
- package/docs/for-ai/skills/okstra-user-response.md +48 -0
- package/docs/performance-improvement-plan-v2.md +4 -4
- package/docs/pr-template-usage.md +34 -34
- package/docs/project-structure-overview.md +91 -70
- package/docs/task-process/README.md +33 -33
- package/docs/task-process/common-flow.md +26 -26
- package/docs/task-process/error-analysis.md +20 -21
- package/docs/task-process/final-verification.md +41 -41
- package/docs/task-process/implementation-planning.md +33 -33
- package/docs/task-process/implementation.md +38 -38
- package/docs/task-process/release-handoff.md +46 -46
- package/docs/task-process/requirements-discovery.md +22 -23
- package/package.json +1 -1
- package/runtime/BUILD.json +2 -2
- package/runtime/agents/workers/antigravity-worker.md +4 -4
- package/runtime/agents/workers/claude-worker.md +2 -2
- package/runtime/agents/workers/codex-worker.md +4 -4
- package/runtime/agents/workers/report-writer-worker.md +4 -4
- package/runtime/prompts/coding-preflight/frameworks/node-server.md +1 -1
- package/runtime/prompts/launch.template.md +1 -1
- package/runtime/prompts/lead/convergence.md +10 -20
- package/runtime/prompts/lead/okstra-lead-contract.md +14 -16
- package/runtime/prompts/lead/plan-body-verification.md +18 -18
- package/runtime/prompts/lead/report-writer.md +43 -44
- package/runtime/prompts/lead/team-contract.md +11 -122
- package/runtime/prompts/profiles/_common-contract.md +15 -22
- package/runtime/prompts/profiles/_implementation-deliverable.md +1 -1
- package/runtime/prompts/profiles/_implementation-executor.md +1 -1
- package/runtime/prompts/profiles/_implementation-verifier.md +2 -2
- package/runtime/prompts/profiles/error-analysis.md +2 -2
- package/runtime/prompts/profiles/final-verification.md +1 -1
- package/runtime/prompts/profiles/implementation-planning.md +13 -13
- package/runtime/prompts/profiles/implementation.md +1 -1
- package/runtime/prompts/profiles/improvement-discovery.md +1 -1
- package/runtime/prompts/profiles/release-handoff.md +3 -3
- package/runtime/prompts/profiles/requirements-discovery.md +18 -18
- package/runtime/skills/_fragments/bash-invocation-rule.md +1 -0
- package/runtime/skills/_fragments/preflight-outdated-cli.md +1 -0
- package/runtime/skills/_fragments/python-bootstrap-note.md +1 -0
- package/runtime/skills/okstra-brief-gen/SKILL.md +117 -122
- package/runtime/skills/okstra-container-build/SKILL.md +24 -14
- package/runtime/skills/okstra-graphify/SKILL.md +12 -4
- package/runtime/skills/okstra-inspect/SKILL.md +104 -98
- package/runtime/skills/okstra-manager/SKILL.md +1 -1
- package/runtime/skills/okstra-memory/SKILL.md +3 -3
- package/runtime/skills/okstra-rollup/SKILL.md +12 -6
- package/runtime/skills/okstra-run/SKILL.md +49 -88
- package/runtime/skills/okstra-schedule-gen/SKILL.md +36 -30
- package/runtime/skills/okstra-setup/SKILL.md +1 -1
- package/runtime/skills/okstra-setup/references/project-config.md +17 -16
- package/runtime/skills/okstra-usage/SKILL.md +5 -2
- package/runtime/skills/okstra-user-response/SKILL.md +15 -3
- package/runtime/templates/prd/brief.template.md +92 -92
- package/runtime/templates/reports/error-analysis-input.template.md +1 -1
- package/runtime/templates/reports/fan-out-unit.template.md +6 -6
- package/runtime/templates/reports/final-verification-input.template.md +6 -6
- package/runtime/templates/reports/implementation-input.template.md +1 -1
- package/runtime/templates/reports/implementation-planning-input.template.md +1 -1
- package/runtime/templates/reports/improvement-discovery-input.template.md +1 -1
- package/runtime/templates/reports/quick-input.template.md +1 -1
- package/runtime/templates/reports/release-handoff-input.template.md +1 -1
- package/runtime/templates/reports/schedule.template.md +22 -22
- package/runtime/templates/reports/task-brief.template.md +3 -3
- package/runtime/templates/reports/user-response.template.md +20 -20
- package/runtime/templates/worker-prompt-preamble.md +111 -13
- package/runtime/validators/validate-schedule.py +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# okstra-pr-gen AI Manual
|
|
2
|
+
|
|
3
|
+
## Sources
|
|
4
|
+
|
|
5
|
+
- Skill source: [`skills/okstra-pr-gen/SKILL.md`](../../../skills/okstra-pr-gen/SKILL.md)
|
|
6
|
+
- Template core (CLI): [`scripts/okstra_ctl/pr_template.py`](../../../scripts/okstra_ctl/pr_template.py)
|
|
7
|
+
- Node wrapper: [`src/commands/pr/pr.mjs`](../../../src/commands/pr/pr.mjs)
|
|
8
|
+
- Bundled default template: [`src/commands/pr/default.md`](../../../src/commands/pr/default.md)
|
|
9
|
+
|
|
10
|
+
## Purpose
|
|
11
|
+
|
|
12
|
+
`okstra-pr-gen` registers PR body templates and generates PR descriptions from a branch diff. Templates live in the user home at `~/.okstra/template/pr/`. This skill is **global** — it does not require `<PROJECT_ROOT>/.okstra/project.json`. PR generation additionally requires the current directory to be a git repository.
|
|
13
|
+
|
|
14
|
+
## Check CLI availability
|
|
15
|
+
|
|
16
|
+
A separate Bash call with a literal leading token:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
okstra pr --help
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If `okstra` is not on PATH: `okstra not installed — run npx okstra@latest install once, then retry`. Every Bash command starts with the literal `okstra` token and passes literal arguments (do not wrap it in `$(...)`/leading `VAR=`/`if`/`eval`/`||`/`&&`).
|
|
23
|
+
|
|
24
|
+
## Pick the mode (always first)
|
|
25
|
+
|
|
26
|
+
A 3-option picker via `AskUserQuestion`:
|
|
27
|
+
|
|
28
|
+
1. `Generate PR` — generate a PR body from a branch diff
|
|
29
|
+
2. `Register template` — save a new PR body template
|
|
30
|
+
3. `Enter manually` — always last (okstra picker convention)
|
|
31
|
+
|
|
32
|
+
## Mode A — Generate PR
|
|
33
|
+
|
|
34
|
+
1. Pick a template: `okstra pr template list --json`. If empty, use the bundled default. Carry the chosen name as `<template>` (`default` for the bundled one).
|
|
35
|
+
2. Pick the base branch: `okstra pr branches --json`. 3-option from the top `recommended` entries plus `Enter manually`. Carry the choice as `<base>`.
|
|
36
|
+
3. Generation bundle: `okstra pr gen --base <base> --template <template> --json` → `{base, currentBranch, templateName, template, commits, diffStat}`. Then **read the real diff honestly** (SSOT): `git diff <base>...HEAD` (large diffs section by section). Fill the placeholders from the diff and commits, describing **only actual changes**. Mark a checklist box `[x]` only when the diff supports it (tests touched → tests box, docs touched → docs box). If `commits`/`diffStat` are empty, say there is nothing to describe and stop. **Never append AI trailers/footers.**
|
|
37
|
+
4. Output and offer to create the PR: print the filled PR body as a single fenced markdown block. Ask whether to open a PR. **Only on an explicit yes**: write the body to a temp file and run `gh pr create --base <base> --title "<title>" --body-file <path>`. If `gh` is missing or unauthenticated (`gh auth status` fails), leave the text in chat and give manual-creation guidance. **No push/PR creation without the user's confirmation.**
|
|
38
|
+
|
|
39
|
+
## Mode B — Register template
|
|
40
|
+
|
|
41
|
+
1. Template name (`AskUserQuestion`, free text) — must match `^[A-Za-z0-9._-]+$`, otherwise re-ask.
|
|
42
|
+
2. body — pasted text or an absolute path.
|
|
43
|
+
3. Save: `okstra pr template add --name <name> --file <abs-path>` (or, for pasted text, `--content "<body>"`). Add `--yes` only when the user confirmed overwriting a same-named template. Report the saved path (`saved: ...`).
|
|
44
|
+
|
|
45
|
+
## Output Rules
|
|
46
|
+
|
|
47
|
+
- Not read-side — write actions (PR creation, template saving) happen only after the user's explicit confirmation.
|
|
48
|
+
- Do not invent changes not in the diff. Stop if commit/diffStat is empty.
|
|
@@ -1,82 +1,82 @@
|
|
|
1
1
|
# okstra-rollup AI Manual
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Source
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
- Node
|
|
8
|
-
-
|
|
9
|
-
- catalog
|
|
10
|
-
-
|
|
5
|
+
- Skill source: [`skills/okstra-rollup/SKILL.md`](../../../skills/okstra-rollup/SKILL.md)
|
|
6
|
+
- aggregation core (CLI): [`scripts/okstra_ctl/rollup.py`](../../../scripts/okstra_ctl/rollup.py)
|
|
7
|
+
- Node wrapper: [`src/commands/inspect/rollup.mjs`](../../../src/commands/inspect/rollup.mjs)
|
|
8
|
+
- reused single-task aggregators: [`scripts/okstra_ctl/time_report.py`](../../../scripts/okstra_ctl/time_report.py), [`scripts/okstra_ctl/error_log_core.py`](../../../scripts/okstra_ctl/error_log_core.py)
|
|
9
|
+
- catalog enumeration helper: [`scripts/okstra_project/state.py`](../../../scripts/okstra_project/state.py) (`list_project_tasks`)
|
|
10
|
+
- unit tests: [`tests/inspect/test_okstra_rollup.py`](../../../tests/inspect/test_okstra_rollup.py)
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Purpose
|
|
13
13
|
|
|
14
|
-
`okstra-rollup
|
|
14
|
+
`okstra-rollup` **collects and summarizes the run results of multiple tasks at once**. It is a cross-task read-side layer, in contrast to `okstra-inspect` which looks at a single task.
|
|
15
15
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
16
|
+
- Input scope: one task-group, or the whole-project catalog when `--task-group` is omitted.
|
|
17
|
+
- Deterministic aggregation (counts, time sums, error sums, status/category/phase distributions) is handled entirely by the `okstra rollup` CLI. The skill renders that table and reads each task's report body to write a **cross-task synthesis (digest)**.
|
|
18
|
+
- Design principle: hand-computed aggregation is error-prone for an LLM, so it is pushed to the CLI (SSOT), and only the natural-language synthesis is left to the LLM. This is the same division of labor as `okstra-inspect time`, which insists on "never re-sum the time by hand".
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
This skill is read-only. It does not mutate task artifacts.
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## When to use
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Use it when:
|
|
25
25
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
26
|
+
- The user asks for "rollup", "task-group summary", "group-level report", "collect multiple task results", "whole-project task status summary", "run results all at once".
|
|
27
|
+
- You want to look across **multiple tasks** rather than a single one.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Do not use it when:
|
|
30
30
|
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
31
|
+
- A single task's report/time/errors/recap → `okstra-inspect` (report / time / errors / recap facet).
|
|
32
|
+
- A forward-looking work plan (a client-facing schedule of non-done tasks) → `okstra-schedule-gen`. rollup is **retrospective**, collecting past run results; schedule is **forward-looking**, planning future work.
|
|
33
|
+
- Actual phase execution → `okstra-run`.
|
|
34
34
|
|
|
35
35
|
## Preflight
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
A single Bash call starting with the literal `okstra` token (not wrapped in `if`/`eval`/`$(...)`/`VAR=`/`||`/`&&`/`npx` fallback):
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
okstra preflight --runtime claude-code --json
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
`ok:false` → `/okstra-setup`
|
|
43
|
+
`ok:false` → point to `/okstra-setup` and stop. If `ok:true`, carry `projectRoot` as a literal string and proceed.
|
|
44
44
|
|
|
45
|
-
## scope
|
|
45
|
+
## scope resolution
|
|
46
46
|
|
|
47
|
-
-
|
|
48
|
-
- "
|
|
49
|
-
-
|
|
47
|
+
- The user named a task-group ("summarize the alpha group") → `--task-group <group>`.
|
|
48
|
+
- "all tasks" / "the whole project" / no scope named → omit `--task-group` (whole catalog).
|
|
49
|
+
- If genuinely ambiguous, ask once: one task-group or the whole project? Do not silently guess a specific group.
|
|
50
50
|
|
|
51
|
-
## CLI
|
|
51
|
+
## CLI call
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
54
|
okstra rollup --task-group <group> --project-root <projectRoot> --json
|
|
55
55
|
```
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
For the whole project, drop `--task-group`. The output is always JSON, and **all times are raw milliseconds**.
|
|
58
58
|
|
|
59
|
-
##
|
|
59
|
+
## Interpreting the output
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
Top level:
|
|
62
62
|
|
|
63
|
-
- `taskGroup` —
|
|
64
|
-
- `tasks[]` — task
|
|
65
|
-
- `totals` — `runs, cpuSumMs, wallClockMs, errors`,
|
|
63
|
+
- `taskGroup` — the scope (`null` = whole project), `taskCount` — number of tasks.
|
|
64
|
+
- `tasks[]` — per task: `taskKey, taskGroup, taskId, taskType, workCategory, workStatus, currentPhase, currentPhaseState, nextRecommendedPhase, latestRunStatus, updatedAt, reportPath, runCount, cpuSumMs, wallClockMs, errorCount`.
|
|
65
|
+
- `totals` — `runs, cpuSumMs, wallClockMs, errors`, plus `byWorkStatus` / `byWorkCategory` / `byCurrentPhase` / `byTaskType` (each a `{value: count}` map).
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
Numeric meanings (must observe):
|
|
68
68
|
|
|
69
|
-
- `runCount
|
|
70
|
-
- `cpuSumMs
|
|
71
|
-
- `reportPath
|
|
72
|
-
- `taskCount
|
|
69
|
+
- `runCount` is the **total number of runs** in the timeline. `cpuSumMs`/`wallClockMs` reflect only runs that reached Phase 7 usage, so they can be `0` even when `runCount > 0`.
|
|
70
|
+
- `cpuSumMs` is the **CPU sum** of the overlapping lead + workers, not wall-clock. Label it "CPU", and show wall-clock as `wallClockMs` only when the user explicitly asks.
|
|
71
|
+
- `reportPath` is project-relative and may be empty (a task with no report yet).
|
|
72
|
+
- If `taskCount` is `0`, say there are no okstra tasks in that scope and stop.
|
|
73
73
|
|
|
74
|
-
##
|
|
74
|
+
## Render
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
Convert every `*Ms` to `HH:MM:SS` (zero-pad; never expose raw ms — the same rule as `okstra-inspect time`). Sort tasks by `updatedAt` descending.
|
|
77
77
|
|
|
78
78
|
```markdown
|
|
79
|
-
## okstra Rollup — <task-group
|
|
79
|
+
## okstra Rollup — <task-group or "whole project"> (<taskCount> tasks)
|
|
80
80
|
|
|
81
81
|
| Task | Category | workStatus | Phase | Runs | CPU | Errors | Report |
|
|
82
82
|
|------|----------|------------|-------|------|-----|--------|--------|
|
|
@@ -87,26 +87,26 @@ okstra rollup --task-group <group> --project-root <projectRoot> --json
|
|
|
87
87
|
**workStatus:** done 1 · in-progress 1 **category:** bugfix 1 · feature 1
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
- `Report`
|
|
91
|
-
-
|
|
90
|
+
- `Report` column: `✓` when `reportPath` is present, `—` when not.
|
|
91
|
+
- Build the status/category/phase lines from the `totals` tally maps **verbatim**. Do not count the `tasks[]` array yourself (the CLI is the SSOT for aggregation).
|
|
92
92
|
|
|
93
|
-
## digest
|
|
93
|
+
## Writing the digest (the summary — the skill's core value)
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
When the user asks to "summarize"/"organize"/"summarize"/"digest" (the common case):
|
|
96
96
|
|
|
97
|
-
1. `reportPath
|
|
98
|
-
2. per-task
|
|
99
|
-
3.
|
|
97
|
+
1. For each task with a non-empty `reportPath` whose `<projectRoot>/<reportPath>` file actually exists, read the report and summarize in 1–2 lines **what it accomplished and its recommended next step**.
|
|
98
|
+
2. Above the per-task lines, write a 2–4 sentence group-level synthesis: what was delivered across the group, where the open work sits (using `byWorkStatus`/`byCurrentPhase`), and whether there are error hot-spots (tasks with high `errorCount`).
|
|
99
|
+
3. Cite each per-task claim with the report path (`<reportPath>`) so the reader can open it directly.
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
For a task with no report, do not invent a summary; state the current phase/workStatus instead. Do not read non-report artifacts to fill the gap (artifact-home rule). If a report is empty or missing, say so.
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
If a deep single-task drill-down (full report, per-worker time, error breakdown, run-to-run recap) is needed, point the user to `/okstra-inspect`.
|
|
104
104
|
|
|
105
|
-
##
|
|
105
|
+
## Forbidden patterns
|
|
106
106
|
|
|
107
|
-
-
|
|
108
|
-
- raw ms
|
|
109
|
-
- `cpuSumMs
|
|
110
|
-
-
|
|
111
|
-
- okstra
|
|
112
|
-
-
|
|
107
|
+
- Re-counting aggregate numbers (totals, distributions) by hand from `tasks[]`. `totals` is the SSOT.
|
|
108
|
+
- Exposing raw ms. Always `HH:MM:SS`.
|
|
109
|
+
- Labeling `cpuSumMs` as if it were wall-clock.
|
|
110
|
+
- Inventing a summary for a task with no report. Substitute the current phase/workStatus.
|
|
111
|
+
- Reading files outside okstra artifacts (non-`.okstra`) to fill the summary.
|
|
112
|
+
- Handling single-task detail in rollup. Send it to `okstra-inspect`.
|
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
# okstra-run AI Manual
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Source
|
|
4
4
|
|
|
5
|
-
-
|
|
5
|
+
- Skill source: [`skills/okstra-run/SKILL.md`](../../../skills/okstra-run/SKILL.md)
|
|
6
6
|
- wizard CLI wrapper: [`src/commands/execute/wizard.mjs`](../../../src/commands/execute/wizard.mjs)
|
|
7
7
|
- wizard state machine: [`scripts/okstra_ctl/wizard.py`](../../../scripts/okstra_ctl/wizard.py)
|
|
8
8
|
- render-bundle CLI: [`src/commands/execute/render-bundle.mjs`](../../../src/commands/execute/render-bundle.mjs)
|
|
9
9
|
- prepare entrypoint: [`scripts/okstra_ctl/run.py`](../../../scripts/okstra_ctl/run.py)
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Purpose
|
|
12
12
|
|
|
13
|
-
`okstra-run
|
|
13
|
+
`okstra-run` starts an okstra task run inside the current Claude Code session. 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 session takes over as Claude lead.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Single authority:
|
|
16
16
|
|
|
17
|
-
-
|
|
17
|
+
- Question order, branching, validation: `scripts/okstra_ctl/wizard.py`
|
|
18
18
|
- task bundle materialization: `prepare_task_bundle()`
|
|
19
|
-
-
|
|
19
|
+
- Skill document: thin prompt-relay loop
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## When to Use
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Use it when:
|
|
24
24
|
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
- "okstra run", "okstra start", "
|
|
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
28
|
|
|
29
|
-
|
|
29
|
+
Do not use it when:
|
|
30
30
|
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
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
34
|
|
|
35
35
|
## Preflight
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
A single Bash call:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
okstra preflight --runtime claude-code --json
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
runtime
|
|
43
|
+
If there is no runtime or project setup (`ok:false`), point the user to `/okstra-setup` and stop. Do not create an `export PYTHONPATH`.
|
|
44
44
|
|
|
45
|
-
## Bash
|
|
45
|
+
## Bash invocation rule
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
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.
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
Avoid:
|
|
50
50
|
|
|
51
51
|
- `$STATE_FILE`, `$ANSWER`
|
|
52
52
|
- `$(...)`
|
|
@@ -54,21 +54,21 @@ runtime이나 project setup이 없으면(`ok:false`) `/okstra-setup`을 안내
|
|
|
54
54
|
- `eval`, `export`
|
|
55
55
|
- `okstra ... && okstra ...`
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Do not drop the flag even for an empty answer.
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
60
|
okstra wizard step --state-file /tmp/okstra-wizard/state.json --answer ""
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
## wizard
|
|
63
|
+
## wizard initialization
|
|
64
64
|
|
|
65
|
-
state file
|
|
65
|
+
Create the state file:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
okstra wizard new-state-file
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
Carry the printed absolute path verbatim.
|
|
72
72
|
|
|
73
73
|
wizard init:
|
|
74
74
|
|
|
@@ -76,61 +76,61 @@ wizard init:
|
|
|
76
76
|
okstra wizard init --state-file /tmp/okstra-wizard/state.json --project-root /abs/project --project-id project-id
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
The result is `{ok, next}` JSON. The first step is `task_pick`.
|
|
80
80
|
|
|
81
|
-
## wizard JSON
|
|
81
|
+
## Interpreting the wizard JSON
|
|
82
82
|
|
|
83
|
-
`next.kind
|
|
83
|
+
Pick the UI according to `next.kind`.
|
|
84
84
|
|
|
85
|
-
| kind |
|
|
85
|
+
| kind | Handling |
|
|
86
86
|
|---|---|
|
|
87
|
-
| `pick`, `multi: false` |
|
|
88
|
-
| `pick`, `multi: true` |
|
|
89
|
-
| `pick_group` | wizard
|
|
90
|
-
| `text` |
|
|
91
|
-
| `done` |
|
|
92
|
-
| `aborted` | state file
|
|
87
|
+
| `pick`, `multi: false` | Render every `options[]` verbatim as a selectable choice. Submit the chosen option's `value` |
|
|
88
|
+
| `pick`, `multi: true` | Submit all chosen values as a comma-separated string. An empty selection still submits `--answer ""` |
|
|
89
|
+
| `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 |
|
|
90
|
+
| `text` | Show a plain text label without a picker, then submit the user's next message verbatim |
|
|
91
|
+
| `done` | Input collection finished. Move to render-args |
|
|
92
|
+
| `aborted` | Delete the state file and stop. Do not call render-args/render-bundle |
|
|
93
93
|
|
|
94
|
-
`progress.label
|
|
94
|
+
`progress.label` is a string the wizard composed. Append it verbatim after the UI prompt; do not compute it yourself.
|
|
95
95
|
|
|
96
96
|
## wizard loop
|
|
97
97
|
|
|
98
|
-
1. prompt
|
|
99
|
-
2.
|
|
100
|
-
3. `ok: true`: `result.echo
|
|
101
|
-
4. `ok: false`: `result.error
|
|
102
|
-
5. `current: null`: prompt
|
|
98
|
+
1. Render the prompt.
|
|
99
|
+
2. Submit the user's answer as a literal `--answer`.
|
|
100
|
+
3. `ok: true`: show `result.echo` to the user on one line and advance to the next step.
|
|
101
|
+
4. `ok: false`: show `result.error` verbatim and retry the same step via `result.current`.
|
|
102
|
+
5. `current: null`: a terminal error where the prompt cannot be reconstructed. Show the error and stop.
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
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.
|
|
105
105
|
|
|
106
|
-
## brief
|
|
106
|
+
## brief candidate ordering
|
|
107
107
|
|
|
108
|
-
entry
|
|
108
|
+
The brief selection for entry phases (`requirements-discovery`, `error-analysis`, `improvement-discovery`) is handled by the wizard.
|
|
109
109
|
|
|
110
|
-
- task-group
|
|
111
|
-
- brief
|
|
112
|
-
- brief
|
|
113
|
-
- direct input
|
|
110
|
+
- task-group candidates are shown newest-first by combining recent task-catalog use with the recent brief creation/modification times under `.okstra/briefs/<group>/`.
|
|
111
|
+
- brief file candidates are chosen from within the selected group's `.okstra/briefs/<task-group>/**/*.md`.
|
|
112
|
+
- The brief-file sort key is `max(file created/modified time, task-catalog updatedAt of the task that used this brief)`.
|
|
113
|
+
- direct input is always last.
|
|
114
114
|
|
|
115
115
|
## confirm step
|
|
116
116
|
|
|
117
|
-
`next.step == "confirm"
|
|
117
|
+
When `next.step == "confirm"`, first fetch the confirmation summary.
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
120
|
okstra wizard confirmation --state-file /tmp/okstra-wizard/state.json
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
-
`text
|
|
123
|
+
Show `text` to the user, then render the Proceed/Edit/Abort picker. `Edit` rewinds the wizard to an earlier step.
|
|
124
124
|
|
|
125
|
-
## outcome
|
|
125
|
+
## outcome and render-bundle
|
|
126
126
|
|
|
127
|
-
`next.kind == "done"
|
|
127
|
+
When `next.kind == "done"`:
|
|
128
128
|
|
|
129
129
|
```bash
|
|
130
130
|
okstra wizard outcome --state-file /tmp/okstra-wizard/state.json
|
|
131
131
|
```
|
|
132
132
|
|
|
133
|
-
`outcome.persistActions[]
|
|
133
|
+
Run `outcome.persistActions[]` first, then pass each key of the `outcome.renderArgs` object as an `okstra render-bundle` flag. Pass empty string values explicitly too. 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`). In the render-bundle block, `--stage` is implementation·final-verification only, and `--stages` is release-handoff only (empty value = whole-task).
|
|
134
134
|
|
|
135
135
|
```bash
|
|
136
136
|
okstra render-bundle \
|
|
@@ -160,52 +160,52 @@ okstra render-bundle \
|
|
|
160
160
|
--fix-cycle "<args.fix-cycle>"
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
Parse the following labeled lines from stdout.
|
|
164
164
|
|
|
165
165
|
- `okstra task root:`
|
|
166
166
|
- `okstra instruction-set:`
|
|
167
|
-
-
|
|
167
|
+
- optionally `okstra concurrent-run stages:`
|
|
168
168
|
|
|
169
|
-
render-bundle
|
|
169
|
+
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`.
|
|
170
170
|
|
|
171
171
|
## conformance waiver
|
|
172
172
|
|
|
173
|
-
|
|
173
|
+
Offer a waiver to the user only when Tier 3 conformance is genuinely impossible in the environment during implementation. A waiver requires user approval and a verbatim reason. Neither the AI lead nor a worker creates a self-exemption.
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
When chosen, add it to `render-bundle` only.
|
|
176
176
|
|
|
177
177
|
```bash
|
|
178
178
|
--qa-waiver "<stageKey>:<reason>"
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
-
|
|
181
|
+
Omit the flag entirely when there is no value.
|
|
182
182
|
|
|
183
|
-
## concurrent-run
|
|
183
|
+
## concurrent-run branch
|
|
184
184
|
|
|
185
|
-
`render-bundle` stdout
|
|
185
|
+
If `render-bundle` stdout carries `okstra concurrent-run stages:`, the no-team background gate is already reflected in the prompt.
|
|
186
186
|
|
|
187
|
-
|
|
187
|
+
Give the user three options.
|
|
188
188
|
|
|
189
|
-
1. no-team background
|
|
190
|
-
2.
|
|
191
|
-
3.
|
|
189
|
+
1. Proceed as no-team background.
|
|
190
|
+
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.
|
|
191
|
+
3. Enter directly.
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
This picker is authored by the skill, so it is separate from the wizard-option-abbreviation ban.
|
|
194
194
|
|
|
195
195
|
## stale git SHA recovery
|
|
196
196
|
|
|
197
|
-
`Recorded stage SHAs no longer match the git history
|
|
197
|
+
When a `PrepareError` such as `Recorded stage SHAs no longer match the git history` appears, do not fix the registry/consumers by hand.
|
|
198
198
|
|
|
199
|
-
1.
|
|
200
|
-
2. confirm
|
|
201
|
-
3.
|
|
202
|
-
4.
|
|
199
|
+
1. Run the `okstra git-reconcile ... --check --json` printed in the error message verbatim.
|
|
200
|
+
2. For each confirm item, ask the user for the current branch tip, a different ref, or abort.
|
|
201
|
+
3. Run `okstra git-reconcile ... --apply --stage <N> --use-ref <ref>` with the chosen ref.
|
|
202
|
+
4. Retry the failed render-bundle with the same arguments.
|
|
203
203
|
|
|
204
|
-
anchor
|
|
204
|
+
If the anchor is unresolvable, run `--reset-anchor <ref>` after user confirmation.
|
|
205
205
|
|
|
206
206
|
## PR template persistence
|
|
207
207
|
|
|
208
|
-
release-handoff
|
|
208
|
+
In release-handoff, when `outcome.persistActions[]` returns a `config.set` / `pr-template-path` action, save the config before render-bundle.
|
|
209
209
|
|
|
210
210
|
```bash
|
|
211
211
|
# action.scope == "project"
|
|
@@ -214,40 +214,40 @@ okstra config set pr-template-path "<path>" --scope project
|
|
|
214
214
|
okstra config set pr-template-path "<path>" --scope global
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
-
scope
|
|
217
|
+
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.
|
|
218
218
|
|
|
219
|
-
## Claude lead
|
|
219
|
+
## Claude lead takeover
|
|
220
220
|
|
|
221
|
-
render-bundle
|
|
221
|
+
After render-bundle, read `<INSTRUCTION_SET_PATH>/claude-execution-prompt.md` verbatim and proceed from Phase 1 in that prompt's order.
|
|
222
222
|
|
|
223
|
-
|
|
223
|
+
Inform the user on one line.
|
|
224
224
|
|
|
225
225
|
```text
|
|
226
226
|
Took over as Claude lead for `<taskKey>` (`<task-type>`). Run dir: `<RUN_DIR_RELATIVE_PATH>`. Beginning Phase 1 (context loading).
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
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.
|
|
230
230
|
|
|
231
|
-
## implementation
|
|
231
|
+
## implementation unattended chaining (chain-stages)
|
|
232
232
|
|
|
233
|
-
`task-type == implementation
|
|
233
|
+
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:
|
|
234
234
|
|
|
235
|
-
1. render-bundle
|
|
236
|
-
2. Step 6
|
|
237
|
-
3. `done`
|
|
238
|
-
4.
|
|
235
|
+
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 conformance waiver·concurrent-run·git-reconcile gates apply identically to each stage's render-bundle.
|
|
236
|
+
2. As in Step 6, become Claude 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`.
|
|
237
|
+
3. After confirming the `done` row was written, move to the next stage. Clean up context (leftover panes·finished teammates) at each stage boundary.
|
|
238
|
+
4. One-line report at each stage start/finish: `stage N/<total> start` / `stage N done → next K`.
|
|
239
239
|
|
|
240
|
-
|
|
240
|
+
Once the whole queue is consumed, end the chain and report completion.
|
|
241
241
|
|
|
242
|
-
-
|
|
243
|
-
-
|
|
242
|
+
- **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`).
|
|
243
|
+
- **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.
|
|
244
244
|
|
|
245
|
-
##
|
|
245
|
+
## Forbidden patterns
|
|
246
246
|
|
|
247
|
-
-
|
|
248
|
-
- wizard
|
|
249
|
-
- `text` prompt
|
|
250
|
-
-
|
|
251
|
-
-
|
|
252
|
-
- render-
|
|
253
|
-
-
|
|
247
|
+
- Changing the question order the wizard emitted.
|
|
248
|
+
- Hiding wizard options or keeping only the recommendations.
|
|
249
|
+
- Turning a `text` prompt into a picker.
|
|
250
|
+
- Dropping the `--answer` flag on an empty answer.
|
|
251
|
+
- Bypassing the wizard/render-bundle path by calling `okstra.sh`.
|
|
252
|
+
- Calling render-args on a state the user aborted before render-bundle.
|
|
253
|
+
- Starting phase work arbitrarily before reading the Claude lead prompt.
|