@codemcp/workflows-core 5.2.1 → 5.2.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.
@@ -27,12 +27,17 @@ states:
27
27
  explore:
28
28
  description: 'Research and exploration phase - understanding the problem space and codebase'
29
29
  default_instructions: |
30
- You are in the TDD exploration phase.
31
- Your main objective now is to gather context about what needs to be developed. Focus on the WHY and WHAT, not the HOW.
32
- Research the codebase, understand existing patterns,
33
- If you are not certain about conventions or rules, ask the user about them.
34
- Read relevant files and documentation. If $REQUIREMENTS_DOC exists, understand and document requirements there, otherwise document them in your task management system.
35
- Don't write code or tests yet - focus on understanding. Document your findings and create tasks as needed.
30
+ **STEP 1:** Gather context about what needs to be developed. Focus on the WHY and WHAT, not the HOW.
31
+
32
+ **STEP 2:** Research the codebase and understand existing patterns.
33
+ - Ask the user about conventions or rules if uncertain
34
+ - Read relevant files and documentation
35
+ - If `$REQUIREMENTS_DOC` exists, understand and document requirements there, otherwise document in your task management system
36
+
37
+ **STEP 3:** Document your findings and create tasks as needed.
38
+ - Don't write code or tests yet
39
+ - Focus on understanding the problem space
40
+ - Prepare for the RED phase of the TDD cycle
36
41
  transitions:
37
42
  - trigger: 'exploration_complete'
38
43
  to: 'red'
@@ -50,19 +55,23 @@ states:
50
55
  red:
51
56
  description: 'RED phase - Write a failing test that defines the expected behavior'
52
57
  default_instructions: |
53
- You are in the RED phase of TDD. Write a failing test that defines the expected behavior.
54
-
55
- **CRITICAL QUALITY GATE**: Before writing the test, ask the user about:
56
- 1. What type of test is appropriate (unit, integration, acceptance, etc.)
57
- 2. Validate with the user that your test actually tests what needs to be developed
58
-
59
- Write a test that:
60
- - Clearly defines the expected behavior
61
- - Will fail initially (since the functionality doesn't exist yet)
62
- - Is specific and focused on one aspect of the functionality
63
- - Uses appropriate assertions (not assert(true) or similar meaningless checks)
64
-
65
- Run the test to confirm it fails for the right reason. Document the test and update task progress as needed.
58
+ Write a failing test that defines the expected behavior for the feature.
59
+
60
+ **STEP 1:** Validate test approach with the user before writing.
61
+ - Determine what type of test is appropriate (unit, integration, acceptance, etc.)
62
+ - Confirm your test will validate the actual requirements
63
+ - Ensure alignment with the feature specification
64
+
65
+ **STEP 2:** Write a focused, meaningful test.
66
+ - Clearly define the expected behavior
67
+ - Will fail initially since functionality doesn't exist yet
68
+ - Focus on one specific aspect of the functionality
69
+ - Use appropriate assertions (not meaningless checks like assert(true))
70
+
71
+ **STEP 3:** Validate test failure.
72
+ - Run the test to confirm it fails for the right reason
73
+ - Document the test and expected failure mode
74
+ - Update task progress
66
75
  transitions:
67
76
  - trigger: 'test_written_and_failing'
68
77
  to: 'green'
@@ -81,22 +90,23 @@ states:
81
90
  green:
82
91
  description: 'GREEN phase - Write only the necessary code to make the test pass'
83
92
  default_instructions: |
84
- You are in the GREEN phase of TDD. Write only the necessary code to make the failing test pass with a proper implementation.
85
-
86
- **CRITICAL QUALITY GATE**: Verify your implementation has NO dirty hacks such as:
87
- - assert(true) or similar meaningless assertions
88
- - Hardcoded return values that don't represent real logic
89
- - Shortcuts that bypass the actual functionality
90
- - Copy-paste code without understanding
91
-
92
- Focus on:
93
- - Making the test pass with real, working code
94
- - Writing only what's necessary (no over-engineering)
95
- - Ensuring the solution actually solves the problem
96
- - Implementing proper logic, not shortcuts
97
- - Running the test to confirm it passes
98
-
99
- Document your implementation approach and update task progress as needed.
93
+ Implement the necessary code to make the failing test pass with proper functionality.
94
+
95
+ **STEP 1:** Write real, working implementation.
96
+ - Make the test pass with actual logic, not shortcuts
97
+ - Write only what's necessary (no over-engineering)
98
+ - Avoid dirty hacks such as hardcoded return values or meaningless assertions
99
+ - Focus on solving the actual problem
100
+
101
+ **STEP 2:** Validate implementation quality.
102
+ - Run the test to confirm it passes
103
+ - Verify no shortcuts or copy-paste code without understanding
104
+ - Ensure the solution actually solves the problem
105
+ - Check that logic is proper, not a bypass
106
+
107
+ **STEP 3:** Document and track progress.
108
+ - Document your implementation approach
109
+ - Update task progress
100
110
  transitions:
101
111
  - trigger: 'test_passing'
102
112
  to: 'refactor'
@@ -119,23 +129,24 @@ states:
119
129
  refactor:
120
130
  description: 'REFACTOR phase - Improve code quality while keeping tests green (cleanup phase)'
121
131
  default_instructions: |
122
- You are in the REFACTOR phase of TDD. This is the cleanup phase - improve code quality while keeping all tests green.
132
+ Improve code quality while keeping all tests green. This is the cleanup phase where you enhance readability and maintainability.
123
133
 
124
- Focus on:
125
- - Removing code duplication
126
- - Improving variable and function names
127
- - Extracting methods for better organization
128
- - Simplifying complex logic
129
- - Enhancing readability and maintainability
130
- - Applying appropriate design patterns
134
+ **STEP 1:** Identify improvement opportunities.
135
+ - Remove code duplication
136
+ - Improve variable and function names
137
+ - Extract methods for better organization
138
+ - Simplify complex logic
139
+ - Apply appropriate design patterns
131
140
 
132
- **Safety Rules**:
141
+ **STEP 2:** Make incremental improvements safely.
133
142
  - Run tests after each refactoring change
134
- - If any test breaks, immediately revert the change
135
- - Make small, incremental improvements
136
- - Stop when code is clean and no obvious improvements remain
143
+ - Immediately revert any change that breaks tests
144
+ - Make small, focused improvements
145
+ - Stop when code is clean with no obvious improvements remaining
137
146
 
138
- Document significant refactoring decisions and update task progress as needed.
147
+ **STEP 3:** Document and complete.
148
+ - Document significant refactoring decisions
149
+ - Update task progress
139
150
  transitions:
140
151
  - trigger: 'refactoring_complete'
141
152
  to: 'red'
@@ -28,14 +28,15 @@ states:
28
28
  requirements:
29
29
  description: 'Gathering and analyzing requirements'
30
30
  default_instructions: |
31
- Make yourself familiar with the code base.
32
- Focus on understanding their goals, scope, constraints, and success criteria, e. g.
33
- Who are the key stakeholders? (end users, business owners, technical teams)
34
- Which requirements are must-have vs nice-to-have?
35
- How will you measure success? What are the acceptance criteria?
36
- What are your time, budget, technical, or regulatory constraints?
37
- What existing systems must this integrate with?
38
- Break down their needs into specific requirements in $REQUIREMENTS_DOC. Create actionable tasks referencing those requirements.
31
+ Familiarize yourself with the code base and understand project goals, scope, constraints, and success criteria.
32
+
33
+ - Who are the key stakeholders? (end users, business owners, technical teams)
34
+ - Which requirements are must-have vs nice-to-have?
35
+ - How will you measure success? What are the acceptance criteria?
36
+ - What are your time, budget, technical, or regulatory constraints?
37
+ - What existing systems must this integrate with?
38
+
39
+ Document all requirements in `$REQUIREMENTS_DOC`. Create actionable tasks referencing those requirements.
39
40
  transitions:
40
41
  - trigger: 'requirements_complete'
41
42
  to: 'design'
@@ -49,11 +50,11 @@ states:
49
50
  design:
50
51
  description: 'Technical design and architecture planning'
51
52
  default_instructions: |
52
- You are in the design phase. Re-analyze important interfaces of the application.
53
- Review requirements from $REQUIREMENTS_DOC and design the technical solution
54
- Focus on HOW to implement what's needed including architecture, technologies, data models, API design, and quality goals.
55
- Clarify performance expectations and technology preferences if not already obvious from the current analysis.
56
- Document architectural decisions in $ARCHITECTURE_DOC and detailed design in $DESIGN_DOC. Create tasks and ensure the approach is solid before implementation."
53
+ Review requirements from `$REQUIREMENTS_DOC` and design the technical solution.
54
+
55
+ Focus on HOW to implement what's needed including architecture, technologies, data models, API design, and quality goals. Clarify performance expectations and technology preferences if not already obvious from the current analysis.
56
+
57
+ Document architectural decisions in `$ARCHITECTURE_DOC` and detailed design in `$DESIGN_DOC`. Create tasks and ensure the approach is solid before implementation.
57
58
  transitions:
58
59
  - trigger: 'need_more_requirements'
59
60
  to: 'requirements'
@@ -72,10 +73,13 @@ states:
72
73
  implementation:
73
74
  description: 'Building the solution according to design'
74
75
  default_instructions: |
75
- Follow the architecture from $ARCHITECTURE_DOC and detailed design from $DESIGN_DOC to build the solution. Before starting, clarify the approach:
76
- • Should this be implemented incrementally or all at once? Any specific order of implementation?
77
- Are there high-risk parts that need extra validation or careful implementation?
78
- Ensure requirements from $REQUIREMENTS_DOC are met. Focus on code structure, error handling, security, and maintainability. Write clean, well-documented code and include basic testing. Update task progress during implementation work.
76
+ Follow the architecture from `$ARCHITECTURE_DOC` and detailed design from `$DESIGN_DOC` to build the solution.
77
+
78
+ Before starting, clarify the approach:
79
+ - Should this be implemented incrementally or all at once? Any specific order of implementation?
80
+ - Are there high-risk parts that need extra validation or careful implementation?
81
+
82
+ Ensure requirements from `$REQUIREMENTS_DOC` are met. Focus on code structure, error handling, security, and maintainability. Write clean, well-documented code and include basic testing. Update task progress during implementation work.
79
83
  transitions:
80
84
  - trigger: 'need_design_changes'
81
85
  to: 'design'
@@ -98,7 +102,19 @@ states:
98
102
 
99
103
  qa:
100
104
  description: 'Quality assurance and code review'
101
- default_instructions: 'You are in the quality assurance phase. Take the following specific actions: 1) Syntax Check: Run syntax checking tools or validate syntax manually, 2) Build Project: Build the project to verify it compiles without errors, 3) Run Linter: Execute linting tools to ensure code style consistency, 4) Execute Tests: Run existing tests to verify functionality. Then conduct a multi-perspective code review from security, performance, UX, maintainability, and requirement compliance perspectives. Verify implementation matches $DESIGN_DOC specifications and fulfills the targeted requirements from $REQUIREMENTS_DOC. Update task progress and mark completed work during QA review.'
105
+ default_instructions: |
106
+ Perform systematic quality checks and code review:
107
+
108
+ **STEP 1: Automated Quality Checks**
109
+ - Run syntax checking tools or validate syntax manually
110
+ - Build the project to verify it compiles without errors
111
+ - Execute linting tools to ensure code style consistency
112
+ - Run existing tests to verify functionality
113
+
114
+ **STEP 2: Multi-Perspective Code Review**
115
+ Conduct code review from security, performance, UX, maintainability, and requirement compliance perspectives. Verify implementation matches `$DESIGN_DOC` specifications and fulfills targeted requirements from `$REQUIREMENTS_DOC`.
116
+
117
+ Update task progress and mark completed work during QA review.
102
118
  transitions:
103
119
  - trigger: 'need_implementation_fixes'
104
120
  to: 'implementation'
@@ -116,7 +132,12 @@ states:
116
132
 
117
133
  testing:
118
134
  description: 'Comprehensive testing and validation'
119
- default_instructions: 'You are in the testing phase. Create comprehensive test plans, write and execute tests, validate feature completeness, and ensure everything works as expected. Focus on test coverage, edge cases, integration testing, and user acceptance validation.'
135
+ default_instructions: |
136
+ Create and execute comprehensive test plans to validate feature completeness.
137
+
138
+ - Write and execute tests with focus on test coverage and edge cases
139
+ - Conduct integration testing to ensure all components work together
140
+ - Validate user acceptance and ensure everything works as expected
120
141
  transitions:
121
142
  - trigger: 'need_implementation_fixes'
122
143
  to: 'implementation'
@@ -139,45 +160,44 @@ states:
139
160
 
140
161
  finalize:
141
162
  description: 'Code cleanup and documentation finalization'
142
- default_instructions: >
143
- You are in the finalize phase. This phase ensures code quality and documentation accuracy through systematic cleanup and review.
163
+ default_instructions: |
164
+ Complete the feature by cleaning up code and updating documentation.
144
165
 
145
166
  **STEP 1: Code Cleanup**
146
- Systematically clean up development artifacts:
147
167
 
148
- 1. **Remove Debug Output**: Search for and remove all temporary debug output statements used during development.
149
- Look for language-specific debug output methods (console logging, print statements, debug output functions).
150
- Remove any debugging statements that were added for development purposes.
168
+ Remove debug output and temporary code:
169
+ - Search for and remove all temporary debug output statements used during development
170
+ - Look for language-specific debug output methods (console logging, print statements, debug output functions)
151
171
 
152
- 2. **Review TODO/FIXME Comments**:
153
- - Address each TODO/FIXME comment by either implementing the solution or documenting why it's deferred
154
- - Remove completed TODOs
155
- - Convert remaining TODOs to proper issue tracking if needed
172
+ Review and address TODO/FIXME comments:
173
+ - Address each TODO/FIXME comment by either implementing the solution or documenting why it's deferred
174
+ - Remove completed TODOs
175
+ - Convert remaining TODOs to proper issue tracking if needed
156
176
 
157
- 3. **Remove Debugging Code Blocks**:
158
- - Remove temporary debugging code, test code blocks, and commented-out code
159
- - Clean up any experimental code that's no longer needed
160
- - Ensure proper error handling replaces temporary debug logging
177
+ Remove debugging code blocks:
178
+ - Remove temporary debugging code, test code blocks, and commented-out code
179
+ - Clean up any experimental code that's no longer needed
180
+ - Ensure proper error handling replaces temporary debug logging
161
181
 
162
182
  **STEP 2: Documentation Review**
163
- Review and update documentation to reflect final implementation:
164
183
 
165
- 1. **Update Long-Term Memory Documents**: Based on what was actually implemented:
166
- Update $REQUIREMENTS_DOC if requirements changed during development
167
- Update $ARCHITECTURE_DOC if architectural decisions evolved
168
- Update $DESIGN_DOC if design details were refined or changed
169
- 2. **Compare Against Implementation**: Review documentation against actual implemented functionality
170
- 3. **Update Changed Sections**: Only modify documentation sections that have functional changes
171
- 4. **Remove Development Progress**: Remove references to development iterations, progress notes, and temporary decisions
172
- 5. **Focus on Final State**: Ensure documentation describes the final implemented state, not the development process
173
- 6. **Ask User to Review Document Updates**
184
+ Review and update documentation to reflect final implementation:
185
+ - Update `$REQUIREMENTS_DOC` if requirements changed during development
186
+ - Update `$ARCHITECTURE_DOC` if architectural decisions evolved
187
+ - Update `$DESIGN_DOC` if design details were refined or changed
188
+ - Compare documentation against actual implemented functionality
189
+ - Only modify documentation sections that have functional changes
190
+ - Remove references to development iterations, progress notes, and temporary decisions
191
+ - Ensure documentation describes the final implemented state, not the development process
192
+ - Ask user to review document updates
174
193
 
175
194
  **STEP 3: Final Validation**
195
+
176
196
  - Run existing tests to ensure cleanup didn't break functionality
177
197
  - Verify documentation accuracy with a final review
178
198
  - Ensure code is ready for production/delivery
179
199
 
180
- Update task progress and mark completed work as you finalize the feature.
200
+ Update task progress and mark completed work as you finalize the feature.
181
201
  transitions:
182
202
  - trigger: 'need_final_changes'
183
203
  to: 'implementation'