workflow-supervisor 0.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.
- package/LICENSE +21 -0
- package/README.md +266 -0
- package/adapters/claude-code/adapter.json +7 -0
- package/adapters/codex/adapter.json +8 -0
- package/adapters/hermesagent/adapter.json +8 -0
- package/adapters/opencode/adapter.json +8 -0
- package/assets/workflow-supervisor-hero.png +0 -0
- package/bin/workflow-skills +2 -0
- package/bin/workflow-skills.mjs +452 -0
- package/docs/artifacts.md +40 -0
- package/docs/cli.md +119 -0
- package/docs/compatibility.md +85 -0
- package/docs/skill-reference.md +33 -0
- package/docs/troubleshooting.md +38 -0
- package/package.json +45 -0
- package/skills/acceptance-matrix/SKILL.md +77 -0
- package/skills/acceptance-matrix/agents/openai.yaml +7 -0
- package/skills/dossier-builder/SKILL.md +93 -0
- package/skills/dossier-builder/agents/openai.yaml +7 -0
- package/skills/loop-policy/SKILL.md +103 -0
- package/skills/loop-policy/agents/openai.yaml +7 -0
- package/skills/source-corpus/SKILL.md +92 -0
- package/skills/source-corpus/agents/openai.yaml +7 -0
- package/skills/work-unit/SKILL.md +72 -0
- package/skills/work-unit/agents/openai.yaml +7 -0
- package/skills/worker-roles/SKILL.md +115 -0
- package/skills/worker-roles/agents/openai.yaml +7 -0
- package/skills/workflow-docs/SKILL.md +88 -0
- package/skills/workflow-docs/agents/openai.yaml +7 -0
- package/skills/workflow-docs/references/documentation-production.md +230 -0
- package/skills/workflow-docs/references/goal-resume.md +62 -0
- package/skills/workflow-docs/references/templates.md +53 -0
- package/skills/workflow-docs/references/workflow-control.md +276 -0
- package/skills/workflow-supervisor/SKILL.md +254 -0
- package/skills/workflow-supervisor/agents/openai.yaml +7 -0
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
# Workflow Control Templates
|
|
2
|
+
|
|
3
|
+
Use these for supervised workflow state. Do not use them for ordinary documentation drafting unless workflow state or handoff is required.
|
|
4
|
+
|
|
5
|
+
Default path: create these files under `<workspace>/.workflow/` unless the user provides another artifact directory or the project already has an established workflow-state location.
|
|
6
|
+
|
|
7
|
+
## WORKFLOW.md
|
|
8
|
+
|
|
9
|
+
```md
|
|
10
|
+
# Workflow
|
|
11
|
+
|
|
12
|
+
## Objective
|
|
13
|
+
|
|
14
|
+
## Audience Or Consumer
|
|
15
|
+
|
|
16
|
+
## Current Status
|
|
17
|
+
|
|
18
|
+
## Execution Path
|
|
19
|
+
|
|
20
|
+
## Final Disposition Policy
|
|
21
|
+
|
|
22
|
+
## Constraints
|
|
23
|
+
|
|
24
|
+
## Non-Goals
|
|
25
|
+
|
|
26
|
+
## Source Corpus
|
|
27
|
+
|
|
28
|
+
## Artifact Map
|
|
29
|
+
|
|
30
|
+
## Work Units
|
|
31
|
+
|
|
32
|
+
| ID | Title | Status | Depends On | Next Action |
|
|
33
|
+
|---|---|---|---|---|
|
|
34
|
+
|
|
35
|
+
## Loop Policy
|
|
36
|
+
|
|
37
|
+
## Stop Gates
|
|
38
|
+
|
|
39
|
+
## Next Action
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## SOURCE-CORPUS.md
|
|
43
|
+
|
|
44
|
+
```md
|
|
45
|
+
# Source Corpus
|
|
46
|
+
|
|
47
|
+
## Source Ranking
|
|
48
|
+
|
|
49
|
+
| Source | Type | Owner | Authority | Freshness | Access | Usage Rights | Relevant Claims | Risk | Confidence |
|
|
50
|
+
|---|---|---|---|---|---|---|---|---|---|
|
|
51
|
+
|
|
52
|
+
## Contradictions
|
|
53
|
+
|
|
54
|
+
| Sources | Issue | Material | Resolution |
|
|
55
|
+
|---|---|---|---|
|
|
56
|
+
|
|
57
|
+
## Missing Sources
|
|
58
|
+
|
|
59
|
+
## Evidence Gaps
|
|
60
|
+
|
|
61
|
+
## Assumptions And Inferences
|
|
62
|
+
|
|
63
|
+
## Allowed Next Action
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## WORK-UNITS.md
|
|
67
|
+
|
|
68
|
+
```md
|
|
69
|
+
# Work Units
|
|
70
|
+
|
|
71
|
+
| ID | Thread Slug | Title | Objective | Dependencies | Status | Verification |
|
|
72
|
+
|---|---|---|---|---|---|---|
|
|
73
|
+
|
|
74
|
+
## Sequencing
|
|
75
|
+
|
|
76
|
+
## Parallelization Notes
|
|
77
|
+
|
|
78
|
+
## Blocked Units
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## DOSSIER.md
|
|
82
|
+
|
|
83
|
+
```md
|
|
84
|
+
# Dossier
|
|
85
|
+
|
|
86
|
+
## Dossier ID
|
|
87
|
+
|
|
88
|
+
## Thread Name
|
|
89
|
+
|
|
90
|
+
## Thread Role
|
|
91
|
+
|
|
92
|
+
## Start Condition
|
|
93
|
+
|
|
94
|
+
## Work Unit
|
|
95
|
+
|
|
96
|
+
## Objective
|
|
97
|
+
|
|
98
|
+
## Non-Goals
|
|
99
|
+
|
|
100
|
+
## Sources To Read
|
|
101
|
+
|
|
102
|
+
## Boundary Type
|
|
103
|
+
|
|
104
|
+
## Scope Boundaries
|
|
105
|
+
|
|
106
|
+
### Allowed Surfaces Or Artifacts
|
|
107
|
+
|
|
108
|
+
### Forbidden Surfaces, Claims, Or Decisions
|
|
109
|
+
|
|
110
|
+
## Read-Only Neighbor Context
|
|
111
|
+
|
|
112
|
+
## Acceptance Matrix
|
|
113
|
+
|
|
114
|
+
## Quality Or Risk Checks
|
|
115
|
+
|
|
116
|
+
## Required Checks Or Evidence
|
|
117
|
+
|
|
118
|
+
## Owner Or Contributor Role
|
|
119
|
+
|
|
120
|
+
## Handoff Message
|
|
121
|
+
|
|
122
|
+
## Supervisor Checkpoints
|
|
123
|
+
|
|
124
|
+
## Report Schema
|
|
125
|
+
|
|
126
|
+
## Stop Gates
|
|
127
|
+
|
|
128
|
+
## Open Questions
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## THREAD-MAP.md
|
|
132
|
+
|
|
133
|
+
```md
|
|
134
|
+
# Thread Map
|
|
135
|
+
|
|
136
|
+
| Thread Name | Role | Work Unit | Dossier | Start Condition | Dependencies | Status | Last Supervisor Message | Terminal Report |
|
|
137
|
+
|---|---|---|---|---|---|---|---|---|
|
|
138
|
+
|
|
139
|
+
## Supervisor Checkpoints
|
|
140
|
+
|
|
141
|
+
## Blocked Threads
|
|
142
|
+
|
|
143
|
+
## Closed Threads
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## ACCEPTANCE-MATRIX.md
|
|
147
|
+
|
|
148
|
+
```md
|
|
149
|
+
# Acceptance Matrix
|
|
150
|
+
|
|
151
|
+
| ID | Requirement | Evidence Required | Verification Method | Adversarial Check | Status | Evidence |
|
|
152
|
+
|---|---|---|---|---|---|---|
|
|
153
|
+
|
|
154
|
+
## Residual Risks
|
|
155
|
+
|
|
156
|
+
## Waivers
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## VERIFICATION-REPORT.md
|
|
160
|
+
|
|
161
|
+
```md
|
|
162
|
+
# Verification Report
|
|
163
|
+
|
|
164
|
+
Status: PASS | FAIL | BLOCKED | NEEDS REVISION | APPROVED WITH CAVEATS | READY TO PUBLISH | SME REVIEW NEEDED | LEGAL REVIEW NEEDED | STALE
|
|
165
|
+
|
|
166
|
+
Verified Work Unit:
|
|
167
|
+
|
|
168
|
+
Verified Thread:
|
|
169
|
+
|
|
170
|
+
## Sources Inspected
|
|
171
|
+
|
|
172
|
+
## Materials Inspected
|
|
173
|
+
|
|
174
|
+
## Checks, Reviews, Or Evidence Methods
|
|
175
|
+
|
|
176
|
+
| Method | Result | Evidence |
|
|
177
|
+
|---|---|---|
|
|
178
|
+
|
|
179
|
+
## Acceptance Mapping
|
|
180
|
+
|
|
181
|
+
| Requirement | Verdict | Evidence |
|
|
182
|
+
|---|---|---|
|
|
183
|
+
|
|
184
|
+
## Findings
|
|
185
|
+
|
|
186
|
+
## Skipped Checks
|
|
187
|
+
|
|
188
|
+
## Residual Risks
|
|
189
|
+
|
|
190
|
+
## Repair Or Revision Recommendations
|
|
191
|
+
|
|
192
|
+
## Re-Verification Required
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## REPAIR-TICKETS.md
|
|
196
|
+
|
|
197
|
+
```md
|
|
198
|
+
# Repair Tickets
|
|
199
|
+
|
|
200
|
+
## Ticket 1: Title
|
|
201
|
+
|
|
202
|
+
Finding Or Matrix Row:
|
|
203
|
+
Severity:
|
|
204
|
+
Affected Surfaces Or Artifacts:
|
|
205
|
+
Problem:
|
|
206
|
+
Required Repair:
|
|
207
|
+
Required Checks Or Evidence:
|
|
208
|
+
Acceptance Criteria:
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## DECISIONS.md
|
|
212
|
+
|
|
213
|
+
```md
|
|
214
|
+
# Decisions
|
|
215
|
+
|
|
216
|
+
| Date | Decision | Source | Rationale | Reversible |
|
|
217
|
+
|---|---|---|---|---|
|
|
218
|
+
|
|
219
|
+
## Assumptions
|
|
220
|
+
|
|
221
|
+
## Reversals
|
|
222
|
+
|
|
223
|
+
## Open Questions
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## HANDOFF.md
|
|
227
|
+
|
|
228
|
+
```md
|
|
229
|
+
# Handoff
|
|
230
|
+
|
|
231
|
+
## Current State
|
|
232
|
+
|
|
233
|
+
## What Was Done
|
|
234
|
+
|
|
235
|
+
## What Remains
|
|
236
|
+
|
|
237
|
+
## Sources Used
|
|
238
|
+
|
|
239
|
+
## Checks, Reviews, Or Methods
|
|
240
|
+
|
|
241
|
+
## Known Risks
|
|
242
|
+
|
|
243
|
+
## Blockers
|
|
244
|
+
|
|
245
|
+
## Next Recommended Action
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## OUTCOME.md
|
|
249
|
+
|
|
250
|
+
```md
|
|
251
|
+
# Outcome
|
|
252
|
+
|
|
253
|
+
Status: PASS | FAIL | BLOCKED | PARTIAL
|
|
254
|
+
|
|
255
|
+
Final Disposition: PR | PUSH_MAIN | KEEP_LOCAL | UNDECIDED
|
|
256
|
+
|
|
257
|
+
Execution Path:
|
|
258
|
+
|
|
259
|
+
Final Disposition Policy:
|
|
260
|
+
|
|
261
|
+
## Objective
|
|
262
|
+
|
|
263
|
+
## Work Completed
|
|
264
|
+
|
|
265
|
+
## Worker Threads
|
|
266
|
+
|
|
267
|
+
## Verification Evidence
|
|
268
|
+
|
|
269
|
+
## Checks Run
|
|
270
|
+
|
|
271
|
+
## Checks Skipped
|
|
272
|
+
|
|
273
|
+
## Residual Risks
|
|
274
|
+
|
|
275
|
+
## Follow-Up
|
|
276
|
+
```
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
---
|
|
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 multi-thread handoff, 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.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Workflow Supervisor
|
|
7
|
+
|
|
8
|
+
Use this skill as the coordinating spine for complex work. The supervisor owns decomposition, 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 should be treated as separate roles when the environment supports separate agents or threads.
|
|
9
|
+
|
|
10
|
+
## Domain Neutrality
|
|
11
|
+
|
|
12
|
+
This workflow must work without a repository, codebase, existing docs, or installed project conventions. Treat "surface" as any mutable target: files, documents, designs, datasets, decisions, prompts, workflows, tickets, configs, UI states, business processes, or research artifacts. Treat "check" as any evidence-producing method: tests, commands, inspections, rubrics, document diffs, stakeholder decisions, examples, screenshots, source citations, or manual verification.
|
|
13
|
+
|
|
14
|
+
When no source corpus exists, make the first work unit a discovery/intake unit instead of inventing prerequisites. Do not require `AGENTS.md`, a repo, commands, or Markdown files unless the specific task provides them or needs them.
|
|
15
|
+
|
|
16
|
+
## Codex Goal Lifecycle
|
|
17
|
+
|
|
18
|
+
This skill is loop-oriented. Complete intake is mandatory before goal binding. After all required intake decisions are answered, bind the workflow to a Codex goal only when the completed intake and governing environment both authorize goal-oriented work.
|
|
19
|
+
|
|
20
|
+
Use this lifecycle:
|
|
21
|
+
|
|
22
|
+
1. Confirm the complete intake gate is satisfied. If any required intake answer is missing or ambiguous, ask for the missing answer(s) and stop.
|
|
23
|
+
2. Call `get_goal` or the environment's equivalent.
|
|
24
|
+
3. Classify goal state: `none`, `active relevant`, `active unrelated`, `complete old`, `blocked old`, or `tool unavailable`.
|
|
25
|
+
4. If an active relevant goal exists, reuse it.
|
|
26
|
+
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
|
+
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.
|
|
29
|
+
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
|
+
9. Use `update_goal` only for terminal `complete` or `blocked` states when the environment supports that action.
|
|
31
|
+
10. Mark the goal complete only after acceptance evidence supports completion and no required supervisor work remains.
|
|
32
|
+
11. Distinguish workflow/unit BLOCKED from Codex goal blocked. Mark a Codex goal blocked only after the same material blocker repeats across the required consecutive goal turns and no meaningful progress remains.
|
|
33
|
+
12. On resume after compaction or handoff, read the active goal first, then reconcile workflow docs and current artifacts.
|
|
34
|
+
|
|
35
|
+
If the environment has no goal tool or goal creation is not permitted, state the intended goal objective in the supervisor report and continue with workflow docs or another state artifact as the fallback state container.
|
|
36
|
+
|
|
37
|
+
## Operating Contract
|
|
38
|
+
|
|
39
|
+
- After complete intake, ground the workflow in sources before creating work units.
|
|
40
|
+
- Treat skill use as instruction loading in the current agent, not as thread, subagent, goal, branch, commit, PR, publication, or other side-effect creation.
|
|
41
|
+
- Run the complete intake gate before goal creation, thread creation, implementation, publication, or other irreversible action.
|
|
42
|
+
- Do not infer execution path, mode, delegation, final disposition, or boundaries from keywords, action verbs, or intent guesses.
|
|
43
|
+
- Classify the workflow as `autonomous_goal` or `human_in_loop` only from completed intake answers before spawning threads or beginning implementation.
|
|
44
|
+
- 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
|
+
- Spawn worker threads only when the environment supports threads and complete intake plus the path gate authorize delegation; otherwise emit handoff prompts or workflow docs as the fallback.
|
|
47
|
+
- Do not start implementer, verifier, repair-author, or documenter threads before complete intake and the path gate are satisfied; role-specific start conditions are additional gates after that.
|
|
48
|
+
- Keep roles separate: implementers implement, verifiers verify, repair authors write tickets, documenters update workflow artifacts, and the supervisor coordinates.
|
|
49
|
+
- Treat same-thread verification as a self-check, not independent verification.
|
|
50
|
+
- Prefer explicit PASS/FAIL/BLOCKED states over soft completion language.
|
|
51
|
+
- Stop instead of improvising when sources are missing, contradictory, materially stale, or too vague to produce acceptance criteria.
|
|
52
|
+
- Keep provenance optional; require enough outcome detail for another agent to resume.
|
|
53
|
+
- Treat companion skills as optional phase tools, not an automatic cascade. Use the smallest set needed for the current risk.
|
|
54
|
+
|
|
55
|
+
## Skills, Threads, And Subagents
|
|
56
|
+
|
|
57
|
+
Using this skill does not spawn a thread or subagent. It coordinates the current agent until a separate execution mechanism is explicitly available and authorized.
|
|
58
|
+
|
|
59
|
+
Treat these as distinct mechanisms:
|
|
60
|
+
|
|
61
|
+
- Skill: reusable instructions loaded into the current agent.
|
|
62
|
+
- Worker thread: a separate environment-managed conversation or task created with thread tools when allowed.
|
|
63
|
+
- Subagent: a separate worker execution mechanism when the environment exposes one.
|
|
64
|
+
- Handoff prompt: a ready-to-send worker brief used when thread or subagent tools are unavailable or not approved.
|
|
65
|
+
|
|
66
|
+
Start worker threads or subagents only after complete intake and the path gate are satisfied, a concrete dossier exists, the loop policy authorizes delegation, and the environment allows the tool. If environment rules require explicit user approval for user-visible thread creation, obtain it before creating threads. Otherwise, output scoped handoff prompts and mark execution as `thread_unavailable` or `delegation_unavailable`.
|
|
67
|
+
|
|
68
|
+
## Intake Gate
|
|
69
|
+
|
|
70
|
+
Every supervisor invocation must pass the complete intake gate before creating a goal, decomposing deeply, spawning workers, implementing, publishing, or taking irreversible action. If the current conversation already contains explicit answers to every required intake decision, record those answers and proceed. Otherwise, ask the intake packet and stop.
|
|
71
|
+
|
|
72
|
+
Do not use keywords to skip intake. Words such as "autonomous", "agent loop", "work until done", "approval", "generate", or "create" are not substitutes for completed intake answers.
|
|
73
|
+
|
|
74
|
+
Required intake decisions:
|
|
75
|
+
|
|
76
|
+
- Objective and source: what artifact, spec, repo path, document, ticket, or source set controls the work.
|
|
77
|
+
- Execution path: `autonomous_goal` or `human_in_loop`.
|
|
78
|
+
- Execution mode: `sequential`, `parallel_where_safe`, or `staged_parallel`.
|
|
79
|
+
- Delegation: `same_thread_only`, `use_threads_or_subagents_if_available`, or `handoff_prompts_only`.
|
|
80
|
+
- Final disposition: `keep_local_when_green`, `open_pr_when_green`, `push_main_when_green`, `deploy_when_green`, `publish_when_green`, or `ask_at_end`.
|
|
81
|
+
- Mutation boundaries: local files, dependency installs, network calls, external services, credentials, destructive operations, and any forbidden surfaces.
|
|
82
|
+
- State artifacts: whether to create workflow docs under `<workspace>/.workflow/`, use another named artifact directory, or keep state inline.
|
|
83
|
+
|
|
84
|
+
Use this question shape for the first intake ask:
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
Before I start the supervisor loop, answer every intake item:
|
|
88
|
+
1. Objective and source: what artifact, spec, repo path, document, ticket, or source set controls the work?
|
|
89
|
+
2. Execution path: autonomous_goal or human_in_loop?
|
|
90
|
+
3. Mode: sequential, parallel where safe, or staged parallel?
|
|
91
|
+
4. Delegation: same-thread only, use threads/subagents if available, or handoff prompts only?
|
|
92
|
+
5. Final disposition: keep local, open PR, push main, deploy/publish, or ask at the end?
|
|
93
|
+
6. Boundaries: may I install dependencies, call external services, use credentials, or only edit local files?
|
|
94
|
+
7. State artifacts: create `.workflow/` docs, use another artifact directory, or keep state inline?
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
If the user answers only some intake items, ask only the unanswered or ambiguous item(s) again and stop. If the user says "use your judgment", treat that item as unanswered; do not substitute defaults. Continue prompting until every required intake decision has an explicit user answer.
|
|
98
|
+
|
|
99
|
+
Treat `autonomous_goal`, PR creation, direct push, deploy, publication, paid operations, production data changes, and credential use as satisfied only by completed intake answers, not by keywords elsewhere in the prompt.
|
|
100
|
+
|
|
101
|
+
Negative example: "Using Workflow Supervisor, generate an API and create the project" is not autonomous authorization and is not complete intake. It names the supervisor and objective, but leaves required intake decisions unresolved. Ask the complete intake packet and stop before implementation.
|
|
102
|
+
|
|
103
|
+
## Supervisor Loop
|
|
104
|
+
|
|
105
|
+
1. Run the complete intake gate. Record explicit user answers. If any required intake answer is missing, vague, or delegated to judgment, ask for the unresolved item(s) and stop.
|
|
106
|
+
2. Restate the objective, constraints, non-goals, known sources, and unknowns from the completed intake.
|
|
107
|
+
3. Bind or reconcile the Codex goal only after complete intake and only when no unrelated active goal prevents binding.
|
|
108
|
+
4. Build or request a source corpus map. Use `$source-corpus` when source authority, freshness, or contradictions matter.
|
|
109
|
+
5. Split the objective into bounded work units. Use `$work-unit` for ambiguous or multi-phase goals.
|
|
110
|
+
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.
|
|
111
|
+
7. Build dossiers for the first implementation units and any planned verification, repair, or documentation threads. Use `$dossier-builder` when handing work to another agent or when the task has boundaries.
|
|
112
|
+
8. Assign worker roles with explicit allowed and forbidden behavior. Use `$worker-roles` for multi-agent or multi-thread work.
|
|
113
|
+
9. Select the execution path:
|
|
114
|
+
- `human_in_loop`: use when selected in completed intake or when a higher-priority rule requires human approval after intake.
|
|
115
|
+
- `autonomous_goal`: use only when selected in completed intake and no higher-priority rule requires human approval.
|
|
116
|
+
10. Present the path-specific plan:
|
|
117
|
+
- `human_in_loop`: approval packet with plan, work units, thread plan, approval gates, stop gates, and first dossiers. Stop until the human approves or revises it.
|
|
118
|
+
- `autonomous_goal`: execution plan with the same contents plus autonomous boundaries, allowed actions, stop gates, repair limits, and final disposition policy. Continue after recording it only when complete intake authorized that path.
|
|
119
|
+
11. After the path gate is satisfied, create or hand off named threads from the thread plan. Send each worker only its role, dossier, sources, acceptance rows, stop gates, and report schema.
|
|
120
|
+
12. Talk to each worker thread after handoff: confirm receipt, answer scoped questions, collect terminal reports, and preserve report links or summaries in the supervisor state.
|
|
121
|
+
13. Verify independently where possible. Use `$acceptance-matrix` to map every requirement to evidence. Start verifier threads only after the relevant implementer report is available.
|
|
122
|
+
14. If verification FAILs, convert findings into repair tickets and route them to a repair-author or implementer repair thread. Do not expand scope during repair.
|
|
123
|
+
15. Re-run verification after repairs. Continue only until PASS, BLOCKED, repair limit, or path stop.
|
|
124
|
+
16. Start documenter threads only after source, implementation, verification, or repair evidence exists, unless the documenter is explicitly creating planning state.
|
|
125
|
+
17. If verification BLOCKs, report the blocker and stop or ask for the missing decision.
|
|
126
|
+
18. Use `$workflow-docs` to create or refresh reusable Markdown artifacts under `<workspace>/.workflow/` when the workflow must persist across context loss, agents, or sessions.
|
|
127
|
+
19. When all material acceptance rows are PASS or waived, apply the final disposition policy:
|
|
128
|
+
- `human_in_loop`: use the completed intake final disposition; if it is `ask_at_end`, ask the human to choose PR, push main, or keep local.
|
|
129
|
+
- `autonomous_goal`: use the completed intake final disposition. If it is `ask_at_end`, stop and ask before taking any final disposition action.
|
|
130
|
+
20. Finish with an outcome report that names execution path, goal status, sources, work units, worker threads, checks, skipped checks, residual risks, final disposition decision, and next action.
|
|
131
|
+
|
|
132
|
+
## Execution Paths
|
|
133
|
+
|
|
134
|
+
### Human-In-Loop
|
|
135
|
+
|
|
136
|
+
Use `human_in_loop` when the completed intake selects it, or when a higher-priority rule requires human approval after intake. If the user has not answered the execution-path intake item, stop and ask for that answer instead of inferring a path.
|
|
137
|
+
|
|
138
|
+
The first supervisor deliverable is a plan for approval, not implementation. The approval packet must include:
|
|
139
|
+
|
|
140
|
+
- objective and non-goals
|
|
141
|
+
- source corpus summary and gaps
|
|
142
|
+
- work units and sequence
|
|
143
|
+
- thread plan with names, roles, dossiers, dependencies, and start conditions
|
|
144
|
+
- acceptance matrix summary
|
|
145
|
+
- approval gates and stop gates
|
|
146
|
+
- expected final disposition choices: PR, push main, or keep local
|
|
147
|
+
|
|
148
|
+
Stop until the human approves or revises the packet.
|
|
149
|
+
|
|
150
|
+
### Autonomous Goal
|
|
151
|
+
|
|
152
|
+
Use `autonomous_goal` only when the completed intake selects it. Phrases such as "work autonomously until done", "run the full loop without waiting for me", or "do not wait" do not skip the required intake packet. The autonomous plan must include:
|
|
153
|
+
|
|
154
|
+
- objective and non-goals
|
|
155
|
+
- source corpus summary and gaps
|
|
156
|
+
- work units and sequence
|
|
157
|
+
- thread plan with names, roles, dossiers, dependencies, and start conditions
|
|
158
|
+
- acceptance matrix summary
|
|
159
|
+
- autonomous boundaries and forbidden actions
|
|
160
|
+
- stop gates, repair limits, budgets, and escalation rules
|
|
161
|
+
- final disposition policy: `open_pr_when_green`, `push_main_when_green`, or `keep_local_when_green`
|
|
162
|
+
|
|
163
|
+
The final disposition must come from the completed intake. Direct push to the main branch, PR creation, deploy, publication, paid operations, production data changes, credential use, and destructive operations require explicit answers in the relevant intake fields.
|
|
164
|
+
|
|
165
|
+
Even in `autonomous_goal`, stop and ask when any required intake answer is missing or ambiguous, required sources are missing, acceptance cannot be verified, a worker needs scope expansion, an irreversible action lacks intake authorization, or higher-priority instructions require approval.
|
|
166
|
+
|
|
167
|
+
## Thread Orchestration
|
|
168
|
+
|
|
169
|
+
After the path gate is satisfied, use environment thread tools when available. In Codex-style environments, use the configured thread-management tools to create or fork worker threads, send handoff messages, read reports, and hand off or close threads. If thread tools are unavailable, output the worker handoff prompts and mark execution as `thread_unavailable`.
|
|
170
|
+
|
|
171
|
+
Name threads deterministically from the workflow, unit, role, and dossier:
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
wf/<workflow-slug>/<unit-id>-<role>-<dossier-slug>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Examples:
|
|
178
|
+
|
|
179
|
+
```text
|
|
180
|
+
wf/better-auth/U1-implementer-backend-auth-instance
|
|
181
|
+
wf/better-auth/U1-verifier-backend-auth-instance
|
|
182
|
+
wf/better-auth/U1-repair-auth-route-order
|
|
183
|
+
wf/better-auth/U6-documenter-auth-handoff
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Use one thread per role per work unit unless the loop policy explicitly allows batching. Supervisor messages to worker threads must be scoped:
|
|
187
|
+
|
|
188
|
+
- kickoff: role, dossier, sources, acceptance rows, stop gates, report schema
|
|
189
|
+
- checkpoint: request status, blockers, or clarification without expanding scope
|
|
190
|
+
- repair handoff: failed rows, verifier findings, allowed repair surfaces, checks
|
|
191
|
+
- closeout: collect terminal report and confirm no further action is expected
|
|
192
|
+
|
|
193
|
+
Final disposition prompt shape:
|
|
194
|
+
|
|
195
|
+
```text
|
|
196
|
+
Verification is green and repair loops are closed. Choose one:
|
|
197
|
+
1. Open a PR
|
|
198
|
+
2. Push directly to main
|
|
199
|
+
3. Keep changes local
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Minimum Dossier Gate
|
|
203
|
+
|
|
204
|
+
Do not hand off or implement a work unit unless the dossier can name:
|
|
205
|
+
|
|
206
|
+
- objective and non-goals
|
|
207
|
+
- source corpus used and missing
|
|
208
|
+
- allowed and forbidden surfaces or artifacts
|
|
209
|
+
- acceptance matrix or acceptance draft
|
|
210
|
+
- required checks or evidence
|
|
211
|
+
- adversarial checks
|
|
212
|
+
- stop gates
|
|
213
|
+
- worker report schema
|
|
214
|
+
- thread name and role start condition when delegation is planned
|
|
215
|
+
|
|
216
|
+
Boundaries may be mutable artifacts, source claims, decisions, audiences, data fields, design areas, process steps, publication rights, or forbidden claims. For read-only advisory work, naming forbidden claims and decision limits can satisfy the boundary requirement.
|
|
217
|
+
|
|
218
|
+
If any item is unknown and material, stop and ask for the missing decision or mark the unit BLOCKED.
|
|
219
|
+
|
|
220
|
+
## Stop Gates
|
|
221
|
+
|
|
222
|
+
Stop when:
|
|
223
|
+
|
|
224
|
+
- any required intake answer is missing, vague, delegated to judgment, or contradicted by another intake answer
|
|
225
|
+
- source authority cannot be established
|
|
226
|
+
- sources contradict each other on a material requirement
|
|
227
|
+
- the requested scope cannot fit into a bounded work unit
|
|
228
|
+
- allowed and forbidden surfaces cannot be named
|
|
229
|
+
- acceptance cannot be verified with evidence
|
|
230
|
+
- a verifier is asked to edit or an implementer is asked to self-approve
|
|
231
|
+
- repair loops repeat without new evidence
|
|
232
|
+
- the user requires approval before continuing
|
|
233
|
+
- the selected path is `autonomous_goal` but it was inferred from prompt wording instead of a completed intake answer
|
|
234
|
+
- an irreversible action is requested without explicit authorization in the completed intake
|
|
235
|
+
- a worker thread asks to expand scope without supervisor or human approval
|
|
236
|
+
- final verification is not green and no waiver evidence exists
|
|
237
|
+
|
|
238
|
+
## Final Report Shape
|
|
239
|
+
|
|
240
|
+
Report:
|
|
241
|
+
|
|
242
|
+
- Status: PASS, FAIL, BLOCKED, or PARTIAL
|
|
243
|
+
- Execution path: autonomous_goal or human_in_loop
|
|
244
|
+
- Goal status and whether a Codex goal was created, reused, skipped, completed, or blocked
|
|
245
|
+
- Objective handled
|
|
246
|
+
- Sources used and gaps
|
|
247
|
+
- Work units completed or remaining
|
|
248
|
+
- Worker threads created, messaged, blocked, or skipped
|
|
249
|
+
- Verification evidence
|
|
250
|
+
- Repairs performed or recommended
|
|
251
|
+
- Checks run and skipped
|
|
252
|
+
- Residual risks
|
|
253
|
+
- Final disposition: PR, push main, keep local, or undecided
|
|
254
|
+
- Resume point or next action
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Workflow Supervisor"
|
|
3
|
+
short_description: "Run autonomous or human-gated workflows"
|
|
4
|
+
default_prompt: "Use $workflow-supervisor to run the complete intake gate first. Ask every required intake question and stop until the user explicitly answers all of them. Do not infer or skip steps from keywords such as autonomous, work until done, approval, generate, or create. Start planning or work only after complete intake is satisfied."
|
|
5
|
+
|
|
6
|
+
policy:
|
|
7
|
+
allow_implicit_invocation: false
|