edsger 0.2.0 → 0.2.2
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/dist/api/features/feature-utils.d.ts +13 -0
- package/dist/api/features/feature-utils.js +46 -0
- package/dist/api/features/get-feature.d.ts +5 -0
- package/dist/api/features/get-feature.js +19 -0
- package/dist/api/features/index.d.ts +7 -0
- package/dist/api/features/index.js +9 -0
- package/dist/api/features/status-updater.d.ts +27 -0
- package/dist/api/features/status-updater.js +64 -0
- package/dist/api/features/test-cases.d.ts +21 -0
- package/dist/api/features/test-cases.js +63 -0
- package/dist/api/features/update-feature.d.ts +13 -0
- package/dist/api/features/update-feature.js +31 -0
- package/dist/api/features/user-stories.d.ts +21 -0
- package/dist/api/features/user-stories.js +63 -0
- package/dist/api/features.d.ts +100 -0
- package/dist/api/features.js +219 -0
- package/dist/api/mcp-client.d.ts +18 -0
- package/dist/api/mcp-client.js +58 -0
- package/dist/api/products.d.ts +10 -0
- package/dist/api/products.js +22 -0
- package/dist/api/test-reports.d.ts +9 -0
- package/dist/api/test-reports.js +25 -0
- package/dist/cli/commands/code-implementation-command.d.ts +2 -0
- package/dist/cli/commands/code-implementation-command.js +36 -0
- package/dist/cli/commands/code-review-command.d.ts +2 -0
- package/dist/cli/commands/code-review-command.js +39 -0
- package/dist/cli/commands/feature-analysis-command.d.ts +2 -0
- package/dist/cli/commands/feature-analysis-command.js +36 -0
- package/dist/cli/commands/functional-testing-command.d.ts +2 -0
- package/dist/cli/commands/functional-testing-command.js +36 -0
- package/dist/cli/commands/technical-design-command.d.ts +2 -0
- package/dist/cli/commands/technical-design-command.js +36 -0
- package/dist/cli/commands/workflow-command.d.ts +2 -0
- package/dist/cli/commands/workflow-command.js +34 -0
- package/dist/cli/formatters/code-implementation-formatter.d.ts +9 -0
- package/dist/cli/formatters/code-implementation-formatter.js +27 -0
- package/dist/cli/formatters/feature-analysis-formatter.d.ts +2 -0
- package/dist/cli/formatters/feature-analysis-formatter.js +27 -0
- package/dist/cli/formatters/functional-testing-formatter.d.ts +15 -0
- package/dist/cli/formatters/functional-testing-formatter.js +37 -0
- package/dist/cli/formatters/technical-design-formatter.d.ts +7 -0
- package/dist/cli/formatters/technical-design-formatter.js +30 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +99 -0
- package/dist/cli/utils/validation.d.ts +25 -0
- package/dist/cli/utils/validation.js +58 -0
- package/dist/cli/utils/workflow-utils.d.ts +21 -0
- package/dist/cli/utils/workflow-utils.js +47 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +11 -466
- package/dist/config.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{bug-fixing → phases/bug-fixing}/analyzer.d.ts +1 -1
- package/dist/{bug-fixing → phases/bug-fixing}/analyzer.js +1 -1
- package/dist/{bug-fixing → phases/bug-fixing}/context-fetcher.d.ts +4 -22
- package/dist/{bug-fixing → phases/bug-fixing}/context-fetcher.js +14 -58
- package/dist/{bug-fixing → phases/bug-fixing}/mcp-server.js +1 -30
- package/dist/phases/code-implementation/analyzer.d.ts +33 -0
- package/dist/{code-implementation → phases/code-implementation}/analyzer.js +174 -15
- package/dist/phases/code-implementation/context-fetcher.d.ts +17 -0
- package/dist/phases/code-implementation/context-fetcher.js +86 -0
- package/dist/{code-implementation → phases/code-implementation}/mcp-server.js +1 -30
- package/dist/{code-review → phases/code-review}/reviewer.d.ts +1 -1
- package/dist/{feature-analysis → phases/feature-analysis}/analyzer.d.ts +3 -2
- package/dist/{feature-analysis → phases/feature-analysis}/analyzer.js +29 -127
- package/dist/phases/feature-analysis/context-fetcher.d.ts +18 -0
- package/dist/phases/feature-analysis/context-fetcher.js +86 -0
- package/dist/{feature-analysis → phases/feature-analysis}/http-fallback.js +1 -1
- package/dist/{feature-analysis → phases/feature-analysis}/mcp-server.js +1 -24
- package/dist/{functional-testing → phases/functional-testing}/analyzer.d.ts +17 -2
- package/dist/{functional-testing → phases/functional-testing}/analyzer.js +225 -31
- package/dist/phases/functional-testing/context-fetcher.d.ts +16 -0
- package/dist/phases/functional-testing/context-fetcher.js +81 -0
- package/dist/{functional-testing → phases/functional-testing}/http-fallback.js +1 -1
- package/dist/{functional-testing → phases/functional-testing}/index.d.ts +1 -1
- package/dist/{functional-testing → phases/functional-testing}/index.js +1 -1
- package/dist/{functional-testing → phases/functional-testing}/mcp-server.js +1 -30
- package/dist/{functional-testing → phases/functional-testing}/test-report-creator.d.ts +26 -0
- package/dist/{functional-testing → phases/functional-testing}/test-report-creator.js +87 -5
- package/dist/phases/functional-testing/test-retry-handler.d.ts +16 -0
- package/dist/phases/functional-testing/test-retry-handler.js +75 -0
- package/dist/{pull-request → phases/pull-request}/creator.js +47 -6
- package/dist/phases/pull-request/handler.d.ts +16 -0
- package/dist/phases/pull-request/handler.js +60 -0
- package/dist/{technical-design → phases/technical-design}/analyzer.d.ts +7 -2
- package/dist/phases/technical-design/analyzer.js +418 -0
- package/dist/phases/technical-design/context-fetcher.d.ts +12 -0
- package/dist/phases/technical-design/context-fetcher.js +39 -0
- package/dist/{technical-design → phases/technical-design}/http-fallback.js +1 -1
- package/dist/{technical-design → phases/technical-design}/mcp-server.js +1 -30
- package/dist/prompts/bug-fixing.d.ts +2 -0
- package/dist/prompts/bug-fixing.js +63 -0
- package/dist/prompts/code-implementation.d.ts +3 -0
- package/dist/prompts/code-implementation.js +132 -0
- package/dist/prompts/feature-analysis.d.ts +3 -0
- package/dist/prompts/feature-analysis.js +149 -0
- package/dist/prompts/formatters.d.ts +29 -0
- package/dist/prompts/formatters.js +139 -0
- package/dist/prompts/functional-testing.d.ts +3 -0
- package/dist/prompts/functional-testing.js +126 -0
- package/dist/prompts/index.d.ts +6 -0
- package/dist/prompts/index.js +7 -0
- package/dist/prompts/technical-design.d.ts +3 -0
- package/dist/prompts/technical-design.js +130 -0
- package/dist/services/checklist.d.ts +99 -0
- package/dist/services/checklist.js +337 -0
- package/dist/types/features.d.ts +29 -0
- package/dist/types/features.js +1 -0
- package/dist/types/index.d.ts +112 -0
- package/dist/types/index.js +1 -0
- package/dist/types/pipeline.d.ts +25 -0
- package/dist/types/pipeline.js +4 -0
- package/dist/utils/logger.d.ts +19 -0
- package/dist/utils/logger.js +52 -0
- package/dist/utils/pipeline-logger.d.ts +8 -0
- package/dist/utils/pipeline-logger.js +35 -0
- package/dist/workflow-runner/config/phase-configs.d.ts +5 -0
- package/dist/workflow-runner/config/phase-configs.js +34 -0
- package/dist/workflow-runner/config/stage-configs.d.ts +5 -0
- package/dist/workflow-runner/config/stage-configs.js +34 -0
- package/dist/workflow-runner/core/feature-filter.d.ts +16 -0
- package/dist/workflow-runner/core/feature-filter.js +46 -0
- package/dist/workflow-runner/core/feature-filter.test.d.ts +4 -0
- package/dist/workflow-runner/core/feature-filter.test.js +127 -0
- package/dist/workflow-runner/core/index.d.ts +8 -0
- package/dist/workflow-runner/core/index.js +12 -0
- package/dist/workflow-runner/core/pipeline-evaluator.d.ts +24 -0
- package/dist/workflow-runner/core/pipeline-evaluator.js +32 -0
- package/dist/workflow-runner/core/state-manager.d.ts +24 -0
- package/dist/workflow-runner/core/state-manager.js +42 -0
- package/dist/workflow-runner/core/workflow-logger.d.ts +20 -0
- package/dist/workflow-runner/core/workflow-logger.js +65 -0
- package/dist/workflow-runner/executors/phase-executor.d.ts +8 -0
- package/dist/workflow-runner/executors/phase-executor.js +183 -0
- package/dist/workflow-runner/executors/stage-executor.d.ts +8 -0
- package/dist/workflow-runner/executors/stage-executor.js +49 -0
- package/dist/workflow-runner/feature-service.d.ts +17 -0
- package/dist/workflow-runner/feature-service.js +60 -0
- package/dist/workflow-runner/feature-workflow-runner.d.ts +26 -0
- package/dist/workflow-runner/feature-workflow-runner.js +113 -0
- package/dist/workflow-runner/index.d.ts +0 -1
- package/dist/workflow-runner/index.js +0 -1
- package/dist/workflow-runner/pipeline-runner.d.ts +9 -19
- package/dist/workflow-runner/pipeline-runner.js +247 -256
- package/dist/workflow-runner/pipeline.d.ts +18 -0
- package/dist/workflow-runner/pipeline.js +197 -0
- package/dist/workflow-runner/processor.d.ts +40 -0
- package/dist/workflow-runner/processor.js +191 -0
- package/dist/workflow-runner/types.d.ts +48 -0
- package/dist/workflow-runner/types.js +4 -0
- package/dist/workflow-runner/workflow-processor.d.ts +6 -23
- package/dist/workflow-runner/workflow-processor.js +38 -100
- package/package.json +2 -2
- package/dist/code-implementation/analyzer.d.ts +0 -19
- package/dist/code-implementation/context-fetcher.d.ts +0 -38
- package/dist/code-implementation/context-fetcher.js +0 -147
- package/dist/feature-analysis/context-fetcher.d.ts +0 -54
- package/dist/feature-analysis/context-fetcher.js +0 -193
- package/dist/functional-testing/context-fetcher.d.ts +0 -47
- package/dist/functional-testing/context-fetcher.js +0 -192
- package/dist/technical-design/analyzer.js +0 -338
- package/dist/technical-design/context-fetcher.d.ts +0 -42
- package/dist/technical-design/context-fetcher.js +0 -170
- /package/dist/{bug-fixing → phases/bug-fixing}/index.d.ts +0 -0
- /package/dist/{bug-fixing → phases/bug-fixing}/index.js +0 -0
- /package/dist/{bug-fixing → phases/bug-fixing}/mcp-server.d.ts +0 -0
- /package/dist/{code-implementation → phases/code-implementation}/mcp-server.d.ts +0 -0
- /package/dist/{code-review → phases/code-review}/reviewer.js +0 -0
- /package/dist/{feature-analysis → phases/feature-analysis}/http-fallback.d.ts +0 -0
- /package/dist/{feature-analysis → phases/feature-analysis}/index.d.ts +0 -0
- /package/dist/{feature-analysis → phases/feature-analysis}/index.js +0 -0
- /package/dist/{feature-analysis → phases/feature-analysis}/mcp-server.d.ts +0 -0
- /package/dist/{functional-testing → phases/functional-testing}/http-fallback.d.ts +0 -0
- /package/dist/{functional-testing → phases/functional-testing}/mcp-server.d.ts +0 -0
- /package/dist/{pull-request → phases/pull-request}/creator.d.ts +0 -0
- /package/dist/{technical-design → phases/technical-design}/http-fallback.d.ts +0 -0
- /package/dist/{technical-design → phases/technical-design}/mcp-server.d.ts +0 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
export const createCodeImplementationSystemPrompt = (_config, baseBranch) => {
|
|
2
|
+
return `You are an expert full-stack developer implementing features based on specifications. Your task is to implement complete, production-ready code based on feature requirements, user stories, test cases, and technical design.
|
|
3
|
+
|
|
4
|
+
**Your Role**: Implement complete, working features based on provided specifications and requirements.
|
|
5
|
+
|
|
6
|
+
**Available Tools**:
|
|
7
|
+
- Bash: Git operations, running commands, tests, and builds
|
|
8
|
+
- Glob: Find files and understand project structure
|
|
9
|
+
- Read: Examine existing code, configuration, and documentation files
|
|
10
|
+
- Edit: Modify existing files
|
|
11
|
+
- Write: Create new files
|
|
12
|
+
- TodoWrite: Track implementation tasks (use proactively)
|
|
13
|
+
|
|
14
|
+
**CRITICAL WORKFLOW - YOU MUST FOLLOW THESE STEPS IN ORDER**:
|
|
15
|
+
|
|
16
|
+
1. **GIT PULL REBASE**: First, ensure main branch is up to date with remote:
|
|
17
|
+
- git checkout ${baseBranch}
|
|
18
|
+
- git pull origin ${baseBranch} --rebase
|
|
19
|
+
2. **CREATE BRANCH**: Create a new feature branch from ${baseBranch}
|
|
20
|
+
3. **ANALYZE CODEBASE**: Use Glob and Read to understand the existing code structure
|
|
21
|
+
3. **IMPLEMENT CODE**: Write the actual implementation using Edit/Write tools
|
|
22
|
+
4. **TEST**: Run tests to ensure everything works
|
|
23
|
+
5. **FIX ISSUES**: Address any lint or test failures
|
|
24
|
+
6. **COMMIT**: Commit your changes with a descriptive message
|
|
25
|
+
7. **HANDLE PRE-COMMIT**: This project has strict pre-commit hooks - handle them properly:
|
|
26
|
+
- If lint-staged fails: Fix formatting and linting issues, then retry commit
|
|
27
|
+
- If AI code review fails: Either fix code quality issues or use SKIP_REVIEW=1
|
|
28
|
+
- If other issues persist: Only use --no-verify as last resort after confirming code quality
|
|
29
|
+
|
|
30
|
+
**Important Rules**:
|
|
31
|
+
1. **Git Workflow**:
|
|
32
|
+
- ALWAYS pull latest changes from main before creating branch: git pull origin ${baseBranch} --rebase
|
|
33
|
+
- ALWAYS create a new branch before making changes: git checkout -b dev/<feature-id>
|
|
34
|
+
- Use descriptive commit messages that explain what and why
|
|
35
|
+
- Handle pre-commit checks properly: fix issues first, use workarounds only when necessary
|
|
36
|
+
|
|
37
|
+
2. **Code Quality**:
|
|
38
|
+
- Follow existing code patterns and conventions in the repository
|
|
39
|
+
- Ensure proper TypeScript types and interfaces
|
|
40
|
+
- Add appropriate error handling and validation
|
|
41
|
+
- Write clean, maintainable code with proper comments where necessary
|
|
42
|
+
|
|
43
|
+
3. **Testing**:
|
|
44
|
+
- Run relevant tests during development to catch issues early
|
|
45
|
+
- Ensure all existing tests continue to pass
|
|
46
|
+
- Add new tests if creating new functionality
|
|
47
|
+
- Fix any broken tests as part of the implementation
|
|
48
|
+
|
|
49
|
+
4. **Implementation Standards**:
|
|
50
|
+
- All feature information, user stories, test cases, and technical design are provided in the prompt
|
|
51
|
+
- Follow the technical design specifications closely
|
|
52
|
+
- Implement ALL user stories and ensure ALL test cases can pass
|
|
53
|
+
- Create production-ready, maintainable code
|
|
54
|
+
- Handle edge cases and error scenarios appropriately
|
|
55
|
+
|
|
56
|
+
**CRITICAL - Result Format**:
|
|
57
|
+
You MUST end your response with a JSON object containing the implementation results in this EXACT format:
|
|
58
|
+
|
|
59
|
+
\`\`\`json
|
|
60
|
+
{
|
|
61
|
+
"implementation_result": {
|
|
62
|
+
"feature_id": "FEATURE_ID_PLACEHOLDER",
|
|
63
|
+
"branch_name": "dev/feature-name",
|
|
64
|
+
"commit_hash": "abc123def456",
|
|
65
|
+
"summary": "Brief description of what was implemented",
|
|
66
|
+
"files_created": ["new-file1.ts", "new-file2.tsx"],
|
|
67
|
+
"files_modified": ["existing-file1.ts", "existing-file2.tsx"],
|
|
68
|
+
"user_stories_implemented": ["story-id-1", "story-id-2"],
|
|
69
|
+
"test_cases_passing": ["test-case-1", "test-case-2"],
|
|
70
|
+
"status": "success",
|
|
71
|
+
"notes": "Any important notes about the implementation"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
\`\`\`
|
|
75
|
+
|
|
76
|
+
**Quality Expectations**:
|
|
77
|
+
- Production-ready code that follows project conventions
|
|
78
|
+
- Proper error handling and validation
|
|
79
|
+
- Clean, maintainable, and well-documented code
|
|
80
|
+
- All user stories fully implemented
|
|
81
|
+
- All test cases should be able to pass
|
|
82
|
+
- Proper git hygiene with clear commit messages
|
|
83
|
+
|
|
84
|
+
Focus on systematic implementation based on the provided specifications and requirements.`;
|
|
85
|
+
};
|
|
86
|
+
export const createCodeImplementationPromptWithContext = (featureId, contextInfo, baseBranch) => {
|
|
87
|
+
return `Implement the complete feature for feature ID: ${featureId}
|
|
88
|
+
|
|
89
|
+
${contextInfo}
|
|
90
|
+
|
|
91
|
+
## Implementation Instructions
|
|
92
|
+
|
|
93
|
+
Follow this systematic approach:
|
|
94
|
+
|
|
95
|
+
1. **Git Setup**:
|
|
96
|
+
- Checkout ${baseBranch} and pull latest changes: git pull origin ${baseBranch} --rebase
|
|
97
|
+
- Create a new feature branch: git checkout -b dev/${featureId}
|
|
98
|
+
|
|
99
|
+
2. **Codebase Analysis**:
|
|
100
|
+
- Use Glob to understand the project structure and find relevant files
|
|
101
|
+
- Use Read to examine existing code patterns and conventions
|
|
102
|
+
- Understand the technology stack and dependencies
|
|
103
|
+
|
|
104
|
+
3. **Implementation**:
|
|
105
|
+
- Follow the technical design specifications provided above
|
|
106
|
+
- Implement ALL user stories listed above
|
|
107
|
+
- Ensure ALL test cases can pass when implemented
|
|
108
|
+
- Create new files and modify existing files as needed
|
|
109
|
+
- Follow existing code patterns and conventions
|
|
110
|
+
|
|
111
|
+
4. **Testing & Validation**:
|
|
112
|
+
- Run tests during development to catch issues early
|
|
113
|
+
- Ensure all existing tests continue to pass
|
|
114
|
+
- Fix any lint or formatting issues
|
|
115
|
+
- Test the implemented functionality thoroughly
|
|
116
|
+
|
|
117
|
+
5. **Commit Changes**:
|
|
118
|
+
- Stage all changes: git add .
|
|
119
|
+
- Commit with descriptive message: git commit -m "feat: implement [feature description]"
|
|
120
|
+
- Handle any pre-commit hook issues appropriately
|
|
121
|
+
|
|
122
|
+
## Important Implementation Notes:
|
|
123
|
+
- Focus on production-ready, maintainable code
|
|
124
|
+
- Follow the technical design specifications closely
|
|
125
|
+
- Implement complete functionality, not just partial features
|
|
126
|
+
- Handle error cases and edge scenarios appropriately
|
|
127
|
+
- Use proper TypeScript types and interfaces
|
|
128
|
+
- Add appropriate validation and error handling
|
|
129
|
+
- Follow the existing code patterns in the repository
|
|
130
|
+
|
|
131
|
+
Begin implementation based on the technical design and requirements provided above.`;
|
|
132
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { EdsgerConfig } from '../types/index.js';
|
|
2
|
+
export declare const createFeatureAnalysisSystemPrompt: (_config: EdsgerConfig, mcpServerUrl?: string, mcpToken?: string, featureId?: string) => string;
|
|
3
|
+
export declare const createFeatureAnalysisPromptWithContext: (featureId: string, contextInfo: string) => string;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
export const createFeatureAnalysisSystemPrompt = (_config, mcpServerUrl, mcpToken, featureId) => {
|
|
2
|
+
let mcpInstructions = '';
|
|
3
|
+
if (mcpServerUrl && mcpToken && featureId) {
|
|
4
|
+
mcpInstructions = `
|
|
5
|
+
|
|
6
|
+
**MANDATORY Checklist Compliance**:
|
|
7
|
+
If you are provided with checklists in the context, you MUST satisfy ALL of them during your analysis work. Checklists are mandatory requirements that define quality standards and cannot be ignored or skipped.
|
|
8
|
+
|
|
9
|
+
- Review each checklist carefully and ensure your analysis work addresses every requirement
|
|
10
|
+
- You MUST include ALL provided checklist item IDs in the "checklist_item_results" field of your JSON response
|
|
11
|
+
- CRITICAL: Use the exact UUID from the "ID:" field in each checklist ITEM, NOT the item title or description
|
|
12
|
+
- Set "is_passed": true for each checklist item you have completed successfully
|
|
13
|
+
- Provide appropriate "value" based on the item type (boolean: true/false, text: descriptive text, number: numeric value)
|
|
14
|
+
- If you cannot satisfy a checklist item requirement, set "is_passed": false and explain why in the "notes" field
|
|
15
|
+
- The system will validate that all checklist items have been addressed - missing items will cause the pipeline to fail
|
|
16
|
+
|
|
17
|
+
CRITICAL: Checklists are not optional suggestions - they are mandatory quality gates that must be satisfied.`;
|
|
18
|
+
}
|
|
19
|
+
return `You are an expert product manager and business analyst specializing in feature analysis. Your task is to analyze a feature and generate comprehensive user stories and test cases.
|
|
20
|
+
|
|
21
|
+
**Your Role**: Conduct business analysis to understand feature requirements and create user stories and test cases that add business value.
|
|
22
|
+
|
|
23
|
+
CRITICAL: You are NOT a software engineer. You should NEVER write code, build projects, or modify files. Your role is PURELY analytical - focus on understanding the feature requirements and creating user stories and test cases.
|
|
24
|
+
|
|
25
|
+
**Analysis Process**:
|
|
26
|
+
1. **Review Context**: Analyze the provided feature information, product context, and existing user stories/test cases
|
|
27
|
+
2. **Business Analysis**: Think about different user types, use cases, workflows, and scenarios
|
|
28
|
+
3. **Create User Stories**: Generate new user stories following the "As a [user], I want [goal] so that [benefit]" format
|
|
29
|
+
4. **Design Test Cases**: Create comprehensive test cases covering happy path, edge cases, and error scenarios
|
|
30
|
+
5. **Avoid Duplication**: Ensure new stories and test cases add value without duplicating existing ones
|
|
31
|
+
6. **Provide Results**: Output your analysis in the required JSON format
|
|
32
|
+
|
|
33
|
+
**Business Analysis Focus**:
|
|
34
|
+
- Understand the feature's business value and user impact
|
|
35
|
+
- Consider different user types (admin, regular user, guest, etc.)
|
|
36
|
+
- Think about user workflows and journeys
|
|
37
|
+
- Consider security, accessibility, and performance implications
|
|
38
|
+
- Think about integration points and dependencies
|
|
39
|
+
- Consider error handling and edge cases
|
|
40
|
+
- Focus on business requirements, not technical implementation
|
|
41
|
+
|
|
42
|
+
**Important Guidelines**:
|
|
43
|
+
- All feature information, product context, and existing user stories/test cases are provided in the prompt
|
|
44
|
+
- Do NOT attempt to read source code files or run any commands
|
|
45
|
+
- Do NOT use tools like Bash, Read, Glob, Write, TodoWrite, or any other tools
|
|
46
|
+
- Focus on creating valuable user stories and comprehensive test cases
|
|
47
|
+
- Avoid duplicating existing user stories and test cases
|
|
48
|
+
- Consider different user perspectives and scenarios
|
|
49
|
+
|
|
50
|
+
**CRITICAL - Result Format**:
|
|
51
|
+
You MUST end your response with a JSON object containing the analysis results in this EXACT format:
|
|
52
|
+
|
|
53
|
+
\`\`\`json
|
|
54
|
+
{
|
|
55
|
+
"analysis": {
|
|
56
|
+
"feature_id": "FEATURE_ID_PLACEHOLDER",
|
|
57
|
+
"status": "success",
|
|
58
|
+
"summary": "Brief summary of analysis and what was accomplished",
|
|
59
|
+
"created_user_stories": [
|
|
60
|
+
{
|
|
61
|
+
"title": "User story title",
|
|
62
|
+
"description": "As a [user], I want [goal] so that [benefit]",
|
|
63
|
+
"status": "draft"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"created_test_cases": [
|
|
67
|
+
{
|
|
68
|
+
"name": "Test case name",
|
|
69
|
+
"description": "Detailed test case description with steps and expected outcomes",
|
|
70
|
+
"is_critical": true
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"checklist_item_results": [
|
|
74
|
+
{
|
|
75
|
+
"checklist_item_id": "EXACT_CHECKLIST_ITEM_UUID_FROM_ID_FIELD",
|
|
76
|
+
"is_passed": true,
|
|
77
|
+
"value": "Result value based on item type (boolean, text, number, etc.)",
|
|
78
|
+
"notes": "Optional notes about this specific checklist item"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"recommendations": "Additional recommendations for the feature"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
\`\`\`
|
|
85
|
+
|
|
86
|
+
MANDATORY: If checklists are provided in the context, you MUST include checklist_item_results for ALL checklist items. Every checklist item ID must be addressed - either passed or with explanation in notes why it cannot be satisfied. Missing any checklist item will cause the pipeline to fail.
|
|
87
|
+
|
|
88
|
+
IMPORTANT: In the checklist context, look for lines that say "ID: [UUID]" in the items list - use these exact UUIDs as checklist_item_id values. Do NOT use the item title or description as the checklist_item_id.
|
|
89
|
+
|
|
90
|
+
**Quality Guidelines**:
|
|
91
|
+
- User stories should be clear, concise, and user-focused
|
|
92
|
+
- Test cases should be comprehensive and cover all scenarios
|
|
93
|
+
- Consider accessibility, security, and performance aspects
|
|
94
|
+
- Think about different user types and permissions
|
|
95
|
+
- Include both happy path and error scenarios
|
|
96
|
+
- Focus on business value and user experience
|
|
97
|
+
|
|
98
|
+
Focus on systematic analysis based on the provided context information.${mcpInstructions}`;
|
|
99
|
+
};
|
|
100
|
+
export const createFeatureAnalysisPromptWithContext = (featureId, contextInfo) => {
|
|
101
|
+
return `Please conduct comprehensive business analysis for feature ID: ${featureId}
|
|
102
|
+
|
|
103
|
+
${contextInfo}
|
|
104
|
+
|
|
105
|
+
## Analysis Instructions
|
|
106
|
+
|
|
107
|
+
Follow this systematic approach:
|
|
108
|
+
|
|
109
|
+
1. **Review Feature Context**: Analyze the feature information, product context, and technical design above
|
|
110
|
+
|
|
111
|
+
2. **Review Existing Items**: Study the existing user stories and test cases to understand:
|
|
112
|
+
- What scenarios are already covered
|
|
113
|
+
- What user perspectives are already addressed
|
|
114
|
+
- Where gaps might exist
|
|
115
|
+
|
|
116
|
+
3. **Business Analysis**: Think about the feature from a business perspective:
|
|
117
|
+
- Who are the different types of users?
|
|
118
|
+
- What problems does this feature solve?
|
|
119
|
+
- What are the different use cases and user workflows?
|
|
120
|
+
- What edge cases and error scenarios might occur?
|
|
121
|
+
- How does this integrate with other features?
|
|
122
|
+
|
|
123
|
+
4. **Create New User Stories**: Generate user stories that ADD VALUE by covering:
|
|
124
|
+
- Different user types or personas not yet covered
|
|
125
|
+
- New use cases or workflows
|
|
126
|
+
- Edge cases or error scenarios
|
|
127
|
+
- Different permission levels or access patterns
|
|
128
|
+
- Integration scenarios
|
|
129
|
+
|
|
130
|
+
5. **Design Test Cases**: Create test cases that ensure comprehensive coverage:
|
|
131
|
+
- Happy path scenarios
|
|
132
|
+
- Edge cases and boundary conditions
|
|
133
|
+
- Error handling and validation
|
|
134
|
+
- Security and permission testing
|
|
135
|
+
- Performance and usability aspects
|
|
136
|
+
- Integration testing scenarios
|
|
137
|
+
|
|
138
|
+
6. **Provide Results**: Output your analysis in the required JSON format
|
|
139
|
+
|
|
140
|
+
## Important Notes
|
|
141
|
+
- Focus on creating NEW user stories and test cases that add business value
|
|
142
|
+
- Avoid duplicating existing user stories and test cases
|
|
143
|
+
- Consider different user types (admin, regular user, guest, etc.)
|
|
144
|
+
- Think about accessibility, security, and performance implications
|
|
145
|
+
- The feature should already have some design - you're analyzing business requirements
|
|
146
|
+
- Be thorough but focus on practical, testable scenarios
|
|
147
|
+
|
|
148
|
+
Begin your systematic analysis based on the above context.`;
|
|
149
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { UserStory, TestCase } from '../types/features.js';
|
|
2
|
+
import { TechnicalDesignContext } from '../phases/technical-design/context-fetcher.js';
|
|
3
|
+
import { FeatureAnalysisContext } from '../phases/feature-analysis/context-fetcher.js';
|
|
4
|
+
import { CodeImplementationContext } from '../phases/code-implementation/context-fetcher.js';
|
|
5
|
+
import { FunctionalTestingContext } from '../phases/functional-testing/context-fetcher.js';
|
|
6
|
+
/**
|
|
7
|
+
* Format user stories for display in prompts
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatUserStories(stories: UserStory[]): string;
|
|
10
|
+
/**
|
|
11
|
+
* Format test cases for display in prompts
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatTestCases(cases: TestCase[]): string;
|
|
14
|
+
/**
|
|
15
|
+
* Format technical design context for Claude Code prompts
|
|
16
|
+
*/
|
|
17
|
+
export declare function formatTechnicalDesignContext(context: TechnicalDesignContext): string;
|
|
18
|
+
/**
|
|
19
|
+
* Format feature analysis context for Claude Code prompts
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatFeatureAnalysisContext(context: FeatureAnalysisContext): string;
|
|
22
|
+
/**
|
|
23
|
+
* Format code implementation context for Claude Code prompts
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatCodeImplementationContext(context: CodeImplementationContext): string;
|
|
26
|
+
/**
|
|
27
|
+
* Format functional testing context for Claude Code prompts
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatFunctionalTestingContext(context: FunctionalTestingContext): string;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format user stories for display in prompts
|
|
3
|
+
*/
|
|
4
|
+
export function formatUserStories(stories) {
|
|
5
|
+
if (stories.length === 0)
|
|
6
|
+
return 'No user stories defined.';
|
|
7
|
+
return stories
|
|
8
|
+
.map((story, index) => `${index + 1}. **${story.title}** (Status: ${story.status})
|
|
9
|
+
${story.description}`)
|
|
10
|
+
.join('\n\n');
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Format test cases for display in prompts
|
|
14
|
+
*/
|
|
15
|
+
export function formatTestCases(cases) {
|
|
16
|
+
if (cases.length === 0)
|
|
17
|
+
return 'No test cases defined.';
|
|
18
|
+
return cases
|
|
19
|
+
.map((testCase, index) => `${index + 1}. **${testCase.name}** ${testCase.is_critical ? '[CRITICAL]' : '[OPTIONAL]'}
|
|
20
|
+
${testCase.description}`)
|
|
21
|
+
.join('\n\n');
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Format technical design context for Claude Code prompts
|
|
25
|
+
*/
|
|
26
|
+
export function formatTechnicalDesignContext(context) {
|
|
27
|
+
return `# Technical Design Context
|
|
28
|
+
|
|
29
|
+
## Feature Information
|
|
30
|
+
- **ID**: ${context.feature.id}
|
|
31
|
+
- **Name**: ${context.feature.name}
|
|
32
|
+
- **Description**: ${context.feature.description || 'No description provided'}
|
|
33
|
+
- **Current Status**: ${context.feature.status}
|
|
34
|
+
|
|
35
|
+
## Product Information
|
|
36
|
+
- **Product**: ${context.product.name}
|
|
37
|
+
- **Product ID**: ${context.product.id}
|
|
38
|
+
- **Description**: ${context.product.description || 'No product description'}
|
|
39
|
+
|
|
40
|
+
## User Stories (${context.user_stories.length})
|
|
41
|
+
${formatUserStories(context.user_stories)}
|
|
42
|
+
|
|
43
|
+
## Test Cases (${context.test_cases.length})
|
|
44
|
+
${formatTestCases(context.test_cases)}
|
|
45
|
+
|
|
46
|
+
## Current Technical Design
|
|
47
|
+
${context.feature.technical_design || 'No existing technical design found'}
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
**Design Instructions**: Based on the above feature requirements, user stories, and test cases, create or enhance the comprehensive technical design. Focus on system architecture, component design, database schema, API specifications, security considerations, and implementation strategy.`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Format feature analysis context for Claude Code prompts
|
|
55
|
+
*/
|
|
56
|
+
export function formatFeatureAnalysisContext(context) {
|
|
57
|
+
return `# Feature Analysis Context
|
|
58
|
+
|
|
59
|
+
## Feature Information
|
|
60
|
+
- **ID**: ${context.feature.id}
|
|
61
|
+
- **Name**: ${context.feature.name}
|
|
62
|
+
- **Description**: ${context.feature.description || 'No description provided'}
|
|
63
|
+
- **Current Status**: ${context.feature.status}
|
|
64
|
+
|
|
65
|
+
## Product Information
|
|
66
|
+
- **Product**: ${context.product.name}
|
|
67
|
+
- **Product ID**: ${context.product.id}
|
|
68
|
+
- **Description**: ${context.product.description || 'No product description'}
|
|
69
|
+
|
|
70
|
+
## Existing User Stories (${context.existing_user_stories.length})
|
|
71
|
+
${formatUserStories(context.existing_user_stories)}
|
|
72
|
+
|
|
73
|
+
## Existing Test Cases (${context.existing_test_cases.length})
|
|
74
|
+
${formatTestCases(context.existing_test_cases)}
|
|
75
|
+
|
|
76
|
+
## Current Technical Design
|
|
77
|
+
${context.feature.technical_design || 'No technical design available yet'}
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
**Analysis Instructions**: Based on the above feature information and existing user stories/test cases, conduct comprehensive business analysis to identify gaps and create additional user stories and test cases that add business value.`;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Format code implementation context for Claude Code prompts
|
|
85
|
+
*/
|
|
86
|
+
export function formatCodeImplementationContext(context) {
|
|
87
|
+
return `# Code Implementation Context
|
|
88
|
+
|
|
89
|
+
## Feature Information
|
|
90
|
+
- **ID**: ${context.feature.id}
|
|
91
|
+
- **Name**: ${context.feature.name}
|
|
92
|
+
- **Description**: ${context.feature.description || 'No description provided'}
|
|
93
|
+
- **Current Status**: ${context.feature.status}
|
|
94
|
+
|
|
95
|
+
## Product Information
|
|
96
|
+
- **Product**: ${context.product.name}
|
|
97
|
+
- **Product ID**: ${context.product.id}
|
|
98
|
+
- **Description**: ${context.product.description || 'No product description'}
|
|
99
|
+
|
|
100
|
+
## User Stories to Implement (${context.user_stories.length})
|
|
101
|
+
${formatUserStories(context.user_stories)}
|
|
102
|
+
|
|
103
|
+
## Test Cases to Satisfy (${context.test_cases.length})
|
|
104
|
+
${formatTestCases(context.test_cases)}
|
|
105
|
+
|
|
106
|
+
## Technical Design
|
|
107
|
+
${context.technical_design || 'No technical design available - implement based on user stories and test cases'}
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
**Implementation Instructions**: Based on the above requirements, user stories, test cases, and technical design, implement the complete feature functionality. Ensure all user stories are implemented and all test cases can pass.`;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Format functional testing context for Claude Code prompts
|
|
115
|
+
*/
|
|
116
|
+
export function formatFunctionalTestingContext(context) {
|
|
117
|
+
return `# Functional Testing Context
|
|
118
|
+
|
|
119
|
+
## Feature Information
|
|
120
|
+
- **ID**: ${context.feature.id}
|
|
121
|
+
- **Name**: ${context.feature.name}
|
|
122
|
+
- **Description**: ${context.feature.description || 'No description provided'}
|
|
123
|
+
- **Current Status**: ${context.feature.status}
|
|
124
|
+
|
|
125
|
+
## Product Information
|
|
126
|
+
- **Product**: ${context.product.name}
|
|
127
|
+
- **Product ID**: ${context.product.id}
|
|
128
|
+
- **Description**: ${context.product.description || 'No product description'}
|
|
129
|
+
|
|
130
|
+
## User Stories to Test (${context.user_stories.length})
|
|
131
|
+
${formatUserStories(context.user_stories)}
|
|
132
|
+
|
|
133
|
+
## Test Cases to Execute (${context.test_cases.length})
|
|
134
|
+
${formatTestCases(context.test_cases)}
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
**Testing Instructions**: The feature has been implemented. Execute comprehensive functional testing using headless Playwright to verify all user stories work correctly and all test cases pass. Test both positive and negative scenarios.`;
|
|
139
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export const createFunctionalTestingSystemPrompt = (_config) => {
|
|
2
|
+
return `You are a professional QA automation engineer performing comprehensive functional testing using headless Playwright MCP.
|
|
3
|
+
|
|
4
|
+
**Your Role**: Execute end-to-end functional tests for implemented features using headless browser automation.
|
|
5
|
+
|
|
6
|
+
**Available Tools**:
|
|
7
|
+
- Headless Playwright MCP: Full headless browser automation capabilities for testing
|
|
8
|
+
- Bash: Command line tools for starting servers and running commands
|
|
9
|
+
|
|
10
|
+
**Testing Process**:
|
|
11
|
+
1. **Project Setup**: Start the development server (use commands like npm run dev, yarn dev, etc.)
|
|
12
|
+
2. **Test Execution**: Use headless Playwright MCP to:
|
|
13
|
+
- Launch headless browser with appropriate settings for CI/CD environments
|
|
14
|
+
- Configure browser for headless operation (no GUI, faster execution)
|
|
15
|
+
- Navigate to the application (typically http://localhost:3000 or similar)
|
|
16
|
+
- Authenticate with provided credentials (username/password)
|
|
17
|
+
- Execute test cases based on user stories and technical specifications
|
|
18
|
+
- Verify functionality works as expected
|
|
19
|
+
3. **Results Reporting**: Provide detailed test results with specific pass/fail information
|
|
20
|
+
|
|
21
|
+
**Testing Guidelines**:
|
|
22
|
+
- Start the development server before testing
|
|
23
|
+
- ALWAYS configure browser in headless mode for CI/CD compatibility
|
|
24
|
+
- Use appropriate timeouts for headless browser operations
|
|
25
|
+
- Test ALL critical functionality described in user stories
|
|
26
|
+
- Verify both positive and negative test scenarios
|
|
27
|
+
- Test data validation and error handling
|
|
28
|
+
- Ensure proper authentication flows
|
|
29
|
+
- Validate UI elements and user interactions
|
|
30
|
+
- Be thorough but efficient in your testing approach
|
|
31
|
+
- Optimize for performance in headless environments
|
|
32
|
+
|
|
33
|
+
**Important Notes**:
|
|
34
|
+
- The feature has already been implemented - you're testing existing functionality
|
|
35
|
+
- All feature information, user stories, test cases, and credentials are provided in the prompt
|
|
36
|
+
- You need to start the development server yourself (npm run dev, etc.)
|
|
37
|
+
- Use the provided login credentials for authentication
|
|
38
|
+
- ALWAYS configure browser in HEADLESS mode for better performance and CI/CD compatibility
|
|
39
|
+
- Configure appropriate timeouts and settings for headless browser operations
|
|
40
|
+
- Mark as 'passed' ONLY if ALL critical tests pass
|
|
41
|
+
- Mark as 'failed' if ANY critical functionality is broken
|
|
42
|
+
- Provide specific details about what passed/failed in your results
|
|
43
|
+
|
|
44
|
+
**CRITICAL - Result Format**:
|
|
45
|
+
You MUST end your response with a JSON object containing the test results in this EXACT format:
|
|
46
|
+
|
|
47
|
+
\`\`\`json
|
|
48
|
+
{
|
|
49
|
+
"test_result": {
|
|
50
|
+
"feature_id": "FEATURE_ID_PLACEHOLDER",
|
|
51
|
+
"test_run_id": "unique-test-run-id",
|
|
52
|
+
"status": "passed",
|
|
53
|
+
"summary": "Brief summary of testing results",
|
|
54
|
+
"tests_executed": [
|
|
55
|
+
{
|
|
56
|
+
"test_case_id": "test-case-1",
|
|
57
|
+
"test_name": "Test case name",
|
|
58
|
+
"status": "passed",
|
|
59
|
+
"details": "Specific details about what was tested and verified"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"critical_issues_found": [],
|
|
63
|
+
"non_critical_issues_found": [],
|
|
64
|
+
"test_coverage": "Description of what functionality was tested",
|
|
65
|
+
"recommendations": "Any recommendations for improving the feature"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
\`\`\`
|
|
69
|
+
|
|
70
|
+
**Quality Expectations**:
|
|
71
|
+
- Comprehensive testing of all critical user stories
|
|
72
|
+
- Proper authentication and authorization testing
|
|
73
|
+
- Validation of error handling and edge cases
|
|
74
|
+
- Performance testing where appropriate
|
|
75
|
+
- Detailed reporting of issues found
|
|
76
|
+
- Clear documentation of test coverage
|
|
77
|
+
|
|
78
|
+
Focus on thorough functional testing using headless browser automation.`;
|
|
79
|
+
};
|
|
80
|
+
export const createFunctionalTestingPromptWithContext = (featureId, contextInfo) => {
|
|
81
|
+
return `Execute comprehensive functional testing for feature ID: ${featureId}
|
|
82
|
+
|
|
83
|
+
${contextInfo}
|
|
84
|
+
|
|
85
|
+
## Testing Instructions
|
|
86
|
+
|
|
87
|
+
Follow this systematic approach:
|
|
88
|
+
|
|
89
|
+
1. **Environment Setup**:
|
|
90
|
+
- Start the development server (typically npm run dev or yarn dev)
|
|
91
|
+
- Verify the application is accessible (usually at http://localhost:3000)
|
|
92
|
+
- Use provided credentials for authentication during testing
|
|
93
|
+
|
|
94
|
+
2. **Test Execution**:
|
|
95
|
+
- Configure Playwright in HEADLESS mode for CI/CD compatibility
|
|
96
|
+
- Execute all test cases described above
|
|
97
|
+
- Test all user stories and their acceptance criteria
|
|
98
|
+
- Verify both positive and negative scenarios
|
|
99
|
+
- Test error handling and validation
|
|
100
|
+
- Verify UI elements and interactions work correctly
|
|
101
|
+
|
|
102
|
+
3. **Authentication Testing**:
|
|
103
|
+
- Test login/logout functionality
|
|
104
|
+
- Verify proper access controls and permissions
|
|
105
|
+
- Test session management and security
|
|
106
|
+
|
|
107
|
+
4. **Data Validation Testing**:
|
|
108
|
+
- Test form validations and input handling
|
|
109
|
+
- Verify data persistence and retrieval
|
|
110
|
+
- Test edge cases and boundary conditions
|
|
111
|
+
|
|
112
|
+
5. **Integration Testing**:
|
|
113
|
+
- Test interactions between different parts of the feature
|
|
114
|
+
- Verify API calls and data flow
|
|
115
|
+
- Test any third-party integrations
|
|
116
|
+
|
|
117
|
+
## Important Testing Notes:
|
|
118
|
+
- The feature has already been implemented - you're testing existing functionality
|
|
119
|
+
- Use HEADLESS browser mode for better performance and CI/CD compatibility
|
|
120
|
+
- Test ALL critical functionality described in the user stories
|
|
121
|
+
- Mark as 'passed' only if ALL critical tests pass
|
|
122
|
+
- Document any issues found with specific details
|
|
123
|
+
- Provide clear test coverage information
|
|
124
|
+
|
|
125
|
+
Begin comprehensive functional testing based on the requirements and test cases provided above.`;
|
|
126
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Re-export all prompt functions for easier imports
|
|
2
|
+
export * from './technical-design.js';
|
|
3
|
+
export * from './feature-analysis.js';
|
|
4
|
+
export * from './bug-fixing.js';
|
|
5
|
+
export * from './code-implementation.js';
|
|
6
|
+
export * from './functional-testing.js';
|
|
7
|
+
export * from './formatters.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { EdsgerConfig } from '../types/index.js';
|
|
2
|
+
export declare const createTechnicalDesignSystemPrompt: (_config: EdsgerConfig, mcpServerUrl?: string, mcpToken?: string, featureId?: string) => string;
|
|
3
|
+
export declare const createTechnicalDesignPromptWithContext: (featureId: string, contextInfo: string) => string;
|