@tiic-tech/openworkflow 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 +37 -0
- package/dist/adapters/codex/src/doctorCodexAdapter.d.ts +6 -0
- package/dist/adapters/codex/src/doctorCodexAdapter.js +124 -0
- package/dist/adapters/codex/src/doctorCodexAdapter.js.map +1 -0
- package/dist/adapters/codex/src/generateAgents.d.ts +2 -0
- package/dist/adapters/codex/src/generateAgents.js +40 -0
- package/dist/adapters/codex/src/generateAgents.js.map +1 -0
- package/dist/adapters/codex/src/generateCodexAdapter.d.ts +9 -0
- package/dist/adapters/codex/src/generateCodexAdapter.js +59 -0
- package/dist/adapters/codex/src/generateCodexAdapter.js.map +1 -0
- package/dist/adapters/codex/src/generateCommands.d.ts +6 -0
- package/dist/adapters/codex/src/generateCommands.js +205 -0
- package/dist/adapters/codex/src/generateCommands.js.map +1 -0
- package/dist/adapters/codex/src/generateSkills.d.ts +7 -0
- package/dist/adapters/codex/src/generateSkills.js +60 -0
- package/dist/adapters/codex/src/generateSkills.js.map +1 -0
- package/dist/adapters/codex/src/generatedFiles.d.ts +4 -0
- package/dist/adapters/codex/src/generatedFiles.js +67 -0
- package/dist/adapters/codex/src/generatedFiles.js.map +1 -0
- package/dist/adapters/codex/src/manifest.d.ts +4 -0
- package/dist/adapters/codex/src/manifest.js +40 -0
- package/dist/adapters/codex/src/manifest.js.map +1 -0
- package/dist/adapters/codex/src/templates.d.ts +7 -0
- package/dist/adapters/codex/src/templates.js +6 -0
- package/dist/adapters/codex/src/templates.js.map +1 -0
- package/dist/cli/src/args.d.ts +8 -0
- package/dist/cli/src/args.js +34 -0
- package/dist/cli/src/args.js.map +1 -0
- package/dist/cli/src/commands/doctor.d.ts +1 -0
- package/dist/cli/src/commands/doctor.js +26 -0
- package/dist/cli/src/commands/doctor.js.map +1 -0
- package/dist/cli/src/commands/init.d.ts +1 -0
- package/dist/cli/src/commands/init.js +52 -0
- package/dist/cli/src/commands/init.js.map +1 -0
- package/dist/cli/src/commands/shared.d.ts +4 -0
- package/dist/cli/src/commands/shared.js +19 -0
- package/dist/cli/src/commands/shared.js.map +1 -0
- package/dist/cli/src/commands/sync.d.ts +1 -0
- package/dist/cli/src/commands/sync.js +27 -0
- package/dist/cli/src/commands/sync.js.map +1 -0
- package/dist/cli/src/commands/validate.d.ts +1 -0
- package/dist/cli/src/commands/validate.js +17 -0
- package/dist/cli/src/commands/validate.js.map +1 -0
- package/dist/cli/src/dev/validateRepositoryContractsCli.d.ts +2 -0
- package/dist/cli/src/dev/validateRepositoryContractsCli.js +37 -0
- package/dist/cli/src/dev/validateRepositoryContractsCli.js.map +1 -0
- package/dist/cli/src/dev/verifyRuntimeSurface.d.ts +2 -0
- package/dist/cli/src/dev/verifyRuntimeSurface.js +344 -0
- package/dist/cli/src/dev/verifyRuntimeSurface.js.map +1 -0
- package/dist/cli/src/dev/verifyWorkflowE2E.d.ts +2 -0
- package/dist/cli/src/dev/verifyWorkflowE2E.js +366 -0
- package/dist/cli/src/dev/verifyWorkflowE2E.js.map +1 -0
- package/dist/cli/src/index.d.ts +2 -0
- package/dist/cli/src/index.js +51 -0
- package/dist/cli/src/index.js.map +1 -0
- package/dist/core/src/artifacts/registry.d.ts +53 -0
- package/dist/core/src/artifacts/registry.js +483 -0
- package/dist/core/src/artifacts/registry.js.map +1 -0
- package/dist/core/src/commands/registry.d.ts +36 -0
- package/dist/core/src/commands/registry.js +539 -0
- package/dist/core/src/commands/registry.js.map +1 -0
- package/dist/core/src/contracts/index.d.ts +23 -0
- package/dist/core/src/contracts/index.js +16 -0
- package/dist/core/src/contracts/index.js.map +1 -0
- package/dist/core/src/contracts/yaml.d.ts +2 -0
- package/dist/core/src/contracts/yaml.js +12 -0
- package/dist/core/src/contracts/yaml.js.map +1 -0
- package/dist/core/src/contracts.d.ts +23 -0
- package/dist/core/src/contracts.js +15 -0
- package/dist/core/src/contracts.js.map +1 -0
- package/dist/core/src/fs/index.d.ts +4 -0
- package/dist/core/src/fs/index.js +28 -0
- package/dist/core/src/fs/index.js.map +1 -0
- package/dist/core/src/fs.d.ts +4 -0
- package/dist/core/src/fs.js +28 -0
- package/dist/core/src/fs.js.map +1 -0
- package/dist/core/src/initOpenWorkflow.d.ts +7 -0
- package/dist/core/src/initOpenWorkflow.js +220 -0
- package/dist/core/src/initOpenWorkflow.js.map +1 -0
- package/dist/core/src/validateOpenWorkflow.d.ts +5 -0
- package/dist/core/src/validateOpenWorkflow.js +145 -0
- package/dist/core/src/validateOpenWorkflow.js.map +1 -0
- package/dist/core/src/validators/validateOpenWorkflow.d.ts +5 -0
- package/dist/core/src/validators/validateOpenWorkflow.js +551 -0
- package/dist/core/src/validators/validateOpenWorkflow.js.map +1 -0
- package/dist/core/src/validators/validateRepositoryContracts.d.ts +2 -0
- package/dist/core/src/validators/validateRepositoryContracts.js +827 -0
- package/dist/core/src/validators/validateRepositoryContracts.js.map +1 -0
- package/dist/core/src/workflow/initOpenWorkflow.d.ts +7 -0
- package/dist/core/src/workflow/initOpenWorkflow.js +182 -0
- package/dist/core/src/workflow/initOpenWorkflow.js.map +1 -0
- package/dist/core/src/yaml.d.ts +2 -0
- package/dist/core/src/yaml.js +12 -0
- package/dist/core/src/yaml.js.map +1 -0
- package/package.json +55 -0
- package/references/artifact-authoring-templates.md +78 -0
- package/references/audit-first-discovery-loop.md +85 -0
- package/references/contract-graph.md +129 -0
- package/references/discovery-artifact-contracts.md +155 -0
- package/references/engineering-skill-reference-research.md +204 -0
- package/references/npm-cli-architecture.md +63 -0
- package/references/runtime-command-surface.md +169 -0
- package/schemas/artifact-contracts.schema.json +130 -0
- package/schemas/change.schema.json +71 -0
- package/schemas/contract-graph.schema.json +80 -0
- package/schemas/decision-record.schema.json +92 -0
- package/schemas/disclosure-levels.schema.json +66 -0
- package/schemas/openworkflow-contract.schema.json +88 -0
- package/schemas/product-design.schema.json +356 -0
- package/schemas/prototype-evidence.schema.json +325 -0
- package/schemas/prototype.schema.json +149 -0
- package/schemas/validation-target.schema.json +127 -0
- package/schemas/validation.schema.json +123 -0
- package/schemas/vision-session.schema.json +78 -0
- package/schemas/work-items.schema.json +87 -0
- package/schemas/workflow-index.schema.json +70 -0
- package/skills/build-prototype/SKILL.md +87 -0
- package/skills/build-prototype/agents/openai.yaml +4 -0
- package/skills/build-prototype/references/prototype-protocol.md +56 -0
- package/skills/build-prototype/scripts/init_prototype.py +260 -0
- package/skills/build-team/SKILL.md +292 -0
- package/skills/build-team/agents/openai.yaml +4 -0
- package/skills/build-team/references/runtime-schema.md +275 -0
- package/skills/build-team/references/team-protocol.md +244 -0
- package/skills/build-team/scripts/init_team_runtime.py +431 -0
- package/skills/build-validation/SKILL.md +81 -0
- package/skills/build-validation/agents/openai.yaml +4 -0
- package/skills/build-validation/references/validation-protocol.md +51 -0
- package/skills/build-validation/scripts/init_validation.py +194 -0
- package/skills/build-workflow/SKILL.md +65 -0
- package/skills/build-workflow/agents/openai.yaml +4 -0
- package/skills/build-workflow/references/workflow-layout.md +57 -0
- package/skills/build-workflow/scripts/init_workflow.py +423 -0
- package/skills/run-team/SKILL.md +93 -0
- package/skills/run-team/agents/openai.yaml +4 -0
- package/skills/run-team/references/delegation-and-agent-lifecycle.md +78 -0
- package/skills/run-team/references/run-loop.md +73 -0
- package/skills/run-team/references/runtime-audit.md +56 -0
- package/skills/run-team/references/scope-selection.md +64 -0
- package/skills/run-team/scripts/audit_team_runtime.py +173 -0
- package/skills/run-team/scripts/init_next_scope.py +304 -0
- package/templates/README.md +5 -0
- package/templates/codex/README.md +4 -0
- package/templates/openworkflow/README.md +4 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
# Runtime Schema Reference
|
|
2
|
+
|
|
3
|
+
Use this reference when creating or reconciling `.codex/runtime/**`.
|
|
4
|
+
|
|
5
|
+
## Directory Layout
|
|
6
|
+
|
|
7
|
+
Required layout:
|
|
8
|
+
|
|
9
|
+
```txt
|
|
10
|
+
.codex/runtime/
|
|
11
|
+
RUNTIME_INDEX.yaml
|
|
12
|
+
STATE_MACHINE.md
|
|
13
|
+
archive/
|
|
14
|
+
scopes/
|
|
15
|
+
<scope_id>/
|
|
16
|
+
SCOPE.yaml
|
|
17
|
+
MILESTONES.yaml
|
|
18
|
+
IMPLEMENT_INDEX.yaml
|
|
19
|
+
IMPLEMENT_ISSUE_INDEX.yaml
|
|
20
|
+
AGENT_ROSTER.yaml
|
|
21
|
+
archive/
|
|
22
|
+
milestones/
|
|
23
|
+
<milestone_id>/
|
|
24
|
+
IMPLEMENT_TASKS.yaml
|
|
25
|
+
IMPLEMENT_ISSUES.yaml
|
|
26
|
+
prompts/
|
|
27
|
+
reviews/
|
|
28
|
+
archive/
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Use `.gitkeep` files in empty `archive/`, `prompts/`, and `reviews/` folders.
|
|
32
|
+
|
|
33
|
+
## RUNTIME_INDEX.yaml
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
active_scope: MVP
|
|
37
|
+
scopes:
|
|
38
|
+
- scope_id: MVP
|
|
39
|
+
title: MVP implementation
|
|
40
|
+
status: active
|
|
41
|
+
source: AGENT.md
|
|
42
|
+
path: .codex/runtime/scopes/MVP/
|
|
43
|
+
base_git_ref: null
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## SCOPE.yaml
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
scope_id: MVP
|
|
50
|
+
title: MVP implementation
|
|
51
|
+
status: active
|
|
52
|
+
source_artifacts:
|
|
53
|
+
- AGENT.md
|
|
54
|
+
base_git_ref: null
|
|
55
|
+
runtime_protocol:
|
|
56
|
+
agent_team_protocol: .codex/agents/README.md
|
|
57
|
+
orchestrator_role: .codex/agents/orchestrator.md
|
|
58
|
+
agent_roster: .codex/runtime/scopes/MVP/AGENT_ROSTER.yaml
|
|
59
|
+
boundary:
|
|
60
|
+
application_roots: []
|
|
61
|
+
protected_roots:
|
|
62
|
+
- .git/
|
|
63
|
+
- .codex/runtime/
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## MILESTONES.yaml
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
scope_id: MVP
|
|
70
|
+
source_artifacts:
|
|
71
|
+
- AGENT.md
|
|
72
|
+
milestones:
|
|
73
|
+
- milestone_id: M01
|
|
74
|
+
title: Repo initialization
|
|
75
|
+
status: planned
|
|
76
|
+
scope: Initialize the repo and workflow contracts.
|
|
77
|
+
target: A runnable baseline with clear ownership and checks.
|
|
78
|
+
dependencies: []
|
|
79
|
+
required_specs:
|
|
80
|
+
- AGENT.md
|
|
81
|
+
expected_artifacts: []
|
|
82
|
+
estimated_atom_tasks: 3-6
|
|
83
|
+
task_file: .codex/runtime/scopes/MVP/milestones/M01/IMPLEMENT_TASKS.yaml
|
|
84
|
+
issue_file: .codex/runtime/scopes/MVP/milestones/M01/IMPLEMENT_ISSUES.yaml
|
|
85
|
+
qa_gate:
|
|
86
|
+
- baseline checks pass
|
|
87
|
+
acceptance:
|
|
88
|
+
- runtime state is current
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## IMPLEMENT_INDEX.yaml
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
scope_id: MVP
|
|
95
|
+
active_milestone: M01
|
|
96
|
+
milestones:
|
|
97
|
+
- milestone_id: M01
|
|
98
|
+
status: active
|
|
99
|
+
title: Repo initialization
|
|
100
|
+
task_file: .codex/runtime/scopes/MVP/milestones/M01/IMPLEMENT_TASKS.yaml
|
|
101
|
+
issue_file: .codex/runtime/scopes/MVP/milestones/M01/IMPLEMENT_ISSUES.yaml
|
|
102
|
+
qa_report: null
|
|
103
|
+
branch: feat/m01-repo-initialization
|
|
104
|
+
last_checkpoint: null
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## IMPLEMENT_TASKS.yaml
|
|
108
|
+
|
|
109
|
+
Each milestone has one task file:
|
|
110
|
+
|
|
111
|
+
```yaml
|
|
112
|
+
tasks:
|
|
113
|
+
- task_id: M01-T001
|
|
114
|
+
milestone_id: M01
|
|
115
|
+
task_name: Initialize workflow baseline
|
|
116
|
+
task_type: implementation
|
|
117
|
+
status: planned
|
|
118
|
+
agent_name: orchestrator
|
|
119
|
+
agent_id: null
|
|
120
|
+
agent_session_policy: persistent
|
|
121
|
+
preferred_agent_id: null
|
|
122
|
+
assigned_at: null
|
|
123
|
+
resumed_from_agent_id: null
|
|
124
|
+
handoff_required: true
|
|
125
|
+
orchestrator_exception: null
|
|
126
|
+
required_artifacts:
|
|
127
|
+
- AGENT.md
|
|
128
|
+
required_tasks: []
|
|
129
|
+
implement_prompt_path: .codex/runtime/scopes/MVP/milestones/M01/prompts/M01-T001.md
|
|
130
|
+
expected_output_artifact: Workflow baseline
|
|
131
|
+
output_artifact_path: []
|
|
132
|
+
owned_paths:
|
|
133
|
+
- .codex/runtime/
|
|
134
|
+
allowed_paths:
|
|
135
|
+
- .codex/runtime/
|
|
136
|
+
forbidden_paths:
|
|
137
|
+
- .git/
|
|
138
|
+
checks_required: []
|
|
139
|
+
artifact_status: missing
|
|
140
|
+
review_status: none
|
|
141
|
+
qa_status: not_run
|
|
142
|
+
is_output_done: false
|
|
143
|
+
notes: ""
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
After assignment, `agent_id` must be a real returned agent id. Use `legacy_untracked` only for historical tasks that predate roster tracking.
|
|
147
|
+
|
|
148
|
+
## AGENT_ROSTER.yaml
|
|
149
|
+
|
|
150
|
+
Each scope owns one agent lifecycle file:
|
|
151
|
+
|
|
152
|
+
```yaml
|
|
153
|
+
scope_id: MVP
|
|
154
|
+
roster_version: 1
|
|
155
|
+
updated_at: null
|
|
156
|
+
lifecycle_status_values:
|
|
157
|
+
- available
|
|
158
|
+
- active
|
|
159
|
+
- idle
|
|
160
|
+
- blocked
|
|
161
|
+
- closed
|
|
162
|
+
- archived
|
|
163
|
+
- legacy_untracked
|
|
164
|
+
session_policies:
|
|
165
|
+
persistent:
|
|
166
|
+
purpose: Keep domain agents mounted across related atom tasks and issue-fix loops.
|
|
167
|
+
reuse_rule: Resume the existing matching agent_id before spawning a replacement.
|
|
168
|
+
event:
|
|
169
|
+
purpose: Run async or one-off review, security, QA, and git drafting work.
|
|
170
|
+
reuse_rule: Close after handoff unless the Orchestrator records a reason to keep it idle.
|
|
171
|
+
persistent_agents:
|
|
172
|
+
- agent_name: frontend-agent
|
|
173
|
+
agent_id: null
|
|
174
|
+
lifecycle_status: available
|
|
175
|
+
session_policy: persistent
|
|
176
|
+
owns:
|
|
177
|
+
- frontend/src/app/
|
|
178
|
+
- frontend/src/components/
|
|
179
|
+
current_task: null
|
|
180
|
+
last_completed_task: null
|
|
181
|
+
active_milestone: null
|
|
182
|
+
notes: Spawn once for frontend work, then resume for related tasks and fixes.
|
|
183
|
+
event_agents:
|
|
184
|
+
- agent_name: code-review-agent
|
|
185
|
+
agent_id: null
|
|
186
|
+
lifecycle_status: available
|
|
187
|
+
session_policy: event
|
|
188
|
+
trigger: artifact_ready
|
|
189
|
+
closes_after_handoff: true
|
|
190
|
+
notes: Writes review artifacts and issue logs, then closes.
|
|
191
|
+
legacy_tracking:
|
|
192
|
+
task_agent_ids_before_roster: legacy_untracked
|
|
193
|
+
note: Do not invent ids for historical null task agent_id values.
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## IMPLEMENT_ISSUES.yaml
|
|
197
|
+
|
|
198
|
+
Milestone-local issue file:
|
|
199
|
+
|
|
200
|
+
```yaml
|
|
201
|
+
issues:
|
|
202
|
+
- id: M01-I001
|
|
203
|
+
task: M01-T001
|
|
204
|
+
severity: major
|
|
205
|
+
status: open
|
|
206
|
+
owner: frontend-agent
|
|
207
|
+
loc: path/to/file.ts:42
|
|
208
|
+
title: Short issue title
|
|
209
|
+
expected: Expected behavior.
|
|
210
|
+
fix_task: null
|
|
211
|
+
review: .codex/runtime/scopes/MVP/milestones/M01/reviews/M01-T001-review.md
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Scope-level issue index:
|
|
215
|
+
|
|
216
|
+
```yaml
|
|
217
|
+
scope_id: MVP
|
|
218
|
+
issues: []
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
Use the scope-level index only for cross-milestone issues, deferred risks, reopened regressions, and architecture-level concerns.
|
|
222
|
+
|
|
223
|
+
## Status Values
|
|
224
|
+
|
|
225
|
+
Task `status`:
|
|
226
|
+
|
|
227
|
+
```txt
|
|
228
|
+
planned, prompted, claimed, in_progress, artifact_ready, review_pending, reviewed, fix_required, qa_ready, done, blocked, archived
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
`artifact_status`:
|
|
232
|
+
|
|
233
|
+
```txt
|
|
234
|
+
missing, created, validated, archived
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
`review_status`:
|
|
238
|
+
|
|
239
|
+
```txt
|
|
240
|
+
none, pending, passed, issues_found, waived
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
`qa_status`:
|
|
244
|
+
|
|
245
|
+
```txt
|
|
246
|
+
not_run, passed, failed, waived
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Milestone `status`:
|
|
250
|
+
|
|
251
|
+
```txt
|
|
252
|
+
planned, active, qa, completed, frozen, blocked, deferred, archived
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Issue `status`:
|
|
256
|
+
|
|
257
|
+
```txt
|
|
258
|
+
open, fixed, waived, deferred, reopened, archived
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Issue `severity`:
|
|
262
|
+
|
|
263
|
+
```txt
|
|
264
|
+
blocker, critical, major, minor, nit
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Maintenance Rules
|
|
268
|
+
|
|
269
|
+
- Update runtime state when task reality changes, not at the end of a session.
|
|
270
|
+
- Update `AGENT_ROSTER.yaml` when agent lifecycle changes.
|
|
271
|
+
- New delegated tasks must not leave `agent_id: null`.
|
|
272
|
+
- Keep YAML compact; put detailed reasoning in `prompts/` and `reviews/`.
|
|
273
|
+
- Archive superseded coordination artifacts instead of deleting them.
|
|
274
|
+
- Freeze completed milestone directories after QA and checkpoint decisions.
|
|
275
|
+
- Do not allow implementation agents to update global runtime indexes unless the Orchestrator assigns an explicit state task.
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# Agent Team Protocol Reference
|
|
2
|
+
|
|
3
|
+
Use this reference when creating `AGENT.md` and `.codex/agents/*.md`.
|
|
4
|
+
|
|
5
|
+
## Operating Priorities
|
|
6
|
+
|
|
7
|
+
P0 Orchestrator focus and delegation boundary:
|
|
8
|
+
|
|
9
|
+
- decompose work into atom tasks and assign or resume eligible subagents before direct execution
|
|
10
|
+
- reserve Orchestrator context for scope, dependency, runtime state, lifecycle, integration, and checkpoint decisions
|
|
11
|
+
- directly edit only runtime state, assignment prompts, coordination protocol, checkpoint metadata, and minimal integration glue unless an exception applies
|
|
12
|
+
- record `orchestrator_exception` when the Orchestrator directly performs implementation, docs, QA, review, or prompt-writing work that a subagent could have owned
|
|
13
|
+
- prefer resuming the persistent agent that owns the relevant domain before spawning a replacement
|
|
14
|
+
|
|
15
|
+
Allowed direct-work exceptions:
|
|
16
|
+
|
|
17
|
+
- no suitable role exists and creating one would be larger than the task
|
|
18
|
+
- an integration conflict requires a small Orchestrator-owned merge adjustment
|
|
19
|
+
- the user explicitly asks the Orchestrator to perform the work directly
|
|
20
|
+
- an urgent blocker prevents safe delegation
|
|
21
|
+
|
|
22
|
+
P1 Git workflow integrity:
|
|
23
|
+
|
|
24
|
+
- inspect `git status --short`, current branch, and recent commits before formal work
|
|
25
|
+
- define the intended checkpoint boundary before edits
|
|
26
|
+
- keep unrelated user changes out of commits
|
|
27
|
+
- include runtime state changes in the same checkpoint when task reality changed
|
|
28
|
+
- record skipped checks in task notes and commit bodies
|
|
29
|
+
- let only the Orchestrator commit unless the user explicitly changes the rule
|
|
30
|
+
|
|
31
|
+
P2 Work state machine and agent lifecycle tracking:
|
|
32
|
+
|
|
33
|
+
- identify active scope, milestone, task, dependencies, and ownership before edits
|
|
34
|
+
- identify `agent_session_policy`, selected agent role, and expected lifecycle before delegation
|
|
35
|
+
- capture the returned `agent_id` after every spawn or resume operation
|
|
36
|
+
- write that `agent_id` to both `AGENT_ROSTER.yaml` and the task entry before delegated work proceeds
|
|
37
|
+
- update `.codex/runtime/` when task ownership, output, review, QA, blocker, or checkpoint state changes
|
|
38
|
+
- update `.codex/runtime/scopes/<scope_id>/AGENT_ROSTER.yaml` when an agent is spawned, resumed, active, idle, blocked, closed, or archived
|
|
39
|
+
- reconcile stale runtime state before starting unrelated work
|
|
40
|
+
- never infer completion from file existence alone
|
|
41
|
+
- never leave `agent_id: null` after assignment; use `legacy_untracked` only for historical tasks that predate roster tracking
|
|
42
|
+
|
|
43
|
+
P3 Source truth, QA, and domain fidelity:
|
|
44
|
+
|
|
45
|
+
- source-of-truth specs govern implementation order and scope
|
|
46
|
+
- TDD or executable checks are required for code work whenever practical
|
|
47
|
+
- review, QA, accessibility, security, and content discipline run inside P0/P1/P2
|
|
48
|
+
|
|
49
|
+
## Required Agent Frontmatter
|
|
50
|
+
|
|
51
|
+
Each `.codex/agents/<role>.md` file should start with:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
---
|
|
55
|
+
name: kebab-case-agent-name
|
|
56
|
+
description: One-sentence role summary.
|
|
57
|
+
agent_type: orchestration | planning | implementation | qa | review | security | git | docs | data | infra
|
|
58
|
+
version: 1.0
|
|
59
|
+
required_skills: []
|
|
60
|
+
optional_skills: []
|
|
61
|
+
required_reads: []
|
|
62
|
+
inputs: []
|
|
63
|
+
outputs: []
|
|
64
|
+
owns: []
|
|
65
|
+
forbidden_paths: []
|
|
66
|
+
allowed_behavior: []
|
|
67
|
+
can_modify_code: false
|
|
68
|
+
can_commit: false
|
|
69
|
+
invoked_by: orchestrator | user
|
|
70
|
+
---
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
These fields describe coordination boundaries. They do not grant runtime permissions.
|
|
74
|
+
|
|
75
|
+
## Core Roles
|
|
76
|
+
|
|
77
|
+
### orchestrator
|
|
78
|
+
|
|
79
|
+
Purpose: Own the implementation state machine, runtime artifacts, integration, and git checkpoint decisions.
|
|
80
|
+
|
|
81
|
+
Required behavior:
|
|
82
|
+
|
|
83
|
+
- read `AGENT.md`, `.codex/agents/README.md`, and source-of-truth docs
|
|
84
|
+
- own `.codex/runtime/**`
|
|
85
|
+
- create scope, milestone, task, prompt, review, issue, QA, and checkpoint state
|
|
86
|
+
- assign subagents only after dependencies, ownership, and prompt paths are clear
|
|
87
|
+
- maintain `AGENT_ROSTER.yaml`
|
|
88
|
+
- capture every returned subagent `agent_id` and write it into runtime state
|
|
89
|
+
- resume persistent agents for related atom tasks and issue-fix loops
|
|
90
|
+
- integrate outputs and decide commits
|
|
91
|
+
- never delegate away final state and git responsibility
|
|
92
|
+
- never default to doing implementation, docs, QA, review, or prompt-writing work directly when an eligible subagent can own it
|
|
93
|
+
|
|
94
|
+
Typical outputs:
|
|
95
|
+
|
|
96
|
+
- `.codex/runtime/RUNTIME_INDEX.yaml`
|
|
97
|
+
- `.codex/runtime/scopes/<scope_id>/**`
|
|
98
|
+
- `.codex/runtime/scopes/<scope_id>/AGENT_ROSTER.yaml`
|
|
99
|
+
- assignment prompts
|
|
100
|
+
- milestone QA/checkpoint updates
|
|
101
|
+
|
|
102
|
+
### tech-prompt-agent
|
|
103
|
+
|
|
104
|
+
Purpose: Convert atom tasks into implementation prompts.
|
|
105
|
+
|
|
106
|
+
Boundary:
|
|
107
|
+
|
|
108
|
+
- may write only `.codex/runtime/scopes/<scope_id>/milestones/<milestone_id>/prompts/`
|
|
109
|
+
- must not edit implementation files
|
|
110
|
+
- must not commit
|
|
111
|
+
|
|
112
|
+
Prompt contents:
|
|
113
|
+
|
|
114
|
+
- mission
|
|
115
|
+
- required reads
|
|
116
|
+
- ownership
|
|
117
|
+
- TDD or executable check requirement
|
|
118
|
+
- implementation contract
|
|
119
|
+
- UX/accessibility/security contract where relevant
|
|
120
|
+
- non-goals
|
|
121
|
+
- expected artifacts
|
|
122
|
+
- done criteria
|
|
123
|
+
|
|
124
|
+
### implementation agents
|
|
125
|
+
|
|
126
|
+
Purpose: Build scoped product artifacts.
|
|
127
|
+
|
|
128
|
+
Select names from the repo domain:
|
|
129
|
+
|
|
130
|
+
- `frontend-agent`
|
|
131
|
+
- `backend-agent`
|
|
132
|
+
- `content-schema-agent`
|
|
133
|
+
- `data-agent`
|
|
134
|
+
- `infra-agent`
|
|
135
|
+
- `docs-agent`
|
|
136
|
+
- `migration-agent`
|
|
137
|
+
|
|
138
|
+
Boundary:
|
|
139
|
+
|
|
140
|
+
- edit only assigned `owned_paths` and `allowed_paths`
|
|
141
|
+
- never edit global runtime indexes unless explicitly assigned a runtime task
|
|
142
|
+
- never commit
|
|
143
|
+
- report exact files changed, checks run, output artifacts, risks, and task id
|
|
144
|
+
|
|
145
|
+
### tdd-qa-agent
|
|
146
|
+
|
|
147
|
+
Purpose: Define and run tests, executable checks, and milestone QA.
|
|
148
|
+
|
|
149
|
+
Boundary:
|
|
150
|
+
|
|
151
|
+
- may write tests and QA reports
|
|
152
|
+
- may write `.codex/runtime/scopes/<scope_id>/milestones/<milestone_id>/reviews/*-qa.md`
|
|
153
|
+
- should not implement product behavior unless assigned a fix task
|
|
154
|
+
- must not commit
|
|
155
|
+
|
|
156
|
+
### code-review-agent
|
|
157
|
+
|
|
158
|
+
Purpose: Review completed artifacts asynchronously.
|
|
159
|
+
|
|
160
|
+
Boundary:
|
|
161
|
+
|
|
162
|
+
- may write review Markdown and update milestone-local issue logs
|
|
163
|
+
- must not edit implementation files
|
|
164
|
+
- must not commit
|
|
165
|
+
|
|
166
|
+
Finding priorities:
|
|
167
|
+
|
|
168
|
+
- correctness
|
|
169
|
+
- source-truth alignment
|
|
170
|
+
- task ownership drift
|
|
171
|
+
- TDD/check gaps
|
|
172
|
+
- maintainability
|
|
173
|
+
- accessibility and responsive behavior where relevant
|
|
174
|
+
- typed contracts and schema drift where relevant
|
|
175
|
+
- security-sensitive mistakes where relevant
|
|
176
|
+
|
|
177
|
+
### security-review-agent
|
|
178
|
+
|
|
179
|
+
Purpose: Review secrets, auth, external input, APIs, file uploads, dependencies, deployment, analytics, and infrastructure.
|
|
180
|
+
|
|
181
|
+
Boundary:
|
|
182
|
+
|
|
183
|
+
- invoke only when security-sensitive scope exists
|
|
184
|
+
- write security review artifacts and issue entries
|
|
185
|
+
- do not edit implementation files
|
|
186
|
+
- critical or blocker findings must be resolved before milestone completion
|
|
187
|
+
|
|
188
|
+
### git-release-agent
|
|
189
|
+
|
|
190
|
+
Purpose: Draft branch strategy, checkpoint boundaries, commit messages, PR text, and release notes.
|
|
191
|
+
|
|
192
|
+
Boundary:
|
|
193
|
+
|
|
194
|
+
- inspect runtime and git status
|
|
195
|
+
- draft only
|
|
196
|
+
- final staging, commit, push, and PR actions remain with the Orchestrator unless the user explicitly changes the rule
|
|
197
|
+
|
|
198
|
+
## Assignment Rules
|
|
199
|
+
|
|
200
|
+
- Assign implementation work only when `implement_prompt_path` exists.
|
|
201
|
+
- Assign delegated work only after selecting `agent_session_policy: persistent | event`.
|
|
202
|
+
- Spawn or resume the agent, then immediately record the returned `agent_id`.
|
|
203
|
+
- Update both `AGENT_ROSTER.yaml` and `IMPLEMENT_TASKS.yaml` with the same `agent_id`.
|
|
204
|
+
- Assign parallel tasks only when `owned_paths` are disjoint.
|
|
205
|
+
- Mark runtime state before or immediately after real work state changes.
|
|
206
|
+
- Convert unresolved review findings into fix tasks before milestone QA.
|
|
207
|
+
- Route fix tasks back to the original persistent implementation `agent_id` when that agent is still available and ownership still matches.
|
|
208
|
+
- Do not start the next milestone while blocker, critical, or required major issues remain open in the current milestone.
|
|
209
|
+
|
|
210
|
+
## Agent Session Topology
|
|
211
|
+
|
|
212
|
+
Persistent agents preserve memory across related work. Use them for planning and repeated implementation domains:
|
|
213
|
+
|
|
214
|
+
- `tech-prompt-agent`
|
|
215
|
+
- `frontend-agent`
|
|
216
|
+
- `backend-agent`
|
|
217
|
+
- `content-schema-agent`
|
|
218
|
+
- `data-agent`
|
|
219
|
+
- `infra-agent`
|
|
220
|
+
- `docs-agent`
|
|
221
|
+
- `migration-agent`
|
|
222
|
+
|
|
223
|
+
Event-driven agents run asynchronously or one-off and close after handoff:
|
|
224
|
+
|
|
225
|
+
- `code-review-agent`
|
|
226
|
+
- `security-review-agent`
|
|
227
|
+
- `tdd-qa-agent` unless it is actively authoring a long test suite across tasks
|
|
228
|
+
- `git-release-agent`
|
|
229
|
+
|
|
230
|
+
Asynchronous review is allowed. For example, a persistent frontend agent may work on `M02` while an event-driven review agent reviews `M01`. If review finds issues, it writes `M01` issues. The Orchestrator later converts them into fix tasks and resumes the original persistent implementation agent when possible.
|
|
231
|
+
|
|
232
|
+
## Handoff Contract
|
|
233
|
+
|
|
234
|
+
All agents return:
|
|
235
|
+
|
|
236
|
+
- task id
|
|
237
|
+
- summary
|
|
238
|
+
- files changed or artifacts written
|
|
239
|
+
- checks run and results
|
|
240
|
+
- skipped checks with reasons
|
|
241
|
+
- known risks
|
|
242
|
+
- next recommended state transition
|
|
243
|
+
|
|
244
|
+
The Orchestrator uses this handoff to update runtime state and decide checkpoint commits.
|