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
@@ -29,8 +29,24 @@ Work plan: $ARGUMENTS
29
29
 
30
30
  ## Pre-execution Prerequisites
31
31
 
32
- ### Task File Existence Check
33
- Check for work plans in docs/plans/ and task files in docs/plans/tasks/.
32
+ ### Implementation Readiness Check
33
+
34
+ Before task processing, locate the work plan to gate against.
35
+
36
+ Resolution rule:
37
+ 1. If `$ARGUMENTS` contains a work plan path, use that exact file and derive `{plan-name}` from its basename. This takes precedence over task-file mtimes.
38
+ 2. If `$ARGUMENTS` is empty, list task files in `docs/plans/tasks/` matching the single-layer pattern `{plan-name}-task-*.md`.
39
+ 3. Exclude `*-task-prep-*.md`, `_overview-*.md`, `*-phase*-completion.md`, `review-fixes-*.md`, and `integration-tests-*-task-*.md`.
40
+ 4. If matching task files exist, infer `{plan-name}` from the most recent matching task file and use `docs/plans/{plan-name}.md`.
41
+ 5. If no matching task files exist, use the most recent non-template work plan in `docs/plans/`.
42
+
43
+ Read the work plan header and apply the Implementation Readiness Marker Contract from `subagents-orchestration-guide`.
44
+
45
+ ### Consumed Task Set
46
+
47
+ Compute the **Consumed Task Set** for this run: task files in `docs/plans/tasks/` matching `{plan-name}-task-*.md`, excluding `*-task-prep-*.md`, `_overview-*.md`, `*-phase*-completion.md`, `review-fixes-*.md`, and `integration-tests-*-task-*.md`.
48
+
49
+ Every subsequent reference to task files in this recipe uses this set, not an unrestricted `docs/plans/tasks/*.md` scan.
34
50
 
35
51
  ### Task Generation Decision Flow
36
52
 
@@ -38,8 +54,8 @@ Analyze task file existence state and determine the action required:
38
54
 
39
55
  | State | Criteria | Next Action |
40
56
  |-------|----------|-------------|
41
- | Tasks exist | .md files in tasks/ directory | User's execution instruction serves as batch approval -> Enter autonomous execution immediately |
42
- | No tasks + plan exists | Plan exists but no task files | Confirm with user -> spawn task-decomposer |
57
+ | Tasks exist | Consumed Task Set is non-empty | User's execution instruction serves as batch approval -> Enter autonomous execution immediately |
58
+ | No tasks + plan exists | Consumed Task Set is empty but plan exists | Confirm with user -> spawn task-decomposer |
43
59
  | Neither exists | No plan or task files | Error: Prerequisites not met |
44
60
 
45
61
  ## Task Decomposition Phase (Conditional)
@@ -58,7 +74,7 @@ Generate tasks from the work plan? (y/n):
58
74
  Spawn task-decomposer agent: "Read work plan at docs/plans/[plan-name].md and decompose into atomic tasks. Output: Individual task files in docs/plans/tasks/. Granularity: 1 task = 1 commit = independently executable."
59
75
 
60
76
  ### 3. Verify Generation
61
- Verify generated task files exist in docs/plans/tasks/.
77
+ Recompute the Consumed Task Set and verify it is non-empty.
62
78
 
63
79
  ## Pre-execution Checklist
64
80
 
@@ -123,6 +139,17 @@ After all task cycles finish, collect all `filesModified` from every task-execut
123
139
  - Maximum retry count is 1 verification fix cycle; if any failed verifier still fails after re-run, escalate to the user
124
140
  5. If both verifiers pass -> Proceed to completion report
125
141
 
142
+ ## Final Cleanup
143
+
144
+ Before the completion report, delete only these files for the current `{plan-name}`:
145
+ - Every file in the Consumed Task Set
146
+ - `docs/plans/tasks/{plan-name}-phase*-completion.md`
147
+ - `docs/plans/tasks/_overview-{plan-name}.md`
148
+
149
+ Preserve the work plan itself.
150
+
151
+ If cleanup fails, report the failed path but do not invalidate completed implementation work.
152
+
126
153
  **[STOP — BLOCKING]** Upon detecting ANY requirement changes, halt execution immediately.
127
154
  **CANNOT proceed until user explicitly confirms the change scope.**
128
155
 
@@ -0,0 +1,113 @@
1
+ ---
2
+ name: recipe-front-adjust
3
+ description: "Adjust an implemented UI with external resource context, focused write-set confirmation, verification, and quality checks."
4
+ ---
5
+
6
+ **Context**: UI adjustment for implemented frontend features. The parent session owns the edit and verification loop; subagents handle bounded fact gathering, planning, and quality checks.
7
+
8
+ ## Required Skills [LOAD BEFORE EXECUTION]
9
+
10
+ 1. [LOAD IF NOT ACTIVE] `documentation-criteria` -- scale and planning criteria
11
+ 2. [LOAD IF NOT ACTIVE] `external-resource-context` -- external resource hearing and lookup
12
+ 3. [LOAD IF NOT ACTIVE] `subagents-orchestration-guide` -- agent coordination rules
13
+
14
+ **Spawn rule**: every `spawn_agent` call MUST pass `fork_turns="none"` or `fork_context=false` for context isolation.
15
+
16
+ ## Execution Pattern
17
+
18
+ **Core Identity**: "I am a guided executor. I run the UI adjustment and verification loop in the parent session."
19
+
20
+ **Execution Protocol**:
21
+ 1. Delegate bounded one-shot work to `ui-analyzer`, `work-planner`, and `quality-fixer-frontend`.
22
+ 2. Run user dialogue, write-set confirmation, edits, and verification in the parent session.
23
+ 3. Respect every `[STOP]` marker before moving to the next phase.
24
+
25
+ Adjustment request: $ARGUMENTS
26
+
27
+ ## Execution Flow
28
+
29
+ ### Step 1: External Resource Hearing
30
+
31
+ Run the frontend domain hearing protocol from `external-resource-context`.
32
+
33
+ ### Step 2: UI Fact Gathering
34
+
35
+ Spawn `ui-analyzer`:
36
+
37
+ `requirement_analysis: { affectedFiles: [files inferred from request], purpose: "UI adjustment", technicalConsiderations: [] }. requirements: [adjustment request]. target_paths: [paths named or inferred from request]. target_components: [components named in request]. ui_spec_path: [path if available]. Read docs/project-context/external-resources.md, resolve relevant UI sources through declared access methods, analyze existing UI code, and populate candidateWriteSet[].`
38
+
39
+ ### Step 3: Confirm Write Set and Scale
40
+
41
+ 1. Present `candidateWriteSet[]` to the user.
42
+ 2. Ask the user to confirm high-confidence entries, confirm all entries, or provide an edited file list.
43
+ 3. Apply documentation-criteria Creation Decision Matrix to the confirmed write set:
44
+ - `0 files`: ask the user for the component or path that owns the change, then pause this recipe.
45
+ - `1-2 files`: proceed with direct adjustment.
46
+ - `3-5 files`: create a focused work plan.
47
+ - `6+ files` or ADR conditions: route to the frontend design flow.
48
+
49
+ ### Step 4: Plan Creation When Needed
50
+
51
+ For `3-5 files`, spawn `work-planner`:
52
+
53
+ `Create a focused UI adjustment plan. Adjustment request: [verbatim]. ui_analysis: [ui-analyzer JSON]. External resources: docs/project-context/external-resources.md. Confirmed write set: [files]. Each phase should be implementable as 1-3 commits. Include visual verification, accessibility, i18n parity, and generated artifact checks when relevant. Output path: docs/plans/[YYYYMMDD]-adjust-[short-description].md.`
54
+
55
+ **[STOP]** Present the plan and wait for approval.
56
+
57
+ For `1-2 files`, present a concise adjustment context:
58
+ - request
59
+ - confirmed write set
60
+ - relevant `focusAreas[]`
61
+ - relevant external resource summaries and access methods
62
+
63
+ **[STOP]** Wait for user confirmation that the context covers the work.
64
+
65
+ ### Step 5: Adjustment and Verification
66
+
67
+ For each adjustment unit:
68
+ 1. Plan the edit from `focusAreas[]`, confirmed write set, and relevant external resource summaries.
69
+ 2. Apply the edit in the parent session.
70
+ 3. Verify against declared access methods:
71
+ - design origin: compare implementation target to the recorded design source
72
+ - visual verification: use the recorded browser, test runner, Storybook, dev server, or manual confirmation path
73
+ - design system: confirm tokens, variants, and usage rules through the recorded source
74
+ 4. Refine until the implemented UI matches the design source or the user-confirmed adjustment target.
75
+
76
+ ### Step 6: Quality Verification
77
+
78
+ Spawn `quality-fixer-frontend` for each unit:
79
+
80
+ - Direct adjustment: pass `filesModified: [edited files]`
81
+ - Planned adjustment: pass `task_file: [work plan path]` and `filesModified: [edited files]`
82
+
83
+ Route `quality-fixer-frontend` results:
84
+ - `approved`: proceed to commit
85
+ - `stub_detected`: complete the implementation gap and rerun quality verification
86
+ - `blocked`: surface missing prerequisites or unclear specification points to the user
87
+
88
+ ### Step 7: Commit
89
+
90
+ Commit each approved adjustment unit with affected files and relevant generated artifacts.
91
+
92
+ ## Completion Criteria
93
+
94
+ - [ ] External resource hearing completed or update explicitly skipped
95
+ - [ ] `ui-analyzer` returned JSON with external resource status and `candidateWriteSet`
96
+ - [ ] User confirmed write set before scale judgment
97
+ - [ ] Scale judgment completed with matching branch
98
+ - [ ] Direct context or work plan approved
99
+ - [ ] Adjustment units edited and verified through declared resource paths
100
+ - [ ] Each unit passed `quality-fixer-frontend`
101
+ - [ ] Each approved unit committed
102
+
103
+ ## Output Example
104
+
105
+ ```
106
+ Frontend adjustment completed.
107
+ - External resources: docs/project-context/external-resources.md (updated|unchanged)
108
+ - UI analysis: [N] components, [M] focus areas
109
+ - Scale: 1-2 files | 3-5 files
110
+ - Work plan: path | N/A
111
+ - Adjustment units committed: [count]
112
+ - Quality status: approved
113
+ ```
@@ -0,0 +1,7 @@
1
+ interface:
2
+ display_name: "recipe-front-adjust"
3
+ short_description: "Implemented UI adjustment flow"
4
+ default_prompt: "Use $recipe-front-adjust to adjust an implemented UI: "
5
+
6
+ policy:
7
+ allow_implicit_invocation: false
@@ -29,8 +29,24 @@ Work plan: $ARGUMENTS
29
29
 
30
30
  ## Pre-execution Prerequisites
31
31
 
32
- ### Task File Existence Check
33
- Check for work plans in docs/plans/ and task files in docs/plans/tasks/.
32
+ ### Implementation Readiness Check
33
+
34
+ Before task processing, locate the work plan to gate against.
35
+
36
+ Resolution rule:
37
+ 1. If `$ARGUMENTS` contains a work plan path, use that exact file and derive `{plan-name}` from its basename. This takes precedence over task-file mtimes.
38
+ 2. If `$ARGUMENTS` is empty, list task files in `docs/plans/tasks/` matching `{plan-name}-frontend-task-*.md`.
39
+ 3. Exclude `*-task-prep-*.md`, `_overview-*.md`, `*-phase*-completion.md`, `review-fixes-*.md`, and `integration-tests-*-task-*.md`.
40
+ 4. If matching task files exist, infer `{plan-name}` from the most recent matching task file and use `docs/plans/{plan-name}.md`.
41
+ 5. If no matching task files exist, use the most recent non-template work plan in `docs/plans/`.
42
+
43
+ Read the work plan header and apply the Implementation Readiness Marker Contract from `subagents-orchestration-guide`.
44
+
45
+ ### Consumed Task Set
46
+
47
+ Compute the **Consumed Task Set** for this run: task files in `docs/plans/tasks/` matching `{plan-name}-frontend-task-*.md`, excluding `*-task-prep-*.md`, `_overview-*.md`, `*-phase*-completion.md`, `review-fixes-*.md`, and `integration-tests-*-task-*.md`.
48
+
49
+ Every subsequent reference to task files in this recipe uses this set, not an unrestricted `docs/plans/tasks/*.md` scan.
34
50
 
35
51
  ### Task Generation Decision Flow
36
52
 
@@ -38,8 +54,8 @@ Analyze task file existence state and determine the action required:
38
54
 
39
55
  | State | Criteria | Next Action |
40
56
  |-------|----------|-------------|
41
- | Tasks exist | .md files in tasks/ directory | User's execution instruction serves as batch approval -> Enter autonomous execution immediately |
42
- | No tasks + plan exists | Plan exists but no task files | Confirm with user -> spawn task-decomposer |
57
+ | Tasks exist | Consumed Task Set is non-empty | User's execution instruction serves as batch approval -> Enter autonomous execution immediately |
58
+ | No tasks + plan exists | Consumed Task Set is empty but plan exists | Confirm with user -> spawn task-decomposer |
43
59
  | Neither exists | No plan or task files | Error: Prerequisites not met |
44
60
 
45
61
  ## Task Decomposition Phase (Conditional)
@@ -58,7 +74,7 @@ Generate tasks from the work plan? (y/n):
58
74
  Spawn task-decomposer agent: "Read work plan at docs/plans/[plan-name].md and decompose into atomic tasks. Output: Individual task files in docs/plans/tasks/. Granularity: 1 task = 1 commit = independently executable"
59
75
 
60
76
  ### 3. Verify Generation
61
- Verify generated task files exist in docs/plans/tasks/.
77
+ Recompute the Consumed Task Set and verify it is non-empty.
62
78
 
63
79
  ## Pre-execution Checklist
64
80
 
@@ -131,6 +147,17 @@ After all task cycles finish, collect all `filesModified` from every task-execut
131
147
  - Maximum retry count is 1 verification fix cycle; if any failed verifier still fails after re-run, escalate to the user
132
148
  5. If both verifiers pass -> Proceed to completion report
133
149
 
150
+ ## Final Cleanup
151
+
152
+ Before the completion report, delete only these files for the current `{plan-name}`:
153
+ - Every file in the Consumed Task Set
154
+ - `docs/plans/tasks/{plan-name}-phase*-completion.md`
155
+ - `docs/plans/tasks/_overview-{plan-name}.md`
156
+
157
+ Preserve the work plan itself.
158
+
159
+ If cleanup fails, report the failed path but do not invalidate completed implementation work.
160
+
134
161
  **[STOP -- BLOCKING]** Upon detecting ANY requirement changes, halt execution immediately.
135
162
  **CANNOT proceed until user explicitly confirms the change scope.**
136
163
 
@@ -10,6 +10,7 @@ description: "Execute from requirement analysis to frontend design document crea
10
10
  1. [LOAD IF NOT ACTIVE] `documentation-criteria` -- document quality standards
11
11
  2. [LOAD IF NOT ACTIVE] `implementation-approach` -- implementation methodology
12
12
  3. [LOAD IF NOT ACTIVE] `subagents-orchestration-guide` -- agent coordination and workflow flows
13
+ 4. [LOAD IF NOT ACTIVE] `external-resource-context` -- external resource hearing and lookup
13
14
 
14
15
  **Spawn rule**: every `spawn_agent` call MUST pass `fork_turns="none"` or `fork_context=false` for context isolation.
15
16
 
@@ -19,7 +20,7 @@ description: "Execute from requirement analysis to frontend design document crea
19
20
 
20
21
  **Execution Method**:
21
22
  - Requirement analysis -> performed by requirement-analyzer
22
- - Codebase analysis -> performed by codebase-analyzer
23
+ - Codebase analysis -> performed by codebase-analyzer and ui-analyzer
23
24
  - UI Specification creation -> performed by ui-spec-designer
24
25
  - Design document creation -> performed by technical-designer-frontend
25
26
  - Design verification -> performed by code-verifier
@@ -31,6 +32,8 @@ Orchestrator spawns agents and passes structured data between them.
31
32
 
32
33
  **Included in this skill**:
33
34
  - Requirement analysis with requirement-analyzer
35
+ - External resource hearing with external-resource-context
36
+ - UI fact gathering with ui-analyzer alongside codebase-analyzer
34
37
  - UI Specification creation with ui-spec-designer (prototype code inquiry included)
35
38
  - ADR creation (if architecture changes, new technology, or data flow changes)
36
39
  - Design Doc creation with technical-designer-frontend
@@ -54,26 +57,41 @@ Once requirements are moderately clarified:
54
57
  **[STOP -- BLOCKING]** Review requirement analysis results and address question items.
55
58
  **CANNOT proceed until user explicitly confirms the requirement analysis.**
56
59
 
57
- ### Step 2: UI Specification Phase
58
- After requirement analysis approval, ask the user about prototype code:
60
+ ### Step 2: External Resource Hearing
61
+ After requirement analysis approval, run the frontend domain hearing protocol from `external-resource-context`.
62
+
63
+ Persist project-level access methods in `docs/project-context/external-resources.md`. When the file already exists, ask whether to keep current axes, refresh all axes, or refresh selected axes.
64
+
65
+ **[STOP -- BLOCKING]** Complete external resource hearing before UI fact gathering.
66
+ Proceed to UI fact gathering after project-level external resources are written or the update is explicitly skipped.
67
+
68
+ ### Step 3: Prototype Inquiry
69
+ After external resource hearing completes, ask the user about prototype code:
59
70
 
60
71
  **Ask the user**: "Do you have prototype code for this feature? If so, please provide the path to the code. The prototype will be placed in `docs/ui-spec/assets/` as reference material for the UI Spec."
61
72
 
62
73
  **[STOP -- BLOCKING]** Wait for user response about prototype code availability.
63
74
  **CANNOT proceed until user responds.**
64
75
 
65
- Then create the UI Specification:
66
- - Spawn ui-spec-designer agent: "Create UI Spec [from PRD at [path] if PRD exists]. [Prototype code is at [user-provided path]. Place prototype in docs/ui-spec/assets/{feature-name}/ | No prototype code available.]"
76
+ ### Step 4: UI Fact Gathering Phase
77
+ After prototype inquiry completes, use the prototype path as an input when one was provided.
78
+
79
+ Spawn codebase-analyzer and ui-analyzer in parallel:
80
+ - Spawn codebase-analyzer agent: "Analyze the existing codebase to provide evidence for frontend Design Doc creation. Focus on existing implementations, state paths, API integrations, and constraints the design should respect. requirement_analysis: [JSON from requirement-analyzer]. requirements: [original user requirements]. layer: frontend. target_paths: [frontend affected files and directories from requirement-analyzer]. focus_areas: component hierarchy, state management, UI interactions, data fetching."
81
+ - Spawn ui-analyzer agent: "Gather UI facts for frontend design. requirement_analysis: [JSON from requirement-analyzer]. requirements: [original user requirements]. target_paths: [frontend affected files and directories from requirement-analyzer]. target_components: [frontend target components when known]. ui_spec_path: [path if an existing UI Spec covers this feature]. 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."
82
+
83
+ ### Step 5: UI Specification Phase
84
+ After UI fact gathering completes, create the UI Specification:
85
+ - Spawn ui-spec-designer agent: "Create UI Spec [from PRD at [path] if PRD exists]. UI analysis: [JSON from ui-analyzer]. [Prototype code is at [user-provided path]. Place prototype in docs/ui-spec/assets/{feature-name}/ | Prototype path unavailable; proceed from PRD/requirements and UI analysis.] Fill External Resources Used from docs/project-context/external-resources.md and feature identifiers."
67
86
  - Spawn document-reviewer agent: "doc_type: UISpec target: [ui-spec path] Review for consistency and completeness"
68
87
 
69
88
  **[STOP -- BLOCKING]** Present UI Spec for user approval.
70
89
  **CANNOT proceed until user explicitly approves the UI Spec.**
71
90
 
72
- ### Step 3: Design Document Creation Phase
91
+ ### Step 6: Design Document Creation Phase
73
92
  Create appropriate design documents according to scale determination:
74
93
  - For ADR: Spawn technical-designer-frontend agent: "Create ADR for [technical decision]"
75
- - For Design Doc: Spawn codebase-analyzer agent first: "Analyze the existing codebase to provide evidence for frontend Design Doc creation. Focus on existing implementations, state paths, API integrations, and constraints the design should respect. requirement_analysis: [JSON from requirement-analyzer]. requirements: [original user requirements]. layer: frontend. target_paths: [frontend affected files and directories from requirement-analyzer]. focus_areas: component hierarchy, state management, UI interactions, data fetching."
76
- - For Design Doc: Spawn technical-designer-frontend agent: "Create Design Doc based on requirements. Codebase Analysis: [JSON from codebase-analyzer]. UI Spec is at [ui-spec path]. Inherit component structure and state design from UI Spec."
94
+ - For Design Doc: Spawn technical-designer-frontend agent: "Create Design Doc based on requirements. Codebase Analysis: [JSON from codebase-analyzer]. UI Analysis: [JSON from ui-analyzer]. UI Spec is at [ui-spec path]. Inherit component structure and state design from UI Spec. Fill External Resources Used from docs/project-context/external-resources.md and feature identifiers."
77
95
  - Spawn code-verifier agent: "Verify Design Doc against code. doc_type: design-doc. document_path: [document path]. verbose: false."
78
96
  - Spawn document-reviewer agent: "Review the Design Doc for consistency and completeness. doc_type: DesignDoc. target: [document path]. mode: composite. code_verification: [JSON from code-verifier]"
79
97
 
@@ -85,8 +103,9 @@ ENFORCEMENT: Every stop point MUST be respected. Skipping user approval invalida
85
103
  ## Completion Criteria
86
104
 
87
105
  - [ ] Requirement analysis completed and approved
106
+ - [ ] External resource hearing completed
107
+ - [ ] Codebase analysis and UI analysis completed before document creation
88
108
  - [ ] UI Specification created and approved
89
- - [ ] Codebase analysis completed before frontend Design Doc creation
90
109
  - [ ] Design document created and approved
91
110
  - [ ] All document reviews passed
92
111
 
@@ -48,7 +48,7 @@ Check for existence of design documents in docs/design/.
48
48
  Spawn acceptance-test-generator agent: "Generate test skeletons from Design Doc at [path]. [UI Spec at [ui-spec path] if exists.]"
49
49
 
50
50
  ### Step 3: Work Plan Creation
51
- Spawn work-planner agent: "Create work plan from Design Doc at [path]. Integration test file: [path from step 2]. E2E test file: [path from step 2 or null]. E2E absence reason: [value from step 2 when E2E file is null]. Integration tests are created simultaneously with each phase implementation, E2E tests are executed only in final phase when an E2E file exists."
51
+ Spawn work-planner agent: "Create work plan from Design Doc at [path]. Integration test file: [path from step 2]. fixture-e2e test file: [path from step 2 or null]. service-integration-e2e test file: [path from step 2 or null]. E2E absence reasons by lane: [values from step 2 when an E2E lane is null]. Integration tests are created with each phase implementation, fixture-e2e runs alongside UI implementation, service-integration-e2e runs only in the final phase when a service E2E file exists. Include `Implementation Readiness: pending` in the work plan header."
52
52
 
53
53
  **[STOP -- BLOCKING]** Interact with user to complete plan and obtain approval for plan content. Clarify specific implementation steps and risks.
54
54
  **CANNOT proceed until user explicitly approves the work plan.**
@@ -18,7 +18,8 @@ description: "Frontend Design Doc compliance and security validation with option
18
18
  - Compliance validation -> performed by code-reviewer
19
19
  - Security validation -> performed by security-reviewer
20
20
  - Rule analysis -> performed by rule-advisor
21
- - Fix implementation -> performed by task-executor-frontend
21
+ - Code-side fix path -> performed by task-executor-frontend
22
+ - Design-side update path -> performed by technical-designer-frontend in update mode, then document-reviewer, then design-sync when multiple Design Docs exist
22
23
  - Quality checks -> performed by quality-fixer-frontend
23
24
  - Re-validation -> performed by code-reviewer / security-reviewer
24
25
 
@@ -80,28 +81,45 @@ Security Review: [status from security-reviewer]
80
81
  - [policy] [location]: [description] — [rationale]
81
82
  Notes: [notes from security-reviewer, if present]
82
83
 
83
- Execute fixes? (y/n):
84
+ Resolve discrepancies by route:
85
+ c) Code-side fix
86
+ d) Design-side update
87
+ s) Skip
88
+
89
+ Default: accept all recommended routes.
90
+
91
+ Accepted response formats:
92
+ - empty input -- accept every recommended route
93
+ - `all-recommended` -- accept every recommended route
94
+ - `all:c`, `all:d`, or `all:s` -- apply one route to every finding
95
+ - Per-finding routes, e.g. `F1:c, F2:d, F3:s`
84
96
  ```
85
97
 
86
- **[STOP -- BLOCKING]** Wait for user response on whether to execute fixes.
87
- **CANNOT proceed with auto-fixes without user approval.**
98
+ Before presenting results, recommend a route for each finding:
99
+ - Use `d` when implementation intent matches the requirement but the Design Doc is stale or too narrow.
100
+ - Use `c` when code drifted from a still-correct Design Doc, or when the finding is reliability, security, or maintainability related.
101
+ - Use `s` only when the user explicitly accepts the current state without changes.
88
102
 
89
- If both pass and user selects `n`: Skip fix steps, proceed to Final Report.
103
+ **[STOP -- BLOCKING]** Wait for user response on routes.
104
+ **CANNOT proceed with fixes or document updates without user approval.**
90
105
 
91
- If user selects `y`:
106
+ If all findings are skipped: Skip fix steps, proceed to Final Report.
92
107
 
93
108
  ## Pre-fix Metacognition
94
109
 
95
110
  1. **Spawn rule-advisor agent**: "Analyze fixes needed. Code issues: $STEP_2_OUTPUT. Security findings: $STEP_3_OUTPUT. Determine root solutions vs symptomatic treatments."
96
- 2. **Register tasks**: Register work steps. Always include: first "Confirm skill constraints", final "Verify skill fidelity". Create task file -> `docs/plans/tasks/review-fixes-YYYYMMDD.md`. Include both code compliance issues and security requiredFixes.
97
- 3. **Spawn task-executor-frontend agent**: "Execute staged auto-fixes for [task-file-path]. Stop at 5 files."
98
- 4. **Spawn quality-fixer-frontend agent**: "Execute all frontend quality checks and confirm quality gate passage"
99
- 5. **Re-validate code-reviewer**: Spawn code-reviewer agent: "Re-validate compliance for [design-doc-path]. Prior issues: $STEP_2_OUTPUT. Measure improvement."
100
- 6. **Re-validate security-reviewer** (only if security fixes were applied): Spawn security-reviewer agent: "Re-validate security after fixes. Prior findings: $STEP_3_OUTPUT. Design Doc: [path]. Implementation files: [union of $STEP_1_FILES and task-executor-frontend filesModified from step 3, deduplicated]."
111
+ 2. **Design-side update**: If any finding is routed to `d`, spawn technical-designer-frontend in update mode, then document-reviewer, then design-sync when multiple Design Docs exist. If both `d` and `c` routes exist, re-evaluate `c` findings against the updated Design Doc and drop any now satisfied.
112
+ 3. **Register tasks**: Register work steps. Always include: first "Confirm skill constraints", final "Verify skill fidelity". Create task file -> `docs/plans/tasks/review-fixes-YYYYMMDD.md`. Include only code compliance issues and security requiredFixes routed to `c`.
113
+ 4. **Spawn task-executor-frontend agent**: "Execute staged auto-fixes for [task-file-path]. Stop at 5 files."
114
+ 5. **Spawn quality-fixer-frontend agent**: "Execute all frontend quality checks and confirm quality gate passage"
115
+ 6. **Re-validate code-reviewer**: Spawn code-reviewer agent: "Re-validate compliance for [design-doc-path]. Prior issues: $STEP_2_OUTPUT. Measure improvement."
116
+ 7. **Re-validate security-reviewer** (only if security fixes were applied): Spawn security-reviewer agent: "Re-validate security after fixes. Prior findings: $STEP_3_OUTPUT. Design Doc: [path]. Implementation files: [union of $STEP_1_FILES and task-executor-frontend filesModified from step 4, deduplicated]."
101
117
 
102
118
  ENFORCEMENT: Auto-fixes MUST go through quality-fixer-frontend before re-validation. Skipping quality checks invalidates fixes.
103
119
 
104
120
  ### Final Report
121
+ Delete the review-fix task file this recipe created, if present. Its work is committed; `docs/plans/` is ephemeral working state.
122
+
105
123
  ```
106
124
  Code Compliance:
107
125
  Initial: [X]%
@@ -39,8 +39,24 @@ Work plan: $ARGUMENTS
39
39
 
40
40
  ## Pre-execution Prerequisites
41
41
 
42
- ### Task File Existence Check
43
- Check for work plans in docs/plans/ and task files in docs/plans/tasks/.
42
+ ### Implementation Readiness Check
43
+
44
+ Before task processing, locate the work plan to gate against.
45
+
46
+ Resolution rule:
47
+ 1. If `$ARGUMENTS` contains a work plan path, use that exact file and derive `{plan-name}` from its basename. This takes precedence over task-file mtimes.
48
+ 2. If `$ARGUMENTS` is empty, list task files in `docs/plans/tasks/` matching `{plan-name}-backend-task-*.md` or `{plan-name}-frontend-task-*.md`.
49
+ 3. Exclude `*-task-prep-*.md`, `_overview-*.md`, `*-phase*-completion.md`, `review-fixes-*.md`, and `integration-tests-*-task-*.md`.
50
+ 4. If matching task files exist, infer `{plan-name}` from the most recent matching task file and use `docs/plans/{plan-name}.md`.
51
+ 5. If no matching task files exist, use the most recent non-template work plan in `docs/plans/`.
52
+
53
+ Read the work plan header and apply the Implementation Readiness Marker Contract from `subagents-orchestration-guide`.
54
+
55
+ ### Consumed Task Set
56
+
57
+ Compute the **Consumed Task Set** for this run: task files in `docs/plans/tasks/` matching `{plan-name}-backend-task-*.md` or `{plan-name}-frontend-task-*.md`, excluding `*-task-prep-*.md`, `_overview-*.md`, `*-phase*-completion.md`, `review-fixes-*.md`, and `integration-tests-*-task-*.md`.
58
+
59
+ Every subsequent reference to task files in this recipe uses this set, not an unrestricted `docs/plans/tasks/*.md` scan.
44
60
 
45
61
  ### Task Generation Decision Flow
46
62
 
@@ -48,8 +64,8 @@ Analyze task file existence state and determine the action required:
48
64
 
49
65
  | State | Criteria | Next Action |
50
66
  |-------|----------|-------------|
51
- | Tasks exist | .md files in tasks/ directory | User's execution instruction serves as batch approval -> Enter autonomous execution immediately |
52
- | No tasks + plan exists | Plan exists but no task files | Confirm with user -> spawn task-decomposer |
67
+ | Tasks exist | Consumed Task Set is non-empty | User's execution instruction serves as batch approval -> Enter autonomous execution immediately |
68
+ | No tasks + plan exists | Consumed Task Set is empty but plan exists | Confirm with user -> spawn task-decomposer |
53
69
  | Neither exists | No plan or task files | Error: Prerequisites not met |
54
70
 
55
71
  ## Task Decomposition Phase (Conditional)
@@ -68,7 +84,7 @@ Generate tasks from the work plan? (y/n):
68
84
  Spawn task-decomposer agent: "Read work plan at docs/plans/[plan-name].md and decompose into atomic tasks. Output: Individual task files in docs/plans/tasks/. Granularity: 1 task = 1 commit = independently executable. Use layer-aware naming: {plan}-backend-task-{n}.md, {plan}-frontend-task-{n}.md based on target file paths."
69
85
 
70
86
  ### 3. Verify Generation
71
- Verify generated task files exist in docs/plans/tasks/.
87
+ Recompute the Consumed Task Set and verify it is non-empty.
72
88
 
73
89
  ## Pre-execution Checklist
74
90
 
@@ -141,6 +157,17 @@ After all task cycles finish, collect all `filesModified` from every task-execut
141
157
  - Maximum retry count is 1 verification fix cycle; if any failed verifier still fails after re-run, escalate to the user
142
158
  5. If all verifiers pass -> Proceed to completion report
143
159
 
160
+ ## Final Cleanup
161
+
162
+ Before the completion report, delete only these files for the current `{plan-name}`:
163
+ - Every file in the Consumed Task Set
164
+ - `docs/plans/tasks/{plan-name}-phase*-completion.md`
165
+ - `docs/plans/tasks/_overview-{plan-name}.md`
166
+
167
+ Preserve the work plan itself.
168
+
169
+ If cleanup fails, report the failed path but do not invalidate completed implementation work.
170
+
144
171
  **[STOP -- BLOCKING]** Upon detecting ANY requirement changes, halt execution immediately.
145
172
  **CANNOT proceed until user explicitly confirms the change scope.**
146
173
 
@@ -13,6 +13,7 @@ description: "Orchestrate full-cycle implementation across backend and frontend
13
13
  4. [LOAD IF NOT ACTIVE] `documentation-criteria` -- document quality standards
14
14
  5. [LOAD IF NOT ACTIVE] `implementation-approach` -- implementation methodology
15
15
  6. [LOAD IF NOT ACTIVE] `subagents-orchestration-guide` -- agent coordination and workflow flows
16
+ 7. [LOAD IF NOT ACTIVE] `external-resource-context` -- external resource hearing and lookup
16
17
 
17
18
  **Spawn rule**: every `spawn_agent` call MUST pass `fork_turns="none"` or `fork_context=false` for context isolation.
18
19
 
@@ -29,7 +30,7 @@ ENFORCEMENT: Proceeding without reading monorepo-flow.md invalidates the entire
29
30
  ## Execution Protocol
30
31
 
31
32
  1. **Spawn agents for all work** -- your role is to invoke sub-agents, pass data between them, and report results
32
- 2. **Follow monorepo-flow.md** for the design phase (multiple Design Docs, design-sync, vertical slicing)
33
+ 2. **Follow monorepo-flow.md** for the design phase (external resource hearing at design entry, multiple Design Docs, design-sync, vertical slicing)
33
34
  3. **Follow subagents-orchestration-guide skill** for all other orchestration rules (stop points, structured responses, escalation)
34
35
  4. **Enter autonomous mode** only after "batch approval for entire implementation phase"
35
36
 
@@ -59,6 +60,7 @@ When continuing existing flow, verify:
59
60
  ### 3. Execute monorepo-flow.md
60
61
 
61
62
  **Follow monorepo-flow.md step-by-step** for the complete flow from UI Spec through Design Docs through Work Plan. The flow includes:
63
+ - External resource hearing at the design phase entry
62
64
  - UI Spec creation (with prototype inquiry)
63
65
  - Separate Design Docs per layer (technical-designer for backend, technical-designer-frontend for frontend)
64
66
  - **Backend Design Doc**: Spawn technical-designer agent
@@ -89,6 +91,7 @@ When user responds to questions:
89
91
  **Pre-execution Checklist (MANDATORY)**:
90
92
  - [ ] Read monorepo-flow.md reference
91
93
  - [ ] Confirmed relevant flow steps
94
+ - [ ] External resource hearing included when entering design flow
92
95
  - [ ] Identified current progress position
93
96
  - [ ] Clarified next step
94
97
  - [ ] Recognized stopping points
@@ -101,6 +104,7 @@ When user responds to questions:
101
104
  **Required Flow Compliance**:
102
105
  - Run quality-fixer (layer-appropriate) before every commit
103
106
  - Obtain user approval before Edit/Write outside autonomous mode
107
+ - Run implementation readiness preflight for the approved work plan before autonomous implementation, or continue without it only after explicit user approval
104
108
 
105
109
  ENFORCEMENT: Commits without quality-fixer approval are invalid and MUST be reverted.
106
110
 
@@ -117,6 +121,10 @@ ENFORCEMENT: Sub-agent prompts missing the constraint suffix MUST be re-issued w
117
121
 
118
122
  ## Task Execution Quality Cycle (Filename-Pattern-Based)
119
123
 
124
+ ### Implementation Readiness Gate
125
+
126
+ Before executing task files, execute the Implementation Readiness Preflight Procedure from `subagents-orchestration-guide` for the approved work plan exact path. This means loading the work plan, evaluating R1-R5, resolving approved prep gaps through exact prep task files when needed, persisting the Readiness Report, and setting `Implementation Readiness: ready` or `escalated`. Then apply the Implementation Readiness Marker Contract before entering autonomous execution.
127
+
120
128
  **Agent routing by task filename** (see monorepo-flow.md reference):
121
129
  ```
122
130
  *-backend-task-* -> task-executor + quality-fixer
@@ -152,9 +160,10 @@ After all task cycles finish, collect all `filesModified` from every task-execut
152
160
  ### Test Information Communication
153
161
  After acceptance-test-generator execution, when calling work-planner, communicate:
154
162
  - Generated integration test file path
155
- - Generated E2E test file path or `null`
156
- - E2E absence reason when no E2E file is generated
157
- - Explicit note that integration tests are created simultaneously with implementation, E2E tests are executed after all implementations only when an E2E file exists
163
+ - Generated fixture-e2e test file path or `null`
164
+ - Generated service-integration-e2e test file path or `null`
165
+ - E2E absence reason per lane when no E2E file is generated
166
+ - Explicit note that integration tests are created simultaneously with implementation, fixture-e2e runs alongside UI implementation, and service-integration-e2e executes after all implementations only when a service E2E file exists
158
167
 
159
168
  **[STOP -- BLOCKING]** Upon detecting ANY requirement changes, halt execution immediately.
160
169
  **CANNOT proceed until user explicitly confirms the change scope.**
@@ -72,7 +72,10 @@ Follow subagents-orchestration-guide skill Large/Medium/Small scale flow exactly
72
72
  **STEP 4**: Spawn acceptance-test-generator agent → spawn work-planner agent.
73
73
  **[STOP — BLOCKING]** Present Work Plan for user approval. **CANNOT proceed until user explicitly confirms.**
74
74
 
75
- **STEP 5**: Enter guided autonomous execution (see Autonomous Execution Mode below) using task-executor-frontend + quality-fixer-frontend agents.
75
+ **STEP 5**: Run implementation readiness preflight.
76
+ Execute the Implementation Readiness Preflight Procedure from `subagents-orchestration-guide` for the approved work plan exact path. This means loading the work plan, evaluating R1-R5, resolving approved prep gaps through exact prep task files when needed, persisting the Readiness Report, and setting `Implementation Readiness: ready` or `escalated`. Apply the Implementation Readiness Marker Contract before entering autonomous execution.
77
+
78
+ **STEP 6**: Enter guided autonomous execution (see Autonomous Execution Mode below) using task-executor-frontend + quality-fixer-frontend agents.
76
79
 
77
80
  ---
78
81
 
@@ -90,6 +93,10 @@ Follow subagents-orchestration-guide `references/monorepo-flow.md` for the compl
90
93
 
91
94
  After user grants "batch approval for entire implementation phase", enter autonomous execution.
92
95
 
96
+ ### Implementation Readiness Gate
97
+
98
+ Before executing task files, read the associated work plan header and apply the Implementation Readiness Marker Contract from `subagents-orchestration-guide`.
99
+
93
100
  ### Task Execution Quality Cycle (4-Step Cycle per Task)
94
101
 
95
102
  **Agent routing by task filename** (for fullstack projects):
@@ -136,9 +143,10 @@ After all task cycles finish, collect all `filesModified` from every executor re
136
143
  ### Test Information Communication
137
144
  After acceptance-test-generator execution, when spawning work-planner, communicate:
138
145
  - Generated integration test file path
139
- - Generated E2E test file path or `null`
140
- - E2E absence reason when no E2E file is generated
141
- - Note: integration tests are created with implementation; E2E tests run after all implementations when an E2E file exists
146
+ - Generated fixture-e2e test file path or `null`
147
+ - Generated service-integration-e2e test file path or `null`
148
+ - E2E absence reason per lane when no E2E file is generated
149
+ - Note: integration tests are created with implementation; fixture-e2e runs alongside UI implementation; service-integration-e2e runs after all implementations when a service E2E file exists
142
150
 
143
151
  ## Completion Criteria
144
152
 
@@ -45,14 +45,14 @@ Follow the planning process below:
45
45
  Check for existence of design documents in docs/design/, notify user if none exist.
46
46
  Present options if multiple exist (can be specified with $ARGUMENTS).
47
47
 
48
- ### Step 2: E2E Test Skeleton Generation Confirmation
49
- - Confirm with user whether to generate E2E test skeleton first
48
+ ### Step 2: Integration/E2E Test Skeleton Generation Confirmation
49
+ - Confirm with user whether to generate integration and E2E test skeletons first
50
50
  - If user wants generation: Spawn acceptance-test-generator agent: "Generate test skeletons from Design Doc at [design-doc-path]"
51
51
  - Pass generation results to next process according to subagents-orchestration-guide skill coordination specification
52
- - If no E2E file is generated, carry the explicit `e2eAbsenceReason` forward as a valid planning input
52
+ - If no E2E file is generated for a lane, carry the explicit lane-specific `e2eAbsenceReason` forward as a valid planning input
53
53
 
54
54
  ### Step 3: Work Plan Creation
55
- - Spawn work-planner agent: "Create work plan from design document at [design-doc-path]. Include deliverables from previous process according to subagents-orchestration-guide skill coordination specification. If `generatedFiles.e2e` is null, use `e2eAbsenceReason` and accept the null E2E file as a valid planning input."
55
+ - Spawn work-planner agent: "Create work plan from design document at [design-doc-path]. Include deliverables from previous process according to subagents-orchestration-guide skill coordination specification. If `generatedFiles.fixtureE2e` or `generatedFiles.serviceE2e` is null, use the corresponding `e2eAbsenceReason` and accept the null E2E lane as a valid planning input. Include `Implementation Readiness: pending` in the work plan header."
56
56
  - Interact with user to complete plan and obtain approval for plan content
57
57
  - Clarify specific implementation steps and risks
58
58
 
@@ -61,7 +61,7 @@ Present options if multiple exist (can be specified with $ARGUMENTS).
61
61
  ## Completion Criteria
62
62
 
63
63
  - [ ] Design document identified and selected
64
- - [ ] E2E test skeleton generation confirmed with user (generated if requested)
64
+ - [ ] Integration/E2E test skeleton generation confirmed with user (generated if requested)
65
65
  - [ ] Work plan created via work-planner
66
66
  - [ ] Plan content approved by user
67
67
  - [ ] All stopping points honored with user confirmation