@codemcp/workflows 5.0.1 → 5.1.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.
Files changed (77) hide show
  1. package/SKILL.md +23 -0
  2. package/package.json +6 -2
  3. package/.prettierignore +0 -2
  4. package/.turbo/turbo-build.log +0 -4
  5. package/.vibe/conversation-state.sqlite +0 -0
  6. package/src/components/beads/beads-instruction-generator.ts +0 -230
  7. package/src/components/beads/beads-plan-manager.ts +0 -333
  8. package/src/components/beads/beads-task-backend-client.ts +0 -229
  9. package/src/index.ts +0 -93
  10. package/src/notification-service.ts +0 -23
  11. package/src/plugin-system/beads-plugin.ts +0 -649
  12. package/src/plugin-system/commit-plugin.ts +0 -252
  13. package/src/plugin-system/index.ts +0 -20
  14. package/src/plugin-system/plugin-interfaces.ts +0 -153
  15. package/src/plugin-system/plugin-registry.ts +0 -190
  16. package/src/resource-handlers/conversation-state.ts +0 -55
  17. package/src/resource-handlers/development-plan.ts +0 -48
  18. package/src/resource-handlers/index.ts +0 -73
  19. package/src/resource-handlers/system-prompt.ts +0 -55
  20. package/src/resource-handlers/workflow-resource.ts +0 -132
  21. package/src/response-renderer.ts +0 -116
  22. package/src/server-config.ts +0 -760
  23. package/src/server-helpers.ts +0 -245
  24. package/src/server-implementation.ts +0 -277
  25. package/src/server.ts +0 -9
  26. package/src/tool-handlers/base-tool-handler.ts +0 -151
  27. package/src/tool-handlers/conduct-review.ts +0 -190
  28. package/src/tool-handlers/get-tool-info.ts +0 -273
  29. package/src/tool-handlers/index.ts +0 -115
  30. package/src/tool-handlers/list-workflows.ts +0 -78
  31. package/src/tool-handlers/no-idea.ts +0 -47
  32. package/src/tool-handlers/proceed-to-phase.ts +0 -296
  33. package/src/tool-handlers/reset-development.ts +0 -90
  34. package/src/tool-handlers/resume-workflow.ts +0 -378
  35. package/src/tool-handlers/setup-project-docs.ts +0 -232
  36. package/src/tool-handlers/start-development.ts +0 -746
  37. package/src/tool-handlers/whats-next.ts +0 -246
  38. package/src/types.ts +0 -135
  39. package/src/version-info.ts +0 -213
  40. package/test/e2e/beads-plugin-integration.test.ts +0 -1623
  41. package/test/e2e/commit-plugin-integration.test.ts +0 -222
  42. package/test/e2e/core-functionality.test.ts +0 -167
  43. package/test/e2e/git-branch-detection.test.ts +0 -351
  44. package/test/e2e/mcp-contract.test.ts +0 -509
  45. package/test/e2e/plan-management.test.ts +0 -334
  46. package/test/e2e/plugin-system-integration.test.ts +0 -1410
  47. package/test/e2e/state-management.test.ts +0 -387
  48. package/test/e2e/workflow-integration.test.ts +0 -498
  49. package/test/unit/beads-instruction-generator.test.ts +0 -979
  50. package/test/unit/beads-phase-task-id-integration.test.ts +0 -535
  51. package/test/unit/beads-plugin-behavioral.test.ts +0 -545
  52. package/test/unit/beads-plugin.test.ts +0 -117
  53. package/test/unit/commit-plugin.test.ts +0 -196
  54. package/test/unit/conduct-review.test.ts +0 -151
  55. package/test/unit/conversation-not-found-error.test.ts +0 -120
  56. package/test/unit/plugin-error-handling.test.ts +0 -240
  57. package/test/unit/proceed-to-phase-plugin-integration.test.ts +0 -150
  58. package/test/unit/reset-functionality.test.ts +0 -72
  59. package/test/unit/resume-workflow.test.ts +0 -193
  60. package/test/unit/server-config-plugin-registry.test.ts +0 -99
  61. package/test/unit/server-tools.test.ts +0 -310
  62. package/test/unit/setup-project-docs-handler.test.ts +0 -268
  63. package/test/unit/start-development-artifact-detection.test.ts +0 -387
  64. package/test/unit/start-development-gitignore.test.ts +0 -178
  65. package/test/unit/start-development-goal-extraction.test.ts +0 -226
  66. package/test/unit/system-prompt-resource.test.ts +0 -102
  67. package/test/unit/tool-handlers/no-idea.test.ts +0 -40
  68. package/test/utils/e2e-test-setup.ts +0 -451
  69. package/test/utils/run-server-in-dir.sh +0 -27
  70. package/test/utils/temp-files.ts +0 -320
  71. package/test/utils/test-access.ts +0 -79
  72. package/test/utils/test-helpers.ts +0 -288
  73. package/test/utils/test-setup.ts +0 -77
  74. package/tsconfig.build.json +0 -10
  75. package/tsconfig.build.tsbuildinfo +0 -1
  76. package/tsconfig.json +0 -12
  77. package/vitest.config.ts +0 -19
@@ -1,320 +0,0 @@
1
- /**
2
- * Temporary File Management for Integration Tests
3
- *
4
- * Provides utilities for creating and managing real temporary files
5
- * for integration tests that spawn server processes.
6
- */
7
-
8
- import { mkdirSync, writeFileSync, rmSync, existsSync } from 'node:fs';
9
- import { rm } from 'node:fs/promises';
10
- import { join } from 'node:path';
11
- import { tmpdir } from 'node:os';
12
-
13
- /**
14
- * Temporary test project configuration
15
- */
16
- export interface TempProjectOptions {
17
- /** Custom state machine YAML content */
18
- customStateMachine?: string;
19
- /** Project name (used for directory name) */
20
- projectName?: string;
21
- /** Git branch name */
22
- gitBranch?: string;
23
- /** Additional files to create */
24
- additionalFiles?: Record<string, string>;
25
- /** Base directory for the project (defaults to OS temp dir) */
26
- baseDirectory?: string;
27
- }
28
-
29
- /**
30
- * Default state machine YAML for testing
31
- */
32
- export const DEFAULT_STATE_MACHINE_YAML = `
33
- name: "Development Workflow"
34
- description: "State machine for guiding feature development workflow"
35
- initial_state: "idle"
36
- states:
37
- idle:
38
- description: "Waiting for feature requests"
39
- transitions:
40
- - trigger: "new_feature_request"
41
- to: "requirements"
42
- instructions: "Start requirements analysis by asking the user clarifying questions about WHAT they need. Focus on understanding their goals, scope, and constraints. Break down their needs into specific, actionable tasks and document them in the plan file. Mark completed requirements tasks as you progress."
43
- transition_reason: "New feature request detected, starting requirements analysis"
44
- requirements:
45
- description: "Gathering requirements"
46
- transitions:
47
- - trigger: "requirements_complete"
48
- to: "design"
49
- instructions: "Help the user design the technical solution. Ask about quality goals, technology preferences, and architectural decisions. Document the design decisions and update the plan file. Mark completed requirements tasks as done."
50
- transition_reason: "Requirements gathering complete, starting design phase"
51
- design:
52
- description: "Designing solution"
53
- transitions:
54
- - trigger: "design_complete"
55
- to: "implementation"
56
- instructions: "Guide the user through implementing the solution. Follow coding best practices, provide structure guidance, and track implementation progress. Update the plan file and mark completed design tasks."
57
- transition_reason: "Design phase complete, starting implementation"
58
- implementation:
59
- description: "Implementing solution"
60
- transitions:
61
- - trigger: "implementation_complete"
62
- to: "qa"
63
- instructions: "Guide code review and quality validation. Ensure requirements are properly met, help with testing and documentation. Update the plan file and mark completed implementation tasks."
64
- transition_reason: "Implementation phase complete, starting QA"
65
- qa:
66
- description: "Quality assurance"
67
- transitions:
68
- - trigger: "qa_complete"
69
- to: "testing"
70
- instructions: "Guide comprehensive testing strategies. Help create and execute test plans, validate feature completeness. Update the plan file and mark completed QA tasks."
71
- transition_reason: "QA phase complete, starting testing"
72
- testing:
73
- description: "Testing solution"
74
- transitions:
75
- - trigger: "testing_complete"
76
- to: "complete"
77
- instructions: "Feature development is complete! All phases have been finished successfully. The feature is ready for delivery."
78
- transition_reason: "Testing phase complete, feature development finished"
79
- complete:
80
- description: "Feature complete"
81
- transitions: []
82
-
83
- direct_transitions:
84
- - state: "idle"
85
- instructions: "Returned to idle state"
86
- transition_reason: "Direct transition to idle state"
87
- - state: "requirements"
88
- instructions: "Starting requirements analysis"
89
- transition_reason: "Direct transition to requirements phase"
90
- - state: "design"
91
- instructions: "Starting design phase"
92
- transition_reason: "Direct transition to design phase"
93
- - state: "implementation"
94
- instructions: "Starting implementation phase"
95
- transition_reason: "Direct transition to implementation phase"
96
- - state: "qa"
97
- instructions: "Starting QA phase"
98
- transition_reason: "Direct transition to QA phase"
99
- - state: "testing"
100
- instructions: "Starting testing phase"
101
- transition_reason: "Direct transition to testing phase"
102
- - state: "complete"
103
- instructions: "Feature development complete"
104
- transition_reason: "Direct transition to complete phase"
105
- `;
106
-
107
- /**
108
- * Custom state machine YAML for testing
109
- */
110
- export const CUSTOM_STATE_MACHINE_YAML = `
111
- name: "Custom Test State Machine"
112
- description: "Simple two-phase state machine for testing"
113
- initial_state: "phase1"
114
- states:
115
- phase1:
116
- description: "First test phase"
117
- transitions:
118
- - trigger: "move_to_phase2"
119
- to: "phase2"
120
- instructions: "Moving to phase 2"
121
- transition_reason: "Transition to phase 2 triggered"
122
- phase2:
123
- description: "Second test phase"
124
- transitions: []
125
- direct_transitions:
126
- - state: "phase1"
127
- instructions: "Direct to phase 1"
128
- transition_reason: "Direct transition to phase 1"
129
- - state: "phase2"
130
- instructions: "Direct to phase 2"
131
- transition_reason: "Direct transition to phase 2"
132
- `;
133
-
134
- /**
135
- * Temporary project manager
136
- */
137
- export class TempProject {
138
- public readonly projectPath: string;
139
- private readonly cleanupPaths: string[] = [];
140
-
141
- constructor(options: TempProjectOptions = {}) {
142
- const {
143
- projectName = `test-project-${Date.now()}`,
144
- gitBranch = 'main',
145
- customStateMachine,
146
- additionalFiles = {},
147
- baseDirectory = tmpdir(),
148
- } = options;
149
-
150
- // Create temporary project directory
151
- this.projectPath = join(
152
- baseDirectory,
153
- 'responsible-vibe-tests',
154
- projectName
155
- );
156
- this.cleanupPaths.push(this.projectPath);
157
-
158
- // Create directory structure
159
- mkdirSync(this.projectPath, { recursive: true });
160
- mkdirSync(join(this.projectPath, '.vibe'), { recursive: true });
161
- mkdirSync(join(this.projectPath, '.git'), { recursive: true });
162
-
163
- // Create basic project files
164
- writeFileSync(
165
- join(this.projectPath, 'package.json'),
166
- JSON.stringify(
167
- {
168
- name: projectName,
169
- version: '1.0.0',
170
- },
171
- null,
172
- 2
173
- )
174
- );
175
-
176
- // Create git branch file
177
- writeFileSync(
178
- join(this.projectPath, '.git', 'HEAD'),
179
- `ref: refs/heads/${gitBranch}`
180
- );
181
-
182
- // Create custom state machine if provided
183
- if (customStateMachine) {
184
- writeFileSync(
185
- join(this.projectPath, '.vibe', 'workflow.yaml'),
186
- customStateMachine
187
- );
188
- }
189
-
190
- // Create additional files
191
- for (const [filePath, content] of Object.entries(additionalFiles)) {
192
- const fullPath = join(this.projectPath, filePath);
193
- const dir = fullPath.substring(0, fullPath.lastIndexOf('/'));
194
- mkdirSync(dir, { recursive: true });
195
- writeFileSync(fullPath, content);
196
- }
197
- }
198
-
199
- /**
200
- * Add a file to the project
201
- */
202
- addFile(relativePath: string, content: string): void {
203
- const fullPath = join(this.projectPath, relativePath);
204
- const dir = fullPath.substring(0, fullPath.lastIndexOf('/'));
205
- mkdirSync(dir, { recursive: true });
206
- writeFileSync(fullPath, content);
207
- }
208
-
209
- /**
210
- * Check if a file exists in the project
211
- */
212
- hasFile(relativePath: string): boolean {
213
- return existsSync(join(this.projectPath, relativePath));
214
- }
215
-
216
- /**
217
- * Add mock project documents to satisfy artifact checking
218
- */
219
- addMockProjectDocs(): void {
220
- this.addFile(
221
- '.vibe/docs/architecture.md',
222
- '# Architecture\n\nMock architecture document for testing.'
223
- );
224
- this.addFile(
225
- '.vibe/docs/requirements.md',
226
- '# Requirements\n\nMock requirements document for testing.'
227
- );
228
- this.addFile(
229
- '.vibe/docs/design.md',
230
- '# Design\n\nMock design document for testing.'
231
- );
232
- }
233
-
234
- /**
235
- * Clean up the temporary project
236
- */
237
- cleanup(): void {
238
- for (const path of this.cleanupPaths) {
239
- if (existsSync(path)) {
240
- rmSync(path, { recursive: true, force: true });
241
- }
242
- }
243
- }
244
- }
245
-
246
- /**
247
- * Create a temporary project with custom state machine
248
- */
249
- export function createTempProjectWithCustomStateMachine(
250
- customStateMachine: string = CUSTOM_STATE_MACHINE_YAML,
251
- baseDirectory?: string
252
- ): TempProject {
253
- const project = new TempProject({
254
- customStateMachine,
255
- projectName: `custom-sm-${Date.now()}`,
256
- baseDirectory,
257
- });
258
-
259
- // Add mock project documents to satisfy artifact checking
260
- project.addMockProjectDocs();
261
-
262
- return project;
263
- }
264
-
265
- /**
266
- * Create a temporary project with default state machine (no custom one)
267
- */
268
- export function createTempProjectWithDefaultStateMachine(
269
- baseDirectory?: string
270
- ): TempProject {
271
- const project = new TempProject({
272
- projectName: `default-sm-${Date.now()}`,
273
- baseDirectory,
274
- });
275
-
276
- // Add mock project documents to satisfy artifact checking
277
- project.addMockProjectDocs();
278
-
279
- return project;
280
- }
281
-
282
- /**
283
- * Helper to safely parse JSON responses from server, handling error cases
284
- */
285
- export function safeParseServerResponse(
286
- content: Array<{ text?: string }>
287
- ): unknown {
288
- if (!content || content.length === 0) {
289
- throw new Error('No content in server response');
290
- }
291
-
292
- const text = content[0].text;
293
- if (!text) {
294
- throw new Error('No text content in server response');
295
- }
296
-
297
- // If the response starts with "Error:", it's an error message, not JSON
298
- if (typeof text === 'string' && text.startsWith('Error:')) {
299
- throw new Error(`Server error: ${text}`);
300
- }
301
-
302
- try {
303
- return JSON.parse(text);
304
- } catch {
305
- throw new Error(
306
- `Failed to parse server response as JSON: ${text.substring(0, 100)}...`
307
- );
308
- }
309
- }
310
-
311
- /**
312
- * Async helper to clean up a directory
313
- * Uses fs.rm which is the Node.js 14.14+ recommended approach
314
- * @param dirPath - Path to directory to remove
315
- */
316
- export async function cleanupDirectory(dirPath: string): Promise<void> {
317
- if (existsSync(dirPath)) {
318
- await rm(dirPath, { recursive: true, force: true });
319
- }
320
- }
@@ -1,79 +0,0 @@
1
- /**
2
- * Test Access Utilities
3
- *
4
- * Clean utilities for accessing private methods and properties in tests
5
- * without using @ts-ignore or unsafe type assertions.
6
- *
7
- * Note: Uses 'any' types intentionally for test utilities to access private members
8
- */
9
-
10
- /* eslint-disable @typescript-eslint/no-explicit-any */
11
-
12
- /**
13
- * Safely access a private property for testing purposes
14
- * @param instance - The class instance
15
- * @param propertyName - The name of the private property
16
- * @returns The property value
17
- */
18
- export function getPrivateProperty<T, K extends keyof T>(
19
- instance: T,
20
- propertyName: K
21
- ): T[K] {
22
- return (instance as any)[propertyName];
23
- }
24
-
25
- /**
26
- * Safely set a private property for testing purposes (e.g., injecting mocks)
27
- * @param instance - The class instance
28
- * @param propertyName - The name of the private property
29
- * @param value - The value to set
30
- */
31
- export function setPrivateProperty<T, K extends keyof T>(
32
- instance: T,
33
- propertyName: K,
34
- value: T[K]
35
- ): void {
36
- (instance as any)[propertyName] = value;
37
- }
38
-
39
- /**
40
- * Safely call a private method for testing purposes
41
- * @param instance - The class instance
42
- * @param methodName - The name of the private method
43
- * @param args - Arguments to pass to the method
44
- * @returns The method return value
45
- */
46
- export function callPrivateMethod<T>(
47
- instance: T,
48
- methodName: string,
49
- ...args: unknown[]
50
- ): unknown {
51
- return (instance as any)[methodName](...args);
52
- }
53
-
54
- /**
55
- * Type-safe helper specifically for common test scenarios
56
- */
57
- export class TestAccess {
58
- /**
59
- * Inject a mock dependency into a private property
60
- */
61
- static injectMock<T>(
62
- instance: T,
63
- propertyName: string,
64
- mockValue: unknown
65
- ): void {
66
- setPrivateProperty(instance, propertyName as keyof T, mockValue);
67
- }
68
-
69
- /**
70
- * Call a private method with proper typing
71
- */
72
- static callMethod<T>(
73
- instance: T,
74
- methodName: string,
75
- ...args: unknown[]
76
- ): unknown {
77
- return callPrivateMethod(instance, methodName, ...args);
78
- }
79
- }
@@ -1,288 +0,0 @@
1
- /**
2
- * Shared Test Utilities
3
- *
4
- * Common utilities to eliminate repetition across test files
5
- */
6
-
7
- import { mkdirSync, writeFileSync, existsSync } from 'node:fs';
8
- import { execSync } from 'node:child_process';
9
- import { join } from 'node:path';
10
- import { vi, expect } from 'vitest';
11
- import {
12
- ResponsibleVibeMCPServer,
13
- createResponsibleVibeMCPServer,
14
- } from '../../src/server.js';
15
- import type { ServerContext } from '../../src/types';
16
- import type { StartDevelopmentResult } from '../../src/tool-handlers/start-development.js';
17
- import { TempProject } from './temp-files.js';
18
- import { PluginRegistry } from '../../src/plugin-system/plugin-registry.js';
19
-
20
- /**
21
- * Mock project documents content
22
- */
23
- export const MOCK_DOCS = {
24
- architecture: '# Architecture\n\nMock architecture document for testing.',
25
- requirements: '# Requirements\n\nMock requirements document for testing.',
26
- design: '# Design\n\nMock design document for testing.',
27
- } as const;
28
-
29
- /**
30
- * Git repository setup utilities
31
- */
32
- export class GitTestHelper {
33
- static initializeRepo(projectPath: string): void {
34
- execSync('git init', { cwd: projectPath });
35
- execSync('git config user.email "test@example.com"', { cwd: projectPath });
36
- execSync('git config user.name "Test User"', { cwd: projectPath });
37
- }
38
-
39
- static createInitialCommit(projectPath: string): void {
40
- writeFileSync(join(projectPath, 'README.md'), '# Test Project');
41
- execSync('git add .', { cwd: projectPath });
42
- execSync('git commit -m "Initial commit"', { cwd: projectPath });
43
- }
44
-
45
- static createFeatureBranch(
46
- projectPath: string,
47
- branchName: string = 'feature/test'
48
- ): void {
49
- execSync(`git checkout -b ${branchName}`, { cwd: projectPath });
50
- }
51
-
52
- static setupFullRepo(projectPath: string, branchName?: string): void {
53
- this.initializeRepo(projectPath);
54
- this.createInitialCommit(projectPath);
55
- if (branchName) {
56
- this.createFeatureBranch(projectPath, branchName);
57
- }
58
- }
59
- }
60
-
61
- /**
62
- * Server test utilities
63
- */
64
- export class ServerTestHelper {
65
- static async createServer(
66
- projectPath: string,
67
- options: { enableLogging?: boolean } = {}
68
- ): Promise<ResponsibleVibeMCPServer> {
69
- const server = await createResponsibleVibeMCPServer({
70
- projectPath,
71
- enableLogging: options.enableLogging ?? false,
72
- });
73
- await server.initialize();
74
- return server;
75
- }
76
-
77
- static async cleanupServer(server: ResponsibleVibeMCPServer): Promise<void> {
78
- if (server) {
79
- await server.cleanup();
80
- }
81
- }
82
- }
83
-
84
- /**
85
- * Mock project documents utilities
86
- */
87
- export class MockDocsHelper {
88
- static addToProject(projectPath: string): void {
89
- const docsDir = join(projectPath, '.vibe', 'docs');
90
- mkdirSync(docsDir, { recursive: true });
91
-
92
- for (const [docType, content] of Object.entries(MOCK_DOCS)) {
93
- writeFileSync(join(docsDir, `${docType}.md`), content);
94
- }
95
- }
96
-
97
- static addToTempProject(tempProject: TempProject): void {
98
- tempProject.addMockProjectDocs();
99
- }
100
-
101
- static ensureExists(projectPath: string): void {
102
- if (!existsSync(join(projectPath, '.vibe', 'docs'))) {
103
- this.addToProject(projectPath);
104
- }
105
- }
106
- }
107
-
108
- /**
109
- * Mock context factory for unit tests
110
- */
111
- export class MockContextFactory {
112
- static createBasicContext(
113
- projectPath: string,
114
- overrides: Partial<ServerContext> = {}
115
- ) {
116
- return {
117
- projectPath,
118
- pluginRegistry: new PluginRegistry(),
119
- workflowManager: {
120
- validateWorkflowName: vi.fn().mockReturnValue(true),
121
- getWorkflowNames: vi
122
- .fn()
123
- .mockReturnValue(['waterfall', 'epcc', 'greenfield']),
124
- loadProjectWorkflows: vi.fn(),
125
- loadWorkflowForProject: vi.fn().mockReturnValue({
126
- initial_state: 'requirements',
127
- states: {
128
- requirements: {
129
- description: 'Define requirements',
130
- instructions: 'Create detailed requirements for the project.',
131
- },
132
- },
133
- }),
134
- },
135
- conversationManager: {
136
- createConversationContext: vi.fn().mockResolvedValue({
137
- conversationId: 'test-conversation',
138
- currentPhase: 'requirements',
139
- projectPath,
140
- planFilePath: join(projectPath, '.vibe', 'plan.md'),
141
- gitBranch: 'feature-branch',
142
- }),
143
- updateConversationState: vi.fn(),
144
- },
145
- transitionEngine: {
146
- handleExplicitTransition: vi.fn().mockResolvedValue({
147
- newPhase: 'requirements',
148
- }),
149
- },
150
- planManager: {
151
- setStateMachine: vi.fn(),
152
- ensurePlanFile: vi.fn(),
153
- },
154
- ...overrides,
155
- };
156
- }
157
-
158
- static createProjectDocsManagerMock(projectPath: string) {
159
- return {
160
- getProjectDocsInfo: vi.fn(),
161
- getVariableSubstitutions: vi.fn().mockReturnValue({
162
- $ARCHITECTURE_DOC: join(
163
- projectPath,
164
- '.vibe',
165
- 'docs',
166
- 'architecture.md'
167
- ),
168
- $REQUIREMENTS_DOC: join(
169
- projectPath,
170
- '.vibe',
171
- 'docs',
172
- 'requirements.md'
173
- ),
174
- $DESIGN_DOC: join(projectPath, '.vibe', 'docs', 'design.md'),
175
- }),
176
- templateManager: {
177
- getAvailableTemplates: vi.fn().mockResolvedValue({
178
- architecture: ['arc42', 'freestyle'],
179
- requirements: ['ears', 'freestyle'],
180
- design: ['comprehensive', 'freestyle'],
181
- }),
182
- getDefaults: vi.fn().mockResolvedValue({
183
- architecture: 'freestyle',
184
- requirements: 'freestyle',
185
- design: 'freestyle',
186
- }),
187
- },
188
- };
189
- }
190
- }
191
-
192
- /**
193
- * Test workflow patterns
194
- */
195
- export const TEST_WORKFLOWS = {
196
- simple: {
197
- initial_state: 'requirements',
198
- states: {
199
- requirements: {
200
- description: 'Define requirements',
201
- instructions: 'Create detailed requirements for the project.',
202
- },
203
- },
204
- },
205
-
206
- withArchDoc: {
207
- initial_state: 'design',
208
- states: {
209
- design: {
210
- description: 'Create design',
211
- instructions:
212
- 'Review the architecture in $ARCHITECTURE_DOC and create detailed design.',
213
- },
214
- },
215
- },
216
-
217
- withMultipleDocs: {
218
- initial_state: 'implementation',
219
- states: {
220
- implementation: {
221
- description: 'Implement solution',
222
- instructions:
223
- 'Follow the architecture in $ARCHITECTURE_DOC and implement according to $DESIGN_DOC requirements.',
224
- },
225
- testing: {
226
- description: 'Test solution',
227
- instructions: 'Verify all requirements from $REQUIREMENTS_DOC are met.',
228
- },
229
- },
230
- },
231
-
232
- // Test workflows with requiresDocumentation: true
233
- requiredArchDoc: {
234
- initial_state: 'design',
235
- metadata: {
236
- requiresDocumentation: true,
237
- },
238
- states: {
239
- design: {
240
- description: 'Create design',
241
- instructions:
242
- 'Review the architecture in $ARCHITECTURE_DOC and create detailed design.',
243
- },
244
- },
245
- },
246
-
247
- requiredMultipleDocs: {
248
- initial_state: 'implementation',
249
- metadata: {
250
- requiresDocumentation: true,
251
- },
252
- states: {
253
- implementation: {
254
- description: 'Implement solution',
255
- instructions:
256
- 'Follow the architecture in $ARCHITECTURE_DOC and implement according to $DESIGN_DOC requirements.',
257
- },
258
- testing: {
259
- description: 'Test solution',
260
- instructions: 'Verify all requirements from $REQUIREMENTS_DOC are met.',
261
- },
262
- },
263
- },
264
- } as const;
265
-
266
- /**
267
- * Common test assertions
268
- */
269
- export class TestAssertions {
270
- static expectValidResult(result: StartDevelopmentResult): void {
271
- expect(result).toBeTypeOf('object');
272
- expect(result.phase).toBeDefined();
273
- expect(result.instructions).toBeDefined();
274
- }
275
-
276
- static expectArtifactSetupPhase(result: StartDevelopmentResult): void {
277
- expect(result.phase).toBe('artifact-setup');
278
- expect(result.instructions).toContain('Referenced Variables');
279
- }
280
-
281
- static expectNormalPhase(
282
- result: StartDevelopmentResult,
283
- expectedPhase: string
284
- ): void {
285
- expect(result.phase).toBe(expectedPhase);
286
- expect(result.instructions).toBeDefined();
287
- }
288
- }