codex-workflows 0.4.11 → 0.5.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 (29) hide show
  1. package/.agents/skills/coding-rules/references/typescript.md +1 -1
  2. package/.agents/skills/documentation-criteria/references/plan-template.md +19 -0
  3. package/.agents/skills/documentation-criteria/references/ui-spec-template.md +2 -0
  4. package/.agents/skills/integration-e2e-testing/SKILL.md +34 -21
  5. package/.agents/skills/integration-e2e-testing/references/e2e-design.md +16 -10
  6. package/.agents/skills/recipe-add-integration-tests/SKILL.md +7 -0
  7. package/.agents/skills/recipe-build/SKILL.md +32 -5
  8. package/.agents/skills/recipe-front-build/SKILL.md +32 -5
  9. package/.agents/skills/recipe-front-plan/SKILL.md +1 -1
  10. package/.agents/skills/recipe-front-review/SKILL.md +29 -11
  11. package/.agents/skills/recipe-fullstack-build/SKILL.md +32 -5
  12. package/.agents/skills/recipe-fullstack-implement/SKILL.md +9 -3
  13. package/.agents/skills/recipe-implement/SKILL.md +12 -4
  14. package/.agents/skills/recipe-plan/SKILL.md +5 -5
  15. package/.agents/skills/recipe-prepare-implementation/SKILL.md +162 -0
  16. package/.agents/skills/recipe-prepare-implementation/agents/openai.yaml +7 -0
  17. package/.agents/skills/recipe-review/SKILL.md +34 -6
  18. package/.agents/skills/subagents-orchestration-guide/SKILL.md +34 -34
  19. package/.agents/skills/subagents-orchestration-guide/references/monorepo-flow.md +1 -1
  20. package/.agents/skills/task-analyzer/references/skills-index.yaml +13 -5
  21. package/.agents/skills/testing/references/typescript.md +2 -3
  22. package/.codex/agents/acceptance-test-generator.toml +69 -31
  23. package/.codex/agents/task-decomposer.toml +27 -2
  24. package/.codex/agents/task-executor-frontend.toml +5 -11
  25. package/.codex/agents/task-executor.toml +8 -14
  26. package/.codex/agents/technical-designer-frontend.toml +2 -2
  27. package/.codex/agents/work-planner.toml +54 -17
  28. package/README.md +12 -2
  29. package/package.json +1 -1
@@ -59,7 +59,7 @@ function isUser(value: unknown): value is User {
59
59
  - **Function Components (Mandatory)**: Official React recommendation, optimizable by modern tooling
60
60
  - **Classes Prohibited**: Class components completely deprecated (Exception: Error Boundary)
61
61
  - **Custom Hooks**: Standard pattern for logic reuse and dependency injection
62
- - **Component Hierarchy**: Atoms > Molecules > Organisms > Templates > Pages
62
+ - **Component Hierarchy**: Follow the project's existing component architecture. Use Atoms > Molecules > Organisms > Templates > Pages only when the project adopts Atomic Design.
63
63
  - **Co-location**: Place tests, styles, and related files alongside components
64
64
 
65
65
  **State Management Patterns**
@@ -5,6 +5,7 @@ Type: feature|fix|refactor
5
5
  Estimated Duration: X days
6
6
  Estimated Impact: X files
7
7
  Related Issue/PR: #XXX (if any)
8
+ Implementation Readiness: pending
8
9
 
9
10
  ## Related Documents
10
11
  - Design Doc(s):
@@ -66,6 +67,24 @@ Map each Design Doc technical requirement to the task or phase that covers it. U
66
67
  - Merge duplicate restatements of the same obligation from multiple DD sections into one row and cite the primary section in `DD Section`
67
68
  - Keep `scope-boundary` rows concrete: name the protected file group, component boundary, contract, or workflow that must remain unchanged
68
69
 
70
+ ## UI Spec Component -> Task Mapping
71
+
72
+ Include this section when a UI Spec is among the inputs. Map each UI component section to the task(s) that implement it so task-decomposer can pass the exact UI Spec context to executor tasks. Omit this section when no UI Spec exists.
73
+
74
+ | UI Spec Component (section heading) | States to Cover | Covered By Task(s) | Gap Status | Notes |
75
+ |-------------------------------------|-----------------|--------------------|------------|-------|
76
+ | [Use the UI Spec heading exactly as written, e.g. "Component: AlertCard"] | [default / loading / empty / error / partial] | [P1-T1, P2-T1] | covered | |
77
+
78
+ **Reference key rule**: The component identifier is the UI Spec section heading verbatim. Component headings must be unique within a UI Spec.
79
+
80
+ ## Connection Map
81
+
82
+ Include this section when implementation crosses runtime, process, deployment, or service boundaries. Omit it when the change stays inside one runtime or only uses in-process package imports.
83
+
84
+ | Boundary | Caller / Producer | Callee / Consumer | Expected Signal | Covered By Task(s) |
85
+ |----------|-------------------|-------------------|-----------------|--------------------|
86
+ | [e.g. "web client -> API"] | [module/package initiating request or message] | [module/package receiving request or message] | [Observable evidence, e.g. HTTP 200 matching schema X] | [P1-T1, P1-T2] |
87
+
69
88
  ## Objective
70
89
  [Why this change is necessary, what problem it solves]
71
90
 
@@ -59,6 +59,8 @@ Map PRD acceptance criteria to prototype references. Skip this section if no pro
59
59
 
60
60
  ### Component: [ComponentName]
61
61
 
62
+ > Component heading uniqueness: every `Component: [ComponentName]` heading must be unique within this UI Spec. Work plans and task decomposition reference components by exact heading text.
63
+
62
64
  #### State x Display Matrix
63
65
 
64
66
  List only states that actually exist for this component. Remove unused rows. Include fallback or degraded states only when explicitly required by the PRD or existing behavior.
@@ -7,14 +7,15 @@ description: "Integration and E2E test design principles, value-based selection,
7
7
 
8
8
  ## References
9
9
 
10
- **E2E test design with Playwright**: See [references/e2e-design.md](references/e2e-design.md) for UI Spec-driven E2E test candidate selection and Playwright test architecture.
10
+ **E2E test design**: See [references/e2e-design.md](references/e2e-design.md) for UI Spec-driven E2E test candidate selection and browser test architecture. Playwright is the default browser harness example; use the project's standard when different.
11
11
 
12
12
  ## Test Type Definition and Limits [MANDATORY]
13
13
 
14
- | Test Type | Purpose | Scope | Limit per Feature | Implementation Timing |
15
- |-----------|---------|-------|-------------------|----------------------|
16
- | Integration | Verify component interactions | Partial system integration | MAX 3 | Created alongside implementation |
17
- | E2E | Verify critical user journeys | Full system | MAX 1-2 | Executed in final phase only |
14
+ | Test Type | Purpose | Scope | External Deps | Limit per Feature | Implementation Timing |
15
+ |-----------|---------|-------|---------------|-------------------|----------------------|
16
+ | Integration | Verify component interactions in-process | Partial system integration | Project-local dependencies | MAX 3 | Created alongside implementation |
17
+ | fixture-e2e | Verify browser/user journey with controlled state | Browser UI + mocked backend or fixtures | No live stack required | MAX 3 | Created alongside UI implementation |
18
+ | service-integration-e2e | Verify live-stack cross-service correctness | Full local stack | Local services, DB, queues, stubs | MAX 1-2 | Executed in final phase only |
18
19
 
19
20
  **ENFORCEMENT**: Exceeding test limits requires explicit justification
20
21
 
@@ -42,44 +43,53 @@ Value Score = (Business Value x User Frequency) + (Legal Requirement x 10) + Def
42
43
 
43
44
  Use `Value Score` for ranking candidates of the same test type. Handle E2E cost through budget limits and reserved-slot rules instead of cost-division scoring.
44
45
 
45
- ### E2E Threshold
46
+ ### E2E Lane Thresholds
46
47
 
47
- - `E2E threshold = Value Score >= 50`
48
- - Use this threshold for non-reserved E2E selection only
48
+ - `fixture-e2e threshold = Value Score >= 20` for non-reserved candidates
49
+ - `service-integration-e2e threshold = Value Score > 50` for non-reserved candidates
49
50
  - Reserved-slot eligibility overrides the threshold when the candidate is the highest-value user-facing multi-step journey
50
51
 
52
+ The fixture-e2e threshold is lower because this lane uses mocked backend or fixture-driven state, avoids live-stack setup, and has a higher per-feature budget. The service-integration-e2e threshold stays higher because live-stack tests are slower, more brittle, and more expensive to maintain.
53
+
51
54
  ### Selection Rules
52
55
 
53
56
  | Test Type | Ranking Basis | Selection Rule |
54
57
  |-----------|---------------|----------------|
55
58
  | Integration | Highest `Value Score` among integration candidates | Select up to budget |
56
- | E2E | Highest `Value Score` among E2E candidates | Select when `reservedSlotEligible = true`, or when `Value Score >= 50` |
59
+ | fixture-e2e | Highest `Value Score` among fixture-e2e candidates | Select reserved user-facing journey or candidates with `Value Score >= 20` |
60
+ | service-integration-e2e | Highest `Value Score` among service-integration-e2e candidates | Select reserved cross-service journey or candidates with `Value Score > 50` |
57
61
 
58
62
  ### E2E Candidate Rules
59
63
 
60
64
  - Treat integration and E2E as complementary coverage layers
65
+ - Default browser-level user journeys to `fixture-e2e` when mocked backend or fixture-driven state can verify the behavior
66
+ - Promote to `service-integration-e2e` only when correctness depends on real cross-service behavior such as DB persistence, queue/event delivery, transactional consistency, or external service contract payloads
61
67
  - Retain an E2E candidate when it validates a user-facing multi-step journey, even if integration tests partially cover the behavior
62
- - Preserve E2E candidates for user-facing multi-step journeys that validate cross-screen or cross-boundary continuity
63
- - Distinguish user-facing journeys from service-internal chains; reserved E2E coverage applies only to user-facing journeys
68
+ - Distinguish user-facing journeys from service-internal chains; reserved fixture-e2e coverage applies only to user-facing journeys
64
69
 
65
70
  ### Reserved E2E Slot
66
71
 
67
- Reserve 1 E2E slot for the highest-value user-facing multi-step journey when such a journey exists, even if it does not satisfy `Value Score >= 50`.
72
+ Reserve 1 fixture-e2e slot for the highest-value user-facing multi-step journey when such a journey exists, even if it does not satisfy `Value Score >= 20`.
73
+
74
+ Reserve 1 service-integration-e2e slot only when that journey requires real cross-service verification that fixture-e2e cannot prove.
68
75
 
69
76
  ### E2E Absence Contract
70
77
 
71
78
  When no E2E test is generated, downstream artifacts must treat that as an explicit decision, not an error. Carry:
72
- - `generatedFiles.e2e: null`
73
- - `e2eAbsenceReason`: one of `no_user_facing_multi_step_journey`, `all_e2e_candidates_below_threshold`, `covered_by_existing_e2e`, `budget_not_justified`
79
+ - `generatedFiles.fixtureE2e: null`
80
+ - `generatedFiles.serviceE2e: null`
81
+ - `e2eAbsenceReason.fixtureE2e`: one of `no_user_facing_multi_step_journey`, `all_e2e_candidates_below_threshold`, `covered_by_existing_e2e`, `budget_not_justified`
82
+ - `e2eAbsenceReason.serviceE2e`: one of the fixture reasons plus `no_real_service_dependency`
74
83
 
75
84
  ### E2E Selection Decision Table
76
85
 
77
86
  | Condition | Result |
78
87
  |-----------|--------|
79
- | At least one user-facing multi-step journey exists | Reserve 1 E2E slot for the highest-value such journey |
80
- | Remaining E2E candidate has `Value Score >= 50` | Eligible for non-reserved E2E selection |
81
- | Remaining E2E candidate has `Value Score < 50` | Exclude and use `all_e2e_candidates_below_threshold` if no E2E remains |
82
- | Existing E2E already covers the same journey | Exclude and use `covered_by_existing_e2e` if no E2E remains |
88
+ | At least one user-facing multi-step journey exists | Reserve 1 fixture-e2e slot for the highest-value such journey |
89
+ | Journey correctness requires live cross-service behavior | Reserve or consider service-integration-e2e |
90
+ | Remaining fixture-e2e candidate has `Value Score >= 20` | Eligible for non-reserved fixture-e2e selection |
91
+ | Remaining service-integration-e2e candidate has `Value Score > 50` | Eligible for non-reserved service-integration-e2e selection |
92
+ | Existing E2E already covers the same journey | Exclude and use `covered_by_existing_e2e` if no lane remains |
83
93
 
84
94
  ## Test Skeleton Specification [MANDATORY]
85
95
 
@@ -90,8 +100,9 @@ Each test MUST include the following annotations:
90
100
  ```
91
101
  // AC: [Original acceptance criteria text]
92
102
  // Behavior: [Trigger] -> [Process] -> [Observable Result]
93
- // @category: core-functionality | integration | edge-case | e2e
94
- // @dependency: none | [component names] | full-system
103
+ // @category: core-functionality | integration | edge-case | fixture-e2e | service-integration-e2e
104
+ // @lane: integration | fixture-e2e | service-integration-e2e
105
+ // @dependency: none | [component names] | full-ui (mocked backend) | full-system
95
106
  // @real-dependency: [component names] (optional)
96
107
  // @complexity: low | medium | high
97
108
  // Value Score: [score]
@@ -133,7 +144,9 @@ These annotations allow work-planner to create prerequisite tasks before E2E exe
133
144
  ## Test File Naming Convention
134
145
 
135
146
  - Integration tests: `*.int.test.*` or `*.integration.test.*`
136
- - E2E tests: `*.e2e.test.*`
147
+ - fixture-e2e tests: `*.fixture.e2e.test.*`
148
+ - service-integration-e2e tests: `*.service.e2e.test.*`
149
+ - legacy E2E tests: `*.e2e.test.*`
137
150
 
138
151
  The test runner or framework in the project determines the appropriate file extension.
139
152
 
@@ -1,10 +1,12 @@
1
- # E2E Test Design with Playwright
1
+ # E2E Test Design
2
2
 
3
3
  ## When to Create E2E Tests
4
4
 
5
- E2E tests target **critical user journeys** that span multiple pages or require real browser interaction. Apply the parent skill rules exactly:
6
- - Reserve 1 E2E slot for the highest-value user-facing multi-step journey
7
- - Use `Value Score >= 50` for any additional non-reserved E2E candidate
5
+ E2E tests target critical user journeys that span multiple interaction boundaries or require browser-level verification. Apply the parent skill rules exactly:
6
+ - Reserve 1 fixture-e2e slot for the highest-value user-facing multi-step journey
7
+ - Use `Value Score >= 20` for additional fixture-e2e candidates
8
+ - Use service-integration-e2e only when correctness depends on real cross-service behavior
9
+ - Use `Value Score > 50` for additional service-integration-e2e candidates
8
10
 
9
11
  ### Candidate Sources
10
12
 
@@ -22,6 +24,7 @@ E2E tests target **critical user journeys** that span multiple pages or require
22
24
  - Flows requiring real browser APIs (navigation, cookies, localStorage)
23
25
  - Accessibility verification requiring actual DOM rendering
24
26
  - Responsive behavior across viewports
27
+ - Live-stack verification where DB persistence, queue/event delivery, transaction consistency, or external service payloads are the behavior under test
25
28
 
26
29
  **Exclude** (use integration tests instead):
27
30
  - Single-component state changes (use RTL)
@@ -47,20 +50,22 @@ Preconditions: [Auth state, data state]
47
50
  Verification Points:
48
51
  - [What to assert at each step]
49
52
  E2E Value Score: [calculated score]
53
+ Lane: fixture-e2e | service-integration-e2e
50
54
  ```
51
55
 
52
- ## Playwright Test Architecture
56
+ ## Browser Test Architecture
53
57
 
54
58
  ### Page Object Pattern
55
59
 
56
- Organize browser interactions through page objects for maintainability:
60
+ Organize browser interactions through page objects or the project's equivalent harness pattern for maintainability:
57
61
 
58
62
  ```
59
63
  tests/
60
64
  ├── e2e/
61
65
  │ ├── pages/ # Page objects
62
66
  │ ├── fixtures/ # Test fixtures and helpers
63
- └── *.e2e.test.ts # Test files
67
+ ├── *.fixture.e2e.test.ts
68
+ │ └── *.service.e2e.test.ts
64
69
  ```
65
70
 
66
71
  ### Test Isolation
@@ -83,7 +88,8 @@ When UI Spec defines responsive behavior, test critical breakpoints:
83
88
  ## Budget Enforcement
84
89
 
85
90
  Hard limits per feature (same as parent skill):
86
- - **E2E Tests**: MAX 1-2 tests
87
- - Generate the reserved user-journey E2E when eligible
88
- - Generate any additional E2E only when `Value Score >= 50`
91
+ - **fixture-e2e**: MAX 3 tests
92
+ - **service-integration-e2e**: MAX 1-2 tests
93
+ - Generate the reserved fixture-e2e user journey when eligible
94
+ - Generate service-integration-e2e only when live cross-service behavior must be verified
89
95
  - Prefer fewer, comprehensive journey tests over many granular tests
@@ -171,3 +171,10 @@ ENFORCEMENT: Commits without quality-fixer approval are invalid.
171
171
  - [ ] Tests reviewed via integration-test-reviewer (approved or fixes applied)
172
172
  - [ ] Quality check passed via quality-fixer
173
173
  - [ ] Test files committed
174
+ - [ ] Task files created by this recipe deleted from `docs/plans/tasks/`
175
+
176
+ ## Final Cleanup
177
+
178
+ Before the completion report, delete only the integration-test task files this recipe created for the current run. Their work is committed; `docs/plans/` is ephemeral working state.
179
+
180
+ If cleanup fails, report the failed path but do not invalidate completed test work.
@@ -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
 
@@ -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
 
@@ -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
 
@@ -101,6 +101,7 @@ When user responds to questions:
101
101
  **Required Flow Compliance**:
102
102
  - Run quality-fixer (layer-appropriate) before every commit
103
103
  - Obtain user approval before Edit/Write outside autonomous mode
104
+ - Run implementation readiness preflight for the approved work plan before autonomous implementation, or continue without it only after explicit user approval
104
105
 
105
106
  ENFORCEMENT: Commits without quality-fixer approval are invalid and MUST be reverted.
106
107
 
@@ -117,6 +118,10 @@ ENFORCEMENT: Sub-agent prompts missing the constraint suffix MUST be re-issued w
117
118
 
118
119
  ## Task Execution Quality Cycle (Filename-Pattern-Based)
119
120
 
121
+ ### Implementation Readiness Gate
122
+
123
+ 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.
124
+
120
125
  **Agent routing by task filename** (see monorepo-flow.md reference):
121
126
  ```
122
127
  *-backend-task-* -> task-executor + quality-fixer
@@ -152,9 +157,10 @@ After all task cycles finish, collect all `filesModified` from every task-execut
152
157
  ### Test Information Communication
153
158
  After acceptance-test-generator execution, when calling work-planner, communicate:
154
159
  - 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
160
+ - Generated fixture-e2e test file path or `null`
161
+ - Generated service-integration-e2e test file path or `null`
162
+ - E2E absence reason per lane when no E2E file is generated
163
+ - 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
164
 
159
165
  **[STOP -- BLOCKING]** Upon detecting ANY requirement changes, halt execution immediately.
160
166
  **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