You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,22 +14,25 @@ The main agent must run every workflow with this protocol.
14
14
15
15
1. Read `AGENTS.md`, then `.agents/roles.md`, then this file.
16
16
2. Select one workflow from this file.
17
-
3. Create the task packet.
18
-
4. Assign only the roles required by the selected workflow.
19
-
5. Assign each role a model tier from `.agents/roles.md`.
20
-
6. Keep `Primary` roles with the active main agent.
21
-
7. Find the exact custom agent name in `.agents/roles.md` and its matching `.codex/agents/<name>.toml` before dispatching a `Lightweight` or `Fast` role.
22
-
8. Create the role as a side task connected to the current main task with `spawn_agent.task_name` set to that exact name, or use `Option-Command-S` from the UI sidebar for the same connected dispatch surface.
23
-
9. Do not use external `codex exec`, a separate user-owned `create_thread`, or an arbitrary `task_name` for repository role dispatch.
24
-
10. Reuse the existing role agent with `followup_task` when assigning later work to the same role.
25
-
11. Return every delegated role result to the current main task for `Primary` review and integration.
26
-
12. Do not complete a required `Lightweight` or `Fast` role directly in `Primary`, and do not substitute a generic sub-agent for the configured custom agent.
27
-
13. Dispatch read-only `Lightweight` or `Fast` roles in parallel only when they do not depend on unfinished edits.
28
-
14. Keep `Primary` editing roles sequential unless the files and ownership boundaries are disjoint.
29
-
15. Integrate role outputs.
30
-
16. Escalate any `Lightweight` or `Fast` blocker to a `Primary` model before editing.
31
-
17. Run completion gates.
32
-
18. Report changed files, architecture decision, verification result, delegated roles, model tiers used, and unresolved decisions.
17
+
3. For non-trivial work, have Planner create a `Design Brief`.
18
+
4. Dispatch `Designer` and obtain its `Designer Result`.
19
+
5. Obtain user approval, then persist the approved result as a Spec under `.agents/specs/`.
20
+
6. Have Planner create a `Task Packet` from only the approved Spec.
21
+
7. Assign only the roles required by the selected workflow.
22
+
8. Assign each role a model tier from `.agents/roles.md`.
23
+
9. Keep `Primary` roles with the active main agent.
24
+
10. Find the exact custom agent name in `.agents/roles.md` and its matching `.codex/agents/<name>.toml` before dispatching an `SDD Gate`, `Lightweight`, or `Fast` role.
25
+
11. Create the role as a side task connected to the current main task with `spawn_agent.task_name` set to that exact name, or use `Option-Command-S` from the UI sidebar for the same connected dispatch surface.
26
+
12. Do not use external `codex exec`, a separate user-owned `create_thread`, or an arbitrary `task_name` for repository role dispatch.
27
+
13. Reuse the existing role agent with `followup_task` when assigning later work to the same role.
28
+
14. Return every delegated role result to the current main task for `Primary` review and integration.
29
+
15. Do not complete a required `SDD Gate`, `Lightweight`, or `Fast` role directly in `Primary`, and do not substitute a generic sub-agent for the configured custom agent.
30
+
16. Dispatch read-only `SDD Gate`, `Lightweight`, or `Fast` roles in parallel only when they do not depend on unfinished edits.
31
+
17. Keep `Primary` editing roles sequential unless the files and ownership boundaries are disjoint.
32
+
18. Integrate role outputs.
33
+
19. Escalate any `SDD Gate`, `Lightweight`, or `Fast` blocker to a `Primary` model before editing.
34
+
20. Run completion gates.
35
+
21. Report changed files, Spec path, acceptance-criterion evidence, architecture decision, verification result, delegated roles, model tiers used, and unresolved decisions.
33
36
34
37
Do not skip the task packet. The task packet is the contract between models.
35
38
@@ -38,9 +41,11 @@ Do not skip the task packet. The task packet is the contract between models.
38
41
Stop and ask the user before editing when:
39
42
40
43
- The task packet conflicts with `AGENTS.md`.
44
+
- A non-trivial task lacks an approved Spec or its `Task Packet` does not cite the Spec path and acceptance criteria.
45
+
- A requirement or scope change needs a Spec update and user reapproval.
41
46
- The requested fix requires relaxing a layer boundary.
42
47
- A role needs to run, launch, install, boot, or open the app or Simulator.
43
-
- A required `Lightweight` or `Fast` custom agent cannot be loaded or selected through the connected side-task surface with its exact `task_name`, the matching `*_luna` fallback cannot be selected after Spark is unavailable, or current tool policy requires user permission that has not been granted.
48
+
- A required `SDD Gate`, `Lightweight`, or `Fast` custom agent cannot be loaded or selected through the connected side-task surface with its exact `task_name`, the matching `*_luna` fallback cannot be selected after Spark is unavailable, or current tool policy requires user permission that has not been granted.
44
49
- The current issue or PR scope is unclear after live GitHub inspection.
45
50
- Two editing roles would touch the same file.
46
51
- A read-only role reports `Block` or `Needs Owner Decision`.
@@ -66,37 +71,43 @@ Use when implementing a live issue or user-scoped code change.
66
71
### Role order
67
72
68
73
1. GitHub/CI Analyst, if live issue or PR state matters.
69
-
2. Planner.
70
-
3. Architecture Watcher, if `Architecture risk` is `possible` or `confirmed`.
71
-
4. Implementer.
72
-
5. Code Reviewer.
73
-
6. Verification Runner.
74
-
7. Documentation Writer, if PR, release, or issue text is needed.
74
+
2. Planner creates a `Design Brief`.
75
+
3. Designer returns a `Designer Result`; the user approves it.
76
+
4. Planner persists the approved Spec and creates a `Task Packet` from it.
77
+
5. Architecture Watcher, if `Architecture risk` is `possible` or `confirmed`.
78
+
6. Implementer.
79
+
7. Code Reviewer.
80
+
8. Verification Runner.
81
+
9. Documentation Writer, if PR, release, or issue text is needed.
75
82
76
83
### Task packet source
77
84
78
85
```md
79
86
## Task Packet
80
87
81
88
- Source: <issue URL, PR URL, or user request>
89
+
- Approved Spec: <.agents/specs/... path>
82
90
- Goal:
83
91
- Scope:
84
92
- Out of scope:
93
+
- Acceptance criteria: <approvedSpeccriteria>
85
94
- Expected changed files:
86
95
- Current owner:
87
96
- Architecture risk: none / possible / confirmed
88
97
- Required roles:
89
98
- Model assignment:
99
+
- Execution authority: app or Simulator / external writes / CI or PR actions
90
100
- Verification:
91
101
- Stop conditions:
92
102
```
93
103
94
104
### Execution
95
105
106
+
- Planner must not create a `Task Packet` before the user approves the `Designer Result` and its Spec is persisted.
96
107
- Planner must identify the owning layer and target before Implementer edits Swift code.
97
108
- Implementer must edit only files listed in the task packet unless Planner updates the packet.
98
-
- Code Reviewer must check scope drift before style concerns.
99
-
- Verification Runner must run changed-file SwiftLint for Swift changes and build-only checks when applicable.
109
+
- Code Reviewer must check Spec acceptance-criterion coverage and scope drift before style concerns.
110
+
- Verification Runner must record evidence for every Spec acceptance criterion, then run changed-file SwiftLint for Swift changes and build-only checks when applicable.
100
111
101
112
### Completion
102
113
@@ -106,6 +117,7 @@ Report:
106
117
## Workflow Result
107
118
108
119
- Workflow: Issue-driven implementation
120
+
- Approved Spec:
109
121
- Changed files:
110
122
- Architecture decision:
111
123
- Verification:
@@ -118,12 +130,14 @@ Use when the task touches module boundaries, file ownership, layer dependencies,
118
130
119
131
### Role order
120
132
121
-
1. Planner.
122
-
2. Architecture Watcher before editing.
123
-
3. Implementer, only after Architecture Watcher returns `Pass`.
124
-
4. Architecture Watcher after editing, if imports, target dependencies, or ownership changed.
125
-
5. Code Reviewer.
126
-
6. Verification Runner.
133
+
1. Planner creates a `Design Brief`.
134
+
2. Designer returns a `Designer Result`; the user approves it.
135
+
3. Planner persists the approved Spec and creates a `Task Packet` from it.
136
+
4. Architecture Watcher before editing.
137
+
5. Implementer, only after Architecture Watcher returns `Pass`.
138
+
6. Architecture Watcher after editing, if imports, target dependencies, or ownership changed.
139
+
7. Code Reviewer.
140
+
8. Verification Runner.
127
141
128
142
### Architecture Watcher gate
129
143
@@ -153,6 +167,7 @@ Report:
153
167
## Workflow Result
154
168
155
169
- Workflow: Architecture-sensitive implementation
170
+
- Approved Spec:
156
171
- Architecture Watcher verdict:
157
172
- Changed files:
158
173
- Boundary decision:
@@ -167,19 +182,21 @@ Use when the user asks to address PR review comments or unresolved review thread
167
182
### Role order
168
183
169
184
1. GitHub/CI Analyst.
170
-
2. Planner.
171
-
3. Architecture Watcher, if a requested fix touches architecture-sensitive areas.
172
-
4. Implementer.
173
-
5. Code Reviewer.
174
-
6. Verification Runner.
175
-
7. GitHub/CI Analyst, only if the user requested replies or thread resolution.
185
+
2. Planner creates a `Design Brief`.
186
+
3. Designer returns a `Designer Result`; the user approves it.
187
+
4. Planner persists the approved Spec and creates a `Task Packet` from it.
188
+
5. Architecture Watcher, if a requested fix touches architecture-sensitive areas.
189
+
6. Implementer.
190
+
7. Code Reviewer.
191
+
8. Verification Runner.
192
+
9. GitHub/CI Analyst, only if the user requested replies or thread resolution.
176
193
177
194
### Execution
178
195
179
196
- GitHub/CI Analyst must use thread-aware inspection when unresolved review threads matter.
180
-
- Planner must classify each comment as required, optional, already handled, or rejected.
197
+
- Planner must classify each comment as required, optional, already handled, or rejected in the `Design Brief`.
181
198
- Implementer must apply only accepted fixes.
182
-
- Code Reviewer must verify that the final diff addresses the accepted comments without unrelated cleanup.
199
+
- Code Reviewer must verify that the final diff addresses the approved Spec and accepted comments without unrelated cleanup.
183
200
- GitHub/CI Analyst must mirror the existing PR reply style when replying.
184
201
185
202
### Completion
@@ -190,6 +207,7 @@ Report:
190
207
## Workflow Result
191
208
192
209
- Workflow: Review-thread follow-up
210
+
- Approved Spec:
193
211
- Addressed comments:
194
212
- Deferred or rejected comments:
195
213
- Changed files:
@@ -204,11 +222,13 @@ Use when GitHub Actions, merge-risk-watch, release, TestFlight, App Store, or PR
204
222
### Role order
205
223
206
224
1. GitHub/CI Analyst.
207
-
2. Planner.
208
-
3. Verification Runner, if a local reproduction is possible without launching the app.
209
-
4. Implementer, only after a concrete root cause is identified.
210
-
5. Code Reviewer.
211
-
6. Verification Runner.
225
+
2. Planner creates a `Design Brief`.
226
+
3. Designer returns a `Designer Result`; the user approves it.
227
+
4. Planner persists the approved Spec and creates a `Task Packet` from it.
228
+
5. Verification Runner, if a local reproduction is possible without launching the app.
229
+
6. Implementer, only after a concrete root cause is identified in the approved Spec.
230
+
7. Code Reviewer.
231
+
8. Verification Runner.
212
232
213
233
### Execution
214
234
@@ -225,6 +245,7 @@ Report:
225
245
## Workflow Result
226
246
227
247
- Workflow: CI failure triage
248
+
- Approved Spec:
228
249
- Failing run:
229
250
- Root cause:
230
251
- Changed files:
@@ -238,14 +259,17 @@ Use for PR body, issue text, release note, README wording, review reply draft, o
238
259
239
260
### Role order
240
261
241
-
1. Documentation Writer.
242
-
2. Code Reviewer, if wording must match a diff.
243
-
3. GitHub/CI Analyst, if live issue, PR, or release state matters.
244
-
4. Verification Runner, for file presence and Markdown checks when files changed.
262
+
1. Planner and Designer, when the documentation change is non-trivial.
263
+
2. User approval and Spec persistence, when a Designer Result is required.
264
+
3. Documentation Writer.
265
+
4. Code Reviewer, if wording must match a diff.
266
+
5. GitHub/CI Analyst, if live issue, PR, or release state matters.
267
+
6. Verification Runner, for file presence and Markdown checks when files changed.
245
268
246
269
### Execution
247
270
248
271
- Documentation Writer must inspect the actual diff before writing PR or release text.
272
+
- For non-trivial documentation changes, Documentation Writer must use the approved Spec and task packet scope.
249
273
- When the Documentation Writer role is required, the main agent must dispatch the draft through `documentation_writer` before writing the final response.
250
274
- If dispatch requires explicit user permission and it has not been granted, ask before drafting, returning, or posting the Documentation Writer output.
251
275
-`Primary` must review the Documentation Writer output against the template, issue scope, and diff before returning or posting it.
@@ -273,10 +297,12 @@ Use for `AGENTS.md`, `.agents/roles.md`, this file, `.agents/rules`, or AI role
273
297
274
298
### Role order
275
299
276
-
1. Planner.
277
-
2. Implementer.
278
-
3. Code Reviewer.
279
-
4. Verification Runner.
300
+
1. Planner creates a `Design Brief`.
301
+
2. Designer returns a `Designer Result`; the user approves it.
302
+
3. Planner persists the approved Spec and creates a `Task Packet` from it.
303
+
4. Implementer.
304
+
5. Code Reviewer.
305
+
6. Verification Runner.
280
306
281
307
Architecture Watcher is required only if the change modifies architecture policy, layer maps, ambiguity gates, or architecture rules.
282
308
@@ -290,16 +316,31 @@ Architecture Watcher is required only if the change modifies architecture policy
290
316
-`.agents/rules/general.md` should define general logic preservation, response style, and Swift coding rules.
291
317
-`.agents/rules/architecture.md` should define detailed architecture boundaries and ambiguity gates.
292
318
-`.agents/rules/project-workflows.md` should define project-specific verification and delivery rules.
319
+
-`.agents/specs/` should define the approved Spec format and change-control rule.
0 commit comments