codex-workflows 0.4.11 → 0.6.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.
Files changed (47) hide show
  1. package/.agents/skills/coding-rules/references/typescript.md +1 -1
  2. package/.agents/skills/documentation-criteria/references/design-template.md +8 -0
  3. package/.agents/skills/documentation-criteria/references/plan-template.md +22 -3
  4. package/.agents/skills/documentation-criteria/references/task-template.md +1 -1
  5. package/.agents/skills/documentation-criteria/references/ui-spec-template.md +10 -0
  6. package/.agents/skills/external-resource-context/SKILL.md +99 -0
  7. package/.agents/skills/external-resource-context/agents/openai.yaml +7 -0
  8. package/.agents/skills/external-resource-context/references/api.md +20 -0
  9. package/.agents/skills/external-resource-context/references/backend.md +21 -0
  10. package/.agents/skills/external-resource-context/references/frontend.md +21 -0
  11. package/.agents/skills/external-resource-context/references/infra.md +21 -0
  12. package/.agents/skills/external-resource-context/references/template.md +72 -0
  13. package/.agents/skills/integration-e2e-testing/SKILL.md +34 -21
  14. package/.agents/skills/integration-e2e-testing/references/e2e-design.md +16 -10
  15. package/.agents/skills/recipe-add-integration-tests/SKILL.md +7 -0
  16. package/.agents/skills/recipe-build/SKILL.md +32 -5
  17. package/.agents/skills/recipe-front-adjust/SKILL.md +113 -0
  18. package/.agents/skills/recipe-front-adjust/agents/openai.yaml +7 -0
  19. package/.agents/skills/recipe-front-build/SKILL.md +32 -5
  20. package/.agents/skills/recipe-front-design/SKILL.md +28 -9
  21. package/.agents/skills/recipe-front-plan/SKILL.md +1 -1
  22. package/.agents/skills/recipe-front-review/SKILL.md +29 -11
  23. package/.agents/skills/recipe-fullstack-build/SKILL.md +32 -5
  24. package/.agents/skills/recipe-fullstack-implement/SKILL.md +13 -4
  25. package/.agents/skills/recipe-implement/SKILL.md +12 -4
  26. package/.agents/skills/recipe-plan/SKILL.md +5 -5
  27. package/.agents/skills/recipe-prepare-implementation/SKILL.md +162 -0
  28. package/.agents/skills/recipe-prepare-implementation/agents/openai.yaml +7 -0
  29. package/.agents/skills/recipe-review/SKILL.md +34 -6
  30. package/.agents/skills/subagents-orchestration-guide/SKILL.md +36 -34
  31. package/.agents/skills/subagents-orchestration-guide/references/monorepo-flow.md +45 -48
  32. package/.agents/skills/task-analyzer/SKILL.md +3 -2
  33. package/.agents/skills/task-analyzer/references/skills-index.yaml +54 -7
  34. package/.agents/skills/testing/references/typescript.md +2 -3
  35. package/.codex/agents/acceptance-test-generator.toml +69 -31
  36. package/.codex/agents/quality-fixer-frontend.toml +5 -0
  37. package/.codex/agents/quality-fixer.toml +5 -0
  38. package/.codex/agents/task-decomposer.toml +27 -2
  39. package/.codex/agents/task-executor-frontend.toml +16 -11
  40. package/.codex/agents/task-executor.toml +19 -14
  41. package/.codex/agents/technical-designer-frontend.toml +25 -2
  42. package/.codex/agents/technical-designer.toml +13 -0
  43. package/.codex/agents/ui-analyzer.toml +307 -0
  44. package/.codex/agents/ui-spec-designer.toml +15 -0
  45. package/.codex/agents/work-planner.toml +54 -17
  46. package/README.md +54 -26
  47. package/package.json +1 -1
@@ -0,0 +1,162 @@
1
+ ---
2
+ name: recipe-prepare-implementation
3
+ description: "Verify that an approved work plan is implementable before build execution, resolving readiness gaps through Phase 0 prep tasks when needed."
4
+ ---
5
+
6
+ ## Required Skills [LOAD BEFORE EXECUTION]
7
+
8
+ 1. [LOAD IF NOT ACTIVE] `coding-rules` -- coding standards
9
+ 2. [LOAD IF NOT ACTIVE] `testing` -- test strategy and quality gates
10
+ 3. [LOAD IF NOT ACTIVE] `ai-development-guide` -- AI development patterns
11
+ 4. [LOAD IF NOT ACTIVE] `documentation-criteria` -- document templates
12
+ 5. [LOAD IF NOT ACTIVE] `subagents-orchestration-guide` -- agent coordination
13
+
14
+ **Spawn rule**: every `spawn_agent` call MUST pass `fork_turns="none"` or `fork_context=false` for context isolation.
15
+
16
+ ## Purpose
17
+
18
+ Run this recipe after work-plan approval and before any build or implementation execution. It verifies that the plan can be executed from Phase 1 onward without missing verification references, test prerequisites, UI render surfaces, or local execution instructions.
19
+
20
+ The recipe is safe to invoke unconditionally. If all readiness criteria pass, it only updates the work plan readiness marker and report.
21
+
22
+ Work plan: $ARGUMENTS
23
+
24
+ ## Readiness Marker Contract
25
+
26
+ Use the Implementation Readiness Marker Contract defined in `subagents-orchestration-guide`. If the line is absent, treat the work plan as `pending` and insert it after `Related Issue/PR:` when persisting the report.
27
+
28
+ ## Readiness Criteria
29
+
30
+ Each criterion produces `pass`, `fail`, or `not_applicable`, with file:line evidence where possible.
31
+
32
+ | ID | Criterion | Pass Evidence |
33
+ |----|-----------|---------------|
34
+ | R1 | Verification Strategy references resolve | Every command, file path, function, endpoint, fixture, seed, and test reference in the work plan's Verification Strategies either exists now or is the deliverable of a task in the plan |
35
+ | R2 | E2E prerequisites are addressed | For each fixture-e2e or service-integration-e2e skeleton, every noted precondition is present in the codebase or covered by a Phase 0 task |
36
+ | R3 | Phase 1 observability exists | The first implementation phase includes at least one operation verification method executable at task completion using existing files, prior Phase 0 deliverables, or the task's own output |
37
+ | R4 | UI rendering surface exists | When the plan implements UI components, a fixture entry, dev route, Storybook story, preview harness, or equivalent render surface exists or is covered by a Phase 0 task |
38
+ | R5 | Local lane procedure exists | The work plan or referenced docs record commands needed to run the relevant local service stack or browser harness, including startup commands, ports, seed steps, and required environment variables |
39
+
40
+ R4 applies only to UI work. R5 applies when the plan uses a local service stack or browser harness.
41
+
42
+ ## Execution Flow
43
+
44
+ ### Step 1: Load Inputs
45
+
46
+ Read the work plan passed in `$ARGUMENTS`; if absent, select the most recent non-template `docs/plans/*.md`. Extract:
47
+ - Verification Strategies
48
+ - Quality Assurance Mechanisms
49
+ - Design-to-Plan Traceability
50
+ - UI Spec Component -> Task Mapping
51
+ - Connection Map
52
+ - test skeleton references and E2E absence reasons
53
+ - phase structure and task IDs
54
+ - referenced Design Docs and UI Specs
55
+
56
+ If no work plan exists, stop and report the missing prerequisite.
57
+
58
+ ### Step 2: Readiness Scan
59
+
60
+ Evaluate R1-R5 using repository search and the work plan content. Build a `## Implementation Readiness Report` regardless of outcome.
61
+
62
+ For each `fail`, identify the smallest concrete prep task that closes the gap. Examples:
63
+ - Add fixture data for a UI state
64
+ - Add an API mock handler for fixture-e2e
65
+ - Add a seed script for service-integration-e2e
66
+ - Add a Storybook story, dev route, or equivalent render surface
67
+ - Document local startup commands and required environment variables
68
+ - Add a missing verification helper or script referenced by the plan
69
+
70
+ ### Step 3: No-Op Success
71
+
72
+ When all applicable criteria are `pass`:
73
+ 1. Persist `## Implementation Readiness Report` in the work plan immediately after the header block.
74
+ 2. Set `Implementation Readiness: ready`.
75
+ 3. Do not create task files.
76
+ 4. Report `outcome: ready`.
77
+
78
+ ### Step 4: Create Resolution Tasks
79
+
80
+ When one or more criteria fail:
81
+ 1. Present the proposed prep tasks to the user and continue only after explicit approval.
82
+ 2. Create task files in `docs/plans/tasks/` using the task template:
83
+ - Backend prep: `{plan-name}-backend-task-prep-{NN}.md`
84
+ - Frontend prep: `{plan-name}-frontend-task-prep-{NN}.md`
85
+ - Single-layer prep: `{plan-name}-task-prep-{NN}.md`
86
+ 3. Insert the tasks into the work plan's existing Phase 0 when one exists. If no Phase 0 exists, create `Phase 0: Implementation Readiness Prep` before Phase 1. Keep existing Phase 0 task IDs stable; assign prep task IDs after existing Phase 0 tasks or use a clearly labeled `P0-PREP-N` identifier when the plan's numbering would otherwise require renumbering.
87
+ 4. Each prep task must include Investigation Targets, concrete implementation steps, and Operation Verification Methods.
88
+
89
+ Layer selection:
90
+ - Use frontend prep when every target is UI, browser harness, component, page, or frontend fixture work.
91
+ - Use backend prep when every target is API, server, service, repository, database, seed, or backend fixture work.
92
+ - Use single-layer prep for non-layered repositories.
93
+ - Escalate if the gap crosses layers and cannot be split into separate prep tasks.
94
+
95
+ ### Step 5: Execute Prep Tasks
96
+
97
+ Run each prep task through the standard 4-step cycle:
98
+ 1. Spawn the layer-appropriate task executor with the exact prep task path in the prompt: "Execute implementation-readiness prep task. Task file: [exact prep task path]."
99
+ 2. Check for `blocked` or `escalation_needed`.
100
+ 3. Spawn the layer-appropriate quality fixer with the task file as `task_file`.
101
+ 4. Commit only when the quality fixer returns `approved`.
102
+
103
+ Append this scope boundary to every subagent prompt:
104
+
105
+ ```
106
+ [SYSTEM CONSTRAINT]
107
+ This agent operates within implementation-readiness prep scope. Use the task file as the primary instruction source. Do not implement feature behavior beyond the readiness gap described by the task.
108
+ ```
109
+
110
+ ### Step 6: Re-Scan and Persist
111
+
112
+ After prep tasks are complete:
113
+ 1. Re-run the readiness scan.
114
+ 2. Persist or replace `## Implementation Readiness Report` in the work plan.
115
+ 3. Set the header to `Implementation Readiness: ready` when all applicable criteria pass, otherwise `Implementation Readiness: escalated`.
116
+ 4. Collapse completed prep tasks out of active plan execution: remove the Phase 0 readiness prep task entries from the work plan and record their committed evidence under `Resolution Tasks Executed` in the Readiness Report. If Phase 0 becomes empty and was created only by this recipe, remove that Phase 0 section. Preserve any pre-existing Phase 0 content.
117
+ 5. Delete only these files for the current `{plan-name}`:
118
+ - `docs/plans/tasks/{plan-name}-task-prep-*.md`
119
+ - `docs/plans/tasks/{plan-name}-backend-task-prep-*.md`
120
+ - `docs/plans/tasks/{plan-name}-frontend-task-prep-*.md`
121
+ - `docs/plans/tasks/{plan-name}-phase0-completion.md`
122
+ 6. Report remaining gaps if any.
123
+
124
+ ## Readiness Report Format
125
+
126
+ ```markdown
127
+ ## Implementation Readiness Report
128
+
129
+ Work plan: [path]
130
+ Outcome: ready | escalated
131
+ Gaps resolved: [N]
132
+ phase0_created_by_recipe: true | false
133
+
134
+ ### Readiness Criteria
135
+
136
+ | ID | Result | Evidence |
137
+ |----|--------|----------|
138
+ | R1 | pass / fail / not_applicable | [file:line or missing reference] |
139
+ | R2 | ... | ... |
140
+ | R3 | ... | ... |
141
+ | R4 | ... | ... |
142
+ | R5 | ... | ... |
143
+
144
+ ### Resolution Tasks Executed
145
+ - [task file path] - [one-line summary] - committed
146
+
147
+ ### Remaining Gaps
148
+ - [criterion ID]: [unresolved reference] - Next action: [recommendation]
149
+ ```
150
+
151
+ ## Completion Criteria
152
+
153
+ - [ ] Work plan loaded and relevant sections extracted
154
+ - [ ] Readiness scan completed with evidence per criterion
155
+ - [ ] No-op success handled when all criteria pass
156
+ - [ ] Failing criteria converted to approved prep tasks when needed
157
+ - [ ] Prep tasks executed through executor -> quality-fixer -> commit
158
+ - [ ] Re-scan completed after prep tasks
159
+ - [ ] Work plan readiness marker updated to `ready` or `escalated`
160
+ - [ ] Readiness Report persisted in the work plan
161
+ - [ ] Completed prep task references collapsed into the Readiness Report
162
+ - [ ] Prep task files created by this recipe removed from `docs/plans/tasks/`
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "recipe-prepare-implementation"
3
+ short_description: "Preflight work plan readiness before implementation"
4
+ default_prompt: "Use $recipe-prepare-implementation to verify: "
5
+
6
+ policy:
7
+ allow_implicit_invocation: false
@@ -23,7 +23,8 @@ description: "Design Doc compliance and security validation with optional auto-f
23
23
 
24
24
  - Compliance validation -> Spawn code-reviewer agent
25
25
  - Security validation -> Spawn security-reviewer agent
26
- - Fix implementation -> Spawn task-executor agent
26
+ - Code-side fix path -> Spawn task-executor agent
27
+ - Design-side update path -> Spawn technical-designer in update mode, then document-reviewer, then design-sync when multiple Design Docs exist
27
28
  - Quality checks -> Spawn quality-fixer agent
28
29
  - Re-validation -> Spawn code-reviewer / security-reviewer agents
29
30
 
@@ -82,22 +83,47 @@ Security Review: [status from security-reviewer]
82
83
  - [policy] [location]: [description] — [rationale]
83
84
  Notes: [notes from security-reviewer, if present]
84
85
 
85
- Execute fixes? (y/n):
86
+ Resolve discrepancies by route:
87
+ c) Code-side fix
88
+ d) Design-side update
89
+ s) Skip
90
+
91
+ Default: accept all recommended routes.
92
+
93
+ Accepted response formats:
94
+ - empty input -- accept every recommended route
95
+ - `all-recommended` -- accept every recommended route
96
+ - `all:c`, `all:d`, or `all:s` -- apply one route to every finding
97
+ - Per-finding routes, e.g. `F1:c, F2:d, F3:s`
86
98
  ```
87
99
 
88
- **[STOP BLOCKING]** Present results to user for confirmation.
89
- **CANNOT proceed until user explicitly confirms.**
100
+ Before presenting results, recommend a route for each finding:
101
+ - Use `d` when implementation intent matches the requirement but the Design Doc is stale or too narrow.
102
+ - Use `c` when code drifted from a still-correct Design Doc, or when the finding is reliability, security, or maintainability related.
103
+ - Use `s` only when the user explicitly accepts the current state without changes.
90
104
 
91
- If both pass and user selects `n`: Skip Steps 5-10, proceed to Step 11.
105
+ **[STOP BLOCKING]** Present results and recommended routes to user for confirmation.
106
+ **CANNOT proceed until user explicitly confirms routes.**
107
+
108
+ If all findings are skipped: Skip Steps 5-10, proceed to Step 11.
92
109
 
93
110
  ### Step 5: Prepare Fix Context
94
111
 
95
112
  Reference documentation-criteria skill for task file template.
96
113
 
114
+ ### Step 5d: Design-Side Update
115
+
116
+ Run this step only when the user routes at least one finding to `d`.
117
+
118
+ 1. Spawn technical-designer agent in update mode: "Update Design Doc at [path]. The implementation is being accepted as correct for these findings: [d-routed findings with code locations and current Design Doc values]. Update the relevant sections and add change history."
119
+ 2. Spawn document-reviewer agent: "Review updated Design Doc at [path] for consistency and completeness."
120
+ 3. If multiple Design Docs exist in `docs/design/`, spawn design-sync agent: "Check cross-Design Doc consistency after updating [path]."
121
+ 4. If the user selected both `d` and `c` routes, re-evaluate the `c` findings against the updated Design Doc and drop any that are now satisfied.
122
+
97
123
  ### Step 6: Create Task File
98
124
 
99
125
  Create task file at `docs/plans/tasks/review-fixes-YYYYMMDD.md`
100
- Include both code compliance issues and security requiredFixes.
126
+ Include only code-side compliance issues and security requiredFixes routed to `c`.
101
127
 
102
128
  ### Step 7: Execute Fixes
103
129
 
@@ -117,6 +143,8 @@ Spawn security-reviewer agent: "Re-validate security after fixes. Prior findings
117
143
 
118
144
  ### Step 11: Final Report
119
145
 
146
+ Delete the review-fix task file this recipe created, if present. Its work is committed; `docs/plans/` is ephemeral working state.
147
+
120
148
  ```
121
149
  Code Compliance:
122
150
  Initial: [X]%
@@ -74,6 +74,7 @@ The following subagents are available:
74
74
  13. **code-verifier**: Document-code consistency verification for review inputs and post-implementation verification
75
75
  14. **design-sync**: Design Doc consistency verification across multiple documents
76
76
  15. **acceptance-test-generator**: Generate integration and E2E test skeletons from Design Doc ACs
77
+ 16. **ui-analyzer**: UI fact gathering from external resources and existing frontend code before UI Spec, Design Doc, or adjustment work
77
78
 
78
79
  ## Orchestration Principles
79
80
 
@@ -123,27 +124,10 @@ Close a running subagent only when the user redirects the workflow, the orchestr
123
124
 
124
125
  Spawn agents using natural language prompts. Provide clear context about what the agent should accomplish. Every `spawn_agent` call MUST include `fork_turns="none"` or `fork_context=false` (see Spawn rule at top of this skill).
125
126
 
126
- ### Spawn Examples
127
+ ### Spawn Prompt Requirements
127
128
 
128
- Each example below is a spawn with `fork_turns="none"` or `fork_context=false` plus the quoted prompt.
129
-
130
- **requirement-analyzer** (`fork_turns="none"` or `fork_context=false`):
131
- > "Analyze the following requirements and determine the work scale: [user requirements]. Perform requirement analysis and scale determination."
132
-
133
- **codebase-analyzer** (`fork_turns="none"` or `fork_context=false`):
134
- > "Analyze the existing codebase to provide evidence for Design Doc creation. Focus on existing implementations, data model elements, and constraints the design should respect. requirement_analysis: [JSON]. prd_path: [path if available]. requirements: [original user requirements]. layer: [target layer if applicable]. target_paths: [paths if narrowed]. Return codebase facts and focus areas."
135
-
136
- **task-executor** (`fork_turns="none"` or `fork_context=false`):
137
- > "Execute the implementation task defined in docs/plans/tasks/[filename].md. Complete the implementation following TDD Red-Green-Refactor."
138
-
139
- **quality-fixer** (`fork_turns="none"` or `fork_context=false`):
140
- > "Run quality checks on the codebase: static analysis, style check, all test execution. Fix any issues found and report when all checks pass."
141
-
142
- **document-reviewer** (`fork_turns="none"` or `fork_context=false`):
143
- > "Review the document at [path] for quality and rule compliance. Check against documentation-criteria standards."
144
-
145
- **design-sync** (`fork_turns="none"` or `fork_context=false`):
146
- > "Verify consistency between Design Docs in docs/design/. Use [path] as the source document for comparison."
129
+ - Set `fork_context=false` or `fork_turns="none"` on every spawn for context isolation.
130
+ - Each spawn prompt must name the target deliverable, input paths, and expected result. When invoking `task-executor*`, include the exact task file path, for example: `Execute the implementation task. Task file: docs/plans/tasks/[filename].md.`
147
131
 
148
132
  ## Explicit Stop Points [MANDATORY]
149
133
 
@@ -200,6 +184,7 @@ Subagents respond in JSON format. The final response from each JSON-returning su
200
184
  |-------|--------------------------------------|
201
185
  | `requirement-analyzer` | `scale`, `confidence`, `affectedLayers`, `adrRequired`, `scopeDependencies`, `questions` |
202
186
  | `codebase-analyzer` | `focusAreas`, `dataModel`, `qualityAssurance`, `dataTransformationPipelines`, `limitations` |
187
+ | `ui-analyzer` | `externalResources`, `componentStructure`, `propsPatterns`, `cssLayout`, `stateDisplay`, `focusAreas`, `candidateWriteSet`, `limitations` |
203
188
  | `task-executor*` | `status`, `escalation_type`, `filesModified`, `requiresTestReview` |
204
189
  | `quality-fixer*` | `status`, `reason`, `stubFindings`, `blockingIssues`, `missingPrerequisites` |
205
190
  | `document-reviewer` | `verdict.decision`, `verdict.conditions` |
@@ -207,7 +192,34 @@ Subagents respond in JSON format. The final response from each JSON-returning su
207
192
  | `design-sync` | `sync_status` |
208
193
  | `integration-test-reviewer` | `status`, `requiredFixes` |
209
194
  | `security-reviewer` | `status`, `findings`, `notes`, `requiredFixes` |
210
- | `acceptance-test-generator` | `status`, `generatedFiles`, `e2eAbsenceReason` |
195
+ | `acceptance-test-generator` | `status`, `generatedFiles.integration`, `generatedFiles.fixtureE2e`, `generatedFiles.serviceE2e`, `e2eAbsenceReason.fixtureE2e`, `e2eAbsenceReason.serviceE2e` |
196
+
197
+ ## Implementation Readiness Marker Contract
198
+
199
+ Work plans use the header line `Implementation Readiness: <status>`.
200
+
201
+ | Status | Meaning | Consumer Action |
202
+ |--------|---------|-----------------|
203
+ | `pending` | Initial state from work-planner; readiness has not been checked | Present the unchecked state, recommend running implementation readiness preflight, and continue only on explicit user approval |
204
+ | `ready` | Readiness scan completed and no applicable failures remain | Proceed with task execution |
205
+ | `escalated` | Readiness scan completed, but one or more failures remain | Read the work plan's Implementation Readiness Report, present remaining gaps, and continue only on explicit user approval |
206
+ | absent | Older work plan without the marker | Treat as `pending` |
207
+
208
+ ## Implementation Readiness Preflight Procedure
209
+
210
+ Use this procedure after work-plan approval and before autonomous task execution when the flow needs to verify implementation readiness.
211
+
212
+ 1. Load the approved work plan exact path and extract Verification Strategies, Quality Assurance Mechanisms, Design-to-Plan Traceability, UI Spec Component -> Task Mapping, Connection Map, test skeleton references, E2E absence reasons, phase structure, referenced Design Docs, and UI Specs.
213
+ 2. Evaluate these criteria with evidence:
214
+ - R1 Verification Strategy references resolve
215
+ - R2 E2E prerequisites are addressed
216
+ - R3 Phase 1 observability exists
217
+ - R4 UI rendering surface exists when UI work is present
218
+ - R5 Local service stack or browser harness procedure exists when applicable
219
+ 3. If every applicable criterion passes, persist `## Implementation Readiness Report` in the work plan and set `Implementation Readiness: ready`.
220
+ 4. If any criterion fails, create the smallest approved prep tasks that close the gaps, execute each exact prep task file through the standard executor -> quality-fixer -> commit cycle, then re-run the scan.
221
+ 5. After re-scan, set `Implementation Readiness: ready` when all applicable criteria pass, otherwise `Implementation Readiness: escalated`, and persist remaining gaps in the Readiness Report.
222
+ 6. Collapse completed prep task references into the Readiness Report and delete only the prep task files created for the current work plan.
211
223
 
212
224
  ## Handling Requirement Changes
213
225
 
@@ -216,17 +228,7 @@ requirement-analyzer follows the "completely self-contained" principle and proce
216
228
 
217
229
  #### How to Integrate Requirements
218
230
 
219
- **Important**: To maximize accuracy, integrate requirements as complete sentences, including all contextual information communicated by the user.
220
-
221
- ```yaml
222
- Integration example:
223
- Initial: "I want to create user management functionality"
224
- Addition: "Permission management is also needed"
225
- Result: "I want to create user management functionality. Permission management is also needed.
226
-
227
- Initial requirement: I want to create user management functionality
228
- Additional requirement: Permission management is also needed"
229
- ```
231
+ Integrate initial requirements and later additions as complete sentences, preserving all contextual information communicated by the user. The updated input must remain self-contained without relying on prior conversation turns.
230
232
 
231
233
  ### Update Mode for Document Generation Agents
232
234
  Document generation agents (work-planner, technical-designer, prd-creator) can update existing documents in `update` mode.
@@ -350,11 +352,11 @@ Maximum retry count is 1 verification fix cycle. If any failed verifier still fa
350
352
  | `codebase-analyzer` | `technical-designer*` | `Codebase Analysis`, including `focusAreas`, `dataModel`, `qualityAssurance`, `dataTransformationPipelines`, `limitations` |
351
353
  | `technical-designer*` | `code-verifier` | Design Doc path |
352
354
  | `code-verifier` | `document-reviewer` | `code_verification` JSON |
353
- | `acceptance-test-generator` | `work-planner` | integration test path, E2E path or `null`, `e2eAbsenceReason` when E2E is absent |
355
+ | `acceptance-test-generator` | `work-planner` | `generatedFiles.integration`, `generatedFiles.fixtureE2e`, `generatedFiles.serviceE2e`, `e2eAbsenceReason: { fixtureE2e, serviceE2e }` |
354
356
  | Design Doc | `work-planner` | Verification Strategy summary, Output Comparison details, implementation-relevant technical requirements, protected no-change boundaries |
355
357
 
356
358
  Handoff rules:
357
- - Verify generated integration and E2E file paths exist before passing them onward
359
+ - Verify generated integration, fixture-e2e, and service-integration-e2e file paths exist before passing them onward
358
360
  - Escalate only when required outputs are missing without a valid absence reason
359
361
  - Require work-planner to map every carried-forward technical requirement to a covering task or a justified `gap`
360
362
 
@@ -10,81 +10,78 @@ This reference defines the orchestration flow for projects spanning multiple lay
10
10
 
11
11
  ## Design Phase
12
12
 
13
- ### Large Scale Fullstack (6+ Files) - 14 Steps
13
+ ### Large Scale Fullstack (6+ Files) - 15 Steps
14
14
 
15
15
  | Step | Agent | Purpose | Output |
16
16
  |------|-------|---------|--------|
17
17
  | 1 | requirement-analyzer | Requirement analysis + scale determination **[Stop]** | Requirements + scale |
18
18
  | 2 | prd-creator | PRD covering entire feature (all layers) | Single PRD |
19
19
  | 3 | document-reviewer | PRD review **[Stop]** | Approval |
20
- | 4 | (orchestrator) | Ask user for prototype code **[Stop]** | Prototype path or none |
21
- | 5 | ui-spec-designer | UI Spec from PRD + optional prototype | UI Spec |
22
- | 6 | document-reviewer | UI Spec review **[Stop]** | Approval |
23
- | 7 | codebase-analyzer x2 | Per-layer codebase analysis before Design Doc creation | Analysis JSON |
24
- | 8 | technical-designer | **Backend** Design Doc | Backend Design Doc |
25
- | 9 | technical-designer-frontend | **Frontend** Design Doc (references backend Integration Points + UI Spec) | Frontend Design Doc |
26
- | 10 | code-verifier x2 | Verify each Design Doc against code | Verification JSON |
27
- | 11 | document-reviewer x2 | Review each Design Doc with verification evidence | Reviews |
28
- | 12 | design-sync | Cross-layer consistency verification (source: frontend Design Doc) **[Stop]** | Sync status |
29
- | 13 | acceptance-test-generator | Integration/E2E test skeleton from cross-layer contracts | Test skeletons |
30
- | 14 | work-planner | Work plan from all Design Docs **[Stop: Batch approval]** | Work plan |
31
-
32
- ### Medium Scale Fullstack (3-5 Files) - 12 Steps
20
+ | 4 | (orchestrator) | External resource hearing **[Stop]** | Project context |
21
+ | 5 | (orchestrator) | Ask user for prototype code **[Stop]** | Prototype path or none |
22
+ | 6 | codebase-analyzer x2 + ui-analyzer x1 | Per-layer codebase analysis plus frontend UI analysis | Analysis JSON |
23
+ | 7 | ui-spec-designer | UI Spec from PRD + UI analysis + optional prototype | UI Spec |
24
+ | 8 | document-reviewer | UI Spec review **[Stop]** | Approval |
25
+ | 9 | technical-designer | **Backend** Design Doc | Backend Design Doc |
26
+ | 10 | technical-designer-frontend | **Frontend** Design Doc (references backend Integration Points + UI Spec + UI analysis) | Frontend Design Doc |
27
+ | 11 | code-verifier x2 | Verify each Design Doc against code | Verification JSON |
28
+ | 12 | document-reviewer x2 | Review each Design Doc with verification evidence | Reviews |
29
+ | 13 | design-sync | Cross-layer consistency verification (source: frontend Design Doc) **[Stop]** | Sync status |
30
+ | 14 | acceptance-test-generator | Integration/E2E test skeleton from cross-layer contracts | Test skeletons |
31
+ | 15 | work-planner | Work plan from all Design Docs **[Stop: Batch approval]** | Work plan |
32
+
33
+ ### Medium Scale Fullstack (3-5 Files) - 13 Steps
33
34
 
34
35
  | Step | Agent | Purpose | Output |
35
36
  |------|-------|---------|--------|
36
37
  | 1 | requirement-analyzer | Requirement analysis + scale determination **[Stop]** | Requirements + scale |
37
- | 2 | codebase-analyzer x2 | Per-layer codebase analysis before Design Doc creation | Analysis JSON |
38
+ | 2 | (orchestrator) | External resource hearing **[Stop]** | Project context |
38
39
  | 3 | (orchestrator) | Ask user for prototype code **[Stop]** | Prototype path or none |
39
- | 4 | ui-spec-designer | UI Spec from requirements + optional prototype | UI Spec |
40
- | 5 | document-reviewer | UI Spec review **[Stop]** | Approval |
41
- | 6 | technical-designer | **Backend** Design Doc | Backend Design Doc |
42
- | 7 | technical-designer-frontend | **Frontend** Design Doc (references backend Integration Points + UI Spec) | Frontend Design Doc |
43
- | 8 | code-verifier x2 | Verify each Design Doc against code | Verification JSON |
44
- | 9 | document-reviewer x2 | Review each Design Doc with verification evidence | Reviews |
45
- | 10 | design-sync | Cross-layer consistency verification (source: frontend Design Doc) **[Stop]** | Sync status |
46
- | 11 | acceptance-test-generator | Integration/E2E test skeleton from cross-layer contracts | Test skeletons |
47
- | 12 | work-planner | Work plan from all Design Docs **[Stop: Batch approval]** | Work plan |
40
+ | 4 | codebase-analyzer x2 + ui-analyzer x1 | Per-layer codebase analysis plus frontend UI analysis | Analysis JSON |
41
+ | 5 | ui-spec-designer | UI Spec from requirements + UI analysis + optional prototype | UI Spec |
42
+ | 6 | document-reviewer | UI Spec review **[Stop]** | Approval |
43
+ | 7 | technical-designer | **Backend** Design Doc | Backend Design Doc |
44
+ | 8 | technical-designer-frontend | **Frontend** Design Doc (references backend Integration Points + UI Spec + UI analysis) | Frontend Design Doc |
45
+ | 9 | code-verifier x2 | Verify each Design Doc against code | Verification JSON |
46
+ | 10 | document-reviewer x2 | Review each Design Doc with verification evidence | Reviews |
47
+ | 11 | design-sync | Cross-layer consistency verification (source: frontend Design Doc) **[Stop]** | Sync status |
48
+ | 12 | acceptance-test-generator | Integration/E2E test skeleton from cross-layer contracts | Test skeletons |
49
+ | 13 | work-planner | Work plan from all Design Docs **[Stop: Batch approval]** | Work plan |
48
50
 
49
51
  ### Parallelization in Multi-Agent Steps
50
52
 
51
- Steps marked `x2` run independently per layer and can execute in parallel when supported.
53
+ Steps marked `x2` run independently per layer and can execute in parallel when supported. `ui-analyzer x1` runs once for the frontend layer alongside frontend codebase analysis and consumes the saved external resource context.
52
54
 
53
55
  ### Layer Context in Design Doc Creation
54
56
 
55
57
  When spawning Design Doc creation for each layer, pass explicit context:
56
58
 
57
- **Large Scale (PRD available) -- Backend Design Doc**:
58
- **Agent**: Spawn technical-designer
59
- > "Create a backend Design Doc from PRD at [path]. Codebase analysis: [backend analysis JSON]. Focus on: API contracts, data layer, business logic, service architecture."
60
-
61
- **Large Scale (PRD available) -- Backend Codebase Analysis**:
62
- **Agent**: Spawn codebase-analyzer
63
- > "Analyze the existing codebase to provide evidence for backend Design Doc creation. requirement_analysis: [requirement-analyzer output filtered to backend files]. prd_path: [path]. requirements: [original user requirements]. layer: backend. target_paths: [backend file and directory scope]. focus_areas: API contracts, data layer, business logic, service architecture."
59
+ | Scale | Concrete context value |
60
+ |-------|------------------------|
61
+ | Large | `context: { scale: "large", prd_path: "[path]", requirement_analysis: [requirement-analyzer output] }` |
62
+ | Medium | `context: { scale: "medium", prd_path: null, requirement_analysis: [requirement-analyzer output] }` |
64
63
 
65
- **Large Scale (PRD available) -- Frontend Design Doc**:
66
- **Agent**: Spawn technical-designer-frontend
67
- > "Create a frontend Design Doc from PRD at [path]. Codebase analysis: [frontend analysis JSON]. Reference backend Design Doc at [path] for API contracts and Integration Points. Reference UI Spec at [path] for component structure and state design. Focus on: component hierarchy, state management, UI interactions, data fetching."
64
+ Before spawning, replace every context placeholder with a concrete context object for the active flow scale. For filtered context placeholders, use the same `scale` and `prd_path` values, and replace `requirement_analysis` with the layer-filtered requirement analysis.
68
65
 
69
- **Large Scale (PRD available) -- Frontend Codebase Analysis**:
70
- **Agent**: Spawn codebase-analyzer
71
- > "Analyze the existing codebase to provide evidence for frontend Design Doc creation. requirement_analysis: [requirement-analyzer output filtered to frontend files]. prd_path: [path]. requirements: [original user requirements]. layer: frontend. target_paths: [frontend file and directory scope]. focus_areas: component hierarchy, state management, UI interactions, data fetching."
72
-
73
- **Medium Scale (no PRD) -- Backend Design Doc**:
66
+ **Backend Design Doc**:
74
67
  **Agent**: Spawn technical-designer
75
- > "Create a backend Design Doc based on the following requirements: [requirement-analyzer output]. Codebase analysis: [backend analysis JSON]. Focus on: API contracts, data layer, business logic, service architecture."
68
+ > "Create a backend Design Doc. context: [context]. Codebase analysis: [backend analysis JSON]. Focus on: API contracts, data layer, business logic, service architecture."
76
69
 
77
- **Medium Scale (no PRD) -- Backend Codebase Analysis**:
70
+ **Backend Codebase Analysis**:
78
71
  **Agent**: Spawn codebase-analyzer
79
- > "Analyze the existing codebase to provide evidence for backend Design Doc creation. requirement_analysis: [requirement-analyzer output filtered to backend files]. requirements: [original user requirements]. layer: backend. target_paths: [backend file and directory scope]. focus_areas: API contracts, data layer, business logic, service architecture."
72
+ > "Analyze the existing codebase to provide evidence for backend Design Doc creation. context: [context with requirement_analysis filtered to backend files]. requirements: [original user requirements]. layer: backend. target_paths: [backend file and directory scope]. focus_areas: API contracts, data layer, business logic, service architecture."
80
73
 
81
- **Medium Scale (no PRD) -- Frontend Design Doc**:
74
+ **Frontend Design Doc**:
82
75
  **Agent**: Spawn technical-designer-frontend
83
- > "Create a frontend Design Doc based on the following requirements: [requirement-analyzer output]. Codebase analysis: [frontend analysis JSON]. Reference backend Design Doc at [path] for API contracts and Integration Points. Reference UI Spec at [path] for component structure and state design. Focus on: component hierarchy, state management, UI interactions, data fetching."
76
+ > "Create a frontend Design Doc. context: [context]. Codebase analysis: [frontend analysis JSON]. UI analysis: [ui-analyzer JSON]. Reference backend Design Doc at [path] for API contracts and Integration Points. Reference UI Spec at [path] for component structure and state design. Focus on: component hierarchy, state management, UI interactions, data fetching."
84
77
 
85
- **Medium Scale (no PRD) -- Frontend Codebase Analysis**:
78
+ **Frontend Codebase Analysis**:
86
79
  **Agent**: Spawn codebase-analyzer
87
- > "Analyze the existing codebase to provide evidence for frontend Design Doc creation. requirement_analysis: [requirement-analyzer output filtered to frontend files]. requirements: [original user requirements]. layer: frontend. target_paths: [frontend file and directory scope]. focus_areas: component hierarchy, state management, UI interactions, data fetching."
80
+ > "Analyze the existing codebase to provide evidence for frontend Design Doc creation. context: [context with requirement_analysis filtered to frontend files]. requirements: [original user requirements]. layer: frontend. target_paths: [frontend file and directory scope]. focus_areas: component hierarchy, state management, UI interactions, data fetching."
81
+
82
+ **Frontend UI Analysis**:
83
+ **Agent**: Spawn ui-analyzer
84
+ > "Gather UI facts for frontend design. context: [context with requirement_analysis filtered to frontend files]. requirements: [original user requirements]. target_paths: [frontend file and directory scope]. target_components: [frontend target components]. prototype_path: [path if provided]. Read docs/project-context/external-resources.md, resolve relevant UI external resources through declared access methods, and analyze component structure, props patterns, CSS layout, state displays, accessibility, generated artifacts, and candidate write set."
88
85
 
89
86
  ### design-sync for Cross-Layer Verification
90
87
 
@@ -100,7 +97,7 @@ Spawn acceptance-test-generator with all Design Docs and UI Spec:
100
97
 
101
98
  Spawn work-planner with all Design Docs:
102
99
 
103
- > "Create a work plan from the following documents: PRD: [path] (Large Scale only), Design Doc (backend): [path], Design Doc (frontend): [path]. Compose phases as vertical feature slices where possible -- each phase should contain both backend and frontend work for the same feature area, enabling early integration verification per phase."
100
+ > "Create a work plan from the following documents: PRD: [path] (Large Scale only), Design Doc (backend): [path], Design Doc (frontend): [path], UI Spec: [path] (if exists). Test skeletons from acceptance-test-generator: integration: [path or null], fixtureE2e: [path or null], serviceE2e: [path or null], e2eAbsenceReason: { fixtureE2e: [value or null], serviceE2e: [value or null] }. Compose phases as vertical feature slices where possible -- each phase should contain both backend and frontend work for the same feature area, enabling early integration verification per phase. Include `Implementation Readiness: pending` in the work plan header."
104
101
 
105
102
  work-planner's existing Integration Complete criteria naturally covers cross-layer verification when given multiple Design Docs.
106
103
 
@@ -102,10 +102,11 @@ selectedSkills:
102
102
  tags: [...]
103
103
  typical-use: <string>
104
104
  size: <small|medium|large>
105
- sections: [...] # All sections from yaml, unfiltered
105
+ sections: [...] # Full section list from yaml
106
+ references: [...] # Full reference file list from yaml when present
106
107
  ```
107
108
 
108
- **Note**: Section selection (choosing which sections are relevant) is done after reading the actual SKILL.md files.
109
+ **Note**: Section and reference selection (choosing which sections or reference files are relevant) is done after reading the actual SKILL.md files. For output-format templates, read only the reference files matching the document type being created or reviewed.
109
110
 
110
111
  ## Metacognitive Question Design
111
112