workflow-supervisor 0.1.0 → 0.1.1

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,266 +1,470 @@
1
1
  # Workflow Supervisor
2
2
 
3
- Portable workflow skills for supervising messy agent work.
3
+ Workflow Supervisor is a small skill pack and npm helper for making coding agents handle complex work with discipline.
4
4
 
5
- ![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)
5
+ It turns a vague request like:
6
6
 
7
- This repository contains an installable skill pack for Codex, Claude Code, OpenCode, HermesAgent, and other agents that can read Markdown instructions. It is built for work that is too broad, risky, ambiguous, or long-running to handle as one ordinary prompt.
7
+ ```text
8
+ Use workflow-supervisor to migrate the database from SQLite to LanceDB.
9
+ ```
8
10
 
9
- Use it when an agent needs to:
11
+ into a supervised workflow with intake, source grounding, bounded work units, concrete worker dossiers, independent verification, repair loops, and evidence-backed output.
10
12
 
11
- - ground work in source material before acting
12
- - split a fuzzy goal into bounded work units
13
- - create concrete handoffs between agents or threads
14
- - choose between autonomous goal execution and human-in-the-loop execution
15
- - fan out path-gated dossiers into named worker threads
16
- - separate implementation from verification
17
- - turn acceptance criteria into evidence-backed checks
18
- - control repair loops, retries, budgets, and stop gates
19
- - leave reusable Markdown state so another agent can resume
13
+ It currently supports certified automated worker delegation for **Codex** and **Claude Code**.
20
14
 
21
- Do not use it for tiny edits, one-off commands, ordinary README wording, or a task that already has clear files and clear acceptance criteria.
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)
22
16
 
23
- ## The Idea
17
+ ## What It Is
24
18
 
25
- The pack treats open-ended work as a supervised loop:
19
+ Workflow Supervisor is not another agent product. It is a thin coordination layer for agents that already exist.
26
20
 
27
- ```text
28
- sources -> work units -> execution path -> named threads -> verification -> repair -> disposition
29
- ```
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.
30
22
 
31
- `$workflow-supervisor` is the spine. The other skills are phase tools the supervisor can call when the workflow needs more structure.
23
+ Workers are short-lived CLI runs:
32
24
 
33
- ```text
34
- source-corpus
35
- |
36
- workflow-supervisor --+-- work-unit
37
- | |
38
- | +-- dossier-builder
39
- | |
40
- | +-- worker-roles
41
- | |
42
- | +-- acceptance-matrix
43
- | |
44
- | +-- loop-policy
45
- |
46
- +-- workflow-docs
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
47
28
  ```
48
29
 
49
- The goal is not bureaucracy. The goal is to stop agents from drifting, guessing, rubber-stamping their own work, or losing state after a long context window.
30
+ Each worker gets only the context it needs. It returns one structured report. The supervisor remains the coordinator.
50
31
 
51
- ## Execution Paths
32
+ ## The Moat
52
33
 
53
- The supervisor enforces complete intake before it chooses a path or starts work:
34
+ The moat is not a clever prompt. The moat is the set of gates that prevent agents from drifting.
54
35
 
55
- - `human_in_loop`: after complete intake, the agent produces an approval packet first, then waits for a human decision before implementation, worker thread creation, publication, direct push, or other irreversible action.
56
- - `autonomous_goal`: after complete intake, the agent can continue through planning, implementation, verification, repair, and final disposition only when the execution-path intake answer selects `autonomous_goal`.
36
+ Workflow Supervisor enforces:
57
37
 
58
- `$workflow-supervisor` does not skip intake from keywords such as "autonomous", "work until done", "approval", "generate", or "create". The user must answer every intake item. If any answer is missing, vague, or delegated to judgment, the supervisor prompts for the unresolved item(s) again and stops before planning or implementation.
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
59
46
 
60
- Both paths use the same core controls after intake: source grounding, bounded work units, dossiers, role separation, acceptance evidence, repair limits, stop gates, and final disposition choices. In Codex-style environments, the supervisor can bind the loop to a goal only after complete intake and any required environment authorization, mirror state into workflow artifacts, and resume without losing the active objective.
47
+ That means the system does not merely ask agents to behave. It blocks unsafe or vague execution before it happens.
61
48
 
62
- The pack is domain-neutral. A "surface" can be a repository path, document section, design, dataset, ticket, process, prompt, or other mutable artifact. When prerequisites are missing, the skills create a discovery or intake unit instead of inventing repo-only requirements.
49
+ ## What It Solves
63
50
 
64
- ## Skills, Threads, And Subagents
51
+ Large agent tasks fail in predictable ways:
65
52
 
66
- Using a skill loads instructions into the current agent. It does not automatically create a new thread, subagent, goal, branch, commit, PR, publication, or other side effect.
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
67
62
 
68
- Worker threads or subagents are separate execution mechanisms. `$workflow-supervisor` may plan them, but creation happens only after the selected execution path is authorized, a concrete dossier exists, the environment exposes the needed tool, and no stop gate applies. If thread or subagent tools are unavailable, the supervisor emits ready-to-send handoff prompts or workflow docs instead.
63
+ Workflow Supervisor solves this by making the workflow explicit and resumable.
69
64
 
70
- In Codex-style environments, user-visible thread creation may require an explicit user request or approval even when the supervisor has prepared a thread plan. Treat same-thread verification as a self-check, not independent verification.
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.
71
66
 
72
- ## Quick Example
67
+ ## Architecture
73
68
 
74
- Ask the agent to use the supervisor for work that needs a real loop:
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.
75
70
 
76
- ```text
77
- Use $workflow-supervisor.
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.
72
+
73
+ ```mermaid
74
+ 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
78
87
 
79
- Migrate this repo's docs to the new API shape.
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"]
96
+ Claude --> Report
97
+ Report --> Supervisor
80
98
  ```
81
99
 
82
- The supervisor should ask the complete intake before work starts:
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
+ ```
83
124
 
84
- ```text
85
- Before I start the supervisor loop, answer every intake item:
86
- 1. Objective and source: what artifact, spec, repo path, document, ticket, or source set controls the work?
87
- 2. Execution path: autonomous_goal or human_in_loop?
88
- 3. Mode: sequential, parallel where safe, or staged parallel?
89
- 4. Delegation: same-thread only, use threads/subagents if available, or handoff prompts only?
90
- 5. Final disposition: keep local, open PR, push main, deploy/publish, or ask at the end?
91
- 6. Boundaries: may I install dependencies, call external services, use credentials, or only edit local files?
92
- 7. State artifacts: create `.workflow/` docs, use another artifact directory, or keep state inline?
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.
126
+
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
93
147
  ```
94
148
 
95
- If the reply skips any item, the supervisor asks for the missing item(s) and stops again.
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
+ ```
168
+
169
+ ## What It Is Used For
170
+
171
+ Use it for work that is:
172
+
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
180
+
181
+ Good examples:
182
+
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
189
+
190
+ Do not use it for:
191
+
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
96
197
 
97
- For a narrower phase, invoke the specific skill:
198
+ ## How It Works
199
+
200
+ The lifecycle is:
98
201
 
99
202
  ```text
100
- Use $source-corpus to identify the sources of truth for this migration and flag contradictions.
203
+ intake
204
+ -> source grounding
205
+ -> work units
206
+ -> acceptance matrix
207
+ -> DossierV1
208
+ -> worker delegation
209
+ -> WorkerReportV1
210
+ -> verification
211
+ -> repair if needed
212
+ -> re-verification
213
+ -> documentation
214
+ -> final disposition
101
215
  ```
102
216
 
217
+ ### 1. Intake
218
+
219
+ The supervisor must ask the user for every required decision before it plans deeply or starts work:
220
+
103
221
  ```text
104
- Use $acceptance-matrix to turn this launch checklist into PASS, FAIL, and BLOCKED criteria with evidence requirements.
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
105
229
  ```
106
230
 
231
+ If any answer is missing or vague, the supervisor asks again and stops.
232
+
233
+ ### 2. Source Grounding
234
+
235
+ The supervisor identifies the source of truth: files, specs, docs, tickets, user decisions, commands, or external constraints.
236
+
237
+ If source authority is unclear, the first work unit becomes discovery instead of implementation.
238
+
239
+ ### 3. Work Units
240
+
241
+ The supervisor splits the objective into bounded units.
242
+
243
+ For a SQLite to LanceDB migration, units might be:
244
+
107
245
  ```text
108
- Use $workflow-docs to create a reusable HANDOFF.md and OUTCOME.md for the next agent.
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
109
251
  ```
110
252
 
111
- ## Install
253
+ ### 4. DossierV1
112
254
 
113
- From a local checkout:
255
+ Before any worker starts, the supervisor creates a concrete `DossierV1`.
114
256
 
115
- ```bash
116
- git clone https://github.com/NikolaCehic/workflow-supervisor.git
117
- cd workflow-supervisor
118
- npm run validate
119
- node ./bin/workflow-skills.mjs install --agent codex --scope user
120
- ```
257
+ A dossier names:
121
258
 
122
- After npm publication, the same installer can be run through `npx`:
259
+ - the exact work unit
260
+ - the worker role
261
+ - allowed surfaces
262
+ - forbidden surfaces
263
+ - must-read sources
264
+ - acceptance rows
265
+ - required evidence
266
+ - adversarial checks
267
+ - stop gates
268
+ - required report schema
269
+
270
+ Then the package validates it:
123
271
 
124
272
  ```bash
125
- npx workflow-supervisor install --agent codex --scope user
273
+ workflow-supervisor validate-dossier .workflow/dossiers/U2-implementer.yaml --role implementer --unit U2 --json
126
274
  ```
127
275
 
128
- Install into a project-local skill directory for all supported agents:
276
+ If the dossier says `all files`, `TBD`, `unknown`, `as needed`, or leaves open questions unresolved, it fails. No worker starts.
129
277
 
130
- ```bash
131
- node ./bin/workflow-skills.mjs install --agent all --scope project --project /path/to/project
132
- ```
278
+ ### 5. Worker Delegation
133
279
 
134
- Install into any custom directory:
280
+ The supervisor launches one role-scoped worker through Codex or Claude Code.
135
281
 
136
282
  ```bash
137
- node ./bin/workflow-skills.mjs install --agent generic --target ./agent-skills
283
+ workflow-supervisor delegate --agent codex --role implementer --unit U2 --dossier .workflow/dossiers/U2-implementer.yaml
138
284
  ```
139
285
 
140
- Install only selected skills:
286
+ The worker does not get the whole chat. It receives the dossier and report schema.
141
287
 
142
- ```bash
143
- node ./bin/workflow-skills.mjs install --agent codex --skills workflow-supervisor,loop-policy,workflow-docs
144
- ```
288
+ ### 6. Verification And Repair
145
289
 
146
- Remove an install:
290
+ A verifier checks the implementer's work against acceptance rows.
147
291
 
148
- ```bash
149
- node ./bin/workflow-skills.mjs uninstall --agent codex --scope user
150
- ```
292
+ If verification fails, the supervisor creates repair work. Repairs must point back to verifier findings or acceptance rows. After repair, verification runs again.
151
293
 
152
- Emit a portable context file for agents that do not natively discover skill folders. This embeds the selected `SKILL.md` files and bundled Markdown references:
294
+ ### 7. Final Disposition
153
295
 
154
- ```bash
155
- npx workflow-supervisor emit-context --agent opencode --skills workflow-supervisor,workflow-docs --out AGENTS.md
296
+ The supervisor applies the final disposition chosen during intake:
297
+
298
+ - keep changes local
299
+ - open a PR
300
+ - push
301
+ - deploy
302
+ - publish
303
+ - ask at the end
304
+
305
+ No final irreversible action is inferred from vibes.
306
+
307
+ ## What The User Sees
308
+
309
+ The user sees the supervisor, not worker chatter.
310
+
311
+ In `human_in_loop`, the user sees:
312
+
313
+ ```text
314
+ intake question
315
+ approval packet
316
+ progress summaries
317
+ blocker questions if needed
318
+ final report
156
319
  ```
157
320
 
158
- Each install writes:
321
+ In `autonomous_goal`, the user sees:
159
322
 
160
- - the selected skill folders
161
- - `WORKFLOW_SKILL_PACK.md`
162
- - `.workflow-skills-install.json` with installed skills and checksums
323
+ ```text
324
+ intake question
325
+ execution plan
326
+ periodic progress summaries
327
+ blockers only when needed
328
+ final report
329
+ ```
163
330
 
164
- ## Supported Agents
331
+ Workers do not ask the user questions directly. They return `BLOCKED` and the supervisor decides how to route it.
165
332
 
166
- | Agent | User Install | Project Install |
167
- |---|---|---|
168
- | Codex | `~/.agents/skills` | `<project>/.agents/skills` |
169
- | Claude Code | `${CLAUDE_HOME:-~/.claude}/skills` | `<project>/.claude/skills` |
170
- | OpenCode | `${OPENCODE_HOME:-~/.config/opencode}/skills` | `<project>/.opencode/skills` |
171
- | HermesAgent | `${HERMESAGENT_HOME:-${HERMES_HOME:-~/.hermes}}/skills` | `<project>/.hermes/skills` |
172
- | Generic | custom `--target` | custom `--target` |
333
+ ## What The Output Is
173
334
 
174
- Use `emit-context` to create `AGENTS.md`, `CLAUDE.md`, `HERMES.md`, or another portable instruction file when an agent does not read `SKILL.md` folders directly. See [docs/compatibility.md](docs/compatibility.md) for adapter notes.
335
+ Workflow Supervisor produces three kinds of output.
175
336
 
176
- ## Included Skills
337
+ ### 1. Durable Workflow State
177
338
 
178
- | Skill | What It Does |
179
- |---|---|
180
- | `$workflow-supervisor` | Coordinates the whole loop: source grounding, work units, autonomous or human-in-loop execution path, thread orchestration, dossiers, verification, repair, stop gates, goal state, final PR/push/local disposition, and outcome reporting. |
181
- | `$source-corpus` | Identifies and ranks sources of truth, then flags stale, missing, contradictory, inaccessible, or non-blocking evidence gaps. |
182
- | `$work-unit` | Turns broad goals into bounded units with objective, dependencies, scope, done criteria, and sequencing. |
183
- | `$dossier-builder` | Creates a concrete handoff contract for one unit: sources, allowed surfaces, forbidden surfaces, checks, stop gates, and report shape. |
184
- | `$worker-roles` | Defines narrow role contracts for implementer, verifier, researcher, repair author, documenter, reviewer, and synthesizer. |
185
- | `$acceptance-matrix` | Converts goals into testable criteria with evidence requirements, adversarial checks, PASS/FAIL/BLOCKED states, and residual risk. |
186
- | `$loop-policy` | Controls autonomous vs human-in-loop execution, sequential/parallel mode, retry limits, approvals, budgets, escalation, no-progress detection, and continuation rules. |
187
- | `$workflow-docs` | Generates the smallest useful set of durable workflow-state and documentation-production artifacts. |
339
+ Usually under `.workflow/`:
188
340
 
189
- ## Documentation Artifacts
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
354
+ ```
190
355
 
191
- `$workflow-docs` supports two lanes.
356
+ These files make the workflow resumable after context compaction or handoff.
357
+
358
+ ### 2. Worker Reports
359
+
360
+ Every worker returns `WorkerReportV1`:
361
+
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
+ }
380
+ ```
192
381
 
193
- Markdown workflow artifacts are created under `<workspace>/.workflow/` by default. Use another directory only when the user names one, the project already has a clearer workflow-state convention, or the artifact is a final deliverable that belongs elsewhere.
382
+ ### 3. Final Supervisor Report
194
383
 
195
- Workflow state:
384
+ The final report names:
196
385
 
197
- - `.workflow/WORKFLOW.md`
198
- - `.workflow/SOURCE-CORPUS.md`
199
- - `.workflow/WORK-UNITS.md`
200
- - `.workflow/DOSSIER.md`
201
- - `.workflow/THREAD-MAP.md`
202
- - `.workflow/ACCEPTANCE-MATRIX.md`
203
- - `.workflow/VERIFICATION-REPORT.md`
204
- - `.workflow/REPAIR-TICKETS.md`
205
- - `.workflow/DECISIONS.md`
206
- - `.workflow/HANDOFF.md`
207
- - `.workflow/OUTCOME.md`
208
- - `.workflow/GOAL-STATE.md`
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
209
397
 
210
- Documentation production:
398
+ ## How To Install
211
399
 
212
- - `.workflow/DOCUMENTATION-BRIEF.md`
213
- - `.workflow/CONTENT-INVENTORY.md`
214
- - `.workflow/OUTLINE.md`
215
- - `.workflow/CONTENT-DRAFT.md`
216
- - `.workflow/CLAIMS-REGISTER.md`
217
- - `.workflow/STYLE-GUIDE.md`
218
- - `.workflow/GLOSSARY.md`
219
- - `.workflow/ASSET-REGISTER.md`
220
- - `.workflow/REVIEW-PLAN.md`
221
- - `.workflow/REVISION-QUEUE.md`
222
- - `.workflow/PUBLISHING-CHECKLIST.md`
223
- - `.workflow/PUBLICATION-LOG.md`
224
- - `.workflow/MAINTENANCE-PLAN.md`
400
+ From a local checkout:
225
401
 
226
- Markdown is the default, but the skills can also produce inline handoffs, ticket outlines, runbooks, spreadsheet-ready tables, design review notes, or other state that a human or agent can reuse.
402
+ ```bash
403
+ git clone https://github.com/NikolaCehic/workflow-supervisor.git
404
+ cd workflow-supervisor
405
+ npm run validate
406
+ ```
407
+
408
+ Install for Codex:
227
409
 
228
- `$workflow-docs` is intentionally selective: it can scaffold, refresh, or preserve only the artifacts a workflow actually needs, including resume packs, verification reports, repair tickets, content briefs, claims registers, review plans, publishing checklists, and maintenance plans.
410
+ ```bash
411
+ npx workflow-supervisor install --agent codex --scope user
412
+ ```
229
413
 
230
- ## CLI
414
+ Install for Claude Code:
231
415
 
232
416
  ```bash
233
- workflow-supervisor list
234
- workflow-supervisor validate
235
- workflow-supervisor doctor --agent codex
236
- workflow-supervisor install --agent codex --dry-run
237
- workflow-supervisor install --agent all --scope project --project .
238
- workflow-supervisor install --agent generic --target ./agent-skills
239
- workflow-supervisor install --agent codex --skills workflow-supervisor,loop-policy
240
- workflow-supervisor uninstall --agent codex --scope user
241
- workflow-supervisor emit-context --agent opencode --skills workflow-supervisor,workflow-docs --out AGENTS.md
417
+ npx workflow-supervisor install --agent claude-code --scope user
242
418
  ```
243
419
 
244
- See [docs/cli.md](docs/cli.md) for the full command reference.
420
+ Install for both in a project:
245
421
 
246
- ## Validation
422
+ ```bash
423
+ npx workflow-supervisor install --agent all --scope project --project .
424
+ ```
247
425
 
248
- Run the built-in validator before installing from a local checkout:
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.
427
+
428
+ Export generic Markdown instructions:
249
429
 
250
430
  ```bash
251
- npm run validate
252
- node ./bin/workflow-skills.mjs install --agent generic --target ./agent-skills --dry-run
431
+ npx workflow-supervisor emit-context --agent generic --out AGENTS.md
253
432
  ```
254
433
 
255
- ## Repository Layout
434
+ ## How To Use
435
+
436
+ In Codex or Claude Code, ask explicitly:
256
437
 
257
438
  ```text
258
- skills/ production skill folders
259
- adapters/ agent adapter metadata
260
- bin/ workflow-supervisor CLI
261
- docs/ user documentation
439
+ Use $workflow-supervisor to migrate this repo from SQLite to LanceDB.
440
+ ```
441
+
442
+ The correct next step is not implementation. The correct next step is the intake packet.
443
+
444
+ After intake is complete, the supervisor proceeds through work units, dossiers, workers, verification, repair, and final disposition.
445
+
446
+ Useful CLI commands:
447
+
448
+ ```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
262
454
  ```
263
455
 
264
- ## Status
456
+ ## For Agents
457
+
458
+ If you are an AI agent reading this README, follow these rules:
459
+
460
+ 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.
265
469
 
266
- The package is ready for local installation and explicit skill invocation. Keep implicit invocation disabled unless your environment has proven routing precision for these skills.
470
+ The point is not to add ceremony. The point is to make complex agent work hard to derail.
@@ -3,5 +3,11 @@
3
3
  "status": "portable",
4
4
  "defaultTarget": "${CLAUDE_HOME:-~/.claude}/skills",
5
5
  "metadata": "SKILL.md",
6
- "fallback": "workflow-supervisor emit-context --agent claude-code --out CLAUDE.md"
6
+ "fallback": "workflow-supervisor emit-context --agent claude-code --out CLAUDE.md",
7
+ "delegate": {
8
+ "command": ["claude", "-p", "--output-format", "json"],
9
+ "promptMode": "arg",
10
+ "schemaMode": "json",
11
+ "schemaFlag": "--json-schema"
12
+ }
7
13
  }