@codemcp/workflows 6.0.1 → 6.0.3

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 (138) hide show
  1. package/package.json +3 -2
  2. package/packages/cli/dist/{dist-UGVUJIDN.js → dist-6TO57O6M.js} +3 -2
  3. package/packages/cli/dist/index.js +4 -2
  4. package/packages/cli/package.json +1 -1
  5. package/packages/cli/resources/agents/architect.yaml +61 -0
  6. package/packages/cli/resources/agents/business-analyst.yaml +60 -0
  7. package/packages/cli/resources/agents/developer.yaml +61 -0
  8. package/packages/cli/resources/templates/architecture/arc42/arc42-template-EN.md +1077 -0
  9. package/packages/cli/resources/templates/architecture/arc42/images/01_2_iso-25010-topics-EN.drawio-2023.png +0 -0
  10. package/packages/cli/resources/templates/architecture/arc42/images/01_2_iso-25010-topics-EN.drawio.png +0 -0
  11. package/packages/cli/resources/templates/architecture/arc42/images/05_building_blocks-EN.png +0 -0
  12. package/packages/cli/resources/templates/architecture/arc42/images/08-concepts-EN.drawio.png +0 -0
  13. package/packages/cli/resources/templates/architecture/arc42/images/arc42-logo.png +0 -0
  14. package/packages/cli/resources/templates/architecture/c4.md +224 -0
  15. package/packages/cli/resources/templates/architecture/freestyle.md +53 -0
  16. package/packages/cli/resources/templates/architecture/game.md +250 -0
  17. package/packages/cli/resources/templates/architecture/none.md +17 -0
  18. package/packages/cli/resources/templates/design/comprehensive.md +207 -0
  19. package/packages/cli/resources/templates/design/freestyle.md +37 -0
  20. package/packages/cli/resources/templates/design/game.md +66 -0
  21. package/packages/cli/resources/templates/design/none.md +17 -0
  22. package/packages/cli/resources/templates/requirements/ears.md +90 -0
  23. package/packages/cli/resources/templates/requirements/freestyle.md +42 -0
  24. package/packages/cli/resources/templates/requirements/game.md +162 -0
  25. package/packages/cli/resources/templates/requirements/none.md +17 -0
  26. package/packages/cli/resources/templates/skills/POWER.md +23 -0
  27. package/packages/cli/resources/templates/skills/SKILL.md +19 -0
  28. package/packages/cli/resources/workflows/adr.yaml +157 -0
  29. package/packages/cli/resources/workflows/big-bang-conversion.yaml +592 -0
  30. package/packages/cli/resources/workflows/boundary-testing.yaml +376 -0
  31. package/packages/cli/resources/workflows/bugfix.yaml +177 -0
  32. package/packages/cli/resources/workflows/business-analysis.yaml +597 -0
  33. package/packages/cli/resources/workflows/c4-analysis.yaml +471 -0
  34. package/packages/cli/resources/workflows/epcc.yaml +183 -0
  35. package/packages/cli/resources/workflows/game-beginner.yaml +434 -0
  36. package/packages/cli/resources/workflows/greenfield.yaml +201 -0
  37. package/packages/cli/resources/workflows/minor.yaml +138 -0
  38. package/packages/cli/resources/workflows/posts.yaml +193 -0
  39. package/packages/cli/resources/workflows/sdd-bugfix-crowd.yaml +608 -0
  40. package/packages/cli/resources/workflows/sdd-bugfix.yaml +381 -0
  41. package/packages/cli/resources/workflows/sdd-feature-crowd.yaml +713 -0
  42. package/packages/cli/resources/workflows/sdd-feature.yaml +471 -0
  43. package/packages/cli/resources/workflows/sdd-greenfield-crowd.yaml +336 -0
  44. package/packages/cli/resources/workflows/sdd-greenfield.yaml +463 -0
  45. package/packages/cli/resources/workflows/slides.yaml +237 -0
  46. package/packages/cli/resources/workflows/tdd.yaml +160 -0
  47. package/packages/cli/resources/workflows/waterfall.yaml +209 -0
  48. package/packages/core/package.json +1 -1
  49. package/packages/core/resources/agents/architect.yaml +61 -0
  50. package/packages/core/resources/agents/business-analyst.yaml +60 -0
  51. package/packages/core/resources/agents/developer.yaml +61 -0
  52. package/packages/core/resources/templates/architecture/arc42/arc42-template-EN.md +1077 -0
  53. package/packages/core/resources/templates/architecture/arc42/images/01_2_iso-25010-topics-EN.drawio-2023.png +0 -0
  54. package/packages/core/resources/templates/architecture/arc42/images/01_2_iso-25010-topics-EN.drawio.png +0 -0
  55. package/packages/core/resources/templates/architecture/arc42/images/05_building_blocks-EN.png +0 -0
  56. package/packages/core/resources/templates/architecture/arc42/images/08-concepts-EN.drawio.png +0 -0
  57. package/packages/core/resources/templates/architecture/arc42/images/arc42-logo.png +0 -0
  58. package/packages/core/resources/templates/architecture/c4.md +224 -0
  59. package/packages/core/resources/templates/architecture/freestyle.md +53 -0
  60. package/packages/core/resources/templates/architecture/game.md +250 -0
  61. package/packages/core/resources/templates/architecture/none.md +17 -0
  62. package/packages/core/resources/templates/design/comprehensive.md +207 -0
  63. package/packages/core/resources/templates/design/freestyle.md +37 -0
  64. package/packages/core/resources/templates/design/game.md +66 -0
  65. package/packages/core/resources/templates/design/none.md +17 -0
  66. package/packages/core/resources/templates/requirements/ears.md +90 -0
  67. package/packages/core/resources/templates/requirements/freestyle.md +42 -0
  68. package/packages/core/resources/templates/requirements/game.md +162 -0
  69. package/packages/core/resources/templates/requirements/none.md +17 -0
  70. package/packages/core/resources/templates/skills/POWER.md +23 -0
  71. package/packages/core/resources/templates/skills/SKILL.md +19 -0
  72. package/packages/core/resources/workflows/adr.yaml +157 -0
  73. package/packages/core/resources/workflows/big-bang-conversion.yaml +592 -0
  74. package/packages/core/resources/workflows/boundary-testing.yaml +376 -0
  75. package/packages/core/resources/workflows/bugfix.yaml +177 -0
  76. package/packages/core/resources/workflows/business-analysis.yaml +597 -0
  77. package/packages/core/resources/workflows/c4-analysis.yaml +471 -0
  78. package/packages/core/resources/workflows/epcc.yaml +183 -0
  79. package/packages/core/resources/workflows/game-beginner.yaml +434 -0
  80. package/packages/core/resources/workflows/greenfield.yaml +201 -0
  81. package/packages/core/resources/workflows/minor.yaml +138 -0
  82. package/packages/core/resources/workflows/posts.yaml +193 -0
  83. package/packages/core/resources/workflows/sdd-bugfix-crowd.yaml +608 -0
  84. package/packages/core/resources/workflows/sdd-bugfix.yaml +381 -0
  85. package/packages/core/resources/workflows/sdd-feature-crowd.yaml +713 -0
  86. package/packages/core/resources/workflows/sdd-feature.yaml +471 -0
  87. package/packages/core/resources/workflows/sdd-greenfield-crowd.yaml +336 -0
  88. package/packages/core/resources/workflows/sdd-greenfield.yaml +463 -0
  89. package/packages/core/resources/workflows/slides.yaml +237 -0
  90. package/packages/core/resources/workflows/tdd.yaml +160 -0
  91. package/packages/core/resources/workflows/waterfall.yaml +209 -0
  92. package/packages/docs/package.json +1 -1
  93. package/packages/mcp-server/dist/index.js +3 -2
  94. package/packages/mcp-server/package.json +1 -1
  95. package/packages/mcp-server/resources/agents/architect.yaml +61 -0
  96. package/packages/mcp-server/resources/agents/business-analyst.yaml +60 -0
  97. package/packages/mcp-server/resources/agents/developer.yaml +61 -0
  98. package/packages/mcp-server/resources/templates/architecture/arc42/arc42-template-EN.md +1077 -0
  99. package/packages/mcp-server/resources/templates/architecture/arc42/images/01_2_iso-25010-topics-EN.drawio-2023.png +0 -0
  100. package/packages/mcp-server/resources/templates/architecture/arc42/images/01_2_iso-25010-topics-EN.drawio.png +0 -0
  101. package/packages/mcp-server/resources/templates/architecture/arc42/images/05_building_blocks-EN.png +0 -0
  102. package/packages/mcp-server/resources/templates/architecture/arc42/images/08-concepts-EN.drawio.png +0 -0
  103. package/packages/mcp-server/resources/templates/architecture/arc42/images/arc42-logo.png +0 -0
  104. package/packages/mcp-server/resources/templates/architecture/c4.md +224 -0
  105. package/packages/mcp-server/resources/templates/architecture/freestyle.md +53 -0
  106. package/packages/mcp-server/resources/templates/architecture/game.md +250 -0
  107. package/packages/mcp-server/resources/templates/architecture/none.md +17 -0
  108. package/packages/mcp-server/resources/templates/design/comprehensive.md +207 -0
  109. package/packages/mcp-server/resources/templates/design/freestyle.md +37 -0
  110. package/packages/mcp-server/resources/templates/design/game.md +66 -0
  111. package/packages/mcp-server/resources/templates/design/none.md +17 -0
  112. package/packages/mcp-server/resources/templates/requirements/ears.md +90 -0
  113. package/packages/mcp-server/resources/templates/requirements/freestyle.md +42 -0
  114. package/packages/mcp-server/resources/templates/requirements/game.md +162 -0
  115. package/packages/mcp-server/resources/templates/requirements/none.md +17 -0
  116. package/packages/mcp-server/resources/templates/skills/POWER.md +23 -0
  117. package/packages/mcp-server/resources/templates/skills/SKILL.md +19 -0
  118. package/packages/mcp-server/resources/workflows/adr.yaml +157 -0
  119. package/packages/mcp-server/resources/workflows/big-bang-conversion.yaml +592 -0
  120. package/packages/mcp-server/resources/workflows/boundary-testing.yaml +376 -0
  121. package/packages/mcp-server/resources/workflows/bugfix.yaml +177 -0
  122. package/packages/mcp-server/resources/workflows/business-analysis.yaml +597 -0
  123. package/packages/mcp-server/resources/workflows/c4-analysis.yaml +471 -0
  124. package/packages/mcp-server/resources/workflows/epcc.yaml +183 -0
  125. package/packages/mcp-server/resources/workflows/game-beginner.yaml +434 -0
  126. package/packages/mcp-server/resources/workflows/greenfield.yaml +201 -0
  127. package/packages/mcp-server/resources/workflows/minor.yaml +138 -0
  128. package/packages/mcp-server/resources/workflows/posts.yaml +193 -0
  129. package/packages/mcp-server/resources/workflows/sdd-bugfix-crowd.yaml +608 -0
  130. package/packages/mcp-server/resources/workflows/sdd-bugfix.yaml +381 -0
  131. package/packages/mcp-server/resources/workflows/sdd-feature-crowd.yaml +713 -0
  132. package/packages/mcp-server/resources/workflows/sdd-feature.yaml +471 -0
  133. package/packages/mcp-server/resources/workflows/sdd-greenfield-crowd.yaml +336 -0
  134. package/packages/mcp-server/resources/workflows/sdd-greenfield.yaml +463 -0
  135. package/packages/mcp-server/resources/workflows/slides.yaml +237 -0
  136. package/packages/mcp-server/resources/workflows/tdd.yaml +160 -0
  137. package/packages/mcp-server/resources/workflows/waterfall.yaml +209 -0
  138. package/packages/visualizer/package.json +1 -1
@@ -0,0 +1,471 @@
1
+ # yaml-language-server: $schema=../state-machine-schema.json
2
+ ---
3
+ name: 'c4-analysis'
4
+ description: 'A comprehensive workflow for analyzing legacy systems using C4 methodology. Progressively understand system architecture from context to components, with scope limiting for large codebases.'
5
+ initial_state: 'discovery'
6
+
7
+ # Enhanced metadata for better discoverability
8
+ metadata:
9
+ domain: 'architecture'
10
+ complexity: 'medium'
11
+ bestFor:
12
+ - 'Legacy system analysis'
13
+ - 'System understanding and documentation'
14
+ - 'Architecture discovery'
15
+ - 'Modernization planning'
16
+ useCases:
17
+ - 'Analyze existing codebase for modernization'
18
+ - 'Document undocumented legacy systems'
19
+ - 'Understand system architecture before enhancements'
20
+ examples:
21
+ - 'Analyze a legacy Java monolith for microservices migration'
22
+ - 'Document architecture of inherited Node.js application'
23
+ - 'Understand legacy system before adding new features'
24
+ requiresDocumentation: true
25
+
26
+ # States with default instructions and transitions
27
+ states:
28
+ discovery:
29
+ description: 'Initial system discovery and inventory with scope limiting'
30
+ default_instructions: >
31
+ Create discovery notes file at `$DISCOVERY_FILE` with comprehensive system information.
32
+
33
+ ```markdown
34
+ # Legacy System Discovery Notes
35
+
36
+ *This file serves as long-term memory for the C4 analysis workflow. It contains comprehensive findings and insights that persist across all analysis phases. Progress tracking is handled in the plan file.*
37
+
38
+ ## System Overview
39
+
40
+ ### Technology Stack
41
+ <!-- Record the identified technology stack -->
42
+ - **Primary Language**:
43
+ - **Framework**:
44
+ - **Build System**:
45
+ - **Database**:
46
+ - **Other Technologies**:
47
+
48
+ ### Repository Structure
49
+ <!-- Map the basic folder structure -->
50
+ ```
51
+ project-root/
52
+ ├── src/ # Source code
53
+ ├── docs/ # Documentation (if exists)
54
+ ├── tests/ # Test files
55
+ ├── config/ # Configuration files
56
+ ├── [other folders] # Other significant folders
57
+ └── [key files] # Important root-level files
58
+ ```
59
+
60
+ ### Key Configuration Files
61
+ <!-- List important configuration files found -->
62
+ - **package.json / pom.xml / build.gradle**: Build and dependency configuration
63
+ - **README.md**: Project documentation (if exists)
64
+ - **[Other config files]**: Purpose and significance
65
+
66
+ ## Existing Documentation
67
+ <!-- Record any existing documentation found -->
68
+ - **[Document 1]**: Location and content summary
69
+ - **[Document 2]**: Location and content summary
70
+ - **Documentation Quality**: Assessment of existing docs
71
+
72
+ ## System Architecture Findings
73
+
74
+ ### Context Level (C4 Level 1)
75
+ <!-- System context findings - updated during context analysis phase -->
76
+
77
+ #### External Systems
78
+ - **[External System 1]**: Purpose, communication method, data exchanged
79
+ - **[External System 2]**: Purpose, communication method, data exchanged
80
+
81
+ #### User Types
82
+ - **[User Type 1]**: Role, needs, interaction patterns
83
+ - **[User Type 2]**: Role, needs, interaction patterns
84
+
85
+ #### System Boundaries
86
+ - **Inside the system**: Core components and responsibilities
87
+ - **Outside the system**: External dependencies and interfaces
88
+
89
+ ### Container Level (C4 Level 2)
90
+ <!-- Container architecture findings - updated during container analysis phase -->
91
+
92
+ #### Identified Containers
93
+ - **[Container 1 Name]** - `path/to/container`
94
+ - **Technology**:
95
+ - **Purpose**:
96
+ - **Interfaces**:
97
+ - **Data Storage**:
98
+ - **Communication**: How it communicates with other containers
99
+
100
+ - **[Container 2 Name]** - `path/to/container`
101
+ - **Technology**:
102
+ - **Purpose**:
103
+ - **Interfaces**:
104
+ - **Data Storage**:
105
+ - **Communication**: How it communicates with other containers
106
+
107
+ #### Container Interactions
108
+ - **[Container A] → [Container B]**: Communication method and purpose
109
+ - **[Container B] → [External System]**: Communication method and purpose
110
+
111
+ ### Component Level (C4 Level 3)
112
+ <!-- Component analysis findings - updated during component analysis phase -->
113
+
114
+ #### Container 1 Components
115
+ - **[Component 1.1]** - `path/to/component`
116
+ - **Responsibilities**:
117
+ - **Interfaces**:
118
+ - **Dependencies**:
119
+ - **Design Patterns**:
120
+ - **Key Insights**:
121
+
122
+ - **[Component 1.2]** - `path/to/component`
123
+ - **Responsibilities**:
124
+ - **Interfaces**:
125
+ - **Dependencies**:
126
+ - **Design Patterns**:
127
+ - **Key Insights**:
128
+
129
+ #### Container 2 Components
130
+ - **[Component 2.1]** - `path/to/component`
131
+ - **Responsibilities**:
132
+ - **Interfaces**:
133
+ - **Dependencies**:
134
+ - **Design Patterns**:
135
+ - **Key Insights**:
136
+
137
+ - **[Component 2.2]** - `path/to/component`
138
+ - **Responsibilities**:
139
+ - **Interfaces**:
140
+ - **Dependencies**:
141
+ - **Design Patterns**:
142
+ - **Key Insights**:
143
+
144
+ ## Analysis Insights and Observations
145
+
146
+ ### Discovery Phase Insights
147
+ <!-- Key insights discovered during initial discovery -->
148
+
149
+ ### Context Analysis Insights
150
+ <!-- Important findings about system context and external interfaces -->
151
+
152
+ ### Container Analysis Insights
153
+ <!-- Key architectural insights about container structure and communication -->
154
+
155
+ ### Component Analysis Insights
156
+ <!-- Detailed insights about individual components and their design -->
157
+
158
+ ### Cross-Cutting Concerns
159
+ <!-- Insights that span multiple components or containers -->
160
+ - **Security**:
161
+ - **Performance**:
162
+ - **Data Flow**:
163
+ - **Error Handling**:
164
+
165
+ ## Technical Debt and Improvement Opportunities
166
+
167
+ ### Technical Debt Identified
168
+ <!-- Technical debt discovered during analysis -->
169
+ - **[Debt Item 1]**: Description, impact, and location
170
+ - **[Debt Item 2]**: Description, impact, and location
171
+
172
+ ### Modernization Opportunities
173
+ <!-- Areas identified for potential modernization -->
174
+ - **[Opportunity 1]**: Description, benefits, and approach
175
+ - **[Opportunity 2]**: Description, benefits, and approach
176
+
177
+ ### Architecture Improvements
178
+ <!-- Potential architectural improvements identified -->
179
+ - **[Improvement 1]**: Description, benefits, and implementation approach
180
+ - **[Improvement 2]**: Description, benefits, and implementation approach
181
+
182
+ ## API and Integration Analysis
183
+
184
+ ### External APIs
185
+ <!-- External APIs the system uses or provides -->
186
+ - **[API 1]**: Purpose, technology, testing approach
187
+ - **[API 2]**: Purpose, technology, testing approach
188
+
189
+ ### Internal Interfaces
190
+ <!-- Internal interfaces between components/containers -->
191
+ - **[Interface 1]**: Components involved, communication method
192
+ - **[Interface 2]**: Components involved, communication method
193
+
194
+ ### Testing Strategy Recommendations
195
+ <!-- Recommendations for end-to-end API testing -->
196
+ - **External API Testing**: Approach and tools
197
+ - **Internal Interface Testing**: Approach and tools
198
+ - **Test Data Strategy**: Data management approach
199
+
200
+ ## Questions and Unknowns
201
+
202
+ ### Open Questions
203
+ <!-- Questions that arose during analysis and need investigation -->
204
+ - **[Question 1]**: Description and why it's important
205
+ - **[Question 2]**: Description and why it's important
206
+
207
+ ### Areas Needing Further Investigation
208
+ <!-- Areas that need deeper analysis -->
209
+ - **[Area 1]**: What needs investigation and why
210
+ - **[Area 2]**: What needs investigation and why
211
+
212
+ ## Enhancement Readiness Assessment
213
+
214
+ ### Current State Assessment
215
+ - **Documentation Quality**:
216
+ - **Code Quality**:
217
+ - **Test Coverage**:
218
+ - **Development Environment**:
219
+ - **Deployment Process**:
220
+
221
+ ### Enhancement Recommendations
222
+ - **Immediate Improvements**: Quick wins that would help
223
+ - **Medium-term Enhancements**: Larger improvements to consider
224
+ - **Long-term Modernization**: Strategic modernization opportunities
225
+
226
+ ---
227
+
228
+ ## Instructions for Use
229
+
230
+ **Purpose**: This file serves as the comprehensive long-term memory for the C4 analysis workflow. All findings, insights, and discoveries should be recorded here for future reference.
231
+
232
+ **For the LLM**:
233
+ - **During Discovery**: Fill in system overview, technology stack, and initial architecture sketch
234
+ - **During Context Analysis**: Add context findings to the Context Level section
235
+ - **During Container Analysis**: Document container findings in the Container Level section
236
+ - **During Component Analysis**: Add detailed component analysis to the Component Level section
237
+ - **Throughout**: Add insights, observations, technical debt, and improvement opportunities as discovered
238
+
239
+ **Long-term Memory**: This file preserves all analysis findings and serves as the knowledge base for future development work. Unlike the plan file (which tracks progress), this file maintains the comprehensive understanding of the system.
240
+
241
+ **Reference**: This file should be referenced throughout the workflow and used as input for the final documentation consolidation phase.
242
+
243
+ ---
244
+
245
+ *This discovery file was created during C4 legacy system analysis and serves as the comprehensive long-term memory of all findings, insights, and architectural understanding.*
246
+ ```
247
+
248
+ **SCOPE LIMIT**: Focus ONLY on repository root, main config files, and top-level structure.
249
+
250
+ **STEP 1:** Scan repository root
251
+ - Identify key files (package.json, pom.xml, build.gradle, README.md, etc.)
252
+ - Map basic folder structure (src/, docs/, tests/, config/, etc.)
253
+ - Create hierarchical sketch of potential containers and components
254
+
255
+ **STEP 2:** Identify technology stack
256
+ - Examine configuration files for language, framework, and build system information
257
+ - For Java: Look for Maven/Gradle structure, Spring configuration, package organization
258
+ - For Node.js: Check package.json, identify framework, examine folder structure
259
+
260
+ **STEP 3:** Document findings
261
+ - Record existing documentation files
262
+ - Fill in the DISCOVERY.md template with your findings
263
+ - Update plan file with discovery progress
264
+ - Add discovered containers and components as tasks for later phases
265
+ transitions:
266
+ - trigger: 'continue_discovery'
267
+ to: 'discovery'
268
+ instructions: >
269
+ Expand the repository scan, refine technology stack identification, and enhance the hierarchical sketch of containers and components.
270
+ Update `$DISCOVERY_FILE` with new findings and add newly discovered items to the plan file as tasks for later analysis phases.
271
+ transition_reason: 'Discovery needs more investigation and refinement'
272
+
273
+ - trigger: 'discovery_complete'
274
+ to: 'context_analysis'
275
+ additional_instructions: |
276
+ **STEP 1:** Set up project documents for living documentation
277
+ - Execute: `setup_project_docs({ architecture: "c4", requirements: "none", design: "comprehensive" })`
278
+
279
+ **STEP 2:** Review created documentation files
280
+ - Read `$ARCHITECTURE_DOC` and `$DESIGN_DOC` to understand their structure
281
+
282
+ **STEP 3:** Begin context analysis preparation
283
+ - Review `$DISCOVERY_FILE` findings
284
+ - Prepare to enhance documentation based on discovery findings
285
+ - Continue enhancement throughout context analysis phase
286
+ transition_reason: 'Initial discovery complete, ready for context analysis'
287
+
288
+ context_analysis:
289
+ description: 'System context analysis (C4 Level 1) - boundaries and external interfaces'
290
+ default_instructions: >
291
+ Analyze system context and external interfaces (C4 Level 1). Reference `$DISCOVERY_FILE` for long-term memory.
292
+
293
+ **SCOPE LIMIT**: Focus ONLY on external interfaces and system boundaries.
294
+
295
+ **STEP 1:** Identify external entities
296
+ - Map external systems the legacy system communicates with
297
+ - Catalog user types and personas who interact with the system
298
+ - Document external dependencies (databases, APIs, services)
299
+
300
+ **STEP 2:** Understand boundaries
301
+ - Clarify system boundaries and responsibilities
302
+ - Define what's inside vs outside the system
303
+ - Map data flows between system and external entities
304
+
305
+ **STEP 3:** Enhance living documentation
306
+ - Update `$ARCHITECTURE_DOC` with context findings
307
+ - Update `$DESIGN_DOC` with external interface details
308
+ - Update `$DISCOVERY_FILE` with all context analysis findings
309
+ - Record progress in plan file
310
+ transitions:
311
+ - trigger: 'refine_context'
312
+ to: 'context_analysis'
313
+ instructions: >
314
+ Investigate more external interfaces and clarify system boundaries.
315
+ Refine understanding of external dependencies and update `$DISCOVERY_FILE` and plan file with refined findings.
316
+ transition_reason: 'Context analysis needs further refinement'
317
+
318
+ - trigger: 'need_more_discovery'
319
+ to: 'discovery'
320
+ additional_instructions: 'Context analysis revealed gaps in discovery. Focus on the specific areas identified that need further investigation.'
321
+ transition_reason: 'Context work revealed need for additional discovery'
322
+
323
+ - trigger: 'context_complete'
324
+ to: 'container_analysis'
325
+ additional_instructions: |
326
+ **Plan container analysis documentation** with the user:
327
+ - How to structure analysis files (one file per container or consolidated, folder structure options)
328
+ - Define container factsheet template format
329
+
330
+ Record documentation plan and component analysis template in the development plan file.
331
+ transition_reason: 'System context is understood, ready for container analysis'
332
+
333
+ container_analysis:
334
+ description: 'Container analysis (C4 Level 2) - high-level system architecture'
335
+ default_instructions: >
336
+ Analyze containers and services (C4 Level 2). Reference `$DISCOVERY_FILE` for container sketch and long-term memory.
337
+
338
+ **SCOPE LIMIT**: Focus on major containers, services, and modules only.
339
+
340
+ **STEP 1:** Identify application containers
341
+ - Map main application containers (web app, API, services)
342
+ - Document databases and data stores
343
+ - Understand deployment architecture
344
+
345
+ **STEP 2:** Document communication patterns
346
+ - Map communication pathways between containers
347
+ - Identify protocols and integration methods
348
+ - Record data exchange patterns
349
+
350
+ **STEP 3:** Enhance living documentation
351
+ - Update `$ARCHITECTURE_DOC` with C4 Level 2 findings
352
+ - Update `$DESIGN_DOC` with container interaction details
353
+ - Update `$DISCOVERY_FILE` with container analysis findings
354
+ - Add component analysis tasks to plan file
355
+ transitions:
356
+ - trigger: 'continue_container_analysis'
357
+ to: 'container_analysis'
358
+ instructions: >
359
+ Investigate more containers and refine communication patterns.
360
+ Enhance architectural understanding and update `$DISCOVERY_FILE` and plan file with progress.
361
+ transition_reason: 'Container analysis continues with more containers to analyze'
362
+
363
+ - trigger: 'need_context_refinement'
364
+ to: 'context_analysis'
365
+ additional_instructions: 'Container analysis revealed context issues. Refine system context based on container insights.'
366
+ transition_reason: 'Container work revealed need to refine context understanding'
367
+
368
+ - trigger: 'containers_complete'
369
+ to: 'component_analysis'
370
+ additional_instructions: |
371
+ **Plan component analysis documentation** with the user:
372
+ - How to structure analysis files (one file per component or consolidated format)
373
+ - Define component factsheet template
374
+
375
+ **Record documentation plan** in the development plan file with template format and file creation instructions.
376
+ transition_reason: 'Container architecture is understood, ready for detailed component analysis'
377
+
378
+ component_analysis:
379
+ description: 'Component analysis (C4 Level 3) - detailed component-by-component analysis'
380
+ default_instructions: >
381
+ Analyze components in detail (C4 Level 3). Reference `$DISCOVERY_FILE` for component information and long-term memory.
382
+
383
+ **SCOPE LIMIT**: Analyze ONE component at a time. User selects which components to focus on.
384
+
385
+ **STEP 1:** Deep dive into component
386
+ - Select next component from plan file task list
387
+ - Document responsibilities and interfaces
388
+ - Map internal component relationships and dependencies
389
+
390
+ **STEP 2:** Analyze design patterns
391
+ - Identify and document component-level design patterns
392
+ - Record architectural decisions and rationale
393
+ - Capture key implementation insights
394
+
395
+ **STEP 3:** Enhance living documentation and track progress
396
+ - Update `$DESIGN_DOC` with detailed component analysis
397
+ - Update `$ARCHITECTURE_DOC` with C4 Level 3 details
398
+ - Update `$DISCOVERY_FILE` with component findings
399
+ - Mark component as complete in plan file
400
+ - Ask user which component to analyze next
401
+ transitions:
402
+ - trigger: 'analyze_next_component'
403
+ to: 'component_analysis'
404
+ instructions: >
405
+ Select another component from plan file task list and perform detailed analysis.
406
+ Mark completed component tasks in plan file and ask user for next component selection.
407
+ transition_reason: 'Continuing systematic component analysis'
408
+
409
+ - trigger: 'need_container_refinement'
410
+ to: 'container_analysis'
411
+ additional_instructions: 'Component analysis revealed container issues. Refine container architecture based on component insights.'
412
+ transition_reason: 'Component work revealed need to refine container understanding'
413
+
414
+ - trigger: 'components_complete'
415
+ to: 'documentation_consolidation'
416
+ transition_reason: 'Component analysis complete, ready to consolidate documentation'
417
+
418
+ documentation_consolidation:
419
+ description: 'Consolidate findings into comprehensive documentation'
420
+ default_instructions: >
421
+ Finalize documentation and prepare recommendations. The `$ARCHITECTURE_DOC` and `$DESIGN_DOC` have been enhanced throughout analysis phases.
422
+
423
+ **STEP 1:** Review analysis findings
424
+ - Review `$DISCOVERY_FILE` for all findings and insights
425
+ - Verify completeness of C4 levels (Context, Container, Component)
426
+
427
+ **STEP 2:** Polish living documentation
428
+ - Final review and polish of `$ARCHITECTURE_DOC`
429
+ - Final review and polish of `$DESIGN_DOC`
430
+ - Ensure all C4 levels are comprehensively documented
431
+
432
+ **STEP 3:** Prepare recommendations
433
+ - Document modernization opportunities and technical debt findings
434
+ - Prepare enhancement recommendations based on analysis
435
+ - Finalize API testing strategy recommendations
436
+ - Update plan file with consolidation progress
437
+ transitions:
438
+ - trigger: 'refine_documentation'
439
+ to: 'documentation_consolidation'
440
+ instructions: >
441
+ Enhance architecture and design documentation and add more detail to recommendations.
442
+ Improve consolidation quality and update plan file with progress.
443
+ transition_reason: 'Documentation needs further refinement and enhancement'
444
+
445
+ - trigger: 'need_more_analysis'
446
+ to: 'component_analysis'
447
+ additional_instructions: 'Documentation revealed gaps in component analysis. Focus on the specific components that need more investigation.'
448
+ transition_reason: 'Documentation work revealed need for additional component analysis'
449
+
450
+ - trigger: 'documentation_complete'
451
+ to: 'analysis_complete'
452
+ transition_reason: 'Documentation is complete, analysis finished'
453
+
454
+ analysis_complete:
455
+ description: 'Legacy system analysis complete'
456
+ default_instructions: >
457
+ Legacy system analysis is complete. The system has been thoroughly analyzed using C4 methodology.
458
+
459
+ **Final deliverables:**
460
+ - Comprehensive system documentation (C4-based architecture and design documents)
461
+ - `$DISCOVERY_FILE` with complete analysis findings
462
+ - Enhancement recommendations
463
+ - API testing strategy
464
+ - Modernization roadmap
465
+
466
+ The analysis provides a foundation for future development. Consider using other workflows (waterfall, epcc, etc.) with the comprehensive understanding gained.
467
+ transitions:
468
+ - trigger: 'refine_analysis'
469
+ to: 'component_analysis'
470
+ additional_instructions: 'Refine specific aspects of analysis. Focus on areas that need additional investigation.'
471
+ transition_reason: 'Analysis review revealed need for additional component analysis'
@@ -0,0 +1,183 @@
1
+ # yaml-language-server: $schema=../state-machine-schema.json
2
+ ---
3
+ name: 'epcc'
4
+ description: "A comprehensive development workflow based on Anthropic's best practices: Explore, Plan, Code, Commit - ideal for smaller features and iterative development"
5
+ initial_state: 'explore'
6
+
7
+ # Enhanced metadata for better discoverability
8
+ metadata:
9
+ domain: 'code'
10
+ complexity: 'medium'
11
+ bestFor:
12
+ - 'Medium-sized features'
13
+ - 'Iterative development'
14
+ - 'Research-heavy tasks'
15
+ - 'Exploratory coding'
16
+ useCases:
17
+ - 'Adding a new API endpoint'
18
+ - 'Implementing a new algorithm'
19
+ - 'Integrating a third-party service'
20
+ examples:
21
+ - 'Add user profile management'
22
+ - 'Implement search functionality'
23
+ - 'Create data export feature'
24
+
25
+ # States with default instructions and transitions
26
+ states:
27
+ explore:
28
+ description: 'Research and exploration phase - understanding the problem space'
29
+ default_instructions: |
30
+ Research the codebase to understand existing patterns and gather context about the problem space.
31
+
32
+ - If uncertain about conventions or rules, ask the user about them
33
+ - Read relevant files and documentation
34
+ - If `$REQUIREMENTS_DOC` exists: Understand and document requirements there
35
+ - Otherwise: Document requirements in your task management system
36
+
37
+ Focus on understanding without writing code yet. Document your findings and create tasks as needed.
38
+ transitions:
39
+ - trigger: 'exploration_complete'
40
+ to: 'plan'
41
+ additional_instructions: 'Present the plan to the user, describing the impact of the changes.'
42
+ transition_reason: 'Sufficient understanding gained, ready to create implementation plan'
43
+
44
+ plan:
45
+ description: 'Planning phase - creating a detailed implementation strategy'
46
+ default_instructions: |
47
+ Create a detailed implementation strategy based on your exploration:
48
+
49
+ - If `$REQUIREMENTS_DOC` exists: Base your strategy on requirements from it
50
+ - Otherwise: Use existing task context
51
+
52
+ Break down the work into specific, actionable tasks. Consider edge cases, dependencies, and potential challenges.
53
+
54
+ - If architectural changes needed and `$ARCHITECTURE_DOC` exists: Document in `$ARCHITECTURE_DOC`
55
+ - Otherwise: Create tasks to track architectural decisions
56
+
57
+ - If `$DESIGN_DOC` exists: Adhere to the design in it
58
+ - Otherwise: Elaborate design options and present them to the user
59
+
60
+ Document the planning work thoroughly and create implementation tasks as part of the code phase as needed.
61
+ transitions:
62
+ - trigger: 'need_more_exploration'
63
+ to: 'explore'
64
+ additional_instructions: 'Focus on the specific areas that need clarification and ask the user about needs and preferences.'
65
+ transition_reason: 'Planning work revealed need for more exploration'
66
+
67
+ - trigger: 'plan_complete'
68
+ to: 'code'
69
+ transition_reason: 'Implementation plan is complete and ready for coding'
70
+ review_perspectives:
71
+ - perspective: 'architect'
72
+ prompt: 'Review implementation strategy, design decisions, and integration approach for soundness and maintainability. Ensure the plan aligns with existing system architecture and follows best practices.'
73
+ - perspective: 'security_expert'
74
+ prompt: 'Assess security considerations and potential risks in the planned implementation approach. Review data handling, authentication, and potential vulnerabilities.'
75
+
76
+ - trigger: 'abandon_feature'
77
+ to: 'explore'
78
+ instructions: >
79
+ Feature development abandoned during planning. Return to exploration state for new tasks.
80
+ Task history will remain for future reference.
81
+ additional_instructions: 'Feature development abandoned during planning. Clean up any planning work and prepare for new tasks.'
82
+ transition_reason: 'User decided to abandon feature during planning phase'
83
+
84
+ code:
85
+ description: 'Implementation phase - writing and building the solution'
86
+ default_instructions: |
87
+ Follow your plan to build the solution:
88
+
89
+ - If `$DESIGN_DOC` exists: Follow the design from it
90
+ - Otherwise: Elaborate design options and present them to the user
91
+ - If `$ARCHITECTURE_DOC` exists: Build according to the architecture from it
92
+ - Otherwise: Elaborate architectural options and present them to the user
93
+ - If `$REQUIREMENTS_DOC` exists: Ensure requirements from it are met
94
+ - Otherwise: Ensure existing requirements are met based on your task context
95
+
96
+ Write clean, well-structured code with proper error handling. Prevent regression by building, linting, and executing existing tests. Stay flexible and adapt the plan as you learn more during implementation. Update task progress and create new tasks as needed.
97
+ transitions:
98
+ - trigger: 'need_replanning'
99
+ to: 'plan'
100
+ additional_instructions: "Consider what you've learned during coding and adjust the plan accordingly. Document the changes and reasons."
101
+ transition_reason: 'Implementation work revealed need to revise the plan'
102
+
103
+ - trigger: 'need_more_exploration'
104
+ to: 'explore'
105
+ additional_instructions: 'Focus on the specific areas that are blocking implementation progress.'
106
+ transition_reason: 'Implementation work revealed need for more exploration'
107
+
108
+ - trigger: 'code_complete'
109
+ to: 'commit'
110
+ transition_reason: 'Core implementation is complete, ready for finalization'
111
+ review_perspectives:
112
+ - perspective: 'senior_software_developer'
113
+ prompt: 'Review code quality, best practices, testing coverage, and readiness for production deployment. Ensure the implementation follows coding standards and is maintainable.'
114
+ - perspective: 'performance_engineer'
115
+ prompt: 'Evaluate performance impact, resource efficiency, and scalability of the implemented solution. Check for potential bottlenecks or optimization opportunities.'
116
+
117
+ - trigger: 'abandon_feature'
118
+ to: 'explore'
119
+ instructions: >
120
+ Feature development abandoned during implementation. Clean up any incomplete code and return to exploration.
121
+ Task history and any completed work will remain for future reference.
122
+ additional_instructions: 'Clean up any incomplete code and prepare for new tasks.'
123
+ transition_reason: 'User decided to abandon feature during implementation'
124
+
125
+ commit:
126
+ description: 'Code cleanup and documentation finalization'
127
+ default_instructions: >
128
+ Ensure code quality and documentation accuracy through systematic cleanup and review.
129
+
130
+ **STEP 1: Code Cleanup**
131
+
132
+ Systematically clean up development artifacts:
133
+
134
+ 1. **Remove Debug Output**: Search for and remove all temporary debug output statements used during development.
135
+ Look for language-specific debug output methods (console logging, print statements, debug output functions).
136
+ Remove any debugging statements that were added for development purposes.
137
+
138
+ 2. **Review TODO/FIXME Comments**:
139
+ - Address each TODO/FIXME comment by either implementing the solution or documenting why it's deferred
140
+ - Remove completed TODOs
141
+ - Convert remaining TODOs to proper issue tracking if needed
142
+
143
+ 3. **Remove Debugging Code Blocks**:
144
+ - Remove temporary debugging code, test code blocks, and commented-out code
145
+ - Clean up any experimental code that's no longer needed
146
+ - Ensure proper error handling replaces temporary debug logging
147
+
148
+ **STEP 2: Documentation Review**
149
+
150
+ Review and update documentation to reflect final implementation:
151
+
152
+ 1. **Update Long-Term Memory Documents**: Based on what was actually implemented:
153
+ - If `$REQUIREMENTS_DOC` exists: Update it if requirements changed during development
154
+ - If `$ARCHITECTURE_DOC` exists: Update it if architectural impacts were identified
155
+ - If `$DESIGN_DOC` exists: Update it if design details were refined or changed
156
+ - Otherwise: Document any changes in the plan file
157
+ 2. **Compare Against Implementation**: Review documentation against actual implemented functionality
158
+ 3. **Update Changed Sections**: Only modify documentation sections that have functional changes
159
+ 4. **Remove Development Progress**: Remove references to development iterations, progress notes, and temporary decisions
160
+ 5. **Focus on Final State**: Ensure documentation describes the final implemented state, not the development process
161
+ 6. **Ask User to Review Document Updates**
162
+
163
+ **STEP 3: Final Validation**
164
+
165
+ - Run existing tests to ensure cleanup didn't break functionality
166
+ - Verify documentation accuracy with a final review
167
+ - Ensure code is ready for production/delivery
168
+
169
+ Update task progress and mark completed work as you finalize the feature.
170
+ transitions:
171
+ - trigger: 'need_code_changes'
172
+ to: 'code'
173
+ additional_instructions: 'Focus on the problems identified during final review.'
174
+ transition_reason: 'Final review found issues requiring code changes'
175
+
176
+ - trigger: 'commit_complete'
177
+ to: 'explore'
178
+ transition_reason: 'Feature delivery complete, ready for next task'
179
+
180
+ - trigger: 'abandon_feature'
181
+ to: 'explore'
182
+ additional_instructions: 'Clean up any finalization artifacts and prepare for new tasks.'
183
+ transition_reason: 'User decided to abandon feature during finalization'