Skip to content

Commit 3ceb3c1

Browse files
committed
docs: SDD workflow와 검증 게이트 정리
1 parent 1917b08 commit 3ceb3c1

1 file changed

Lines changed: 114 additions & 64 deletions

File tree

.agents/workflows.md

Lines changed: 114 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,25 @@ The main agent must run every workflow with this protocol.
1414

1515
1. Read `AGENTS.md`, then `.agents/roles.md`, then this file.
1616
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.
3336

3437
Do not skip the task packet. The task packet is the contract between models.
3538

@@ -38,9 +41,11 @@ Do not skip the task packet. The task packet is the contract between models.
3841
Stop and ask the user before editing when:
3942

4043
- 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.
4146
- The requested fix requires relaxing a layer boundary.
4247
- 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.
4449
- The current issue or PR scope is unclear after live GitHub inspection.
4550
- Two editing roles would touch the same file.
4651
- 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.
6671
### Role order
6772

6873
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.
7582

7683
### Task packet source
7784

7885
```md
7986
## Task Packet
8087

8188
- Source: <issue URL, PR URL, or user request>
89+
- Approved Spec: <.agents/specs/... path>
8290
- Goal:
8391
- Scope:
8492
- Out of scope:
93+
- Acceptance criteria: <approved Spec criteria>
8594
- Expected changed files:
8695
- Current owner:
8796
- Architecture risk: none / possible / confirmed
8897
- Required roles:
8998
- Model assignment:
99+
- Execution authority: app or Simulator / external writes / CI or PR actions
90100
- Verification:
91101
- Stop conditions:
92102
```
93103

94104
### Execution
95105

106+
- Planner must not create a `Task Packet` before the user approves the `Designer Result` and its Spec is persisted.
96107
- Planner must identify the owning layer and target before Implementer edits Swift code.
97108
- 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.
100111

101112
### Completion
102113

@@ -106,6 +117,7 @@ Report:
106117
## Workflow Result
107118

108119
- Workflow: Issue-driven implementation
120+
- Approved Spec:
109121
- Changed files:
110122
- Architecture decision:
111123
- Verification:
@@ -118,12 +130,14 @@ Use when the task touches module boundaries, file ownership, layer dependencies,
118130

119131
### Role order
120132

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.
127141

128142
### Architecture Watcher gate
129143

@@ -153,6 +167,7 @@ Report:
153167
## Workflow Result
154168

155169
- Workflow: Architecture-sensitive implementation
170+
- Approved Spec:
156171
- Architecture Watcher verdict:
157172
- Changed files:
158173
- Boundary decision:
@@ -167,19 +182,21 @@ Use when the user asks to address PR review comments or unresolved review thread
167182
### Role order
168183

169184
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.
176193

177194
### Execution
178195

179196
- 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`.
181198
- 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.
183200
- GitHub/CI Analyst must mirror the existing PR reply style when replying.
184201

185202
### Completion
@@ -190,6 +207,7 @@ Report:
190207
## Workflow Result
191208

192209
- Workflow: Review-thread follow-up
210+
- Approved Spec:
193211
- Addressed comments:
194212
- Deferred or rejected comments:
195213
- Changed files:
@@ -204,11 +222,13 @@ Use when GitHub Actions, merge-risk-watch, release, TestFlight, App Store, or PR
204222
### Role order
205223

206224
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.
212232

213233
### Execution
214234

@@ -225,6 +245,7 @@ Report:
225245
## Workflow Result
226246

227247
- Workflow: CI failure triage
248+
- Approved Spec:
228249
- Failing run:
229250
- Root cause:
230251
- Changed files:
@@ -238,14 +259,17 @@ Use for PR body, issue text, release note, README wording, review reply draft, o
238259

239260
### Role order
240261

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.
245268

246269
### Execution
247270

248271
- 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.
249273
- When the Documentation Writer role is required, the main agent must dispatch the draft through `documentation_writer` before writing the final response.
250274
- If dispatch requires explicit user permission and it has not been granted, ask before drafting, returning, or posting the Documentation Writer output.
251275
- `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
273297

274298
### Role order
275299

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.
280306

281307
Architecture Watcher is required only if the change modifies architecture policy, layer maps, ambiguity gates, or architecture rules.
282308

@@ -290,16 +316,31 @@ Architecture Watcher is required only if the change modifies architecture policy
290316
- `.agents/rules/general.md` should define general logic preservation, response style, and Swift coding rules.
291317
- `.agents/rules/architecture.md` should define detailed architecture boundaries and ambiguity gates.
292318
- `.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.
293320

294321
### Verification
295322

296323
Verification Runner must run:
297324

298325
```sh
299-
git diff --check -- AGENTS.md .agents .codex/agents README.md
326+
git diff --check -- AGENTS.md .agents .codex/agents
327+
```
328+
329+
Verification Runner must also confirm the configured role names, model assignments, and fallback files:
330+
331+
```sh
332+
test -f .codex/agents/designer.toml
333+
test ! -e .codex/agents/designer_luna.toml
334+
test ! -e .codex/agents/code_reviewer_luna.toml
335+
rg -qx 'name = "designer"' .codex/agents/designer.toml
336+
rg -qx 'model = "gpt-5.6-sol"' .codex/agents/designer.toml
337+
rg -qx 'model_reasoning_effort = "xhigh"' .codex/agents/designer.toml
338+
rg -qx 'name = "code_reviewer"' .codex/agents/code_reviewer.toml
339+
rg -qx 'model = "gpt-5.6-sol"' .codex/agents/code_reviewer.toml
340+
rg -qx 'model_reasoning_effort = "xhigh"' .codex/agents/code_reviewer.toml
300341
```
301342

302-
If only Markdown workflow files changed, no iOS build is required.
343+
If only Markdown workflow files and agent TOML files changed, no iOS build is required.
303344

304345
### Completion
305346

@@ -309,6 +350,7 @@ Report:
309350
## Workflow Result
310351

311352
- Workflow: AI workflow maintenance
353+
- Approved Spec:
312354
- Changed files:
313355
- Operational change:
314356
- Verification:
@@ -321,13 +363,14 @@ Use only side tasks connected to the current main task for parallel role dispatc
321363

322364
Parallelize only these combinations:
323365

324-
- GitHub/CI Analyst reading live GitHub state while Planner inspects local files.
366+
- GitHub/CI Analyst reading live GitHub state while Planner inspects local files for a `Design Brief`.
325367
- Architecture Watcher reviewing boundaries while Code Reviewer reviews non-architecture risks after the diff is complete.
326368
- Documentation Writer drafting PR text while Verification Runner runs checks, after the diff is stable.
327369

328370
Do not parallelize:
329371

330372
- Two Implementers over overlapping files.
373+
- Designer and Implementer before user approval and Spec persistence.
331374
- Implementer and Code Reviewer before Implementer finishes the diff.
332375
- Verification Runner before the relevant files are saved.
333376
- GitHub write actions with local code edits.
@@ -337,6 +380,7 @@ Do not parallelize:
337380
Use the activation template from `.agents/roles.md`, then set `<Role Name>` to one of:
338381

339382
- `Planner`
383+
- `Designer`
340384
- `Implementer`
341385
- `Architecture Watcher`
342386
- `Code Reviewer`
@@ -354,18 +398,21 @@ Include the selected workflow name in the task packet `Source` or `Goal` field s
354398
## Task Packet
355399

356400
- Source: https://github.com/opficdev/DevLog_iOS/issues/704
401+
- Approved Spec: `.agents/specs/704-ai-role-workflow.md`
357402
- Goal: Define AI agent roles and executable role-based workflows for this repository.
358403
- Scope: Update root AI workflow files and README visual summary only.
359404
- Out of scope: Swift/iOS app code, target dependency changes, architecture rule relocation, GitHub Actions changes, app launch.
360-
- Expected changed files: `AGENTS.md`, `.agents/roles.md`, `.agents/workflows.md`, `README.md`
405+
- Acceptance criteria: approved Spec의 역할, 모델, 실행 흐름, 검증 조건
406+
- Expected changed files: `AGENTS.md`, `.agents/roles.md`, `.agents/workflows.md`, `.agents/specs/README.md`
361407
- Current owner: repository workflow documentation
362408
- Architecture risk: none
363-
- Required roles: Planner, Implementer, Code Reviewer, Verification Runner
364-
- Model assignment: Planner=Primary, Implementer=Primary, Code Reviewer=code_reviewer (Lightweight), Verification Runner=verification_runner (Lightweight)
365-
- Custom agent `task_name`: Code Reviewer=`code_reviewer`, Verification Runner=`verification_runner`
409+
- Required roles: Planner, Designer, Implementer, Code Reviewer, Verification Runner
410+
- Model assignment: Planner=Primary, Designer=designer (SDD Gate, `gpt-5.6-sol`, `xhigh`), Implementer=Primary, Code Reviewer=code_reviewer (SDD Gate, `gpt-5.6-sol`, `xhigh`), Verification Runner=verification_runner (Lightweight)
411+
- Custom agent `task_name`: Designer=`designer`, Code Reviewer=`code_reviewer`, Verification Runner=`verification_runner`
366412
- Result recipient: `Primary` of the current main task
367-
- Verification: `git diff --check -- AGENTS.md .agents .codex/agents README.md`
368-
- Stop conditions: README `docs/` asset policy changes, Swift/iOS code changes, request to remove architecture rules immediately
413+
- Execution authority: app or Simulator=not allowed / external writes=not allowed / CI or PR actions=not allowed
414+
- Verification: `git diff --check -- AGENTS.md .agents .codex/agents`
415+
- Stop conditions: missing user approval for the Spec, Swift/iOS code changes, request to remove architecture rules immediately
369416
```
370417

371418
### Review-thread follow-up example
@@ -374,16 +421,19 @@ Include the selected workflow name in the task packet `Source` or `Goal` field s
374421
## Task Packet
375422

376423
- Source: <PR URL or review thread URL>
424+
- Approved Spec: <.agents/specs/... path>
377425
- Goal: Address accepted review feedback without expanding PR scope.
378426
- Scope: Apply only required review fixes confirmed by GitHub/CI Analyst and Planner.
379427
- Out of scope: Optional suggestions, unrelated cleanup, new architecture policy, app launch.
428+
- Acceptance criteria: <approved Spec criteria>
380429
- Expected changed files: <filled by Planner after reading threads>
381430
- Current owner: <layer and target identified by Planner>
382431
- Architecture risk: none / possible / confirmed
383-
- Required roles: GitHub/CI Analyst, Planner, Implementer, Code Reviewer, Verification Runner
384-
- Model assignment: GitHub/CI Analyst=github_ci_analyst (Lightweight), Planner=Primary, Implementer=Primary, Code Reviewer=code_reviewer (Lightweight) -> Primary if blocking, Verification Runner=verification_runner (Lightweight)
385-
- Custom agent `task_name`: GitHub/CI Analyst=`github_ci_analyst`, Code Reviewer=`code_reviewer`, Verification Runner=`verification_runner`
432+
- Required roles: GitHub/CI Analyst, Planner, Designer, Implementer, Code Reviewer, Verification Runner
433+
- Model assignment: GitHub/CI Analyst=github_ci_analyst (Lightweight), Planner=Primary, Designer=designer (SDD Gate, `gpt-5.6-sol`, `xhigh`), Implementer=Primary, Code Reviewer=code_reviewer (SDD Gate, `gpt-5.6-sol`, `xhigh`), Verification Runner=verification_runner (Lightweight)
434+
- Custom agent `task_name`: GitHub/CI Analyst=`github_ci_analyst`, Designer=`designer`, Code Reviewer=`code_reviewer`, Verification Runner=`verification_runner`
386435
- Result recipient: `Primary` of the current main task
436+
- Execution authority: app or Simulator=not allowed / external writes=only user-authorized reply or resolution / CI or PR actions=inspection only
387437
- Verification: changed-file SwiftLint for Swift changes, targeted tests or build-only check when applicable
388438
- Stop conditions: unresolved thread requires owner decision, fix relaxes architecture boundary, two comments conflict, CI failure source is unrelated to review feedback
389439
```

0 commit comments

Comments
 (0)