workflow-supervisor 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,212 +1,142 @@
1
1
  # Workflow Supervisor
2
2
 
3
- Workflow Supervisor is a small skill pack and npm helper for making coding agents handle complex work with discipline.
3
+ Workflow Supervisor is a strict supervision skill pack for agent work that needs to stay organized, resumable, and evidence-backed.
4
4
 
5
- It turns a vague request like:
5
+ It is for moments when you do not want an agent to jump straight into implementation, lose the thread halfway through, verify its own work, or quietly skip important handoffs. You ask for the supervisor, the supervisor asks the right setup questions, turns the work into small units, creates worker dossiers, delegates scoped work to real worker agents when possible, verifies the results, and leaves a clear outcome trail.
6
+
7
+ Example prompt:
6
8
 
7
9
  ```text
8
- Use workflow-supervisor to migrate the database from SQLite to LanceDB.
10
+ Use $workflow-supervisor to build a FastAPI Naive RAG demo for a healthcare specialist agent.
9
11
  ```
10
12
 
11
- into a supervised workflow with intake, source grounding, bounded work units, concrete worker dossiers, independent verification, repair loops, and evidence-backed output.
12
-
13
- It currently supports certified automated worker delegation for **Codex** and **Claude Code**.
13
+ The correct first response is not code. The correct first response is an intake packet. That is intentional.
14
14
 
15
15
  ![Workflow Supervisor hero image showing the supervisor coordinating source corpus, work units, dossiers, roles, loop policy, acceptance, repair, workflow docs, and final outputs](assets/workflow-supervisor-hero.png)
16
16
 
17
- ## What It Is
18
-
19
- Workflow Supervisor is not another agent product. It is a thin coordination layer for agents that already exist.
20
-
21
- The supervisor is the visible agent in the conversation. It owns the plan, asks the user questions, creates work units, validates worker contracts, launches workers, reads reports, and decides what happens next.
22
-
23
- Workers are short-lived CLI runs:
24
-
25
- ```bash
26
- workflow-supervisor delegate --agent codex --role implementer --unit U1 --dossier .workflow/dossiers/U1.yaml
27
- workflow-supervisor delegate --agent claude-code --role verifier --unit U1 --dossier .workflow/dossiers/U1.yaml
28
- ```
17
+ ## What You Get
29
18
 
30
- Each worker gets only the context it needs. It returns one structured report. The supervisor remains the coordinator.
19
+ Workflow Supervisor gives you a repeatable workflow for serious agent tasks:
31
20
 
32
- ## The Moat
21
+ - a complete intake before work starts
22
+ - a source map, even when the only source is the user prompt
23
+ - bounded work units, including `WU-001` for tiny tasks
24
+ - dossiers that tell each worker exactly what to do and what not to touch
25
+ - separate implementer, verifier, repair, and documenter responsibilities
26
+ - structured worker reports instead of loose prose
27
+ - evidence-based verification
28
+ - repair loops that stay tied to failed acceptance rows
29
+ - durable `.workflow/` state when the work needs to survive context loss
30
+ - a final report with checks, risks, workers, and next actions
33
31
 
34
- The moat is not a clever prompt. The moat is the set of gates that prevent agents from drifting.
32
+ The main design choice is simple: the supervisor coordinates, workers do scoped work, and the CLI stays small.
35
33
 
36
- Workflow Supervisor enforces:
34
+ ## The Mental Model
37
35
 
38
- - complete intake before work starts
39
- - no keyword-based skipping
40
- - bounded work units before implementation
41
- - machine-checkable `DossierV1` before workers start
42
- - role separation between implementer, verifier, repair, and documenter
43
- - normalized `WorkerReportV1` output from every worker
44
- - evidence required for PASS
45
- - automatic BLOCKED reports for vague dossiers, missing CLIs, auth failures, invalid output, timeouts, forbidden edits, or verifier mutations
36
+ Think of Workflow Supervisor as a project lead inside the current agent conversation.
46
37
 
47
- That means the system does not merely ask agents to behave. It blocks unsafe or vague execution before it happens.
38
+ The supervisor:
48
39
 
49
- ## What It Solves
40
+ - asks the user for missing decisions
41
+ - decides when work is ready to start
42
+ - creates the plan, units, dossiers, and acceptance rows
43
+ - hands work to role-specific workers
44
+ - reads worker reports
45
+ - routes blockers and repairs
46
+ - decides when verification is good enough
47
+ - applies the final disposition policy
50
48
 
51
- Large agent tasks fail in predictable ways:
49
+ Workers:
52
50
 
53
- - the agent starts before asking enough questions
54
- - "autonomous" or "use workflow supervisor" gets treated as permission to act
55
- - the context window fills with unrelated history
56
- - handoffs are vague
57
- - implementers verify their own work
58
- - verifiers say "looks good" without evidence
59
- - repair work expands scope
60
- - progress disappears after context compaction
61
- - every platform has a different output style
51
+ - receive one scoped dossier
52
+ - perform one role
53
+ - return one structured report
54
+ - do not talk to the human directly
55
+ - do not choose final disposition
56
+ - do not message each other
62
57
 
63
- Workflow Supervisor solves this by making the workflow explicit and resumable.
58
+ The CLI:
64
59
 
65
- The conversation holds the supervisor. The `.workflow/` artifacts hold durable state. Workers get small, role-specific dossiers instead of the full conversation. Reports come back in one schema.
60
+ - installs the skills
61
+ - validates skill and schema files
62
+ - validates `DossierV1`
63
+ - invokes one worker process
64
+ - validates `WorkerReportV1`
65
+ - returns a normalized report to the supervisor
66
66
 
67
- ## Architecture
68
-
69
- Workflow Supervisor has two halves: a portable skill pack that teaches an agent how to supervise work, and a small npm CLI that installs those skills, validates contracts, and runs one-shot worker delegations.
70
-
71
- The current chat agent is always the supervisor. It owns intake, planning, source grounding, work-unit boundaries, dossiers, verification decisions, repair routing, and final disposition. The CLI never becomes a workflow daemon or queue. It is a helper that copies skills into supported agent directories, emits portable Markdown context, validates schema-backed artifacts, and invokes a single role-scoped worker process when delegation is authorized.
67
+ It is not a daemon, queue, dashboard, scheduler, or full agent harness.
72
68
 
73
69
  ```mermaid
74
70
  flowchart TB
75
- User["User"] --> Supervisor["Supervisor agent in current chat"]
76
- Supervisor --> Skills["Installed skills: SKILL.md and agent metadata"]
77
- Supervisor --> State["Durable state: .workflow/ in the target workspace"]
78
- Supervisor --> CLI["workflow-supervisor CLI: bin/workflow-skills.mjs"]
79
-
80
- subgraph Package["npm package"]
81
- SkillsSource["skills/"]
82
- AdapterDefs["adapters/"]
83
- SchemaDefs["schemas/"]
84
- Docs["docs/"]
85
- CLI
86
- end
87
-
88
- CLI --> SkillsSource
89
- CLI --> AdapterDefs
90
- CLI --> SchemaDefs
91
- CLI --> Docs
92
- CLI --> Adapters["Adapter command array"]
93
- Adapters --> Codex["Codex CLI worker"]
94
- Adapters --> Claude["Claude Code CLI worker"]
95
- Codex --> Report["WorkerReportV1 JSON"]
71
+ User["User"] --> Supervisor["Supervisor agent in the current chat"]
72
+ Supervisor --> Intake["Complete intake"]
73
+ Supervisor --> Sources["Source corpus"]
74
+ Supervisor --> Units["Work units"]
75
+ Supervisor --> Matrix["Acceptance matrix"]
76
+ Supervisor --> Dossiers["DossierV1 files"]
77
+ Supervisor --> CLI["workflow-supervisor CLI"]
78
+ CLI --> Codex["Codex worker"]
79
+ CLI --> Claude["Claude Code worker"]
80
+ Codex --> Report["WorkerReportV1"]
96
81
  Claude --> Report
97
82
  Report --> Supervisor
83
+ Supervisor --> Docs[".workflow/ state"]
84
+ Supervisor --> Outcome["Final report"]
98
85
  ```
99
86
 
100
- The package layout is intentionally simple:
101
-
102
- - `skills/` contains the opt-in supervisor skills and OpenAI metadata prompts.
103
- - `bin/workflow-skills.mjs` contains the installer, validator, context emitter, delegation wrapper, surface guard, and command dispatch.
104
- - `schemas/` defines `DossierV1` and `WorkerReportV1`.
105
- - `adapters/` defines certified Codex and Claude Code command arrays.
106
- - `docs/` explains CLI usage, portable delegation semantics, compatibility, artifacts, and troubleshooting.
107
- - `.workflow/` is created in consuming projects as private supervisor working memory, not as package state.
108
-
109
- ```mermaid
110
- flowchart LR
111
- Package["workflow-supervisor package"] --> Install["install"]
112
- Package --> Emit["emit-context"]
113
- Package --> Validate["validate and validate-dossier"]
114
- Package --> Delegate["delegate and delegate-doctor"]
115
-
116
- Install --> CodexTarget["Codex target: ~/.agents/skills or project .agents/skills"]
117
- Install --> ClaudeTarget["Claude target: ~/.claude/skills or project .claude/skills"]
118
- Install --> Gitignore["Project .gitignore contains .workflow/"]
119
-
120
- Emit --> PortableFile["Portable context file: AGENTS.md or CLAUDE.md"]
121
- Validate --> SkillGate["Skill, schema, adapter, and dossier gates"]
122
- Delegate --> WorkerRun["One role-scoped worker CLI process"]
123
- ```
124
-
125
- Delegation is a guarded subprocess, not an open-ended conversation between agents. The supervisor creates a concrete `DossierV1`, the CLI validates it before any worker starts, the adapter receives a role-scoped prompt and the `WorkerReportV1` schema, and the wrapper normalizes failure modes into structured `BLOCKED` reports.
87
+ ## What Happens When You Invoke It
126
88
 
127
- ```mermaid
128
- sequenceDiagram
129
- participant S as Supervisor
130
- participant C as "workflow-supervisor delegate"
131
- participant D as "DossierV1 validator"
132
- participant G as "Surface guard"
133
- participant A as "Agent adapter"
134
- participant W as "Worker CLI"
135
-
136
- S->>C: Role, unit ID, workspace, dossier path
137
- C->>D: Parse JSON, YAML, or fenced YAML
138
- D-->>C: Valid dossier or BLOCKED invalid_dossier
139
- C->>G: Snapshot git status or explicit surfaces
140
- C->>A: Build command from adapters/<agent>/adapter.json
141
- A->>W: Run one CLI process with role prompt and schema
142
- W-->>A: stdout, stderr, exit code, timeout signal
143
- A-->>C: Raw worker output
144
- C->>C: Extract and validate WorkerReportV1
145
- C->>G: Compare after-state against allowed and forbidden surfaces
146
- C-->>S: PASS, FAIL, or normalized BLOCKED WorkerReportV1
147
- ```
89
+ When you explicitly invoke `workflow-supervisor`, `$workflow-supervisor`, or say to use the skill, the workflow enters `strict_full_workflow`.
148
90
 
149
- The supervisor loop is therefore stateful at the workflow level but stateless at the worker level. Every worker run is fresh, bounded by one dossier, and reduced back to one report before the supervisor decides the next step.
150
-
151
- ```mermaid
152
- stateDiagram-v2
153
- [*] --> Intake
154
- Intake --> SourceGrounding: Complete intake
155
- SourceGrounding --> WorkUnits: Sources ranked
156
- WorkUnits --> AcceptanceMatrix: Units bounded
157
- AcceptanceMatrix --> Dossier: Evidence rows ready
158
- Dossier --> Delegation: DossierV1 valid
159
- Delegation --> Verification: WorkerReportV1 returned
160
- Verification --> Repair: FAIL or actionable BLOCKED
161
- Repair --> Verification: Repair report returned
162
- Verification --> Documentation: PASS with evidence
163
- Documentation --> FinalDisposition: Outcome recorded
164
- FinalDisposition --> [*]
165
- Dossier --> Intake: Missing decision
166
- Delegation --> Intake: Worker BLOCKED with human question
167
- ```
91
+ Strict mode means task size does not matter. Even if the request is "make a function that adds two numbers", explicit supervisor invocation still means the full workflow:
168
92
 
169
- ## What It Is Used For
93
+ 1. Ask the complete intake packet.
94
+ 2. Build or record the source corpus.
95
+ 3. Create at least one work unit.
96
+ 4. Create acceptance rows.
97
+ 5. Create dossiers for the planned workers.
98
+ 6. Create a worker-agent plan.
99
+ 7. Ask for approval when the selected path is human-in-loop.
100
+ 8. Delegate scoped work to real workers when the environment supports it.
101
+ 9. Verify with evidence.
102
+ 10. Route repair work if verification fails.
103
+ 11. Refresh docs or outcome state.
104
+ 12. Report final status and next action.
170
105
 
171
- Use it for work that is:
106
+ This rule exists to prevent the agent from deciding that a task is "too simple" and quietly skipping the supervisor.
172
107
 
173
- - broad or ambiguous
174
- - multi-step
175
- - high-risk
176
- - likely to need repair loops
177
- - likely to exceed one context window
178
- - important enough to require independent verification
179
- - easier to handle as several bounded units
108
+ ## Intake
180
109
 
181
- Good examples:
110
+ The supervisor must get explicit answers to these seven items before planning deeply, creating a goal, delegating workers, implementing, publishing, or taking irreversible action:
182
111
 
183
- - migrate SQLite storage to LanceDB
184
- - refactor authentication across several modules
185
- - update docs from a new API spec
186
- - implement a feature with tests and verification
187
- - review and repair a messy PR
188
- - produce durable workflow docs for a long-running task
112
+ ```text
113
+ 1. Objective and source: what artifact, spec, repo path, document, ticket, or source set controls the work?
114
+ 2. Execution path: autonomous_goal or human_in_loop?
115
+ 3. Mode: sequential, parallel where safe, or staged parallel?
116
+ 4. Delegation: automated worker delegation, native threads/subagents if available, or same-session phased?
117
+ 5. Final disposition: keep local, open PR, push main, deploy/publish, or ask at the end?
118
+ 6. Boundaries: may I install dependencies, call external services, use credentials, or only edit local files?
119
+ 7. State artifacts: create .workflow docs, use another artifact directory, or keep state inline?
120
+ ```
189
121
 
190
- Do not use it for:
122
+ If any answer is missing or vague, the supervisor asks only for the missing pieces and stops. Phrases like "work autonomously", "just do it", or "use your judgment" do not fill in the missing intake fields.
191
123
 
192
- - tiny edits
193
- - one-off shell commands
194
- - obvious single-file changes
195
- - quick explanations
196
- - tasks where a normal agent turn is enough
124
+ Expected human pauses are normal. A workflow can move from `WAITING_FOR_HUMAN` back to `ACTIVE` after the user approves a plan or answers a blocker question.
197
125
 
198
- ## How It Works
126
+ ## The Workflow
199
127
 
200
- The lifecycle is:
128
+ The full loop looks like this:
201
129
 
202
130
  ```text
203
- intake
204
- -> source grounding
131
+ complete intake
132
+ -> source corpus
205
133
  -> work units
134
+ -> loop policy
206
135
  -> acceptance matrix
207
- -> DossierV1
208
- -> worker delegation
209
- -> WorkerReportV1
136
+ -> dossiers
137
+ -> approval or autonomous path gate
138
+ -> worker handoff
139
+ -> worker report
210
140
  -> verification
211
141
  -> repair if needed
212
142
  -> re-verification
@@ -214,257 +144,389 @@ intake
214
144
  -> final disposition
215
145
  ```
216
146
 
217
- ### 1. Intake
218
-
219
- The supervisor must ask the user for every required decision before it plans deeply or starts work:
147
+ The worker lifecycle is tracked separately:
220
148
 
221
149
  ```text
222
- 1. Objective and source
223
- 2. Execution path: autonomous_goal or human_in_loop
224
- 3. Mode: sequential, parallel where safe, or staged parallel
225
- 4. Delegation: automated workers, native subagents if available, or same-session phased
226
- 5. Final disposition: keep local, open PR, push, deploy, publish, or ask at end
227
- 6. Boundaries: installs, network, credentials, destructive operations, forbidden surfaces
228
- 7. State artifacts: .workflow docs, another directory, or inline state
150
+ planned -> handed_off -> acknowledged -> reported -> verified -> closed
229
151
  ```
230
152
 
231
- If any answer is missing or vague, the supervisor asks again and stops.
153
+ This makes it possible to see where the workflow is, which worker owns which piece, what evidence exists, and what should happen next.
232
154
 
233
- ### 2. Source Grounding
155
+ ## Skills In The Pack
234
156
 
235
- The supervisor identifies the source of truth: files, specs, docs, tickets, user decisions, commands, or external constraints.
157
+ The skill pack is made of small focused skills. The supervisor can use them as phase instructions.
236
158
 
237
- If source authority is unclear, the first work unit becomes discovery instead of implementation.
159
+ | Skill | What it does |
160
+ |---|---|
161
+ | `workflow-supervisor` | Coordinates the whole workflow, gates, workers, verification, repair, and final disposition. |
162
+ | `source-corpus` | Lists and ranks sources, gaps, contradictions, authority, freshness, and allowed next action. |
163
+ | `work-unit` | Turns the objective into bounded units with dependencies, surfaces, readiness, and done criteria. |
164
+ | `loop-policy` | Defines execution path, mode, approval gates, repair limits, budgets, goal policy, and resume behavior. |
165
+ | `acceptance-matrix` | Turns requirements into evidence rows with PASS, FAIL, BLOCKED, and waiver handling. |
166
+ | `dossier-builder` | Creates concrete `DossierV1` contracts for workers. |
167
+ | `worker-roles` | Defines role boundaries so implementers, verifiers, repair authors, and documenters do not blur together. |
168
+ | `workflow-docs` | Creates or refreshes durable `.workflow/` artifacts when state needs to persist. |
238
169
 
239
- ### 3. Work Units
170
+ Loading a skill does not spawn a worker. A skill is instruction context for the current supervisor. A worker is a separate role-scoped execution run.
240
171
 
241
- The supervisor splits the objective into bounded units.
172
+ ## Files The Workflow Creates
242
173
 
243
- For a SQLite to LanceDB migration, units might be:
174
+ Workflow state lives under `.workflow/` by default. The directory is local supervisor memory, not product code.
175
+
176
+ In a Git-backed project, `.workflow/` must be in `.gitignore` before these files are written. Project installs do this automatically.
177
+
178
+ Common workflow files:
179
+
180
+ | File | Created from | Purpose |
181
+ |---|---|---|
182
+ | `.workflow/WORKFLOW.md` | `workflow-supervisor`, `loop-policy`, `workflow-docs` | Main state, objective, execution path, policy, stop gates, next action. |
183
+ | `.workflow/SOURCE-CORPUS.md` | `source-corpus`, `workflow-docs` | Source ranking, missing sources, contradictions, assumptions. |
184
+ | `.workflow/WORK-UNITS.md` | `work-unit`, `workflow-docs` | Unit list, dependencies, sequencing, blocked units. |
185
+ | `.workflow/DOSSIER.md` or `.workflow/dossiers/*.yaml` | `dossier-builder`, `workflow-docs` | Worker contracts for implementation, verification, repair, or documentation. |
186
+ | `.workflow/WORKER-MAP.md` | `workflow-supervisor`, `worker-roles`, `workflow-docs` | Worker names, roles, transports, lifecycle, reports, blockers. |
187
+ | `.workflow/ACCEPTANCE-MATRIX.md` | `acceptance-matrix`, `workflow-docs` | Evidence rows and material PASS, FAIL, BLOCKED states. |
188
+ | `.workflow/VERIFICATION-REPORT.md` | verifier worker, `acceptance-matrix`, `workflow-docs` | Verification evidence, findings, skipped checks, residual risks. |
189
+ | `.workflow/REPAIR-TICKETS.md` | repair worker, `workflow-docs` | Repair tasks tied to failed rows or verifier findings. |
190
+ | `.workflow/DECISIONS.md` | supervisor, `workflow-docs` | User decisions, assumptions, reversals, unresolved questions. |
191
+ | `.workflow/HANDOFF.md` | supervisor, `workflow-docs` | Resume pack for another agent or later session. |
192
+ | `.workflow/OUTCOME.md` | supervisor, documenter worker, `workflow-docs` | Final status, checks, risks, disposition, next action. |
193
+ | `.workflow/GOAL-STATE.md` | supervisor, `workflow-docs` | Codex goal mirror when goal state needs durable backup. |
194
+
195
+ For documentation-heavy workflows, `workflow-docs` can also create:
244
196
 
245
197
  ```text
246
- U1 dependency and config
247
- U2 storage adapter
248
- U3 data migration path
249
- U4 tests and regression checks
250
- U5 docs and outcome report
198
+ .workflow/DOCUMENTATION-BRIEF.md
199
+ .workflow/CONTENT-INVENTORY.md
200
+ .workflow/OUTLINE.md
201
+ .workflow/CONTENT-DRAFT.md
202
+ .workflow/CLAIMS-REGISTER.md
203
+ .workflow/STYLE-GUIDE.md
204
+ .workflow/GLOSSARY.md
205
+ .workflow/ASSET-REGISTER.md
206
+ .workflow/REVIEW-PLAN.md
207
+ .workflow/REVISION-QUEUE.md
208
+ .workflow/PUBLISHING-CHECKLIST.md
209
+ .workflow/PUBLICATION-LOG.md
210
+ .workflow/MAINTENANCE-PLAN.md
251
211
  ```
252
212
 
253
- ### 4. DossierV1
213
+ It should not create all of these by default. It should create the smallest useful set.
254
214
 
255
- Before any worker starts, the supervisor creates a concrete `DossierV1`.
215
+ ## Dossiers
256
216
 
257
- A dossier names:
217
+ A dossier is the worker contract. It is how the supervisor prevents vague delegation.
258
218
 
259
- - the exact work unit
260
- - the worker role
219
+ Before any worker starts, the supervisor creates a concrete `DossierV1` with:
220
+
221
+ - workflow name
222
+ - work unit
223
+ - dossier id
224
+ - worker name
225
+ - worker role
226
+ - delegation transport
227
+ - start condition
228
+ - objective and non-goals
229
+ - source corpus and must-read sources
261
230
  - allowed surfaces
262
231
  - forbidden surfaces
263
- - must-read sources
264
232
  - acceptance rows
265
- - required evidence
266
233
  - adversarial checks
234
+ - required commands or evidence
235
+ - worker prompt
236
+ - supervisor checkpoints
237
+ - report schemas
267
238
  - stop gates
268
- - required report schema
239
+ - assumptions
240
+ - open questions
269
241
 
270
- Then the package validates it:
242
+ Validate a dossier before delegation:
271
243
 
272
244
  ```bash
273
- workflow-supervisor validate-dossier .workflow/dossiers/U2-implementer.yaml --role implementer --unit U2 --json
245
+ workflow-supervisor validate-dossier .workflow/dossiers/WU-001-implementer.yaml --role implementer --unit WU-001 --json
274
246
  ```
275
247
 
276
- If the dossier says `all files`, `TBD`, `unknown`, `as needed`, or leaves open questions unresolved, it fails. No worker starts.
248
+ The validator rejects things like `TBD`, `unknown`, `all files`, `entire repo`, unresolved open questions, role mismatches, unit mismatches, missing forbidden surfaces, and prompts that do not require `WorkerReportV1`.
277
249
 
278
- ### 5. Worker Delegation
250
+ ## Workers
279
251
 
280
- The supervisor launches one role-scoped worker through Codex or Claude Code.
252
+ The required worker responsibilities are:
281
253
 
282
- ```bash
283
- workflow-supervisor delegate --agent codex --role implementer --unit U2 --dossier .workflow/dossiers/U2-implementer.yaml
284
- ```
254
+ | Responsibility | CLI role value | What it does |
255
+ |---|---|---|
256
+ | Implementer | `implementer` | Changes only the allowed surfaces named in the dossier. |
257
+ | Verifier | `verifier` | Checks the work against acceptance rows and must not edit implementation. |
258
+ | Repair author | `repair` | Converts failed rows or verifier findings into actionable repair work. |
259
+ | Documenter | `documenter` | Updates workflow or outcome docs from evidence. |
285
260
 
286
- The worker does not get the whole chat. It receives the dossier and report schema.
261
+ The skill text may say "repair-author" because that is the human role. The CLI schema uses `repair`.
287
262
 
288
- ### 6. Verification And Repair
263
+ Workers receive only their scoped handoff:
289
264
 
290
- A verifier checks the implementer's work against acceptance rows.
265
+ - role
266
+ - dossier
267
+ - sources
268
+ - acceptance rows
269
+ - stop gates
270
+ - report schema
271
+
272
+ They return one terminal `WorkerReportV1`.
273
+
274
+ ## Worker Reports
275
+
276
+ Every delegated worker returns this machine-shaped report:
277
+
278
+ ```json
279
+ {
280
+ "schema": "WorkerReportV1",
281
+ "status": "PASS",
282
+ "role": "verifier",
283
+ "unit_id": "WU-001",
284
+ "summary": "Verified the API responses and retrieval behavior against the acceptance rows.",
285
+ "changed_surfaces": [],
286
+ "evidence": ["pytest tests/test_api.py passed", "manual inspection of /health response"],
287
+ "checks_run": ["pytest tests/test_api.py"],
288
+ "skipped_checks": [],
289
+ "findings": [],
290
+ "blocking_question": null,
291
+ "next_action": "supervisor_review",
292
+ "adapter": null,
293
+ "guard": null,
294
+ "reason": null
295
+ }
296
+ ```
291
297
 
292
- If verification fails, the supervisor creates repair work. Repairs must point back to verifier findings or acceptance rows. After repair, verification runs again.
298
+ The supervisor trusts the report shape, not loose prose. A PASS without evidence is invalid. A verifier that edits implementation is invalid. A worker that asks the human directly is converted into a blocker for the supervisor to route.
293
299
 
294
- ### 7. Final Disposition
300
+ ## How The Supervisor Talks To Workers
295
301
 
296
- The supervisor applies the final disposition chosen during intake:
302
+ The portable worker path is one CLI command:
297
303
 
298
- - keep changes local
299
- - open a PR
300
- - push
301
- - deploy
302
- - publish
303
- - ask at the end
304
+ ```bash
305
+ workflow-supervisor delegate \
306
+ --agent <codex|claude-code> \
307
+ --role <implementer|verifier|repair|documenter> \
308
+ --unit <unit-id> \
309
+ --cwd <workspace> \
310
+ --dossier <path>
311
+ ```
304
312
 
305
- No final irreversible action is inferred from vibes.
313
+ The command:
306
314
 
307
- ## What The User Sees
315
+ 1. Validates the dossier as `DossierV1`.
316
+ 2. Builds a scoped worker prompt.
317
+ 3. Starts the selected agent CLI with an adapter command array.
318
+ 4. Captures stdout, stderr, exit code, and timeout.
319
+ 5. Extracts and validates `WorkerReportV1`.
320
+ 6. Runs surface and role guards.
321
+ 7. Prints one normalized JSON report for the supervisor.
308
322
 
309
- The user sees the supervisor, not worker chatter.
323
+ Certified worker adapters:
310
324
 
311
- In `human_in_loop`, the user sees:
325
+ - `codex`
326
+ - `claude-code`
312
327
 
313
- ```text
314
- intake question
315
- approval packet
316
- progress summaries
317
- blocker questions if needed
318
- final report
328
+ The `generic` target is for Markdown instruction export. It is not a certified automated worker adapter.
329
+
330
+ Check local adapter readiness:
331
+
332
+ ```bash
333
+ workflow-supervisor delegate-doctor --agent all --probe --require-pass
319
334
  ```
320
335
 
321
- In `autonomous_goal`, the user sees:
336
+ If a worker adapter is missing, unauthenticated, times out, returns invalid output, edits forbidden surfaces, or returns PASS without evidence, the delegate command returns a structured `BLOCKED` report.
337
+
338
+ ## No Silent Fallbacks
339
+
340
+ If the environment can create, message, or delegate to worker agents, the supervisor must use real workers for implementation, verification, repair, and documentation responsibilities.
341
+
342
+ If it cannot, it must record:
322
343
 
323
344
  ```text
324
- intake question
325
- execution plan
326
- periodic progress summaries
327
- blockers only when needed
328
- final report
345
+ worker_agent_unavailable
329
346
  ```
330
347
 
331
- Workers do not ask the user questions directly. They return `BLOCKED` and the supervisor decides how to route it.
348
+ Then it must stop for a human decision unless complete intake explicitly selected `same_session_phased`.
349
+
350
+ Same-session phased work is allowed only when selected. Verification in that mode is a `self-check`, not an `independent-verifier`.
332
351
 
333
- ## What The Output Is
352
+ ## Install
334
353
 
335
- Workflow Supervisor produces three kinds of output.
354
+ Install from npm once published:
336
355
 
337
- ### 1. Durable Workflow State
356
+ ```bash
357
+ npm install -g workflow-supervisor
358
+ workflow-supervisor validate
359
+ ```
338
360
 
339
- Usually under `.workflow/`:
361
+ Use with `npx`:
340
362
 
341
- ```text
342
- WORKFLOW.md
343
- SOURCE-CORPUS.md
344
- WORK-UNITS.md
345
- DOSSIER.md
346
- WORKER-MAP.md
347
- ACCEPTANCE-MATRIX.md
348
- VERIFICATION-REPORT.md
349
- REPAIR-TICKETS.md
350
- DECISIONS.md
351
- HANDOFF.md
352
- OUTCOME.md
353
- GOAL-STATE.md
363
+ ```bash
364
+ npx workflow-supervisor list
354
365
  ```
355
366
 
356
- These files make the workflow resumable after context compaction or handoff.
367
+ Install skills for Codex:
357
368
 
358
- ### 2. Worker Reports
369
+ ```bash
370
+ npx workflow-supervisor install --agent codex --scope user
371
+ ```
359
372
 
360
- Every worker returns `WorkerReportV1`:
373
+ Install skills for Claude Code:
361
374
 
362
- ```json
363
- {
364
- "schema": "WorkerReportV1",
365
- "status": "PASS",
366
- "role": "verifier",
367
- "unit_id": "U2",
368
- "summary": "Verified LanceDB-backed search path.",
369
- "changed_surfaces": [],
370
- "evidence": ["pytest tests/test_search.py passed"],
371
- "checks_run": ["pytest tests/test_search.py"],
372
- "skipped_checks": [],
373
- "findings": [],
374
- "blocking_question": null,
375
- "next_action": "supervisor_review",
376
- "adapter": null,
377
- "guard": null,
378
- "reason": null
379
- }
375
+ ```bash
376
+ npx workflow-supervisor install --agent claude-code --scope user
380
377
  ```
381
378
 
382
- ### 3. Final Supervisor Report
379
+ Install both certified targets into a project:
383
380
 
384
- The final report names:
381
+ ```bash
382
+ npx workflow-supervisor install --agent all --scope project --project .
383
+ ```
385
384
 
386
- - execution path
387
- - goal status
388
- - sources used
389
- - work units completed
390
- - workers delegated
391
- - checks run
392
- - skipped checks
393
- - repairs performed
394
- - residual risks
395
- - final disposition
396
- - next action
385
+ Project installs copy the skill folders into project-level agent directories and ensure the target project `.gitignore` contains:
397
386
 
398
- ## How To Install
387
+ ```gitignore
388
+ .workflow/
389
+ ```
399
390
 
400
391
  From a local checkout:
401
392
 
402
393
  ```bash
403
394
  git clone https://github.com/NikolaCehic/workflow-supervisor.git
404
395
  cd workflow-supervisor
396
+ npm install
405
397
  npm run validate
406
398
  ```
407
399
 
408
- Install for Codex:
400
+ ## Basic Use
409
401
 
410
- ```bash
411
- npx workflow-supervisor install --agent codex --scope user
402
+ After installing the skills, ask your agent:
403
+
404
+ ```text
405
+ Use $workflow-supervisor to implement a healthcare specialist FastAPI Naive RAG demo.
412
406
  ```
413
407
 
414
- Install for Claude Code:
408
+ You should expect:
409
+
410
+ 1. The supervisor asks the complete intake packet.
411
+ 2. You answer every intake item.
412
+ 3. If the path is `human_in_loop`, the supervisor gives you an approval packet before implementation.
413
+ 4. The supervisor creates work units, acceptance rows, and dossiers.
414
+ 5. The supervisor delegates scoped work to workers when supported.
415
+ 6. Workers return structured reports.
416
+ 7. The supervisor verifies, routes repairs if needed, and gives you the final result.
417
+
418
+ If you only want a normal quick edit, do not invoke `$workflow-supervisor`.
419
+
420
+ ## CLI Reference
421
+
422
+ Common commands:
415
423
 
416
424
  ```bash
417
- npx workflow-supervisor install --agent claude-code --scope user
425
+ workflow-supervisor list
426
+ workflow-supervisor validate
427
+ workflow-supervisor doctor --agent all
428
+ workflow-supervisor install --agent codex --scope user
429
+ workflow-supervisor install --agent claude-code --scope user
430
+ workflow-supervisor install --agent all --scope project --project .
431
+ workflow-supervisor emit-context --agent generic --out AGENTS.md
432
+ workflow-supervisor validate-dossier .workflow/dossiers/WU-001-implementer.yaml --role implementer --unit WU-001 --json
433
+ workflow-supervisor delegate --agent codex --role implementer --unit WU-001 --cwd . --dossier .workflow/dossiers/WU-001-implementer.yaml
434
+ workflow-supervisor delegate --agent claude-code --role verifier --unit WU-001 --cwd . --dossier .workflow/dossiers/WU-001-verifier.yaml
435
+ workflow-supervisor delegate-doctor --agent all --probe --require-pass
418
436
  ```
419
437
 
420
- Install for both in a project:
438
+ The package exposes two binary names:
421
439
 
422
- ```bash
423
- npx workflow-supervisor install --agent all --scope project --project .
440
+ ```text
441
+ workflow-supervisor
442
+ workflow-skills
424
443
  ```
425
444
 
426
- Project installs also add `.workflow/` to the target project's `.gitignore`. Workflow state is local working memory by default; it should not be pushed with the consuming codebase unless the user explicitly chooses that.
445
+ `workflow-skills` is kept as an alias. Prefer `workflow-supervisor` in user-facing instructions.
446
+
447
+ ## Codex, Claude Code, And Generic Targets
427
448
 
428
- Export generic Markdown instructions:
449
+ Codex support uses:
450
+
451
+ - `SKILL.md`
452
+ - `agents/openai.yaml`
453
+ - the `codex` CLI adapter for delegated workers
454
+
455
+ Claude Code support uses:
456
+
457
+ - the same `SKILL.md` folders
458
+ - the `claude` CLI adapter for delegated workers
459
+ - optional emitted context through `CLAUDE.md`
460
+
461
+ The presence of `agents/openai.yaml` does not mean Claude Code is unsupported. It only means Codex has a specific metadata format.
462
+
463
+ Generic support is for custom Markdown-reading agent setups:
429
464
 
430
465
  ```bash
431
- npx workflow-supervisor emit-context --agent generic --out AGENTS.md
466
+ npx workflow-supervisor emit-context --agent generic --skills workflow-supervisor,workflow-docs --out AGENTS.md
432
467
  ```
433
468
 
434
- ## How To Use
469
+ Generic is not a certified worker delegation target.
435
470
 
436
- In Codex or Claude Code, ask explicitly:
471
+ ## Package Layout
437
472
 
438
473
  ```text
439
- Use $workflow-supervisor to migrate this repo from SQLite to LanceDB.
474
+ skills/ Skill instructions
475
+ skills/*/agents/ Agent metadata, including Codex openai.yaml files
476
+ schemas/ DossierV1 and WorkerReportV1 schemas
477
+ adapters/ Codex and Claude Code delegate command arrays
478
+ docs/ CLI, artifact, compatibility, and troubleshooting docs
479
+ assets/ README image assets
480
+ bin/workflow-skills.mjs Installer, validator, delegation wrapper, and command dispatch
440
481
  ```
441
482
 
442
- The correct next step is not implementation. The correct next step is the intake packet.
483
+ The npm package includes:
484
+
485
+ ```text
486
+ skills
487
+ adapters
488
+ schemas
489
+ docs
490
+ assets
491
+ bin
492
+ README.md
493
+ LICENSE
494
+ ```
443
495
 
444
- After intake is complete, the supervisor proceeds through work units, dossiers, workers, verification, repair, and final disposition.
496
+ ## Publishing Checklist
445
497
 
446
- Useful CLI commands:
498
+ Before publishing:
447
499
 
448
500
  ```bash
449
- workflow-supervisor validate
450
- workflow-supervisor validate-dossier .workflow/dossiers/U2-implementer.yaml --role implementer --unit U2 --json
451
- workflow-supervisor delegate --agent codex --role implementer --unit U2 --dossier .workflow/dossiers/U2-implementer.yaml
452
- workflow-supervisor delegate --agent claude-code --role verifier --unit U2 --dossier .workflow/dossiers/U2-verifier.yaml
453
- workflow-supervisor delegate-doctor --agent all --probe --require-pass
501
+ npm run validate
502
+ npm pack --dry-run
454
503
  ```
455
504
 
456
- ## For Agents
505
+ `npm run validate` checks skill structure, adapter metadata, schema artifacts, and the test suite.
506
+
507
+ `npm pack --dry-run` shows exactly what will be included in the npm package.
508
+
509
+ The package also has:
510
+
511
+ - `prepublishOnly`: runs `npm run validate`
512
+ - `engines.node`: `>=18`
513
+ - `license`: `MIT`
514
+ - `bin.workflow-supervisor`: `bin/workflow-skills`
515
+ - `bin.workflow-skills`: `bin/workflow-skills`
516
+
517
+ ## Rules For Agents Reading This README
457
518
 
458
- If you are an AI agent reading this README, follow these rules:
519
+ If you are an agent using this package:
459
520
 
460
521
  1. Do not start work before complete intake.
461
- 2. Do not infer missing permissions from user intent.
462
- 3. Do not delegate without a valid `DossierV1`.
463
- 4. Do not accept worker prose as completion.
464
- 5. Trust only `WorkerReportV1` reports.
465
- 6. Treat verifier edits as invalid.
466
- 7. Ask the user only through the supervisor.
467
- 8. Before creating `.workflow/` in a codebase, ensure `.gitignore` contains `.workflow/`.
468
- 9. Preserve enough `.workflow/` state for another agent to resume, but do not stage or publish it unless explicitly requested.
469
-
470
- The point is not to add ceremony. The point is to make complex agent work hard to derail.
522
+ 2. Do not infer missing permissions from words like "autonomous", "generate", or "work until done".
523
+ 3. If `$workflow-supervisor` is explicit, always create at least one work unit.
524
+ 4. Do not delegate without a valid `DossierV1`.
525
+ 5. Use separate worker agents when supported by the environment.
526
+ 6. Do not silently collapse worker agents into same-session roleplay.
527
+ 7. Treat same-session verification as `self-check`, not `independent-verifier`.
528
+ 8. Trust only structured `WorkerReportV1` results from delegated workers.
529
+ 9. Treat verifier edits as invalid.
530
+ 10. Keep `.workflow/` ignored and local unless the user explicitly asks to publish it.
531
+
532
+ The promise is not magic autonomy. The promise is disciplined supervision: clear setup, bounded work, scoped workers, structured reports, evidence, repair, and a clean final handoff.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "workflow-supervisor",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Portable workflow supervision skills for Codex, Claude Code, and generic agent workspaces.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,11 +1,34 @@
1
1
  ---
2
2
  name: workflow-supervisor
3
- description: Coordinate open-ended, multi-step agent workflows when the user explicitly requests supervised or agent-loop coordination and at least one hard trigger is present, or when no explicit supervisor wording exists but two or more hard triggers are present. Hard triggers include multi-agent or worker delegation, durable resume need, high-risk independent verification, contradictory or missing sources, multi-unit scope, repair loops, approval gates, or workflow-state documentation. Do not use for simple single-turn answers, ordinary repo inspection, medium scoped edits, typo fixes, one-off tests, or narrowly scoped changes that can be completed directly.
3
+ description: Coordinate supervised multi-agent workflows. Trigger whenever the user explicitly invokes workflow-supervisor, $workflow-supervisor, supervised workflow, dossiers, work units, worker agents, handoffs, approval gates, durable resume, or workflow-state documentation. When explicitly invoked, always run the full strict supervisor workflow regardless of task size; do not downscope, skip human approval or complete intake, skip dossiers, skip work units, skip worker-agent contracts, skip worker handoffs, or skip verification because a task appears simple. When not explicitly invoked, use only for workflows with hard supervisor triggers such as multi-agent handoff, durable resume, high-risk verification, contradictory or missing sources, multi-unit scope, repair loops, approval gates, or workflow-state documentation.
4
4
  ---
5
5
 
6
6
  # Workflow Supervisor
7
7
 
8
- Use this skill as the coordinating spine for complex work. The supervisor owns decomposition, delegation quality, loop discipline, stop gates, and outcome reporting. It may do source discovery and reporting itself, but implementation, verification, repair-ticket writing, and documentation should be treated as separate roles when an automated worker path is available. Native threads or subagents are optional transport optimizations, not the workflow contract.
8
+ Use this skill as the coordinating spine for supervised multi-agent work. The supervisor owns decomposition, worker-agent handoff quality, loop discipline, stop gates, and outcome reporting. It may do source discovery and reporting itself, but implementation, verification, repair-ticket writing, and documentation must be treated as separate worker-agent responsibilities when an automated worker path is available. Native threads, subagents, or the portable delegate command are transports for those worker agents.
9
+
10
+ ## Strict Explicit Invocation Contract
11
+
12
+ When the user explicitly invokes `workflow-supervisor`, `$workflow-supervisor`, or says to use this skill, the workflow is in `strict_full_workflow` mode. Task size is irrelevant. Do not decide that a request is too small, too easy, local-only, or single-file to receive the full workflow.
13
+
14
+ Strict mode always requires:
15
+
16
+ 1. Complete intake before planning, goal creation, worker delegation, implementation, publication, or irreversible action.
17
+ 2. A human approval question before implementation unless completed intake explicitly selects `autonomous_goal`.
18
+ 3. A source corpus map, even if the source corpus is only "user prompt plus current workspace".
19
+ 4. At least one bounded work unit, even for a tiny change. Use `WU-001` when there is only one unit.
20
+ 5. A dossier for each implementation work unit before implementation begins.
21
+ 6. An acceptance matrix or acceptance draft with evidence expectations before implementation begins.
22
+ 7. A worker-agent plan with implementer, verifier, repair-author, and documenter agents.
23
+ 8. A worker lifecycle record using `planned -> handed_off -> acknowledged -> reported -> verified -> closed`.
24
+ 9. Verification labeled as `self-check`, `focused-check`, or `independent-verifier`.
25
+ 10. A final disposition question or recorded completed-intake final disposition after verification.
26
+
27
+ Worker agents are mandatory when the environment provides worker, subagent, thread, or portable delegation tools. The supervisor must hand off implementation, verification, repair-authoring when needed, and documentation to separate agents with scoped dossiers and the required report schema. Run worker agents sequentially by default unless completed intake explicitly authorizes parallelism.
28
+
29
+ If the environment cannot create, message, or delegate to worker agents, record `worker_agent_unavailable` and stop for the human decision unless completed intake explicitly selected `same_session_phased`. Do not silently collapse worker agents into same-session work.
30
+
31
+ Do not nest supervisors recursively. A worker agent that receives a supervisor-scoped dossier must perform its assigned role instead of spawning another supervisor layer unless the parent supervisor explicitly asks for a child supervisor.
9
32
 
10
33
  ## Domain Neutrality
11
34
 
@@ -25,7 +48,7 @@ Use this lifecycle:
25
48
  4. If an active relevant goal exists, reuse it.
26
49
  5. If an active unrelated goal exists, do not create, reuse, complete, block, or update it. Ask the user whether to switch goals or continue with goal binding skipped.
27
50
  6. If no active goal exists and completed intake authorizes goal binding, call `create_goal` at most once with a concrete objective.
28
- 7. Do not create a goal for simple single-turn answers, ordinary scoped edits, tiny tasks, incomplete intake, or when the user says not to.
51
+ 7. Do not create a goal for incomplete intake or when the user says not to.
29
52
  8. Keep the goal objective stable. Track tactical steps in the plan, dossier, workflow docs, or `.workflow/GOAL-STATE.md` rather than trying to rewrite the goal.
30
53
  9. Use `update_goal` only for terminal `complete` or `blocked` states when the environment supports that action.
31
54
  10. Mark the goal complete only after acceptance evidence supports completion and no required supervisor work remains.
@@ -41,12 +64,13 @@ If the environment has no goal tool or goal creation is not permitted, state the
41
64
  - Run the complete intake gate before goal creation, worker delegation, implementation, publication, or other irreversible action.
42
65
  - Do not infer execution path, mode, delegation, final disposition, or boundaries from keywords, action verbs, or intent guesses.
43
66
  - Classify the workflow as `autonomous_goal` or `human_in_loop` only from completed intake answers before delegating workers or beginning implementation.
67
+ - Explicit invocation always requires complete intake, work units, dossiers, worker-agent contracts, scoped handoffs, report schema, and verification; do this even for trivial tasks.
44
68
  - Always produce a plan after complete intake. In `human_in_loop`, make it an approval packet and stop for approval. In `autonomous_goal`, make it an execution plan and continue only when the completed intake authorizes that path.
45
- - Do not begin implementation until complete intake and the path gate are satisfied, at least one concrete dossier exists, and no stop gate applies.
46
- - Delegate workers only through an automated supported delegation transport after complete intake and the path gate authorize delegation. If no supported transport exists, use same-session phased mode only when intake allowed it; otherwise stop as `delegation_unavailable`.
69
+ - Do not begin implementation until complete intake and the path gate are satisfied, at least one work unit exists, at least one concrete dossier exists, worker-agent contracts exist, and no stop gate applies.
70
+ - Delegate workers only through an automated supported delegation transport after complete intake and the path gate authorize delegation. If no supported transport exists, use same-session phased mode only when intake allowed it; otherwise stop as `worker_agent_unavailable`.
47
71
  - Do not start implementer, verifier, repair-author, or documenter workers before complete intake and the path gate are satisfied; role-specific start conditions are additional gates after that.
48
72
  - Keep roles separate: implementers implement, verifiers verify, repair authors write tickets, documenters update workflow artifacts, and the supervisor coordinates.
49
- - Treat same-session verification as a self-check, not independent verification.
73
+ - Treat same-session verification as a self-check, not independent verification. Separate verifier-agent verification may be labeled `independent-verifier` only when genuinely performed by a separate worker agent or thread.
50
74
  - Prefer explicit PASS/FAIL/BLOCKED states over soft completion language.
51
75
  - Stop instead of improvising when sources are missing, contradictory, materially stale, or too vague to produce acceptance criteria.
52
76
  - Keep provenance optional; require enough outcome detail for another agent to resume.
@@ -64,7 +88,29 @@ Treat these as distinct mechanisms:
64
88
  - Native thread or subagent: an environment-specific transport a worker adapter may use when it is available and authorized.
65
89
  - Same-session phased mode: the current agent performs roles sequentially. Verification in this mode is a self-check, not independent verification.
66
90
 
67
- Start workers only after complete intake and the path gate are satisfied, a concrete dossier exists, the loop policy authorizes delegation, and the environment exposes an automated supported transport. If environment rules require explicit user approval for user-visible native thread creation, obtain it before using that transport. Do not use manual copy/paste handoff as the primary path. If automated delegation is unavailable, mark the unit `delegation_unavailable` unless completed intake explicitly selected same-session phased work.
91
+ Start workers only after complete intake and the path gate are satisfied, at least one work unit exists, a concrete dossier exists, the loop policy authorizes delegation, and the environment exposes an automated supported transport. If environment rules require explicit user approval for user-visible native thread creation, obtain it before using that transport. Do not use manual copy/paste handoff as the primary path. If automated delegation is unavailable, mark the unit `worker_agent_unavailable` unless completed intake explicitly selected same-session phased work.
92
+
93
+ ## Worker Report Schema
94
+
95
+ Every worker report back to the supervisor must use this schema:
96
+
97
+ ```text
98
+ status: PASS | FAIL | BLOCKED | PARTIAL
99
+ worker_id:
100
+ role: implementer | verifier | repair-author | documenter
101
+ work_unit_id:
102
+ dossier_id:
103
+ summary:
104
+ changed_files:
105
+ acceptance_evidence:
106
+ checks_run:
107
+ skipped_checks:
108
+ blockers:
109
+ residual_risks:
110
+ next_recommended_action:
111
+ ```
112
+
113
+ Implementers may edit only allowed surfaces from the dossier. Verifiers must not edit. Repair authors write repair tickets from failed acceptance rows and must not expand scope. Documenters update only approved workflow or documentation surfaces after source, implementation, verification, or repair evidence exists.
68
114
 
69
115
  ## Intake Gate
70
116
 
@@ -109,7 +155,7 @@ Negative example: "Using Workflow Supervisor, generate an API and create the pro
109
155
  2. Restate the objective, constraints, non-goals, known sources, and unknowns from the completed intake.
110
156
  3. Bind or reconcile the Codex goal only after complete intake and only when no unrelated active goal prevents binding.
111
157
  4. Build or request a source corpus map. Use `$source-corpus` when source authority, freshness, or contradictions matter.
112
- 5. Split the objective into bounded work units. Use `$work-unit` for ambiguous or multi-phase goals.
158
+ 5. Split the objective into bounded work units. Use `$work-unit` for ambiguous or multi-phase goals. If the task is tiny, create exactly one work unit named `WU-001`.
113
159
  6. Choose a loop policy before starting work: sequential or parallel, retry limits, approval gates, budgets, goal update cadence, and blocker rules. Use `$loop-policy` when the policy is not obvious.
114
160
  7. Build dossiers for the first implementation units and any planned verification, repair, or documentation workers. Use `$dossier-builder` when delegating work to another agent or when the task has boundaries.
115
161
  8. Assign worker roles with explicit allowed and forbidden behavior. Use `$worker-roles` for multi-agent, native-thread, or portable-worker work.
@@ -184,7 +230,7 @@ workflow-supervisor validate-dossier <path> --role <role> --unit <unit-id> --jso
184
230
 
185
231
  If the dossier does not pass `DossierV1` validation, do not start the worker. Create a discovery dossier, ask for the missing decision, or mark the unit BLOCKED.
186
232
 
187
- Adapters may use native threads, native subagents, or one-shot CLI execution underneath, but the supervisor consumes only the normalized worker report. Use `workflow-supervisor delegate-doctor --agent <agent> --probe` to test the installed local adapter before relying on it for a workflow. If automated delegation is unavailable, mark execution as `delegation_unavailable` unless completed intake selected `same_session_phased`.
233
+ Adapters may use native threads, native subagents, or one-shot CLI execution underneath, but the supervisor consumes only the normalized worker report. Use `workflow-supervisor delegate-doctor --agent <agent> --probe` to test the installed local adapter before relying on it for a workflow. If automated delegation is unavailable, mark execution as `worker_agent_unavailable` unless completed intake selected `same_session_phased`.
188
234
 
189
235
  Name workers deterministically from the workflow, unit, role, and dossier:
190
236
 
@@ -247,6 +293,7 @@ Stop when:
247
293
  - source authority cannot be established
248
294
  - sources contradict each other on a material requirement
249
295
  - the requested scope cannot fit into a bounded work unit
296
+ - mandatory approval packet, work unit, dossier, worker-agent contract, or acceptance matrix is missing
250
297
  - allowed and forbidden surfaces cannot be named
251
298
  - acceptance cannot be verified with evidence
252
299
  - a verifier is asked to edit or an implementer is asked to self-approve
@@ -267,7 +314,10 @@ Report:
267
314
  - Objective handled
268
315
  - Sources used and gaps
269
316
  - Work units completed or remaining
317
+ - Approval question id and whether `WAITING_FOR_HUMAN -> ACTIVE` occurred
318
+ - Dossiers created or missing
270
319
  - Workers delegated, blocked, unavailable, or skipped
320
+ - Worker lifecycle status for each role
271
321
  - Verification evidence
272
322
  - Repairs performed or recommended
273
323
  - Checks run and skipped