@clawplays/ospec-cli 1.0.2 → 1.1.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 (70) hide show
  1. package/README.md +44 -10
  2. package/SKILL.md +86 -1
  3. package/assets/for-ai/ar/ai-guide.md +27 -1
  4. package/assets/for-ai/ar/execution-protocol.md +42 -10
  5. package/assets/for-ai/en-US/ai-guide.md +28 -1
  6. package/assets/for-ai/en-US/execution-protocol.md +44 -10
  7. package/assets/for-ai/ja-JP/ai-guide.md +27 -1
  8. package/assets/for-ai/ja-JP/execution-protocol.md +42 -10
  9. package/assets/for-ai/zh-CN/ai-guide.md +28 -1
  10. package/assets/for-ai/zh-CN/execution-protocol.md +44 -10
  11. package/assets/global-skills/claude/ospec-change/SKILL.md +94 -6
  12. package/assets/global-skills/codex/ospec-change/SKILL.md +94 -6
  13. package/assets/project-conventions/ar/workflow-conventions.md +51 -8
  14. package/assets/project-conventions/en-US/workflow-conventions.md +54 -8
  15. package/assets/project-conventions/ja-JP/workflow-conventions.md +51 -8
  16. package/assets/project-conventions/zh-CN/workflow-conventions.md +54 -8
  17. package/dist/cli.js +49 -1
  18. package/dist/commands/ArchiveCommand.js +119 -0
  19. package/dist/commands/BrainstormCommand.d.ts +21 -0
  20. package/dist/commands/BrainstormCommand.js +276 -0
  21. package/dist/commands/ExecuteCommand.d.ts +97 -0
  22. package/dist/commands/ExecuteCommand.js +2155 -0
  23. package/dist/commands/InitCommand.js +9 -0
  24. package/dist/commands/NewCommand.js +70 -0
  25. package/dist/commands/PlanCommand.d.ts +23 -0
  26. package/dist/commands/PlanCommand.js +284 -0
  27. package/dist/commands/PluginsCommand.js +0 -1
  28. package/dist/commands/RunCommand.d.ts +1 -0
  29. package/dist/commands/RunCommand.js +27 -0
  30. package/dist/commands/SessionCommand.d.ts +38 -0
  31. package/dist/commands/SessionCommand.js +487 -0
  32. package/dist/commands/SkillCommand.js +151 -7
  33. package/dist/commands/UpdateCommand.d.ts +1 -0
  34. package/dist/commands/UpdateCommand.js +45 -5
  35. package/dist/commands/VerifyCommand.js +67 -1
  36. package/dist/commands/index.d.ts +4 -0
  37. package/dist/commands/index.js +9 -1
  38. package/dist/core/constants.d.ts +9 -0
  39. package/dist/core/constants.js +15 -0
  40. package/dist/core/types.d.ts +16 -0
  41. package/dist/presets/ProjectPresets.js +4 -4
  42. package/dist/services/PluginRegistryService.d.ts +0 -3
  43. package/dist/services/PluginRegistryService.js +0 -31
  44. package/dist/services/PostSyncMaintenanceService.d.ts +18 -0
  45. package/dist/services/PostSyncMaintenanceService.js +93 -0
  46. package/dist/services/ProjectAssetService.js +4 -1
  47. package/dist/services/ProjectService.d.ts +56 -0
  48. package/dist/services/ProjectService.js +968 -2
  49. package/dist/services/RunService.d.ts +6 -1
  50. package/dist/services/RunService.js +108 -12
  51. package/dist/services/TaskGraphExecutionService.d.ts +1128 -0
  52. package/dist/services/TaskGraphExecutionService.js +5940 -0
  53. package/dist/services/TemplateEngine.d.ts +6 -0
  54. package/dist/services/TemplateEngine.js +18 -0
  55. package/dist/services/TemplateGenerator.d.ts +25 -1
  56. package/dist/services/TemplateGenerator.js +298 -11
  57. package/dist/services/index.d.ts +3 -0
  58. package/dist/services/index.js +6 -1
  59. package/dist/services/templates/ExecutionTemplateBuilder.d.ts +6 -0
  60. package/dist/services/templates/ExecutionTemplateBuilder.js +878 -0
  61. package/dist/services/templates/ProjectTemplateBuilder.js +364 -16
  62. package/dist/tools/build-index.js +574 -0
  63. package/dist/utils/PathUtils.d.ts +1 -1
  64. package/dist/utils/PathUtils.js +14 -0
  65. package/dist/utils/subcommandHelp.d.ts +2 -0
  66. package/dist/utils/subcommandHelp.js +42 -2
  67. package/dist/workflow/ConfigurableWorkflow.d.ts +2 -2
  68. package/dist/workflow/ConfigurableWorkflow.js +17 -3
  69. package/package.json +1 -1
  70. package/scripts/postinstall.js +16 -0
package/README.md CHANGED
@@ -37,10 +37,10 @@ The official OSpec CLI package is `@clawplays/ospec-cli`, and the official comma
37
37
 
38
38
  AI coding assistants are powerful, but requirements that live only in chat history are hard to inspect, review, and close out cleanly. OSpec adds a lightweight workflow layer so the repository can hold the change context before code is written and after the work ships.
39
39
 
40
- - Align before code — keep proposal, tasks, state, verification, and review visible in the repo
40
+ - Align before code — keep proposal, design, implementation plan, tasks, state, verification, and review visible in the repo
41
41
  - Keep each requirement explicit — the default path moves one requirement through one active change
42
42
  - Stay lightweight — keep the normal flow short with `init -> change -> verify/finalize`
43
- - Use the assistants you already have — OSpec is built for Codex, Claude Code, and direct CLI workflows
43
+ - Use the assistants you already have — OSpec is built for Codex/GPT, Claude Code, Gemini, OpenCode, and direct CLI fallback workflows
44
44
 
45
45
  ## Install With npm
46
46
 
@@ -71,7 +71,7 @@ OSpec, initialize this project.
71
71
  Claude / Codex skill mode:
72
72
 
73
73
  ```text
74
- $ospec initialize this project.
74
+ /ospec initialize this project.
75
75
  ```
76
76
 
77
77
  <details>
@@ -114,7 +114,7 @@ OSpec, create and advance a change for this requirement.
114
114
  Claude / Codex skill mode:
115
115
 
116
116
  ```text
117
- $ospec-change create and advance a change for this requirement.
117
+ /ospec-change create and advance a change for this requirement.
118
118
  ```
119
119
 
120
120
  <details>
@@ -128,6 +128,25 @@ ospec new update-billing-copy .
128
128
 
129
129
  </details>
130
130
 
131
+ ### One-Change Agent Execution
132
+
133
+ The normal AI-assisted path still starts with one active change. OSpec keeps the controller state in repo artifacts, and the current AI harness starts native worker agents when available.
134
+
135
+ ```bash
136
+ ospec session .
137
+ ospec execute bootstrap changes/active/<change-name>
138
+ ospec execute workspace changes/active/<change-name>
139
+ ospec execute status changes/active/<change-name>
140
+ ospec execute dispatch changes/active/<change-name> --limit 2
141
+ ospec execute launch changes/active/<change-name> --task <task-id> --target codex
142
+ ospec execute complete <task-id> changes/active/<change-name> --status DONE --summary "..."
143
+ ospec execute review changes/active/<change-name> --task <task-id> --stage spec
144
+ ospec execute review changes/active/<change-name> --task <task-id> --stage quality
145
+ ospec execute verify changes/active/<change-name> --command "npm test" --status PASSED --exit-code 0
146
+ ```
147
+
148
+ `launch` writes `artifacts/agents/launch-plan.md`; it does not start workers by itself. Codex/GPT use `spawn_agent` / `wait_agent` / `close_agent`, Claude Code uses Task, Gemini uses `@generalist`, and OpenCode uses `@mention`. Use `launch --run --command` or `orchestrate --command` only when the current harness cannot start native subagents.
149
+
131
150
  ### 3. Archive After Acceptance
132
151
 
133
152
  After the requirement has passed deployment, testing, QA, or other acceptance checks, archive the validated change.
@@ -141,7 +160,7 @@ OSpec, archive this accepted change.
141
160
  Claude / Codex skill mode:
142
161
 
143
162
  ```text
144
- $ospec archive this accepted change.
163
+ /ospec archive this accepted change.
145
164
  ```
146
165
 
147
166
  <details>
@@ -203,7 +222,19 @@ If you want to convert an older classic project to the new layout, run `ospec la
203
222
  ┌─────────────────────────────────────────────────────────────────┐
204
223
  │ 3. EXECUTION │
205
224
  │ ospec new <change-name> │
225
+ │ ospec brainstorm / plan (optional pre-change aids) │
226
+ │ ospec session │
227
+ │ ospec session hook │
206
228
  │ ospec progress │
229
+ │ ospec execute bootstrap / handoff / doc-review / status │
230
+ │ ospec execute next │
231
+ │ ospec execute workspace / worktree / worktree --create │
232
+ │ ospec execute worktree --cleanup / finish │
233
+ │ ospec execute dispatch / launch / collect / retry / review │
234
+ │ ospec execute debug │
235
+ │ ospec execute tdd │
236
+ │ ospec execute verify │
237
+ │ ospec execute sync │
207
238
  └─────────────────────────────────────────────────────────────────┘
208
239
 
209
240
 
@@ -227,7 +258,7 @@ If you want to convert an older classic project to the new layout, run `ospec la
227
258
  |---------|---------------|
228
259
  | **Protocol Shell** | The minimum collaboration skeleton: root `.skillrc` and `README.md`, plus managed OSpec files under `.ospec/` for change state, SKILL docs, index state, `for-ai/` guidance, and project docs. |
229
260
  | **Project Knowledge Layer** | Explicit project context such as `docs/project/*`, layered skill files, and index state that AI can read consistently. |
230
- | **Active Change** | A dedicated execution container for one requirement, usually with `proposal.md`, `tasks.md`, `state.json`, `verification.md`, and `review.md`. |
261
+ | **Active Change** | A dedicated execution container for one requirement, usually with `proposal.md`, `design.md`, `implementation-plan.md`, `artifacts/agents/task-graph.json`, `tasks.md`, handoff artifacts, document-review artifacts, launch-plan artifacts, worker-run artifacts, reviewer-run artifacts, retry artifacts, review artifacts, `artifacts/agents/worker-status.md`, `state.json`, `verification.md`, and `review.md`. |
231
262
 
232
263
  ## Features
233
264
 
@@ -235,7 +266,10 @@ If you want to convert an older classic project to the new layout, run `ospec la
235
266
  - **Guided initialization**: AI-assisted init can ask once for missing summary or tech stack; direct CLI init falls back to placeholder docs when context is missing.
236
267
  - **Stable project language**: the chosen document language is stored in `.skillrc` so later guidance and generated change docs stay consistent unless you explicitly change it.
237
268
  - **Docs maintenance**: `ospec docs generate` refreshes or repairs project knowledge docs when you need it later.
238
- - **Tracked requirement execution**: each change can keep proposal, tasks, state, verification, and review files aligned.
269
+ - **Tracked requirement execution**: each change can keep proposal, design, implementation plan, task graph, tasks, handoff artifacts, document-review artifacts, launch-plan artifacts, worker-run artifacts, reviewer-run artifacts, retry artifacts, worker status, state, verification, and review files aligned.
270
+ - **Optional pre-change aids**: `ospec brainstorm` writes durable exploration artifacts under `.ospec/brainstorms/`, with an optional static visual companion; `ospec plan` writes plan drafts under `.ospec/plans/` and only updates `implementation-plan.md` when `--apply` is passed. The default one-change flow still starts with `ospec new`.
271
+ - **Session brief**: `ospec session` writes `.ospec/session-brief.json` and `.ospec/session-brief.md` so agents or humans entering an existing project can see active changes, queued changes, queue-run state, a cache fingerprint, and the next safe command before touching a change; `ospec session hook` writes opt-in harness startup hook artifacts under `.ospec/hooks/`.
272
+ - **Task graph controller**: `ospec execute bootstrap` writes a one-change startup/resume snapshot with the project session brief snapshot and next safe action; `handoff` writes a cross-tool worker handoff guide with the project session brief snapshot; `doc-review` creates design and implementation-plan reviewer packets before task execution; `status` and `next` report controller state and safe next task candidates; `workspace` records git workspace safety before worker handoff; `worktree` records an isolated-worktree preparation plan by default, while explicit `--create` or `--cleanup` runs the matching git worktree command and captures `artifacts/agents/worktree-runs/`; `finish` records closeout readiness before finalize, archive, push, merge, or worktree cleanup; `dispatch` and `complete` create parallel-safe worker packets with worker profiles and target tool mapping, then record task results as OSpec artifacts; `review --task` creates per-task spec and quality review packets that block dependent tasks until approved, while final `review` creates whole-change reviewer packets; `launch` writes the native agent launch plan for the current AI harness, including Codex/GPT `spawn_agent`, Claude Code Task, Gemini `@generalist`, and OpenCode `@mention` guidance; `orchestrate` is the final CLI fallback for harnesses without native subagents and runs explicit command templates only; `launch --run --command` is the single-worker CLI fallback; `collect` turns a fallback worker run into task completion state; `retry` reopens blocked, needs-context, or failed task work; explicit review `--run --command` captures `artifacts/agents/review-runs/`; `debug`, `tdd`, and `verify` record durable evidence; `sync` rebuilds `worker-status.md` from execution and review artifacts.
239
273
  - **Queue helpers**: `queue` and `run` support explicit multi-change execution when one active change is not enough.
240
274
  - **Plugin workflow gates**: plugin commands support Stitch design review and Checkpoint automation through npm-installed official plugins.
241
275
  - **Skill management**: install and inspect OSpec skills for Codex and Claude Code.
@@ -247,11 +281,11 @@ OSpec supports plugins for UI review and runtime validation.
247
281
  Keep the public flow simple:
248
282
 
249
283
  ```text
250
- $ospec open Stitch for this project.
251
- $ospec open Checkpoint for this project.
284
+ /ospec open Stitch for this project.
285
+ /ospec open Checkpoint for this project.
252
286
  ```
253
287
 
254
- In AI / `$ospec` flows, requests like "open Stitch" or "open Checkpoint" should be handled as: check whether the plugin is already installed globally, install only when missing, then enable it in the current project.
288
+ In AI / `/ospec` flows, requests like "open Stitch" or "open Checkpoint" should be handled as: check whether the plugin is already installed globally, install only when missing, then enable it in the current project.
255
289
 
256
290
  Command line fallback:
257
291
 
package/SKILL.md CHANGED
@@ -163,11 +163,35 @@ This CLI now covers:
163
163
  Treat these as the source of truth for active delivery work:
164
164
 
165
165
  - `.skillrc`
166
+ - `.ospec/session-brief.md`
166
167
  - `docs/project/overview.md`
167
168
  - `docs/project/tech-stack.md`
168
169
  - `docs/project/architecture.md`
169
170
  - `changes/active/<change>/proposal.md`
171
+ - `changes/active/<change>/design.md`
172
+ - `changes/active/<change>/implementation-plan.md`
173
+ - `changes/active/<change>/artifacts/agents/task-graph.json`
174
+ - `changes/active/<change>/artifacts/agents/bootstrap.md`
175
+ - `changes/active/<change>/artifacts/agents/handoff.md`
176
+ - `changes/active/<change>/artifacts/agents/document-review-dispatches/`
177
+ - `changes/active/<change>/artifacts/agents/workspace-status.md`
178
+ - `changes/active/<change>/artifacts/agents/worktree-plan.md`
179
+ - `changes/active/<change>/artifacts/agents/finish-plan.md`
180
+ - `changes/active/<change>/artifacts/agents/launch-plan.md`
181
+ - `changes/active/<change>/artifacts/agents/worker-runs/`
182
+ - `changes/active/<change>/artifacts/agents/review-runs/`
183
+ - `changes/active/<change>/artifacts/agents/retries/`
184
+ - `changes/active/<change>/artifacts/agents/blockers/`
185
+ - `changes/active/<change>/artifacts/agents/review-feedback-plan.md`
170
186
  - `changes/active/<change>/tasks.md`
187
+ - `changes/active/<change>/artifacts/reviews/design-review.md`
188
+ - `changes/active/<change>/artifacts/reviews/implementation-plan-review.md`
189
+ - `changes/active/<change>/artifacts/reviews/spec-compliance.md`
190
+ - `changes/active/<change>/artifacts/reviews/code-quality.md`
191
+ - `changes/active/<change>/artifacts/agents/worker-status.md`
192
+ - `changes/active/<change>/artifacts/agents/debug-evidence.json`
193
+ - `changes/active/<change>/artifacts/agents/tdd-evidence.json`
194
+ - `changes/active/<change>/artifacts/agents/verification-evidence.json`
171
195
  - `changes/active/<change>/state.json`
172
196
  - `changes/active/<change>/verification.md`
173
197
 
@@ -176,6 +200,38 @@ Treat these as the source of truth for active delivery work:
176
200
  Before advancing an active change:
177
201
 
178
202
  - read `.skillrc.plugins` to detect enabled blocking plugins
203
+ - use `ospec session [path]` when entering an existing OSpec project to write `.ospec/session-brief.json` and `.ospec/session-brief.md`; it records active changes, queued changes, queue run state, safe next commands, and a cache fingerprint for session re-entry, and does not launch workers, run tests, inspect git, archive, or edit source files
204
+ - use `ospec session hook [path]` only to write opt-in harness startup hook artifacts under `.ospec/hooks/`; it refreshes session context only and must not launch workers, run tests, inspect git, archive, or edit source files
205
+ - use `ospec brainstorm [path] --topic "..." [--visual]` only for optional pre-change exploration artifacts under `.ospec/brainstorms/`; it does not create a change
206
+ - use `ospec plan [path] --change changes/active/<change> [--apply]` only for optional plan drafts under `.ospec/plans/`; `--apply` is required to update `implementation-plan.md`
207
+ - treat activated built-in quality policy steps such as `tdd_cycle`, `root_cause_debug`, and `verification_evidence` as archive-gated `optional_steps`; cover them in `tasks.md`, `verification.md`, and the matching evidence artifacts before closeout
208
+ - keep `changes/active/<change>/artifacts/agents/task-graph.json` aligned with `implementation-plan.md` and `tasks.md`
209
+ - do not archive while `artifacts/agents/task-graph.json` has unresolved task statuses, invalid dependencies, missing target files, or missing verification commands
210
+ - use `ospec execute bootstrap [changes/active/<change>]` when starting or resuming a single active change to write `artifacts/agents/bootstrap.json` and `artifacts/agents/bootstrap.md`; it summarizes current stage, project session brief snapshot, and next safe action, including `ospec execute launch ... --task ...` when an active dispatch is waiting, without launching workers, syncing worker status, running tests, inspecting git, or editing source files
211
+ - use `ospec execute handoff [changes/active/<change>] [--target codex|gpt|claude|gemini|opencode|shell|generic]` when moving a change between agents, tools, worktrees, shells, or human operators; it writes `artifacts/agents/handoff.json` and `artifacts/agents/handoff.md` with the project session brief snapshot, target tool mapping, and safety rules, but does not launch workers, sync worker status, run tests, inspect git, or edit source files
212
+ - use `ospec execute doc-review [changes/active/<change>] [--stage design|plan]` before deriving or dispatching implementation tasks to create document reviewer packets with the project session brief snapshot under `artifacts/agents/document-review-dispatches/`; design review must be approved before implementation plan review, and the command does not launch reviewers, run shell commands, sync worker status, or edit source files
213
+ - use `ospec execute workspace [changes/active/<change>]` before worker handoff to record git workspace safety; if status is `needs_isolation`, defer parallel dispatch until the workspace is clean or moved into an isolated git worktree
214
+ - use `ospec execute worktree [changes/active/<change>] [--branch name] [--path path] [--base ref]` to write an isolated worktree preparation plan without running git
215
+ - use `ospec execute worktree [changes/active/<change>] --create [--branch name] [--path path] [--base ref]` only when explicitly asked to run `git worktree add`; it records stdout/stderr/status under `artifacts/agents/worktree-runs/`
216
+ - use `ospec execute worktree [changes/active/<change>] --cleanup [--path path]` only when explicitly asked to run `git worktree remove`; it does not delete branches, push, merge, archive, run tests, or edit project source files
217
+ - use `ospec execute finish [changes/active/<change>] [--target main] [--remote origin]` to write an artifact-only closeout readiness plan before finalize, archive, push, PR, merge, or worktree cleanup; review blockers and commands manually
218
+ - use `ospec execute dispatch [changes/active/<change>] [--task task-id] [--limit N]` to create a parallel-safe worker packet batch and `artifacts/agents/execution-session.json`; each packet includes the project session brief snapshot and a worker profile with capability tier, recommended target, target tool mapping, rationale, and required behavior; use `--task` for one explicit task, use `--limit` to cap dispatch batch size, and use `ospec execute complete <task-id> ...` to record worker results; a terminal worker result opens task-level review gates, so run `ospec execute review [changes/active/<change>] --task <task-id> --stage spec`, then `--stage quality`, before dispatching dependent work
219
+ - use `ospec execute launch [changes/active/<change>] [--task task-id] [--target codex|gpt|claude|gemini|opencode|shell|generic] [--dry-run]` after dispatch to write `artifacts/agents/launch-plan.json` and `artifacts/agents/launch-plan.md`; this is the native agent launch artifact and tells the controlling AI how to use the current harness native agent mechanism (`spawn_agent`/`wait_agent`/`close_agent` for Codex/GPT, Task for Claude Code, `@generalist` for Gemini, and `@mention` for OpenCode). It requires an active dispatch and ready workspace status, and does not start workers, run shell commands, or edit source files by itself
220
+ - default to current-harness native subagents for multi-worker execution: create parallel-safe packets with `ospec execute dispatch`, inspect `launch-plan.md`, then dispatch one native agent per safe packet in the current AI session; only use `ospec execute orchestrate [changes/active/<change>] --command "..." [--target codex|gpt|claude|gemini|opencode|shell|generic] [--limit N] [--max-rounds N] [--timeout-ms N]` as the final CLI fallback when the current AI harness cannot dispatch native subagents. The fallback reads or creates parallel-safe dispatches, renders the explicit command template, runs worker commands concurrently, records `artifacts/agents/orchestration-runs/`, captures worker runs, and collects results into the task graph unless `--no-collect` is passed
221
+ - use `--run --command` with `ospec execute launch [changes/active/<change>] [--task task-id] [--target codex|gpt|claude|gemini|opencode|shell|generic] --run --command "..." [--timeout-ms N]` only as single-worker CLI fallback when native subagents are unavailable or explicitly bypassed; it captures stdout, stderr, exit code, timeout metadata, and run metadata under `artifacts/agents/worker-runs/`, then `ospec execute collect [changes/active/<change>] [--task task-id] [--run run-id]` records the task result
222
+ - use `ospec execute retry [changes/active/<change>] --task task-id [--run run-id] [--force]` after a blocked, needs-context, or failed run has been corrected; it writes `artifacts/agents/retries/`, reopens the task, and creates a fresh dispatch packet. Completed tasks require explicit `--force`
223
+ - keep `dispatch`, `launch`, `orchestrate`, `collect`, `retry`, and `complete` artifact-controlled: native subagent dispatch is performed by the current AI harness, while shell commands run only for explicit fallback `launch --run --command` or `orchestrate` with a command template; none of these commands edits project source files directly; when `complete` or `collect` records `NEEDS_CONTEXT` or `BLOCKED`, OSpec writes blocker escalation under `artifacts/agents/blockers/`
224
+ - complete `changes/active/<change>/artifacts/reviews/spec-compliance.md` before `changes/active/<change>/artifacts/reviews/code-quality.md`
225
+ - use `ospec execute review [changes/active/<change>] [--task task-id] [--stage spec|quality]` to create durable task-level or final reviewer handoff packets with the project session brief snapshot; with `--task`, review one completed task and write `artifacts/reviews/tasks/<task-id>/...`; without `--task`, run the final whole-change review after the task graph is completed; do not dispatch quality review before the matching spec review is approved
226
+ - use `ospec execute review [changes/active/<change>] [--task task-id] [--stage spec|quality] --run --command "..."` only when explicitly asked to run a local reviewer command; it captures review stdout/stderr under `artifacts/agents/review-runs/` and can update the matching task-level or final review artifact when `--decision` is provided
227
+ - use `ospec execute feedback [changes/active/<change>] [--stage spec|quality]` after a review artifact has a non-`PENDING` decision to write `artifacts/agents/review-feedback-plan.json` and `artifacts/agents/review-feedback-plan.md`; this records how to accept, revise, clarify, or unblock review feedback and does not edit source files or launch workers
228
+ - do not archive while any task-level review or final review decision is `PENDING`, `NEEDS_CHANGES`, or `BLOCKED`
229
+ - update `changes/active/<change>/artifacts/agents/worker-status.md` during implementation and review
230
+ - use `ospec execute debug [changes/active/<change>] --symptom "..." --root-cause "..." --status FIXED` when debugging was part of the change to record systematic debugging evidence; this command records evidence only and does not run shell commands
231
+ - use `ospec execute tdd [changes/active/<change>] --phase red|green|refactor --command "..." --status ...` after focused test runs to record TDD cycle evidence; this command records evidence only and does not run shell commands
232
+ - use `ospec execute verify [changes/active/<change>] --command "..." --status PASSED` after running fresh project checks to record verification evidence; this command records evidence only and does not run shell commands
233
+ - use `ospec execute sync [changes/active/<change>]` after manual task graph, execution-session, review artifact, or verification checklist edits to rebuild worker status
234
+ - do not claim completion while worker status is `PENDING`, `NEEDS_CONTEXT`, or `BLOCKED`; `controller_status` must be `DONE` before archive
179
235
  - if the current change activates `stitch_design_review`, inspect `changes/active/<change>/artifacts/stitch/approval.json`
180
236
  - when Stitch approval is missing or `status != approved`, treat the change as blocked and do not claim it is ready to continue or archive
181
237
 
@@ -185,10 +241,14 @@ Do not fall back to the old `features/...` layout unless the target repository r
185
241
 
186
242
  ```bash
187
243
  ospec status [path]
244
+ ospec session [path]
245
+ ospec session hook [path]
188
246
  ospec init [path]
189
247
  ospec init [path] --document-language zh-CN
190
248
  ospec init [path] --summary "..." --tech-stack node,react
191
249
  ospec docs generate [path]
250
+ ospec brainstorm [path] --topic "..." [--change name] [--output id] [--visual]
251
+ ospec plan [path] [--change changes/active/<change>] [--from-brainstorm file] [--output id] [--apply]
192
252
  ospec new <change-name> [path]
193
253
  ospec docs status [path]
194
254
  ospec skills status [path]
@@ -201,6 +261,31 @@ ospec run status [path]
201
261
  ospec run step [path]
202
262
  ospec run resume [path]
203
263
  ospec run stop [path]
264
+ ospec execute status [changes/active/<change>]
265
+ ospec execute bootstrap [changes/active/<change>]
266
+ ospec execute handoff [changes/active/<change>] [--target codex|gpt|claude|gemini|opencode|shell|generic]
267
+ ospec execute doc-review [changes/active/<change>] [--stage design|plan]
268
+ ospec execute next [changes/active/<change>]
269
+ ospec execute workspace [changes/active/<change>]
270
+ ospec execute worktree [changes/active/<change>] [--branch name] [--path path] [--base ref]
271
+ ospec execute worktree [changes/active/<change>] --create [--branch name] [--path path] [--base ref]
272
+ ospec execute worktree [changes/active/<change>] --cleanup [--path path]
273
+ ospec execute finish [changes/active/<change>] [--target main] [--remote origin]
274
+ ospec execute dispatch [changes/active/<change>] [--task task-id] [--limit N]
275
+ ospec execute launch [changes/active/<change>] [--task task-id] [--target codex|gpt|claude|gemini|opencode|shell|generic] [--dry-run]
276
+ ospec execute orchestrate [changes/active/<change>] --command "..." [--target codex|gpt|claude|gemini|opencode|shell|generic] [--limit N] [--max-rounds N] [--timeout-ms N] # fallback only
277
+ ospec execute launch [changes/active/<change>] [--task task-id] [--target codex|gpt|claude|gemini|opencode|shell|generic] --run --command "..." [--timeout-ms N] # fallback only
278
+ ospec execute collect [changes/active/<change>] [--task task-id] [--run run-id] [--status DONE|DONE_WITH_CONCERNS|NEEDS_CONTEXT|BLOCKED] [--summary "..."]
279
+ ospec execute retry [changes/active/<change>] --task task-id [--run run-id] [--summary "..."] [--force]
280
+ ospec execute complete <task-id> [changes/active/<change>] --status DONE --summary "..."
281
+ ospec execute review [changes/active/<change>] [--task task-id] [--stage spec|quality]
282
+ ospec execute review [changes/active/<change>] [--task task-id] [--stage spec|quality] --run --command "..." [--timeout-ms N] [--decision APPROVED|APPROVED_WITH_CONCERNS|NEEDS_CHANGES|BLOCKED|PENDING] [--summary "..."]
283
+ ospec execute feedback [changes/active/<change>] [--stage spec|quality] [--summary "..."]
284
+ ospec execute debug [changes/active/<change>] --symptom "..." --root-cause "..." --status FIXED --command "npm test -- focused" --summary "..."
285
+ ospec execute tdd [changes/active/<change>] --phase red --command "npm test -- focused" --status FAILED --exit-code 1 --summary "..."
286
+ ospec execute tdd [changes/active/<change>] --phase green --command "npm test -- focused" --status PASSED --exit-code 0 --summary "..."
287
+ ospec execute verify [changes/active/<change>] --command "npm test" --status PASSED --exit-code 0 --summary "..."
288
+ ospec execute sync [changes/active/<change>]
204
289
  ospec plugins available
205
290
  ospec plugins info <plugin>
206
291
  ospec plugins install <plugin>
@@ -249,7 +334,7 @@ ospec finalize [changes/active/<change>]
249
334
 
250
335
  Use `ospec docs generate [path]` later when you need a docs-only maintenance pass.
251
336
 
252
- Use `ospec status [path]` separately when you want an explicit troubleshooting snapshot.
337
+ Use `ospec session [path]` when entering an existing OSpec project and you need a durable project-level brief with active change, queued change, queue-run, safe next command context, and a cache fingerprint. Use `ospec session hook [path]` only to write opt-in startup hook artifacts for a harness. Use `ospec status [path]` separately when you want an explicit troubleshooting snapshot.
253
338
 
254
339
  For completed changes, archive before commit. Use `ospec archive [changes/active/<change>]` to execute the archive and `--check` only when you want a readiness preview without moving files.
255
340
 
@@ -22,10 +22,36 @@ tags: [ai, guide, ospec]
22
22
 
23
23
  ## السلوك المطلوب
24
24
 
25
- - حافظ على `proposal.md` و`tasks.md` و`verification.md` و`review.md` باللغة المعتمدة للمشروع
25
+ - حافظ على `proposal.md` و`design.md` و`implementation-plan.md` و`artifacts/agents/task-graph.json` و`artifacts/agents/bootstrap.md` و`artifacts/agents/handoff.md` و`artifacts/agents/document-review-dispatches/` و`artifacts/agents/workspace-status.md` و`artifacts/agents/worktree-plan.md` و`artifacts/agents/finish-plan.md` و`artifacts/agents/launch-plan.md` و`artifacts/agents/worker-runs/` و`artifacts/agents/review-runs/` و`artifacts/agents/retries/` و`artifacts/agents/blockers/` و`artifacts/agents/review-feedback-plan.md` و`tasks.md` و`artifacts/reviews/design-review.md` و`artifacts/reviews/implementation-plan-review.md` و`artifacts/reviews/spec-compliance.md` و`artifacts/reviews/code-quality.md` و`artifacts/agents/worker-status.md` و`artifacts/agents/debug-evidence.json` و`artifacts/agents/tdd-evidence.json` و`artifacts/agents/verification-evidence.json` و`verification.md` و`review.md` باللغة المعتمدة للمشروع
26
26
  - لا تستنتج لغة وثائق change من لغة واجهة المنتج أو locale الموقع أو من متطلب "الإنجليزية أولاً" فقط
27
27
  - إذا كان البروتوكول المعتمد للمشروع بالصينية أو كانت وثائق change الحالية بالصينية بالفعل، فاستمر بالصينية ما لم تغيّر قواعد المشروع ذلك صراحةً
28
28
  - استخدم الفهرس لتحديد موقع المعرفة قبل قراءة الملفات الهدف
29
+ - عند الدخول إلى مشروع OSpec موجود، شغّل `ospec session [path]` لكتابة `.ospec/session-brief.json` و`.ospec/session-brief.md` مع active change وqueued change وqueue run وcache fingerprint والأمر الآمن التالي؛ هذا project entry brief لا يستبدل `ospec execute bootstrap` للـ active change
30
+ - تعامل مع خطوات built-in quality policy المفعّلة مثل `tdd_cycle` و`root_cause_debug` و`verification_evidence` كـ `optional_steps` خاضعة لـ archive gate؛ غطّها في `tasks.md` و`verification.md` وملفات evidence المطابقة قبل closeout
31
+ - عند تنفيذ change بمساعدة AI، لا تطلب من المستخدم كتابة `design.md` أو `implementation-plan.md` يدوياً؛ أنشئهما أو حدّثهما من المتطلب و`proposal.md` وسياق المشروع قبل اشتقاق `artifacts/agents/task-graph.json` أو تعديل `tasks.md` أو الكود
32
+ - لا تطرح أكثر من سؤال تصميم موجز واحد إلا عندما يغيّر القرار الناقص البنية أو API أو البيانات أو UI أو المخاطر فعلياً؛ وإلا فسجل الافتراضات في `design.md`
33
+ - يجب أن يُشتق `implementation-plan.md` من `design.md`، وأن يُشتق `artifacts/agents/task-graph.json` من `implementation-plan.md`، وأن تُشتق `tasks.md` من task graph، وتُوائم المهام الموجودة بعد تحديث الوثائق السابقة
34
+ - عند بدء أو استئناف active change واحد، استخدم `ospec execute bootstrap [changes/active/<change>]` لكتابة `artifacts/agents/bootstrap.json` و`artifacts/agents/bootstrap.md` مع project session brief snapshot، ثم اتبع الإجراء الآمن التالي المسجل فيه؛ عند وجود active dispatch، يوصي bootstrap بأمر `ospec execute launch ... --task ...` المطابق
35
+ - عند نقل change بين agents أو tools أو worktrees أو shells أو operators بشريين، استخدم `ospec execute handoff [changes/active/<change>] [--target codex|gpt|claude|gemini|opencode|shell|generic]` لكتابة `artifacts/agents/handoff.json` و`artifacts/agents/handoff.md`؛ يسجل هذا الأمر project session brief snapshot وtool mapping وقواعد السلامة فقط ولا يشغّل workers أو يعدّل source files
36
+ - قبل اشتقاق implementation tasks أو dispatch لها، استخدم `ospec execute doc-review [changes/active/<change>] [--stage design|plan]` لإنشاء document reviewer packets تتضمن project session brief snapshot تحت `artifacts/agents/document-review-dispatches/` وتجهيز `artifacts/reviews/design-review.md` أو `artifacts/reviews/implementation-plan-review.md`؛ يجب اعتماد design review قبل dispatch لمراجعة implementation plan
37
+ - عندما تحتاج إلى عرض controller للمهام ready وblocked وrunning وcompleted والمرشحات التالية الآمنة، استخدم `ospec execute status [changes/active/<change>]` أو `ospec execute next [changes/active/<change>]`
38
+ - قبل handoff إلى worker استخدم `ospec execute workspace [changes/active/<change>]` لتسجيل سلامة git workspace؛ إذا كانت الحالة `needs_isolation`، نظّف workspace أو انقل العمل إلى git worktree معزول قبل parallel dispatch
39
+ - قبل إنشاء git worktree معزول، استخدم `ospec execute worktree [changes/active/<change>] [--branch name] [--path path] [--base ref]` لكتابة `artifacts/agents/worktree-plan.json` و`artifacts/agents/worktree-plan.md`؛ هذا الأمر يسجل خطة تحضير فقط ولا يشغّل `git worktree add`
40
+ - قبل الإغلاق النهائي، استخدم `ospec execute finish [changes/active/<change>] [--target main] [--remote origin]` لكتابة `artifacts/agents/finish-plan.json` و`artifacts/agents/finish-plan.md`؛ هذا الأمر يسجل الجاهزية ونص الأوامر فقط ولا يشغل finalize أو archive أو push أو merge أو حذف worktree
41
+ - عندما تحتاج إلى handoff artifacts دائمة على مستوى task، استخدم `ospec execute dispatch` لإنشاء batch آمن للتوازي من worker packets و`ospec execute complete` لتسجيل نتائج worker؛ يتضمن كل dispatch packet project session brief snapshot وworker profile يوضح capability tier وrecommended target وtarget tool mapping وrationale وrequired behavior؛ عندما تكون النتيجة `NEEDS_CONTEXT` أو `BLOCKED` يكتب `complete` ملفات `artifacts/agents/blockers/`؛ استخدم `--task` لمهمة واحدة صريحة و`--limit` لتحديد حجم dispatch batch؛ بعد اكتمال كل worker task استخدم `ospec execute review [changes/active/<change>] --task <task-id> --stage spec` ثم `--stage quality` لإجراء task-level review، وتبقى المهام التابعة محجوبة حتى اعتماد المراجعتين؛ وبعد اعتماد كل task-level reviews واكتمال task graph استخدم `ospec execute review` من دون `--task` لإنشاء final spec أو quality reviewer handoff packets؛ وبعد decision غير `PENDING` استخدم `ospec execute feedback` لكتابة `artifacts/agents/review-feedback-plan.md`؛ وبعد تعديل execution أو review artifacts يدويا استخدم `ospec execute sync` لإعادة بناء `worker-status.md`
42
+ - بعد dispatch، استخدم `ospec execute launch [changes/active/<change>] [--task task-id] [--target codex|gpt|claude|gemini|opencode|shell|generic] [--dry-run]` لكتابة native agent launch plan؛ يوجه controlling AI إلى آلية agent الأصلية في harness الحالي: Codex/GPT يستخدم `spawn_agent`/`wait_agent`/`close_agent`، وClaude Code يستخدم Task، وGemini يستخدم `@generalist`، وOpenCode يستخدم `@mention`. هذا الأمر لا يشغّل workers ولا أوامر shell بنفسه
43
+ - default multi-worker execution هو current-harness native subagents: أنشئ safe packets عبر `ospec execute dispatch`، اقرأ `launch-plan.md`، ثم dispatch native worker agent لكل packet آمن، وسجل النتيجة عبر `ospec execute complete`
44
+ - استخدم `ospec execute orchestrate [changes/active/<change>] --command "..."` فقط كـ final CLI fallback عندما لا يدعم harness الحالي native subagents؛ fallback mode يرندر explicit command template ويشغّل worker commands بالتوازي ويسجل `artifacts/agents/orchestration-runs/`
45
+ - استخدم `--run --command` مع `ospec execute launch ... --run --command "..."` فقط كـ single-worker CLI fallback عندما لا تتوفر native subagents أو يتم تجاوزها صراحة؛ ثم استخدم `ospec execute collect ...` لتسجيل fallback task result. بعد إصلاح blocked أو needs-context أو failed work استخدم `ospec execute retry` لإعادة dispatch
46
+ - لا يشغّل OSpec local reviewer command إلا عند استخدام `ospec execute review ... --run --command "..."` صراحة؛ يسجل ذلك `artifacts/agents/review-runs/` ويمكنه كتابة review decision عند تمرير `--decision`
47
+ - عندما يكون debugging جزءا من change، استخدم `ospec execute debug [changes/active/<change>] --symptom "..." --root-cause "..." --status FIXED` لتسجيل root-cause وfix evidence؛ هذا الأمر يسجل evidence فقط ولا يشغّل أوامر shell
48
+ - بعد تشغيل focused tests، استخدم `ospec execute tdd [changes/active/<change>] --phase red|green|refactor --command "..." --status ...` لتسجيل TDD cycle evidence؛ هذا الأمر يسجل evidence فقط ولا يشغّل أوامر shell
49
+ - بعد تشغيل project checks حديثة، استخدم `ospec execute verify [changes/active/<change>] --command "..." --status PASSED` لتسجيل verification evidence؛ هذا الأمر يسجل evidence فقط ولا يشغّل أوامر shell
50
+ - `ospec execute doc-review` يسجل artifacts فقط ولا يشغّل reviewers ولا أوامر shell ولا يزامن worker status ولا يعدّل source files
51
+ - لا تؤرشف عندما يحتوي `artifacts/agents/task-graph.json` على حالات مهام غير محسومة أو اعتماديات غير صالحة أو ملفات مستهدفة ناقصة أو أوامر تحقق ناقصة أو عندما لا يكون `status` العلوي `completed`
52
+ - بعد التنفيذ، أكمل كل task-level spec review قبل quality review الخاصة بها، ثم أكمل final `artifacts/reviews/spec-compliance.md` قبل final `artifacts/reviews/code-quality.md`؛ قرارات task-level أو final review غير المحسومة تمنع الأرشفة
53
+ - أثناء التنفيذ والمراجعة، حافظ على اتساق `artifacts/agents/worker-status.md` مع حالات implementer وspec reviewer وquality reviewer وcontroller
54
+ - لا تدّعِ الاكتمال ما دامت أي حالة worker هي `PENDING` أو `NEEDS_CONTEXT` أو `BLOCKED`؛ ويجب أن تكون `controller_status` هي `DONE` قبل الأرشفة
29
55
  - اقرأ القواعد المعتمدة للمشروع قبل بدء التنفيذ
30
56
  - إذا كان `stitch_design_review` مفعلاً وكان `approval.json.preview_url` أو `submitted_at` فارغاً، فشغّل أولاً `ospec plugins run stitch <change-path>` لتوليد preview ثم أرسل الرابط للمستخدم
31
57
  - إذا كانت `.skillrc.plugins.stitch.project.project_id` مضبوطة مسبقاً، فيجب إعادة استخدام مشروع Stitch نفسه وعدم إنشاء مشروع جديد
@@ -9,22 +9,54 @@ tags: [ai, protocol, ospec]
9
9
  ## اقرأ هذا أولاً في كل مرة تدخل فيها إلى مشروع
10
10
 
11
11
  1. `.skillrc`
12
- 2. `SKILL.index.json`
13
- 3. `docs/project/naming-conventions.md`
14
- 4. `docs/project/skill-conventions.md`
15
- 5. `docs/project/workflow-conventions.md`
16
- 6. ملفات change الحالية: `proposal.md / tasks.md / state.json / verification.md`
17
- 7. إذا وُجد `stitch_design_review` فاقرأ `artifacts/stitch/approval.json`
18
- 8. إذا كنت تحتاج إلى تعديل إعدادات Stitch أو Checkpoint المتعلقة بـ provider أو MCP أو المصادقة أو التثبيت أو التفعيل، فاقرأ أولاً مواصفة الإضافة المحلية المطابقة للغة الوثائق المعتمدة للمشروع، ولا تنتقل إلى لغة أخرى إلا إذا كان الملف المطابق غير موجود
12
+ 2. اقرأ `.ospec/session-brief.md` إذا كان موجودا؛ وإلا شغّل `ospec session [path]` في المشاريع المهيأة لإنشائه
13
+ 3. `SKILL.index.json`
14
+ 4. `docs/project/naming-conventions.md`
15
+ 5. `docs/project/skill-conventions.md`
16
+ 6. `docs/project/workflow-conventions.md`
17
+ 7. ملفات change الحالية: `proposal.md / design.md / implementation-plan.md / artifacts/agents/task-graph.json / artifacts/agents/bootstrap.md / artifacts/agents/handoff.md / artifacts/agents/document-review-dispatches/ / artifacts/agents/launch-plan.md / artifacts/agents/review-feedback-plan.md / tasks.md / artifacts/reviews/design-review.md / artifacts/reviews/implementation-plan-review.md / artifacts/reviews/spec-compliance.md / artifacts/reviews/code-quality.md / artifacts/agents/worker-status.md / artifacts/agents/debug-evidence.json / state.json / verification.md`
18
+ 8. إذا وُجد `stitch_design_review` فاقرأ `artifacts/stitch/approval.json`
19
+ 9. إذا كنت تحتاج إلى تعديل إعدادات Stitch أو Checkpoint المتعلقة بـ provider أو MCP أو المصادقة أو التثبيت أو التفعيل، فاقرأ أولاً مواصفة الإضافة المحلية المطابقة للغة الوثائق المعتمدة للمشروع، ولا تنتقل إلى لغة أخرى إلا إذا كان الملف المطابق غير موجود
19
20
 
20
21
  ## القواعد الإلزامية
21
22
 
22
- - حافظ على `proposal.md` و`tasks.md` و`verification.md` و`review.md` باللغة المعتمدة للمشروع
23
+ - حافظ على `proposal.md` و`design.md` و`implementation-plan.md` و`artifacts/agents/task-graph.json` و`artifacts/agents/bootstrap.md` و`artifacts/agents/handoff.md` و`artifacts/agents/document-review-dispatches/` و`artifacts/agents/workspace-status.md` و`artifacts/agents/worktree-plan.md` و`artifacts/agents/finish-plan.md` و`artifacts/agents/launch-plan.md` و`artifacts/agents/worker-runs/` و`artifacts/agents/review-runs/` و`artifacts/agents/retries/` و`artifacts/agents/blockers/` و`artifacts/agents/review-feedback-plan.md` و`tasks.md` و`artifacts/reviews/design-review.md` و`artifacts/reviews/implementation-plan-review.md` و`artifacts/reviews/spec-compliance.md` و`artifacts/reviews/code-quality.md` و`artifacts/agents/worker-status.md` و`artifacts/agents/debug-evidence.json` و`artifacts/agents/tdd-evidence.json` و`artifacts/agents/verification-evidence.json` و`verification.md` و`review.md` باللغة المعتمدة للمشروع
23
24
  - لا تعِد كتابة وثائق change إلى الإنجليزية فقط لأن واجهة المنتج أو locale الموقع أو نص المتطلب يميل إلى الإنجليزية
24
25
  - إذا كانت وثائق change الحالية بالصينية بالفعل، فاستمر بالصينية ما لم تتطلب قواعد المشروع التحويل إلى الإنجليزية صراحةً
25
- - لا تتجاوز proposal/tasks وتنتقل مباشرة إلى التنفيذ
26
+ - لا تتجاوز proposal/design/implementation-plan/task-graph/tasks/review-artifacts/worker-status وتدّعي الاكتمال مباشرة
27
+ - عند الدخول إلى مشروع OSpec موجود، استخدم `ospec session [path]` لكتابة `.ospec/session-brief.json` و`.ospec/session-brief.md`؛ يسجل active changes وqueued changes وحالة queue-run وcache fingerprint والأوامر الآمنة التالية فقط، ولا يشغّل workers ولا tests ولا يفحص git ولا يؤرشف ولا يحرر source files
28
+ - تعامل مع خطوات built-in quality policy المفعّلة مثل `tdd_cycle` و`root_cause_debug` و`verification_evidence` كـ `optional_steps` خاضعة لـ archive gate؛ غطّها في `tasks.md` و`verification.md` وملفات evidence المطابقة قبل closeout
29
+ - أثناء تنفيذ change بمساعدة AI، أنشئ `design.md` أو حدّثه بعد `proposal.md` وقبل تعديل `implementation-plan.md` أو `tasks.md` أو الكود
30
+ - لا تطرح إلا سؤال تصميم موجزاً واحداً عندما يغيّر القرار الناقص فعلياً البنية أو API أو البيانات أو UI أو المخاطر؛ وإلا فسجل الافتراضات في `design.md`
31
+ - أنشئ `implementation-plan.md` أو حدّثه من `design.md`، مع الملفات المستهدفة والنتائج المتوقعة وأوامر التحقق والاعتماديات والعمل القابل للتوازي والتعارضات
32
+ - اشتق `artifacts/agents/task-graph.json` من `implementation-plan.md`؛ ويجب أن تتضمن كل مهمة id والحالة والاعتماديات وسلامة التوازي والتعارضات والملفات المستهدفة وأوامر التحقق والنتيجة المتوقعة ودور worker
33
+ - عند بدء أو استئناف active change واحد، استخدم `ospec execute bootstrap [changes/active/<change>]` لكتابة `artifacts/agents/bootstrap.json` و`artifacts/agents/bootstrap.md` مع project session brief snapshot، ثم اتبع الإجراء الآمن التالي المسجل فيه
34
+ - عند نقل change بين agents أو tools أو worktrees أو shells أو operators بشريين، استخدم `ospec execute handoff [changes/active/<change>] [--target codex|gpt|claude|gemini|opencode|shell|generic]` لكتابة `artifacts/agents/handoff.json` و`artifacts/agents/handoff.md`؛ يسجل هذا الأمر project session brief snapshot وtool mapping وقواعد السلامة فقط ولا يشغّل workers أو يعدّل source files
35
+ - قبل اشتقاق implementation tasks أو dispatch لها، استخدم `ospec execute doc-review [changes/active/<change>] [--stage design|plan]` لإنشاء document reviewer packets تتضمن project session brief snapshot تحت `artifacts/agents/document-review-dispatches/` وتجهيز `artifacts/reviews/design-review.md` أو `artifacts/reviews/implementation-plan-review.md`؛ يجب اعتماد design review قبل dispatch لمراجعة implementation plan. هذا الأمر يسجل artifacts فقط ولا يشغّل reviewers ولا أوامر shell ولا يزامن worker status ولا يعدّل source files
36
+ - قبل توزيع عمل المهام، استخدم `ospec execute status [changes/active/<change>]` أو `ospec execute next [changes/active/<change>]` لفحص حالة controller والمهام التالية الآمنة
37
+ - قبل handoff إلى worker استخدم `ospec execute workspace [changes/active/<change>]` لكتابة `artifacts/agents/workspace-status.json` و`artifacts/agents/workspace-status.md`؛ إذا كانت الحالة `needs_isolation`، نظّف workspace أو انقل العمل إلى git worktree معزول قبل parallel dispatch
38
+ - قبل إنشاء git worktree معزول، استخدم `ospec execute worktree [changes/active/<change>] [--branch name] [--path path] [--base ref]` لكتابة `artifacts/agents/worktree-plan.json` و`artifacts/agents/worktree-plan.md`؛ هذا الأمر يسجل خطة تحضير فقط ولا يشغّل `git worktree add`
39
+ - قبل الإغلاق النهائي، استخدم `ospec execute finish [changes/active/<change>] [--target main] [--remote origin]` لكتابة `artifacts/agents/finish-plan.json` و`artifacts/agents/finish-plan.md`؛ هذا الأمر يسجل الجاهزية ونص الأوامر فقط ولا يشغل finalize أو archive أو push أو merge أو حذف worktree
40
+ - استخدم `ospec execute dispatch [changes/active/<change>] [--task task-id] [--limit N]` لإنشاء batch آمن للتوازي من worker packets و`artifacts/agents/execution-session.json`؛ يتضمن كل packet project session brief snapshot وworker profile يوضح capability tier وrecommended target وtarget tool mapping وrationale وrequired behavior. استخدم `ospec execute complete <task-id> ...` لتسجيل نتائج worker. استخدم `--task` لمهمة واحدة صريحة و`--limit` لتحديد حجم dispatch batch. تزامن هذه الأوامر أيضا `artifacts/agents/worker-status.md`، وتحدّث OSpec artifacts فقط ولا تشغّل workers خارجيين؛ عندما تكون النتيجة `NEEDS_CONTEXT` أو `BLOCKED` يكتب `complete` ملفات blocker escalation تحت `artifacts/agents/blockers/`
41
+ - بعد dispatch، استخدم `ospec execute launch [changes/active/<change>] [--task task-id] [--target codex|gpt|claude|gemini|opencode|shell|generic] [--dry-run]` لكتابة native agent launch plan؛ يوجه controlling AI إلى آلية agent الأصلية في harness الحالي: Codex/GPT يستخدم `spawn_agent`/`wait_agent`/`close_agent`، وClaude Code يستخدم Task، وGemini يستخدم `@generalist`، وOpenCode يستخدم `@mention`. هذا الأمر لا يشغّل workers ولا أوامر shell بنفسه
42
+ - default multi-worker execution هو current-harness native subagents: أنشئ safe packets عبر `ospec execute dispatch`، اقرأ `launch-plan.md`، ثم dispatch native worker agent لكل packet آمن، وسجل النتيجة عبر `ospec execute complete`
43
+ - استخدم `ospec execute orchestrate [changes/active/<change>] --command "..."` فقط كـ final CLI fallback عندما لا يدعم harness الحالي native subagents؛ fallback mode يرندر explicit command template ويشغّل worker commands بالتوازي ويسجل `artifacts/agents/orchestration-runs/`
44
+ - استخدم `--run --command` مع `ospec execute launch ... --run --command "..."` فقط كـ single-worker CLI fallback عندما لا تتوفر native subagents أو يتم تجاوزها صراحة؛ ثم استخدم `ospec execute collect ...` لتسجيل fallback task result. بعد إصلاح blocked أو needs-context أو failed work استخدم `ospec execute retry` لإعادة dispatch
45
+ - بعد اكتمال كل worker task، استخدم `ospec execute review [changes/active/<change>] --task <task-id> --stage spec` ثم `--stage quality` لإنشاء task-level reviewer handoff packets. تحفظ قرارات task-level داخل `artifacts/reviews/tasks/<task-id>/` وتبقى المهام التابعة محجوبة حتى اعتماد المراجعتين
46
+ - بعد اعتماد كل task-level reviews واكتمال task graph، استخدم `ospec execute review [changes/active/<change>] [--stage spec|quality]` من دون `--task` لإنشاء final whole-change reviewer handoff packets داخل `artifacts/agents/review-dispatches/`؛ لا توزّع final quality review قبل اعتماد final spec review
47
+ - لا يشغّل OSpec local reviewer command إلا عند استخدام `ospec execute review ... --run --command "..."` صراحة؛ يسجل ذلك `artifacts/agents/review-runs/` ويمكنه كتابة review decision عند تمرير `--decision`
48
+ - بعد أن يحتوي review artifact على قرار غير `PENDING`، استخدم `ospec execute feedback [changes/active/<change>] [--stage spec|quality]` لكتابة `artifacts/agents/review-feedback-plan.json` و`artifacts/agents/review-feedback-plan.md`؛ حدد accept أو revise أو clarify أو blocked قبل dispatch عمل إضافي
49
+ - عندما يكون debugging جزءا من change، استخدم `ospec execute debug [changes/active/<change>] --symptom "..." --root-cause "..." --status FIXED` لتسجيل `artifacts/agents/debug-evidence.json`؛ تعني `CONFIRMED` عزل root cause، وتعني `FIXED` إصلاحا متحققا، وتؤدي `BLOCKED` إلى فشل verify
50
+ - بعد تشغيل focused tests، استخدم `ospec execute tdd [changes/active/<change>] --phase red|green|refactor --command "..." --status ...` لتسجيل `artifacts/agents/tdd-evidence.json`؛ عادة يسجل red الاختبار المتوقع فشله، بينما يجب أن تسجل green/refactor نتيجة ناجحة
51
+ - بعد تشغيل project verification commands حديثة، استخدم `ospec execute verify [changes/active/<change>] --command "..." --status PASSED` لتسجيل `artifacts/agents/verification-evidence.json`؛ لا تدّعِ الاكتمال بمجرد ملخص داخل المحادثة
52
+ - بعد تعديل task graph أو execution session أو review artifacts أو debug evidence أو verification checklist يدويا، استخدم `ospec execute sync [changes/active/<change>]` لإعادة بناء `artifacts/agents/worker-status.md`
53
+ - يجب اشتقاق `tasks.md` من `artifacts/agents/task-graph.json`؛ وإذا كانت المهام موجودة لكن وثائقها السابقة ما زالت قوالب، فحدّث الوثائق السابقة أولاً ثم وائم المهام معها
54
+ - لا تؤرشف عندما يحتوي `artifacts/agents/task-graph.json` على حالات مهام غير محسومة أو اعتماديات غير صالحة أو تفاصيل تنفيذ ناقصة أو عندما لا يكون `status` العلوي `completed`
55
+ - أكمل كل task-level spec review قبل quality review الخاصة بها، ثم أكمل final `artifacts/reviews/spec-compliance.md` قبل final `artifacts/reviews/code-quality.md`؛ قرارات task-level أو final review غير المحسومة تمنع الأرشفة
56
+ - أثناء التنفيذ والمراجعة، حافظ على اتساق `artifacts/agents/worker-status.md` مع حالات implementer وspec reviewer وquality reviewer وcontroller
57
+ - لا تعتبر change مكتملة ما دامت أي حالة worker هي `PENDING` أو `NEEDS_CONTEXT` أو `BLOCKED`؛ ويجب أن تكون `controller_status` هي `DONE` قبل الأرشفة
26
58
  - استخدم `state.json` كمصدر الحقيقة لحالة التنفيذ
27
- - يجب أن تظهر optional steps المفعلة في `tasks.md` و`verification.md`
59
+ - يجب أن تظهر optional steps المفعلة في `artifacts/agents/task-graph.json` و`tasks.md` و`verification.md`
28
60
  - إذا كان `stitch_design_review` مفعلاً وكان `approval.json.preview_url` أو `submitted_at` فارغاً، فشغّل أولاً `ospec plugins run stitch <change-path>` لإرسال preview
29
61
  - يجب أن تفرض مراجعة تصميم Stitch تخطيطاً canonical واحداً لكل route، ويجب تصنيف الشاشات غير canonical على أنها `archive / old / exploration`
30
62
  - في متغيرات الثيم `light/dark` حافظ على التخطيط canonical نفسه وحوّل الثيم البصري فقط من دون إعادة ترتيب الوحدات أو نقل CTA أو تغيير البنية
@@ -22,10 +22,37 @@ This document is the project-adopted AI guide copied from the OSpec mother spec.
22
22
 
23
23
  ## Required Behavior
24
24
 
25
- - Follow the project-adopted document language for `proposal.md`, `tasks.md`, `verification.md`, and `review.md`
25
+ - Follow the project-adopted document language for `proposal.md`, `design.md`, `implementation-plan.md`, `artifacts/agents/task-graph.json`, `artifacts/agents/bootstrap.md`, `artifacts/agents/handoff.md`, `artifacts/agents/document-review-dispatches/`, `artifacts/agents/workspace-status.md`, `artifacts/agents/worktree-plan.md`, `artifacts/agents/finish-plan.md`, `artifacts/agents/launch-plan.md`, `artifacts/agents/worker-runs/`, `artifacts/agents/review-runs/`, `artifacts/agents/retries/`, `artifacts/agents/blockers/`, `artifacts/agents/review-feedback-plan.md`, `tasks.md`, `artifacts/reviews/design-review.md`, `artifacts/reviews/implementation-plan-review.md`, `artifacts/reviews/spec-compliance.md`, `artifacts/reviews/code-quality.md`, `artifacts/agents/worker-status.md`, `artifacts/agents/debug-evidence.json`, `artifacts/agents/tdd-evidence.json`, `artifacts/agents/verification-evidence.json`, `verification.md`, and `review.md`
26
26
  - Do not infer change-document language from product copy, default site locale, or an "English-first" business requirement alone
27
27
  - If the project-adopted protocol is Chinese or the current change docs are already Chinese, keep the change docs in Chinese unless the project rules explicitly switch them to English
28
28
  - Use the index to locate knowledge before reading target files
29
+ - When entering an existing OSpec project, run `ospec session [path]` to write `.ospec/session-brief.json` and `.ospec/session-brief.md` with active change, queued change, queue-run, cache fingerprint, and safe next command context; this project entry brief does not replace active-change `ospec execute bootstrap`. Use `ospec session hook [path]` only to write optional harness startup hook artifacts
30
+ - Use `ospec brainstorm [path] --topic "..."` only for optional pre-change exploration artifacts; use `ospec plan [path] --change changes/active/<change>` only for optional plan drafts, and pass `--apply` only when updating `implementation-plan.md` deliberately
31
+ - Treat activated built-in quality policy steps such as `tdd_cycle`, `root_cause_debug`, and `verification_evidence` as archive-gated `optional_steps`; cover them in `tasks.md`, `verification.md`, and matching evidence artifacts before closeout
32
+ - In AI-assisted change execution, do not ask the user to hand-write `design.md` or `implementation-plan.md`; draft or update them from the requirement, `proposal.md`, and project context before deriving `artifacts/agents/task-graph.json`, editing `tasks.md`, or editing code
33
+ - Ask at most one concise design question only when the missing decision materially changes architecture, API, data, UI, or risk; otherwise write assumptions into `design.md`
34
+ - Keep `implementation-plan.md` derived from `design.md`, keep `artifacts/agents/task-graph.json` derived from `implementation-plan.md`, keep `tasks.md` derived from the task graph, and reconcile existing tasks after upstream docs are updated
35
+ - When starting or resuming one active change, use `ospec execute bootstrap [changes/active/<change>]` to write `artifacts/agents/bootstrap.json` and `artifacts/agents/bootstrap.md` with the project session brief snapshot, then follow its next safe action; when an active dispatch is waiting, bootstrap recommends the matching `ospec execute launch ... --task ...` command
36
+ - Use `ospec execute handoff [changes/active/<change>] [--target codex|gpt|claude|gemini|opencode|shell|generic]` when moving a change between agents, tools, worktrees, shells, or human operators; it writes `artifacts/agents/handoff.json` and `artifacts/agents/handoff.md` with the project session brief snapshot, target tool mapping, and safety rules without launching workers or editing source files
37
+ - Before deriving or dispatching implementation tasks, use `ospec execute doc-review [changes/active/<change>] [--stage design|plan]` to create document reviewer packets with the project session brief snapshot under `artifacts/agents/document-review-dispatches/` plus `artifacts/reviews/design-review.md` or `artifacts/reviews/implementation-plan-review.md`; design review must be approved before implementation plan review
38
+ - Use `ospec execute status [changes/active/<change>]` or `ospec execute next [changes/active/<change>]` when you need a controller view of ready, blocked, running, completed, and safe next task candidates
39
+ - Before worker handoff, use `ospec execute workspace [changes/active/<change>]` to record git workspace safety; if status is `needs_isolation`, clean the workspace or move work into an isolated git worktree before parallel dispatch
40
+ - Before creating an isolated worktree, use `ospec execute worktree [changes/active/<change>] [--branch name] [--path path] [--base ref]` to write `artifacts/agents/worktree-plan.json` and `artifacts/agents/worktree-plan.md`; plan mode does not run git. Use explicit `--create` to run `git worktree add`, and explicit `--cleanup` to run `git worktree remove`; both record `artifacts/agents/worktree-runs/`
41
+ - Before final closeout, use `ospec execute finish [changes/active/<change>] [--target main] [--remote origin]` to write `artifacts/agents/finish-plan.json` and `artifacts/agents/finish-plan.md`; this command records readiness and command text only and does not finalize, archive, push, merge, or remove worktrees
42
+ - Use `ospec execute dispatch` to create a parallel-safe batch of worker packets and `ospec execute complete` to record worker results when task-level execution needs durable handoff artifacts; each dispatch packet includes the project session brief snapshot and a worker profile with capability tier, recommended target, target tool mapping, rationale, and required behavior; `complete` writes `artifacts/agents/blockers/` when the result is `NEEDS_CONTEXT` or `BLOCKED`; use `--task` for one explicit task and `--limit` to cap dispatch batch size; after each `DONE` or `DONE_WITH_CONCERNS` worker result, run task-level review with `ospec execute review [changes/active/<change>] --task <task-id> --stage spec`, then `--stage quality`, before dispatching dependent work; after all task-level reviews complete, use `ospec execute review` without `--task` for final whole-change spec or quality reviewer packets; use `ospec execute feedback` after non-`PENDING` final review decisions to write `artifacts/agents/review-feedback-plan.md`; use `ospec execute sync` to rebuild `worker-status.md` after manual execution or review artifact edits
43
+ - Use `ospec execute launch [changes/active/<change>] [--task task-id] [--target codex|gpt|claude|gemini|opencode|shell|generic] [--dry-run]` after dispatch to write the native agent launch plan; it tells the controlling AI how to use the current harness agent mechanism (`spawn_agent`/`wait_agent`/`close_agent` for Codex/GPT, Task for Claude Code, `@generalist` for Gemini, and `@mention` for OpenCode). It does not start workers or edit source files by itself
44
+ - Default to current-harness native subagents for multi-worker execution: create safe packets with `ospec execute dispatch`, inspect `launch-plan.md`, dispatch one native worker agent per safe packet, and record each result with `ospec execute complete`
45
+ - Use `ospec execute orchestrate [changes/active/<change>] --command "..."` only as the final CLI fallback when native subagents are unavailable; fallback mode renders an explicit command template, runs worker commands concurrently, records `artifacts/agents/orchestration-runs/`, captures worker runs, and collects results unless `--no-collect` is passed
46
+ - Use explicit `--run --command` on `ospec execute launch ... --run --command "..."` only as single-worker CLI fallback when native subagents are unavailable or explicitly bypassed; runs capture `artifacts/agents/worker-runs/`. Then use `ospec execute collect ...` to record the fallback task result. Use `ospec execute retry` to reopen corrected blocked, needs-context, or failed work with `artifacts/agents/retries/`; completed tasks require explicit `--force`
47
+ - Use explicit `ospec execute review ... --run --command "..."` only when OSpec should run a local reviewer command; it captures `artifacts/agents/review-runs/` and can write the task-level or final review decision when `--decision` is provided
48
+ - When debugging is part of the change, use `ospec execute debug [changes/active/<change>] --symptom "..." --root-cause "..." --status FIXED` to record root-cause and fix evidence; it records evidence only and does not run shell commands
49
+ - After focused test runs, use `ospec execute tdd [changes/active/<change>] --phase red|green|refactor --command "..." --status ...` to record TDD cycle evidence; it records evidence only and does not run shell commands
50
+ - After running fresh project checks, use `ospec execute verify [changes/active/<change>] --command "..." --status PASSED` to record verification evidence; it records evidence only and does not run shell commands
51
+ - `ospec execute doc-review` records artifacts only and does not launch reviewers, run shell commands, sync worker status, or edit source files; native subagent dispatch is done by the current AI harness, while shell commands run only for explicit worktree create/cleanup, fallback `launch --run --command`, `review --run --command`, or fallback `orchestrate` with an explicit command template
52
+ - Do not archive while `artifacts/agents/task-graph.json` has unresolved task statuses, invalid dependencies, missing target files, missing verification commands, or top-level `status` other than `completed`
53
+ - After implementation, every task-level spec review must complete before that task's quality review, and final `artifacts/reviews/spec-compliance.md` must complete before final `artifacts/reviews/code-quality.md`; unresolved task-level or final review decisions block archive
54
+ - During implementation and review, keep `artifacts/agents/worker-status.md` aligned with implementer, spec reviewer, quality reviewer, and controller statuses
55
+ - Do not claim completion while any worker status is `PENDING`, `NEEDS_CONTEXT`, or `BLOCKED`; the controller status must be `DONE` before archive
29
56
  - Read the project-adopted rules before implementation work
30
57
  - If `stitch_design_review` is active and `approval.json.preview_url` or `submitted_at` is empty, run `ospec plugins run stitch <change-path>` first to generate a preview, then send the preview URL to the user for review
31
58
  - If `.skillrc.plugins.stitch.project.project_id` is already set, you must reuse that exact Stitch project instead of creating a new one
@@ -9,22 +9,56 @@ tags: [ai, protocol, ospec]
9
9
  ## Read First Every Time You Enter A Project
10
10
 
11
11
  1. `.skillrc`
12
- 2. `SKILL.index.json`
13
- 3. `docs/project/naming-conventions.md`
14
- 4. `docs/project/skill-conventions.md`
15
- 5. `docs/project/workflow-conventions.md`
16
- 6. The current change files: `proposal.md / tasks.md / state.json / verification.md`
17
- 7. If `stitch_design_review` exists, read `artifacts/stitch/approval.json`
18
- 8. If Stitch or Checkpoint provider, MCP, auth, install, or enable config must be changed, read the repo-local localized plugin docs under `.ospec/plugins/<plugin>/docs/` first; if they are missing, install or enable the plugin to sync its docs before changing config
12
+ 2. `.ospec/session-brief.md` if it exists; otherwise run `ospec session [path]` in initialized projects to create it
13
+ 3. `SKILL.index.json`
14
+ 4. `docs/project/naming-conventions.md`
15
+ 5. `docs/project/skill-conventions.md`
16
+ 6. `docs/project/workflow-conventions.md`
17
+ 7. The current change files: `proposal.md / design.md / implementation-plan.md / artifacts/agents/task-graph.json / artifacts/agents/bootstrap.md / artifacts/agents/handoff.md / artifacts/agents/document-review-dispatches/ / artifacts/agents/launch-plan.md / artifacts/agents/review-feedback-plan.md / tasks.md / artifacts/reviews/design-review.md / artifacts/reviews/implementation-plan-review.md / artifacts/reviews/spec-compliance.md / artifacts/reviews/code-quality.md / artifacts/agents/worker-status.md / artifacts/agents/debug-evidence.json / state.json / verification.md`
18
+ 8. If `stitch_design_review` exists, read `artifacts/stitch/approval.json`
19
+ 9. If Stitch or Checkpoint provider, MCP, auth, install, or enable config must be changed, read the repo-local localized plugin docs under `.ospec/plugins/<plugin>/docs/` first; if they are missing, install or enable the plugin to sync its docs before changing config
19
20
 
20
21
  ## Mandatory Rules
21
22
 
22
- - Keep `proposal.md`, `tasks.md`, `verification.md`, and `review.md` in the project-adopted document language
23
+ - Keep `proposal.md`, `design.md`, `implementation-plan.md`, `artifacts/agents/task-graph.json`, `artifacts/agents/bootstrap.md`, `artifacts/agents/handoff.md`, `artifacts/agents/document-review-dispatches/`, `artifacts/agents/workspace-status.md`, `artifacts/agents/worktree-plan.md`, `artifacts/agents/finish-plan.md`, `artifacts/agents/launch-plan.md`, `artifacts/agents/worker-runs/`, `artifacts/agents/review-runs/`, `artifacts/agents/retries/`, `artifacts/agents/blockers/`, `artifacts/agents/review-feedback-plan.md`, `tasks.md`, `artifacts/reviews/design-review.md`, `artifacts/reviews/implementation-plan-review.md`, `artifacts/reviews/spec-compliance.md`, `artifacts/reviews/code-quality.md`, `artifacts/agents/worker-status.md`, `artifacts/agents/debug-evidence.json`, `artifacts/agents/tdd-evidence.json`, `artifacts/agents/verification-evidence.json`, `verification.md`, and `review.md` in the project-adopted document language
23
24
  - Do not rewrite change docs into English just because the product UI, site locale, or requirement text is English-first
24
25
  - If the current change docs are already Chinese, continue in Chinese unless the project rules explicitly require an English switch
25
- - Do not skip proposal/tasks and jump straight into implementation
26
+ - Do not skip proposal/design/implementation-plan/task-graph/tasks/review-artifacts/worker-status and jump straight into completion
27
+ - When entering an existing OSpec project, use `ospec session [path]` to write `.ospec/session-brief.json` and `.ospec/session-brief.md`; it records active changes, queued changes, queue-run state, cache fingerprint, and safe next commands without launching workers, running tests, inspecting git, archiving, or editing source files. Use `ospec session hook [path]` only to write opt-in harness startup hook artifacts under `.ospec/hooks/`
28
+ - Use `ospec brainstorm [path] --topic "..."` only for optional pre-change exploration artifacts under `.ospec/brainstorms/`; `--visual` adds a local static HTML companion and the command does not create a change
29
+ - Use `ospec plan [path] --change changes/active/<change>` for optional plan drafts under `.ospec/plans/`; pass `--apply` only when deliberately updating that change's `implementation-plan.md`
30
+ - Treat activated built-in quality policy steps such as `tdd_cycle`, `root_cause_debug`, and `verification_evidence` as archive-gated `optional_steps`; cover them in `tasks.md`, `verification.md`, and matching evidence artifacts before closeout
31
+ - During AI-assisted change execution, draft or update `design.md` after `proposal.md` and before editing `implementation-plan.md`, `tasks.md`, or code
32
+ - Ask one concise design question only when a missing decision would materially change architecture, API, data, UI, or risk; otherwise record assumptions in `design.md`
33
+ - Draft or update `implementation-plan.md` from `design.md`, including target files, expected results, verification commands, dependencies, parallelizable work, and conflicts
34
+ - Derive `artifacts/agents/task-graph.json` from `implementation-plan.md`; each task must include id, status, dependencies, parallel safety, conflicts, target files, verification commands, expected result, and worker role
35
+ - When starting or resuming one active change, use `ospec execute bootstrap [changes/active/<change>]` to write `artifacts/agents/bootstrap.json` and `artifacts/agents/bootstrap.md` with the project session brief snapshot, then follow its next safe action
36
+ - Use `ospec execute handoff [changes/active/<change>] [--target codex|gpt|claude|gemini|opencode|shell|generic]` when moving a change between agents, tools, worktrees, shells, or human operators; it writes `artifacts/agents/handoff.json` and `artifacts/agents/handoff.md` with the project session brief snapshot, target tool mapping, and safety rules without launching workers or editing source files
37
+ - Before deriving or dispatching implementation tasks, use `ospec execute doc-review [changes/active/<change>] [--stage design|plan]` to create document reviewer packets with the project session brief snapshot under `artifacts/agents/document-review-dispatches/` and review artifacts at `artifacts/reviews/design-review.md` or `artifacts/reviews/implementation-plan-review.md`; design review must be approved before implementation plan review. This command records artifacts only and does not launch reviewers, run shell commands, sync worker status, or edit source files
38
+ - Use `ospec execute status [changes/active/<change>]` or `ospec execute next [changes/active/<change>]` to inspect controller state and safe next task candidates before assigning task work
39
+ - Before worker handoff, use `ospec execute workspace [changes/active/<change>]` to write `artifacts/agents/workspace-status.json` and `artifacts/agents/workspace-status.md`; if status is `needs_isolation`, clean the workspace or move work into an isolated git worktree before parallel dispatch
40
+ - Before creating an isolated worktree, use `ospec execute worktree [changes/active/<change>] [--branch name] [--path path] [--base ref]` to write `artifacts/agents/worktree-plan.json` and `artifacts/agents/worktree-plan.md`; plan mode records a preparation plan only and does not run git. Use explicit `--create` to run `git worktree add`, and explicit `--cleanup` to run `git worktree remove`; both write `artifacts/agents/worktree-runs/`, and cleanup does not delete branches
41
+ - Before final closeout, use `ospec execute finish [changes/active/<change>] [--target main] [--remote origin]` to write `artifacts/agents/finish-plan.json` and `artifacts/agents/finish-plan.md`; this command records readiness and command text only and does not finalize, archive, push, merge, or remove worktrees
42
+ - Use `ospec execute dispatch [changes/active/<change>] [--task task-id] [--limit N]` to create a parallel-safe batch of worker packets and `artifacts/agents/execution-session.json`; each packet includes the project session brief snapshot and a worker profile with capability tier, recommended target, target tool mapping, rationale, and required behavior. Use `ospec execute complete <task-id> ...` to record worker results. Use `--task` for one explicit task and `--limit` to cap dispatch batch size. These commands also sync `artifacts/agents/worker-status.md`, update OSpec artifacts only, and do not launch external workers; `complete` writes blocker escalation artifacts under `artifacts/agents/blockers/` when the result is `NEEDS_CONTEXT` or `BLOCKED`
43
+ - Use `ospec execute launch [changes/active/<change>] [--task task-id] [--target codex|gpt|claude|gemini|opencode|shell|generic] [--dry-run]` after dispatch to write the native agent launch plan; it tells the controlling AI how to use the current harness agent mechanism (`spawn_agent`/`wait_agent`/`close_agent` for Codex/GPT, Task for Claude Code, `@generalist` for Gemini, and `@mention` for OpenCode). It does not start workers or run shell commands by itself
44
+ - Default to current-harness native subagents for multi-worker execution: create safe packets with `ospec execute dispatch`, inspect `launch-plan.md`, dispatch one native worker agent per safe packet, and record each result with `ospec execute complete`
45
+ - Use `ospec execute orchestrate [changes/active/<change>] --command "..."` only as the final CLI fallback when native subagents are unavailable; fallback mode renders an explicit command template, runs worker commands concurrently, records `artifacts/agents/orchestration-runs/`, captures worker runs, and collects results unless `--no-collect` is passed
46
+ - Use explicit `--run --command` on `ospec execute launch ... --run --command "..."` only as single-worker CLI fallback when native subagents are unavailable or explicitly bypassed; runs capture `artifacts/agents/worker-runs/`. Then use `ospec execute collect ...` to record the fallback task result. Use `ospec execute retry` to reopen corrected blocked, needs-context, or failed work with `artifacts/agents/retries/`; completed tasks require explicit `--force`
47
+ - After a worker records `DONE` or `DONE_WITH_CONCERNS`, use `ospec execute review [changes/active/<change>] --task <task-id> --stage spec` and then `--stage quality` to create task-level reviewer packets; task-level decisions are stored under `artifacts/reviews/tasks/<task-id>/`, and dependent tasks stay blocked until both task reviews are approved
48
+ - After all task-level reviews are approved and the task graph is completed, use `ospec execute review [changes/active/<change>] [--stage spec|quality]` without `--task` to create final whole-change reviewer packets with the project session brief snapshot under `artifacts/agents/review-dispatches/`; final spec review must be approved before final quality review is dispatched
49
+ - Use explicit `ospec execute review ... --run --command "..."` only when OSpec should run a local reviewer command; it captures `artifacts/agents/review-runs/` and can write the task-level or final review decision when `--decision` is provided
50
+ - Use `ospec execute feedback [changes/active/<change>] [--stage spec|quality]` after a review artifact has a non-`PENDING` decision to write `artifacts/agents/review-feedback-plan.json` and `artifacts/agents/review-feedback-plan.md`; handle review feedback through accept, revise, clarify, or blocked actions before dispatching more work
51
+ - When debugging is part of the change, use `ospec execute debug [changes/active/<change>] --symptom "..." --root-cause "..." --status FIXED` to record `artifacts/agents/debug-evidence.json`; `CONFIRMED` isolates root cause, `FIXED` verifies the fix, and `BLOCKED` fails verification
52
+ - After focused test runs, use `ospec execute tdd [changes/active/<change>] --phase red|green|refactor --command "..." --status ...` to record `artifacts/agents/tdd-evidence.json`; red normally records the expected failing test, while green/refactor should pass
53
+ - After running fresh project verification commands, use `ospec execute verify [changes/active/<change>] --command "..." --status PASSED` to record `artifacts/agents/verification-evidence.json`; do not claim completion with only an unrecorded chat summary
54
+ - Use `ospec execute sync [changes/active/<change>]` after manual task graph, execution-session, review artifact, debug evidence, or verification checklist edits to rebuild `artifacts/agents/worker-status.md`
55
+ - Derive `tasks.md` from `artifacts/agents/task-graph.json`; if tasks already exist but upstream docs are still templates, update them first and then reconcile tasks
56
+ - Do not archive while `artifacts/agents/task-graph.json` has unresolved task statuses, invalid dependencies, missing execution details, or top-level `status` other than `completed`
57
+ - Complete every task-level spec review before that task's quality review, then complete final `artifacts/reviews/spec-compliance.md` before final `artifacts/reviews/code-quality.md`; unresolved task-level or final review decisions block archive
58
+ - During implementation and review, keep `artifacts/agents/worker-status.md` aligned with implementer, spec reviewer, quality reviewer, and controller statuses
59
+ - Do not treat the change as complete while any worker status is `PENDING`, `NEEDS_CONTEXT`, or `BLOCKED`; `controller_status` must be `DONE` before archive
26
60
  - Use `state.json` as the execution status source of truth
27
- - Activated optional steps must appear in `tasks.md` and `verification.md`
61
+ - Activated optional steps must appear in `artifacts/agents/task-graph.json`, `tasks.md`, and `verification.md`
28
62
  - If `stitch_design_review` is active and `approval.json.preview_url` or `submitted_at` is empty, run `ospec plugins run stitch <change-path>` first to submit a design preview
29
63
  - Stitch design review must enforce one canonical layout per route; non-canonical screens under the same route must be explicitly marked as `archive / old / exploration`
30
64
  - For `light/dark` theme variants, keep the same canonical layout and only transform the visual theme; do not reorder modules, regroup sections, move CTAs, or alter navigation structure