@codemcp/workflows-core 3.2.2 → 3.3.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.
@@ -36,7 +36,6 @@ states:
36
36
  transitions:
37
37
  - trigger: 'exploration_complete'
38
38
  to: 'implement'
39
- additional_instructions: 'Analysis and design complete! ✅ Now transition to implementation phase. You have a clear understanding of the problem and a solid design approach. Keep the scope focused on the minor enhancement. Mark completed exploration tasks.'
40
39
  transition_reason: 'Analysis and design complete, ready for streamlined implementation'
41
40
 
42
41
  - trigger: 'abandon_feature'
@@ -59,7 +58,6 @@ states:
59
58
 
60
59
  - trigger: 'implementation_complete'
61
60
  to: 'finalize'
62
- additional_instructions: 'Implementation is complete! Clean up code and finalize documentation to ensure everything is ready for delivery. Mark all implementation tasks as complete.'
63
61
  transition_reason: 'Implementation complete, ready for finalization'
64
62
 
65
63
  - trigger: 'abandon_feature'
@@ -67,7 +65,7 @@ states:
67
65
  instructions: >
68
66
  Minor enhancement abandoned during implementation. Clean up any incomplete code and return to exploration.
69
67
  The plan file and any completed work will remain for future reference.
70
- additional_instructions: 'Minor enhancement abandoned during implementation. Clean up any incomplete code and prepare for new tasks.'
68
+ additional_instructions: 'Clean up any incomplete code and prepare for new tasks.'
71
69
  transition_reason: 'User decided to abandon minor enhancement during implementation'
72
70
 
73
71
  finalize:
@@ -118,10 +116,9 @@ states:
118
116
 
119
117
  - trigger: 'finalization_complete'
120
118
  to: 'explore'
121
- additional_instructions: 'Minor enhancement is complete and finalized! All work is finished and ready for delivery. Prepare for the next development task.'
122
119
  transition_reason: 'Minor enhancement delivery complete, ready for next task'
123
120
 
124
121
  - trigger: 'abandon_feature'
125
122
  to: 'explore'
126
- additional_instructions: 'Minor enhancement abandoned during finalization. Clean up any finalization artifacts and prepare for new tasks.'
123
+ additional_instructions: 'Clean up any finalization artifacts and prepare for new tasks.'
127
124
  transition_reason: 'User decided to abandon minor enhancement during finalization'
@@ -40,10 +40,6 @@ states:
40
40
  transitions:
41
41
  - trigger: discovery_complete
42
42
  to: story
43
- additional_instructions: |
44
- Discovery complete! ✅ You have clear format decision, unique angle, and research foundation.
45
-
46
- Update the plan file with story development tasks and mark completed discovery work.
47
43
  transition_reason: 'Topic researched and format decided, ready for story structure development'
48
44
 
49
45
  - trigger: abandon_post
@@ -190,7 +186,6 @@ states:
190
186
  transitions:
191
187
  - trigger: distribution_complete
192
188
  to: discovery
193
- additional_instructions: 'Post successfully published. Ready for next post project.'
194
189
  transition_reason: 'Post publishing completed successfully, ready for new projects'
195
190
 
196
191
  - trigger: need_final_review
@@ -0,0 +1,399 @@
1
+ # yaml-language-server: $schema=../state-machine-schema.json
2
+ ---
3
+ name: 'sdd-bugfix'
4
+ description: 'Test and specification-driven bugfix workflow: Reproduce → Specify → Test → Plan → Fix → Verify'
5
+ initial_state: 'reproduce'
6
+
7
+ # Enhanced metadata for better discoverability
8
+ metadata:
9
+ domain: 'sdd'
10
+ complexity: 'medium'
11
+ bestFor:
12
+ - 'Systematic bug fixing'
13
+ - 'Test-driven bug resolution'
14
+ - 'Specification-driven debugging'
15
+ - 'Quality-focused fixes'
16
+ useCases:
17
+ - 'Fix complex bugs with clear specification'
18
+ - 'Resolve issues with comprehensive testing'
19
+ - 'Debug problems requiring systematic approach'
20
+ examples:
21
+ - 'Fix authentication flow bug with test coverage'
22
+ - 'Resolve data corruption issue with specification'
23
+ - 'Debug performance problem with systematic approach'
24
+
25
+ # States with default instructions and transitions
26
+ states:
27
+ reproduce:
28
+ description: 'Reproduce and understand the bug systematically'
29
+ default_instructions: |
30
+ You are systematically reproducing and understanding the bug to create a solid foundation for specification-driven fixing.
31
+
32
+ **Bug Reproduction Process:**
33
+
34
+ 1. **Gather Comprehensive Information**:
35
+ - What are the exact OS, browser/runtime versions, and hardware specs?
36
+ - What is the precise sequence of actions that trigger the bug?
37
+ - What error messages, logs, or stack traces are available?
38
+ - Does this happen every time or intermittently?
39
+ - How many users are affected and what is the business impact?
40
+
41
+ 2. **Create Reproduction Cases**:
42
+ - Develop minimal, reliable reproduction steps
43
+ - Document the exact environment and conditions
44
+ - Create test data or scenarios that trigger the issue
45
+ - Verify the bug occurs consistently
46
+
47
+ 3. **Understand the Problem**:
48
+ - What is the current (buggy) behavior?
49
+ - What should the correct behavior be?
50
+ - What are the symptoms vs. root cause?
51
+ - Are there related issues or edge cases?
52
+
53
+ 4. **Document Findings**:
54
+ - Create `$VIBE_DIR/specs/$BRANCH_NAME/reproduction.md` with detailed reproduction steps
55
+ - Include error logs, screenshots, or other evidence
56
+ - Document the gap between expected and actual behavior
57
+
58
+ **Output**: Clear, reliable reproduction case that can be used to verify the fix later.
59
+
60
+ transitions:
61
+ - trigger: 'bug_reproduced'
62
+ to: 'specify'
63
+ transition_reason: 'Bug reproduced successfully, ready to specify correct behavior'
64
+
65
+ - trigger: 'bug_not_reproducible'
66
+ to: 'reproduce'
67
+ instructions: >
68
+ Unable to reproduce the bug with current information. Gather more details about the environment,
69
+ conditions, or steps that might be missing. Contact the reporter for additional information if needed.
70
+ transition_reason: 'Bug could not be reproduced, need more information'
71
+
72
+ specify:
73
+ description: 'Create specification of correct behavior'
74
+ default_instructions: |
75
+ You are creating a clear specification of the correct behavior. This specification will guide the fix and prevent regressions.
76
+
77
+ **Specification Process:**
78
+
79
+ 1. **Define Correct Behavior**:
80
+ - What should happen in the scenario that currently fails?
81
+ - What are the expected outcomes for users?
82
+ - How should the system behave in edge cases?
83
+ - What are the business rules that should be enforced?
84
+
85
+ 2. **Handle Ambiguities**:
86
+ - Make informed decisions about unclear requirements
87
+ - Use [NEEDS CLARIFICATION: question] only for critical ambiguities (max 3)
88
+ - Prioritize: correctness > user experience > technical details
89
+
90
+ 3. **Quality Standards**:
91
+ - Focus on user impact and business value
92
+ - Avoid implementation details
93
+ - Ensure all requirements are testable
94
+ - Make success criteria measurable
95
+
96
+ Create `$VIBE_DIR/specs/$BRANCH_NAME/bug-spec.md` using the template provided below.
97
+ additional_instructions: |
98
+ **Bug Specification Template:**
99
+
100
+ Use this template to create your `bug-spec.md` file:
101
+
102
+ ```markdown
103
+ # Bug Fix Specification: [BUG TITLE]
104
+
105
+ **Created**: [DATE]
106
+ **Bug Report**: [Reference to original bug report]
107
+
108
+ ## Current Problem
109
+
110
+ **Description**: [Clear description of the bug and its impact]
111
+
112
+ **Symptoms**: [What users experience when the bug occurs]
113
+
114
+ **Impact**: [Business impact, user frustration, data issues, etc.]
115
+
116
+ ## Expected Behavior
117
+
118
+ **Correct Functionality**: [Detailed specification of how it should work]
119
+
120
+ **User Experience**: [How users should be able to interact with the fixed system]
121
+
122
+ **Business Rules**: [Rules that should be enforced]
123
+
124
+ ## User Scenarios
125
+
126
+ ### Scenario 1 - [Primary Fix Scenario]
127
+
128
+ **Given** [initial state]
129
+ **When** [action that currently fails]
130
+ **Then** [expected correct outcome]
131
+
132
+ ### Scenario 2 - [Edge Case Scenario]
133
+
134
+ **Given** [edge case state]
135
+ **When** [edge case action]
136
+ **Then** [expected correct outcome]
137
+
138
+ [Add more scenarios as needed]
139
+
140
+ ## Functional Requirements
141
+
142
+ - **FR-001**: System MUST [correct behavior requirement]
143
+ - **FR-002**: System MUST [error handling requirement]
144
+ - **FR-003**: System MUST [data integrity requirement]
145
+ - **FR-004**: System MUST [user feedback requirement]
146
+
147
+ ## Success Criteria
148
+
149
+ ### Fix Validation
150
+
151
+ - **SC-001**: Original reproduction case no longer occurs
152
+ - **SC-002**: All user scenarios work as specified
153
+ - **SC-003**: [Performance/reliability metric if applicable]
154
+ - **SC-004**: No regressions in related functionality
155
+
156
+ ### User Impact
157
+
158
+ - **SC-005**: [Measurable improvement in user experience]
159
+ - **SC-006**: [Reduction in error rates or support tickets]
160
+
161
+ ## Edge Cases
162
+
163
+ - What happens when [boundary condition]?
164
+ - How does system handle [error scenario]?
165
+ - What about [related functionality]?
166
+
167
+ ## Assumptions
168
+
169
+ - [Document any assumptions about correct behavior]
170
+ - [Include decisions made about ambiguous requirements]
171
+
172
+ ## Dependencies
173
+
174
+ - [Related systems that must continue working]
175
+ - [Integration points that must be preserved]
176
+ ```
177
+
178
+ Fill in all sections with specific details about the correct behavior that should replace the current buggy behavior.
179
+
180
+ transitions:
181
+ - trigger: 'specification_complete'
182
+ to: 'test'
183
+ transition_reason: 'Bug specification completed, ready to create tests'
184
+
185
+ - trigger: 'needs_clarification'
186
+ to: 'specify'
187
+ instructions: >
188
+ Bug specification has unresolved clarifications. Present structured questions to stakeholders,
189
+ wait for their responses, then update the specification accordingly.
190
+ transition_reason: 'Bug specification needs clarification before proceeding'
191
+
192
+ test:
193
+ description: 'Create comprehensive tests that capture the bug and expected behavior'
194
+ default_instructions: |
195
+ You are creating comprehensive tests that capture both the current bug and the expected correct behavior. These tests will guide the fix and prevent regressions.
196
+
197
+ **Test Creation Process:**
198
+
199
+ 1. **Failing Tests for Current Bug**:
200
+ - Create tests that demonstrate the current buggy behavior
201
+ - These tests should fail initially (Red phase of TDD)
202
+ - Cover the main reproduction case and related scenarios
203
+ - Include edge cases and boundary conditions
204
+
205
+ 2. **Tests for Expected Behavior**:
206
+ - Create tests that specify the correct behavior from `$VIBE_DIR/specs/$BRANCH_NAME/bug-spec.md`
207
+ - These tests should pass once the bug is fixed
208
+ - Cover all functional requirements from the specification
209
+ - Include user scenarios and success criteria
210
+
211
+ 3. **Regression Tests**:
212
+ - Create tests for related functionality that should not be affected
213
+ - Ensure the fix doesn't break existing features
214
+ - Test integration points and dependencies
215
+
216
+ 4. **Test Organization**:
217
+ - Group tests by functionality and user scenarios
218
+ - Use clear, descriptive test names
219
+ - Include both unit and integration tests as appropriate
220
+ - Document test setup and data requirements
221
+
222
+ **Output**: Create comprehensive test suite in appropriate test files that will guide the fix implementation.
223
+
224
+ transitions:
225
+ - trigger: 'tests_created'
226
+ to: 'plan'
227
+ transition_reason: 'Tests created for bug and expected behavior, ready to plan the fix'
228
+
229
+ plan:
230
+ description: 'Plan the fix approach with constitutional compliance'
231
+ default_instructions: |
232
+ You are planning the fix approach, ensuring the solution aligns with system architecture and quality principles.
233
+
234
+ **Fix Planning Process:**
235
+
236
+ 1. **Load Context**:
237
+ - Read bug specification (`$VIBE_DIR/specs/$BRANCH_NAME/bug-spec.md`)
238
+ - Review reproduction case (`$VIBE_DIR/specs/$BRANCH_NAME/reproduction.md`)
239
+ - Understand the test requirements
240
+ - Analyze existing codebase and architecture
241
+
242
+ 2. **Root Cause Analysis**:
243
+ - Identify the underlying cause of the bug
244
+ - Understand why the current implementation fails
245
+ - Map the problem to specific code areas or logic flaws
246
+ - Consider systemic issues vs. isolated bugs
247
+
248
+ 3. **Fix Strategy**:
249
+ - Design minimal, targeted fix that addresses root cause
250
+ - Ensure fix aligns with existing architectural patterns
251
+ - Consider impact on related functionality
252
+ - Plan for backward compatibility if needed
253
+
254
+ 4. **Constitutional/Quality Compliance**:
255
+ - Ensure fix follows system design principles
256
+ - Verify approach maintains code quality standards
257
+ - Check that fix doesn't introduce technical debt
258
+ - Validate solution is maintainable and testable
259
+
260
+ 5. **Implementation Plan**:
261
+ - Break down fix into specific, actionable tasks
262
+ - Identify files and components that need changes
263
+ - Plan testing and validation approach
264
+ - Consider rollout and deployment strategy
265
+
266
+ **Output**: Create `$VIBE_DIR/specs/$BRANCH_NAME/fix-plan.md` with detailed approach for implementing the bug fix.
267
+
268
+ transitions:
269
+ - trigger: 'plan_complete'
270
+ to: 'fix'
271
+ transition_reason: 'Fix plan completed, ready to implement the solution'
272
+
273
+ - trigger: 'architectural_conflict'
274
+ to: 'plan'
275
+ instructions: >
276
+ Planned fix conflicts with system architecture or quality principles.
277
+ Revise the approach to ensure proper integration and maintainability.
278
+ transition_reason: 'Fix plan conflicts with architecture, needs revision'
279
+
280
+ fix:
281
+ description: 'Implement the minimal fix to make tests pass'
282
+ default_instructions: |
283
+ You are implementing the bug fix following the plan and making the tests pass. Focus on minimal, targeted changes that address the root cause.
284
+
285
+ **Fix Implementation Process:**
286
+
287
+ 1. **Follow the Plan**: Execute the fix strategy from `$VIBE_DIR/specs/$BRANCH_NAME/fix-plan.md`
288
+ - Make targeted changes to address the root cause
289
+ - Avoid over-engineering or unnecessary modifications
290
+ - Keep changes minimal and focused
291
+
292
+ 2. **Test-Driven Implementation**:
293
+ - Run the failing tests to confirm they capture the bug
294
+ - Implement changes to make the tests pass (Green phase)
295
+ - Ensure all new tests pass while maintaining existing functionality
296
+
297
+ 3. **Quality Standards**:
298
+ - Follow existing code patterns and conventions
299
+ - Maintain or improve code readability
300
+ - Add appropriate error handling
301
+ - Include necessary logging or monitoring
302
+
303
+ 4. **Validation**:
304
+ - Verify the original reproduction case no longer occurs
305
+ - Run full test suite to check for regressions
306
+ - Test edge cases and boundary conditions
307
+ - Validate fix meets success criteria from specification
308
+
309
+ **Progress Tracking**:
310
+ - Document any deviations from the original plan
311
+ - Note any additional issues discovered during implementation
312
+ - Update tests if new edge cases are found
313
+
314
+ transitions:
315
+ - trigger: 'fix_implemented'
316
+ to: 'verify'
317
+ transition_reason: 'Bug fix implemented and tests passing, ready for verification'
318
+
319
+ - trigger: 'fix_blocked'
320
+ to: 'plan'
321
+ instructions: >
322
+ Fix implementation is blocked by technical issues or complexity.
323
+ Return to planning to revise the approach or break down the problem further.
324
+ transition_reason: 'Fix implementation blocked, need to revise plan'
325
+
326
+ - trigger: 'tests_failing'
327
+ to: 'test'
328
+ instructions: >
329
+ Tests are failing in unexpected ways, indicating the test design may need revision.
330
+ Review and update the test suite to better capture the requirements.
331
+ transition_reason: 'Tests failing unexpectedly, need to revise test approach'
332
+
333
+ verify:
334
+ description: 'Verify the fix works and does not introduce regressions'
335
+ default_instructions: |
336
+ You are verifying that the bug fix works correctly and doesn't introduce any regressions or new issues.
337
+
338
+ **Verification Process:**
339
+
340
+ 1. **Bug Resolution Verification**:
341
+ - Confirm the original reproduction case no longer occurs
342
+ - Verify all scenarios from `$VIBE_DIR/specs/$BRANCH_NAME/bug-spec.md` work correctly
343
+ - Test the fix in the original environment where the bug was reported
344
+ - Validate that success criteria are met
345
+
346
+ 2. **Regression Testing**:
347
+ - Run full test suite to ensure no existing functionality is broken
348
+ - Test related features and integration points
349
+ - Verify performance hasn't degraded
350
+ - Check that the fix doesn't introduce new edge case failures
351
+
352
+ 3. **User Acceptance**:
353
+ - Test from user perspective using real scenarios
354
+ - Verify the fix addresses the original user problem
355
+ - Ensure user experience is improved, not just technically correct
356
+ - Consider having original bug reporter validate the fix
357
+
358
+ 4. **Documentation and Communication**:
359
+ - Update relevant documentation if behavior has changed
360
+ - Document the fix approach for future reference
361
+ - Prepare release notes or change log entries
362
+ - Consider if this fix reveals systemic issues to address
363
+
364
+ **Final Validation**:
365
+ - All tests pass (both new and existing)
366
+ - Original bug reproduction case fails (bug is fixed)
367
+ - No regressions detected
368
+ - User scenarios work as specified
369
+
370
+ transitions:
371
+ - trigger: 'verification_complete'
372
+ to: 'verify'
373
+ instructions: >
374
+ Bug fix verification completed successfully. The bug has been resolved, all tests pass,
375
+ and no regressions have been detected. The fix is ready for deployment.
376
+ transition_reason: 'Verification complete, bug fix ready for deployment'
377
+
378
+ - trigger: 'regression_detected'
379
+ to: 'fix'
380
+ instructions: >
381
+ Regression detected during verification. The fix has introduced new issues or broken
382
+ existing functionality. Return to implementation to address the problems.
383
+ transition_reason: 'Regression detected, need to revise fix implementation'
384
+
385
+ - trigger: 'fix_insufficient'
386
+ to: 'specify'
387
+ instructions: >
388
+ The fix doesn't fully address the original problem or reveals that the specification
389
+ was incomplete. Return to specification to better define the requirements.
390
+ transition_reason: 'Fix insufficient, need to revise specification'
391
+
392
+ # Global transitions available from any state
393
+ global_transitions:
394
+ - trigger: 'abandon_bugfix'
395
+ to: 'reproduce'
396
+ instructions: >
397
+ Bug fix abandoned. If you want to restart, you'll begin again with reproducing
398
+ and understanding the bug.
399
+ transition_reason: 'Bug fix abandoned, restart from beginning'