pupt 1.4.0 → 2.0.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/dist/cli.js +124 -38
- package/dist/cli.js.map +1 -1
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +15 -49
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/config.d.ts +9 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +120 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/edit.d.ts.map +1 -1
- package/dist/commands/edit.js +4 -3
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +14 -15
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +20 -45
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install.d.ts +6 -0
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +52 -6
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/migrate.d.ts +22 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +92 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +13 -77
- package/dist/commands/run.js.map +1 -1
- package/dist/config/config-manager.d.ts +9 -0
- package/dist/config/config-manager.d.ts.map +1 -1
- package/dist/config/config-manager.js +70 -64
- package/dist/config/config-manager.js.map +1 -1
- package/dist/config/migration.d.ts.map +1 -1
- package/dist/config/migration.js +52 -16
- package/dist/config/migration.js.map +1 -1
- package/dist/history/history-manager.js +1 -1
- package/dist/history/history-manager.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/schemas/config-schema.d.ts +522 -260
- package/dist/schemas/config-schema.d.ts.map +1 -1
- package/dist/schemas/config-schema.js +38 -22
- package/dist/schemas/config-schema.js.map +1 -1
- package/dist/schemas/prompt-schema.d.ts +115 -115
- package/dist/search/search-engine.d.ts.map +1 -1
- package/dist/search/search-engine.js +2 -1
- package/dist/search/search-engine.js.map +1 -1
- package/dist/services/input-collector.d.ts +9 -0
- package/dist/services/input-collector.d.ts.map +1 -0
- package/dist/services/input-collector.js +154 -0
- package/dist/services/input-collector.js.map +1 -0
- package/dist/services/prompt-converter.d.ts +27 -0
- package/dist/services/prompt-converter.d.ts.map +1 -0
- package/dist/services/prompt-converter.js +383 -0
- package/dist/services/prompt-converter.js.map +1 -0
- package/dist/services/prompt-resolver.d.ts +32 -0
- package/dist/services/prompt-resolver.d.ts.map +1 -0
- package/dist/services/prompt-resolver.js +71 -0
- package/dist/services/prompt-resolver.js.map +1 -0
- package/dist/services/pupt-service.d.ts +47 -0
- package/dist/services/pupt-service.d.ts.map +1 -0
- package/dist/services/pupt-service.js +252 -0
- package/dist/services/pupt-service.js.map +1 -0
- package/dist/services/review-data-builder.d.ts +1 -1
- package/dist/services/review-data-builder.d.ts.map +1 -1
- package/dist/services/review-data-builder.js +13 -9
- package/dist/services/review-data-builder.js.map +1 -1
- package/dist/types/config.d.ts +62 -12
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +1 -7
- package/dist/types/config.js.map +1 -1
- package/dist/types/prompt.d.ts +6 -0
- package/dist/types/prompt.d.ts.map +1 -1
- package/dist/types/prompt.js +23 -1
- package/dist/types/prompt.js.map +1 -1
- package/dist/utils/errors.js +1 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/path-utils.d.ts +42 -0
- package/dist/utils/path-utils.d.ts.map +1 -0
- package/dist/utils/path-utils.js +139 -0
- package/dist/utils/path-utils.js.map +1 -0
- package/dist/utils/prompt-format.d.ts +27 -0
- package/dist/utils/prompt-format.d.ts.map +1 -0
- package/dist/utils/prompt-format.js +28 -0
- package/dist/utils/prompt-format.js.map +1 -0
- package/package.json +3 -3
- package/prompts/ad-hoc-long.prompt +60 -0
- package/prompts/ad-hoc.prompt +32 -0
- package/prompts/add-summary.prompt +48 -0
- package/prompts/code-review.prompt +103 -0
- package/prompts/debugging-error-message.prompt +81 -0
- package/prompts/fix-github-actions.prompt +60 -0
- package/prompts/fix-test-errors.prompt +71 -0
- package/prompts/git-commit-comment.prompt +59 -0
- package/prompts/implementation-phase.prompt +57 -0
- package/prompts/implementation-plan.prompt +105 -0
- package/prompts/new-feature.prompt +93 -0
- package/prompts/new-project.prompt +9 -0
- package/prompts/one-shot-change.prompt +77 -0
- package/prompts/pupt-prompt-improvement.prompt +265 -0
- package/prompts/simple-test.prompt +8 -0
- package/prompts/update-design.prompt +75 -0
- package/prompts/update-documentation.prompt +6 -0
- package/dist/prompts/prompt-manager.d.ts +0 -12
- package/dist/prompts/prompt-manager.d.ts.map +0 -1
- package/dist/prompts/prompt-manager.js +0 -102
- package/dist/prompts/prompt-manager.js.map +0 -1
- package/dist/services/auto-annotation-service.d.ts +0 -40
- package/dist/services/auto-annotation-service.d.ts.map +0 -1
- package/dist/services/auto-annotation-service.js +0 -439
- package/dist/services/auto-annotation-service.js.map +0 -1
- package/dist/services/prompt-service.d.ts +0 -31
- package/dist/services/prompt-service.d.ts.map +0 -1
- package/dist/services/prompt-service.js +0 -278
- package/dist/services/prompt-service.js.map +0 -1
- package/dist/template/helpers/index.d.ts +0 -4
- package/dist/template/helpers/index.d.ts.map +0 -1
- package/dist/template/helpers/index.js +0 -156
- package/dist/template/helpers/index.js.map +0 -1
- package/dist/template/template-context.d.ts +0 -32
- package/dist/template/template-context.d.ts.map +0 -1
- package/dist/template/template-context.js +0 -81
- package/dist/template/template-context.js.map +0 -1
- package/dist/template/template-engine.d.ts +0 -14
- package/dist/template/template-engine.d.ts.map +0 -1
- package/dist/template/template-engine.js +0 -85
- package/dist/template/template-engine.js.map +0 -1
- package/dist/utils/handlebars-extensions.d.ts +0 -4
- package/dist/utils/handlebars-extensions.d.ts.map +0 -1
- package/dist/utils/handlebars-extensions.js +0 -87
- package/dist/utils/handlebars-extensions.js.map +0 -1
- package/prompts/ad-hoc-long.md +0 -52
- package/prompts/ad-hoc.md +0 -23
- package/prompts/add-summary.md +0 -42
- package/prompts/analyze-execution.md +0 -181
- package/prompts/code-review.md +0 -97
- package/prompts/debugging-error-message.md +0 -75
- package/prompts/fix-github-actions.md +0 -55
- package/prompts/fix-test-errors.md +0 -66
- package/prompts/git-commit-comment.md +0 -54
- package/prompts/implementation-phase.md +0 -46
- package/prompts/implementation-plan.md +0 -89
- package/prompts/new-feature.md +0 -80
- package/prompts/new-project.md +0 -11
- package/prompts/one-shot-change.md +0 -71
- package/prompts/pupt-prompt-improvement.md +0 -264
- package/prompts/simple-test.md +0 -11
- package/prompts/update-design.md +0 -68
- package/prompts/update-documentation.md +0 -8
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{/* Converted from add-summary.md */}
|
|
2
|
+
<Prompt name="update-prompt-summary" description="Update summary field in a prompt file for better history display" tags={[]}>
|
|
3
|
+
<Ask.File name="design" label="Design:" />
|
|
4
|
+
<Ask.ReviewFile name="output" label="Output:" />
|
|
5
|
+
|
|
6
|
+
<Role>
|
|
7
|
+
You are an expert at creating concise, informative summaries for prompt templates. You understand JSX-based prompt files using pupt-lib components.
|
|
8
|
+
</Role>
|
|
9
|
+
|
|
10
|
+
<Task>
|
|
11
|
+
Add or update the description attribute in the Prompt component for the following prompt file to improve its display in `pt history`.
|
|
12
|
+
|
|
13
|
+
## Current Prompt File:
|
|
14
|
+
<Ask.File name="prompt" label="Select the prompt file to update" basePath={"./prompts"} filter={"*.prompt"} />
|
|
15
|
+
</Task>
|
|
16
|
+
|
|
17
|
+
<Constraint>
|
|
18
|
+
- Create a single-line description that clearly describes what the prompt does
|
|
19
|
+
- Keep the description under 80 characters for optimal display
|
|
20
|
+
- Focus on the action/outcome rather than implementation details
|
|
21
|
+
- Preserve all existing attributes and components when updating
|
|
22
|
+
</Constraint>
|
|
23
|
+
|
|
24
|
+
<Format>
|
|
25
|
+
- Update the `description` attribute in the Prompt component: {'`<Prompt name="..." description="YOUR DESCRIPTION HERE" tags={...}>`'}
|
|
26
|
+
- Output the complete updated file content that can be directly saved
|
|
27
|
+
</Format>
|
|
28
|
+
|
|
29
|
+
<Section>
|
|
30
|
+
- `summary: Create React component <Ask.Text name="name" label="Name:" /> with tests`
|
|
31
|
+
- `summary: Review <Ask.File name="code" label="Code:" /> and suggest improvements`
|
|
32
|
+
- `summary: Generate API client for <Ask.Select name="service" label="Service:" /> using <Ask.Select name="language" label="Language:" />`
|
|
33
|
+
</Section>
|
|
34
|
+
|
|
35
|
+
<Constraint>
|
|
36
|
+
- Maintain the exact formatting and structure of the existing file
|
|
37
|
+
- Only modify the frontmatter section
|
|
38
|
+
- Ensure the summary accurately reflects the prompt's purpose
|
|
39
|
+
</Constraint>
|
|
40
|
+
|
|
41
|
+
<SuccessCriteria>
|
|
42
|
+
<Criterion>The updated prompt file should have a clear, concise summary that will be displayed in `pt history` output.</Criterion>
|
|
43
|
+
</SuccessCriteria>
|
|
44
|
+
|
|
45
|
+
<PostExecution>
|
|
46
|
+
<ReviewFile file={inputs.output} />
|
|
47
|
+
</PostExecution>
|
|
48
|
+
</Prompt>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{/* Converted from code-review.md */}
|
|
2
|
+
<Prompt name="code-review" description="Code Review" tags={[]}>
|
|
3
|
+
|
|
4
|
+
<Role>
|
|
5
|
+
You are a meticulous code reviewer with expertise in identifying both human and AI-generated code issues, focusing on maintainability, correctness, and common LLM coding mistakes.
|
|
6
|
+
</Role>
|
|
7
|
+
|
|
8
|
+
<Task>
|
|
9
|
+
Perform a comprehensive multi-pass code review identifying issues and improvement opportunities. Write the code review to <Ask.ReviewFile name="outputFile" label="Output file:" />.
|
|
10
|
+
</Task>
|
|
11
|
+
|
|
12
|
+
<Constraint>
|
|
13
|
+
- **Pass 1 - Critical Issues**: Security, correctness, data loss risks
|
|
14
|
+
- **Pass 2 - Code Quality**:
|
|
15
|
+
<Ask.Editor name="codeReviewConcerns" label="Code review concerns (press enter to open editor):" />
|
|
16
|
+
- **Pass 3 - LLM-Specific Issues**:
|
|
17
|
+
- Hallucinated APIs or methods that don't exist
|
|
18
|
+
- Incorrect error handling patterns
|
|
19
|
+
- Overly complex solutions to simple problems
|
|
20
|
+
- Inconsistent code style within same file
|
|
21
|
+
- Copy-paste errors and duplicated logic
|
|
22
|
+
- Missing edge case handling
|
|
23
|
+
|
|
24
|
+
- Create file inventory first, categorizing files as:
|
|
25
|
+
- Production code (src/)
|
|
26
|
+
- Test code (test/, *.test.*, *.spec.*)
|
|
27
|
+
- Configuration (config files, build scripts)
|
|
28
|
+
- Apply different standards based on file type:
|
|
29
|
+
- Production code: Strict type safety, no 'any' types
|
|
30
|
+
- Test code: 'any' types acceptable for mocks, relaxed standards
|
|
31
|
+
- Configuration: Focus on security and correctness
|
|
32
|
+
- For each issue found:
|
|
33
|
+
- Verify it's a real issue considering the file context
|
|
34
|
+
- Assess actual impact on system
|
|
35
|
+
- Provide specific fix with code example
|
|
36
|
+
- Group similar issues for batch remediation
|
|
37
|
+
</Constraint>
|
|
38
|
+
|
|
39
|
+
<Format>
|
|
40
|
+
```markdown
|
|
41
|
+
# Code Review Report - <DateTime />
|
|
42
|
+
|
|
43
|
+
## Executive Summary
|
|
44
|
+
- Files reviewed: X
|
|
45
|
+
- Critical issues: X
|
|
46
|
+
- High priority issues: X
|
|
47
|
+
- Medium priority issues: X
|
|
48
|
+
- Low priority issues: X
|
|
49
|
+
|
|
50
|
+
## Critical Issues (Fix Immediately)
|
|
51
|
+
### 1. [Issue Title]
|
|
52
|
+
- **Files**: [List affected files]
|
|
53
|
+
- **Description**: [What and why it's critical]
|
|
54
|
+
- **Example**: `path/to/file.js:123`
|
|
55
|
+
```javascript
|
|
56
|
+
// Problem code
|
|
57
|
+
```
|
|
58
|
+
- **Fix**:
|
|
59
|
+
```javascript
|
|
60
|
+
// Corrected code
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## High Priority Issues (Fix Soon)
|
|
64
|
+
[Same format as critical]
|
|
65
|
+
|
|
66
|
+
## Medium Priority Issues (Technical Debt)
|
|
67
|
+
[Same format, grouped by theme]
|
|
68
|
+
|
|
69
|
+
## Low Priority Issues (Nice to Have)
|
|
70
|
+
[Brief list with file references]
|
|
71
|
+
|
|
72
|
+
## Positive Findings
|
|
73
|
+
- [Good patterns to replicate elsewhere]
|
|
74
|
+
|
|
75
|
+
## Recommendations
|
|
76
|
+
1. [Highest impact improvement]
|
|
77
|
+
2. [Next priority]
|
|
78
|
+
...
|
|
79
|
+
```
|
|
80
|
+
</Format>
|
|
81
|
+
|
|
82
|
+
<Section>
|
|
83
|
+
Included in format above
|
|
84
|
+
</Section>
|
|
85
|
+
|
|
86
|
+
<Constraint>
|
|
87
|
+
- Don't flag test utilities for production code issues
|
|
88
|
+
- Test files have different standards: 'any' types, mocks, and test helpers are acceptable
|
|
89
|
+
- Consider project conventions before suggesting changes
|
|
90
|
+
- Check if the issue is actually problematic in its context
|
|
91
|
+
- Focus on measurable improvements
|
|
92
|
+
- Distinguish must-fix from nice-to-have
|
|
93
|
+
- CRITICAL: Don't recommend unnecessary libraries - check if existing solutions work first
|
|
94
|
+
</Constraint>
|
|
95
|
+
|
|
96
|
+
<SuccessCriteria>
|
|
97
|
+
<Criterion>All significant issues caught and correctly prioritized</Criterion>
|
|
98
|
+
<Criterion>Fixes are specific and implementable</Criterion>
|
|
99
|
+
<Criterion>Report enables systematic remediation</Criterion>
|
|
100
|
+
<Criterion>No false positives that waste developer time</Criterion>
|
|
101
|
+
</SuccessCriteria>
|
|
102
|
+
|
|
103
|
+
</Prompt>
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{/* Converted from debugging-error-message.md */}
|
|
2
|
+
<Prompt name="debugging-error-message" description="Debugging Error Message" tags={[]}>
|
|
3
|
+
|
|
4
|
+
<Role>
|
|
5
|
+
You are a debugging specialist with expertise in error analysis, root cause identification, and systematic problem-solving in software systems.
|
|
6
|
+
</Role>
|
|
7
|
+
|
|
8
|
+
<Task>
|
|
9
|
+
Diagnose and fix all errors that occur when <Ask.Text name="errorCondition" label="Error condition:" />.
|
|
10
|
+
</Task>
|
|
11
|
+
|
|
12
|
+
<Constraint>
|
|
13
|
+
- First, reproduce the error condition exactly as described
|
|
14
|
+
- Capture complete error output including stack traces
|
|
15
|
+
- For multiple errors, create a prioritized list (fix blocking errors first)
|
|
16
|
+
- For each error apply this debugging process:
|
|
17
|
+
1. **Understand**: Read error message and stack trace completely
|
|
18
|
+
2. **Locate**: Find exact file, line, and surrounding context
|
|
19
|
+
3. **Analyze**: Determine what the code is trying to do vs. what's happening
|
|
20
|
+
4. **Trace**: Follow data flow to find where things go wrong
|
|
21
|
+
5. **Fix**: Address root cause, not symptoms
|
|
22
|
+
6. **Verify**: Confirm this specific error is resolved
|
|
23
|
+
7. **Test**: Ensure fix doesn't break other functionality
|
|
24
|
+
- After all fixes, reproduce original condition to verify resolution
|
|
25
|
+
- Document any assumptions or environmental dependencies
|
|
26
|
+
</Constraint>
|
|
27
|
+
|
|
28
|
+
<Format>
|
|
29
|
+
```markdown
|
|
30
|
+
## Error Analysis for: {inputs.errorCondition}
|
|
31
|
+
|
|
32
|
+
### Complete Error Output
|
|
33
|
+
```
|
|
34
|
+
<Ask.Editor name="errorText" label="Error text (press enter to open editor):" />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Error Inventory
|
|
38
|
+
1. [Error Type]: [File:Line] - [Brief description]
|
|
39
|
+
2. [Continue for all errors...]
|
|
40
|
+
|
|
41
|
+
### Root Cause Analysis
|
|
42
|
+
|
|
43
|
+
#### Error 1: [Error type]
|
|
44
|
+
- **Symptom**: [What's visibly wrong]
|
|
45
|
+
- **Location**: [Specific file:line]
|
|
46
|
+
- **Root Cause**: [Why it's happening]
|
|
47
|
+
- **Code Context**: [Relevant code snippet]
|
|
48
|
+
- **Fix Applied**: [Specific changes made]
|
|
49
|
+
- **Verification**: [How confirmed it's fixed]
|
|
50
|
+
|
|
51
|
+
### Final Verification
|
|
52
|
+
- Command run: [exact command]
|
|
53
|
+
- Result: [success/failure]
|
|
54
|
+
- All errors resolved: [yes/no]
|
|
55
|
+
```
|
|
56
|
+
</Format>
|
|
57
|
+
|
|
58
|
+
<Section>
|
|
59
|
+
```
|
|
60
|
+
Error 1: TypeError: Cannot read property 'name' of undefined
|
|
61
|
+
Location: src/user.js:42
|
|
62
|
+
Root Cause: API returns null for deleted users, code assumes user always exists
|
|
63
|
+
Fix: Added null check before accessing user.name
|
|
64
|
+
Verification: Error no longer occurs, added test case for null user
|
|
65
|
+
```
|
|
66
|
+
</Section>
|
|
67
|
+
|
|
68
|
+
<Constraint>
|
|
69
|
+
- Fix root causes, not symptoms
|
|
70
|
+
- Don't suppress errors with try-catch unless that's the correct solution
|
|
71
|
+
- Preserve all intended functionality
|
|
72
|
+
- Make focused changes that don't introduce new issues
|
|
73
|
+
</Constraint>
|
|
74
|
+
|
|
75
|
+
<SuccessCriteria>
|
|
76
|
+
<Criterion>Original error condition no longer produces any errors</Criterion>
|
|
77
|
+
<Criterion>All fixes address root causes</Criterion>
|
|
78
|
+
<Criterion>No new errors introduced</Criterion>
|
|
79
|
+
<Criterion>Clear documentation of what was wrong and how it was fixed</Criterion>
|
|
80
|
+
</SuccessCriteria>
|
|
81
|
+
</Prompt>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{/* Converted from fix-github-actions.md */}
|
|
2
|
+
<Prompt name="fix-github-actions" description="Fix GitHub Actions" tags={[]}>
|
|
3
|
+
<Role>
|
|
4
|
+
You are a DevOps engineer specializing in GitHub Actions, CI/CD pipelines, and cross-platform compatibility issues.
|
|
5
|
+
</Role>
|
|
6
|
+
|
|
7
|
+
<Task>
|
|
8
|
+
Analyze and fix all failing GitHub Actions workflow jobs, ensuring reliable CI/CD pipeline operation.
|
|
9
|
+
</Task>
|
|
10
|
+
|
|
11
|
+
<Constraint>
|
|
12
|
+
- Use `gh run list --limit 1` to find the latest workflow run
|
|
13
|
+
- Use `gh run view` with the run ID to see all jobs
|
|
14
|
+
- For each failed job, use `gh run view` with the run ID and `--log-failed` to get error details
|
|
15
|
+
- Categorize failures: environment, dependencies, tests, build, deployment
|
|
16
|
+
- For each error:
|
|
17
|
+
1. Identify if it's environment-specific (OS, versions)
|
|
18
|
+
2. Check if it's a flaky test or real failure
|
|
19
|
+
3. Determine if it's a workflow configuration issue
|
|
20
|
+
4. Test the fix locally when possible
|
|
21
|
+
5. Consider cross-platform compatibility
|
|
22
|
+
- Create fixes that work across all environments
|
|
23
|
+
- Add appropriate error handling and retries for transient failures
|
|
24
|
+
</Constraint>
|
|
25
|
+
|
|
26
|
+
<Format>
|
|
27
|
+
1. Workflow run summary (ID, jobs, success/failure status)
|
|
28
|
+
2. Categorized error list with job names
|
|
29
|
+
3. For each error:
|
|
30
|
+
- Job name and step that failed
|
|
31
|
+
- Error message and likely cause
|
|
32
|
+
- Proposed fix with explanation
|
|
33
|
+
- Local verification method
|
|
34
|
+
4. Summary of all changes made
|
|
35
|
+
</Format>
|
|
36
|
+
|
|
37
|
+
<Section>
|
|
38
|
+
```
|
|
39
|
+
Job: test-ubuntu / Step: Run tests
|
|
40
|
+
Error: Cannot find module 'xyz'
|
|
41
|
+
Cause: Package not installed in CI environment
|
|
42
|
+
Fix: Add 'xyz' to package.json dependencies
|
|
43
|
+
Local verification: npm ci && npm test
|
|
44
|
+
```
|
|
45
|
+
</Section>
|
|
46
|
+
|
|
47
|
+
<Constraint>
|
|
48
|
+
- Fixes must work on all platforms (Ubuntu, macOS, Windows)
|
|
49
|
+
- Don't disable failing tests to make CI pass
|
|
50
|
+
- Preserve existing CI/CD functionality
|
|
51
|
+
- Consider impact on build time and resource usage
|
|
52
|
+
</Constraint>
|
|
53
|
+
|
|
54
|
+
<SuccessCriteria>
|
|
55
|
+
<Criterion>All GitHub Actions jobs pass on next run</Criterion>
|
|
56
|
+
<Criterion>No reduction in test coverage or quality checks</Criterion>
|
|
57
|
+
<Criterion>Fixes are robust against common CI/CD issues</Criterion>
|
|
58
|
+
<Criterion>Clear documentation of what was fixed and why</Criterion>
|
|
59
|
+
</SuccessCriteria>
|
|
60
|
+
</Prompt>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{/* Converted from fix-test-errors.md */}
|
|
2
|
+
<Prompt name="fix-lint-build-test-errors" description="Fix Lint, Build, Test Errors" tags={[]}>
|
|
3
|
+
<Role>
|
|
4
|
+
You are a debugging expert with deep knowledge of JavaScript/TypeScript, testing frameworks, and build tools.
|
|
5
|
+
</Role>
|
|
6
|
+
|
|
7
|
+
<Task>
|
|
8
|
+
Systematically identify and fix all build, lint, and test errors in the codebase.
|
|
9
|
+
</Task>
|
|
10
|
+
|
|
11
|
+
<Constraint>
|
|
12
|
+
- IMPORTANT: Before making ANY changes, understand the CONTEXT of why tests might be failing
|
|
13
|
+
- Check recent changes, removed features, or intentional modifications
|
|
14
|
+
- Run commands in this exact order: `npm run build`, `npm run lint`, `npm test`
|
|
15
|
+
- Capture ALL error output completely (stdout and stderr)
|
|
16
|
+
- Categorize errors by type: syntax, type, lint, test assertion, runtime
|
|
17
|
+
- For each error:
|
|
18
|
+
1. Identify the specific file and line number
|
|
19
|
+
2. Understand what the code is trying to do
|
|
20
|
+
3. CRITICAL: Determine if the test is failing because:
|
|
21
|
+
- The implementation is wrong (fix the implementation)
|
|
22
|
+
- The test is outdated (update the test to match new requirements)
|
|
23
|
+
- A feature was intentionally removed (remove the corresponding test)
|
|
24
|
+
4. Fix the root cause with minimal code changes
|
|
25
|
+
5. Verify the specific error is resolved
|
|
26
|
+
- After fixing all errors, run ALL commands again to verify
|
|
27
|
+
- MANDATORY: Show complete test output proving "0 failing" before declaring success
|
|
28
|
+
- If new errors appear, repeat the process
|
|
29
|
+
- Continue until all commands pass with zero errors
|
|
30
|
+
</Constraint>
|
|
31
|
+
|
|
32
|
+
<Format>
|
|
33
|
+
1. Context analysis (recent changes, removed features)
|
|
34
|
+
2. Initial error inventory (categorized list)
|
|
35
|
+
3. For each error:
|
|
36
|
+
- Error type and location
|
|
37
|
+
- Root cause analysis
|
|
38
|
+
- Decision: Fix implementation OR Update test OR Remove test
|
|
39
|
+
- Fix applied with justification
|
|
40
|
+
- Verification result
|
|
41
|
+
4. Final status report with COMPLETE command outputs showing:
|
|
42
|
+
- npm run build: "Compiled successfully"
|
|
43
|
+
- npm run lint: "0 errors, 0 warnings"
|
|
44
|
+
- npm test: Full output with "0 failing"
|
|
45
|
+
</Format>
|
|
46
|
+
|
|
47
|
+
<Section>
|
|
48
|
+
```
|
|
49
|
+
Error 1: TypeError at src/utils/helper.ts:23
|
|
50
|
+
Root cause: Function expects string but receives undefined when config.name is not set
|
|
51
|
+
Fix: Add default parameter value
|
|
52
|
+
Verification: Error resolved, test now passes
|
|
53
|
+
```
|
|
54
|
+
</Section>
|
|
55
|
+
|
|
56
|
+
<Constraint>
|
|
57
|
+
- NEVER skip tests with .skip() or xit()
|
|
58
|
+
- NEVER remove failing tests
|
|
59
|
+
- NEVER suppress errors with ignore comments
|
|
60
|
+
- Fix root causes, not symptoms
|
|
61
|
+
- Preserve all existing functionality
|
|
62
|
+
</Constraint>
|
|
63
|
+
|
|
64
|
+
<SuccessCriteria>
|
|
65
|
+
<Criterion>`npm run build` exits with code 0</Criterion>
|
|
66
|
+
<Criterion>`npm run lint` reports 0 errors and 0 warnings</Criterion>
|
|
67
|
+
<Criterion>`npm test` shows all tests passing (100% pass rate)</Criterion>
|
|
68
|
+
<Criterion>No unhandled errors or warnings in output</Criterion>
|
|
69
|
+
<Criterion>All original tests still present and passing</Criterion>
|
|
70
|
+
</SuccessCriteria>
|
|
71
|
+
</Prompt>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{/* Converted from git-commit-comment.md */}
|
|
2
|
+
<Prompt name="git-commit-comment" description="Git Commit Comment" tags={["git", "commit", "version-control"]}>
|
|
3
|
+
<Role>
|
|
4
|
+
You are a Git commit message expert who follows conventional commit standards and creates clear, descriptive commit messages that accurately reflect the changes made.
|
|
5
|
+
</Role>
|
|
6
|
+
|
|
7
|
+
<Task>
|
|
8
|
+
Analyze recent changes since the last commit and generate a properly formatted conventional commit message with the git command to execute.
|
|
9
|
+
</Task>
|
|
10
|
+
|
|
11
|
+
<Constraint>
|
|
12
|
+
1. **Analyze recent work**:
|
|
13
|
+
- Review pt history to understand recent activities
|
|
14
|
+
- Check git status for current changes
|
|
15
|
+
- Review git diff for uncommitted changes
|
|
16
|
+
- Identify the primary purpose of these changes
|
|
17
|
+
|
|
18
|
+
2. **Follow Conventional Commits format**:
|
|
19
|
+
- Type: feat, fix, docs, style, refactor, test, chore, perf, ci, build, revert
|
|
20
|
+
- Scope (optional): Component or area affected
|
|
21
|
+
- Description: Clear, imperative mood, lowercase
|
|
22
|
+
- Body (if needed): Explain what and why, not how
|
|
23
|
+
|
|
24
|
+
3. **Generate ready-to-use git command**:
|
|
25
|
+
- Provide complete git commit command
|
|
26
|
+
- Properly escape for shell execution
|
|
27
|
+
- Include multi-line format if body is needed
|
|
28
|
+
</Constraint>
|
|
29
|
+
|
|
30
|
+
<Format>
|
|
31
|
+
1. Analyze recent changes
|
|
32
|
+
2. Determine appropriate commit type and scope
|
|
33
|
+
3. Write clear commit message
|
|
34
|
+
4. Output the complete git commit command
|
|
35
|
+
</Format>
|
|
36
|
+
|
|
37
|
+
<Section>
|
|
38
|
+
```bash
|
|
39
|
+
git commit -m "feat(template): add git commit comment prompt
|
|
40
|
+
|
|
41
|
+
Creates a prompt that analyzes recent changes and generates
|
|
42
|
+
conventional commit messages. Helps maintain consistent commit
|
|
43
|
+
formatting across the project."
|
|
44
|
+
```
|
|
45
|
+
</Section>
|
|
46
|
+
|
|
47
|
+
<Constraint>
|
|
48
|
+
- Subject line: 50 characters or less
|
|
49
|
+
- Use imperative mood
|
|
50
|
+
- Focus on the most significant change
|
|
51
|
+
- Output must be a ready-to-execute command
|
|
52
|
+
</Constraint>
|
|
53
|
+
|
|
54
|
+
<SuccessCriteria>
|
|
55
|
+
<Criterion>The command can be directly copied and pasted</Criterion>
|
|
56
|
+
<Criterion>Message follows conventional commit standards</Criterion>
|
|
57
|
+
<Criterion>Clearly describes what changed and why</Criterion>
|
|
58
|
+
</SuccessCriteria>
|
|
59
|
+
</Prompt>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{/* Converted from implementation-phase.md */}
|
|
2
|
+
<Prompt name="implement-phase" description="Implement Phase" tags={[]}>
|
|
3
|
+
|
|
4
|
+
<Role>
|
|
5
|
+
You are a senior software engineer implementing features according to a detailed implementation plan, with expertise in test-driven development and clean code practices.
|
|
6
|
+
</Role>
|
|
7
|
+
|
|
8
|
+
<Task>
|
|
9
|
+
Implement Phase <Ask.Text name="phase" label="Phase:" /> from <Ask.File name="implementationFile" label="Implementation file:" /> following all specifications exactly.
|
|
10
|
+
</Task>
|
|
11
|
+
|
|
12
|
+
<Constraint>
|
|
13
|
+
- Read and understand the full phase requirements before starting
|
|
14
|
+
- Implement features incrementally, testing after each change
|
|
15
|
+
- Write tests BEFORE implementing features (TDD approach)
|
|
16
|
+
- Achieve minimum 80% code coverage with meaningful tests
|
|
17
|
+
- Run `npm run build`, `npm run lint`, and `npm test` after implementation
|
|
18
|
+
- Fix ALL errors completely - "minimal changes" means fixing root causes without adding unnecessary code
|
|
19
|
+
- CRITICAL: After running tests, verify the EXACT output shows "0 failing" before proceeding
|
|
20
|
+
- If ANY tests fail, you MUST fix them completely - do not report success with failing tests
|
|
21
|
+
- Copy and paste the full test output showing all tests passing before completing
|
|
22
|
+
- Verify the implementation matches the specification exactly
|
|
23
|
+
</Constraint>
|
|
24
|
+
|
|
25
|
+
<Format>
|
|
26
|
+
1. First, summarize what Phase {inputs.phase} requires
|
|
27
|
+
2. Implement features with appropriate tests
|
|
28
|
+
3. Run all verification commands and fix any issues
|
|
29
|
+
4. MANDATORY: Show the complete output from `npm test` demonstrating all tests pass
|
|
30
|
+
5. Provide a status report including:
|
|
31
|
+
- Summary of implemented functionality
|
|
32
|
+
- Exact test results showing "0 failing"
|
|
33
|
+
- How users can verify it works (specific commands/steps)
|
|
34
|
+
- Any deviations from the plan and why
|
|
35
|
+
- Next phase number and brief description
|
|
36
|
+
</Format>
|
|
37
|
+
|
|
38
|
+
<Section>
|
|
39
|
+
N/A (varies by implementation plan)
|
|
40
|
+
</Section>
|
|
41
|
+
|
|
42
|
+
<Constraint>
|
|
43
|
+
- Do NOT skip tests or use `.skip()`
|
|
44
|
+
- Do NOT suppress linting errors with ignore comments
|
|
45
|
+
- If tests fail after fixes, investigate root cause rather than making superficial changes
|
|
46
|
+
- If blocked, report the specific issue rather than proceeding with partial implementation
|
|
47
|
+
</Constraint>
|
|
48
|
+
|
|
49
|
+
<SuccessCriteria>
|
|
50
|
+
<Criterion>All tests pass (100% success rate)</Criterion>
|
|
51
|
+
<Criterion>Build completes without errors</Criterion>
|
|
52
|
+
<Criterion>Linting passes without warnings</Criterion>
|
|
53
|
+
<Criterion>Code coverage ≥ 80%</Criterion>
|
|
54
|
+
<Criterion>Implementation exactly matches phase specification</Criterion>
|
|
55
|
+
<Criterion>Clear user-facing functionality description provided</Criterion>
|
|
56
|
+
</SuccessCriteria>
|
|
57
|
+
</Prompt>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{/* Converted from implementation-plan.md */}
|
|
2
|
+
<Prompt name="implementation-plan" description="Implementation Plan" tags={[]}>
|
|
3
|
+
|
|
4
|
+
<Role>
|
|
5
|
+
You are a senior software architect creating detailed implementation plans that balance pragmatism with best practices, specializing in test-driven development and modular design.
|
|
6
|
+
</Role>
|
|
7
|
+
|
|
8
|
+
<Task>
|
|
9
|
+
Create a comprehensive, phased implementation plan for the design specified in <Ask.File name="designFile" label="Design file:" />.
|
|
10
|
+
</Task>
|
|
11
|
+
|
|
12
|
+
<Constraint>
|
|
13
|
+
- Analyze the design document completely before planning
|
|
14
|
+
- Break implementation into logical phases
|
|
15
|
+
- The first phase should be a MVP and subsiquent phases should add incremental features
|
|
16
|
+
- For example, if the feature is a new HTML page, the first phase should implement the HTML page and then add features to it in future phases
|
|
17
|
+
- Each phase must:
|
|
18
|
+
- Deliver functionality in a way that the user can verify that the functionality works, beyond just running tests
|
|
19
|
+
- Include specific test scenarios (unit and integration)
|
|
20
|
+
- Build on previous phases without breaking them
|
|
21
|
+
- Take roughly equal effort (1-3 days each)
|
|
22
|
+
- For each phase specify:
|
|
23
|
+
- Clear objectives and success criteria
|
|
24
|
+
- Test files to create/modify with example test cases
|
|
25
|
+
- Implementation files to create/modify
|
|
26
|
+
- Dependencies on external libraries or earlier phases
|
|
27
|
+
- User-facing verification steps
|
|
28
|
+
- Identify opportunities for:
|
|
29
|
+
- Code reuse and shared utilities
|
|
30
|
+
- External libraries that solve common problems
|
|
31
|
+
- Refactoring to reduce duplication
|
|
32
|
+
</Constraint>
|
|
33
|
+
|
|
34
|
+
<Format>
|
|
35
|
+
Write the impleementation plan <Ask.ReviewFile name="planFile" label="Plan file:" />. Use this template for the implementation plan:
|
|
36
|
+
|
|
37
|
+
```markdown
|
|
38
|
+
# Implementation Plan for [Feature Name]
|
|
39
|
+
|
|
40
|
+
## Overview
|
|
41
|
+
[Brief summary of what will be built]
|
|
42
|
+
|
|
43
|
+
## Phase Breakdown
|
|
44
|
+
|
|
45
|
+
### Phase 1: [Foundation/Core Setup]
|
|
46
|
+
</Format>
|
|
47
|
+
|
|
48
|
+
<Task>
|
|
49
|
+
[What this phase accomplishes]
|
|
50
|
+
**Duration**: X days
|
|
51
|
+
|
|
52
|
+
**Tests to Write First**:
|
|
53
|
+
- `test/[filename].test.ts`: [Test description]
|
|
54
|
+
```typescript
|
|
55
|
+
// Example test case
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Implementation**:
|
|
59
|
+
- `src/[filename].ts`: [What to implement]
|
|
60
|
+
```typescript
|
|
61
|
+
// Key interfaces/structures
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Dependencies**:
|
|
65
|
+
- External: [npm packages needed]
|
|
66
|
+
- Internal: [files from previous phases]
|
|
67
|
+
|
|
68
|
+
**Verification**:
|
|
69
|
+
1. Run: `[specific command]`
|
|
70
|
+
2. Expected output: [what user should see]
|
|
71
|
+
|
|
72
|
+
### Phase 2: [Feature Name]
|
|
73
|
+
[Same structure as Phase 1]
|
|
74
|
+
|
|
75
|
+
## Common Utilities Needed
|
|
76
|
+
- [Utility name]: [Purpose and where used]
|
|
77
|
+
|
|
78
|
+
## External Libraries Assessment
|
|
79
|
+
- [Task]: Consider using [library] because [reason]
|
|
80
|
+
|
|
81
|
+
## Risk Mitigation
|
|
82
|
+
- [Potential risk]: [Mitigation strategy]
|
|
83
|
+
```
|
|
84
|
+
</Task>
|
|
85
|
+
|
|
86
|
+
<Section>
|
|
87
|
+
See template above
|
|
88
|
+
</Section>
|
|
89
|
+
|
|
90
|
+
<Constraint>
|
|
91
|
+
- Each phase must be independently testable
|
|
92
|
+
- No phase should break existing functionality
|
|
93
|
+
- Prefer proven libraries over custom implementations
|
|
94
|
+
- Keep phases focused on single concerns
|
|
95
|
+
</Constraint>
|
|
96
|
+
|
|
97
|
+
<SuccessCriteria>
|
|
98
|
+
<Criterion>Plan is clear enough for any developer to implement</Criterion>
|
|
99
|
+
<Criterion>Phases have balanced complexity and effort</Criterion>
|
|
100
|
+
<Criterion>All design requirements are addressed</Criterion>
|
|
101
|
+
<Criterion>Test strategy ensures quality and maintainability</Criterion>
|
|
102
|
+
<Criterion>Human reviewer can understand plan without reading code examples</Criterion>
|
|
103
|
+
</SuccessCriteria>
|
|
104
|
+
|
|
105
|
+
</Prompt>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{/* Converted from new-feature.md */}
|
|
2
|
+
<Prompt name="new-feature" description="New Feature" tags={[]}>
|
|
3
|
+
|
|
4
|
+
<Role>
|
|
5
|
+
You are a senior software architect designing features that are elegant, maintainable, and aligned with existing system architecture.
|
|
6
|
+
</Role>
|
|
7
|
+
|
|
8
|
+
<Task>
|
|
9
|
+
Design new features based on provided objectives and requirements stated below.
|
|
10
|
+
</Task>
|
|
11
|
+
|
|
12
|
+
<Constraint>
|
|
13
|
+
- Review existing codebase architecture before designing
|
|
14
|
+
- Ensure design aligns with current patterns and conventions
|
|
15
|
+
- Consider both technical implementation and user experience
|
|
16
|
+
- Address all requirements comprehensively
|
|
17
|
+
- Identify potential challenges and mitigation strategies
|
|
18
|
+
- Keep scope manageable and incrementally deliverable
|
|
19
|
+
</Constraint>
|
|
20
|
+
|
|
21
|
+
<Format>
|
|
22
|
+
Create design document with these sections and write it to <Ask.ReviewFile name="outputFile" label="Output file:" />:
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
# Feature Design: [Feature Name]
|
|
26
|
+
|
|
27
|
+
## Overview
|
|
28
|
+
- **User Value**: [What users gain]
|
|
29
|
+
- **Technical Value**: [What developers/system gains]
|
|
30
|
+
|
|
31
|
+
## Requirements
|
|
32
|
+
<Ask.Editor name="requirements" label="Requirements (press enter to open editor):" />
|
|
33
|
+
|
|
34
|
+
## Proposed Solution
|
|
35
|
+
|
|
36
|
+
### User Interface/API
|
|
37
|
+
[How users will interact with this feature]
|
|
38
|
+
|
|
39
|
+
### Technical Architecture
|
|
40
|
+
- **Components**: [New modules/classes needed]
|
|
41
|
+
- **Data Model**: [Any data structure changes]
|
|
42
|
+
- **Integration Points**: [How it connects to existing code]
|
|
43
|
+
|
|
44
|
+
### Implementation Approach
|
|
45
|
+
1. [High-level step 1]
|
|
46
|
+
2. [High-level step 2]
|
|
47
|
+
...
|
|
48
|
+
|
|
49
|
+
## Acceptance Criteria
|
|
50
|
+
- [ ] [Specific measurable criterion]
|
|
51
|
+
- [ ] [Another criterion]
|
|
52
|
+
...
|
|
53
|
+
|
|
54
|
+
## Technical Considerations
|
|
55
|
+
- **Performance**: [Impact and mitigation]
|
|
56
|
+
- **Security**: [Considerations and measures]
|
|
57
|
+
- **Compatibility**: [Backward compatibility notes]
|
|
58
|
+
- **Testing**: [Testing strategy]
|
|
59
|
+
|
|
60
|
+
## Risks and Mitigation
|
|
61
|
+
- **Risk**: [Potential issue]
|
|
62
|
+
**Mitigation**: [How to address]
|
|
63
|
+
|
|
64
|
+
## Future Enhancements
|
|
65
|
+
[Features that could build on this]
|
|
66
|
+
|
|
67
|
+
## Implementation Estimate
|
|
68
|
+
- Development: X-Y days
|
|
69
|
+
- Testing: X days
|
|
70
|
+
- Total: X-Y days
|
|
71
|
+
```
|
|
72
|
+
</Format>
|
|
73
|
+
|
|
74
|
+
<Section>
|
|
75
|
+
See template above
|
|
76
|
+
</Section>
|
|
77
|
+
|
|
78
|
+
<Constraint>
|
|
79
|
+
- Design must be implementable within reasonable timeframe
|
|
80
|
+
- Cannot break existing functionality
|
|
81
|
+
- Must follow project coding standards
|
|
82
|
+
- Should reuse existing code where possible
|
|
83
|
+
</Constraint>
|
|
84
|
+
|
|
85
|
+
<SuccessCriteria>
|
|
86
|
+
<Criterion>All requirements addressed in design</Criterion>
|
|
87
|
+
<Criterion>Technical approach is clear and feasible</Criterion>
|
|
88
|
+
<Criterion>Risks are identified with mitigation strategies</Criterion>
|
|
89
|
+
<Criterion>Design document is complete and reviewable</Criterion>
|
|
90
|
+
<Criterion>Implementation path is clear to developers</Criterion>
|
|
91
|
+
</SuccessCriteria>
|
|
92
|
+
|
|
93
|
+
</Prompt>
|