@codemcp/workflows-core 5.2.3 → 5.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.
@@ -33,10 +33,6 @@ export declare class InstructionGenerator implements IInstructionGenerator {
33
33
  * Enhance base instructions with context-specific information
34
34
  */
35
35
  private enhanceInstructions;
36
- /**
37
- * Generate task management guidance for markdown backend
38
- */
39
- private generateTaskManagementGuidance;
40
36
  /**
41
37
  * Capitalize phase name for display
42
38
  */
@@ -62,43 +62,19 @@ export class InstructionGenerator {
62
62
  * Enhance base instructions with context-specific information
63
63
  */
64
64
  async enhanceInstructions(baseInstructions, context) {
65
- const { phase, conversationContext, transitionReason, isModeled, planFileExists, } = context;
66
- // Generate task management guidance for markdown backend
67
- const taskGuidance = this.generateTaskManagementGuidance();
68
- let enhanced;
69
- // Markdown mode: Traditional plan file approach
70
- enhanced = `Check your plan file at \`${conversationContext.planFilePath}\` and focus on the "${this.capitalizePhase(phase)}" section.
71
-
72
- ${baseInstructions}
73
-
74
- **Plan File Guidance:**
75
- - Work on the tasks listed in the ${this.capitalizePhase(phase)} section
76
- ${taskGuidance}
77
- - Update the "Key Decisions" section with important choices made
78
- - Add relevant notes to help maintain context`;
79
- // Add transition context if this is a modeled transition
80
- if (isModeled && transitionReason) {
81
- enhanced += `\n\n**Phase Context:**
82
- - ${transitionReason}`;
83
- }
84
- // Add plan file creation note if needed
65
+ const { phase, conversationContext, planFileExists } = context;
66
+ const phaseName = this.capitalizePhase(phase);
67
+ let workflowSection = `---
68
+ **Workflow Continuity:**
69
+ Maintain \`${conversationContext.planFilePath}\`:
70
+ - Work through tasks in the "${phaseName}" section; Focus on those tasks!
71
+ - Add newly discovered tasks; log decisions in "Key Decisions"
72
+ - DO NOT maintain tasks in other tools or documents than explicitly stated in this plan file!`;
85
73
  if (!planFileExists) {
86
- enhanced +=
87
- '\n\n**Note**: Plan file will be created when you first update it.';
74
+ workflowSection += '\n- Note: plan file will be created on first update';
88
75
  }
89
- // Add continuity and task management instructions
90
- enhanced += `\n\n**Important Reminders:**
91
- - Use ONLY the development plan for task management - do not use your own task management tools
92
- - Call whats_next() after the next user message to maintain the development workflow`;
93
- return enhanced;
94
- }
95
- /**
96
- * Generate task management guidance for markdown backend
97
- */
98
- generateTaskManagementGuidance() {
99
- // Default markdown backend
100
- return `- Mark completed tasks with [x] as you finish them
101
- - Add new tasks as they are identified during your work with the user`;
76
+ workflowSection += '\n\nCall `whats_next()` after each user message.';
77
+ return `## ${phaseName} Phase\n\n${baseInstructions}\n\n${workflowSection}`;
102
78
  }
103
79
  /**
104
80
  * Capitalize phase name for display
@@ -1 +1 @@
1
- {"version":3,"file":"instruction-generator.js","sourceRoot":"","sources":["../src/instruction-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAS/D,MAAM,OAAO,oBAAoB;IACvB,kBAAkB,CAAqB;IAE/C,YAAY,YAAyB;QACnC,+EAA+E;QAC/E,IAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,aAA+B;QAC7C,gFAAgF;QAChF,OAAO;IACT,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,oBAAoB,CACxB,gBAAwB,EACxB,OAA2B;QAE3B,mDAAmD;QACnD,MAAM,uBAAuB,GAAG,IAAI,CAAC,yBAAyB,CAC5D,gBAAgB,EAChB,OAAO,CAAC,mBAAmB,CAAC,WAAW,EACvC,OAAO,CAAC,mBAAmB,CAAC,SAAS,CACtC,CAAC;QAEF,2DAA2D;QAC3D,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,mBAAmB,CACzD,uBAAuB,EACvB,OAAO,CACR,CAAC;QAEF,OAAO;YACL,YAAY,EAAE,oBAAoB;YAClC,gBAAgB,EACd,+DAA+D;YACjE,QAAQ,EAAE;gBACR,KAAK,EAAE,OAAO,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D,YAAY;;8CAEgC,CAAC;QAC3C,yDAAyD;QACzD,IAAI,SAAS,IAAI,gBAAgB,EAAE,CAAC;YAClC,QAAQ,IAAI;IACd,gBAAgB,EAAE,CAAC;QACnB,CAAC;QAED,wCAAwC;QACxC,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,QAAQ;gBACN,mEAAmE,CAAC;QACxE,CAAC;QAED,kDAAkD;QAClD,QAAQ,IAAI;;qFAEqE,CAAC;QAElF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;OAEG;IACK,8BAA8B;QACpC,2BAA2B;QAC3B,OAAO;sEAC2D,CAAC;IACrE,CAAC;IAED;;OAEG;IACK,eAAe,CAAC,KAAa;QACnC,OAAO,KAAK;aACT,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aACzD,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACF"}
1
+ {"version":3,"file":"instruction-generator.js","sourceRoot":"","sources":["../src/instruction-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAS/D,MAAM,OAAO,oBAAoB;IACvB,kBAAkB,CAAqB;IAE/C,YAAY,YAAyB;QACnC,+EAA+E;QAC/E,IAAI,CAAC,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,aAA+B;QAC7C,gFAAgF;QAChF,OAAO;IACT,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,oBAAoB,CACxB,gBAAwB,EACxB,OAA2B;QAE3B,mDAAmD;QACnD,MAAM,uBAAuB,GAAG,IAAI,CAAC,yBAAyB,CAC5D,gBAAgB,EAChB,OAAO,CAAC,mBAAmB,CAAC,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AAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QAE9C,IAAI,eAAe,GAAG;;aAEb,mBAAmB,CAAC,YAAY;+BACd,SAAS;;8FAEsD,CAAC;QAE3F,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,eAAe,IAAI,qDAAqD,CAAC;QAC3E,CAAC;QAED,eAAe,IAAI,kDAAkD,CAAC;QAEtE,OAAO,MAAM,SAAS,aAAa,gBAAgB,OAAO,eAAe,EAAE,CAAC;IAC9E,CAAC;IAED;;OAEG;IACK,eAAe,CAAC,KAAa;QACnC,OAAO,KAAK;aACT,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aACzD,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemcp/workflows-core",
3
- "version": "5.2.3",
3
+ "version": "5.3.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -594,10 +594,4 @@ states:
594
594
  - Business-friendly documentation for domain architects
595
595
 
596
596
  The analysis provides a solid foundation for business architecture decisions and technical-business alignment.
597
- transitions:
598
- - trigger: 'analysis_complete'
599
- to: 'analysis_complete'
600
- instructions: >
601
- Analysis is complete! The business architecture is now well-documented and understood.
602
- Use the comprehensive documentation for business architecture decisions and planning.
603
- transition_reason: 'Analysis complete, ready for business architecture work'
597
+ transitions: []
@@ -465,13 +465,6 @@ states:
465
465
 
466
466
  The analysis provides a foundation for future development. Consider using other workflows (waterfall, epcc, etc.) with the comprehensive understanding gained.
467
467
  transitions:
468
- - trigger: 'analysis_complete'
469
- to: 'analysis_complete'
470
- instructions: >
471
- Analysis is complete. The legacy system is now well-documented and understood.
472
- Use the comprehensive documentation and `$DISCOVERY_FILE` findings for any future development work.
473
- transition_reason: 'Analysis complete, ready for future development'
474
-
475
468
  - trigger: 'refine_analysis'
476
469
  to: 'component_analysis'
477
470
  additional_instructions: 'Refine specific aspects of analysis. Focus on areas that need additional investigation.'
@@ -45,14 +45,6 @@ states:
45
45
  - perspective: 'ux_expert'
46
46
  prompt: 'Evaluate user experience requirements and usability considerations. Ensure user personas, workflows, and interaction patterns are properly defined for the greenfield project.'
47
47
 
48
- - trigger: 'abandon_project'
49
- to: 'ideation'
50
- instructions: >
51
- Project development abandoned. Return to ideation state for new projects.
52
- Task history will remain for future reference if needed.
53
- additional_instructions: 'Project development abandoned. Clean up any ideation work and prepare for new projects.'
54
- transition_reason: 'User decided to abandon current project development'
55
-
56
48
  architecture:
57
49
  description: 'Tech stack selection and architecture design phase'
58
50
  default_instructions: |
@@ -47,15 +47,6 @@ states:
47
47
  to: 'implement'
48
48
  transition_reason: 'Analysis and design complete, ready for streamlined implementation'
49
49
 
50
- - trigger: 'abandon_feature'
51
- to: 'explore'
52
- instructions: >
53
- Minor enhancement abandoned. Revert potentially made changes.
54
- Return to exploration state for new tasks.
55
- Task history will remain for future reference if needed.
56
- additional_instructions: 'Minor enhancement development abandoned. Clean up any analysis work and prepare for new tasks.'
57
- transition_reason: 'User decided to abandon current minor enhancement'
58
-
59
50
  implement:
60
51
  description: 'Combined implementation phase - code, test, and commit'
61
52
  default_instructions: >
@@ -45,14 +45,6 @@ states:
45
45
  to: story
46
46
  transition_reason: 'Topic researched and format decided, ready for story structure development'
47
47
 
48
- - trigger: abandon_post
49
- to: discovery
50
- instructions: |
51
- Abandon post development. Clean up any discovery work and prepare for new post topics.
52
- The `$PLAN_FILE` will remain for future reference if needed.
53
- additional_instructions: 'Prepare for new post topics.'
54
- transition_reason: 'User decided to abandon current post development'
55
-
56
48
  story:
57
49
  description: 'Create narrative structure and story outline'
58
50
  default_instructions: |
@@ -358,13 +358,6 @@ states:
358
358
  - User scenarios work as specified
359
359
 
360
360
  transitions:
361
- - trigger: 'verification_complete'
362
- to: 'verify'
363
- instructions: >
364
- The bug has been resolved, all tests pass, and no regressions have been detected.
365
- The fix is ready for deployment.
366
- transition_reason: 'Verification complete, bug fix ready for deployment'
367
-
368
361
  - trigger: 'regression_detected'
369
362
  to: 'fix'
370
363
  instructions: >
@@ -447,14 +447,6 @@ states:
447
447
  Focus on delivering working, tested increments that integrate seamlessly with the existing system.
448
448
 
449
449
  transitions:
450
- - trigger: 'implementation_complete'
451
- to: 'implement'
452
- instructions: >
453
- Feature implementation completed successfully. All user stories have been implemented,
454
- tested, and integrated with the existing system. The feature meets the success criteria
455
- defined in the specification.
456
- transition_reason: 'Implementation complete, feature ready for use'
457
-
458
450
  - trigger: 'implementation_blocked'
459
451
  to: 'plan'
460
452
  instructions: >
@@ -452,14 +452,7 @@ states:
452
452
 
453
453
  Create comprehensive documentation that enables users to successfully adopt and use the project.
454
454
 
455
- transitions:
456
- - trigger: 'documentation_complete'
457
- to: 'document'
458
- instructions: >
459
- Project documentation is complete. The specification-driven development process has successfully
460
- delivered a working solution with comprehensive documentation. Review all deliverables and
461
- ensure they meet the constitutional principles established at the beginning.
462
- transition_reason: 'Documentation complete, project ready for delivery'
455
+ transitions: []
463
456
 
464
457
  # Global transitions available from any state
465
458
  global_transitions:
@@ -39,15 +39,6 @@ states:
39
39
  to: structure
40
40
  transition_reason: 'Presentation concept and goals clearly defined, ready for content structuring'
41
41
 
42
- - trigger: abandon_presentation
43
- to: ideate
44
- instructions: |
45
- **Abandon ideation work** - Clean up any ideation work and prepare for new presentation topics.
46
-
47
- The plan file will remain for future reference if needed.
48
- additional_instructions: 'Presentation development abandoned. Prepare for new presentation topics.'
49
- transition_reason: 'User decided to abandon current presentation development'
50
-
51
42
  structure:
52
43
  description: 'Organize content flow and logical progression'
53
44
  default_instructions: |
@@ -44,14 +44,6 @@ states:
44
44
  additional_instructions: 'Update task progress as you complete exploration work.'
45
45
  transition_reason: 'Sufficient understanding gained, ready to start TDD cycle with failing test'
46
46
 
47
- - trigger: 'abandon_feature'
48
- to: 'explore'
49
- instructions: >
50
- Feature development abandoned. Return to exploration state for new tasks.
51
- Task history will remain for future reference if needed.
52
- additional_instructions: 'Clean up any work in progress and prepare for new tasks.'
53
- transition_reason: 'User decided to abandon current feature development'
54
-
55
47
  red:
56
48
  description: 'RED phase - Write a failing test that defines the expected behavior'
57
49
  default_instructions: |