okstra 0.2.0 → 0.3.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/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "okstra",
3
- "version": "0.2.0",
4
- "description": "Runtime installer and path resolver for okstra cross-verification skills",
3
+ "version": "0.3.0",
4
+ "description": "Multi-agent cross-verification orchestrator runtime + Claude Code skills.",
5
5
  "license": "MIT",
6
6
  "author": "devonshin",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/Devonshin/okstra.git",
10
- "directory": "packages/okstra"
9
+ "url": "git+https://github.com/Devonshin/okstra.git"
11
10
  },
12
11
  "type": "module",
13
12
  "bin": {
@@ -23,8 +22,7 @@
23
22
  "node": ">=18"
24
23
  },
25
24
  "scripts": {
26
- "build": "node scripts/build.mjs",
27
- "prepack": "node scripts/build.mjs",
28
- "test": "node --test test/"
25
+ "build": "node tools/build.mjs",
26
+ "prepack": "node tools/build.mjs"
29
27
  }
30
28
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "package": "0.2.0",
3
- "builtAt": "2026-05-11T14:50:08.756Z",
2
+ "package": "0.3.0",
3
+ "builtAt": "2026-05-11T15:55:55.785Z",
4
4
  "repoRoot": "/home/runner/work/okstra/okstra"
5
5
  }
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: okstra-context-loader
3
+ description: Use when okstra Phase 1 starts, or when the user asks for an okstra task bundle path, task-manifest location, or the current/latest okstra run artifacts.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # OKSTRA Context Loader
8
+
9
+ ## When to Use
10
+
11
+ - When starting okstra Skill Phase 1 (Task-bundle intake)
12
+ - When the user needs to know the okstra task bundle path
13
+ - When you need to derive all artifact paths based on `task-manifest.json`
14
+
15
+ ## Step 1: Locating the Task Bundle
16
+
17
+ ### Default Location Rules
18
+
19
+ - AI documentation root: `.project-docs/`
20
+ - Project-level latest-task pointer: `.project-docs/okstra/discovery/latest-task.json`
21
+ - Project-level task catalog: `.project-docs/okstra/discovery/task-catalog.json`
22
+ - okstra task root: `.project-docs/okstra/tasks/`
23
+ - Task path pattern: `.project-docs/okstra/tasks/<task-group>/<task-id>/`
24
+
25
+ ### Task Identification
26
+ 1. If the user specifies the `task-manifest.json` path or the task root path, that path is used.
27
+ 2. If the user specifies only the task key, the expected task root is calculated by converting the `task-group` and `task-id` to lowercase and applying the slug rule (`[^a-z0-9]+` → `-`), and the corresponding `task-manifest.json` is opened.
28
+ 3. If the user attempts to find a task based on `task-group` + `task-id` or `task-id`, `.project-docs/okstra/discovery/task-catalog.json` is read to find candidates.
29
+ 4. If multiple candidates are found based on `task-id` alone, the situation is ambiguous, so `task-group` or the full `taskKey` is required.
30
+ 5. If the user has not provided an explicit task key/path, first read `.project-docs/okstra/discovery/latest-task.json` using the current-task convenience pointer.
31
+ 6. Even if the latest-task pointer is missing or corrupted, but the task catalog exists, first check the list of prepared task bundles based on the catalog. Do not use the legacy `CLAUDE.md`, project guide, or task scan fallback.
32
+
33
+ ## Step 2: Read task-manifest.json
34
+
35
+ task-manifest.json is the canonical metadata source. The following fields must be extracted from this file:
36
+
37
+ | Field | Description |
38
+ |------|------|
39
+ | `taskKey` | `<project-id>:<task-group>:<task-id>` |
40
+ | `projectId` | Project ID |
41
+ | `taskGroup` | Task group |
42
+ | `taskId` | Task ID |
43
+ | `taskType` | Analysis type (requirements-discovery, error-analysis, final-verification, implementation-planning) |
44
+ | `workCategory` | bugfix / feature / improvement / refactor / ops-change / unknown |
45
+ | `recommendedWorkers` | List of selected workers |
46
+ | `currentStatus` | Current task status |
47
+ | `workflow.phaseSequence` | Ordered lifecycle phases for the task |
48
+ | `workflow.currentPhase` | Current lifecycle phase |
49
+ | `workflow.currentPhaseState` | Current lifecycle phase state |
50
+ | `workflow.phaseStates` | Phase-by-phase lifecycle state map |
51
+ | `workflow.lastCompletedPhase` | Last completed lifecycle phase |
52
+ | `workflow.nextRecommendedPhase` | Next recommended lifecycle phase |
53
+ | `workflow.awaitingApproval` | Approval wait marker |
54
+ | `workflow.routingStatus` | Routing decision status |
55
+ | `workflow.lastSafeCheckpoint` | Safe resume checkpoint metadata |
56
+ | `instructionSetPath` | Instruction-set path |
57
+ | `referenceExpectationsPath` | config/deployment expectation artifact path |
58
+ | `latestRunPath` | latest run path |
59
+ | `latestRunStatus` | latest run status |
60
+ | `latestRunPromptsPath` | latest run prompt directory path |
61
+ | `latestReportPath` | latest report path |
62
+ | `latestResumeCommandPath` | resume helper path |
63
+ | `historyTimelinePath` | timeline path |
64
+ | `resultContract` | team contract and expected artifact metadata |
65
+ | `resultContract.requiredWorkerRoles[*].promptPath` | worker prompt history path by role |
66
+ | `convergence` | convergence loop settings (enabled, maxRounds, verificationMode). `maxRounds` 기본값은 phase-aware: `requirements-discovery`는 `1`, 그 외는 `2`. 자세한 내용은 [okstra-convergence](../okstra-convergence/SKILL.md) 참고 |
67
+
68
+ ## Step 3: Directory Structure Rules
69
+
70
+ After identifying the task root in `task-manifest.json`, derive all paths according to the following rules:
71
+
72
+ ```
73
+ <task-root>/
74
+ ├── task-manifest.json (canonical metadata)
75
+ ├── task-index.md (human-readable summary, non-canonical)
76
+ ├── instruction-set/
77
+ │ ├── analysis-profile.md (analysis guide by task type)
78
+ │ ├── analysis-material.md (analysis materials)
79
+ │ ├── reference-expectations.md (config/deployment expected values)
80
+ │ ├── task-brief.md (task brief)
81
+ │ └── final-report-template.md (Final Report Template)
82
+ ├── runs/
83
+ │ └── <task-type>/ (Run scope isolated per task-type, e.g. error-analysis)
84
+ │ ├── manifests/ (run-manifest-<task-type>-<seq>.json)
85
+ │ ├── state/ (team-state-<task-type>-<seq>.json, convergence-<task-type>-<seq>.json)
86
+ │ ├── prompts/ (claude-execution-prompt-<task-type>-<seq>.md and worker prompt history files)
87
+ │ ├── reports/ (final-report-<task-type>-<seq>.md)
88
+ │ ├── status/ (final-<task-type>-<seq>.status)
89
+ │ ├── sessions/ (claude-resume-<task-type>-<seq>.sh)
90
+ │ ├── logs/ (errors-<task-type>-<seq>.jsonl, optional)
91
+ │ └── worker-results/
92
+ │ ├── claude-worker-<task-type>-<seq>.md
93
+ │ ├── codex-worker-<task-type>-<seq>.md
94
+ │ ├── gemini-worker-<task-type>-<seq>.md
95
+ │ └── report-writer-worker-<task-type>-<seq>.md
96
+ └── history/
97
+ └── timeline.json
98
+ ```
99
+
100
+ ### File Naming Conventions
101
+
102
+ - Run-level artifact files use the `-<task-type>-<seq>` suffix, where `<seq>` is a 3-digit zero-padded sequence number (`001`, `002`, …) scanned **per-category directory** (`manifests/`, `prompts/`, `reports/`, `status/`, `state/`, `sessions/`, `worker-results/`). Re-runs of the same task-type never overwrite each other's artifacts.
103
+ - Because each category directory has its own counter, the `<seq>` for `manifests/` may differ from the `<seq>` for `reports/` if a previous run only wrote some categories. The shared run identifier across categories is the manifest `runDateTimeSegment` field (still ISO timestamp), not a filename infix.
104
+ - Worker result files use the same `-<task-type>-<seq>` filename suffix as other run-level artifacts (counter scoped to `worker-results/`).
105
+ - Worker prompt history files use role + suffix names such as `claude-worker-prompt-<task-type>-<seq>.md`.
106
+ - A single `runs/<task-type>/` directory is reused for every run of that task type; the per-run separation comes entirely from the per-category sequence-number infix inside each typed subdirectory.
107
+
108
+ ### Finding the Latest Run
109
+
110
+ 1. If a `latest-task` pointer exists, prioritize the path to the latest run, latest run manifest, or latest team-state recorded there.
111
+ 2. If entering via an explicit task key/path, locate the current run based on the latest run metadata in `task-manifest.json`.
112
+ 3. Only if necessary, directly check `manifests/`, `state/`, `prompts/`, `reports/`, and `sessions/` within the relevant run directory.
113
+
114
+ ## Step 4: Instruction Set Reading Order
115
+
116
+ After verifying `task-manifest.json`, read the instruction set in the following order:
117
+
118
+ 1. `instruction-set/analysis-profile.md` (analysis guide by task type)
119
+ 2. `instruction-set/analysis-material.md` (analysis materials, if available)
120
+ 3. `instruction-set/reference-expectations.md` (config/deployment expected values)
121
+ 4. `instruction-set/task-brief.md` (task brief)
122
+ 5. `instruction-set/final-report-template.md` (report template)
123
+
124
+ ## Step 5: Read Run Manifest and Team State
125
+
126
+ 1. Current run manifest: The latest run manifest pointed to by the discovery pointer or task-manifest
127
+ 2. Current team state: The latest team-state pointed to by the discovery pointer or task-manifest
128
+ 3. Extract the worker prompt directory path and per-worker prompt history paths from the current run manifest and team-state
129
+ 4. If an existing run report is available, use it solely as historical context.
130
+
131
+ ## Output
132
+
133
+ Information to be obtained after executing this skill:
134
+ - task key, task type, work category, workflow lifecycle snapshot, analysis profile
135
+ - List of selected workers and model assignments by role
136
+ - Absolute/relative paths of all artifacts (including latest-task pointer, task catalog, prompt directory, per-worker prompt history files, resume command, and timeline)
137
+ - Reference list of config files/deployment manifests and task-level expected values
138
+ - Current run status and presence of existing worker results
139
+ - Current run prompt history contract for attempted workers
140
+ - Resume command path: `runs/<task-type>/sessions/claude-resume-<task-type>-<seq>.sh`
@@ -0,0 +1,289 @@
1
+ ---
2
+ name: okstra-convergence
3
+ description: Use when okstra Phase 5.5 needs iterative cross-verification between workers, or when worker findings must be classified by consensus level before final synthesis.
4
+ user-invocable: false
5
+ ---
6
+
7
+ # OKSTRA Convergence
8
+
9
+ ## When to Use
10
+
11
+ - When the okstra skill Phase 5.5 (convergence loop) begins
12
+ - Immediately after all workers have completed Phases 4 and 5
13
+ - When findings need to be systematically classified by consensus level
14
+
15
+ ## Configuration
16
+
17
+ Configure this in the `convergence` block of `task-manifest.json`. If the block is missing, the default values are used.
18
+
19
+ | Setting | Default | Description |
20
+ |------|--------|------|
21
+ | `enabled` | `true` | If `false`, skip the convergence loop and use the existing consensus/divergence method |
22
+ | `maxRounds` | phase-aware: `1` for `requirements-discovery`, `2` otherwise (range 1–3) | Maximum number of re-verification rounds. Discovery's routing/missing-input outputs gain little from a second round; other phases (especially `error-analysis`) keep `2`. Lead resolves the effective value when the manifest omits the key and records it in `config.maxRounds` of the convergence state artifact. |
23
+ | `verificationMode` | `"lightweight"` | `"lightweight"` or `"full-reanalysis"` |
24
+
25
+ ## Finding Category
26
+
27
+ | Category | Definition | Included in Report |
28
+ |------|------|------------|
29
+ | `full-consensus` | All participating workers agree | Required |
30
+ | `partial-consensus` | Majority of workers agree; dissenting opinions are recorded | Required |
31
+ | `contested` | No consensus reached even after max rounds; each worker's position is recorded | Required |
32
+ | `worker-unique` | Only the discoverer confirms; others oppose or remain unverified | Required |
33
+
34
+ ## Convergence Algorithm
35
+
36
+ ### Round 0: Parse worker results
37
+
38
+ Read the worker result files generated in Phase 4/5 and extract individual findings.
39
+
40
+ 1. In the "Findings" section of each worker's results, identify individual items by number (F-001, F-002, ...).
41
+ 2. For each finding, record the summary, evidence (file path, line number, basis), and the worker who identified it.
42
+ 3. Claude Lead groups findings based on semantic similarity:
43
+ - When 2 or more workers report the same or similar findings → immediately reach `full consensus`
44
+ - Only one worker confirms → `unique`, enter the verification queue
45
+ 4. When grouping is ambiguous, prefer splitting over merging (avoid over-merging).
46
+
47
+ ### Round 1-N: Re-verification Loop
48
+
49
+ ```
50
+ FOR round = 1 to convergence.maxRounds:
51
+ IF the verification queue is empty:
52
+ BREAK (early convergence)
53
+
54
+ FOR each worker W (excluding the report writer):
55
+ List of findings W must verify = items in the verification queue for which W is not the discoverer
56
+ IF the list is empty:
57
+ SKIP
58
+ Send a re-verification request to W (batch: spawn once per worker)
59
+ Collect responses: AGREE / DISAGREE / SUPPLEMENT for each finding
60
+
61
+ FOR each finding F in the verification queue:
62
+ Vote aggregation:
63
+ - All AGREE or SUPPLEMENT → full consensus
64
+ - Majority AGREE or SUPPLEMENT → partial consensus
65
+ - All DISAGREE → worker-unique
66
+ - Mixed results → Carry over to next round (or marked as contested if this is the final round)
67
+
68
+ Update convergence state (record current round results)
69
+ ```
70
+
71
+ ### Convergence Test
72
+
73
+ - If the validation queue is empty → Convergence complete (`converged`)
74
+ - Upon reaching the maximum number of rounds → Apply final classification to remaining unresolved findings:
75
+ - Majority agreement → `partial-consensus`
76
+ - Otherwise → `contested`
77
+
78
+ ## Verification Mode
79
+
80
+ ### Lightweight (Default)
81
+
82
+ Decisions are made based solely on the findings and evidence presented by other reviewers. The original code or data is not reanalyzed.
83
+
84
+ Advantages: Fast and cost-effective
85
+ Disadvantages: Accuracy decreases if evidence is insufficient
86
+
87
+ ### Full Re-analysis (opt-in)
88
+
89
+ Use the findings as a guide, but reanalyze the original code/data yourself.
90
+
91
+ Advantages: High accuracy
92
+ Disadvantages: 2–3 times the cost, increased time
93
+
94
+ ## Re-verification Agent Dispatch
95
+
96
+ ### Sponsorship Optimization
97
+
98
+ Processing is performed by spawning each worker once per round. All findings to be verified by that worker are included in a single prompt.
99
+
100
+ ```text
101
+ Agent(
102
+ description: "Re-verify findings for <task-key> round <N>",
103
+ prompt: "<re-verification prompt with findings batch>",
104
+ name: "<role-slug>-reverify-r<N>",
105
+ subagent_type: "<same as initial execution>",
106
+ team_name: "okstra-<task-key>",
107
+ model: "<same as initial execution>",
108
+ mode: "auto"
109
+ )
110
+ ```
111
+
112
+ - Agent Teams mode: Spawn within an existing team
113
+ - Fallback mode: Spawn with `run_in_background: true` and no `team_name`
114
+
115
+ ### Required reverify-prompt anchor headers (BLOCKING)
116
+
117
+ Every reverify prompt MUST start with the same 5 anchor headers used in the initial Phase 4 dispatch — in this exact order, before any other content:
118
+
119
+ ```
120
+ **Project Root:** <absolute-path>
121
+ **Prompt History Path:** runs/<task-type>/prompts/<role-slug>-reverify-r<N>-<task-type>-<seq>.md
122
+ **Result Path:** runs/<task-type>/worker-results/<role-slug>-reverify-r<N>-<task-type>-<seq>.md
123
+ Assigned worker prompt history path: <Project Root>/<Prompt History Path>
124
+ **Model:** <role>, <modelExecutionValue>
125
+ ```
126
+
127
+ `<modelExecutionValue>` MUST be resolved from one of these canonical sources, in priority order:
128
+
129
+ 1. `task-manifest.json` → `resultContract.requiredWorkerRoles[].modelExecutionValue` for the receiving role
130
+ 2. `team-state-<task-type>-<seq>.json` → `workers[].usage.cliModel` for that role (initial run's actual execution value)
131
+ 3. The `**Model:**` line of the initial Phase 4 prompt for that role (read from its persisted prompt-history file)
132
+
133
+ If none of the three is available, **abort the reverify dispatch for that role** and record a `contract-violation` event via `okstra-error-log.py append-observed`. Do NOT guess, do NOT fall back to training-data defaults — for codex this would silently produce `o4-mini` instead of the assigned `gpt-5.5`-class model, which is a real bug class observed in production.
134
+
135
+ For Codex/Gemini wrapper subagents, the `**Model:** <role>, <modelExecutionValue>` line is what their wrapper extracts to pass into the underlying CLI's `--model` flag. Omitting it forces the wrapper to fall back to its own training-data knowledge of the CLI's historical default.
136
+
137
+ ### Reverify prompt: required-reading suppression (BLOCKING)
138
+
139
+ Reverify prompts MUST NOT inject the Phase 2 `[Required reading]` clause:
140
+
141
+ - **Lightweight mode**: the clause directly contradicts the "Do NOT re-analyze the original source materials" instruction below. Including it forces workers to re-read the entire instruction-set per round per worker (3 workers × 2 rounds × 5+ files in the worst case) for no quality gain.
142
+ - **Full-reanalysis mode**: workers DO need to re-read source materials, but only the analysis-worker file list (no `final-report-template.md`). If lead chooses to inject a reading clause here, it MUST mirror the audience-scoped enumeration in [okstra/SKILL.md](../../SKILL.md) Phase 2 (no template).
143
+
144
+ This is the single largest avoidable cost in `requirements-discovery` and `error-analysis` runs. Treat as BLOCKING.
145
+
146
+ ### Lightweight Re-verification Prompt
147
+
148
+ ```
149
+ You are <worker-role> performing re-verification for <task-key> (round <N>).
150
+
151
+ ## Instructions
152
+
153
+ Review the following findings discovered by other workers.
154
+ For EACH finding, respond with exactly one verdict:
155
+
156
+ - **AGREE**: The finding is valid based on the evidence presented
157
+ - **DISAGREE**: The finding is incorrect or unsupported (explain briefly why)
158
+ - **SUPPLEMENT**: The finding is valid AND you have additional supporting evidence or context
159
+
160
+ Do NOT re-analyze the original source materials. Judge based on the evidence provided.
161
+
162
+ ## Findings to verify
163
+
164
+ ### F-001: <one-line summary>
165
+ **Origin**: <worker role>
166
+ **Evidence**: <file paths, line numbers, reasoning from origin worker>
167
+
168
+ ### F-002: <one-line summary>
169
+ **Origin**: <worker role>
170
+ **Evidence**: <...>
171
+
172
+ ## Response format
173
+
174
+ For each finding, respond as:
175
+
176
+ ### F-001
177
+ **Verdict**: AGREE | DISAGREE | SUPPLEMENT
178
+ **Explanation**: <2-3 sentences>
179
+
180
+ ### F-002
181
+ **Verdict**: ...
182
+ ```
183
+
184
+ ### Full Re-analysis Re-verification Prompt
185
+
186
+ ```
187
+ You are <worker-role> performing deep re-verification for <task-key> (round <N>).
188
+
189
+ ## Instructions
190
+
191
+ Independently verify the following findings by examining the original materials.
192
+ Use each finding as a starting point, NOT as a confirmed conclusion.
193
+
194
+ ## Task bundle paths
195
+ - Instruction set: <instruction-set path>
196
+ - Task brief: <task-brief path>
197
+ - Analysis material: <analysis-material path>
198
+ - Reference expectations: <reference-expectations path>
199
+
200
+ ## Findings to verify
201
+
202
+ ### F-001: <one-line summary>
203
+ **Origin**: <worker role>
204
+ **Original evidence**: <file paths, line numbers>
205
+
206
+ ### F-002: <one-line summary>
207
+ **Origin**: <worker role>
208
+ **Original evidence**: <...>
209
+
210
+ ## Response format
211
+
212
+ For each finding:
213
+
214
+ ### F-001
215
+ **Verdict**: AGREE | DISAGREE | SUPPLEMENT
216
+ **Your evidence**: <your independent evidence trail with file paths and line numbers>
217
+ **Explanation**: <detailed analysis>
218
+ ```
219
+
220
+ ## Convergence State Artifact
221
+
222
+ Save it to `runs/<task-type>/state/convergence-<task-type>-<seq>.json`.
223
+
224
+ ```json
225
+ {
226
+ "schemaVersion": "1.0",
227
+ "taskKey": "<task-key>",
228
+ "config": {
229
+ "enabled": true,
230
+ "maxRounds": 2,
231
+ "verificationMode": "lightweight"
232
+ },
233
+ "findings": [
234
+ {
235
+ "findingId": "F-001",
236
+ "summary": "<one-line summary>",
237
+ "category": "<bug|risk|missing|observation|...>",
238
+ "originWorker": "<worker-id>",
239
+ "originEvidence": "<evidence text>",
240
+ "classification": "full-consensus",
241
+ "rounds": [
242
+ {
243
+ "round": 1,
244
+ "votes": {
245
+ "<worker-id>": {
246
+ "verdict": "agree",
247
+ "explanation": "<brief>"
248
+ }
249
+ }
250
+ }
251
+ ],
252
+ "consensusWorkers": ["worker-a", "worker-b", "worker-c"],
253
+ "dissentingWorkers": []
254
+ }
255
+ ],
256
+ "roundHistory": [
257
+ {
258
+ "round": 1,
259
+ "verificationsRequested": 4,
260
+ "verificationsCompleted": 4,
261
+ "newConsensus": 2,
262
+ "remainingInQueue": 1,
263
+ "earlyExit": false
264
+ }
265
+ ],
266
+ "finalState": "converged",
267
+ "totalRounds": 1,
268
+ "summary": {
269
+ "fullConsensus": 5,
270
+ "partialConsensus": 1,
271
+ "contested": 0,
272
+ "workerUnique": 1
273
+ }
274
+ }
275
+ ```
276
+
277
+ ## Output
278
+
279
+ Information to be passed to Phase 6 after executing this skill:
280
+
281
+ - Final classification of all findings (4-category)
282
+ - Round history and votes per worker for each finding
283
+ - Path to the convergence state artifact
284
+ - Convergence summary (count per category)
285
+ - Whether early convergence occurred and the total number of rounds
286
+
287
+ ## Convergence Disabled
288
+
289
+ If `convergence.enabled: false`, this skill is skipped. Phase 6 operates using the existing consensus/divergence method.
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: okstra-history
3
+ description: Use when the user asks to list past okstra runs, check execution history, review previous cross-verification results, or wants to re-run a past okstra task. Trigger words include "okstra history", "past runs", "run history", "re-run", "list tasks".
4
+ ---
5
+
6
+ # OKSTRA History
7
+
8
+ ## When to Use
9
+
10
+ - When a user views the history of past okstra executions
11
+ - When re-running or resuming a previous execution
12
+ - When checking the execution status of each task
13
+
14
+ ## Step 1: Read the Task Catalog
15
+
16
+ 1. Read `.project-docs/okstra/discovery/task-catalog.json`.
17
+ 2. Sort the `tasks` array in reverse order by `updatedAt` and display it.
18
+ 3. Extract the following fields from each task:
19
+
20
+ | Field | Description |
21
+ |------|------|
22
+ | `taskKey` | Task identifier (`<project-id>:<task-group>:<task-id>`) |
23
+ | `taskType` | Analysis type |
24
+ | `currentStatus` | Task-level status |
25
+ | `latestRunStatus` | Latest run status |
26
+ | `updatedAt` | Last update time |
27
+ | `latestReportPath` | Latest report path |
28
+ | `latestResumeCommandPath` | Resume command path |
29
+
30
+ 4. Output format:
31
+
32
+ ```markdown
33
+ ## okstra Task History — <project-id>
34
+
35
+ | # | Task Key | Type | Status | Last Run | Report |
36
+ |---|----------|------|--------|----------|--------|
37
+ | 1 | proj:group:id | error-analysis | completed | 2026-04-05 22:59 | .project-docs/.../final-report-*.md |
38
+ | 2 | proj:group:id2 | final-verification | prepared | 2026-04-04 15:30 | -- |
39
+ ```
40
+
41
+ 5. If `task-catalog.json` is missing, it responds with "There is no okstra execution history. Please run okstra.sh first."
42
+
43
+ ## Step 2: Run History by Task
44
+
45
+ When a user selects a specific task or requests detailed history:
46
+
47
+ 1. Retrieve the `historyTimelinePath` path for the task from the task catalog.
48
+ 2. Read the `runs` array from `timeline.json`.
49
+ 3. Fields to extract from each run:
50
+
51
+ | Field | Description |
52
+ |------|------|
53
+ | `runTimestamp` | Execution time (ISO 8601) |
54
+ | `runDateTimeSegment` | YYYY-MM-DD_HH-MM-SS |
55
+ | `taskType` | `--task-type` argument value |
56
+ | `status` | Run status |
57
+ | `reportPath` | Report Path |
58
+ | `resumeCommandPath` | resume Command path |
59
+ | `relatedTasks` | List of related tasks |
60
+
61
+ 4. Output format:
62
+
63
+ ```markdown
64
+ ## Runs for <task-key>
65
+
66
+ | # | Timestamp | Type | Status | Report |
67
+ |---|-----------|------|--------|--------|
68
+ | 1 | 2026-04-05 22:59 | error-analysis | completed | .../final-report-*.md |
69
+ | 2 | 2026-04-04 15:30 | error-analysis | error | -- |
70
+ ```
71
+
72
+ ## Step 3: Create a re-execution command
73
+
74
+ To re-run a specific run:
75
+
76
+ 1. Read the run-manifest JSON from the `runManifestPath` of that run.
77
+ 2. Extract the required arguments:
78
+ - `projectId` → `--project-id`
79
+ - `taskGroup` → `--task-group`
80
+ - `taskId` → `--task-id`
81
+ - `taskType` → `--task-type`
82
+ - `taskBriefPath` → `--task-brief`
83
+ 3. Extract the optional arguments:
84
+ - `recommendedWorkers` → `--workers` (comma-separated)
85
+ - `relatedTasks` → `--related-tasks` (if present)
86
+ - model overrides → `--claude-model`, `--codex-model`, `--gemini-model` (if different from default)
87
+ 4. Display the assembled command:
88
+
89
+ ```bash
90
+ okstra.sh \
91
+ --project-id <project-id> \
92
+ --task-group <task-group> \
93
+ --task-id <task-id> \
94
+ --task-type <task-type> \
95
+ --task-brief <brief-path> \
96
+ --workers <worker-list>
97
+ ```
98
+
99
+ 5. Once the user confirms, execute it using the Bash tool.
100
+
101
+ ## Step 4: Resume
102
+
103
+ To resume a paused session:
104
+
105
+ 1. Check `latestResumeCommandPath` in the task catalog or timeline.
106
+ 2. Verify that the resume script file actually exists.
107
+ 3. If it exists, display the execution command:
108
+ ```bash
109
+ bash <resume-command-path>
110
+ ```
111
+ 4. If it does not exist, display the message: "No resume script found. Please run it again."
112
+
113
+ ## Output Rules
114
+
115
+ - Display concisely in a table format
116
+ - Dates in `YYYY-MM-DD HH:MM` format
117
+ - Display status as-is (`completed`, `prepared`, `error`, `not-run`, etc.)
118
+ - Display `--` if no report is available
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: okstra-report-finder
3
+ description: Use when the user provides a task key and needs to find the final report path, or wants to read a previous okstra report to continue work based on its findings. Trigger words include "find report", "show report for", "read the okstra report", "continue from report".
4
+ ---
5
+
6
+ # OKSTRA Report Finder
7
+
8
+ ## When to Use
9
+
10
+ - 사용자가 task-key를 주고 해당 최종 보고서를 찾을 때
11
+ - 이전 okstra 보고서를 읽고 후속 작업을 진행할 때
12
+ - 보고서 내용을 기반으로 구현, 수정, 추가 검증을 시작할 때
13
+
14
+ ## Step 1: Task Key로 Report 경로 찾기
15
+
16
+ task-key 형식: `<project-id>:<task-group>:<task-id>`
17
+
18
+ ### 방법 A: task-catalog.json (빠름)
19
+
20
+ 1. `.project-docs/okstra/discovery/task-catalog.json`을 읽는다.
21
+ 2. `tasks` 배열에서 `taskKey`가 일치하는 항목을 찾는다.
22
+ 3. `latestReportPath` 필드가 최신 보고서 경로이다.
23
+
24
+ ### 방법 B: task-manifest.json (직접)
25
+
26
+ task-catalog가 없거나 최신이 아닌 경우:
27
+
28
+ 1. task-key에서 task-group과 task-id를 추출한다.
29
+ 2. `.project-docs/okstra/tasks/<task-group>/<task-id>/task-manifest.json`을 읽는다.
30
+ 3. `latestReportPath` 필드가 최신 보고서 경로이다.
31
+
32
+ ### 방법 C: timeline.json (특정 run의 보고서)
33
+
34
+ 특정 날짜나 run의 보고서가 필요한 경우:
35
+
36
+ 1. `.project-docs/okstra/tasks/<task-group>/<task-id>/history/timeline.json`을 읽는다.
37
+ 2. `runs` 배열에서 원하는 run을 찾는다 (날짜, 상태 등으로 필터).
38
+ 3. `reportPath` 필드가 해당 run의 보고서 경로이다.
39
+
40
+ ## Step 2: Report 존재 확인
41
+
42
+ 1. 찾은 경로에 파일이 실제로 존재하는지 확인한다.
43
+ 2. 존재하면 경로를 표시하고 읽을지 사용자에게 확인한다.
44
+ 3. 존재하지 않으면:
45
+ - `task-manifest.json`의 `currentStatus`를 확인한다.
46
+ - status가 `completed`가 아니면: "이 task는 아직 완료되지 않았습니다 (status: `<status>`)."
47
+ - 파일만 없으면: "보고서 파일이 존재하지 않습니다: `<path>`"
48
+
49
+ ## Step 3: Report 읽기 및 후속 작업 안내
50
+
51
+ 보고서를 읽은 후 사용자에게 가능한 후속 작업을 안내한다:
52
+
53
+ 1. **구현 진행**: 보고서의 "권장 다음 단계" 섹션 기반으로 코드 수정
54
+ 2. **추가 검증**: 같은 task-key로 새 okstra run 실행 (`okstra-history` 스킬로 재실행 커맨드 생성)
55
+ 3. **관련 task 확인**: 보고서의 관련 task 참조가 있으면 해당 task의 보고서도 조회
56
+
57
+ ## Output
58
+
59
+ ```markdown
60
+ ## Report for <task-key>
61
+
62
+ - Status: `<status>`
63
+ - Report path: `<relative-path>`
64
+ - Run date: `<YYYY-MM-DD HH:MM>`
65
+ - Task type: `<task-type>`
66
+ ```
67
+
68
+ 이후 사용자 요청에 따라 보고서를 읽고 후속 작업을 진행한다.