opencode-metis 0.1.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 (156) hide show
  1. package/README.md +140 -0
  2. package/dist/cli.cjs +63 -0
  3. package/dist/mcp-server.cjs +51 -0
  4. package/dist/plugin.cjs +4 -0
  5. package/dist/worker.cjs +224 -0
  6. package/opencode/agent/the-analyst/feature-prioritization.md +66 -0
  7. package/opencode/agent/the-analyst/market-research.md +77 -0
  8. package/opencode/agent/the-analyst/project-coordination.md +81 -0
  9. package/opencode/agent/the-analyst/requirements-analysis.md +77 -0
  10. package/opencode/agent/the-architect/compatibility-review.md +138 -0
  11. package/opencode/agent/the-architect/complexity-review.md +137 -0
  12. package/opencode/agent/the-architect/quality-review.md +67 -0
  13. package/opencode/agent/the-architect/security-review.md +127 -0
  14. package/opencode/agent/the-architect/system-architecture.md +119 -0
  15. package/opencode/agent/the-architect/system-documentation.md +83 -0
  16. package/opencode/agent/the-architect/technology-research.md +85 -0
  17. package/opencode/agent/the-chief.md +79 -0
  18. package/opencode/agent/the-designer/accessibility-implementation.md +101 -0
  19. package/opencode/agent/the-designer/design-foundation.md +74 -0
  20. package/opencode/agent/the-designer/interaction-architecture.md +75 -0
  21. package/opencode/agent/the-designer/user-research.md +70 -0
  22. package/opencode/agent/the-meta-agent.md +155 -0
  23. package/opencode/agent/the-platform-engineer/ci-cd-pipelines.md +109 -0
  24. package/opencode/agent/the-platform-engineer/containerization.md +106 -0
  25. package/opencode/agent/the-platform-engineer/data-architecture.md +81 -0
  26. package/opencode/agent/the-platform-engineer/dependency-review.md +144 -0
  27. package/opencode/agent/the-platform-engineer/deployment-automation.md +81 -0
  28. package/opencode/agent/the-platform-engineer/infrastructure-as-code.md +107 -0
  29. package/opencode/agent/the-platform-engineer/performance-tuning.md +82 -0
  30. package/opencode/agent/the-platform-engineer/pipeline-engineering.md +81 -0
  31. package/opencode/agent/the-platform-engineer/production-monitoring.md +105 -0
  32. package/opencode/agent/the-qa-engineer/exploratory-testing.md +66 -0
  33. package/opencode/agent/the-qa-engineer/performance-testing.md +81 -0
  34. package/opencode/agent/the-qa-engineer/quality-assurance.md +77 -0
  35. package/opencode/agent/the-qa-engineer/test-execution.md +66 -0
  36. package/opencode/agent/the-software-engineer/api-development.md +78 -0
  37. package/opencode/agent/the-software-engineer/component-development.md +79 -0
  38. package/opencode/agent/the-software-engineer/concurrency-review.md +141 -0
  39. package/opencode/agent/the-software-engineer/domain-modeling.md +66 -0
  40. package/opencode/agent/the-software-engineer/performance-optimization.md +113 -0
  41. package/opencode/command/analyze.md +149 -0
  42. package/opencode/command/constitution.md +178 -0
  43. package/opencode/command/debug.md +194 -0
  44. package/opencode/command/document.md +178 -0
  45. package/opencode/command/implement.md +225 -0
  46. package/opencode/command/refactor.md +207 -0
  47. package/opencode/command/review.md +229 -0
  48. package/opencode/command/simplify.md +267 -0
  49. package/opencode/command/specify.md +191 -0
  50. package/opencode/command/validate.md +224 -0
  51. package/opencode/skill/accessibility-design/SKILL.md +566 -0
  52. package/opencode/skill/accessibility-design/checklists/wcag-checklist.md +435 -0
  53. package/opencode/skill/agent-coordination/SKILL.md +224 -0
  54. package/opencode/skill/api-contract-design/SKILL.md +550 -0
  55. package/opencode/skill/api-contract-design/templates/graphql-schema-template.md +818 -0
  56. package/opencode/skill/api-contract-design/templates/rest-api-template.md +417 -0
  57. package/opencode/skill/architecture-design/SKILL.md +160 -0
  58. package/opencode/skill/architecture-design/examples/architecture-examples.md +170 -0
  59. package/opencode/skill/architecture-design/template.md +749 -0
  60. package/opencode/skill/architecture-design/validation.md +99 -0
  61. package/opencode/skill/architecture-selection/SKILL.md +522 -0
  62. package/opencode/skill/architecture-selection/examples/adrs/001-example-adr.md +71 -0
  63. package/opencode/skill/architecture-selection/examples/architecture-patterns.md +239 -0
  64. package/opencode/skill/bug-diagnosis/SKILL.md +235 -0
  65. package/opencode/skill/code-quality-review/SKILL.md +337 -0
  66. package/opencode/skill/code-quality-review/examples/anti-patterns.md +629 -0
  67. package/opencode/skill/code-quality-review/reference.md +322 -0
  68. package/opencode/skill/code-review/SKILL.md +363 -0
  69. package/opencode/skill/code-review/reference.md +450 -0
  70. package/opencode/skill/codebase-analysis/SKILL.md +139 -0
  71. package/opencode/skill/codebase-navigation/SKILL.md +227 -0
  72. package/opencode/skill/codebase-navigation/examples/exploration-patterns.md +263 -0
  73. package/opencode/skill/coding-conventions/SKILL.md +178 -0
  74. package/opencode/skill/coding-conventions/checklists/accessibility-checklist.md +176 -0
  75. package/opencode/skill/coding-conventions/checklists/performance-checklist.md +154 -0
  76. package/opencode/skill/coding-conventions/checklists/security-checklist.md +127 -0
  77. package/opencode/skill/constitution-validation/SKILL.md +315 -0
  78. package/opencode/skill/constitution-validation/examples/CONSTITUTION.md +202 -0
  79. package/opencode/skill/constitution-validation/reference/rule-patterns.md +328 -0
  80. package/opencode/skill/constitution-validation/template.md +115 -0
  81. package/opencode/skill/context-preservation/SKILL.md +445 -0
  82. package/opencode/skill/data-modeling/SKILL.md +385 -0
  83. package/opencode/skill/data-modeling/templates/schema-design-template.md +268 -0
  84. package/opencode/skill/deployment-pipeline-design/SKILL.md +579 -0
  85. package/opencode/skill/deployment-pipeline-design/templates/pipeline-template.md +633 -0
  86. package/opencode/skill/documentation-extraction/SKILL.md +259 -0
  87. package/opencode/skill/documentation-sync/SKILL.md +431 -0
  88. package/opencode/skill/domain-driven-design/SKILL.md +509 -0
  89. package/opencode/skill/domain-driven-design/examples/ddd-patterns.md +688 -0
  90. package/opencode/skill/domain-driven-design/reference.md +465 -0
  91. package/opencode/skill/drift-detection/SKILL.md +383 -0
  92. package/opencode/skill/drift-detection/reference.md +340 -0
  93. package/opencode/skill/error-recovery/SKILL.md +162 -0
  94. package/opencode/skill/error-recovery/examples/error-patterns.md +484 -0
  95. package/opencode/skill/feature-prioritization/SKILL.md +419 -0
  96. package/opencode/skill/feature-prioritization/examples/rice-template.md +139 -0
  97. package/opencode/skill/feature-prioritization/reference.md +256 -0
  98. package/opencode/skill/git-workflow/SKILL.md +453 -0
  99. package/opencode/skill/implementation-planning/SKILL.md +215 -0
  100. package/opencode/skill/implementation-planning/examples/phase-examples.md +217 -0
  101. package/opencode/skill/implementation-planning/template.md +220 -0
  102. package/opencode/skill/implementation-planning/validation.md +88 -0
  103. package/opencode/skill/implementation-verification/SKILL.md +272 -0
  104. package/opencode/skill/knowledge-capture/SKILL.md +265 -0
  105. package/opencode/skill/knowledge-capture/reference/knowledge-capture.md +402 -0
  106. package/opencode/skill/knowledge-capture/reference.md +444 -0
  107. package/opencode/skill/knowledge-capture/templates/domain-template.md +325 -0
  108. package/opencode/skill/knowledge-capture/templates/interface-template.md +255 -0
  109. package/opencode/skill/knowledge-capture/templates/pattern-template.md +144 -0
  110. package/opencode/skill/observability-design/SKILL.md +291 -0
  111. package/opencode/skill/observability-design/references/monitoring-patterns.md +461 -0
  112. package/opencode/skill/pattern-detection/SKILL.md +171 -0
  113. package/opencode/skill/pattern-detection/examples/common-patterns.md +359 -0
  114. package/opencode/skill/performance-analysis/SKILL.md +266 -0
  115. package/opencode/skill/performance-analysis/references/profiling-tools.md +499 -0
  116. package/opencode/skill/requirements-analysis/SKILL.md +139 -0
  117. package/opencode/skill/requirements-analysis/examples/good-prd.md +66 -0
  118. package/opencode/skill/requirements-analysis/template.md +177 -0
  119. package/opencode/skill/requirements-analysis/validation.md +69 -0
  120. package/opencode/skill/requirements-elicitation/SKILL.md +518 -0
  121. package/opencode/skill/requirements-elicitation/examples/interview-questions.md +226 -0
  122. package/opencode/skill/requirements-elicitation/examples/user-stories.md +414 -0
  123. package/opencode/skill/safe-refactoring/SKILL.md +312 -0
  124. package/opencode/skill/safe-refactoring/reference/code-smells.md +347 -0
  125. package/opencode/skill/security-assessment/SKILL.md +421 -0
  126. package/opencode/skill/security-assessment/checklists/security-review-checklist.md +285 -0
  127. package/opencode/skill/specification-management/SKILL.md +143 -0
  128. package/opencode/skill/specification-management/readme-template.md +32 -0
  129. package/opencode/skill/specification-management/reference.md +115 -0
  130. package/opencode/skill/specification-management/spec.py +229 -0
  131. package/opencode/skill/specification-validation/SKILL.md +397 -0
  132. package/opencode/skill/specification-validation/reference/3cs-framework.md +306 -0
  133. package/opencode/skill/specification-validation/reference/ambiguity-detection.md +132 -0
  134. package/opencode/skill/specification-validation/reference/constitution-validation.md +301 -0
  135. package/opencode/skill/specification-validation/reference/drift-detection.md +383 -0
  136. package/opencode/skill/task-delegation/SKILL.md +607 -0
  137. package/opencode/skill/task-delegation/examples/file-coordination.md +495 -0
  138. package/opencode/skill/task-delegation/examples/parallel-research.md +337 -0
  139. package/opencode/skill/task-delegation/examples/sequential-build.md +504 -0
  140. package/opencode/skill/task-delegation/reference.md +825 -0
  141. package/opencode/skill/tech-stack-detection/SKILL.md +89 -0
  142. package/opencode/skill/tech-stack-detection/references/framework-signatures.md +598 -0
  143. package/opencode/skill/technical-writing/SKILL.md +190 -0
  144. package/opencode/skill/technical-writing/templates/adr-template.md +205 -0
  145. package/opencode/skill/technical-writing/templates/system-doc-template.md +380 -0
  146. package/opencode/skill/test-design/SKILL.md +464 -0
  147. package/opencode/skill/test-design/examples/test-pyramid.md +724 -0
  148. package/opencode/skill/testing/SKILL.md +213 -0
  149. package/opencode/skill/testing/examples/test-pyramid.md +724 -0
  150. package/opencode/skill/user-insight-synthesis/SKILL.md +576 -0
  151. package/opencode/skill/user-insight-synthesis/templates/research-plan-template.md +217 -0
  152. package/opencode/skill/user-research/SKILL.md +508 -0
  153. package/opencode/skill/user-research/examples/interview-questions.md +265 -0
  154. package/opencode/skill/user-research/examples/personas.md +267 -0
  155. package/opencode/skill/vibe-security/SKILL.md +654 -0
  156. package/package.json +45 -0
@@ -0,0 +1,215 @@
1
+ ---
2
+ name: implementation-planning
3
+ description: "Provides methodology for creating actionable implementation plans with TDD phase structure, task granularity principles, specification compliance gates, and deviation protocols"
4
+ license: MIT
5
+ compatibility: opencode
6
+ metadata:
7
+ category: analysis
8
+ version: "1.0"
9
+ ---
10
+
11
+ # Implementation Planning
12
+
13
+ Roleplay as an implementation plan specialist that creates actionable plans breaking features into executable tasks following TDD principles. Plans enable developers to work independently without requiring clarification.
14
+
15
+ ImplementationPlanning {
16
+ Activation {
17
+ When to use this skill:
18
+ - Create a new PLAN from the template
19
+ - Complete phases in an existing implementation-plan.md
20
+ - Define task sequences and dependencies
21
+ - Plan TDD cycles (Prime to Test to Implement to Validate)
22
+ - Work on any `implementation-plan.md` file in docs/specs/
23
+ }
24
+
25
+ SuccessCriteria {
26
+ A plan is complete when:
27
+ - [ ] A developer can follow it independently without additional context
28
+ - [ ] Every task produces a verifiable deliverable (not just an activity)
29
+ - [ ] All PRD acceptance criteria map to specific tasks
30
+ - [ ] All SDD components have corresponding implementation tasks
31
+ - [ ] Dependencies are explicit and no circular dependencies exist
32
+ }
33
+
34
+ Template {
35
+ Constraints {
36
+ 1. The PLAN template is at [template.md](template.md) -- use this structure exactly
37
+ 2. Read the template from this skill's directory
38
+ 3. Write to spec directory: `docs/specs/[NNN]-[name]/implementation-plan.md`
39
+ }
40
+ }
41
+
42
+ PlanFocusAreas {
43
+ Questions {
44
+ Your plan MUST answer these questions:
45
+ - **WHAT** produces value? (deliverables, not activities)
46
+ - **IN WHAT ORDER** do tasks execute? (dependencies and sequencing)
47
+ - **HOW TO VALIDATE** correctness? (test-first approach)
48
+ - **WHERE** is each task specified? (links to PRD/SDD sections)
49
+ }
50
+
51
+ Constraints {
52
+ Keep plans actionable and focused:
53
+ 1. Use task descriptions, sequence, and validation criteria
54
+ 2. Omit time estimates -- focus on what, not when
55
+ 3. Omit resource assignments -- focus on work, not who
56
+ 4. Omit implementation code -- the plan guides, implementation follows
57
+ }
58
+ }
59
+
60
+ TaskGranularityPrinciple {
61
+ Definition: Track logical units that produce verifiable outcomes. The TDD cycle is the execution method, not separate tracked items.
62
+
63
+ GoodTrackingUnits {
64
+ Produces outcome:
65
+ - "Payment Entity" produces working entity with tests
66
+ - "Stripe Adapter" produces working integration with tests
67
+ - "Payment Form Component" produces working UI with tests
68
+ }
69
+
70
+ BadTrackingUnits {
71
+ Too granular:
72
+ - "Read payment interface contracts" -- Preparation, not deliverable
73
+ - "Test Payment.validate() rejects negative amounts" -- Part of larger outcome
74
+ - "Run linting" -- Validation step, not deliverable
75
+ }
76
+
77
+ StructurePattern {
78
+ ```markdown
79
+ - [ ] **T1.1 Payment Entity** `[activity: domain-modeling]`
80
+
81
+ **Prime**: Read payment interface contracts `[ref: SDD/Section 4.2; lines: 145-200]`
82
+
83
+ **Test**: Entity validation rejects negative amounts; supports currency conversion; handles refunds
84
+
85
+ **Implement**: Create `src/domain/Payment.ts` with validation logic
86
+
87
+ **Validate**: Run unit tests, lint, typecheck
88
+ ```
89
+
90
+ The checkbox tracks "Payment Entity" as a unit. Prime/Test/Implement/Validate are embedded guidance.
91
+ }
92
+ }
93
+
94
+ TDDPhaseStructure {
95
+ Definition: Every task follows red-green-refactor within this pattern
96
+
97
+ Phase1_PrimeContext {
98
+ - Read relevant specification sections
99
+ - Understand interfaces and contracts
100
+ - Load patterns and examples
101
+ }
102
+
103
+ Phase2_WriteTests_Red {
104
+ - Test behavior before implementation
105
+ - Reference PRD acceptance criteria
106
+ - Cover happy path and edge cases
107
+ }
108
+
109
+ Phase3_Implement_Green {
110
+ - Build to pass tests
111
+ - Follow SDD architecture
112
+ - Use discovered patterns
113
+ }
114
+
115
+ Phase4_Validate_Refactor {
116
+ - Run automated tests
117
+ - Check code quality (lint, format)
118
+ - Verify specification compliance
119
+ }
120
+ }
121
+
122
+ TaskMetadata {
123
+ Annotations {
124
+ ```markdown
125
+ - [ ] T1.2.1 [Task description] `[ref: SDD/Section 5; lines: 100-150]` `[activity: backend-api]`
126
+ ```
127
+ }
128
+
129
+ MetadataTable {
130
+ | Metadata | Description |
131
+ |----------|-------------|
132
+ | `[parallel: true]` | Tasks that can run concurrently |
133
+ | `[component: name]` | For multi-component features |
134
+ | `[ref: doc/section; lines: X-Y]` | Links to specifications |
135
+ | `[activity: type]` | Hint for specialist selection |
136
+ }
137
+ }
138
+
139
+ CyclePattern {
140
+ DiscoveryPhase {
141
+ - Read PRD and SDD to understand requirements and design
142
+ - Identify activities needed for each implementation area
143
+ - Launch parallel specialist agents to investigate:
144
+ - Task sequencing and dependencies
145
+ - Testing strategies
146
+ - Risk assessment
147
+ - Validation approaches
148
+ }
149
+
150
+ DocumentationPhase {
151
+ - Update the PLAN with task definitions
152
+ - Add specification references (`[ref: ...]`)
153
+ - Focus only on current phase being defined
154
+ - Follow template structure exactly
155
+ }
156
+
157
+ ReviewPhase {
158
+ - Present task breakdown to user
159
+ - Show dependencies and sequencing
160
+ - Highlight parallel opportunities
161
+ - Wait for user confirmation before next phase
162
+ }
163
+
164
+ SelfCheck {
165
+ Ask yourself each cycle:
166
+ 1. Have I read the relevant PRD and SDD sections?
167
+ 2. Do all tasks trace back to specification requirements?
168
+ 3. Are dependencies between tasks clear?
169
+ 4. Can parallel tasks actually run in parallel?
170
+ 5. Are validation steps included in each phase?
171
+ 6. Have I received user confirmation?
172
+ }
173
+ }
174
+
175
+ SpecificationCompliance {
176
+ PhaseValidationTask {
177
+ Every phase should include a validation task:
178
+ ```markdown
179
+ - [ ] **T1.3 Phase Validation** `[activity: validate]`
180
+
181
+ Run all phase tests, linting, type checking. Verify against SDD patterns and PRD acceptance criteria.
182
+ ```
183
+
184
+ For complex phases, validation is embedded in each task's **Validate** step.
185
+ }
186
+
187
+ DeviationProtocol {
188
+ When implementation requires changes from the specification:
189
+ 1. Document the deviation with clear rationale
190
+ 2. Obtain approval before proceeding
191
+ 3. Update SDD when the deviation improves the design
192
+ 4. Record all deviations in the plan for traceability
193
+ }
194
+ }
195
+
196
+ ValidationChecklist {
197
+ See [validation.md](validation.md) for the complete checklist. Key gates:
198
+ - [ ] All specification file paths are correct and exist
199
+ - [ ] Context priming section is complete
200
+ - [ ] All implementation phases are defined
201
+ - [ ] Each phase follows TDD: Prime to Test to Implement to Validate
202
+ - [ ] Dependencies between phases are clear (no circular dependencies)
203
+ - [ ] Parallel work is properly tagged with `[parallel: true]`
204
+ - [ ] Activity hints provided for specialist selection `[activity: type]`
205
+ - [ ] Every phase references relevant SDD sections
206
+ - [ ] Every test references PRD acceptance criteria
207
+ - [ ] Integration and E2E tests defined in final phase
208
+ - [ ] Project commands match actual project setup
209
+ - [ ] A developer could follow this plan independently
210
+ }
211
+
212
+ Examples {
213
+ See [examples/phase-examples.md](examples/phase-examples.md) for reference.
214
+ }
215
+ }
@@ -0,0 +1,217 @@
1
+ # Implementation Phase Examples
2
+
3
+ Reference examples for structuring implementation phases with grouped task tracking.
4
+
5
+ ## Core Principle
6
+
7
+ **Track logical units that produce verifiable outcomes.** Each checkbox represents a deliverable, not a step in the process. The TDD cycle (Prime → Test → Implement → Validate) is embedded guidance within each task.
8
+
9
+ ---
10
+
11
+ ## Example: Foundation Phase
12
+
13
+ ```markdown
14
+ ### Phase 1: Payment Domain Foundation
15
+
16
+ Establishes core domain entities, repository patterns, and database schema.
17
+
18
+ - [ ] **T1.1 Payment Entity** `[activity: domain-modeling]`
19
+
20
+ **Prime**: Read payment interface contracts and validation rules `[ref: SDD/Section 4.2; lines: 145-200]`
21
+
22
+ **Test**: Entity validation rejects negative amounts; supports multiple currencies; calculates fees correctly; handles partial refunds
23
+
24
+ **Implement**: Create `src/domain/Payment.ts` with Amount value object and validation logic
25
+
26
+ **Validate**: Run unit tests, lint, typecheck
27
+
28
+ - [ ] **T1.2 Payment Repository** `[activity: data-architecture]`
29
+
30
+ **Prime**: Review existing repository patterns and database schema `[ref: docs/patterns/repository-pattern.md]` `[ref: SDD/Section 4.3]`
31
+
32
+ **Test**: CRUD operations work correctly; queries filter by status and date range; handles concurrent updates
33
+
34
+ **Implement**: Create `src/repositories/PaymentRepository.ts` with PostgreSQL adapter; create migration for payments table
35
+
36
+ **Validate**: Run integration tests against test database
37
+
38
+ - [ ] **T1.3 Phase Validation** `[activity: validate]`
39
+
40
+ Run all unit and integration tests. Verify entity matches SDD data model. Lint and typecheck pass.
41
+ ```
42
+
43
+ **Task count**: 3 tracked items (vs ~12 with granular tracking)
44
+
45
+ ---
46
+
47
+ ## Example: Parallel Tasks
48
+
49
+ ```markdown
50
+ ### Phase 2: API and Integration Layer
51
+
52
+ API endpoints and external service integration. These can be developed in parallel.
53
+
54
+ - [ ] **T2.1 Payment API Endpoints** `[parallel: true]` `[component: backend]`
55
+
56
+ **Prime**: Read API specification and authentication requirements `[ref: SDD/Section 4.4]`
57
+
58
+ **Test**: POST /payments creates payment and returns 201; GET /payments/:id returns payment or 404; validation errors return 422 with details
59
+
60
+ **Implement**: Create `src/controllers/PaymentController.ts` with create, get, list routes
61
+
62
+ **Validate**: API contract tests pass; authentication enforced
63
+
64
+ - [ ] **T2.2 Stripe Integration** `[parallel: true]` `[component: backend]`
65
+
66
+ **Prime**: Read Stripe integration pattern and webhook handling `[ref: docs/interfaces/stripe-payment-integration.md]`
67
+
68
+ **Test**: Charges created with correct amount; webhook validates signature; handles declined cards gracefully
69
+
70
+ **Implement**: Create `src/adapters/StripePaymentAdapter.ts` with charge and refund methods
71
+
72
+ **Validate**: Integration tests pass with Stripe test mode
73
+
74
+ - [ ] **T2.3 Phase Validation** `[activity: validate]`
75
+
76
+ Run all API and integration tests. Verify endpoints match OpenAPI spec. Lint and typecheck pass.
77
+ ```
78
+
79
+ **Task count**: 3 tracked items (vs ~10 with granular tracking)
80
+
81
+ ---
82
+
83
+ ## Example: Multi-Component Feature
84
+
85
+ ```markdown
86
+ ### Phase 3: Frontend Integration
87
+
88
+ UI components and state management for the payment flow.
89
+
90
+ - [ ] **T3.1 Payment Form Component** `[component: frontend]`
91
+
92
+ **Prime**: Read UI specifications and form validation rules `[ref: SDD/Section 5.1]`
93
+
94
+ **Test**: Form renders with all fields; validates card number format; submits on valid input; shows error states
95
+
96
+ **Implement**: Create `src/components/PaymentForm.tsx` with Stripe Elements integration
97
+
98
+ **Validate**: Component tests pass; accessibility audit passes
99
+
100
+ - [ ] **T3.2 Payment State Management** `[component: frontend]`
101
+
102
+ **Prime**: Read state management pattern and async handling `[ref: docs/patterns/state-management.md]`
103
+
104
+ **Test**: Loading states during API calls; success state updates UI; error state shows message; retry logic works
105
+
106
+ **Implement**: Create `src/store/paymentSlice.ts` with async thunks for API calls
107
+
108
+ **Validate**: State transitions match flow diagram; reducer tests pass
109
+
110
+ - [ ] **T3.3 Payment Flow Integration** `[depends: T3.1, T3.2]`
111
+
112
+ **Prime**: Review complete user journey from cart to confirmation
113
+
114
+ **Test**: E2E flow from form submission to confirmation page; handles payment failures; shows receipt
115
+
116
+ **Implement**: Wire PaymentForm to payment state; connect to backend API; add confirmation page
117
+
118
+ **Validate**: E2E test passes; manual QA of happy path and error cases
119
+ ```
120
+
121
+ **Task count**: 3 tracked items (vs ~12 with granular tracking)
122
+
123
+ ---
124
+
125
+ ## Example: Final Validation Phase
126
+
127
+ ```markdown
128
+ ### Phase 4: Integration & Validation
129
+
130
+ Full system validation with all components working together.
131
+
132
+ - [ ] **T4.1 Integration Testing** `[activity: integration-test]`
133
+
134
+ Verify cross-component integration: API ↔ Database, Frontend ↔ API, Payment ↔ Stripe
135
+
136
+ - [ ] **T4.2 E2E User Flows** `[activity: e2e-test]`
137
+
138
+ Verify complete user journeys: happy path payment `[ref: PRD/Section 3.1]`; payment failure handling `[ref: PRD/Section 3.2]`; payment history display `[ref: PRD/Section 3.3]`
139
+
140
+ - [ ] **T4.3 Quality Gates** `[activity: validate]`
141
+
142
+ Performance: API response < 200ms p95 `[ref: SDD/Section 10]`; Security: input validation verified; Coverage: > 80% line coverage
143
+
144
+ - [ ] **T4.4 Specification Compliance** `[activity: business-acceptance]`
145
+
146
+ All PRD acceptance criteria verified `[ref: PRD/Section 4]`; implementation follows SDD design; documentation updated for API changes
147
+ ```
148
+
149
+ **Task count**: 4 tracked items (vs ~15 with granular tracking)
150
+
151
+ ---
152
+
153
+ ## Activity Type Reference
154
+
155
+ Common activity types for specialist selection:
156
+
157
+ | Activity | Description |
158
+ |----------|-------------|
159
+ | `domain-modeling` | Business entity and rule design |
160
+ | `data-architecture` | Database schema, migrations, queries |
161
+ | `api-development` | REST/GraphQL endpoint implementation |
162
+ | `component-development` | UI component implementation |
163
+ | `backend-implementation` | General backend code |
164
+ | `frontend-implementation` | General frontend code |
165
+ | `integration-test` | Cross-component integration testing |
166
+ | `e2e-test` | End-to-end user flow testing |
167
+ | `validate` | Quality gates and compliance checks |
168
+ | `business-acceptance` | PRD criteria verification |
169
+
170
+ ---
171
+
172
+ ## What Makes Good Implementation Plans
173
+
174
+ 1. **Logical Unit Tracking** - Each checkbox produces a verifiable outcome
175
+ 2. **Embedded TDD Guidance** - Prime/Test/Implement/Validate as text, not checkboxes
176
+ 3. **Specification Links** - Every task traces to PRD/SDD
177
+ 4. **Parallel Opportunities** - Independent work clearly marked
178
+ 5. **No Time Estimates** - Focus on sequence, not duration
179
+ 6. **Activity Hints** - Guide specialist selection
180
+ 7. **Phase Validation** - Quality gates at phase boundaries
181
+
182
+ ## Comparison: Before and After
183
+
184
+ **Before (granular - 9 tracked items):**
185
+ ```markdown
186
+ - [ ] T1.1 Prime Context
187
+ - [ ] T1.1.1 Read payment interface contracts
188
+ - [ ] T1.1.2 Review repository patterns
189
+ - [ ] T1.2 Write Tests
190
+ - [ ] T1.2.1 Unit tests for Payment entity
191
+ - [ ] T1.2.2 Unit tests for PaymentRepository
192
+ - [ ] T1.3 Implement
193
+ - [ ] T1.3.1 Create Payment entity
194
+ - [ ] T1.3.2 Create PaymentRepository
195
+ - [ ] T1.4 Validate
196
+ - [ ] T1.4.1 Run tests
197
+ ```
198
+
199
+ **After (grouped - 3 tracked items):**
200
+ ```markdown
201
+ - [ ] **T1.1 Payment Entity** `[activity: domain-modeling]`
202
+ **Prime**: Read payment contracts `[ref: SDD/Section 4.2]`
203
+ **Test**: Validation rules, currency support, fee calculation
204
+ **Implement**: Create `src/domain/Payment.ts`
205
+ **Validate**: Unit tests, lint, typecheck
206
+
207
+ - [ ] **T1.2 Payment Repository** `[activity: data-architecture]`
208
+ **Prime**: Review repository patterns `[ref: docs/patterns/repository-pattern.md]`
209
+ **Test**: CRUD operations, query filters, concurrency
210
+ **Implement**: Create repository and migration
211
+ **Validate**: Integration tests
212
+
213
+ - [ ] **T1.3 Phase Validation** `[activity: validate]`
214
+ Run all tests, verify against SDD, lint and typecheck pass
215
+ ```
216
+
217
+ Same detail, 67% fewer todowrite operations.
@@ -0,0 +1,220 @@
1
+ ---
2
+ title: "[NEEDS CLARIFICATION: Feature title]"
3
+ status: draft
4
+ version: "1.0"
5
+ ---
6
+
7
+ # Implementation Plan
8
+
9
+ ## Validation Checklist
10
+
11
+ ### CRITICAL GATES (Must Pass)
12
+
13
+ - [ ] All `[NEEDS CLARIFICATION: ...]` markers have been addressed
14
+ - [ ] All specification file paths are correct and exist
15
+ - [ ] Each phase follows TDD: Prime → Test → Implement → Validate
16
+ - [ ] Every task has verifiable success criteria
17
+ - [ ] A developer could follow this plan independently
18
+
19
+ ### QUALITY CHECKS (Should Pass)
20
+
21
+ - [ ] Context priming section is complete
22
+ - [ ] All implementation phases are defined
23
+ - [ ] Dependencies between phases are clear (no circular dependencies)
24
+ - [ ] Parallel work is properly tagged with `[parallel: true]`
25
+ - [ ] Activity hints provided for specialist selection `[activity: type]`
26
+ - [ ] Every phase references relevant SDD sections
27
+ - [ ] Every test references PRD acceptance criteria
28
+ - [ ] Integration & E2E tests defined in final phase
29
+ - [ ] Project commands match actual project setup
30
+
31
+ ---
32
+
33
+ ## Specification Compliance Guidelines
34
+
35
+ ### How to Ensure Specification Adherence
36
+
37
+ 1. **Before Each Phase**: Complete the Pre-Implementation Specification Gate
38
+ 2. **During Implementation**: Reference specific SDD sections in each task
39
+ 3. **After Each Task**: Run Specification Compliance checks
40
+ 4. **Phase Completion**: Verify all specification requirements are met
41
+
42
+ ### Deviation Protocol
43
+
44
+ When implementation requires changes from the specification:
45
+ 1. Document the deviation with clear rationale
46
+ 2. Obtain approval before proceeding
47
+ 3. Update SDD when the deviation improves the design
48
+ 4. Record all deviations in this plan for traceability
49
+
50
+ ## Metadata Reference
51
+
52
+ - `[parallel: true]` - Tasks that can run concurrently
53
+ - `[component: component-name]` - For multi-component features
54
+ - `[ref: document/section; lines: 1, 2-3]` - Links to specifications, patterns, or interfaces and (if applicable) line(s)
55
+ - `[activity: type]` - Activity hint for specialist agent selection
56
+
57
+ ### Success Criteria
58
+
59
+ **Validate** = Process verification ("did we follow TDD?")
60
+ **Success** = Outcome verification ("does it work correctly?")
61
+
62
+ ```markdown
63
+ # Single-line format
64
+ - Success: [Criterion] `[ref: PRD/AC-X.Y]`
65
+
66
+ # Multi-line format
67
+ - Success:
68
+ - [ ] [Criterion 1] `[ref: PRD/AC-X.Y]`
69
+ - [ ] [Criterion 2] `[ref: SDD/Section]`
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Context Priming
75
+
76
+ *GATE: Read all files in this section before starting any implementation.*
77
+
78
+ **Specification**:
79
+
80
+ [NEEDS CLARIFICATION: Replace with actual paths from your spec directory]
81
+ - `docs/specs/[NNN]-[name]/product-requirements.md` - Product Requirements
82
+ - `docs/specs/[NNN]-[name]/solution-design.md` - Solution Design
83
+ - `docs/{patterns,interfaces,research}/[name].md` - Optional references
84
+
85
+ **Key Design Decisions**:
86
+
87
+ [NEEDS CLARIFICATION: Extract 2-5 critical decisions from the SDD that affect implementation]
88
+ - **ADR-1**: [Decision name] - [One-line summary of what was decided and why]
89
+ - **ADR-2**: [Decision name] - [One-line summary]
90
+
91
+ **Implementation Context**:
92
+
93
+ [NEEDS CLARIFICATION: Update implementation-relevant commands to match project setup]
94
+ ```bash
95
+ # Testing
96
+ npm test # Unit tests
97
+ npm run test:integration # Integration tests
98
+
99
+ # Quality
100
+ npm run lint # Linting
101
+ npm run typecheck # Type checking
102
+
103
+ # Full validation
104
+ npm run validate # All checks
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Implementation Phases
110
+
111
+ Each task follows red-green-refactor: **Prime** (understand context), **Test** (red), **Implement** (green), **Validate** (refactor + verify).
112
+
113
+ > **Tracking Principle**: Track logical units that produce verifiable outcomes. The TDD cycle is the method, not separate tracked items.
114
+
115
+ ---
116
+
117
+ ### Phase 1: Core Foundation
118
+
119
+ [NEEDS CLARIFICATION: Describe what this phase delivers - "Establishes X capability" or "Enables Y functionality"]
120
+
121
+ Establishes the foundational [domain/infrastructure/components] required for subsequent phases.
122
+
123
+ - [ ] **T1.1 [Primary deliverable name]** `[activity: domain-modeling]`
124
+
125
+ 1. Prime: Read [entity/component] specification `[ref: SDD/Section X; lines: Y-Z]`
126
+ 2. Test: [Behavior 1]; [Behavior 2]; [Edge case handling]
127
+ 3. Implement: Create `src/[path]/[File].ts` with [key capability]
128
+ 4. Validate: Unit tests pass; lint clean; types check
129
+ 5. Success: [Criterion 1] `[ref: PRD/AC-1.1]`; [Criterion 2] `[ref: SDD/Section]`
130
+
131
+ - [ ] **T1.2 [Secondary deliverable name]** `[activity: data-architecture]`
132
+
133
+ 1. Prime: Review [pattern/interface] requirements `[ref: SDD/Section X]`
134
+ 2. Test: [CRUD operations]; [Query patterns]; [Error handling]
135
+ 3. Implement: Create `src/[path]/[File].ts` with [key capability]
136
+ 4. Validate: Integration tests pass; lint clean; types check
137
+ 5. Success: [Criterion 1] `[ref: PRD/AC-1.2]`; [Criterion 2] `[ref: SDD/Section]`
138
+
139
+ - [ ] **T1.3 Phase Validation** `[activity: validate]`
140
+
141
+ - Run all Phase 1 tests. Verify foundation matches SDD data models. Lint and typecheck pass.
142
+
143
+ ---
144
+
145
+ ### Phase 2: [API/Integration/UI] Layer
146
+
147
+ [NEEDS CLARIFICATION: Describe what this phase delivers. Mark parallel tasks for concurrent execution.]
148
+
149
+ Builds the [API endpoints/integrations/UI components] that expose Phase 1 capabilities.
150
+
151
+ - [ ] **T2.1 [Component A]** `[parallel: true]` `[component: backend]`
152
+
153
+ 1. Prime: Read API specification `[ref: SDD/Section X]`
154
+ 2. Test: [Endpoint behavior]; [Validation]; [Error responses]
155
+ 3. Implement: Create `src/[path]/[Controller].ts` with routes
156
+ 4. Validate: API tests pass; contract matches specification
157
+ 5. Success: [Criterion] `[ref: PRD/AC-2.1]`
158
+
159
+ - [ ] **T2.2 [Component B]** `[parallel: true]` `[component: backend]`
160
+
161
+ 1. Prime: Read integration pattern `[ref: docs/interfaces/X.md]`
162
+ 2. Test: [Success flow]; [Failure handling]; [Retry logic]
163
+ 3. Implement: Create `src/[path]/[Adapter].ts` with integration
164
+ 4. Validate: Integration tests pass with test/mock service
165
+ 5. Success:
166
+ - [Success criterion 1] `[ref: PRD/AC-2.2]`
167
+ - [Failure handling verified] `[ref: SDD/Error Handling]`
168
+ - [Retry logic works with backoff] `[ref: docs/patterns/resilience.md]`
169
+
170
+ - [ ] **T2.3 Phase Validation** `[activity: validate]`
171
+
172
+ Run all Phase 2 tests. Verify API contracts match SDD. Lint and typecheck pass.
173
+
174
+ ---
175
+
176
+ ### Phase 3: Final Integration & Validation
177
+
178
+ Full system validation ensuring all components work together correctly.
179
+
180
+ - [ ] **T3.1 Integration Testing** `[activity: integration-test]`
181
+
182
+ Verify cross-component integration: [Component A] ↔ [Component B]; [Service] ↔ [Database]
183
+
184
+ `[ref: SDD/integration points]`
185
+
186
+ - [ ] **T3.2 E2E User Flows** `[activity: e2e-test]`
187
+
188
+ Verify complete user journeys: [Happy path flow]; [Error handling flow]; [Edge case flow]
189
+
190
+ `[ref: PRD/acceptance criteria]`
191
+
192
+ - [ ] **T3.3 Quality Gates** `[activity: validate]`
193
+
194
+ - Performance: [Specific metric] < [threshold] `[ref: SDD/Quality Requirements]`
195
+ - Security: [Specific check] verified
196
+ - Coverage: > [X]% line coverage
197
+
198
+ - [ ] **T3.4 Specification Compliance** `[activity: business-acceptance]`
199
+
200
+ - All PRD acceptance criteria verified
201
+ - Implementation follows SDD design
202
+ - Documentation updated for API/interface changes
203
+ - Build and deployment verification complete
204
+
205
+ ---
206
+
207
+ ## Plan Verification
208
+
209
+ Before this plan is ready for implementation, verify:
210
+
211
+ | Criterion | Status |
212
+ |-----------|--------|
213
+ | A developer can follow this plan without additional clarification | ⬜ |
214
+ | Every task produces a verifiable deliverable | ⬜ |
215
+ | All PRD acceptance criteria map to specific tasks | ⬜ |
216
+ | All SDD components have implementation tasks | ⬜ |
217
+ | Dependencies are explicit with no circular references | ⬜ |
218
+ | Parallel opportunities are marked with `[parallel: true]` | ⬜ |
219
+ | Each task has specification references `[ref: ...]` | ⬜ |
220
+ | Project commands in Context Priming are accurate | ⬜ |