@codemcp/workflows 6.5.0 → 6.6.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.
- package/package.json +2 -2
- package/packages/cli/dist/{chunk-4AZGS2GG.js → chunk-OQEE77IJ.js} +23 -1
- package/packages/cli/dist/{cli-ZCCFBQTP.js → cli-JKYH3LI3.js} +3 -3
- package/packages/cli/dist/{dist-MW7THWM3.js → dist-6V5QENI6.js} +23 -1
- package/packages/cli/dist/{dist-I6VSREAJ.js → dist-CANNJPRJ.js} +1 -1
- package/packages/cli/dist/index.js +2 -2
- package/packages/cli/package.json +1 -1
- package/packages/core/dist/conversation-manager.d.ts +13 -1
- package/packages/core/dist/conversation-manager.js +22 -0
- package/packages/core/dist/conversation-manager.js.map +1 -1
- package/packages/core/dist/types.d.ts +8 -0
- package/packages/core/package.json +1 -1
- package/packages/docs/package.json +1 -1
- package/packages/mcp-server/dist/index.d.ts +10 -1
- package/packages/mcp-server/dist/index.js +23 -1
- package/packages/mcp-server/package.json +1 -1
- package/packages/opencode-plugin/dist/index.d.ts +216 -5
- package/packages/opencode-plugin/dist/index.js +28682 -11
- package/packages/opencode-plugin/package.json +8 -5
- package/packages/opencode-plugin/resources/agents/architect.yaml +61 -0
- package/packages/opencode-plugin/resources/agents/business-analyst.yaml +60 -0
- package/packages/opencode-plugin/resources/agents/developer.yaml +61 -0
- package/packages/opencode-plugin/resources/templates/architecture/arc42/arc42-template-EN.md +1077 -0
- package/packages/opencode-plugin/resources/templates/architecture/arc42/images/01_2_iso-25010-topics-EN.drawio-2023.png +0 -0
- package/packages/opencode-plugin/resources/templates/architecture/arc42/images/01_2_iso-25010-topics-EN.drawio.png +0 -0
- package/packages/opencode-plugin/resources/templates/architecture/arc42/images/05_building_blocks-EN.png +0 -0
- package/packages/opencode-plugin/resources/templates/architecture/arc42/images/08-concepts-EN.drawio.png +0 -0
- package/packages/opencode-plugin/resources/templates/architecture/arc42/images/arc42-logo.png +0 -0
- package/packages/opencode-plugin/resources/templates/architecture/c4.md +224 -0
- package/packages/opencode-plugin/resources/templates/architecture/freestyle.md +53 -0
- package/packages/opencode-plugin/resources/templates/architecture/game.md +250 -0
- package/packages/opencode-plugin/resources/templates/architecture/none.md +17 -0
- package/packages/opencode-plugin/resources/templates/design/comprehensive.md +207 -0
- package/packages/opencode-plugin/resources/templates/design/freestyle.md +37 -0
- package/packages/opencode-plugin/resources/templates/design/game.md +66 -0
- package/packages/opencode-plugin/resources/templates/design/none.md +17 -0
- package/packages/opencode-plugin/resources/templates/requirements/ears.md +90 -0
- package/packages/opencode-plugin/resources/templates/requirements/freestyle.md +42 -0
- package/packages/opencode-plugin/resources/templates/requirements/game.md +162 -0
- package/packages/opencode-plugin/resources/templates/requirements/none.md +17 -0
- package/packages/opencode-plugin/resources/templates/skills/POWER.md +23 -0
- package/packages/opencode-plugin/resources/templates/skills/SKILL.md +19 -0
- package/packages/opencode-plugin/resources/workflows/adr.yaml +157 -0
- package/packages/opencode-plugin/resources/workflows/big-bang-conversion.yaml +592 -0
- package/packages/opencode-plugin/resources/workflows/boundary-testing.yaml +376 -0
- package/packages/opencode-plugin/resources/workflows/bugfix.yaml +178 -0
- package/packages/opencode-plugin/resources/workflows/business-analysis.yaml +597 -0
- package/packages/opencode-plugin/resources/workflows/c4-analysis.yaml +471 -0
- package/packages/opencode-plugin/resources/workflows/epcc.yaml +195 -0
- package/packages/opencode-plugin/resources/workflows/game-beginner.yaml +434 -0
- package/packages/opencode-plugin/resources/workflows/greenfield.yaml +217 -0
- package/packages/opencode-plugin/resources/workflows/minor.yaml +146 -0
- package/packages/opencode-plugin/resources/workflows/posts.yaml +193 -0
- package/packages/opencode-plugin/resources/workflows/sdd-bugfix-crowd.yaml +608 -0
- package/packages/opencode-plugin/resources/workflows/sdd-bugfix.yaml +381 -0
- package/packages/opencode-plugin/resources/workflows/sdd-feature-crowd.yaml +713 -0
- package/packages/opencode-plugin/resources/workflows/sdd-feature.yaml +471 -0
- package/packages/opencode-plugin/resources/workflows/sdd-greenfield-crowd.yaml +336 -0
- package/packages/opencode-plugin/resources/workflows/sdd-greenfield.yaml +463 -0
- package/packages/opencode-plugin/resources/workflows/skilled-bugfix.yaml +174 -0
- package/packages/opencode-plugin/resources/workflows/skilled-epcc.yaml +171 -0
- package/packages/opencode-plugin/resources/workflows/skilled-greenfield.yaml +207 -0
- package/packages/opencode-plugin/resources/workflows/slides.yaml +237 -0
- package/packages/opencode-plugin/resources/workflows/tdd.yaml +170 -0
- package/packages/opencode-plugin/resources/workflows/waterfall.yaml +225 -0
- package/packages/opencode-tui-plugin/package.json +1 -1
- package/packages/visualizer/package.json +1 -1
- package/packages/opencode-plugin/dist/index.js.map +0 -1
- package/packages/opencode-plugin/dist/opencode-logger.d.ts +0 -21
- package/packages/opencode-plugin/dist/opencode-logger.js +0 -104
- package/packages/opencode-plugin/dist/opencode-logger.js.map +0 -1
- package/packages/opencode-plugin/dist/plugin.d.ts +0 -23
- package/packages/opencode-plugin/dist/plugin.js +0 -395
- package/packages/opencode-plugin/dist/plugin.js.map +0 -1
- package/packages/opencode-plugin/dist/server-context.d.ts +0 -40
- package/packages/opencode-plugin/dist/server-context.js +0 -96
- package/packages/opencode-plugin/dist/server-context.js.map +0 -1
- package/packages/opencode-plugin/dist/tool-handlers/conduct-review.d.ts +0 -3
- package/packages/opencode-plugin/dist/tool-handlers/conduct-review.js +0 -37
- package/packages/opencode-plugin/dist/tool-handlers/conduct-review.js.map +0 -1
- package/packages/opencode-plugin/dist/tool-handlers/proceed-to-phase.d.ts +0 -3
- package/packages/opencode-plugin/dist/tool-handlers/proceed-to-phase.js +0 -74
- package/packages/opencode-plugin/dist/tool-handlers/proceed-to-phase.js.map +0 -1
- package/packages/opencode-plugin/dist/tool-handlers/reset-development.d.ts +0 -3
- package/packages/opencode-plugin/dist/tool-handlers/reset-development.js +0 -63
- package/packages/opencode-plugin/dist/tool-handlers/reset-development.js.map +0 -1
- package/packages/opencode-plugin/dist/tool-handlers/setup-project-docs.d.ts +0 -3
- package/packages/opencode-plugin/dist/tool-handlers/setup-project-docs.js +0 -74
- package/packages/opencode-plugin/dist/tool-handlers/setup-project-docs.js.map +0 -1
- package/packages/opencode-plugin/dist/tool-handlers/start-development.d.ts +0 -3
- package/packages/opencode-plugin/dist/tool-handlers/start-development.js +0 -69
- package/packages/opencode-plugin/dist/tool-handlers/start-development.js.map +0 -1
- package/packages/opencode-plugin/dist/tool-handlers/tool-helper.d.ts +0 -10
- package/packages/opencode-plugin/dist/tool-handlers/tool-helper.js +0 -7
- package/packages/opencode-plugin/dist/tool-handlers/tool-helper.js.map +0 -1
- package/packages/opencode-plugin/dist/types.d.ts +0 -193
- package/packages/opencode-plugin/dist/types.js +0 -8
- package/packages/opencode-plugin/dist/types.js.map +0 -1
- package/packages/opencode-plugin/dist/utils.d.ts +0 -14
- package/packages/opencode-plugin/dist/utils.js +0 -26
- package/packages/opencode-plugin/dist/utils.js.map +0 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# yaml-language-server: $schema=../state-machine-schema.json
|
|
2
|
+
---
|
|
3
|
+
name: 'tdd'
|
|
4
|
+
description: 'Test-Driven Development workflow: Explore → Red → Green → Refactor cycle for quality-focused development'
|
|
5
|
+
initial_state: 'explore'
|
|
6
|
+
|
|
7
|
+
# Enhanced metadata for better discoverability
|
|
8
|
+
metadata:
|
|
9
|
+
domain: 'code'
|
|
10
|
+
complexity: 'medium'
|
|
11
|
+
bestFor:
|
|
12
|
+
- 'TDD development'
|
|
13
|
+
- 'Test-first coding'
|
|
14
|
+
- 'Quality-focused development'
|
|
15
|
+
- 'Refactoring existing code'
|
|
16
|
+
useCases:
|
|
17
|
+
- 'Adding new features with comprehensive tests'
|
|
18
|
+
- 'Refactoring legacy code safely'
|
|
19
|
+
- 'Building robust, well-tested components'
|
|
20
|
+
examples:
|
|
21
|
+
- 'Add new API endpoint with full test coverage'
|
|
22
|
+
- 'Refactor existing function with safety net of tests'
|
|
23
|
+
- 'Build new feature following TDD principles'
|
|
24
|
+
|
|
25
|
+
# States with default instructions and transitions
|
|
26
|
+
states:
|
|
27
|
+
explore:
|
|
28
|
+
description: 'Research and exploration phase - understanding the problem space and codebase'
|
|
29
|
+
allowed_file_patterns:
|
|
30
|
+
- '**/*.md'
|
|
31
|
+
- '**/*.txt'
|
|
32
|
+
- '**/*.adoc'
|
|
33
|
+
default_instructions: |
|
|
34
|
+
**STEP 1:** Gather context about what needs to be developed. Focus on the WHY and WHAT, not the HOW.
|
|
35
|
+
|
|
36
|
+
**STEP 2:** Research the codebase and understand existing patterns.
|
|
37
|
+
- Ask the user about conventions or rules if uncertain
|
|
38
|
+
- Read relevant files and documentation
|
|
39
|
+
- If `$REQUIREMENTS_DOC` exists, understand and document requirements there, otherwise document in your task management system
|
|
40
|
+
|
|
41
|
+
**STEP 3:** Document your findings and create tasks as needed.
|
|
42
|
+
- Don't write code or tests yet
|
|
43
|
+
- Focus on understanding the problem space
|
|
44
|
+
- Prepare for the RED phase of the TDD cycle
|
|
45
|
+
transitions:
|
|
46
|
+
- trigger: 'exploration_complete'
|
|
47
|
+
to: 'red'
|
|
48
|
+
additional_instructions: 'Update task progress as you complete exploration work.'
|
|
49
|
+
transition_reason: 'Sufficient understanding gained, ready to start TDD cycle with failing test'
|
|
50
|
+
|
|
51
|
+
red:
|
|
52
|
+
description: 'RED phase - Write a failing test that defines the expected behavior'
|
|
53
|
+
allowed_file_patterns:
|
|
54
|
+
- '**/*'
|
|
55
|
+
default_instructions: |
|
|
56
|
+
Write a failing test that defines the expected behavior for the feature.
|
|
57
|
+
|
|
58
|
+
**STEP 1:** Validate test approach with the user before writing.
|
|
59
|
+
- Determine what type of test is appropriate (unit, integration, acceptance, etc.)
|
|
60
|
+
- Confirm your test will validate the actual requirements
|
|
61
|
+
- Ensure alignment with the feature specification
|
|
62
|
+
|
|
63
|
+
**STEP 2:** Write a focused, meaningful test.
|
|
64
|
+
- Clearly define the expected behavior
|
|
65
|
+
- Will fail initially since functionality doesn't exist yet
|
|
66
|
+
- Focus on one specific aspect of the functionality
|
|
67
|
+
- Use appropriate assertions (not meaningless checks like assert(true))
|
|
68
|
+
|
|
69
|
+
**STEP 3:** Validate test failure.
|
|
70
|
+
- Run the test to confirm it fails for the right reason
|
|
71
|
+
- Document the test and expected failure mode
|
|
72
|
+
- Update task progress
|
|
73
|
+
transitions:
|
|
74
|
+
- trigger: 'test_written_and_failing'
|
|
75
|
+
to: 'green'
|
|
76
|
+
additional_instructions: 'Update task progress as you complete test writing work.'
|
|
77
|
+
transition_reason: 'Failing test successfully written and validated, ready to implement'
|
|
78
|
+
|
|
79
|
+
- trigger: 'need_more_exploration'
|
|
80
|
+
to: 'explore'
|
|
81
|
+
transition_reason: 'Test writing revealed need for more exploration'
|
|
82
|
+
|
|
83
|
+
- trigger: 'abandon_feature'
|
|
84
|
+
to: 'explore'
|
|
85
|
+
additional_instructions: 'Clean up any test artifacts and prepare for new tasks.'
|
|
86
|
+
transition_reason: 'User decided to abandon feature during test phase'
|
|
87
|
+
|
|
88
|
+
green:
|
|
89
|
+
description: 'GREEN phase - Write only the necessary code to make the test pass'
|
|
90
|
+
allowed_file_patterns:
|
|
91
|
+
- '**/*'
|
|
92
|
+
default_instructions: |
|
|
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
|
|
110
|
+
transitions:
|
|
111
|
+
- trigger: 'test_passing'
|
|
112
|
+
to: 'refactor'
|
|
113
|
+
additional_instructions: 'Update task progress as you complete implementation work.'
|
|
114
|
+
transition_reason: 'Test passes with proper implementation, ready for refactoring'
|
|
115
|
+
|
|
116
|
+
- trigger: 'need_different_test'
|
|
117
|
+
to: 'red'
|
|
118
|
+
transition_reason: 'Implementation work revealed need to revise the test'
|
|
119
|
+
|
|
120
|
+
- trigger: 'need_more_exploration'
|
|
121
|
+
to: 'explore'
|
|
122
|
+
transition_reason: 'Implementation work revealed need for more exploration'
|
|
123
|
+
|
|
124
|
+
- trigger: 'abandon_feature'
|
|
125
|
+
to: 'explore'
|
|
126
|
+
additional_instructions: 'Clean up any incomplete code and prepare for new tasks.'
|
|
127
|
+
transition_reason: 'User decided to abandon feature during implementation'
|
|
128
|
+
|
|
129
|
+
refactor:
|
|
130
|
+
description: 'REFACTOR phase - Improve code quality while keeping tests green (cleanup phase)'
|
|
131
|
+
allowed_file_patterns:
|
|
132
|
+
- '**/*'
|
|
133
|
+
default_instructions: |
|
|
134
|
+
Improve code quality while keeping all tests green. This is the cleanup phase where you enhance readability and maintainability.
|
|
135
|
+
|
|
136
|
+
**STEP 1:** Identify improvement opportunities.
|
|
137
|
+
- Remove code duplication
|
|
138
|
+
- Improve variable and function names
|
|
139
|
+
- Extract methods for better organization
|
|
140
|
+
- Simplify complex logic
|
|
141
|
+
- Apply appropriate design patterns
|
|
142
|
+
|
|
143
|
+
**STEP 2:** Make incremental improvements safely.
|
|
144
|
+
- Run tests after each refactoring change
|
|
145
|
+
- Immediately revert any change that breaks tests
|
|
146
|
+
- Make small, focused improvements
|
|
147
|
+
- Stop when code is clean with no obvious improvements remaining
|
|
148
|
+
|
|
149
|
+
**STEP 3:** Document and complete.
|
|
150
|
+
- Document significant refactoring decisions
|
|
151
|
+
- Update task progress
|
|
152
|
+
transitions:
|
|
153
|
+
- trigger: 'refactoring_complete'
|
|
154
|
+
to: 'red'
|
|
155
|
+
additional_instructions: 'Update task progress as you complete refactoring work.'
|
|
156
|
+
transition_reason: 'Code cleanup complete, ready for next TDD cycle'
|
|
157
|
+
|
|
158
|
+
- trigger: 'need_different_approach'
|
|
159
|
+
to: 'green'
|
|
160
|
+
transition_reason: 'Refactoring revealed need to revise implementation'
|
|
161
|
+
|
|
162
|
+
- trigger: 'feature_complete'
|
|
163
|
+
to: 'explore'
|
|
164
|
+
additional_instructions: 'Update task progress to reflect feature completion.'
|
|
165
|
+
transition_reason: 'Feature fully implemented and cleaned up, ready for new tasks'
|
|
166
|
+
|
|
167
|
+
- trigger: 'abandon_feature'
|
|
168
|
+
to: 'explore'
|
|
169
|
+
additional_instructions: 'Clean up any refactoring work and prepare for new tasks.'
|
|
170
|
+
transition_reason: 'User decided to abandon feature during refactoring'
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# yaml-language-server: $schema=../state-machine-schema.json
|
|
2
|
+
---
|
|
3
|
+
name: 'waterfall'
|
|
4
|
+
description: 'V-Model: Specification down to test – the historical way. Ideal for larger, design-heavy tasks with well-defined requirements'
|
|
5
|
+
initial_state: 'requirements'
|
|
6
|
+
|
|
7
|
+
# Enhanced metadata for better discoverability
|
|
8
|
+
metadata:
|
|
9
|
+
domain: 'code'
|
|
10
|
+
complexity: 'high'
|
|
11
|
+
bestFor:
|
|
12
|
+
- 'Large feature development'
|
|
13
|
+
- 'Complex system changes'
|
|
14
|
+
- 'Well-defined requirements'
|
|
15
|
+
- 'Design-heavy projects'
|
|
16
|
+
useCases:
|
|
17
|
+
- 'Building a new module from scratch'
|
|
18
|
+
- 'Implementing complex business logic'
|
|
19
|
+
- 'Major architectural changes'
|
|
20
|
+
examples:
|
|
21
|
+
- 'Create a new authentication system'
|
|
22
|
+
- 'Build a reporting dashboard'
|
|
23
|
+
- 'Implement a payment processing workflow'
|
|
24
|
+
requiresDocumentation: true
|
|
25
|
+
|
|
26
|
+
# States with default instructions and transitions
|
|
27
|
+
states:
|
|
28
|
+
requirements:
|
|
29
|
+
description: 'Gathering and analyzing requirements'
|
|
30
|
+
allowed_file_patterns:
|
|
31
|
+
- '**/*.md'
|
|
32
|
+
- '**/*.txt'
|
|
33
|
+
- '**/*.adoc'
|
|
34
|
+
default_instructions: |
|
|
35
|
+
Familiarize yourself with the code base and understand project goals, scope, constraints, and success criteria.
|
|
36
|
+
|
|
37
|
+
- Who are the key stakeholders? (end users, business owners, technical teams)
|
|
38
|
+
- Which requirements are must-have vs nice-to-have?
|
|
39
|
+
- How will you measure success? What are the acceptance criteria?
|
|
40
|
+
- What are your time, budget, technical, or regulatory constraints?
|
|
41
|
+
- What existing systems must this integrate with?
|
|
42
|
+
|
|
43
|
+
Document all requirements in `$REQUIREMENTS_DOC`. Create actionable tasks referencing those requirements.
|
|
44
|
+
transitions:
|
|
45
|
+
- trigger: 'requirements_complete'
|
|
46
|
+
to: 'design'
|
|
47
|
+
transition_reason: 'All requirements tasks completed, moving to technical design'
|
|
48
|
+
review_perspectives:
|
|
49
|
+
- perspective: 'business_analyst'
|
|
50
|
+
prompt: 'Review requirements completeness, clarity, and business value. Ensure all stakeholder needs are captured and requirements are testable. Check for missing edge cases or unclear acceptance criteria.'
|
|
51
|
+
- perspective: 'ux_expert'
|
|
52
|
+
prompt: 'Evaluate user experience implications and usability requirements. Ensure user needs and workflows are properly defined. Identify potential UX challenges or accessibility concerns.'
|
|
53
|
+
|
|
54
|
+
design:
|
|
55
|
+
description: 'Technical design and architecture planning'
|
|
56
|
+
allowed_file_patterns:
|
|
57
|
+
- '**/*.md'
|
|
58
|
+
- '**/*.txt'
|
|
59
|
+
- '**/*.adoc'
|
|
60
|
+
default_instructions: |
|
|
61
|
+
Review requirements from `$REQUIREMENTS_DOC` and design the technical solution.
|
|
62
|
+
|
|
63
|
+
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.
|
|
64
|
+
|
|
65
|
+
Document architectural decisions in `$ARCHITECTURE_DOC` and detailed design in `$DESIGN_DOC`. Create tasks and ensure the approach is solid before implementation.
|
|
66
|
+
transitions:
|
|
67
|
+
- trigger: 'need_more_requirements'
|
|
68
|
+
to: 'requirements'
|
|
69
|
+
additional_instructions: 'Design work revealed gaps in requirements understanding. Focus on clarifying the specific requirements that are blocking design decisions.'
|
|
70
|
+
transition_reason: 'Design work revealed need for additional requirements clarification'
|
|
71
|
+
|
|
72
|
+
- trigger: 'design_complete'
|
|
73
|
+
to: 'implementation'
|
|
74
|
+
transition_reason: 'Technical design is complete, ready for implementation'
|
|
75
|
+
review_perspectives:
|
|
76
|
+
- perspective: 'architect'
|
|
77
|
+
prompt: 'Review technical architecture, design patterns, and system integration. Ensure scalability, maintainability, and alignment with existing systems. Evaluate technology choices and architectural decisions.'
|
|
78
|
+
- perspective: 'security_expert'
|
|
79
|
+
prompt: 'Evaluate security considerations, data protection, and potential vulnerabilities in the proposed design. Review authentication, authorization, data handling, and potential attack vectors.'
|
|
80
|
+
|
|
81
|
+
implementation:
|
|
82
|
+
description: 'Building the solution according to design'
|
|
83
|
+
allowed_file_patterns:
|
|
84
|
+
- '**/*'
|
|
85
|
+
default_instructions: |
|
|
86
|
+
Follow the architecture from `$ARCHITECTURE_DOC` and detailed design from `$DESIGN_DOC` to build the solution.
|
|
87
|
+
|
|
88
|
+
Before starting, clarify the approach:
|
|
89
|
+
- Should this be implemented incrementally or all at once? Any specific order of implementation?
|
|
90
|
+
- Are there high-risk parts that need extra validation or careful implementation?
|
|
91
|
+
|
|
92
|
+
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.
|
|
93
|
+
transitions:
|
|
94
|
+
- trigger: 'need_design_changes'
|
|
95
|
+
to: 'design'
|
|
96
|
+
additional_instructions: "Implementation revealed issues with the current design. Consider what you've learned during coding and adjust the design accordingly. Document the changes and reasons."
|
|
97
|
+
transition_reason: 'Implementation work revealed need to revise the design'
|
|
98
|
+
|
|
99
|
+
- trigger: 'need_more_requirements'
|
|
100
|
+
to: 'requirements'
|
|
101
|
+
additional_instructions: 'Implementation revealed gaps in requirements understanding. Focus on clarifying the specific requirements that are blocking implementation.'
|
|
102
|
+
transition_reason: 'Implementation work revealed need for additional requirements'
|
|
103
|
+
|
|
104
|
+
- trigger: 'implementation_complete'
|
|
105
|
+
to: 'qa'
|
|
106
|
+
transition_reason: 'Core implementation is complete, ready for quality assurance'
|
|
107
|
+
review_perspectives:
|
|
108
|
+
- perspective: 'senior_software_developer'
|
|
109
|
+
prompt: 'Review code quality, best practices, and implementation approach. Ensure clean, maintainable, and efficient code. Check for proper error handling, logging, and code organization.'
|
|
110
|
+
- perspective: 'performance_engineer'
|
|
111
|
+
prompt: 'Assess performance implications, resource usage, and potential bottlenecks in the implementation. Review algorithms, data structures, and system resource utilization.'
|
|
112
|
+
|
|
113
|
+
qa:
|
|
114
|
+
description: 'Quality assurance and code review'
|
|
115
|
+
allowed_file_patterns:
|
|
116
|
+
- '**/*'
|
|
117
|
+
default_instructions: |
|
|
118
|
+
Perform systematic quality checks and code review:
|
|
119
|
+
|
|
120
|
+
**STEP 1: Automated Quality Checks**
|
|
121
|
+
- Run syntax checking tools or validate syntax manually
|
|
122
|
+
- Build the project to verify it compiles without errors
|
|
123
|
+
- Execute linting tools to ensure code style consistency
|
|
124
|
+
- Run existing tests to verify functionality
|
|
125
|
+
|
|
126
|
+
**STEP 2: Multi-Perspective Code Review**
|
|
127
|
+
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`.
|
|
128
|
+
|
|
129
|
+
Update task progress and mark completed work during QA review.
|
|
130
|
+
transitions:
|
|
131
|
+
- trigger: 'need_implementation_fixes'
|
|
132
|
+
to: 'implementation'
|
|
133
|
+
additional_instructions: 'Quality assurance revealed issues that require code changes. Focus on the specific problems identified during QA review.'
|
|
134
|
+
transition_reason: 'QA found issues requiring implementation fixes'
|
|
135
|
+
|
|
136
|
+
- trigger: 'need_design_changes'
|
|
137
|
+
to: 'design'
|
|
138
|
+
additional_instructions: 'Quality assurance revealed fundamental design issues. Consider the QA findings and adjust the design accordingly.'
|
|
139
|
+
transition_reason: 'QA found issues requiring design changes'
|
|
140
|
+
|
|
141
|
+
- trigger: 'qa_complete'
|
|
142
|
+
to: 'testing'
|
|
143
|
+
transition_reason: 'Quality assurance is complete, ready for comprehensive testing'
|
|
144
|
+
|
|
145
|
+
testing:
|
|
146
|
+
description: 'Comprehensive testing and validation'
|
|
147
|
+
allowed_file_patterns:
|
|
148
|
+
- '**/*'
|
|
149
|
+
default_instructions: |
|
|
150
|
+
Create and execute comprehensive test plans to validate feature completeness.
|
|
151
|
+
|
|
152
|
+
- Write and execute tests with focus on test coverage and edge cases
|
|
153
|
+
- Conduct integration testing to ensure all components work together
|
|
154
|
+
- Validate user acceptance and ensure everything works as expected
|
|
155
|
+
transitions:
|
|
156
|
+
- trigger: 'need_implementation_fixes'
|
|
157
|
+
to: 'implementation'
|
|
158
|
+
additional_instructions: 'Testing revealed bugs or issues that require code changes. Focus on the specific problems identified during testing.'
|
|
159
|
+
transition_reason: 'Testing found issues requiring implementation fixes'
|
|
160
|
+
|
|
161
|
+
- trigger: 'need_qa_review'
|
|
162
|
+
to: 'qa'
|
|
163
|
+
additional_instructions: 'Testing revealed quality issues that need additional QA review. Focus on the specific quality concerns identified.'
|
|
164
|
+
transition_reason: 'Testing found issues requiring additional QA review'
|
|
165
|
+
|
|
166
|
+
- trigger: 'testing_complete'
|
|
167
|
+
to: 'finalize'
|
|
168
|
+
transition_reason: 'All testing is complete, feature is ready for delivery'
|
|
169
|
+
review_perspectives:
|
|
170
|
+
- perspective: 'business_analyst'
|
|
171
|
+
prompt: 'Verify that all requirements have been met and business objectives are achieved. Ensure the solution delivers the expected business value and meets acceptance criteria.'
|
|
172
|
+
- perspective: 'ux_expert'
|
|
173
|
+
prompt: 'Confirm user experience goals are met and the solution is user-friendly and accessible. Validate that user workflows are intuitive and efficient.'
|
|
174
|
+
|
|
175
|
+
finalize:
|
|
176
|
+
description: 'Code cleanup and documentation finalization'
|
|
177
|
+
allowed_file_patterns:
|
|
178
|
+
- '**/*'
|
|
179
|
+
default_instructions: |
|
|
180
|
+
Complete the feature by cleaning up code and updating documentation.
|
|
181
|
+
|
|
182
|
+
**STEP 1: Code Cleanup**
|
|
183
|
+
|
|
184
|
+
Remove debug output and temporary code:
|
|
185
|
+
- Search for and remove all temporary debug output statements used during development
|
|
186
|
+
- Look for language-specific debug output methods (console logging, print statements, debug output functions)
|
|
187
|
+
|
|
188
|
+
Review and address TODO/FIXME comments:
|
|
189
|
+
- Address each TODO/FIXME comment by either implementing the solution or documenting why it's deferred
|
|
190
|
+
- Remove completed TODOs
|
|
191
|
+
- Convert remaining TODOs to proper issue tracking if needed
|
|
192
|
+
|
|
193
|
+
Remove debugging code blocks:
|
|
194
|
+
- Remove temporary debugging code, test code blocks, and commented-out code
|
|
195
|
+
- Clean up any experimental code that's no longer needed
|
|
196
|
+
- Ensure proper error handling replaces temporary debug logging
|
|
197
|
+
|
|
198
|
+
**STEP 2: Documentation Review**
|
|
199
|
+
|
|
200
|
+
Review and update documentation to reflect final implementation:
|
|
201
|
+
- Update `$REQUIREMENTS_DOC` if requirements changed during development
|
|
202
|
+
- Update `$ARCHITECTURE_DOC` if architectural decisions evolved
|
|
203
|
+
- Update `$DESIGN_DOC` if design details were refined or changed
|
|
204
|
+
- Compare documentation against actual implemented functionality
|
|
205
|
+
- Only modify documentation sections that have functional changes
|
|
206
|
+
- Remove references to development iterations, progress notes, and temporary decisions
|
|
207
|
+
- Ensure documentation describes the final implemented state, not the development process
|
|
208
|
+
- Ask user to review document updates
|
|
209
|
+
|
|
210
|
+
**STEP 3: Final Validation**
|
|
211
|
+
|
|
212
|
+
- Run existing tests to ensure cleanup didn't break functionality
|
|
213
|
+
- Verify documentation accuracy with a final review
|
|
214
|
+
- Ensure code is ready for production/delivery
|
|
215
|
+
|
|
216
|
+
Update task progress and mark completed work as you finalize the feature.
|
|
217
|
+
transitions:
|
|
218
|
+
- trigger: 'need_final_changes'
|
|
219
|
+
to: 'implementation'
|
|
220
|
+
additional_instructions: 'Finalization revealed issues that require code changes. Focus on the specific problems identified during final review.'
|
|
221
|
+
transition_reason: 'Final review found issues requiring implementation changes'
|
|
222
|
+
|
|
223
|
+
- trigger: 'finalization_complete'
|
|
224
|
+
to: 'requirements'
|
|
225
|
+
transition_reason: 'Feature delivery complete, beginning new development cycle'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,cAAc,YAAY,CAAC;AAE3B,4CAA4C;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type LoggerFactory } from '@codemcp/workflows-core';
|
|
2
|
-
import type { PluginInput } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* Logger interface for structured logging
|
|
5
|
-
*/
|
|
6
|
-
export interface Logger {
|
|
7
|
-
debug: (message: string, extra?: Record<string, unknown>) => void;
|
|
8
|
-
info: (message: string, extra?: Record<string, unknown>) => void;
|
|
9
|
-
warn: (message: string, extra?: Record<string, unknown>) => void;
|
|
10
|
-
error: (message: string, extra?: Record<string, unknown>) => void;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Create a logger factory that creates loggers which send output to OpenCode SDK.
|
|
14
|
-
* This factory can be passed to ServerContext so handlers use OpenCode logging.
|
|
15
|
-
*/
|
|
16
|
-
export declare function createOpenCodeLoggerFactory(client: PluginInput['client']): LoggerFactory;
|
|
17
|
-
/**
|
|
18
|
-
* Create a logger backed by core's createLogger + a LogSink that delegates
|
|
19
|
-
* log output to the OpenCode SDK client.app.log() API.
|
|
20
|
-
*/
|
|
21
|
-
export declare function createOpenCodeLogger(client: PluginInput['client']): Logger;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { createLogger as coreCreateLogger, registerLogSink, } from '@codemcp/workflows-core';
|
|
2
|
-
/**
|
|
3
|
-
* Create a logger factory that creates loggers which send output to OpenCode SDK.
|
|
4
|
-
* This factory can be passed to ServerContext so handlers use OpenCode logging.
|
|
5
|
-
*/
|
|
6
|
-
export function createOpenCodeLoggerFactory(client) {
|
|
7
|
-
const openCodeClient = client;
|
|
8
|
-
return (component) => {
|
|
9
|
-
return {
|
|
10
|
-
debug: (message, context) => {
|
|
11
|
-
openCodeClient.app
|
|
12
|
-
.log({
|
|
13
|
-
body: {
|
|
14
|
-
service: component,
|
|
15
|
-
level: 'debug',
|
|
16
|
-
message,
|
|
17
|
-
extra: context,
|
|
18
|
-
},
|
|
19
|
-
})
|
|
20
|
-
.catch(() => { });
|
|
21
|
-
},
|
|
22
|
-
info: (message, context) => {
|
|
23
|
-
openCodeClient.app
|
|
24
|
-
.log({
|
|
25
|
-
body: {
|
|
26
|
-
service: component,
|
|
27
|
-
level: 'info',
|
|
28
|
-
message,
|
|
29
|
-
extra: context,
|
|
30
|
-
},
|
|
31
|
-
})
|
|
32
|
-
.catch(() => { });
|
|
33
|
-
},
|
|
34
|
-
warn: (message, context) => {
|
|
35
|
-
openCodeClient.app
|
|
36
|
-
.log({
|
|
37
|
-
body: {
|
|
38
|
-
service: component,
|
|
39
|
-
level: 'warn',
|
|
40
|
-
message,
|
|
41
|
-
extra: context,
|
|
42
|
-
},
|
|
43
|
-
})
|
|
44
|
-
.catch(() => { });
|
|
45
|
-
},
|
|
46
|
-
error: (message, error, context) => {
|
|
47
|
-
const errorContext = error
|
|
48
|
-
? { ...context, error: error.message, stack: error.stack }
|
|
49
|
-
: context;
|
|
50
|
-
openCodeClient.app
|
|
51
|
-
.log({
|
|
52
|
-
body: {
|
|
53
|
-
service: component,
|
|
54
|
-
level: 'error',
|
|
55
|
-
message,
|
|
56
|
-
extra: errorContext,
|
|
57
|
-
},
|
|
58
|
-
})
|
|
59
|
-
.catch(() => { });
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Create a logger backed by core's createLogger + a LogSink that delegates
|
|
66
|
-
* log output to the OpenCode SDK client.app.log() API.
|
|
67
|
-
*/
|
|
68
|
-
export function createOpenCodeLogger(client) {
|
|
69
|
-
const openCodeClient = client;
|
|
70
|
-
const service = 'plugin.workflows';
|
|
71
|
-
// Register a LogSink that forwards core log events to the OpenCode SDK.
|
|
72
|
-
// The core LogSink interface uses 'warning' for warn-level; we map that
|
|
73
|
-
// back to 'warn' for the OpenCode SDK which expects the shorter form.
|
|
74
|
-
const sink = {
|
|
75
|
-
log: (level, _logger, message, context) => {
|
|
76
|
-
const sdkLevel = level === 'warning' ? 'warn' : level;
|
|
77
|
-
try {
|
|
78
|
-
return openCodeClient.app.log({
|
|
79
|
-
body: {
|
|
80
|
-
service,
|
|
81
|
-
level: sdkLevel,
|
|
82
|
-
message,
|
|
83
|
-
extra: context,
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
catch {
|
|
88
|
-
return Promise.resolve();
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
registerLogSink(sink);
|
|
93
|
-
// Return a Logger that delegates to the core logger.
|
|
94
|
-
// The core error() method has signature (message, error?, context?) so we
|
|
95
|
-
// wrap it to match our simpler (message, extra?) interface.
|
|
96
|
-
const coreLogger = coreCreateLogger('plugin.workflows');
|
|
97
|
-
return {
|
|
98
|
-
debug: (message, extra) => coreLogger.debug(message, extra),
|
|
99
|
-
info: (message, extra) => coreLogger.info(message, extra),
|
|
100
|
-
warn: (message, extra) => coreLogger.warn(message, extra),
|
|
101
|
-
error: (message, extra) => coreLogger.error(message, undefined, extra),
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=opencode-logger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"opencode-logger.js","sourceRoot":"","sources":["../src/opencode-logger.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OpenCode Workflows Plugin
|
|
3
|
-
*
|
|
4
|
-
* Integrates workflows-core state management with OpenCode hooks to provide
|
|
5
|
-
* phase-aware development guidance and file edit restrictions.
|
|
6
|
-
*
|
|
7
|
-
* Hooks implemented:
|
|
8
|
-
* 1. chat.message - Add synthetic part with phase instructions after each user message
|
|
9
|
-
* 2. tool.execute.before - Block editing of certain files based on phase
|
|
10
|
-
* 3. experimental.session.compacting - Inject workflow state into compaction context
|
|
11
|
-
*
|
|
12
|
-
* Logs are sent via OpenCode SDK's client.app.log() API
|
|
13
|
-
*/
|
|
14
|
-
import type { Plugin } from './types.js';
|
|
15
|
-
/**
|
|
16
|
-
* Main plugin export
|
|
17
|
-
*/
|
|
18
|
-
export declare const WorkflowsPlugin: Plugin;
|
|
19
|
-
declare const _default: {
|
|
20
|
-
id: string;
|
|
21
|
-
server: Plugin;
|
|
22
|
-
};
|
|
23
|
-
export default _default;
|