agile-context-engineering 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/LICENSE +30 -0
  2. package/README.md +272 -78
  3. package/agents/ace-code-discovery-analyst.md +245 -0
  4. package/agents/ace-code-integration-analyst.md +248 -0
  5. package/agents/ace-code-reviewer.md +375 -0
  6. package/agents/ace-product-owner.md +361 -0
  7. package/agents/ace-project-researcher.md +606 -0
  8. package/agents/ace-research-synthesizer.md +228 -0
  9. package/agents/ace-technical-application-architect.md +287 -0
  10. package/agents/ace-wiki-mapper.md +334 -0
  11. package/agile-context-engineering/src/ace-tools.js +2881 -0
  12. package/agile-context-engineering/src/ace-tools.test.js +1089 -0
  13. package/agile-context-engineering/templates/_command.md +54 -0
  14. package/agile-context-engineering/templates/_workflow.xml +17 -0
  15. package/agile-context-engineering/templates/config.json +0 -0
  16. package/agile-context-engineering/templates/product/external-solution.xml +832 -0
  17. package/agile-context-engineering/templates/product/feature.xml +361 -0
  18. package/agile-context-engineering/templates/product/integration-solution.xml +0 -0
  19. package/agile-context-engineering/templates/product/product-backlog.xml +231 -0
  20. package/agile-context-engineering/templates/product/product-vision.xml +227 -0
  21. package/agile-context-engineering/templates/product/story-integration-solution.xml +1014 -0
  22. package/agile-context-engineering/templates/product/story-technical-solution.xml +1025 -0
  23. package/agile-context-engineering/templates/product/story-wiki.xml +190 -0
  24. package/agile-context-engineering/templates/product/story.xml +451 -0
  25. package/agile-context-engineering/templates/wiki/coding-standards.xml +493 -0
  26. package/agile-context-engineering/templates/wiki/decizions.xml +115 -0
  27. package/agile-context-engineering/templates/wiki/guide.xml +137 -0
  28. package/agile-context-engineering/templates/wiki/module-discovery.xml +174 -0
  29. package/agile-context-engineering/templates/wiki/pattern.xml +159 -0
  30. package/agile-context-engineering/templates/wiki/subsystem-architecture.xml +343 -0
  31. package/agile-context-engineering/templates/wiki/subsystem-structure.xml +235 -0
  32. package/agile-context-engineering/templates/wiki/system-architecture.xml +254 -0
  33. package/agile-context-engineering/templates/wiki/system-cross-cutting.xml +197 -0
  34. package/agile-context-engineering/templates/wiki/system-structure.xml +178 -0
  35. package/agile-context-engineering/templates/wiki/system.xml +381 -0
  36. package/agile-context-engineering/templates/wiki/tech-debt-index.xml +125 -0
  37. package/agile-context-engineering/templates/wiki/testing-framework.xml +283 -0
  38. package/agile-context-engineering/utils/questioning.xml +111 -0
  39. package/agile-context-engineering/utils/ui-formatting.md +300 -0
  40. package/agile-context-engineering/workflows/execute-story.xml +1145 -0
  41. package/agile-context-engineering/workflows/help.xml +540 -0
  42. package/agile-context-engineering/workflows/init-coding-standards.xml +386 -0
  43. package/agile-context-engineering/workflows/map-story.xml +797 -0
  44. package/agile-context-engineering/workflows/map-subsystem.xml +1177 -0
  45. package/agile-context-engineering/workflows/map-system.xml +647 -0
  46. package/agile-context-engineering/workflows/plan-backlog.xml +1356 -0
  47. package/agile-context-engineering/workflows/plan-feature.xml +1495 -0
  48. package/agile-context-engineering/workflows/plan-product-vision.xml +342 -0
  49. package/agile-context-engineering/workflows/plan-story.xml +909 -0
  50. package/agile-context-engineering/workflows/research-external-solution.xml +659 -0
  51. package/agile-context-engineering/workflows/research-integration-solution.xml +712 -0
  52. package/agile-context-engineering/workflows/research-story-wiki.xml +474 -0
  53. package/agile-context-engineering/workflows/research-technical-solution.xml +762 -0
  54. package/agile-context-engineering/workflows/review-story.xml +281 -0
  55. package/bin/install.js +102 -166
  56. package/commands/ace/execute-story.md +137 -0
  57. package/commands/ace/help.md +93 -0
  58. package/commands/ace/init-coding-standards.md +83 -0
  59. package/commands/ace/map-story.md +156 -0
  60. package/commands/ace/map-subsystem.md +138 -0
  61. package/commands/ace/map-system.md +90 -0
  62. package/commands/ace/plan-backlog.md +83 -0
  63. package/commands/ace/plan-feature.md +89 -0
  64. package/commands/ace/plan-product-vision.md +81 -0
  65. package/commands/ace/plan-story.md +145 -0
  66. package/commands/ace/research-external-solution.md +138 -0
  67. package/commands/ace/research-integration-solution.md +135 -0
  68. package/commands/ace/research-story-wiki.md +116 -0
  69. package/commands/ace/research-technical-solution.md +147 -0
  70. package/commands/ace/review-story.md +109 -0
  71. package/package.json +5 -8
  72. package/agents/executor.md +0 -88
  73. package/agents/planner.md +0 -78
  74. package/agents/researcher.md +0 -77
  75. package/agents/verifier.md +0 -116
  76. package/commands/ace-execute-story.md +0 -114
  77. package/commands/ace-init.md +0 -254
  78. package/commands/ace-plan-epic.md +0 -79
  79. package/commands/ace-plan-feature.md +0 -78
  80. package/commands/ace-plan-project.md +0 -205
  81. package/commands/ace-plan-story.md +0 -97
  82. package/commands/ace-refine-story.md +0 -90
  83. package/commands/ace-verify-story.md +0 -127
@@ -0,0 +1,1014 @@
1
+ <integration-solution>
2
+
3
+ <purpose>
4
+ Template for `.ace/artifacts/product/&lt;id-epic_name&gt;/&lt;id-feature_name&gt;/&lt;id-story_name&gt;/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
+ &lt;!-- 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. --&gt;
68
+
69
+ ### Domain Layer
70
+ &lt;!-- 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. --&gt;
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
+ &lt;!-- Use cases, interfaces, DTOs to create.
82
+ How they interact with existing application services.
83
+ Dependency injection registrations needed. --&gt;
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
+ &lt;!-- Services, implementations, repositories required.
91
+ External service integrations.
92
+ How they implement application layer interfaces. --&gt;
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
+ &lt;!-- UI components, API endpoints, view models needed.
100
+ How they connect to application layer.
101
+ User interaction patterns to follow. --&gt;
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
+ &lt;!-- 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. --&gt;
111
+ - [Compliance verification for each proposed change]
112
+ </section>
113
+
114
+ <section name="existing-patterns">
115
+ ## 3. Existing Patterns to Follow
116
+
117
+ &lt;!-- 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. --&gt;
120
+
121
+ ### Similar Implementations
122
+ &lt;!-- Reference existing code that implements similar functionality.
123
+ The new implementation should follow these as examples. --&gt;
124
+ - **[Implementation Name]** at `[file:line-range]` — [what to learn from it]
125
+
126
+ ### Established Conventions
127
+ &lt;!-- Naming patterns, file organization, code structure conventions. --&gt;
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
+ &lt;!-- Which design patterns are already used that must be followed. --&gt;
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
+ &lt;!-- Repeat for each identified pattern --&gt;
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 &amp; 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
+ &lt;!-- 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. --&gt;
165
+
166
+ ### Refactoring Items
167
+
168
+ &lt;!-- 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 --&gt;
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
+ &lt;!-- Repeat for each refactoring item.
195
+ If no refactoring needed, state: "No refactoring required. [justification]." --&gt;
196
+ </section>
197
+
198
+ <section name="hardcoded-values-critical">
199
+ ## 5. CRITICAL: Hardcoded Values &amp; Placeholder Code That MUST Be Replaced
200
+
201
+ &lt;!-- 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. --&gt;
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
+ &lt;!-- Repeat for EACH hardcoded value found --&gt;
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
+ &lt;!-- Repeat for EACH disconnected wiring found --&gt;
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
+ &lt;!-- Repeat for EACH placeholder found --&gt;
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
+ &lt;!-- Repeat for EACH new entity --&gt;
276
+ </section>
277
+
278
+ <section name="integration-points">
279
+ ## 6. Integration Points
280
+
281
+ &lt;!-- All touchpoints between the new implementation and the existing system.
282
+ Categorize by architectural layer and component type. --&gt;
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
+ &lt;!-- Event systems, middleware, DI container, logging, error handling --&gt;
298
+ - [Integration point — cross-cutting concerns this story must respect]
299
+ </section>
300
+
301
+ <section name="impact-analysis">
302
+ ## 7. Impact Analysis
303
+
304
+ &lt;!-- ALL code flows that might be impacted by the new implementation.
305
+ Include specific file references for each impacted flow. --&gt;
306
+
307
+ ### Affected Code Flows
308
+ - **[Flow Name]**: [description of impact] — `[file:line-range]`
309
+
310
+ ### Affected Tests
311
+ &lt;!-- Tests that may need modification due to the new implementation --&gt;
312
+ - `[test-file:line-range]` — [what needs to change and why]
313
+
314
+ ### Affected Documentation
315
+ &lt;!-- Documentation files/wiki docs that may need updates --&gt;
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
+ &lt;!-- 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. --&gt;
332
+
333
+ ```
334
+ [Current relevant file tree]
335
+ ```
336
+
337
+ ### Proposed Structure (With New Files)
338
+ &lt;!-- Tree structure showing what the codebase will look like
339
+ after implementing this story. Mark new files clearly. --&gt;
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
+ &lt;!-- Step-by-step approach following coding standards.
350
+ The implementing agent should follow this order. --&gt;
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
+ &lt;!-- Continue for all implementation steps --&gt;
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
+ &lt;!-- How to test without breaking existing tests.
378
+ Follow the testing framework patterns from wiki. --&gt;
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
+ &lt;!-- 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 --&gt;
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
+ &lt;!-- All relevant internal docs with full paths --&gt;
433
+ - `[path]` — [what to learn from this doc]
434
+
435
+ ### Code References
436
+ &lt;!-- All files that should be studied before implementation --&gt;
437
+ - `[file:line-range]` — [what to learn from this code]
438
+
439
+ ### Design Patterns &amp; Best Practices
440
+ &lt;!-- Links to pattern documentation --&gt;
441
+ - [Pattern Name] — [link to documentation, e.g., refactoring.guru]
442
+
443
+ ### External Resources
444
+ &lt;!-- Official documentation links for libraries used --&gt;
445
+ - [Resource] — [link]
446
+ </section>
447
+
448
+ <section name="ai-implementation-context">
449
+ ## 13. AI Implementation Context
450
+
451
+ &lt;!-- CRITICAL SECTION — This will be the primary context for the implementing AI.
452
+ Everything the implementing agent needs to know in one place. --&gt;
453
+
454
+ ### Domain Knowledge
455
+ - [All domain-specific knowledge the implementing agent needs]
456
+
457
+ ### Constraints &amp; 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
+ &lt;!-- Code snippets from similar implementations that serve as templates --&gt;
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
+ &lt;!-- 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 &amp; Strategy) — MANDATORY
493
+ - Phase 4: ALL 2 items (AI Implementation Context) — MANDATORY
494
+ - Total: 18 mandatory analysis items — SKIP NONE --&gt;
495
+
496
+ <phase name="context-loading" order="1">
497
+ &lt;!-- ALL 4 items are MANDATORY --&gt;
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
+ - **Decisions (ADRs)**: Architecture decisions that constrain design
530
+ - **Architecture**: Subsystem architecture documents
531
+
532
+ Read EVERY document. These replace the obsolete command's separate parameters:
533
+ - sourcecode → system-structure.md (high-level tree)
534
+ - high-level-architecture → system-architecture.md
535
+ - documentation → all wiki documents combined
536
+ - related-stories-implementations → wiki documents capture story knowledge
537
+ - documented-features → wiki documents catalog feature implementations
538
+ </item>
539
+
540
+ <item name="load-external-analysis" mandatory="true">
541
+ **[MANDATORY] Check and load external analysis if available:**
542
+ - Automatically check for `{STORY_DIR}/external-analysis.md`
543
+ - This is the artifact from pass 3 (`/ace:research-external-solution`)
544
+ - If present, study it for:
545
+ - How industry-standard systems implement this functionality
546
+ - Algorithms and formulas to reuse
547
+ - Design patterns from external implementations
548
+ - Best practices that should inform our integration
549
+ - If not present, proceed without — note this in the analysis
550
+ </item>
551
+
552
+ <item name="load-feature-document" mandatory="true">
553
+ **[MANDATORY] Load the parent feature document:**
554
+ - The feature file path can be extracted from the story metadata
555
+ - Understand the feature planning context
556
+ - Identify how this story fits within the broader feature
557
+ - Identify dependencies and integration points with other stories
558
+ - If not found, proceed without — the analysis can still be done
559
+ </item>
560
+ </phase>
561
+
562
+ <phase name="deep-codebase-analysis" order="2">
563
+ &lt;!-- ALL 8 items are MANDATORY — skip NONE --&gt;
564
+
565
+ <item name="architecture-compatibility" mandatory="true">
566
+ **[MANDATORY] Architecture Compatibility Analysis:**
567
+
568
+ Map how the new story fits into Clean Architecture layers:
569
+
570
+ - **Domain Layer**: New entities, value objects, constants needed.
571
+ How they relate to existing domain objects. Domain events needed.
572
+ - **Application Layer**: Use cases and interfaces to create.
573
+ How they interact with existing application services. DI registrations.
574
+ - **Infrastructure Layer**: Services and implementations required.
575
+ External service integrations. How they implement application interfaces.
576
+ - **Presentation Layer**: UI components and API endpoints needed.
577
+ How they connect to application layer. User interaction patterns.
578
+
579
+ Verify Clean Architecture compliance:
580
+ - Dependencies point inward toward domain
581
+ - Each layer knows only about inner layers
582
+ - Depend on abstractions, not concretions
583
+ - All business logic independently testable
584
+ </item>
585
+
586
+ <item name="pattern-recognition" mandatory="true">
587
+ **[MANDATORY] Pattern Recognition &amp; Existing Patterns:**
588
+
589
+ Search for similar features/patterns in the codebase and reference them
590
+ with specific file paths and line numbers:
591
+
592
+ - **Similar Implementations**: Find existing code that does something similar
593
+ - **Naming Conventions**: Document exact naming patterns with examples
594
+ - **Design Patterns**: Catalog patterns in use (Strategy, Factory, Observer, etc.)
595
+ - **Error Handling**: Document error handling approaches with code references
596
+ - **Logging**: Document logging approaches
597
+ - **Constants Organization**: How constants are organized and where to add new ones
598
+ </item>
599
+
600
+ <item name="integration-points" mandatory="true">
601
+ **[MANDATORY] Integration Point Discovery (Layer-by-Layer):**
602
+
603
+ Examine each architectural layer for integration opportunities:
604
+
605
+ - **Domain Layer**: Entity extensions, value objects, business rules
606
+ - **Application Layer**: Service interfaces, use cases, DTOs
607
+ - **Infrastructure Layer**: Repository patterns, external services
608
+ - **Presentation Layer**: UI components, view models, controllers
609
+
610
+ Find:
611
+ - Existing interfaces that can be extended
612
+ - Abstract classes available for inheritance
613
+ - Event systems for loose coupling
614
+ - Middleware or pipeline patterns
615
+ - Plugin or extension points
616
+ - Configuration-based feature toggles
617
+ - DI container registrations needed
618
+ </item>
619
+
620
+ <item name="file-dependencies" mandatory="true">
621
+ **[MANDATORY] File Dependency Analysis:**
622
+
623
+ - Identify ALL files that will be referenced or modified
624
+ - Document supporting files for the new implementation
625
+ - Map import chains and dependency graphs
626
+ - Identify potential circular dependency risks
627
+ - List all current files that will support the new implementation
628
+ </item>
629
+
630
+ <item name="convention-compliance" mandatory="true">
631
+ **[MANDATORY] Convention Compliance Analysis:**
632
+
633
+ - Document existing conventions that MUST be followed
634
+ - Verify the new implementation doesn't violate CODING STANDARDS
635
+ - Check naming conventions, file organization, error handling
636
+ - Verify SOLID principles compliance
637
+ - Verify Clean Architecture layer boundaries
638
+ </item>
639
+
640
+ <item name="testing-patterns" mandatory="true">
641
+ **[MANDATORY] Testing Pattern Analysis:**
642
+
643
+ - Analyze current test patterns for consistent validation approach
644
+ - Identify test utilities and helpers available for reuse
645
+ - Document testing conventions (unit, integration, e2e)
646
+ - Identify tests that need modification due to the new implementation
647
+ - Extract mocking strategies used
648
+ </item>
649
+
650
+ <item name="hardcoded-values-discovery" mandatory="true">
651
+ **[MANDATORY] CRITICAL: Hardcoded Values &amp; Placeholder Code Discovery:**
652
+
653
+ THIS IS THE MOST CRITICAL PART OF THE INTEGRATION ANALYSIS!
654
+
655
+ When a new story implements a feature, there are ALWAYS existing hardcoded
656
+ values or placeholder implementations that the new feature is MEANT TO REPLACE.
657
+
658
+ YOU MUST EXHAUSTIVELY SEARCH FOR:
659
+
660
+ <search-category name="hardcoded-domain-values">
661
+ **Hardcoded Domain/Range Values:**
662
+ - Search for hardcoded number ranges, dimensions, colors, sizes, offsets
663
+ - Search for values that should come from the new entity/service
664
+ - Grep patterns: `domain\(\[`, `= 0;`, `= 100`, `MIN_`, `MAX_`, `DEFAULT_`
665
+ </search-category>
666
+
667
+ <search-category name="placeholder-stubs">
668
+ **Placeholder/Stub Implementations:**
669
+ - Search for TODO comments mentioning the feature being implemented
670
+ - Search for "temporary", "placeholder", "stub", "mock" in comments
671
+ - Search for methods returning hardcoded values instead of computed ones
672
+ - Grep patterns: `TODO`, `TEMPORARY`, `placeholder`, `HARDCODED`
673
+ </search-category>
674
+
675
+ <search-category name="disconnected-wiring">
676
+ **Disconnected Wiring:**
677
+ - Classes/services that EXIST but are NOT USED where they should be
678
+ - Find where the NEW entity/service SHOULD be injected but currently isn't
679
+ - For every new entity/service, ask:
680
+ - "What existing code currently does this job?"
681
+ - "Where should this entity be INJECTED?"
682
+ - "What hardcoded values exist that this entity should REPLACE?"
683
+ </search-category>
684
+
685
+ <search-category name="inline-calculations">
686
+ **Inline Calculations That Should Use New Service:**
687
+ - Inline calculations done manually instead of using the new entity
688
+ - Duplicate calculation logic across multiple files
689
+ - Grep patterns: `Math.min`, `Math.max`, inline formulas
690
+ </search-category>
691
+
692
+ <search-category name="manager-service-defaults">
693
+ **Manager/Service Classes with Hardcoded Defaults:**
694
+ - Manager/service classes initializing with dummy values
695
+ - These MUST be updated to receive values from the new entity
696
+ - Search: `*Manager`, `*Service` classes in Infrastructure layer
697
+ </search-category>
698
+
699
+ <search-category name="renderers-not-using-entity">
700
+ **Renderers/Handlers Not Using New Entity:**
701
+ - When implementing a new feature, ALL relevant renderers/handlers must be checked
702
+ - Verify they use the new entity instead of hardcoded values
703
+ - Search: `*Renderer`, `*Handler`, `*Controller` classes
704
+ </search-category>
705
+
706
+ Output format for EACH discovered item:
707
+ ```yaml
708
+ FILE: [exact file path]
709
+ LINE: [line number(s)]
710
+ CURRENT CODE: |
711
+ [actual code snippet from the file]
712
+ PROBLEM: [why this is wrong]
713
+ SHOULD BE: [what it should become after implementation]
714
+ FIX REQUIRED: [specific action to take]
715
+ ```
716
+
717
+ CRITICAL: This section MUST be filled with ACTUAL CODE SNIPPETS from the codebase!
718
+ The implementing AI agent NEEDS to know EXACTLY what to change and WHERE.
719
+ </item>
720
+
721
+ <item name="impact-analysis" mandatory="true">
722
+ **[MANDATORY] Impact Analysis:**
723
+
724
+ - Discover ALL code flows that might be impacted by the new implementation
725
+ - Include specific file references for each impacted flow
726
+ - Identify tests that need modification (include file paths)
727
+ - Document documentation files/flows requiring updates
728
+ - Assess performance implications
729
+ - Identify breaking change risks
730
+ </item>
731
+ </phase>
732
+
733
+ <phase name="refactoring-strategy" order="3">
734
+ &lt;!-- ALL 4 items are MANDATORY --&gt;
735
+
736
+ <item name="refactoring-requirements" mandatory="true">
737
+ **[MANDATORY] Refactoring Requirements:**
738
+
739
+ Determine if existing code needs refactoring for the new implementation
740
+ to be MAINTAINABLE / EXTENSIBLE. Check for:
741
+
742
+ <refactoring-scenario name="consolidation">
743
+ Duplicate code that should be unified before adding more
744
+ </refactoring-scenario>
745
+ <refactoring-scenario name="abstraction">
746
+ Concrete implementations that need interfaces for extensibility
747
+ </refactoring-scenario>
748
+ <refactoring-scenario name="separation">
749
+ Mixed concerns that need splitting before adding new functionality
750
+ </refactoring-scenario>
751
+ <refactoring-scenario name="generalization">
752
+ Specific code that could be made reusable by the new implementation
753
+ </refactoring-scenario>
754
+ <refactoring-scenario name="simplification">
755
+ Complex code that could be streamlined
756
+ </refactoring-scenario>
757
+ <refactoring-scenario name="standardization">
758
+ Inconsistent patterns needing alignment before extending
759
+ </refactoring-scenario>
760
+
761
+ Common refactoring scenarios to check:
762
+ - Pattern violations (adding a new type when Strategy pattern should be used)
763
+ - Constants scattered across files (centralize in Domain layer)
764
+ - Model proliferation (extend existing vs. create duplicate)
765
+ - Method duplication (reuse existing methods)
766
+ - Layer violations (business logic in wrong layer)
767
+ - Service sprawl (extend existing services if cohesive)
768
+ - Event handler inconsistencies
769
+ - State management violations
770
+ - API integration inconsistencies
771
+ - Type definition duplication
772
+
773
+ **Even if no refactoring is needed, this section MUST be completed
774
+ with the conclusion "no refactoring required" and justification.**
775
+ </item>
776
+
777
+ <item name="implementation-guidelines" mandatory="true">
778
+ **[MANDATORY] Implementation Guidelines:**
779
+
780
+ - Step-by-step implementation approach following coding standards
781
+ - Optimal architectural placement for new code
782
+ - Interface design for maximum flexibility
783
+ - Dependency management approach (DI registrations)
784
+ - State management strategy
785
+ - Error handling patterns to follow
786
+ - Recommended implementation order
787
+ </item>
788
+
789
+ <item name="testing-strategy" mandatory="true">
790
+ **[MANDATORY] Testing Strategy:**
791
+
792
+ - How to test without breaking existing tests
793
+ - Test patterns to follow (from testing framework doc)
794
+ - Required test types (unit, integration, e2e)
795
+ - Mocking strategies based on existing patterns
796
+ - Edge cases to cover from acceptance criteria
797
+ - Test data patterns to follow
798
+ </item>
799
+
800
+ <item name="risk-mitigation" mandatory="true">
801
+ **[MANDATORY] Risk Mitigation:**
802
+
803
+ - Backward compatibility considerations
804
+ - Migration path for existing functionality
805
+ - What existing functionality might be impacted
806
+ - Performance implications
807
+ - Breaking change risks
808
+ - Rollback strategies if needed
809
+ </item>
810
+ </phase>
811
+
812
+ <phase name="ai-context" order="4">
813
+ &lt;!-- ALL 2 items are MANDATORY --&gt;
814
+
815
+ <item name="complete-findings" mandatory="true">
816
+ **[MANDATORY] Complete Analysis Findings:**
817
+
818
+ Include ALL findings from the deep analysis:
819
+ - Every discovered pattern with file references
820
+ - Every relevant code snippet
821
+ - Every architectural decision
822
+ - Every potential issue
823
+ - Every integration consideration
824
+
825
+ CRITICAL REQUIREMENT: This analysis output will be used as PROMPT CONTEXT
826
+ for the AI agent implementing this feature. Therefore:
827
+ - INCLUDE ALL FINDINGS — don't summarize or omit details
828
+ - PROVIDE COMPLETE CONTEXT — the implementing AI needs every piece of information
829
+ - BE EXPLICIT — don't assume the implementing AI will know anything not stated
830
+ </item>
831
+
832
+ <item name="implementation-references" mandatory="true">
833
+ **[MANDATORY] Implementation References:**
834
+
835
+ - **Internal Documentation**: All relevant internal docs with full paths,
836
+ including architecture diagrams and ADRs
837
+ - **Code References**: All files to study before implementation,
838
+ specific functions/classes as examples, utility functions to reuse
839
+ - **Design Patterns &amp; Best Practices**: Links to pattern documentation
840
+ (e.g., https://refactoring.guru/design-patterns/strategy)
841
+ - **External Resources**: Official docs for libraries used, best practice guides
842
+ - **Domain Knowledge**: All naming conventions, error handling patterns,
843
+ logging standards, performance considerations
844
+ </item>
845
+ </phase>
846
+
847
+ </analysis-process>
848
+
849
+ <validation-checklist>
850
+ &lt;!-- Mark each item as complete before finishing.
851
+ Total: 22 mandatory items — DO NOT PROCEED until ALL are verified.
852
+
853
+ COMMON MISTAKE PREVENTION:
854
+ - Tree structures must show ACTUAL current files, not placeholders
855
+ - Refactoring analysis is required even if conclusion is "no refactoring needed"
856
+ - Integration points must reference actual existing code with file paths
857
+ - Testing strategy must ensure existing tests continue to pass
858
+ - Hardcoded values section MUST have actual code snippets, not descriptions
859
+ - All output goes ONLY to the analysis file — NO GitHub updates --&gt;
860
+
861
+ <category name="file-creation">
862
+ <check>[MANDATORY] Analysis file created at story-directory/integration-analysis.md</check>
863
+ <check>[MANDATORY] Story directory created if it didn't exist</check>
864
+ <check>[MANDATORY] File contains all required sections from template</check>
865
+ </category>
866
+
867
+ <category name="core-analysis">
868
+ <check>[MANDATORY] Tree structure showing current codebase structure</check>
869
+ <check>[MANDATORY] Tree structure showing proposed changes with new files</check>
870
+ <check>[MANDATORY] Architecture compatibility analysis completed (layer-by-layer)</check>
871
+ <check>[MANDATORY] All existing patterns identified with file references</check>
872
+ <check>[MANDATORY] Integration points clearly documented</check>
873
+ <check>[MANDATORY] Impact analysis showing affected components</check>
874
+ </category>
875
+
876
+ <category name="architecture">
877
+ <check>[MANDATORY] Clean Architecture compliance verified</check>
878
+ <check>[MANDATORY] Dependency injection strategy documented</check>
879
+ <check>[MANDATORY] Design patterns identified and documented</check>
880
+ <check>[MANDATORY] Coding standards compliance verified</check>
881
+ <check>[MANDATORY] Testing strategy that preserves existing tests</check>
882
+ </category>
883
+
884
+ <category name="hardcoded-values-critical">
885
+ <check>[MANDATORY &amp; CRITICAL] Searched for hardcoded domain/range values</check>
886
+ <check>[MANDATORY &amp; CRITICAL] Searched for placeholder/TODO comments related to the feature</check>
887
+ <check>[MANDATORY &amp; CRITICAL] Identified ALL renderers/handlers that should use new entity but don't</check>
888
+ <check>[MANDATORY &amp; CRITICAL] Identified ALL manager/service classes with hardcoded defaults</check>
889
+ <check>[MANDATORY &amp; CRITICAL] Found disconnected wiring (entity exists but not injected where needed)</check>
890
+ <check>[MANDATORY &amp; CRITICAL] Section 5 filled with ACTUAL CODE SNIPPETS (not placeholders!)</check>
891
+ <check>[MANDATORY &amp; CRITICAL] Every hardcoded value includes: file path, line number, current code, fix required</check>
892
+ </category>
893
+ </validation-checklist>
894
+
895
+ <guidelines>
896
+
897
+ <guideline name="accuracy-first">
898
+ NO ASSUMPTIONS are tolerated. The analysis must reflect 100% accurate code.
899
+ Only document what you actually find in the code. Never infer behavior
900
+ that isn't explicitly implemented. Every claim must be traceable to
901
+ actual code references with file paths and line numbers.
902
+ </guideline>
903
+
904
+ <guideline name="story-scope">
905
+ Focus exclusively on code paths related to the story.
906
+ Do NOT document the entire codebase — only files, functions,
907
+ and constants that are directly involved in implementing the story's
908
+ functionality as defined by its acceptance criteria.
909
+ </guideline>
910
+
911
+ <guideline name="coding-standards-first">
912
+ STRONG EMPHASIS ON CODING STANDARDS — NO EXCEPTIONS!
913
+ Every proposed change, new file, and integration point must be verified
914
+ against the project's coding standards (from wiki system-wide docs).
915
+ Standards compliance is not optional — it is the primary quality gate.
916
+ </guideline>
917
+
918
+ <guideline name="code-level-depth">
919
+ This is a DEEP TECHNICAL ANALYSIS, not a summary:
920
+ - ACTUAL CODE SNIPPETS must be included, not descriptions
921
+ - COMPLETE FILE PATHS WITH LINE NUMBERS for every reference
922
+ - EXACT INTEGRATION POINTS with specific method signatures
923
+ - NO HIGH-LEVEL SUMMARIES — only detailed, code-level analysis
924
+
925
+ This output will be used as the PRIMARY TECHNICAL REFERENCE for
926
+ implementing this story. Without complete code-level detail, the
927
+ analysis is USELESS.
928
+ </guideline>
929
+
930
+ <guideline name="thoroughness">
931
+ THOROUGH &amp; COMPREHENSIVE: Cover every aspect of the integration.
932
+ 100% SUBSTANTIVE: Only include relevant, actionable information.
933
+ TAKE ALL TIME NEEDED: Read EVERY line of relevant code.
934
+ ACCURACY IS PARAMOUNT: This will guide the implementation.
935
+ </guideline>
936
+
937
+ <guideline name="hardcoded-values-critical">
938
+ The hardcoded values discovery is the MOST IMPORTANT section.
939
+ THE #1 REASON INTEGRATION ANALYSES FAIL is identifying what NEW code
940
+ to create but FAILING to identify what EXISTING code must be MODIFIED.
941
+
942
+ For EVERY new entity/service being created:
943
+ 1. "What existing code currently does this job (probably poorly/hardcoded)?"
944
+ 2. "Where should this entity be INJECTED that it currently ISN'T?"
945
+ 3. "What hardcoded values exist that this entity should REPLACE?"
946
+
947
+ This section MUST contain ACTUAL CODE SNIPPETS with file paths and line numbers.
948
+ </guideline>
949
+
950
+ <guideline name="wiki-as-context">
951
+ Wiki documents are the SINGLE SOURCE of codebase knowledge.
952
+ They replace all obsolete separate parameters (sourcecode, high-level-architecture,
953
+ documentation, related-stories-implementations, documented-features).
954
+ Read ALL wiki documents referenced in the story's Relevant Wiki section.
955
+ </guideline>
956
+
957
+ <guideline name="no-github-updates">
958
+ All output is written ONLY to the integration-analysis.md file.
959
+ NO GitHub updates, NO modifications to the story file.
960
+ This is a standalone artifact consumed by pass 5 (technical solution).
961
+ </guideline>
962
+
963
+ <guideline name="github-compatibility">
964
+ The analysis document must render cleanly in GitHub markdown viewers.
965
+ - Use markdown tables (no HTML tables)
966
+ - No custom CSS or HTML styling
967
+ - Code blocks with language hints for syntax highlighting
968
+ - YAML blocks for structured data (hardcoded values, wiring)
969
+ </guideline>
970
+
971
+ <guideline name="refactoring-always-addressed">
972
+ The refactoring section MUST be completed even if the conclusion is
973
+ "no refactoring required." The analysis must explicitly state whether
974
+ refactoring is needed and provide justification either way.
975
+ </guideline>
976
+
977
+ <guideline name="common-mistakes">
978
+ Common mistakes to avoid:
979
+ - Tree structures must show ACTUAL current files, not placeholders
980
+ - Refactoring analysis is required even if "no refactoring needed"
981
+ - Integration points must reference actual existing code with file paths
982
+ - Testing strategy must ensure existing tests continue to pass
983
+ - Hardcoded values section MUST have actual code snippets
984
+ - Don't identify only NEW code — also identify what EXISTING code must CHANGE
985
+ - Don't miss disconnected wiring (entities that exist but aren't injected)
986
+ </guideline>
987
+
988
+ </guidelines>
989
+
990
+ <evolution>
991
+
992
+ **Creation (research-integration-solution — pass 4):**
993
+ This is pass 4 of the story specification pipeline.
994
+ A single run produces the complete integration-analysis.md document.
995
+ All sections must be filled, all checklist items verified.
996
+
997
+ **Consumption (story-technical-solution — pass 5):**
998
+ The integration-analysis.md is consumed as input by pass 5 (technical solution).
999
+ The technical solution uses insights from this analysis to design the
1000
+ implementation approach — file changes, integration points, refactoring,
1001
+ hardcoded values to replace, testing strategy.
1002
+
1003
+ **Re-analysis (exception, not norm):**
1004
+ Only when the story scope changes significantly or the codebase changes
1005
+ substantially. Re-running overwrites the existing analysis.
1006
+
1007
+ **This analysis does NOT modify the story file.**
1008
+ It lives as a separate artifact in the story directory.
1009
+ The story.xml template has no sections that reference this analysis directly.
1010
+ Only the technical solution (pass 5) consumes it.
1011
+
1012
+ </evolution>
1013
+
1014
+ </integration-solution>