agile-context-engineering 0.3.0 → 0.5.1
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.
- package/.claude-plugin/marketplace.json +18 -0
- package/.claude-plugin/plugin.json +10 -0
- package/CHANGELOG.md +7 -1
- package/LICENSE +51 -51
- package/README.md +330 -318
- package/agents/ace-code-discovery-analyst.md +245 -245
- package/agents/ace-code-integration-analyst.md +248 -248
- package/agents/ace-code-reviewer.md +375 -375
- package/agents/ace-product-owner.md +365 -361
- package/agents/ace-project-researcher.md +606 -606
- package/agents/ace-research-synthesizer.md +228 -228
- package/agents/ace-technical-application-architect.md +315 -315
- package/agents/ace-wiki-mapper.md +449 -445
- package/bin/install.js +605 -195
- package/hooks/ace-check-update.js +71 -62
- package/hooks/ace-statusline.js +107 -89
- package/hooks/hooks.json +14 -0
- package/package.json +7 -5
- package/shared/lib/ace-core.js +361 -0
- package/shared/lib/ace-core.test.js +308 -0
- package/shared/lib/ace-github.js +753 -0
- package/shared/lib/ace-story.js +400 -0
- package/shared/lib/ace-story.test.js +250 -0
- package/{agile-context-engineering → shared}/utils/questioning.xml +110 -110
- package/{agile-context-engineering → shared}/utils/ui-formatting.md +299 -299
- package/{commands/ace/execute-story.md → skills/execute-story/SKILL.md} +116 -138
- package/skills/execute-story/script.js +291 -0
- package/skills/execute-story/script.test.js +261 -0
- package/{agile-context-engineering/templates/product/story.xml → skills/execute-story/story-template.xml} +451 -451
- package/skills/execute-story/walkthrough-template.xml +255 -0
- package/{agile-context-engineering/workflows/execute-story.xml → skills/execute-story/workflow.xml} +1221 -1219
- package/skills/help/SKILL.md +71 -0
- package/skills/help/script.js +315 -0
- package/skills/help/script.test.js +183 -0
- package/{agile-context-engineering/workflows/help.xml → skills/help/workflow.xml} +544 -533
- package/{commands/ace/init-coding-standards.md → skills/init-coding-standards/SKILL.md} +91 -83
- package/{agile-context-engineering/templates/wiki/coding-standards.xml → skills/init-coding-standards/coding-standards-template.xml} +531 -531
- package/skills/init-coding-standards/script.js +50 -0
- package/skills/init-coding-standards/script.test.js +70 -0
- package/{agile-context-engineering/workflows/init-coding-standards.xml → skills/init-coding-standards/workflow.xml} +381 -386
- package/skills/map-cross-cutting/SKILL.md +126 -0
- package/{agile-context-engineering/templates/wiki → skills/map-cross-cutting}/system-cross-cutting.xml +197 -197
- package/skills/map-cross-cutting/workflow.xml +330 -0
- package/skills/map-guide/SKILL.md +126 -0
- package/{agile-context-engineering/templates/wiki → skills/map-guide}/guide.xml +137 -137
- package/skills/map-guide/workflow.xml +320 -0
- package/skills/map-pattern/SKILL.md +125 -0
- package/{agile-context-engineering/templates/wiki → skills/map-pattern}/pattern.xml +159 -159
- package/skills/map-pattern/workflow.xml +331 -0
- package/{commands/ace/map-story.md → skills/map-story/SKILL.md} +180 -165
- package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/decizions.xml +115 -115
- package/skills/map-story/templates/guide.xml +137 -0
- package/skills/map-story/templates/pattern.xml +159 -0
- package/skills/map-story/templates/system-cross-cutting.xml +197 -0
- package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/system.xml +381 -381
- package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/tech-debt-index.xml +125 -125
- package/{agile-context-engineering/templates/wiki → skills/map-story/templates}/walkthrough.xml +255 -255
- package/{agile-context-engineering/workflows/map-story.xml → skills/map-story/workflow.xml} +1046 -1046
- package/{commands/ace/map-subsystem.md → skills/map-subsystem/SKILL.md} +155 -140
- package/skills/map-subsystem/script.js +51 -0
- package/skills/map-subsystem/script.test.js +68 -0
- package/skills/map-subsystem/templates/decizions.xml +115 -0
- package/skills/map-subsystem/templates/guide.xml +137 -0
- package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/module-discovery.xml +174 -174
- package/skills/map-subsystem/templates/pattern.xml +159 -0
- package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/subsystem-architecture.xml +343 -343
- package/{agile-context-engineering/templates/wiki → skills/map-subsystem/templates}/subsystem-structure.xml +234 -234
- package/skills/map-subsystem/templates/system-cross-cutting.xml +197 -0
- package/skills/map-subsystem/templates/system.xml +381 -0
- package/skills/map-subsystem/templates/walkthrough.xml +255 -0
- package/{agile-context-engineering/workflows/map-subsystem.xml → skills/map-subsystem/workflow.xml} +1173 -1178
- package/skills/map-sys-doc/SKILL.md +125 -0
- package/skills/map-sys-doc/system.xml +381 -0
- package/skills/map-sys-doc/workflow.xml +336 -0
- package/{commands/ace/map-system.md → skills/map-system/SKILL.md} +103 -92
- package/skills/map-system/script.js +75 -0
- package/skills/map-system/script.test.js +73 -0
- package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/system-architecture.xml +254 -254
- package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/system-structure.xml +177 -177
- package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/testing-framework.xml +283 -283
- package/{agile-context-engineering/templates/wiki → skills/map-system/templates}/wiki-readme.xml +296 -296
- package/{agile-context-engineering/workflows/map-system.xml → skills/map-system/workflow.xml} +667 -672
- package/{commands/ace/map-walkthrough.md → skills/map-walkthrough/SKILL.md} +140 -127
- package/skills/map-walkthrough/walkthrough.xml +255 -0
- package/{agile-context-engineering/workflows/map-walkthrough.xml → skills/map-walkthrough/workflow.xml} +457 -457
- package/{commands/ace/plan-backlog.md → skills/plan-backlog/SKILL.md} +93 -83
- package/{agile-context-engineering/templates/product/product-backlog.xml → skills/plan-backlog/product-backlog-template.xml} +231 -231
- package/skills/plan-backlog/script.js +121 -0
- package/skills/plan-backlog/script.test.js +83 -0
- package/{agile-context-engineering/workflows/plan-backlog.xml → skills/plan-backlog/workflow.xml} +1348 -1356
- package/{commands/ace/plan-feature.md → skills/plan-feature/SKILL.md} +99 -89
- package/{agile-context-engineering/templates/product/feature.xml → skills/plan-feature/feature-template.xml} +361 -361
- package/skills/plan-feature/script.js +131 -0
- package/skills/plan-feature/script.test.js +80 -0
- package/{agile-context-engineering/workflows/plan-feature.xml → skills/plan-feature/workflow.xml} +1487 -1495
- package/{commands/ace/plan-product-vision.md → skills/plan-product-vision/SKILL.md} +91 -81
- package/{agile-context-engineering/templates/product/product-vision.xml → skills/plan-product-vision/product-vision-template.xml} +227 -227
- package/skills/plan-product-vision/script.js +51 -0
- package/skills/plan-product-vision/script.test.js +69 -0
- package/{agile-context-engineering/workflows/plan-product-vision.xml → skills/plan-product-vision/workflow.xml} +337 -342
- package/{commands/ace/plan-story.md → skills/plan-story/SKILL.md} +139 -159
- package/skills/plan-story/script.js +295 -0
- package/skills/plan-story/script.test.js +240 -0
- package/skills/plan-story/story-template.xml +458 -0
- package/{agile-context-engineering/workflows/plan-story.xml → skills/plan-story/workflow.xml} +1301 -944
- package/{commands/ace/research-external-solution.md → skills/research-external-solution/SKILL.md} +120 -138
- package/{agile-context-engineering/templates/product/external-solution.xml → skills/research-external-solution/external-solution-template.xml} +832 -832
- package/skills/research-external-solution/script.js +229 -0
- package/skills/research-external-solution/script.test.js +134 -0
- package/{agile-context-engineering/workflows/research-external-solution.xml → skills/research-external-solution/workflow.xml} +657 -659
- package/{commands/ace/research-integration-solution.md → skills/research-integration-solution/SKILL.md} +121 -135
- package/{agile-context-engineering/templates/product/story-integration-solution.xml → skills/research-integration-solution/integration-solution-template.xml} +1015 -1015
- package/skills/research-integration-solution/script.js +223 -0
- package/skills/research-integration-solution/script.test.js +134 -0
- package/{agile-context-engineering/workflows/research-integration-solution.xml → skills/research-integration-solution/workflow.xml} +711 -713
- package/{commands/ace/research-story-wiki.md → skills/research-story-wiki/SKILL.md} +101 -116
- package/skills/research-story-wiki/script.js +223 -0
- package/skills/research-story-wiki/script.test.js +138 -0
- package/{agile-context-engineering/templates/product/story-wiki.xml → skills/research-story-wiki/story-wiki-template.xml} +194 -194
- package/{agile-context-engineering/workflows/research-story-wiki.xml → skills/research-story-wiki/workflow.xml} +473 -475
- package/{commands/ace/research-technical-solution.md → skills/research-technical-solution/SKILL.md} +131 -147
- package/skills/research-technical-solution/script.js +223 -0
- package/skills/research-technical-solution/script.test.js +134 -0
- package/{agile-context-engineering/templates/product/story-technical-solution.xml → skills/research-technical-solution/technical-solution-template.xml} +1025 -1025
- package/{agile-context-engineering/workflows/research-technical-solution.xml → skills/research-technical-solution/workflow.xml} +761 -763
- package/{commands/ace/review-story.md → skills/review-story/SKILL.md} +99 -109
- package/skills/review-story/script.js +249 -0
- package/skills/review-story/script.test.js +169 -0
- package/skills/review-story/story-template.xml +451 -0
- package/{agile-context-engineering/workflows/review-story.xml → skills/review-story/workflow.xml} +279 -281
- package/{commands/ace/update.md → skills/update/SKILL.md} +65 -56
- package/{agile-context-engineering/workflows/update.xml → skills/update/workflow.xml} +33 -18
- package/agile-context-engineering/src/ace-tools.js +0 -2881
- package/agile-context-engineering/src/ace-tools.test.js +0 -1089
- package/agile-context-engineering/templates/_command.md +0 -54
- package/agile-context-engineering/templates/_workflow.xml +0 -17
- package/agile-context-engineering/templates/config.json +0 -0
- package/agile-context-engineering/templates/product/integration-solution.xml +0 -0
- package/commands/ace/help.md +0 -93
|
@@ -1,1015 +1,1015 @@
|
|
|
1
|
-
<integration-solution>
|
|
2
|
-
|
|
3
|
-
<purpose>
|
|
4
|
-
Template for `.ace/artifacts/product/<id-epic_name>/<id-feature_name>/<id-story_name>/integration-analysis.md` —
|
|
5
|
-
a COMPREHENSIVE, IN-DEPTH System Integration Analysis that ensures new story
|
|
6
|
-
implementations integrate seamlessly with existing systems without breaking
|
|
7
|
-
functionality or violating architectural principles.
|
|
8
|
-
|
|
9
|
-
This is pass 4 of the story specification pipeline (see story.xml composition).
|
|
10
|
-
It produces a separate artifact in the story directory — NOT appended to the story file.
|
|
11
|
-
The analysis is consumed by pass 5 (technical solution) as input for designing
|
|
12
|
-
the implementation approach with full codebase integration context.
|
|
13
|
-
|
|
14
|
-
**[MANDATORY]** Identify how a new story would PROPERLY integrate with the existing
|
|
15
|
-
codebase while maintaining architectural integrity, maintainability, and extensibility
|
|
16
|
-
while strictly following CODING STANDARDS.
|
|
17
|
-
|
|
18
|
-
You are operating within a PRODUCTION-GRADE, CLEAN, COMPLEX CODEBASE — new code
|
|
19
|
-
must be added thoughtfully and systematically. The purpose is to analyze HOW TO ADD
|
|
20
|
-
NEW FUNCTIONALITY WHILE KEEPING THE CODE MAINTAINABLE AND EXTENSIBLE.
|
|
21
|
-
|
|
22
|
-
This document does NOT modify the story file. It lives as a separate artifact
|
|
23
|
-
in the story directory. Only the technical solution (pass 5) consumes it.
|
|
24
|
-
|
|
25
|
-
CRITICAL: This analysis output will be used as PROMPT CONTEXT for the AI agent
|
|
26
|
-
implementing this feature. Therefore:
|
|
27
|
-
- INCLUDE ALL FINDINGS — don't summarize or omit details
|
|
28
|
-
- PROVIDE COMPLETE CONTEXT — the implementing AI needs every piece of information
|
|
29
|
-
- BE EXPLICIT — don't assume the implementing AI will know anything not explicitly stated
|
|
30
|
-
</purpose>
|
|
31
|
-
|
|
32
|
-
<output-format>
|
|
33
|
-
|
|
34
|
-
<section name="header">
|
|
35
|
-
# System Integration Analysis: [Story Name]
|
|
36
|
-
|
|
37
|
-
## Analysis Context
|
|
38
|
-
- **Story**: [Story ID] — [Story Title]
|
|
39
|
-
- **Feature**: [Feature ID] — [Feature Title]
|
|
40
|
-
- **Epic**: [Epic ID] — [Epic Title]
|
|
41
|
-
- **Analysis Date**: [Current date]
|
|
42
|
-
- **Wiki Documents Loaded**: [N] files
|
|
43
|
-
- **External Analysis**: [Available/Not available]
|
|
44
|
-
- **Code References**: [N] references documented
|
|
45
|
-
- **Hardcoded Values Found**: [N] items
|
|
46
|
-
- **Refactoring Items**: [N] items
|
|
47
|
-
</section>
|
|
48
|
-
|
|
49
|
-
<section name="use-case-overview">
|
|
50
|
-
## 1. Use Case Overview
|
|
51
|
-
|
|
52
|
-
[Brief description of what needs to be implemented — extracted from the story's
|
|
53
|
-
User Story statement, Description, and Acceptance Criteria.
|
|
54
|
-
|
|
55
|
-
Include:
|
|
56
|
-
- What the user can do when this story is done
|
|
57
|
-
- Key behaviors and requirements from acceptance criteria
|
|
58
|
-
- How this story relates to other stories in the feature
|
|
59
|
-
- What the parent feature context provides]
|
|
60
|
-
</section>
|
|
61
|
-
|
|
62
|
-
<section name="architecture-compatibility">
|
|
63
|
-
## 2. Architecture Compatibility
|
|
64
|
-
|
|
65
|
-
<!-- How this story fits into the Clean Architecture layers.
|
|
66
|
-
For EACH layer, document what new components are needed
|
|
67
|
-
and how they integrate with existing components. -->
|
|
68
|
-
|
|
69
|
-
### Domain Layer
|
|
70
|
-
<!-- New entities, value objects, constants, business rules needed.
|
|
71
|
-
How they relate to existing domain objects.
|
|
72
|
-
Domain events that may be needed.
|
|
73
|
-
File paths to relevant existing domain code. -->
|
|
74
|
-
- **New Entities**: [entities to create with proposed file paths]
|
|
75
|
-
- **Value Objects**: [value objects needed]
|
|
76
|
-
- **Constants**: [new constants or extensions to existing constant files]
|
|
77
|
-
- **Business Rules**: [domain rules this story introduces]
|
|
78
|
-
- **Existing Domain Code**: [relevant existing domain files with paths]
|
|
79
|
-
|
|
80
|
-
### Application Layer
|
|
81
|
-
<!-- Use cases, interfaces, DTOs to create.
|
|
82
|
-
How they interact with existing application services.
|
|
83
|
-
Dependency injection registrations needed. -->
|
|
84
|
-
- **Use Cases**: [use cases to create]
|
|
85
|
-
- **Interfaces**: [interfaces to define or extend]
|
|
86
|
-
- **DTOs**: [data transfer objects needed]
|
|
87
|
-
- **Existing Services**: [application services that will be affected]
|
|
88
|
-
|
|
89
|
-
### Infrastructure Layer
|
|
90
|
-
<!-- Services, implementations, repositories required.
|
|
91
|
-
External service integrations.
|
|
92
|
-
How they implement application layer interfaces. -->
|
|
93
|
-
- **Services**: [infrastructure services to implement]
|
|
94
|
-
- **Implementations**: [interface implementations needed]
|
|
95
|
-
- **Repositories**: [data access patterns to follow]
|
|
96
|
-
- **Existing Infrastructure**: [existing infrastructure code affected]
|
|
97
|
-
|
|
98
|
-
### Presentation Layer
|
|
99
|
-
<!-- UI components, API endpoints, view models needed.
|
|
100
|
-
How they connect to application layer.
|
|
101
|
-
User interaction patterns to follow. -->
|
|
102
|
-
- **Components**: [UI components or API endpoints needed]
|
|
103
|
-
- **View Models**: [presentation models needed]
|
|
104
|
-
- **Existing Presentation Code**: [existing presentation code affected]
|
|
105
|
-
|
|
106
|
-
### Dependency Rule Compliance
|
|
107
|
-
<!-- Verify that all proposed changes maintain the dependency rule:
|
|
108
|
-
dependencies point inward (Presentation → Application → Domain).
|
|
109
|
-
Infrastructure implements Application interfaces.
|
|
110
|
-
No layer knows about outer layers. -->
|
|
111
|
-
- [Compliance verification for each proposed change]
|
|
112
|
-
</section>
|
|
113
|
-
|
|
114
|
-
<section name="existing-patterns">
|
|
115
|
-
## 3. Existing Patterns to Follow
|
|
116
|
-
|
|
117
|
-
<!-- Specific patterns found in the codebase that this story MUST follow.
|
|
118
|
-
Each pattern includes file references with line numbers.
|
|
119
|
-
The implementing agent must study these files before coding. -->
|
|
120
|
-
|
|
121
|
-
### Similar Implementations
|
|
122
|
-
<!-- Reference existing code that implements similar functionality.
|
|
123
|
-
The new implementation should follow these as examples. -->
|
|
124
|
-
- **[Implementation Name]** at `[file:line-range]` — [what to learn from it]
|
|
125
|
-
|
|
126
|
-
### Established Conventions
|
|
127
|
-
<!-- Naming patterns, file organization, code structure conventions. -->
|
|
128
|
-
- **Naming**: [naming conventions with examples from codebase]
|
|
129
|
-
- **File Organization**: [how files are organized with examples]
|
|
130
|
-
- **Code Structure**: [class/function structure patterns]
|
|
131
|
-
|
|
132
|
-
### Design Patterns in Use
|
|
133
|
-
<!-- Which design patterns are already used that must be followed. -->
|
|
134
|
-
|
|
135
|
-
#### [Pattern Name] (e.g., Strategy, Factory, Observer)
|
|
136
|
-
- **Where**: [File/component where pattern is used — with path]
|
|
137
|
-
- **Why**: [Why this pattern was chosen]
|
|
138
|
-
- **Implementation Example**:
|
|
139
|
-
```typescript
|
|
140
|
-
// From [file:line-range]
|
|
141
|
-
[Code example showing the pattern]
|
|
142
|
-
```
|
|
143
|
-
- **How to Follow**: [How the new code should use this pattern]
|
|
144
|
-
|
|
145
|
-
<!-- Repeat for each identified pattern -->
|
|
146
|
-
|
|
147
|
-
### Error Handling Patterns
|
|
148
|
-
- [How errors are handled — with code references]
|
|
149
|
-
|
|
150
|
-
### Logging Patterns
|
|
151
|
-
- [How logging is done — with code references]
|
|
152
|
-
|
|
153
|
-
### Constants & Configuration Patterns
|
|
154
|
-
- [How constants are organized — with code references]
|
|
155
|
-
- [Where to add new constants]
|
|
156
|
-
</section>
|
|
157
|
-
|
|
158
|
-
<section name="required-refactoring">
|
|
159
|
-
## 4. Required Refactoring
|
|
160
|
-
|
|
161
|
-
<!-- List any existing code that needs refactoring to support the new implementation.
|
|
162
|
-
Include justification for each refactoring decision.
|
|
163
|
-
Impact assessment of changes.
|
|
164
|
-
Even if no refactoring is needed, complete this section with that conclusion. -->
|
|
165
|
-
|
|
166
|
-
### Refactoring Items
|
|
167
|
-
|
|
168
|
-
<!-- For each item:
|
|
169
|
-
- What code needs to change (file path, line numbers)
|
|
170
|
-
- Current state (what it is now)
|
|
171
|
-
- Proposed change (what it should become)
|
|
172
|
-
- Justification (why this refactoring is needed)
|
|
173
|
-
- Impact (what else is affected by this change)
|
|
174
|
-
|
|
175
|
-
Common scenarios:
|
|
176
|
-
- Pattern violations: Direct implementations that should use Strategy/Factory
|
|
177
|
-
- Constants chaos: Magic strings/numbers that should be centralized
|
|
178
|
-
- Model proliferation: Duplicate models that should be unified
|
|
179
|
-
- Method duplication: Duplicate logic that should be extracted
|
|
180
|
-
- Layer violations: Business logic in wrong architectural layer
|
|
181
|
-
- Service sprawl: Services that should be extended vs. duplicated
|
|
182
|
-
- Event handler inconsistencies: Inconsistent event handling patterns
|
|
183
|
-
- State management violations: State managed inconsistently
|
|
184
|
-
- API integration inconsistencies: Direct API calls instead of services
|
|
185
|
-
- Type definition duplication: Redefined types that should be imported -->
|
|
186
|
-
|
|
187
|
-
#### [Refactoring Item Name]
|
|
188
|
-
- **File**: `[file:line-range]`
|
|
189
|
-
- **Current State**: [what it is now]
|
|
190
|
-
- **Proposed Change**: [what it should become]
|
|
191
|
-
- **Justification**: [why this is needed for the new implementation]
|
|
192
|
-
- **Impact**: [what else is affected]
|
|
193
|
-
|
|
194
|
-
<!-- Repeat for each refactoring item.
|
|
195
|
-
If no refactoring needed, state: "No refactoring required. [justification]." -->
|
|
196
|
-
</section>
|
|
197
|
-
|
|
198
|
-
<section name="hardcoded-values-critical">
|
|
199
|
-
## 5. CRITICAL: Hardcoded Values & Placeholder Code That MUST Be Replaced
|
|
200
|
-
|
|
201
|
-
<!-- THIS IS THE MOST CRITICAL SECTION OF THE INTEGRATION ANALYSIS!
|
|
202
|
-
|
|
203
|
-
THE #1 REASON INTEGRATION ANALYSES FAIL:
|
|
204
|
-
The analysis identifies what NEW code to create but FAILS to identify
|
|
205
|
-
what EXISTING code must be MODIFIED or REPLACED.
|
|
206
|
-
|
|
207
|
-
For every new entity/service being created, ask:
|
|
208
|
-
- "What existing code currently does this job (probably poorly/hardcoded)?"
|
|
209
|
-
- "Where should this entity be INJECTED that it currently ISN'T?"
|
|
210
|
-
- "What hardcoded values exist that this entity should REPLACE?"
|
|
211
|
-
|
|
212
|
-
MANDATORY SEARCHES:
|
|
213
|
-
- Hardcoded numeric ranges, dimensions, colors, sizes
|
|
214
|
-
- TODO comments mentioning the feature
|
|
215
|
-
- "temporary", "placeholder", "stub", "mock" in comments
|
|
216
|
-
- Methods returning hardcoded values instead of computed ones
|
|
217
|
-
- Classes/services that exist but aren't used where they should be
|
|
218
|
-
- Inline calculations that should use the new service
|
|
219
|
-
- Manager/Service classes with hardcoded defaults
|
|
220
|
-
- Renderers/handlers not using the new entity
|
|
221
|
-
|
|
222
|
-
This section MUST be filled with ACTUAL CODE SNIPPETS from the codebase!
|
|
223
|
-
The implementing AI agent NEEDS to know EXACTLY what to change and WHERE. -->
|
|
224
|
-
|
|
225
|
-
### Hardcoded Values to Replace
|
|
226
|
-
|
|
227
|
-
```yaml
|
|
228
|
-
FILE: [exact file path]
|
|
229
|
-
LINE: [line number(s)]
|
|
230
|
-
CURRENT CODE: |
|
|
231
|
-
[actual code snippet from the file]
|
|
232
|
-
PROBLEM: [why this is wrong]
|
|
233
|
-
SHOULD BE: [what it should become after implementation]
|
|
234
|
-
FIX REQUIRED: [specific action to take]
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
<!-- Repeat for EACH hardcoded value found -->
|
|
238
|
-
|
|
239
|
-
### Disconnected Wiring to Fix
|
|
240
|
-
|
|
241
|
-
```yaml
|
|
242
|
-
ENTITY/SERVICE EXISTS: [path to entity/service that should be used]
|
|
243
|
-
CURRENTLY NOT CONNECTED TO:
|
|
244
|
-
- [File 1]: [what it uses instead]
|
|
245
|
-
- [File 2]: [what it uses instead]
|
|
246
|
-
REQUIRED CONNECTIONS:
|
|
247
|
-
- [Where to inject and how]
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
<!-- Repeat for EACH disconnected wiring found -->
|
|
251
|
-
|
|
252
|
-
### Placeholder/TODO Code to Implement
|
|
253
|
-
|
|
254
|
-
```yaml
|
|
255
|
-
FILE: [file path]
|
|
256
|
-
LINE: [line number]
|
|
257
|
-
TODO COMMENT: "[exact TODO text]"
|
|
258
|
-
CURRENT IMPLEMENTATION: [what it does now — probably hardcoded]
|
|
259
|
-
REQUIRED IMPLEMENTATION: [what needs to be implemented]
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
<!-- Repeat for EACH placeholder found -->
|
|
263
|
-
|
|
264
|
-
### Renderers/Services Not Using New Entity
|
|
265
|
-
|
|
266
|
-
```yaml
|
|
267
|
-
NEW ENTITY: [entity name and path]
|
|
268
|
-
RENDERERS/HANDLERS THAT MUST USE IT:
|
|
269
|
-
- [Renderer/Handler 1]: Currently uses [X], must use [new entity]
|
|
270
|
-
- [Renderer/Handler 2]: Currently uses [X], must use [new entity]
|
|
271
|
-
SERVICES THAT MUST USE IT:
|
|
272
|
-
- [Service 1]: Currently [behavior], must [new behavior]
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
<!-- Repeat for EACH new entity -->
|
|
276
|
-
</section>
|
|
277
|
-
|
|
278
|
-
<section name="integration-points">
|
|
279
|
-
## 6. Integration Points
|
|
280
|
-
|
|
281
|
-
<!-- All touchpoints between the new implementation and the existing system.
|
|
282
|
-
Categorize by architectural layer and component type. -->
|
|
283
|
-
|
|
284
|
-
### Domain Layer Integration
|
|
285
|
-
- [Integration point — how the new domain code connects with existing domain]
|
|
286
|
-
|
|
287
|
-
### Application Layer Integration
|
|
288
|
-
- [Integration point — new use cases, service interfaces, DI registrations]
|
|
289
|
-
|
|
290
|
-
### Infrastructure Layer Integration
|
|
291
|
-
- [Integration point — new service implementations, repository patterns]
|
|
292
|
-
|
|
293
|
-
### Presentation Layer Integration
|
|
294
|
-
- [Integration point — new UI components, API endpoints, event handlers]
|
|
295
|
-
|
|
296
|
-
### Cross-Cutting Integration
|
|
297
|
-
<!-- Event systems, middleware, DI container, logging, error handling -->
|
|
298
|
-
- [Integration point — cross-cutting concerns this story must respect]
|
|
299
|
-
</section>
|
|
300
|
-
|
|
301
|
-
<section name="impact-analysis">
|
|
302
|
-
## 7. Impact Analysis
|
|
303
|
-
|
|
304
|
-
<!-- ALL code flows that might be impacted by the new implementation.
|
|
305
|
-
Include specific file references for each impacted flow. -->
|
|
306
|
-
|
|
307
|
-
### Affected Code Flows
|
|
308
|
-
- **[Flow Name]**: [description of impact] — `[file:line-range]`
|
|
309
|
-
|
|
310
|
-
### Affected Tests
|
|
311
|
-
<!-- Tests that may need modification due to the new implementation -->
|
|
312
|
-
- `[test-file:line-range]` — [what needs to change and why]
|
|
313
|
-
|
|
314
|
-
### Affected Documentation
|
|
315
|
-
<!-- Documentation files/wiki docs that may need updates -->
|
|
316
|
-
- `[doc-file]` — [what needs updating]
|
|
317
|
-
|
|
318
|
-
### Performance Implications
|
|
319
|
-
- [Performance consideration — with mitigation strategy]
|
|
320
|
-
|
|
321
|
-
### Breaking Change Risks
|
|
322
|
-
- [Risk — with mitigation strategy]
|
|
323
|
-
</section>
|
|
324
|
-
|
|
325
|
-
<section name="codebase-tree">
|
|
326
|
-
## 8. Codebase Structure
|
|
327
|
-
|
|
328
|
-
### Current Structure (Relevant Files)
|
|
329
|
-
<!-- Tree structure showing ACTUAL current files relevant to this story.
|
|
330
|
-
NOT the entire codebase — only files that are involved.
|
|
331
|
-
Include file paths and one-line purpose. -->
|
|
332
|
-
|
|
333
|
-
```
|
|
334
|
-
[Current relevant file tree]
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
### Proposed Structure (With New Files)
|
|
338
|
-
<!-- Tree structure showing what the codebase will look like
|
|
339
|
-
after implementing this story. Mark new files clearly. -->
|
|
340
|
-
|
|
341
|
-
```
|
|
342
|
-
[Proposed file tree with new files marked]
|
|
343
|
-
```
|
|
344
|
-
</section>
|
|
345
|
-
|
|
346
|
-
<section name="implementation-guidelines">
|
|
347
|
-
## 9. Implementation Guidelines
|
|
348
|
-
|
|
349
|
-
<!-- Step-by-step approach following coding standards.
|
|
350
|
-
The implementing agent should follow this order. -->
|
|
351
|
-
|
|
352
|
-
### Recommended Implementation Order
|
|
353
|
-
|
|
354
|
-
1. **[Step 1]**: [What to implement first and why]
|
|
355
|
-
- Files to create/modify: [list]
|
|
356
|
-
- Pattern to follow: [reference to existing pattern]
|
|
357
|
-
|
|
358
|
-
2. **[Step 2]**: [What to implement next]
|
|
359
|
-
- Files to create/modify: [list]
|
|
360
|
-
- Pattern to follow: [reference]
|
|
361
|
-
|
|
362
|
-
<!-- Continue for all implementation steps -->
|
|
363
|
-
|
|
364
|
-
### Dependency Management
|
|
365
|
-
- [How to manage dependencies — DI registrations, imports, etc.]
|
|
366
|
-
|
|
367
|
-
### Error Handling Approach
|
|
368
|
-
- [Error handling strategy for the new implementation]
|
|
369
|
-
|
|
370
|
-
### State Management Strategy
|
|
371
|
-
- [How state should be managed in the new implementation]
|
|
372
|
-
</section>
|
|
373
|
-
|
|
374
|
-
<section name="testing-strategy">
|
|
375
|
-
## 10. Testing Strategy
|
|
376
|
-
|
|
377
|
-
<!-- How to test without breaking existing tests.
|
|
378
|
-
Follow the testing framework patterns from wiki. -->
|
|
379
|
-
|
|
380
|
-
### Test Types Required
|
|
381
|
-
- **Unit Tests**: [what to unit test, mocking strategy]
|
|
382
|
-
- **Integration Tests**: [what integration scenarios to cover]
|
|
383
|
-
- **E2E Tests**: [end-to-end scenarios if applicable]
|
|
384
|
-
|
|
385
|
-
### Existing Test Patterns to Follow
|
|
386
|
-
- [Pattern 1 — with reference to existing test file]
|
|
387
|
-
- [Pattern 2 — with reference to existing test file]
|
|
388
|
-
|
|
389
|
-
### Test Data Patterns
|
|
390
|
-
- [How test data is managed in existing tests]
|
|
391
|
-
|
|
392
|
-
### Ensuring Existing Tests Pass
|
|
393
|
-
- [Steps to verify existing tests still pass after changes]
|
|
394
|
-
- [Tests that may need adjustment and why]
|
|
395
|
-
</section>
|
|
396
|
-
|
|
397
|
-
<section name="complete-findings">
|
|
398
|
-
## 11. Complete Analysis Findings
|
|
399
|
-
|
|
400
|
-
<!-- INCLUDE ALL FINDINGS from the deep analysis.
|
|
401
|
-
This is the comprehensive dump of everything discovered.
|
|
402
|
-
The implementing AI needs every piece of information.
|
|
403
|
-
|
|
404
|
-
Include:
|
|
405
|
-
- Every discovered pattern with file references
|
|
406
|
-
- Every relevant code snippet
|
|
407
|
-
- Every architectural decision
|
|
408
|
-
- Every potential issue
|
|
409
|
-
- Every integration consideration -->
|
|
410
|
-
|
|
411
|
-
### Discovered Patterns
|
|
412
|
-
- [Pattern — file reference — relevance to this story]
|
|
413
|
-
|
|
414
|
-
### Relevant Code Snippets
|
|
415
|
-
```typescript
|
|
416
|
-
// From [file:line-range]
|
|
417
|
-
// [Why this snippet is relevant]
|
|
418
|
-
[actual code]
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
### Architectural Constraints
|
|
422
|
-
- [Constraint — source (coding standards, ADR, etc.) — impact on implementation]
|
|
423
|
-
|
|
424
|
-
### Potential Issues
|
|
425
|
-
- [Issue — likelihood — mitigation]
|
|
426
|
-
</section>
|
|
427
|
-
|
|
428
|
-
<section name="implementation-references">
|
|
429
|
-
## 12. Implementation References
|
|
430
|
-
|
|
431
|
-
### Internal Documentation
|
|
432
|
-
<!-- All relevant internal docs with full paths -->
|
|
433
|
-
- `[path]` — [what to learn from this doc]
|
|
434
|
-
|
|
435
|
-
### Code References
|
|
436
|
-
<!-- All files that should be studied before implementation -->
|
|
437
|
-
- `[file:line-range]` — [what to learn from this code]
|
|
438
|
-
|
|
439
|
-
### Design Patterns & Best Practices
|
|
440
|
-
<!-- Links to pattern documentation -->
|
|
441
|
-
- [Pattern Name] — [link to documentation, e.g., refactoring.guru]
|
|
442
|
-
|
|
443
|
-
### External Resources
|
|
444
|
-
<!-- Official documentation links for libraries used -->
|
|
445
|
-
- [Resource] — [link]
|
|
446
|
-
</section>
|
|
447
|
-
|
|
448
|
-
<section name="ai-implementation-context">
|
|
449
|
-
## 13. AI Implementation Context
|
|
450
|
-
|
|
451
|
-
<!-- CRITICAL SECTION — This will be the primary context for the implementing AI.
|
|
452
|
-
Everything the implementing agent needs to know in one place. -->
|
|
453
|
-
|
|
454
|
-
### Domain Knowledge
|
|
455
|
-
- [All domain-specific knowledge the implementing agent needs]
|
|
456
|
-
|
|
457
|
-
### Constraints & Limitations
|
|
458
|
-
- [All constraints from coding standards, architecture, ADRs]
|
|
459
|
-
|
|
460
|
-
### Naming Conventions
|
|
461
|
-
- [All naming conventions observed in the codebase with examples]
|
|
462
|
-
|
|
463
|
-
### Error Handling Standards
|
|
464
|
-
- [Error handling patterns with code references]
|
|
465
|
-
|
|
466
|
-
### Logging Standards
|
|
467
|
-
- [Logging approach with code references]
|
|
468
|
-
|
|
469
|
-
### Performance Considerations
|
|
470
|
-
- [Performance requirements and optimization approaches]
|
|
471
|
-
|
|
472
|
-
### Example Code Snippets
|
|
473
|
-
<!-- Code snippets from similar implementations that serve as templates -->
|
|
474
|
-
```typescript
|
|
475
|
-
// From [file:line-range]
|
|
476
|
-
// [This serves as a template for implementing [component]]
|
|
477
|
-
[actual code from similar implementation]
|
|
478
|
-
```
|
|
479
|
-
</section>
|
|
480
|
-
|
|
481
|
-
</output-format>
|
|
482
|
-
|
|
483
|
-
<analysis-process>
|
|
484
|
-
|
|
485
|
-
<!-- This section defines the analysis methodology that the code-integration-analyst
|
|
486
|
-
agent must follow. It mirrors the workflow steps but provides detailed
|
|
487
|
-
instructions for each analysis phase.
|
|
488
|
-
|
|
489
|
-
MANDATORY COMPLETION REQUIREMENTS:
|
|
490
|
-
- Phase 1: ALL 4 items (Context Loading) — MANDATORY
|
|
491
|
-
- Phase 2: ALL 8 items (Deep Codebase Analysis) — MANDATORY
|
|
492
|
-
- Phase 3: ALL 4 items (Refactoring & Strategy) — MANDATORY
|
|
493
|
-
- Phase 4: ALL 2 items (AI Implementation Context) — MANDATORY
|
|
494
|
-
- Total: 18 mandatory analysis items — SKIP NONE -->
|
|
495
|
-
|
|
496
|
-
<phase name="context-loading" order="1">
|
|
497
|
-
<!-- ALL 4 items are MANDATORY -->
|
|
498
|
-
|
|
499
|
-
<item name="understand-story" mandatory="true">
|
|
500
|
-
**[MANDATORY] Understand the story requirements:**
|
|
501
|
-
- Read the story thoroughly: User Story, Description, all AC scenarios
|
|
502
|
-
- These define WHAT functionality needs to integrate into the codebase
|
|
503
|
-
- Extract key behaviors, components, and patterns needed
|
|
504
|
-
- The story's acceptance criteria define the SCOPE of the analysis
|
|
505
|
-
- **Requirements come from the story** — do NOT seek requirements
|
|
506
|
-
from other sources. The story IS the source of truth.
|
|
507
|
-
- If a parent feature document is available, read it to understand:
|
|
508
|
-
- The broader feature context
|
|
509
|
-
- What other stories exist and how they relate
|
|
510
|
-
- Dependencies and shared components between stories
|
|
511
|
-
</item>
|
|
512
|
-
|
|
513
|
-
<item name="load-wiki-documents" mandatory="true">
|
|
514
|
-
**[MANDATORY] Load and study ALL wiki documents from the story's Relevant Wiki section:**
|
|
515
|
-
|
|
516
|
-
These wiki documents provide the COMPLETE codebase context:
|
|
517
|
-
|
|
518
|
-
- **System-Wide** (always present):
|
|
519
|
-
- `system-structure.md` — High-level codebase tree and organization
|
|
520
|
-
- `system-architecture.md` — Complete architectural overview
|
|
521
|
-
- `coding-standards.md` — CRITICAL: coding standards — NO EXCEPTIONS!
|
|
522
|
-
- `testing-framework.md` — Testing patterns and frameworks
|
|
523
|
-
|
|
524
|
-
- **Subsystem Documents** (as referenced by story):
|
|
525
|
-
- **Systems**: System descriptions, boundaries, APIs
|
|
526
|
-
- **Patterns**: Design patterns in use with examples
|
|
527
|
-
- **Cross-Cutting Concerns**: Shared concerns (auth, logging, errors, etc.)
|
|
528
|
-
- **Guides**: How-to guides for common implementation tasks
|
|
529
|
-
- **Walkthroughs**: Deep tutorial-style flow explanations with actual code snippets
|
|
530
|
-
- **Decisions (ADRs)**: Architecture decisions that constrain design
|
|
531
|
-
- **Architecture**: Subsystem architecture documents
|
|
532
|
-
|
|
533
|
-
Read EVERY document. These replace the obsolete command's separate parameters:
|
|
534
|
-
- sourcecode → system-structure.md (high-level tree)
|
|
535
|
-
- high-level-architecture → system-architecture.md
|
|
536
|
-
- documentation → all wiki documents combined
|
|
537
|
-
- related-stories-implementations → wiki documents capture story knowledge
|
|
538
|
-
- documented-features → wiki documents catalog feature implementations
|
|
539
|
-
</item>
|
|
540
|
-
|
|
541
|
-
<item name="load-external-analysis" mandatory="true">
|
|
542
|
-
**[MANDATORY] Check and load external analysis if available:**
|
|
543
|
-
- Automatically check for `{STORY_DIR}/external-analysis.md`
|
|
544
|
-
- This is the artifact from pass 3 (`/ace:research-external-solution`)
|
|
545
|
-
- If present, study it for:
|
|
546
|
-
- How industry-standard systems implement this functionality
|
|
547
|
-
- Algorithms and formulas to reuse
|
|
548
|
-
- Design patterns from external implementations
|
|
549
|
-
- Best practices that should inform our integration
|
|
550
|
-
- If not present, proceed without — note this in the analysis
|
|
551
|
-
</item>
|
|
552
|
-
|
|
553
|
-
<item name="load-feature-document" mandatory="true">
|
|
554
|
-
**[MANDATORY] Load the parent feature document:**
|
|
555
|
-
- The feature file path can be extracted from the story metadata
|
|
556
|
-
- Understand the feature planning context
|
|
557
|
-
- Identify how this story fits within the broader feature
|
|
558
|
-
- Identify dependencies and integration points with other stories
|
|
559
|
-
- If not found, proceed without — the analysis can still be done
|
|
560
|
-
</item>
|
|
561
|
-
</phase>
|
|
562
|
-
|
|
563
|
-
<phase name="deep-codebase-analysis" order="2">
|
|
564
|
-
<!-- ALL 8 items are MANDATORY — skip NONE -->
|
|
565
|
-
|
|
566
|
-
<item name="architecture-compatibility" mandatory="true">
|
|
567
|
-
**[MANDATORY] Architecture Compatibility Analysis:**
|
|
568
|
-
|
|
569
|
-
Map how the new story fits into Clean Architecture layers:
|
|
570
|
-
|
|
571
|
-
- **Domain Layer**: New entities, value objects, constants needed.
|
|
572
|
-
How they relate to existing domain objects. Domain events needed.
|
|
573
|
-
- **Application Layer**: Use cases and interfaces to create.
|
|
574
|
-
How they interact with existing application services. DI registrations.
|
|
575
|
-
- **Infrastructure Layer**: Services and implementations required.
|
|
576
|
-
External service integrations. How they implement application interfaces.
|
|
577
|
-
- **Presentation Layer**: UI components and API endpoints needed.
|
|
578
|
-
How they connect to application layer. User interaction patterns.
|
|
579
|
-
|
|
580
|
-
Verify Clean Architecture compliance:
|
|
581
|
-
- Dependencies point inward toward domain
|
|
582
|
-
- Each layer knows only about inner layers
|
|
583
|
-
- Depend on abstractions, not concretions
|
|
584
|
-
- All business logic independently testable
|
|
585
|
-
</item>
|
|
586
|
-
|
|
587
|
-
<item name="pattern-recognition" mandatory="true">
|
|
588
|
-
**[MANDATORY] Pattern Recognition & Existing Patterns:**
|
|
589
|
-
|
|
590
|
-
Search for similar features/patterns in the codebase and reference them
|
|
591
|
-
with specific file paths and line numbers:
|
|
592
|
-
|
|
593
|
-
- **Similar Implementations**: Find existing code that does something similar
|
|
594
|
-
- **Naming Conventions**: Document exact naming patterns with examples
|
|
595
|
-
- **Design Patterns**: Catalog patterns in use (Strategy, Factory, Observer, etc.)
|
|
596
|
-
- **Error Handling**: Document error handling approaches with code references
|
|
597
|
-
- **Logging**: Document logging approaches
|
|
598
|
-
- **Constants Organization**: How constants are organized and where to add new ones
|
|
599
|
-
</item>
|
|
600
|
-
|
|
601
|
-
<item name="integration-points" mandatory="true">
|
|
602
|
-
**[MANDATORY] Integration Point Discovery (Layer-by-Layer):**
|
|
603
|
-
|
|
604
|
-
Examine each architectural layer for integration opportunities:
|
|
605
|
-
|
|
606
|
-
- **Domain Layer**: Entity extensions, value objects, business rules
|
|
607
|
-
- **Application Layer**: Service interfaces, use cases, DTOs
|
|
608
|
-
- **Infrastructure Layer**: Repository patterns, external services
|
|
609
|
-
- **Presentation Layer**: UI components, view models, controllers
|
|
610
|
-
|
|
611
|
-
Find:
|
|
612
|
-
- Existing interfaces that can be extended
|
|
613
|
-
- Abstract classes available for inheritance
|
|
614
|
-
- Event systems for loose coupling
|
|
615
|
-
- Middleware or pipeline patterns
|
|
616
|
-
- Plugin or extension points
|
|
617
|
-
- Configuration-based feature toggles
|
|
618
|
-
- DI container registrations needed
|
|
619
|
-
</item>
|
|
620
|
-
|
|
621
|
-
<item name="file-dependencies" mandatory="true">
|
|
622
|
-
**[MANDATORY] File Dependency Analysis:**
|
|
623
|
-
|
|
624
|
-
- Identify ALL files that will be referenced or modified
|
|
625
|
-
- Document supporting files for the new implementation
|
|
626
|
-
- Map import chains and dependency graphs
|
|
627
|
-
- Identify potential circular dependency risks
|
|
628
|
-
- List all current files that will support the new implementation
|
|
629
|
-
</item>
|
|
630
|
-
|
|
631
|
-
<item name="convention-compliance" mandatory="true">
|
|
632
|
-
**[MANDATORY] Convention Compliance Analysis:**
|
|
633
|
-
|
|
634
|
-
- Document existing conventions that MUST be followed
|
|
635
|
-
- Verify the new implementation doesn't violate CODING STANDARDS
|
|
636
|
-
- Check naming conventions, file organization, error handling
|
|
637
|
-
- Verify SOLID principles compliance
|
|
638
|
-
- Verify Clean Architecture layer boundaries
|
|
639
|
-
</item>
|
|
640
|
-
|
|
641
|
-
<item name="testing-patterns" mandatory="true">
|
|
642
|
-
**[MANDATORY] Testing Pattern Analysis:**
|
|
643
|
-
|
|
644
|
-
- Analyze current test patterns for consistent validation approach
|
|
645
|
-
- Identify test utilities and helpers available for reuse
|
|
646
|
-
- Document testing conventions (unit, integration, e2e)
|
|
647
|
-
- Identify tests that need modification due to the new implementation
|
|
648
|
-
- Extract mocking strategies used
|
|
649
|
-
</item>
|
|
650
|
-
|
|
651
|
-
<item name="hardcoded-values-discovery" mandatory="true">
|
|
652
|
-
**[MANDATORY] CRITICAL: Hardcoded Values & Placeholder Code Discovery:**
|
|
653
|
-
|
|
654
|
-
THIS IS THE MOST CRITICAL PART OF THE INTEGRATION ANALYSIS!
|
|
655
|
-
|
|
656
|
-
When a new story implements a feature, there are ALWAYS existing hardcoded
|
|
657
|
-
values or placeholder implementations that the new feature is MEANT TO REPLACE.
|
|
658
|
-
|
|
659
|
-
YOU MUST EXHAUSTIVELY SEARCH FOR:
|
|
660
|
-
|
|
661
|
-
<search-category name="hardcoded-domain-values">
|
|
662
|
-
**Hardcoded Domain/Range Values:**
|
|
663
|
-
- Search for hardcoded number ranges, dimensions, colors, sizes, offsets
|
|
664
|
-
- Search for values that should come from the new entity/service
|
|
665
|
-
- Grep patterns: `domain\(\[`, `= 0;`, `= 100`, `MIN_`, `MAX_`, `DEFAULT_`
|
|
666
|
-
</search-category>
|
|
667
|
-
|
|
668
|
-
<search-category name="placeholder-stubs">
|
|
669
|
-
**Placeholder/Stub Implementations:**
|
|
670
|
-
- Search for TODO comments mentioning the feature being implemented
|
|
671
|
-
- Search for "temporary", "placeholder", "stub", "mock" in comments
|
|
672
|
-
- Search for methods returning hardcoded values instead of computed ones
|
|
673
|
-
- Grep patterns: `TODO`, `TEMPORARY`, `placeholder`, `HARDCODED`
|
|
674
|
-
</search-category>
|
|
675
|
-
|
|
676
|
-
<search-category name="disconnected-wiring">
|
|
677
|
-
**Disconnected Wiring:**
|
|
678
|
-
- Classes/services that EXIST but are NOT USED where they should be
|
|
679
|
-
- Find where the NEW entity/service SHOULD be injected but currently isn't
|
|
680
|
-
- For every new entity/service, ask:
|
|
681
|
-
- "What existing code currently does this job?"
|
|
682
|
-
- "Where should this entity be INJECTED?"
|
|
683
|
-
- "What hardcoded values exist that this entity should REPLACE?"
|
|
684
|
-
</search-category>
|
|
685
|
-
|
|
686
|
-
<search-category name="inline-calculations">
|
|
687
|
-
**Inline Calculations That Should Use New Service:**
|
|
688
|
-
- Inline calculations done manually instead of using the new entity
|
|
689
|
-
- Duplicate calculation logic across multiple files
|
|
690
|
-
- Grep patterns: `Math.min`, `Math.max`, inline formulas
|
|
691
|
-
</search-category>
|
|
692
|
-
|
|
693
|
-
<search-category name="manager-service-defaults">
|
|
694
|
-
**Manager/Service Classes with Hardcoded Defaults:**
|
|
695
|
-
- Manager/service classes initializing with dummy values
|
|
696
|
-
- These MUST be updated to receive values from the new entity
|
|
697
|
-
- Search: `*Manager`, `*Service` classes in Infrastructure layer
|
|
698
|
-
</search-category>
|
|
699
|
-
|
|
700
|
-
<search-category name="renderers-not-using-entity">
|
|
701
|
-
**Renderers/Handlers Not Using New Entity:**
|
|
702
|
-
- When implementing a new feature, ALL relevant renderers/handlers must be checked
|
|
703
|
-
- Verify they use the new entity instead of hardcoded values
|
|
704
|
-
- Search: `*Renderer`, `*Handler`, `*Controller` classes
|
|
705
|
-
</search-category>
|
|
706
|
-
|
|
707
|
-
Output format for EACH discovered item:
|
|
708
|
-
```yaml
|
|
709
|
-
FILE: [exact file path]
|
|
710
|
-
LINE: [line number(s)]
|
|
711
|
-
CURRENT CODE: |
|
|
712
|
-
[actual code snippet from the file]
|
|
713
|
-
PROBLEM: [why this is wrong]
|
|
714
|
-
SHOULD BE: [what it should become after implementation]
|
|
715
|
-
FIX REQUIRED: [specific action to take]
|
|
716
|
-
```
|
|
717
|
-
|
|
718
|
-
CRITICAL: This section MUST be filled with ACTUAL CODE SNIPPETS from the codebase!
|
|
719
|
-
The implementing AI agent NEEDS to know EXACTLY what to change and WHERE.
|
|
720
|
-
</item>
|
|
721
|
-
|
|
722
|
-
<item name="impact-analysis" mandatory="true">
|
|
723
|
-
**[MANDATORY] Impact Analysis:**
|
|
724
|
-
|
|
725
|
-
- Discover ALL code flows that might be impacted by the new implementation
|
|
726
|
-
- Include specific file references for each impacted flow
|
|
727
|
-
- Identify tests that need modification (include file paths)
|
|
728
|
-
- Document documentation files/flows requiring updates
|
|
729
|
-
- Assess performance implications
|
|
730
|
-
- Identify breaking change risks
|
|
731
|
-
</item>
|
|
732
|
-
</phase>
|
|
733
|
-
|
|
734
|
-
<phase name="refactoring-strategy" order="3">
|
|
735
|
-
<!-- ALL 4 items are MANDATORY -->
|
|
736
|
-
|
|
737
|
-
<item name="refactoring-requirements" mandatory="true">
|
|
738
|
-
**[MANDATORY] Refactoring Requirements:**
|
|
739
|
-
|
|
740
|
-
Determine if existing code needs refactoring for the new implementation
|
|
741
|
-
to be MAINTAINABLE / EXTENSIBLE. Check for:
|
|
742
|
-
|
|
743
|
-
<refactoring-scenario name="consolidation">
|
|
744
|
-
Duplicate code that should be unified before adding more
|
|
745
|
-
</refactoring-scenario>
|
|
746
|
-
<refactoring-scenario name="abstraction">
|
|
747
|
-
Concrete implementations that need interfaces for extensibility
|
|
748
|
-
</refactoring-scenario>
|
|
749
|
-
<refactoring-scenario name="separation">
|
|
750
|
-
Mixed concerns that need splitting before adding new functionality
|
|
751
|
-
</refactoring-scenario>
|
|
752
|
-
<refactoring-scenario name="generalization">
|
|
753
|
-
Specific code that could be made reusable by the new implementation
|
|
754
|
-
</refactoring-scenario>
|
|
755
|
-
<refactoring-scenario name="simplification">
|
|
756
|
-
Complex code that could be streamlined
|
|
757
|
-
</refactoring-scenario>
|
|
758
|
-
<refactoring-scenario name="standardization">
|
|
759
|
-
Inconsistent patterns needing alignment before extending
|
|
760
|
-
</refactoring-scenario>
|
|
761
|
-
|
|
762
|
-
Common refactoring scenarios to check:
|
|
763
|
-
- Pattern violations (adding a new type when Strategy pattern should be used)
|
|
764
|
-
- Constants scattered across files (centralize in Domain layer)
|
|
765
|
-
- Model proliferation (extend existing vs. create duplicate)
|
|
766
|
-
- Method duplication (reuse existing methods)
|
|
767
|
-
- Layer violations (business logic in wrong layer)
|
|
768
|
-
- Service sprawl (extend existing services if cohesive)
|
|
769
|
-
- Event handler inconsistencies
|
|
770
|
-
- State management violations
|
|
771
|
-
- API integration inconsistencies
|
|
772
|
-
- Type definition duplication
|
|
773
|
-
|
|
774
|
-
**Even if no refactoring is needed, this section MUST be completed
|
|
775
|
-
with the conclusion "no refactoring required" and justification.**
|
|
776
|
-
</item>
|
|
777
|
-
|
|
778
|
-
<item name="implementation-guidelines" mandatory="true">
|
|
779
|
-
**[MANDATORY] Implementation Guidelines:**
|
|
780
|
-
|
|
781
|
-
- Step-by-step implementation approach following coding standards
|
|
782
|
-
- Optimal architectural placement for new code
|
|
783
|
-
- Interface design for maximum flexibility
|
|
784
|
-
- Dependency management approach (DI registrations)
|
|
785
|
-
- State management strategy
|
|
786
|
-
- Error handling patterns to follow
|
|
787
|
-
- Recommended implementation order
|
|
788
|
-
</item>
|
|
789
|
-
|
|
790
|
-
<item name="testing-strategy" mandatory="true">
|
|
791
|
-
**[MANDATORY] Testing Strategy:**
|
|
792
|
-
|
|
793
|
-
- How to test without breaking existing tests
|
|
794
|
-
- Test patterns to follow (from testing framework doc)
|
|
795
|
-
- Required test types (unit, integration, e2e)
|
|
796
|
-
- Mocking strategies based on existing patterns
|
|
797
|
-
- Edge cases to cover from acceptance criteria
|
|
798
|
-
- Test data patterns to follow
|
|
799
|
-
</item>
|
|
800
|
-
|
|
801
|
-
<item name="risk-mitigation" mandatory="true">
|
|
802
|
-
**[MANDATORY] Risk Mitigation:**
|
|
803
|
-
|
|
804
|
-
- Backward compatibility considerations
|
|
805
|
-
- Migration path for existing functionality
|
|
806
|
-
- What existing functionality might be impacted
|
|
807
|
-
- Performance implications
|
|
808
|
-
- Breaking change risks
|
|
809
|
-
- Rollback strategies if needed
|
|
810
|
-
</item>
|
|
811
|
-
</phase>
|
|
812
|
-
|
|
813
|
-
<phase name="ai-context" order="4">
|
|
814
|
-
<!-- ALL 2 items are MANDATORY -->
|
|
815
|
-
|
|
816
|
-
<item name="complete-findings" mandatory="true">
|
|
817
|
-
**[MANDATORY] Complete Analysis Findings:**
|
|
818
|
-
|
|
819
|
-
Include ALL findings from the deep analysis:
|
|
820
|
-
- Every discovered pattern with file references
|
|
821
|
-
- Every relevant code snippet
|
|
822
|
-
- Every architectural decision
|
|
823
|
-
- Every potential issue
|
|
824
|
-
- Every integration consideration
|
|
825
|
-
|
|
826
|
-
CRITICAL REQUIREMENT: This analysis output will be used as PROMPT CONTEXT
|
|
827
|
-
for the AI agent implementing this feature. Therefore:
|
|
828
|
-
- INCLUDE ALL FINDINGS — don't summarize or omit details
|
|
829
|
-
- PROVIDE COMPLETE CONTEXT — the implementing AI needs every piece of information
|
|
830
|
-
- BE EXPLICIT — don't assume the implementing AI will know anything not stated
|
|
831
|
-
</item>
|
|
832
|
-
|
|
833
|
-
<item name="implementation-references" mandatory="true">
|
|
834
|
-
**[MANDATORY] Implementation References:**
|
|
835
|
-
|
|
836
|
-
- **Internal Documentation**: All relevant internal docs with full paths,
|
|
837
|
-
including architecture diagrams and ADRs
|
|
838
|
-
- **Code References**: All files to study before implementation,
|
|
839
|
-
specific functions/classes as examples, utility functions to reuse
|
|
840
|
-
- **Design Patterns & Best Practices**: Links to pattern documentation
|
|
841
|
-
(e.g., https://refactoring.guru/design-patterns/strategy)
|
|
842
|
-
- **External Resources**: Official docs for libraries used, best practice guides
|
|
843
|
-
- **Domain Knowledge**: All naming conventions, error handling patterns,
|
|
844
|
-
logging standards, performance considerations
|
|
845
|
-
</item>
|
|
846
|
-
</phase>
|
|
847
|
-
|
|
848
|
-
</analysis-process>
|
|
849
|
-
|
|
850
|
-
<validation-checklist>
|
|
851
|
-
<!-- Mark each item as complete before finishing.
|
|
852
|
-
Total: 22 mandatory items — DO NOT PROCEED until ALL are verified.
|
|
853
|
-
|
|
854
|
-
COMMON MISTAKE PREVENTION:
|
|
855
|
-
- Tree structures must show ACTUAL current files, not placeholders
|
|
856
|
-
- Refactoring analysis is required even if conclusion is "no refactoring needed"
|
|
857
|
-
- Integration points must reference actual existing code with file paths
|
|
858
|
-
- Testing strategy must ensure existing tests continue to pass
|
|
859
|
-
- Hardcoded values section MUST have actual code snippets, not descriptions
|
|
860
|
-
- All output goes ONLY to the analysis file — NO GitHub updates -->
|
|
861
|
-
|
|
862
|
-
<category name="file-creation">
|
|
863
|
-
<check>[MANDATORY] Analysis file created at story-directory/integration-analysis.md</check>
|
|
864
|
-
<check>[MANDATORY] Story directory created if it didn't exist</check>
|
|
865
|
-
<check>[MANDATORY] File contains all required sections from template</check>
|
|
866
|
-
</category>
|
|
867
|
-
|
|
868
|
-
<category name="core-analysis">
|
|
869
|
-
<check>[MANDATORY] Tree structure showing current codebase structure</check>
|
|
870
|
-
<check>[MANDATORY] Tree structure showing proposed changes with new files</check>
|
|
871
|
-
<check>[MANDATORY] Architecture compatibility analysis completed (layer-by-layer)</check>
|
|
872
|
-
<check>[MANDATORY] All existing patterns identified with file references</check>
|
|
873
|
-
<check>[MANDATORY] Integration points clearly documented</check>
|
|
874
|
-
<check>[MANDATORY] Impact analysis showing affected components</check>
|
|
875
|
-
</category>
|
|
876
|
-
|
|
877
|
-
<category name="architecture">
|
|
878
|
-
<check>[MANDATORY] Clean Architecture compliance verified</check>
|
|
879
|
-
<check>[MANDATORY] Dependency injection strategy documented</check>
|
|
880
|
-
<check>[MANDATORY] Design patterns identified and documented</check>
|
|
881
|
-
<check>[MANDATORY] Coding standards compliance verified</check>
|
|
882
|
-
<check>[MANDATORY] Testing strategy that preserves existing tests</check>
|
|
883
|
-
</category>
|
|
884
|
-
|
|
885
|
-
<category name="hardcoded-values-critical">
|
|
886
|
-
<check>[MANDATORY & CRITICAL] Searched for hardcoded domain/range values</check>
|
|
887
|
-
<check>[MANDATORY & CRITICAL] Searched for placeholder/TODO comments related to the feature</check>
|
|
888
|
-
<check>[MANDATORY & CRITICAL] Identified ALL renderers/handlers that should use new entity but don't</check>
|
|
889
|
-
<check>[MANDATORY & CRITICAL] Identified ALL manager/service classes with hardcoded defaults</check>
|
|
890
|
-
<check>[MANDATORY & CRITICAL] Found disconnected wiring (entity exists but not injected where needed)</check>
|
|
891
|
-
<check>[MANDATORY & CRITICAL] Section 5 filled with ACTUAL CODE SNIPPETS (not placeholders!)</check>
|
|
892
|
-
<check>[MANDATORY & CRITICAL] Every hardcoded value includes: file path, line number, current code, fix required</check>
|
|
893
|
-
</category>
|
|
894
|
-
</validation-checklist>
|
|
895
|
-
|
|
896
|
-
<guidelines>
|
|
897
|
-
|
|
898
|
-
<guideline name="accuracy-first">
|
|
899
|
-
NO ASSUMPTIONS are tolerated. The analysis must reflect 100% accurate code.
|
|
900
|
-
Only document what you actually find in the code. Never infer behavior
|
|
901
|
-
that isn't explicitly implemented. Every claim must be traceable to
|
|
902
|
-
actual code references with file paths and line numbers.
|
|
903
|
-
</guideline>
|
|
904
|
-
|
|
905
|
-
<guideline name="story-scope">
|
|
906
|
-
Focus exclusively on code paths related to the story.
|
|
907
|
-
Do NOT document the entire codebase — only files, functions,
|
|
908
|
-
and constants that are directly involved in implementing the story's
|
|
909
|
-
functionality as defined by its acceptance criteria.
|
|
910
|
-
</guideline>
|
|
911
|
-
|
|
912
|
-
<guideline name="coding-standards-first">
|
|
913
|
-
STRONG EMPHASIS ON CODING STANDARDS — NO EXCEPTIONS!
|
|
914
|
-
Every proposed change, new file, and integration point must be verified
|
|
915
|
-
against the project's coding standards (from wiki system-wide docs).
|
|
916
|
-
Standards compliance is not optional — it is the primary quality gate.
|
|
917
|
-
</guideline>
|
|
918
|
-
|
|
919
|
-
<guideline name="code-level-depth">
|
|
920
|
-
This is a DEEP TECHNICAL ANALYSIS, not a summary:
|
|
921
|
-
- ACTUAL CODE SNIPPETS must be included, not descriptions
|
|
922
|
-
- COMPLETE FILE PATHS WITH LINE NUMBERS for every reference
|
|
923
|
-
- EXACT INTEGRATION POINTS with specific method signatures
|
|
924
|
-
- NO HIGH-LEVEL SUMMARIES — only detailed, code-level analysis
|
|
925
|
-
|
|
926
|
-
This output will be used as the PRIMARY TECHNICAL REFERENCE for
|
|
927
|
-
implementing this story. Without complete code-level detail, the
|
|
928
|
-
analysis is USELESS.
|
|
929
|
-
</guideline>
|
|
930
|
-
|
|
931
|
-
<guideline name="thoroughness">
|
|
932
|
-
THOROUGH & COMPREHENSIVE: Cover every aspect of the integration.
|
|
933
|
-
100% SUBSTANTIVE: Only include relevant, actionable information.
|
|
934
|
-
TAKE ALL TIME NEEDED: Read EVERY line of relevant code.
|
|
935
|
-
ACCURACY IS PARAMOUNT: This will guide the implementation.
|
|
936
|
-
</guideline>
|
|
937
|
-
|
|
938
|
-
<guideline name="hardcoded-values-critical">
|
|
939
|
-
The hardcoded values discovery is the MOST IMPORTANT section.
|
|
940
|
-
THE #1 REASON INTEGRATION ANALYSES FAIL is identifying what NEW code
|
|
941
|
-
to create but FAILING to identify what EXISTING code must be MODIFIED.
|
|
942
|
-
|
|
943
|
-
For EVERY new entity/service being created:
|
|
944
|
-
1. "What existing code currently does this job (probably poorly/hardcoded)?"
|
|
945
|
-
2. "Where should this entity be INJECTED that it currently ISN'T?"
|
|
946
|
-
3. "What hardcoded values exist that this entity should REPLACE?"
|
|
947
|
-
|
|
948
|
-
This section MUST contain ACTUAL CODE SNIPPETS with file paths and line numbers.
|
|
949
|
-
</guideline>
|
|
950
|
-
|
|
951
|
-
<guideline name="wiki-as-context">
|
|
952
|
-
Wiki documents are the SINGLE SOURCE of codebase knowledge.
|
|
953
|
-
They replace all obsolete separate parameters (sourcecode, high-level-architecture,
|
|
954
|
-
documentation, related-stories-implementations, documented-features).
|
|
955
|
-
Read ALL wiki documents referenced in the story's Relevant Wiki section.
|
|
956
|
-
</guideline>
|
|
957
|
-
|
|
958
|
-
<guideline name="no-github-updates">
|
|
959
|
-
All output is written ONLY to the integration-analysis.md file.
|
|
960
|
-
NO GitHub updates, NO modifications to the story file.
|
|
961
|
-
This is a standalone artifact consumed by pass 5 (technical solution).
|
|
962
|
-
</guideline>
|
|
963
|
-
|
|
964
|
-
<guideline name="github-compatibility">
|
|
965
|
-
The analysis document must render cleanly in GitHub markdown viewers.
|
|
966
|
-
- Use markdown tables (no HTML tables)
|
|
967
|
-
- No custom CSS or HTML styling
|
|
968
|
-
- Code blocks with language hints for syntax highlighting
|
|
969
|
-
- YAML blocks for structured data (hardcoded values, wiring)
|
|
970
|
-
</guideline>
|
|
971
|
-
|
|
972
|
-
<guideline name="refactoring-always-addressed">
|
|
973
|
-
The refactoring section MUST be completed even if the conclusion is
|
|
974
|
-
"no refactoring required." The analysis must explicitly state whether
|
|
975
|
-
refactoring is needed and provide justification either way.
|
|
976
|
-
</guideline>
|
|
977
|
-
|
|
978
|
-
<guideline name="common-mistakes">
|
|
979
|
-
Common mistakes to avoid:
|
|
980
|
-
- Tree structures must show ACTUAL current files, not placeholders
|
|
981
|
-
- Refactoring analysis is required even if "no refactoring needed"
|
|
982
|
-
- Integration points must reference actual existing code with file paths
|
|
983
|
-
- Testing strategy must ensure existing tests continue to pass
|
|
984
|
-
- Hardcoded values section MUST have actual code snippets
|
|
985
|
-
- Don't identify only NEW code — also identify what EXISTING code must CHANGE
|
|
986
|
-
- Don't miss disconnected wiring (entities that exist but aren't injected)
|
|
987
|
-
</guideline>
|
|
988
|
-
|
|
989
|
-
</guidelines>
|
|
990
|
-
|
|
991
|
-
<evolution>
|
|
992
|
-
|
|
993
|
-
**Creation (research-integration-solution — pass 4):**
|
|
994
|
-
This is pass 4 of the story specification pipeline.
|
|
995
|
-
A single run produces the complete integration-analysis.md document.
|
|
996
|
-
All sections must be filled, all checklist items verified.
|
|
997
|
-
|
|
998
|
-
**Consumption (story-technical-solution — pass 5):**
|
|
999
|
-
The integration-analysis.md is consumed as input by pass 5 (technical solution).
|
|
1000
|
-
The technical solution uses insights from this analysis to design the
|
|
1001
|
-
implementation approach — file changes, integration points, refactoring,
|
|
1002
|
-
hardcoded values to replace, testing strategy.
|
|
1003
|
-
|
|
1004
|
-
**Re-analysis (exception, not norm):**
|
|
1005
|
-
Only when the story scope changes significantly or the codebase changes
|
|
1006
|
-
substantially. Re-running overwrites the existing analysis.
|
|
1007
|
-
|
|
1008
|
-
**This analysis does NOT modify the story file.**
|
|
1009
|
-
It lives as a separate artifact in the story directory.
|
|
1010
|
-
The story.xml template has no sections that reference this analysis directly.
|
|
1011
|
-
Only the technical solution (pass 5) consumes it.
|
|
1012
|
-
|
|
1013
|
-
</evolution>
|
|
1014
|
-
|
|
1015
|
-
</integration-solution>
|
|
1
|
+
<integration-solution>
|
|
2
|
+
|
|
3
|
+
<purpose>
|
|
4
|
+
Template for `.ace/artifacts/product/<id-epic_name>/<id-feature_name>/<id-story_name>/integration-analysis.md` —
|
|
5
|
+
a COMPREHENSIVE, IN-DEPTH System Integration Analysis that ensures new story
|
|
6
|
+
implementations integrate seamlessly with existing systems without breaking
|
|
7
|
+
functionality or violating architectural principles.
|
|
8
|
+
|
|
9
|
+
This is pass 4 of the story specification pipeline (see story.xml composition).
|
|
10
|
+
It produces a separate artifact in the story directory — NOT appended to the story file.
|
|
11
|
+
The analysis is consumed by pass 5 (technical solution) as input for designing
|
|
12
|
+
the implementation approach with full codebase integration context.
|
|
13
|
+
|
|
14
|
+
**[MANDATORY]** Identify how a new story would PROPERLY integrate with the existing
|
|
15
|
+
codebase while maintaining architectural integrity, maintainability, and extensibility
|
|
16
|
+
while strictly following CODING STANDARDS.
|
|
17
|
+
|
|
18
|
+
You are operating within a PRODUCTION-GRADE, CLEAN, COMPLEX CODEBASE — new code
|
|
19
|
+
must be added thoughtfully and systematically. The purpose is to analyze HOW TO ADD
|
|
20
|
+
NEW FUNCTIONALITY WHILE KEEPING THE CODE MAINTAINABLE AND EXTENSIBLE.
|
|
21
|
+
|
|
22
|
+
This document does NOT modify the story file. It lives as a separate artifact
|
|
23
|
+
in the story directory. Only the technical solution (pass 5) consumes it.
|
|
24
|
+
|
|
25
|
+
CRITICAL: This analysis output will be used as PROMPT CONTEXT for the AI agent
|
|
26
|
+
implementing this feature. Therefore:
|
|
27
|
+
- INCLUDE ALL FINDINGS — don't summarize or omit details
|
|
28
|
+
- PROVIDE COMPLETE CONTEXT — the implementing AI needs every piece of information
|
|
29
|
+
- BE EXPLICIT — don't assume the implementing AI will know anything not explicitly stated
|
|
30
|
+
</purpose>
|
|
31
|
+
|
|
32
|
+
<output-format>
|
|
33
|
+
|
|
34
|
+
<section name="header">
|
|
35
|
+
# System Integration Analysis: [Story Name]
|
|
36
|
+
|
|
37
|
+
## Analysis Context
|
|
38
|
+
- **Story**: [Story ID] — [Story Title]
|
|
39
|
+
- **Feature**: [Feature ID] — [Feature Title]
|
|
40
|
+
- **Epic**: [Epic ID] — [Epic Title]
|
|
41
|
+
- **Analysis Date**: [Current date]
|
|
42
|
+
- **Wiki Documents Loaded**: [N] files
|
|
43
|
+
- **External Analysis**: [Available/Not available]
|
|
44
|
+
- **Code References**: [N] references documented
|
|
45
|
+
- **Hardcoded Values Found**: [N] items
|
|
46
|
+
- **Refactoring Items**: [N] items
|
|
47
|
+
</section>
|
|
48
|
+
|
|
49
|
+
<section name="use-case-overview">
|
|
50
|
+
## 1. Use Case Overview
|
|
51
|
+
|
|
52
|
+
[Brief description of what needs to be implemented — extracted from the story's
|
|
53
|
+
User Story statement, Description, and Acceptance Criteria.
|
|
54
|
+
|
|
55
|
+
Include:
|
|
56
|
+
- What the user can do when this story is done
|
|
57
|
+
- Key behaviors and requirements from acceptance criteria
|
|
58
|
+
- How this story relates to other stories in the feature
|
|
59
|
+
- What the parent feature context provides]
|
|
60
|
+
</section>
|
|
61
|
+
|
|
62
|
+
<section name="architecture-compatibility">
|
|
63
|
+
## 2. Architecture Compatibility
|
|
64
|
+
|
|
65
|
+
<!-- How this story fits into the Clean Architecture layers.
|
|
66
|
+
For EACH layer, document what new components are needed
|
|
67
|
+
and how they integrate with existing components. -->
|
|
68
|
+
|
|
69
|
+
### Domain Layer
|
|
70
|
+
<!-- New entities, value objects, constants, business rules needed.
|
|
71
|
+
How they relate to existing domain objects.
|
|
72
|
+
Domain events that may be needed.
|
|
73
|
+
File paths to relevant existing domain code. -->
|
|
74
|
+
- **New Entities**: [entities to create with proposed file paths]
|
|
75
|
+
- **Value Objects**: [value objects needed]
|
|
76
|
+
- **Constants**: [new constants or extensions to existing constant files]
|
|
77
|
+
- **Business Rules**: [domain rules this story introduces]
|
|
78
|
+
- **Existing Domain Code**: [relevant existing domain files with paths]
|
|
79
|
+
|
|
80
|
+
### Application Layer
|
|
81
|
+
<!-- Use cases, interfaces, DTOs to create.
|
|
82
|
+
How they interact with existing application services.
|
|
83
|
+
Dependency injection registrations needed. -->
|
|
84
|
+
- **Use Cases**: [use cases to create]
|
|
85
|
+
- **Interfaces**: [interfaces to define or extend]
|
|
86
|
+
- **DTOs**: [data transfer objects needed]
|
|
87
|
+
- **Existing Services**: [application services that will be affected]
|
|
88
|
+
|
|
89
|
+
### Infrastructure Layer
|
|
90
|
+
<!-- Services, implementations, repositories required.
|
|
91
|
+
External service integrations.
|
|
92
|
+
How they implement application layer interfaces. -->
|
|
93
|
+
- **Services**: [infrastructure services to implement]
|
|
94
|
+
- **Implementations**: [interface implementations needed]
|
|
95
|
+
- **Repositories**: [data access patterns to follow]
|
|
96
|
+
- **Existing Infrastructure**: [existing infrastructure code affected]
|
|
97
|
+
|
|
98
|
+
### Presentation Layer
|
|
99
|
+
<!-- UI components, API endpoints, view models needed.
|
|
100
|
+
How they connect to application layer.
|
|
101
|
+
User interaction patterns to follow. -->
|
|
102
|
+
- **Components**: [UI components or API endpoints needed]
|
|
103
|
+
- **View Models**: [presentation models needed]
|
|
104
|
+
- **Existing Presentation Code**: [existing presentation code affected]
|
|
105
|
+
|
|
106
|
+
### Dependency Rule Compliance
|
|
107
|
+
<!-- Verify that all proposed changes maintain the dependency rule:
|
|
108
|
+
dependencies point inward (Presentation → Application → Domain).
|
|
109
|
+
Infrastructure implements Application interfaces.
|
|
110
|
+
No layer knows about outer layers. -->
|
|
111
|
+
- [Compliance verification for each proposed change]
|
|
112
|
+
</section>
|
|
113
|
+
|
|
114
|
+
<section name="existing-patterns">
|
|
115
|
+
## 3. Existing Patterns to Follow
|
|
116
|
+
|
|
117
|
+
<!-- Specific patterns found in the codebase that this story MUST follow.
|
|
118
|
+
Each pattern includes file references with line numbers.
|
|
119
|
+
The implementing agent must study these files before coding. -->
|
|
120
|
+
|
|
121
|
+
### Similar Implementations
|
|
122
|
+
<!-- Reference existing code that implements similar functionality.
|
|
123
|
+
The new implementation should follow these as examples. -->
|
|
124
|
+
- **[Implementation Name]** at `[file:line-range]` — [what to learn from it]
|
|
125
|
+
|
|
126
|
+
### Established Conventions
|
|
127
|
+
<!-- Naming patterns, file organization, code structure conventions. -->
|
|
128
|
+
- **Naming**: [naming conventions with examples from codebase]
|
|
129
|
+
- **File Organization**: [how files are organized with examples]
|
|
130
|
+
- **Code Structure**: [class/function structure patterns]
|
|
131
|
+
|
|
132
|
+
### Design Patterns in Use
|
|
133
|
+
<!-- Which design patterns are already used that must be followed. -->
|
|
134
|
+
|
|
135
|
+
#### [Pattern Name] (e.g., Strategy, Factory, Observer)
|
|
136
|
+
- **Where**: [File/component where pattern is used — with path]
|
|
137
|
+
- **Why**: [Why this pattern was chosen]
|
|
138
|
+
- **Implementation Example**:
|
|
139
|
+
```typescript
|
|
140
|
+
// From [file:line-range]
|
|
141
|
+
[Code example showing the pattern]
|
|
142
|
+
```
|
|
143
|
+
- **How to Follow**: [How the new code should use this pattern]
|
|
144
|
+
|
|
145
|
+
<!-- Repeat for each identified pattern -->
|
|
146
|
+
|
|
147
|
+
### Error Handling Patterns
|
|
148
|
+
- [How errors are handled — with code references]
|
|
149
|
+
|
|
150
|
+
### Logging Patterns
|
|
151
|
+
- [How logging is done — with code references]
|
|
152
|
+
|
|
153
|
+
### Constants & Configuration Patterns
|
|
154
|
+
- [How constants are organized — with code references]
|
|
155
|
+
- [Where to add new constants]
|
|
156
|
+
</section>
|
|
157
|
+
|
|
158
|
+
<section name="required-refactoring">
|
|
159
|
+
## 4. Required Refactoring
|
|
160
|
+
|
|
161
|
+
<!-- List any existing code that needs refactoring to support the new implementation.
|
|
162
|
+
Include justification for each refactoring decision.
|
|
163
|
+
Impact assessment of changes.
|
|
164
|
+
Even if no refactoring is needed, complete this section with that conclusion. -->
|
|
165
|
+
|
|
166
|
+
### Refactoring Items
|
|
167
|
+
|
|
168
|
+
<!-- For each item:
|
|
169
|
+
- What code needs to change (file path, line numbers)
|
|
170
|
+
- Current state (what it is now)
|
|
171
|
+
- Proposed change (what it should become)
|
|
172
|
+
- Justification (why this refactoring is needed)
|
|
173
|
+
- Impact (what else is affected by this change)
|
|
174
|
+
|
|
175
|
+
Common scenarios:
|
|
176
|
+
- Pattern violations: Direct implementations that should use Strategy/Factory
|
|
177
|
+
- Constants chaos: Magic strings/numbers that should be centralized
|
|
178
|
+
- Model proliferation: Duplicate models that should be unified
|
|
179
|
+
- Method duplication: Duplicate logic that should be extracted
|
|
180
|
+
- Layer violations: Business logic in wrong architectural layer
|
|
181
|
+
- Service sprawl: Services that should be extended vs. duplicated
|
|
182
|
+
- Event handler inconsistencies: Inconsistent event handling patterns
|
|
183
|
+
- State management violations: State managed inconsistently
|
|
184
|
+
- API integration inconsistencies: Direct API calls instead of services
|
|
185
|
+
- Type definition duplication: Redefined types that should be imported -->
|
|
186
|
+
|
|
187
|
+
#### [Refactoring Item Name]
|
|
188
|
+
- **File**: `[file:line-range]`
|
|
189
|
+
- **Current State**: [what it is now]
|
|
190
|
+
- **Proposed Change**: [what it should become]
|
|
191
|
+
- **Justification**: [why this is needed for the new implementation]
|
|
192
|
+
- **Impact**: [what else is affected]
|
|
193
|
+
|
|
194
|
+
<!-- Repeat for each refactoring item.
|
|
195
|
+
If no refactoring needed, state: "No refactoring required. [justification]." -->
|
|
196
|
+
</section>
|
|
197
|
+
|
|
198
|
+
<section name="hardcoded-values-critical">
|
|
199
|
+
## 5. CRITICAL: Hardcoded Values & Placeholder Code That MUST Be Replaced
|
|
200
|
+
|
|
201
|
+
<!-- THIS IS THE MOST CRITICAL SECTION OF THE INTEGRATION ANALYSIS!
|
|
202
|
+
|
|
203
|
+
THE #1 REASON INTEGRATION ANALYSES FAIL:
|
|
204
|
+
The analysis identifies what NEW code to create but FAILS to identify
|
|
205
|
+
what EXISTING code must be MODIFIED or REPLACED.
|
|
206
|
+
|
|
207
|
+
For every new entity/service being created, ask:
|
|
208
|
+
- "What existing code currently does this job (probably poorly/hardcoded)?"
|
|
209
|
+
- "Where should this entity be INJECTED that it currently ISN'T?"
|
|
210
|
+
- "What hardcoded values exist that this entity should REPLACE?"
|
|
211
|
+
|
|
212
|
+
MANDATORY SEARCHES:
|
|
213
|
+
- Hardcoded numeric ranges, dimensions, colors, sizes
|
|
214
|
+
- TODO comments mentioning the feature
|
|
215
|
+
- "temporary", "placeholder", "stub", "mock" in comments
|
|
216
|
+
- Methods returning hardcoded values instead of computed ones
|
|
217
|
+
- Classes/services that exist but aren't used where they should be
|
|
218
|
+
- Inline calculations that should use the new service
|
|
219
|
+
- Manager/Service classes with hardcoded defaults
|
|
220
|
+
- Renderers/handlers not using the new entity
|
|
221
|
+
|
|
222
|
+
This section MUST be filled with ACTUAL CODE SNIPPETS from the codebase!
|
|
223
|
+
The implementing AI agent NEEDS to know EXACTLY what to change and WHERE. -->
|
|
224
|
+
|
|
225
|
+
### Hardcoded Values to Replace
|
|
226
|
+
|
|
227
|
+
```yaml
|
|
228
|
+
FILE: [exact file path]
|
|
229
|
+
LINE: [line number(s)]
|
|
230
|
+
CURRENT CODE: |
|
|
231
|
+
[actual code snippet from the file]
|
|
232
|
+
PROBLEM: [why this is wrong]
|
|
233
|
+
SHOULD BE: [what it should become after implementation]
|
|
234
|
+
FIX REQUIRED: [specific action to take]
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
<!-- Repeat for EACH hardcoded value found -->
|
|
238
|
+
|
|
239
|
+
### Disconnected Wiring to Fix
|
|
240
|
+
|
|
241
|
+
```yaml
|
|
242
|
+
ENTITY/SERVICE EXISTS: [path to entity/service that should be used]
|
|
243
|
+
CURRENTLY NOT CONNECTED TO:
|
|
244
|
+
- [File 1]: [what it uses instead]
|
|
245
|
+
- [File 2]: [what it uses instead]
|
|
246
|
+
REQUIRED CONNECTIONS:
|
|
247
|
+
- [Where to inject and how]
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
<!-- Repeat for EACH disconnected wiring found -->
|
|
251
|
+
|
|
252
|
+
### Placeholder/TODO Code to Implement
|
|
253
|
+
|
|
254
|
+
```yaml
|
|
255
|
+
FILE: [file path]
|
|
256
|
+
LINE: [line number]
|
|
257
|
+
TODO COMMENT: "[exact TODO text]"
|
|
258
|
+
CURRENT IMPLEMENTATION: [what it does now — probably hardcoded]
|
|
259
|
+
REQUIRED IMPLEMENTATION: [what needs to be implemented]
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
<!-- Repeat for EACH placeholder found -->
|
|
263
|
+
|
|
264
|
+
### Renderers/Services Not Using New Entity
|
|
265
|
+
|
|
266
|
+
```yaml
|
|
267
|
+
NEW ENTITY: [entity name and path]
|
|
268
|
+
RENDERERS/HANDLERS THAT MUST USE IT:
|
|
269
|
+
- [Renderer/Handler 1]: Currently uses [X], must use [new entity]
|
|
270
|
+
- [Renderer/Handler 2]: Currently uses [X], must use [new entity]
|
|
271
|
+
SERVICES THAT MUST USE IT:
|
|
272
|
+
- [Service 1]: Currently [behavior], must [new behavior]
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
<!-- Repeat for EACH new entity -->
|
|
276
|
+
</section>
|
|
277
|
+
|
|
278
|
+
<section name="integration-points">
|
|
279
|
+
## 6. Integration Points
|
|
280
|
+
|
|
281
|
+
<!-- All touchpoints between the new implementation and the existing system.
|
|
282
|
+
Categorize by architectural layer and component type. -->
|
|
283
|
+
|
|
284
|
+
### Domain Layer Integration
|
|
285
|
+
- [Integration point — how the new domain code connects with existing domain]
|
|
286
|
+
|
|
287
|
+
### Application Layer Integration
|
|
288
|
+
- [Integration point — new use cases, service interfaces, DI registrations]
|
|
289
|
+
|
|
290
|
+
### Infrastructure Layer Integration
|
|
291
|
+
- [Integration point — new service implementations, repository patterns]
|
|
292
|
+
|
|
293
|
+
### Presentation Layer Integration
|
|
294
|
+
- [Integration point — new UI components, API endpoints, event handlers]
|
|
295
|
+
|
|
296
|
+
### Cross-Cutting Integration
|
|
297
|
+
<!-- Event systems, middleware, DI container, logging, error handling -->
|
|
298
|
+
- [Integration point — cross-cutting concerns this story must respect]
|
|
299
|
+
</section>
|
|
300
|
+
|
|
301
|
+
<section name="impact-analysis">
|
|
302
|
+
## 7. Impact Analysis
|
|
303
|
+
|
|
304
|
+
<!-- ALL code flows that might be impacted by the new implementation.
|
|
305
|
+
Include specific file references for each impacted flow. -->
|
|
306
|
+
|
|
307
|
+
### Affected Code Flows
|
|
308
|
+
- **[Flow Name]**: [description of impact] — `[file:line-range]`
|
|
309
|
+
|
|
310
|
+
### Affected Tests
|
|
311
|
+
<!-- Tests that may need modification due to the new implementation -->
|
|
312
|
+
- `[test-file:line-range]` — [what needs to change and why]
|
|
313
|
+
|
|
314
|
+
### Affected Documentation
|
|
315
|
+
<!-- Documentation files/wiki docs that may need updates -->
|
|
316
|
+
- `[doc-file]` — [what needs updating]
|
|
317
|
+
|
|
318
|
+
### Performance Implications
|
|
319
|
+
- [Performance consideration — with mitigation strategy]
|
|
320
|
+
|
|
321
|
+
### Breaking Change Risks
|
|
322
|
+
- [Risk — with mitigation strategy]
|
|
323
|
+
</section>
|
|
324
|
+
|
|
325
|
+
<section name="codebase-tree">
|
|
326
|
+
## 8. Codebase Structure
|
|
327
|
+
|
|
328
|
+
### Current Structure (Relevant Files)
|
|
329
|
+
<!-- Tree structure showing ACTUAL current files relevant to this story.
|
|
330
|
+
NOT the entire codebase — only files that are involved.
|
|
331
|
+
Include file paths and one-line purpose. -->
|
|
332
|
+
|
|
333
|
+
```
|
|
334
|
+
[Current relevant file tree]
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Proposed Structure (With New Files)
|
|
338
|
+
<!-- Tree structure showing what the codebase will look like
|
|
339
|
+
after implementing this story. Mark new files clearly. -->
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
[Proposed file tree with new files marked]
|
|
343
|
+
```
|
|
344
|
+
</section>
|
|
345
|
+
|
|
346
|
+
<section name="implementation-guidelines">
|
|
347
|
+
## 9. Implementation Guidelines
|
|
348
|
+
|
|
349
|
+
<!-- Step-by-step approach following coding standards.
|
|
350
|
+
The implementing agent should follow this order. -->
|
|
351
|
+
|
|
352
|
+
### Recommended Implementation Order
|
|
353
|
+
|
|
354
|
+
1. **[Step 1]**: [What to implement first and why]
|
|
355
|
+
- Files to create/modify: [list]
|
|
356
|
+
- Pattern to follow: [reference to existing pattern]
|
|
357
|
+
|
|
358
|
+
2. **[Step 2]**: [What to implement next]
|
|
359
|
+
- Files to create/modify: [list]
|
|
360
|
+
- Pattern to follow: [reference]
|
|
361
|
+
|
|
362
|
+
<!-- Continue for all implementation steps -->
|
|
363
|
+
|
|
364
|
+
### Dependency Management
|
|
365
|
+
- [How to manage dependencies — DI registrations, imports, etc.]
|
|
366
|
+
|
|
367
|
+
### Error Handling Approach
|
|
368
|
+
- [Error handling strategy for the new implementation]
|
|
369
|
+
|
|
370
|
+
### State Management Strategy
|
|
371
|
+
- [How state should be managed in the new implementation]
|
|
372
|
+
</section>
|
|
373
|
+
|
|
374
|
+
<section name="testing-strategy">
|
|
375
|
+
## 10. Testing Strategy
|
|
376
|
+
|
|
377
|
+
<!-- How to test without breaking existing tests.
|
|
378
|
+
Follow the testing framework patterns from wiki. -->
|
|
379
|
+
|
|
380
|
+
### Test Types Required
|
|
381
|
+
- **Unit Tests**: [what to unit test, mocking strategy]
|
|
382
|
+
- **Integration Tests**: [what integration scenarios to cover]
|
|
383
|
+
- **E2E Tests**: [end-to-end scenarios if applicable]
|
|
384
|
+
|
|
385
|
+
### Existing Test Patterns to Follow
|
|
386
|
+
- [Pattern 1 — with reference to existing test file]
|
|
387
|
+
- [Pattern 2 — with reference to existing test file]
|
|
388
|
+
|
|
389
|
+
### Test Data Patterns
|
|
390
|
+
- [How test data is managed in existing tests]
|
|
391
|
+
|
|
392
|
+
### Ensuring Existing Tests Pass
|
|
393
|
+
- [Steps to verify existing tests still pass after changes]
|
|
394
|
+
- [Tests that may need adjustment and why]
|
|
395
|
+
</section>
|
|
396
|
+
|
|
397
|
+
<section name="complete-findings">
|
|
398
|
+
## 11. Complete Analysis Findings
|
|
399
|
+
|
|
400
|
+
<!-- INCLUDE ALL FINDINGS from the deep analysis.
|
|
401
|
+
This is the comprehensive dump of everything discovered.
|
|
402
|
+
The implementing AI needs every piece of information.
|
|
403
|
+
|
|
404
|
+
Include:
|
|
405
|
+
- Every discovered pattern with file references
|
|
406
|
+
- Every relevant code snippet
|
|
407
|
+
- Every architectural decision
|
|
408
|
+
- Every potential issue
|
|
409
|
+
- Every integration consideration -->
|
|
410
|
+
|
|
411
|
+
### Discovered Patterns
|
|
412
|
+
- [Pattern — file reference — relevance to this story]
|
|
413
|
+
|
|
414
|
+
### Relevant Code Snippets
|
|
415
|
+
```typescript
|
|
416
|
+
// From [file:line-range]
|
|
417
|
+
// [Why this snippet is relevant]
|
|
418
|
+
[actual code]
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### Architectural Constraints
|
|
422
|
+
- [Constraint — source (coding standards, ADR, etc.) — impact on implementation]
|
|
423
|
+
|
|
424
|
+
### Potential Issues
|
|
425
|
+
- [Issue — likelihood — mitigation]
|
|
426
|
+
</section>
|
|
427
|
+
|
|
428
|
+
<section name="implementation-references">
|
|
429
|
+
## 12. Implementation References
|
|
430
|
+
|
|
431
|
+
### Internal Documentation
|
|
432
|
+
<!-- All relevant internal docs with full paths -->
|
|
433
|
+
- `[path]` — [what to learn from this doc]
|
|
434
|
+
|
|
435
|
+
### Code References
|
|
436
|
+
<!-- All files that should be studied before implementation -->
|
|
437
|
+
- `[file:line-range]` — [what to learn from this code]
|
|
438
|
+
|
|
439
|
+
### Design Patterns & Best Practices
|
|
440
|
+
<!-- Links to pattern documentation -->
|
|
441
|
+
- [Pattern Name] — [link to documentation, e.g., refactoring.guru]
|
|
442
|
+
|
|
443
|
+
### External Resources
|
|
444
|
+
<!-- Official documentation links for libraries used -->
|
|
445
|
+
- [Resource] — [link]
|
|
446
|
+
</section>
|
|
447
|
+
|
|
448
|
+
<section name="ai-implementation-context">
|
|
449
|
+
## 13. AI Implementation Context
|
|
450
|
+
|
|
451
|
+
<!-- CRITICAL SECTION — This will be the primary context for the implementing AI.
|
|
452
|
+
Everything the implementing agent needs to know in one place. -->
|
|
453
|
+
|
|
454
|
+
### Domain Knowledge
|
|
455
|
+
- [All domain-specific knowledge the implementing agent needs]
|
|
456
|
+
|
|
457
|
+
### Constraints & Limitations
|
|
458
|
+
- [All constraints from coding standards, architecture, ADRs]
|
|
459
|
+
|
|
460
|
+
### Naming Conventions
|
|
461
|
+
- [All naming conventions observed in the codebase with examples]
|
|
462
|
+
|
|
463
|
+
### Error Handling Standards
|
|
464
|
+
- [Error handling patterns with code references]
|
|
465
|
+
|
|
466
|
+
### Logging Standards
|
|
467
|
+
- [Logging approach with code references]
|
|
468
|
+
|
|
469
|
+
### Performance Considerations
|
|
470
|
+
- [Performance requirements and optimization approaches]
|
|
471
|
+
|
|
472
|
+
### Example Code Snippets
|
|
473
|
+
<!-- Code snippets from similar implementations that serve as templates -->
|
|
474
|
+
```typescript
|
|
475
|
+
// From [file:line-range]
|
|
476
|
+
// [This serves as a template for implementing [component]]
|
|
477
|
+
[actual code from similar implementation]
|
|
478
|
+
```
|
|
479
|
+
</section>
|
|
480
|
+
|
|
481
|
+
</output-format>
|
|
482
|
+
|
|
483
|
+
<analysis-process>
|
|
484
|
+
|
|
485
|
+
<!-- This section defines the analysis methodology that the code-integration-analyst
|
|
486
|
+
agent must follow. It mirrors the workflow steps but provides detailed
|
|
487
|
+
instructions for each analysis phase.
|
|
488
|
+
|
|
489
|
+
MANDATORY COMPLETION REQUIREMENTS:
|
|
490
|
+
- Phase 1: ALL 4 items (Context Loading) — MANDATORY
|
|
491
|
+
- Phase 2: ALL 8 items (Deep Codebase Analysis) — MANDATORY
|
|
492
|
+
- Phase 3: ALL 4 items (Refactoring & Strategy) — MANDATORY
|
|
493
|
+
- Phase 4: ALL 2 items (AI Implementation Context) — MANDATORY
|
|
494
|
+
- Total: 18 mandatory analysis items — SKIP NONE -->
|
|
495
|
+
|
|
496
|
+
<phase name="context-loading" order="1">
|
|
497
|
+
<!-- ALL 4 items are MANDATORY -->
|
|
498
|
+
|
|
499
|
+
<item name="understand-story" mandatory="true">
|
|
500
|
+
**[MANDATORY] Understand the story requirements:**
|
|
501
|
+
- Read the story thoroughly: User Story, Description, all AC scenarios
|
|
502
|
+
- These define WHAT functionality needs to integrate into the codebase
|
|
503
|
+
- Extract key behaviors, components, and patterns needed
|
|
504
|
+
- The story's acceptance criteria define the SCOPE of the analysis
|
|
505
|
+
- **Requirements come from the story** — do NOT seek requirements
|
|
506
|
+
from other sources. The story IS the source of truth.
|
|
507
|
+
- If a parent feature document is available, read it to understand:
|
|
508
|
+
- The broader feature context
|
|
509
|
+
- What other stories exist and how they relate
|
|
510
|
+
- Dependencies and shared components between stories
|
|
511
|
+
</item>
|
|
512
|
+
|
|
513
|
+
<item name="load-wiki-documents" mandatory="true">
|
|
514
|
+
**[MANDATORY] Load and study ALL wiki documents from the story's Relevant Wiki section:**
|
|
515
|
+
|
|
516
|
+
These wiki documents provide the COMPLETE codebase context:
|
|
517
|
+
|
|
518
|
+
- **System-Wide** (always present):
|
|
519
|
+
- `system-structure.md` — High-level codebase tree and organization
|
|
520
|
+
- `system-architecture.md` — Complete architectural overview
|
|
521
|
+
- `coding-standards.md` — CRITICAL: coding standards — NO EXCEPTIONS!
|
|
522
|
+
- `testing-framework.md` — Testing patterns and frameworks
|
|
523
|
+
|
|
524
|
+
- **Subsystem Documents** (as referenced by story):
|
|
525
|
+
- **Systems**: System descriptions, boundaries, APIs
|
|
526
|
+
- **Patterns**: Design patterns in use with examples
|
|
527
|
+
- **Cross-Cutting Concerns**: Shared concerns (auth, logging, errors, etc.)
|
|
528
|
+
- **Guides**: How-to guides for common implementation tasks
|
|
529
|
+
- **Walkthroughs**: Deep tutorial-style flow explanations with actual code snippets
|
|
530
|
+
- **Decisions (ADRs)**: Architecture decisions that constrain design
|
|
531
|
+
- **Architecture**: Subsystem architecture documents
|
|
532
|
+
|
|
533
|
+
Read EVERY document. These replace the obsolete command's separate parameters:
|
|
534
|
+
- sourcecode → system-structure.md (high-level tree)
|
|
535
|
+
- high-level-architecture → system-architecture.md
|
|
536
|
+
- documentation → all wiki documents combined
|
|
537
|
+
- related-stories-implementations → wiki documents capture story knowledge
|
|
538
|
+
- documented-features → wiki documents catalog feature implementations
|
|
539
|
+
</item>
|
|
540
|
+
|
|
541
|
+
<item name="load-external-analysis" mandatory="true">
|
|
542
|
+
**[MANDATORY] Check and load external analysis if available:**
|
|
543
|
+
- Automatically check for `{STORY_DIR}/external-analysis.md`
|
|
544
|
+
- This is the artifact from pass 3 (`/ace:research-external-solution`)
|
|
545
|
+
- If present, study it for:
|
|
546
|
+
- How industry-standard systems implement this functionality
|
|
547
|
+
- Algorithms and formulas to reuse
|
|
548
|
+
- Design patterns from external implementations
|
|
549
|
+
- Best practices that should inform our integration
|
|
550
|
+
- If not present, proceed without — note this in the analysis
|
|
551
|
+
</item>
|
|
552
|
+
|
|
553
|
+
<item name="load-feature-document" mandatory="true">
|
|
554
|
+
**[MANDATORY] Load the parent feature document:**
|
|
555
|
+
- The feature file path can be extracted from the story metadata
|
|
556
|
+
- Understand the feature planning context
|
|
557
|
+
- Identify how this story fits within the broader feature
|
|
558
|
+
- Identify dependencies and integration points with other stories
|
|
559
|
+
- If not found, proceed without — the analysis can still be done
|
|
560
|
+
</item>
|
|
561
|
+
</phase>
|
|
562
|
+
|
|
563
|
+
<phase name="deep-codebase-analysis" order="2">
|
|
564
|
+
<!-- ALL 8 items are MANDATORY — skip NONE -->
|
|
565
|
+
|
|
566
|
+
<item name="architecture-compatibility" mandatory="true">
|
|
567
|
+
**[MANDATORY] Architecture Compatibility Analysis:**
|
|
568
|
+
|
|
569
|
+
Map how the new story fits into Clean Architecture layers:
|
|
570
|
+
|
|
571
|
+
- **Domain Layer**: New entities, value objects, constants needed.
|
|
572
|
+
How they relate to existing domain objects. Domain events needed.
|
|
573
|
+
- **Application Layer**: Use cases and interfaces to create.
|
|
574
|
+
How they interact with existing application services. DI registrations.
|
|
575
|
+
- **Infrastructure Layer**: Services and implementations required.
|
|
576
|
+
External service integrations. How they implement application interfaces.
|
|
577
|
+
- **Presentation Layer**: UI components and API endpoints needed.
|
|
578
|
+
How they connect to application layer. User interaction patterns.
|
|
579
|
+
|
|
580
|
+
Verify Clean Architecture compliance:
|
|
581
|
+
- Dependencies point inward toward domain
|
|
582
|
+
- Each layer knows only about inner layers
|
|
583
|
+
- Depend on abstractions, not concretions
|
|
584
|
+
- All business logic independently testable
|
|
585
|
+
</item>
|
|
586
|
+
|
|
587
|
+
<item name="pattern-recognition" mandatory="true">
|
|
588
|
+
**[MANDATORY] Pattern Recognition & Existing Patterns:**
|
|
589
|
+
|
|
590
|
+
Search for similar features/patterns in the codebase and reference them
|
|
591
|
+
with specific file paths and line numbers:
|
|
592
|
+
|
|
593
|
+
- **Similar Implementations**: Find existing code that does something similar
|
|
594
|
+
- **Naming Conventions**: Document exact naming patterns with examples
|
|
595
|
+
- **Design Patterns**: Catalog patterns in use (Strategy, Factory, Observer, etc.)
|
|
596
|
+
- **Error Handling**: Document error handling approaches with code references
|
|
597
|
+
- **Logging**: Document logging approaches
|
|
598
|
+
- **Constants Organization**: How constants are organized and where to add new ones
|
|
599
|
+
</item>
|
|
600
|
+
|
|
601
|
+
<item name="integration-points" mandatory="true">
|
|
602
|
+
**[MANDATORY] Integration Point Discovery (Layer-by-Layer):**
|
|
603
|
+
|
|
604
|
+
Examine each architectural layer for integration opportunities:
|
|
605
|
+
|
|
606
|
+
- **Domain Layer**: Entity extensions, value objects, business rules
|
|
607
|
+
- **Application Layer**: Service interfaces, use cases, DTOs
|
|
608
|
+
- **Infrastructure Layer**: Repository patterns, external services
|
|
609
|
+
- **Presentation Layer**: UI components, view models, controllers
|
|
610
|
+
|
|
611
|
+
Find:
|
|
612
|
+
- Existing interfaces that can be extended
|
|
613
|
+
- Abstract classes available for inheritance
|
|
614
|
+
- Event systems for loose coupling
|
|
615
|
+
- Middleware or pipeline patterns
|
|
616
|
+
- Plugin or extension points
|
|
617
|
+
- Configuration-based feature toggles
|
|
618
|
+
- DI container registrations needed
|
|
619
|
+
</item>
|
|
620
|
+
|
|
621
|
+
<item name="file-dependencies" mandatory="true">
|
|
622
|
+
**[MANDATORY] File Dependency Analysis:**
|
|
623
|
+
|
|
624
|
+
- Identify ALL files that will be referenced or modified
|
|
625
|
+
- Document supporting files for the new implementation
|
|
626
|
+
- Map import chains and dependency graphs
|
|
627
|
+
- Identify potential circular dependency risks
|
|
628
|
+
- List all current files that will support the new implementation
|
|
629
|
+
</item>
|
|
630
|
+
|
|
631
|
+
<item name="convention-compliance" mandatory="true">
|
|
632
|
+
**[MANDATORY] Convention Compliance Analysis:**
|
|
633
|
+
|
|
634
|
+
- Document existing conventions that MUST be followed
|
|
635
|
+
- Verify the new implementation doesn't violate CODING STANDARDS
|
|
636
|
+
- Check naming conventions, file organization, error handling
|
|
637
|
+
- Verify SOLID principles compliance
|
|
638
|
+
- Verify Clean Architecture layer boundaries
|
|
639
|
+
</item>
|
|
640
|
+
|
|
641
|
+
<item name="testing-patterns" mandatory="true">
|
|
642
|
+
**[MANDATORY] Testing Pattern Analysis:**
|
|
643
|
+
|
|
644
|
+
- Analyze current test patterns for consistent validation approach
|
|
645
|
+
- Identify test utilities and helpers available for reuse
|
|
646
|
+
- Document testing conventions (unit, integration, e2e)
|
|
647
|
+
- Identify tests that need modification due to the new implementation
|
|
648
|
+
- Extract mocking strategies used
|
|
649
|
+
</item>
|
|
650
|
+
|
|
651
|
+
<item name="hardcoded-values-discovery" mandatory="true">
|
|
652
|
+
**[MANDATORY] CRITICAL: Hardcoded Values & Placeholder Code Discovery:**
|
|
653
|
+
|
|
654
|
+
THIS IS THE MOST CRITICAL PART OF THE INTEGRATION ANALYSIS!
|
|
655
|
+
|
|
656
|
+
When a new story implements a feature, there are ALWAYS existing hardcoded
|
|
657
|
+
values or placeholder implementations that the new feature is MEANT TO REPLACE.
|
|
658
|
+
|
|
659
|
+
YOU MUST EXHAUSTIVELY SEARCH FOR:
|
|
660
|
+
|
|
661
|
+
<search-category name="hardcoded-domain-values">
|
|
662
|
+
**Hardcoded Domain/Range Values:**
|
|
663
|
+
- Search for hardcoded number ranges, dimensions, colors, sizes, offsets
|
|
664
|
+
- Search for values that should come from the new entity/service
|
|
665
|
+
- Grep patterns: `domain\(\[`, `= 0;`, `= 100`, `MIN_`, `MAX_`, `DEFAULT_`
|
|
666
|
+
</search-category>
|
|
667
|
+
|
|
668
|
+
<search-category name="placeholder-stubs">
|
|
669
|
+
**Placeholder/Stub Implementations:**
|
|
670
|
+
- Search for TODO comments mentioning the feature being implemented
|
|
671
|
+
- Search for "temporary", "placeholder", "stub", "mock" in comments
|
|
672
|
+
- Search for methods returning hardcoded values instead of computed ones
|
|
673
|
+
- Grep patterns: `TODO`, `TEMPORARY`, `placeholder`, `HARDCODED`
|
|
674
|
+
</search-category>
|
|
675
|
+
|
|
676
|
+
<search-category name="disconnected-wiring">
|
|
677
|
+
**Disconnected Wiring:**
|
|
678
|
+
- Classes/services that EXIST but are NOT USED where they should be
|
|
679
|
+
- Find where the NEW entity/service SHOULD be injected but currently isn't
|
|
680
|
+
- For every new entity/service, ask:
|
|
681
|
+
- "What existing code currently does this job?"
|
|
682
|
+
- "Where should this entity be INJECTED?"
|
|
683
|
+
- "What hardcoded values exist that this entity should REPLACE?"
|
|
684
|
+
</search-category>
|
|
685
|
+
|
|
686
|
+
<search-category name="inline-calculations">
|
|
687
|
+
**Inline Calculations That Should Use New Service:**
|
|
688
|
+
- Inline calculations done manually instead of using the new entity
|
|
689
|
+
- Duplicate calculation logic across multiple files
|
|
690
|
+
- Grep patterns: `Math.min`, `Math.max`, inline formulas
|
|
691
|
+
</search-category>
|
|
692
|
+
|
|
693
|
+
<search-category name="manager-service-defaults">
|
|
694
|
+
**Manager/Service Classes with Hardcoded Defaults:**
|
|
695
|
+
- Manager/service classes initializing with dummy values
|
|
696
|
+
- These MUST be updated to receive values from the new entity
|
|
697
|
+
- Search: `*Manager`, `*Service` classes in Infrastructure layer
|
|
698
|
+
</search-category>
|
|
699
|
+
|
|
700
|
+
<search-category name="renderers-not-using-entity">
|
|
701
|
+
**Renderers/Handlers Not Using New Entity:**
|
|
702
|
+
- When implementing a new feature, ALL relevant renderers/handlers must be checked
|
|
703
|
+
- Verify they use the new entity instead of hardcoded values
|
|
704
|
+
- Search: `*Renderer`, `*Handler`, `*Controller` classes
|
|
705
|
+
</search-category>
|
|
706
|
+
|
|
707
|
+
Output format for EACH discovered item:
|
|
708
|
+
```yaml
|
|
709
|
+
FILE: [exact file path]
|
|
710
|
+
LINE: [line number(s)]
|
|
711
|
+
CURRENT CODE: |
|
|
712
|
+
[actual code snippet from the file]
|
|
713
|
+
PROBLEM: [why this is wrong]
|
|
714
|
+
SHOULD BE: [what it should become after implementation]
|
|
715
|
+
FIX REQUIRED: [specific action to take]
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
CRITICAL: This section MUST be filled with ACTUAL CODE SNIPPETS from the codebase!
|
|
719
|
+
The implementing AI agent NEEDS to know EXACTLY what to change and WHERE.
|
|
720
|
+
</item>
|
|
721
|
+
|
|
722
|
+
<item name="impact-analysis" mandatory="true">
|
|
723
|
+
**[MANDATORY] Impact Analysis:**
|
|
724
|
+
|
|
725
|
+
- Discover ALL code flows that might be impacted by the new implementation
|
|
726
|
+
- Include specific file references for each impacted flow
|
|
727
|
+
- Identify tests that need modification (include file paths)
|
|
728
|
+
- Document documentation files/flows requiring updates
|
|
729
|
+
- Assess performance implications
|
|
730
|
+
- Identify breaking change risks
|
|
731
|
+
</item>
|
|
732
|
+
</phase>
|
|
733
|
+
|
|
734
|
+
<phase name="refactoring-strategy" order="3">
|
|
735
|
+
<!-- ALL 4 items are MANDATORY -->
|
|
736
|
+
|
|
737
|
+
<item name="refactoring-requirements" mandatory="true">
|
|
738
|
+
**[MANDATORY] Refactoring Requirements:**
|
|
739
|
+
|
|
740
|
+
Determine if existing code needs refactoring for the new implementation
|
|
741
|
+
to be MAINTAINABLE / EXTENSIBLE. Check for:
|
|
742
|
+
|
|
743
|
+
<refactoring-scenario name="consolidation">
|
|
744
|
+
Duplicate code that should be unified before adding more
|
|
745
|
+
</refactoring-scenario>
|
|
746
|
+
<refactoring-scenario name="abstraction">
|
|
747
|
+
Concrete implementations that need interfaces for extensibility
|
|
748
|
+
</refactoring-scenario>
|
|
749
|
+
<refactoring-scenario name="separation">
|
|
750
|
+
Mixed concerns that need splitting before adding new functionality
|
|
751
|
+
</refactoring-scenario>
|
|
752
|
+
<refactoring-scenario name="generalization">
|
|
753
|
+
Specific code that could be made reusable by the new implementation
|
|
754
|
+
</refactoring-scenario>
|
|
755
|
+
<refactoring-scenario name="simplification">
|
|
756
|
+
Complex code that could be streamlined
|
|
757
|
+
</refactoring-scenario>
|
|
758
|
+
<refactoring-scenario name="standardization">
|
|
759
|
+
Inconsistent patterns needing alignment before extending
|
|
760
|
+
</refactoring-scenario>
|
|
761
|
+
|
|
762
|
+
Common refactoring scenarios to check:
|
|
763
|
+
- Pattern violations (adding a new type when Strategy pattern should be used)
|
|
764
|
+
- Constants scattered across files (centralize in Domain layer)
|
|
765
|
+
- Model proliferation (extend existing vs. create duplicate)
|
|
766
|
+
- Method duplication (reuse existing methods)
|
|
767
|
+
- Layer violations (business logic in wrong layer)
|
|
768
|
+
- Service sprawl (extend existing services if cohesive)
|
|
769
|
+
- Event handler inconsistencies
|
|
770
|
+
- State management violations
|
|
771
|
+
- API integration inconsistencies
|
|
772
|
+
- Type definition duplication
|
|
773
|
+
|
|
774
|
+
**Even if no refactoring is needed, this section MUST be completed
|
|
775
|
+
with the conclusion "no refactoring required" and justification.**
|
|
776
|
+
</item>
|
|
777
|
+
|
|
778
|
+
<item name="implementation-guidelines" mandatory="true">
|
|
779
|
+
**[MANDATORY] Implementation Guidelines:**
|
|
780
|
+
|
|
781
|
+
- Step-by-step implementation approach following coding standards
|
|
782
|
+
- Optimal architectural placement for new code
|
|
783
|
+
- Interface design for maximum flexibility
|
|
784
|
+
- Dependency management approach (DI registrations)
|
|
785
|
+
- State management strategy
|
|
786
|
+
- Error handling patterns to follow
|
|
787
|
+
- Recommended implementation order
|
|
788
|
+
</item>
|
|
789
|
+
|
|
790
|
+
<item name="testing-strategy" mandatory="true">
|
|
791
|
+
**[MANDATORY] Testing Strategy:**
|
|
792
|
+
|
|
793
|
+
- How to test without breaking existing tests
|
|
794
|
+
- Test patterns to follow (from testing framework doc)
|
|
795
|
+
- Required test types (unit, integration, e2e)
|
|
796
|
+
- Mocking strategies based on existing patterns
|
|
797
|
+
- Edge cases to cover from acceptance criteria
|
|
798
|
+
- Test data patterns to follow
|
|
799
|
+
</item>
|
|
800
|
+
|
|
801
|
+
<item name="risk-mitigation" mandatory="true">
|
|
802
|
+
**[MANDATORY] Risk Mitigation:**
|
|
803
|
+
|
|
804
|
+
- Backward compatibility considerations
|
|
805
|
+
- Migration path for existing functionality
|
|
806
|
+
- What existing functionality might be impacted
|
|
807
|
+
- Performance implications
|
|
808
|
+
- Breaking change risks
|
|
809
|
+
- Rollback strategies if needed
|
|
810
|
+
</item>
|
|
811
|
+
</phase>
|
|
812
|
+
|
|
813
|
+
<phase name="ai-context" order="4">
|
|
814
|
+
<!-- ALL 2 items are MANDATORY -->
|
|
815
|
+
|
|
816
|
+
<item name="complete-findings" mandatory="true">
|
|
817
|
+
**[MANDATORY] Complete Analysis Findings:**
|
|
818
|
+
|
|
819
|
+
Include ALL findings from the deep analysis:
|
|
820
|
+
- Every discovered pattern with file references
|
|
821
|
+
- Every relevant code snippet
|
|
822
|
+
- Every architectural decision
|
|
823
|
+
- Every potential issue
|
|
824
|
+
- Every integration consideration
|
|
825
|
+
|
|
826
|
+
CRITICAL REQUIREMENT: This analysis output will be used as PROMPT CONTEXT
|
|
827
|
+
for the AI agent implementing this feature. Therefore:
|
|
828
|
+
- INCLUDE ALL FINDINGS — don't summarize or omit details
|
|
829
|
+
- PROVIDE COMPLETE CONTEXT — the implementing AI needs every piece of information
|
|
830
|
+
- BE EXPLICIT — don't assume the implementing AI will know anything not stated
|
|
831
|
+
</item>
|
|
832
|
+
|
|
833
|
+
<item name="implementation-references" mandatory="true">
|
|
834
|
+
**[MANDATORY] Implementation References:**
|
|
835
|
+
|
|
836
|
+
- **Internal Documentation**: All relevant internal docs with full paths,
|
|
837
|
+
including architecture diagrams and ADRs
|
|
838
|
+
- **Code References**: All files to study before implementation,
|
|
839
|
+
specific functions/classes as examples, utility functions to reuse
|
|
840
|
+
- **Design Patterns & Best Practices**: Links to pattern documentation
|
|
841
|
+
(e.g., https://refactoring.guru/design-patterns/strategy)
|
|
842
|
+
- **External Resources**: Official docs for libraries used, best practice guides
|
|
843
|
+
- **Domain Knowledge**: All naming conventions, error handling patterns,
|
|
844
|
+
logging standards, performance considerations
|
|
845
|
+
</item>
|
|
846
|
+
</phase>
|
|
847
|
+
|
|
848
|
+
</analysis-process>
|
|
849
|
+
|
|
850
|
+
<validation-checklist>
|
|
851
|
+
<!-- Mark each item as complete before finishing.
|
|
852
|
+
Total: 22 mandatory items — DO NOT PROCEED until ALL are verified.
|
|
853
|
+
|
|
854
|
+
COMMON MISTAKE PREVENTION:
|
|
855
|
+
- Tree structures must show ACTUAL current files, not placeholders
|
|
856
|
+
- Refactoring analysis is required even if conclusion is "no refactoring needed"
|
|
857
|
+
- Integration points must reference actual existing code with file paths
|
|
858
|
+
- Testing strategy must ensure existing tests continue to pass
|
|
859
|
+
- Hardcoded values section MUST have actual code snippets, not descriptions
|
|
860
|
+
- All output goes ONLY to the analysis file — NO GitHub updates -->
|
|
861
|
+
|
|
862
|
+
<category name="file-creation">
|
|
863
|
+
<check>[MANDATORY] Analysis file created at story-directory/integration-analysis.md</check>
|
|
864
|
+
<check>[MANDATORY] Story directory created if it didn't exist</check>
|
|
865
|
+
<check>[MANDATORY] File contains all required sections from template</check>
|
|
866
|
+
</category>
|
|
867
|
+
|
|
868
|
+
<category name="core-analysis">
|
|
869
|
+
<check>[MANDATORY] Tree structure showing current codebase structure</check>
|
|
870
|
+
<check>[MANDATORY] Tree structure showing proposed changes with new files</check>
|
|
871
|
+
<check>[MANDATORY] Architecture compatibility analysis completed (layer-by-layer)</check>
|
|
872
|
+
<check>[MANDATORY] All existing patterns identified with file references</check>
|
|
873
|
+
<check>[MANDATORY] Integration points clearly documented</check>
|
|
874
|
+
<check>[MANDATORY] Impact analysis showing affected components</check>
|
|
875
|
+
</category>
|
|
876
|
+
|
|
877
|
+
<category name="architecture">
|
|
878
|
+
<check>[MANDATORY] Clean Architecture compliance verified</check>
|
|
879
|
+
<check>[MANDATORY] Dependency injection strategy documented</check>
|
|
880
|
+
<check>[MANDATORY] Design patterns identified and documented</check>
|
|
881
|
+
<check>[MANDATORY] Coding standards compliance verified</check>
|
|
882
|
+
<check>[MANDATORY] Testing strategy that preserves existing tests</check>
|
|
883
|
+
</category>
|
|
884
|
+
|
|
885
|
+
<category name="hardcoded-values-critical">
|
|
886
|
+
<check>[MANDATORY & CRITICAL] Searched for hardcoded domain/range values</check>
|
|
887
|
+
<check>[MANDATORY & CRITICAL] Searched for placeholder/TODO comments related to the feature</check>
|
|
888
|
+
<check>[MANDATORY & CRITICAL] Identified ALL renderers/handlers that should use new entity but don't</check>
|
|
889
|
+
<check>[MANDATORY & CRITICAL] Identified ALL manager/service classes with hardcoded defaults</check>
|
|
890
|
+
<check>[MANDATORY & CRITICAL] Found disconnected wiring (entity exists but not injected where needed)</check>
|
|
891
|
+
<check>[MANDATORY & CRITICAL] Section 5 filled with ACTUAL CODE SNIPPETS (not placeholders!)</check>
|
|
892
|
+
<check>[MANDATORY & CRITICAL] Every hardcoded value includes: file path, line number, current code, fix required</check>
|
|
893
|
+
</category>
|
|
894
|
+
</validation-checklist>
|
|
895
|
+
|
|
896
|
+
<guidelines>
|
|
897
|
+
|
|
898
|
+
<guideline name="accuracy-first">
|
|
899
|
+
NO ASSUMPTIONS are tolerated. The analysis must reflect 100% accurate code.
|
|
900
|
+
Only document what you actually find in the code. Never infer behavior
|
|
901
|
+
that isn't explicitly implemented. Every claim must be traceable to
|
|
902
|
+
actual code references with file paths and line numbers.
|
|
903
|
+
</guideline>
|
|
904
|
+
|
|
905
|
+
<guideline name="story-scope">
|
|
906
|
+
Focus exclusively on code paths related to the story.
|
|
907
|
+
Do NOT document the entire codebase — only files, functions,
|
|
908
|
+
and constants that are directly involved in implementing the story's
|
|
909
|
+
functionality as defined by its acceptance criteria.
|
|
910
|
+
</guideline>
|
|
911
|
+
|
|
912
|
+
<guideline name="coding-standards-first">
|
|
913
|
+
STRONG EMPHASIS ON CODING STANDARDS — NO EXCEPTIONS!
|
|
914
|
+
Every proposed change, new file, and integration point must be verified
|
|
915
|
+
against the project's coding standards (from wiki system-wide docs).
|
|
916
|
+
Standards compliance is not optional — it is the primary quality gate.
|
|
917
|
+
</guideline>
|
|
918
|
+
|
|
919
|
+
<guideline name="code-level-depth">
|
|
920
|
+
This is a DEEP TECHNICAL ANALYSIS, not a summary:
|
|
921
|
+
- ACTUAL CODE SNIPPETS must be included, not descriptions
|
|
922
|
+
- COMPLETE FILE PATHS WITH LINE NUMBERS for every reference
|
|
923
|
+
- EXACT INTEGRATION POINTS with specific method signatures
|
|
924
|
+
- NO HIGH-LEVEL SUMMARIES — only detailed, code-level analysis
|
|
925
|
+
|
|
926
|
+
This output will be used as the PRIMARY TECHNICAL REFERENCE for
|
|
927
|
+
implementing this story. Without complete code-level detail, the
|
|
928
|
+
analysis is USELESS.
|
|
929
|
+
</guideline>
|
|
930
|
+
|
|
931
|
+
<guideline name="thoroughness">
|
|
932
|
+
THOROUGH & COMPREHENSIVE: Cover every aspect of the integration.
|
|
933
|
+
100% SUBSTANTIVE: Only include relevant, actionable information.
|
|
934
|
+
TAKE ALL TIME NEEDED: Read EVERY line of relevant code.
|
|
935
|
+
ACCURACY IS PARAMOUNT: This will guide the implementation.
|
|
936
|
+
</guideline>
|
|
937
|
+
|
|
938
|
+
<guideline name="hardcoded-values-critical">
|
|
939
|
+
The hardcoded values discovery is the MOST IMPORTANT section.
|
|
940
|
+
THE #1 REASON INTEGRATION ANALYSES FAIL is identifying what NEW code
|
|
941
|
+
to create but FAILING to identify what EXISTING code must be MODIFIED.
|
|
942
|
+
|
|
943
|
+
For EVERY new entity/service being created:
|
|
944
|
+
1. "What existing code currently does this job (probably poorly/hardcoded)?"
|
|
945
|
+
2. "Where should this entity be INJECTED that it currently ISN'T?"
|
|
946
|
+
3. "What hardcoded values exist that this entity should REPLACE?"
|
|
947
|
+
|
|
948
|
+
This section MUST contain ACTUAL CODE SNIPPETS with file paths and line numbers.
|
|
949
|
+
</guideline>
|
|
950
|
+
|
|
951
|
+
<guideline name="wiki-as-context">
|
|
952
|
+
Wiki documents are the SINGLE SOURCE of codebase knowledge.
|
|
953
|
+
They replace all obsolete separate parameters (sourcecode, high-level-architecture,
|
|
954
|
+
documentation, related-stories-implementations, documented-features).
|
|
955
|
+
Read ALL wiki documents referenced in the story's Relevant Wiki section.
|
|
956
|
+
</guideline>
|
|
957
|
+
|
|
958
|
+
<guideline name="no-github-updates">
|
|
959
|
+
All output is written ONLY to the integration-analysis.md file.
|
|
960
|
+
NO GitHub updates, NO modifications to the story file.
|
|
961
|
+
This is a standalone artifact consumed by pass 5 (technical solution).
|
|
962
|
+
</guideline>
|
|
963
|
+
|
|
964
|
+
<guideline name="github-compatibility">
|
|
965
|
+
The analysis document must render cleanly in GitHub markdown viewers.
|
|
966
|
+
- Use markdown tables (no HTML tables)
|
|
967
|
+
- No custom CSS or HTML styling
|
|
968
|
+
- Code blocks with language hints for syntax highlighting
|
|
969
|
+
- YAML blocks for structured data (hardcoded values, wiring)
|
|
970
|
+
</guideline>
|
|
971
|
+
|
|
972
|
+
<guideline name="refactoring-always-addressed">
|
|
973
|
+
The refactoring section MUST be completed even if the conclusion is
|
|
974
|
+
"no refactoring required." The analysis must explicitly state whether
|
|
975
|
+
refactoring is needed and provide justification either way.
|
|
976
|
+
</guideline>
|
|
977
|
+
|
|
978
|
+
<guideline name="common-mistakes">
|
|
979
|
+
Common mistakes to avoid:
|
|
980
|
+
- Tree structures must show ACTUAL current files, not placeholders
|
|
981
|
+
- Refactoring analysis is required even if "no refactoring needed"
|
|
982
|
+
- Integration points must reference actual existing code with file paths
|
|
983
|
+
- Testing strategy must ensure existing tests continue to pass
|
|
984
|
+
- Hardcoded values section MUST have actual code snippets
|
|
985
|
+
- Don't identify only NEW code — also identify what EXISTING code must CHANGE
|
|
986
|
+
- Don't miss disconnected wiring (entities that exist but aren't injected)
|
|
987
|
+
</guideline>
|
|
988
|
+
|
|
989
|
+
</guidelines>
|
|
990
|
+
|
|
991
|
+
<evolution>
|
|
992
|
+
|
|
993
|
+
**Creation (research-integration-solution — pass 4):**
|
|
994
|
+
This is pass 4 of the story specification pipeline.
|
|
995
|
+
A single run produces the complete integration-analysis.md document.
|
|
996
|
+
All sections must be filled, all checklist items verified.
|
|
997
|
+
|
|
998
|
+
**Consumption (story-technical-solution — pass 5):**
|
|
999
|
+
The integration-analysis.md is consumed as input by pass 5 (technical solution).
|
|
1000
|
+
The technical solution uses insights from this analysis to design the
|
|
1001
|
+
implementation approach — file changes, integration points, refactoring,
|
|
1002
|
+
hardcoded values to replace, testing strategy.
|
|
1003
|
+
|
|
1004
|
+
**Re-analysis (exception, not norm):**
|
|
1005
|
+
Only when the story scope changes significantly or the codebase changes
|
|
1006
|
+
substantially. Re-running overwrites the existing analysis.
|
|
1007
|
+
|
|
1008
|
+
**This analysis does NOT modify the story file.**
|
|
1009
|
+
It lives as a separate artifact in the story directory.
|
|
1010
|
+
The story.xml template has no sections that reference this analysis directly.
|
|
1011
|
+
Only the technical solution (pass 5) consumes it.
|
|
1012
|
+
|
|
1013
|
+
</evolution>
|
|
1014
|
+
|
|
1015
|
+
</integration-solution>
|