@dedesfr/prompter 0.4.3 ā 0.5.1
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/.github/prompts/prd-agent-generator.prompt.md +133 -0
- package/CHANGELOG.md +122 -0
- package/dist/cli/index.js +10 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +129 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/upgrade.d.ts +4 -0
- package/dist/commands/upgrade.d.ts.map +1 -0
- package/dist/commands/upgrade.js +27 -0
- package/dist/commands/upgrade.js.map +1 -0
- package/dist/core/config.d.ts +7 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +50 -0
- package/dist/core/config.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/index.ts +11 -1
- package/src/commands/init.ts +146 -4
- package/src/commands/upgrade.ts +30 -0
- package/src/core/config.ts +58 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Generate a PRD with autonomous assumptions (non-interactive mode)
|
|
3
|
+
---
|
|
4
|
+
$ARGUMENTS
|
|
5
|
+
<!-- prompter-managed-start -->
|
|
6
|
+
# PRD Generator (Non-Interactive Mode)
|
|
7
|
+
|
|
8
|
+
Create detailed Product Requirements Documents that are clear, actionable, and suitable for implementation based solely on the user's initial input.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## The Job
|
|
13
|
+
|
|
14
|
+
1. Receive a feature description from the user
|
|
15
|
+
2. Analyze the input and make reasonable assumptions where details are missing
|
|
16
|
+
3. Generate a structured PRD based on the input
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Handling Ambiguity
|
|
21
|
+
|
|
22
|
+
When the user's input lacks specific details:
|
|
23
|
+
|
|
24
|
+
- **Make reasonable assumptions** based on common patterns and best practices
|
|
25
|
+
- **Document assumptions** in the PRD under "Assumptions Made"
|
|
26
|
+
- **Flag critical unknowns** in the "Open Questions" section
|
|
27
|
+
- **Err on the side of MVP scope** when scope is unclear
|
|
28
|
+
- **Default to standard patterns** (e.g., CRUD operations, standard UI components)
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## PRD Structure
|
|
33
|
+
|
|
34
|
+
Generate the PRD with these sections:
|
|
35
|
+
|
|
36
|
+
### 1. Introduction/Overview
|
|
37
|
+
Brief description of the feature and the problem it solves.
|
|
38
|
+
|
|
39
|
+
### 2. Assumptions Made
|
|
40
|
+
List key assumptions made due to missing details in the original request:
|
|
41
|
+
- "Assumed target users are [X] based on feature context"
|
|
42
|
+
- "Assumed MVP scope since no specific scope mentioned"
|
|
43
|
+
- "Assumed standard authentication is already in place"
|
|
44
|
+
|
|
45
|
+
### 3. Goals
|
|
46
|
+
Specific, measurable objectives (bullet list).
|
|
47
|
+
|
|
48
|
+
### 4. User Stories
|
|
49
|
+
Each story needs:
|
|
50
|
+
- **Title:** Short descriptive name
|
|
51
|
+
- **Description:** "As a [user], I want [feature] so that [benefit]"
|
|
52
|
+
- **Acceptance Criteria:** Verifiable checklist of what "done" means
|
|
53
|
+
|
|
54
|
+
Each story should be small enough to implement in one focused session.
|
|
55
|
+
|
|
56
|
+
**Format:**
|
|
57
|
+
```markdown
|
|
58
|
+
### US-001: [Title]
|
|
59
|
+
**Description:** As a [user], I want [feature] so that [benefit].
|
|
60
|
+
|
|
61
|
+
**Acceptance Criteria:**
|
|
62
|
+
- [ ] Specific verifiable criterion
|
|
63
|
+
- [ ] Another criterion
|
|
64
|
+
- [ ] Typecheck/lint passes
|
|
65
|
+
- [ ] **[UI stories only]** Verify in browser using dev-browser skill
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Important:**
|
|
69
|
+
- Acceptance criteria must be verifiable, not vague. "Works correctly" is bad. "Button shows confirmation dialog before deleting" is good.
|
|
70
|
+
- **For any story with UI changes:** Always include "Verify in browser using dev-browser skill" as acceptance criteria. This ensures visual verification of frontend work.
|
|
71
|
+
|
|
72
|
+
### 5. Functional Requirements
|
|
73
|
+
Numbered list of specific functionalities:
|
|
74
|
+
- "FR-1: The system must allow users to..."
|
|
75
|
+
- "FR-2: When a user clicks X, the system must..."
|
|
76
|
+
|
|
77
|
+
Be explicit and unambiguous.
|
|
78
|
+
|
|
79
|
+
### 6. Non-Goals (Out of Scope)
|
|
80
|
+
What this feature will NOT include. Critical for managing scope.
|
|
81
|
+
|
|
82
|
+
### 7. Design Considerations (Optional)
|
|
83
|
+
- UI/UX requirements
|
|
84
|
+
- Link to mockups if available
|
|
85
|
+
- Relevant existing components to reuse
|
|
86
|
+
|
|
87
|
+
### 8. Technical Considerations (Optional)
|
|
88
|
+
- Known constraints or dependencies
|
|
89
|
+
- Integration points with existing systems
|
|
90
|
+
- Performance requirements
|
|
91
|
+
|
|
92
|
+
### 9. Success Metrics
|
|
93
|
+
How will success be measured?
|
|
94
|
+
- "Reduce time to complete X by 50%"
|
|
95
|
+
- "Increase conversion rate by 10%"
|
|
96
|
+
|
|
97
|
+
### 10. Open Questions
|
|
98
|
+
Remaining questions or areas needing clarification. This is where you document:
|
|
99
|
+
- Critical unknowns that affect implementation
|
|
100
|
+
- Areas where the original request was ambiguous
|
|
101
|
+
- Decisions that may need stakeholder input
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Writing for Junior Developers
|
|
106
|
+
|
|
107
|
+
The PRD reader may be a junior developer or AI agent. Therefore:
|
|
108
|
+
|
|
109
|
+
- Be explicit and unambiguous
|
|
110
|
+
- Avoid jargon or explain it
|
|
111
|
+
- Provide enough detail to understand purpose and core logic
|
|
112
|
+
- Number requirements for easy reference
|
|
113
|
+
- Use concrete examples where helpful
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Output
|
|
118
|
+
|
|
119
|
+
- **Format:** Markdown (`.md`)
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## WORKFLOW STEPS
|
|
124
|
+
1. Read the user's input about the feature
|
|
125
|
+
2. Generate a unique, URL-friendly slug from the feature name (lowercase, hyphen-separated)
|
|
126
|
+
3. Create the directory `prompter/<slug>/` if it doesn't exist
|
|
127
|
+
4. Generate the complete PRD following all requirements above
|
|
128
|
+
5. Save the PRD to `prompter/<slug>/prd-agent.md`
|
|
129
|
+
6. Report the saved file path
|
|
130
|
+
|
|
131
|
+
## REFERENCE
|
|
132
|
+
- Read `prompter/project.md` for project context if needed
|
|
133
|
+
<!-- prompter-managed-end -->
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,127 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## [0.5.1] - 2026-01-22
|
|
4
|
+
|
|
5
|
+
### ⨠Added
|
|
6
|
+
- **Upgrade Command**: New command for self-updating Prompter
|
|
7
|
+
- Run `prompter upgrade` to update to the latest version
|
|
8
|
+
- Automatically executes `npm install -g @dedesfr/prompter@latest`
|
|
9
|
+
- Cross-platform support (Windows, macOS, Linux)
|
|
10
|
+
- Clear success/error feedback
|
|
11
|
+
- Fallback instructions if upgrade fails
|
|
12
|
+
|
|
13
|
+
## [0.5.0] - 2026-01-22
|
|
14
|
+
|
|
15
|
+
### ⨠Added
|
|
16
|
+
- **Prompt Installation & Management**: New system for installing and managing workflow prompts
|
|
17
|
+
- Install prompts from templates
|
|
18
|
+
- Manage existing prompt workflows
|
|
19
|
+
- Centralized prompt management system
|
|
20
|
+
|
|
21
|
+
## [0.4.3] - 2026-01-22
|
|
22
|
+
|
|
23
|
+
### ⨠Added
|
|
24
|
+
- **PRD Agent Generator**: New command and workflow support
|
|
25
|
+
- Generate PRD (Product Requirements Document) agents
|
|
26
|
+
- Automated workflow creation for PRD generation
|
|
27
|
+
- Integration with AI tools for PRD creation
|
|
28
|
+
|
|
29
|
+
## [0.4.2] - 2026-01-21
|
|
30
|
+
|
|
31
|
+
### ⨠Added
|
|
32
|
+
- **AI Humanizer**: New command and workflow support
|
|
33
|
+
- Humanize AI-generated content
|
|
34
|
+
- Make AI text more natural and conversational
|
|
35
|
+
- Workflow integration for content improvement
|
|
36
|
+
|
|
37
|
+
## [0.4.1] - 2026-01-21
|
|
38
|
+
|
|
39
|
+
### š Changed
|
|
40
|
+
- **Enhanced Product Brief Template**: Comprehensive structure improvements
|
|
41
|
+
- More detailed product brief sections
|
|
42
|
+
- Better organization and clarity
|
|
43
|
+
- Improved guidance for product documentation
|
|
44
|
+
|
|
45
|
+
## [0.4.0] - 2026-01-21
|
|
46
|
+
|
|
47
|
+
### ⨠Added
|
|
48
|
+
- **Product Brief Command**: New workflow support for product documentation
|
|
49
|
+
- Generate product briefs using AI workflows
|
|
50
|
+
- Structured product documentation templates
|
|
51
|
+
- Integration with AI coding tools
|
|
52
|
+
|
|
53
|
+
## [0.3.9] - 2026-01-21
|
|
54
|
+
|
|
55
|
+
### ⨠Added
|
|
56
|
+
- **ASCII Art Banner**: Welcome message during initial setup
|
|
57
|
+
- Visual branding during `prompter init`
|
|
58
|
+
- Improved first-run experience
|
|
59
|
+
|
|
60
|
+
## [0.3.8] - 2026-01-21
|
|
61
|
+
|
|
62
|
+
### ⨠Added
|
|
63
|
+
- **Guide Command**: New command for documentation and help
|
|
64
|
+
- Interactive guide for using Prompter
|
|
65
|
+
- Documentation assistance
|
|
66
|
+
- Usage examples and tips
|
|
67
|
+
|
|
68
|
+
## [0.3.7] - 2026-01-21
|
|
69
|
+
|
|
70
|
+
### ⨠Added
|
|
71
|
+
- **Skill Creator Command**: New workflow for creating skills
|
|
72
|
+
- Generate skill definitions
|
|
73
|
+
- Workflow files for skill creation
|
|
74
|
+
- Integration with AI tools for skill development
|
|
75
|
+
|
|
76
|
+
## [0.3.6] - 2026-01-20
|
|
77
|
+
|
|
78
|
+
### š§ Technical
|
|
79
|
+
- CLI version synchronization with package version
|
|
80
|
+
- Improved version consistency across the codebase
|
|
81
|
+
|
|
82
|
+
## [0.3.5] - 2026-01-20
|
|
83
|
+
|
|
84
|
+
### š Fixed
|
|
85
|
+
- Updated CLI version display to match package version
|
|
86
|
+
|
|
87
|
+
## [0.3.4] - 2026-01-20
|
|
88
|
+
|
|
89
|
+
### š Changed
|
|
90
|
+
- Improved next steps message for `project.md` clarity
|
|
91
|
+
- Enhanced project template with structured sections
|
|
92
|
+
|
|
93
|
+
## [0.3.3] - 2026-01-20
|
|
94
|
+
|
|
95
|
+
### š Fixed
|
|
96
|
+
- **GitHub Copilot Format**: Corrected workflow file format
|
|
97
|
+
- Use `.prompt.md` extension instead of `.md`
|
|
98
|
+
- Add `$ARGUMENTS` placeholder after frontmatter
|
|
99
|
+
- Fixed `$ARGUMENTS` position in template
|
|
100
|
+
|
|
101
|
+
## [0.3.2] - 2026-01-19
|
|
102
|
+
|
|
103
|
+
### š Fixed
|
|
104
|
+
- **Update Command Enhancement**: Now detects configured tools automatically
|
|
105
|
+
- Adds missing workflow files during update
|
|
106
|
+
- Intelligent tool detection from existing workflows
|
|
107
|
+
|
|
108
|
+
## [0.3.1] - 2026-01-19
|
|
109
|
+
|
|
110
|
+
### š Fixed
|
|
111
|
+
- **Re-init Support**: Ensure missing workflow files are added during re-initialization
|
|
112
|
+
- Automatically detect and create missing workflows
|
|
113
|
+
- Safe re-initialization without data loss
|
|
114
|
+
|
|
115
|
+
## [0.3.0] - 2026-01-19
|
|
116
|
+
|
|
117
|
+
### ⨠Added
|
|
118
|
+
- **New Workflows**: Added support for multiple project management workflows
|
|
119
|
+
- PRD (Product Requirements Document) workflow
|
|
120
|
+
- Epic workflow for large features
|
|
121
|
+
- Story workflow for user stories
|
|
122
|
+
- QA test scenario workflow
|
|
123
|
+
- Comprehensive project planning support
|
|
124
|
+
|
|
3
125
|
## [0.2.0] - 2026-01-19
|
|
4
126
|
|
|
5
127
|
### ⨠Added
|
package/dist/cli/index.js
CHANGED
|
@@ -3,15 +3,17 @@ import { InitCommand } from '../commands/init.js';
|
|
|
3
3
|
import { UpdateCommand } from '../commands/update.js';
|
|
4
4
|
import { ListCommand } from '../commands/list.js';
|
|
5
5
|
import { GuideCommand } from '../commands/guide.js';
|
|
6
|
+
import { UpgradeCommand } from '../commands/upgrade.js';
|
|
6
7
|
const program = new Command();
|
|
7
8
|
program
|
|
8
9
|
.name('prompter')
|
|
9
10
|
.description('Enhance prompts directly in your AI coding workflow')
|
|
10
|
-
.version('0.
|
|
11
|
+
.version('0.5.1');
|
|
11
12
|
program
|
|
12
13
|
.command('init')
|
|
13
14
|
.description('Initialize Prompter in your project')
|
|
14
15
|
.option('--tools <tools...>', 'Specify AI tools to configure (antigravity, claude, codex, github-copilot, opencode, kilocode)')
|
|
16
|
+
.option('--prompts <prompts...>', 'Specify prompts to install (ai-humanizer, epic-single, prd-agent-generator, prd-generator, product-brief, qa-test-scenario, skill-creator, story-single)')
|
|
15
17
|
.option('--no-interactive', 'Run without interactive prompts')
|
|
16
18
|
.action(async (options) => {
|
|
17
19
|
const initCommand = new InitCommand();
|
|
@@ -39,5 +41,12 @@ program
|
|
|
39
41
|
const guideCommand = new GuideCommand();
|
|
40
42
|
await guideCommand.execute();
|
|
41
43
|
});
|
|
44
|
+
program
|
|
45
|
+
.command('upgrade')
|
|
46
|
+
.description('Upgrade Prompter to the latest version')
|
|
47
|
+
.action(async () => {
|
|
48
|
+
const upgradeCommand = new UpgradeCommand();
|
|
49
|
+
await upgradeCommand.execute();
|
|
50
|
+
});
|
|
42
51
|
program.parse();
|
|
43
52
|
//# sourceMappingURL=index.js.map
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,E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P,OAAO;KACF,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,2BAA2B,CAAC;KACxC,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;KAClC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACtB,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IACtC,MAAM,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC;AAEP,OAAO;KACF,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,+BAA+B,CAAC;KAC5C,MAAM,CAAC,KAAK,IAAI,EAAE;IACf,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;IACxC,MAAM,YAAY,CAAC,OAAO,EAAE,CAAC;AACjC,CAAC,CAAC,CAAC;AAEP,OAAO;KACF,OAAO,CAAC,SAAS,CAAC;KAClB,WAAW,CAAC,wCAAwC,CAAC;KACrD,MAAM,CAAC,KAAK,IAAI,EAAE;IACf,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IAC5C,MAAM,cAAc,CAAC,OAAO,EAAE,CAAC;AACnC,CAAC,CAAC,CAAC;AAEP,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
interface InitOptions {
|
|
2
2
|
tools?: string[];
|
|
3
|
+
prompts?: string[];
|
|
3
4
|
noInteractive?: boolean;
|
|
4
5
|
}
|
|
5
6
|
export declare class InitCommand {
|
|
@@ -8,6 +9,9 @@ export declare class InitCommand {
|
|
|
8
9
|
private detectConfiguredTools;
|
|
9
10
|
private removeToolFiles;
|
|
10
11
|
private removeEmptyDirs;
|
|
12
|
+
private detectInstalledPrompts;
|
|
13
|
+
private installPrompts;
|
|
14
|
+
private removePrompts;
|
|
11
15
|
}
|
|
12
16
|
export {};
|
|
13
17
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAaA,UAAU,WAAW;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qBAAa,WAAW;IACd,OAAO,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;YAwQzC,UAAU;YASV,qBAAqB;YAwBrB,eAAe;YAkBf,eAAe;YAkBf,sBAAsB;YAatB,cAAc;YAkCd,aAAa;CAqB9B"}
|
package/dist/commands/init.js
CHANGED
|
@@ -2,9 +2,13 @@ import { promises as fs } from 'fs';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { checkbox } from '@inquirer/prompts';
|
|
5
|
-
import { PROMPTER_DIR, SUPPORTED_TOOLS, PrompterConfig } from '../core/config.js';
|
|
5
|
+
import { PROMPTER_DIR, SUPPORTED_TOOLS, AVAILABLE_PROMPTS, PrompterConfig } from '../core/config.js';
|
|
6
6
|
import { projectTemplate, agentsTemplate } from '../core/templates/index.js';
|
|
7
7
|
import { registry } from '../core/configurators/slash/index.js';
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
import { dirname } from 'path';
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
11
|
+
const __dirname = dirname(__filename);
|
|
8
12
|
export class InitCommand {
|
|
9
13
|
async execute(options = {}) {
|
|
10
14
|
const projectPath = process.cwd();
|
|
@@ -69,6 +73,32 @@ export class InitCommand {
|
|
|
69
73
|
// In non-interactive re-init without tools specified, keep current tools
|
|
70
74
|
selectedTools = currentTools;
|
|
71
75
|
}
|
|
76
|
+
// Select prompts
|
|
77
|
+
let selectedPrompts = [];
|
|
78
|
+
if (options.prompts && options.prompts.length > 0) {
|
|
79
|
+
selectedPrompts = options.prompts;
|
|
80
|
+
}
|
|
81
|
+
else if (!options.noInteractive) {
|
|
82
|
+
try {
|
|
83
|
+
// Detect currently installed prompts (use path.join to get prompter path)
|
|
84
|
+
const prompterPathForDetection = path.join(projectPath, PROMPTER_DIR);
|
|
85
|
+
const currentPrompts = await this.detectInstalledPrompts(prompterPathForDetection);
|
|
86
|
+
selectedPrompts = await checkbox({
|
|
87
|
+
message: 'Select prompt templates to install:',
|
|
88
|
+
choices: AVAILABLE_PROMPTS.map(prompt => ({
|
|
89
|
+
name: `${prompt.name} - ${chalk.gray(prompt.description)}`,
|
|
90
|
+
value: prompt.value,
|
|
91
|
+
checked: currentPrompts.includes(prompt.value)
|
|
92
|
+
})),
|
|
93
|
+
pageSize: 15
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
// User cancelled
|
|
98
|
+
console.log(chalk.yellow(isReInitialization ? '\nRe-configuration cancelled.' : '\nInitialization cancelled.'));
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
72
102
|
// Create or ensure prompter directory
|
|
73
103
|
const prompterPath = await PrompterConfig.ensurePrompterDir(projectPath);
|
|
74
104
|
if (!isReInitialization) {
|
|
@@ -98,6 +128,12 @@ export class InitCommand {
|
|
|
98
128
|
const toolsToAdd = selectedTools.filter(t => !currentTools.includes(t));
|
|
99
129
|
const toolsToRemove = currentTools.filter(t => !selectedTools.includes(t));
|
|
100
130
|
const toolsToKeep = selectedTools.filter(t => currentTools.includes(t));
|
|
131
|
+
// Handle prompt changes
|
|
132
|
+
const prompterPathForDetection = path.join(projectPath, PROMPTER_DIR);
|
|
133
|
+
const currentPrompts = await this.detectInstalledPrompts(prompterPathForDetection);
|
|
134
|
+
const promptsToAdd = selectedPrompts.filter(p => !currentPrompts.includes(p));
|
|
135
|
+
const promptsToRemove = currentPrompts.filter(p => !selectedPrompts.includes(p));
|
|
136
|
+
const promptsToKeep = selectedPrompts.filter(p => currentPrompts.includes(p));
|
|
101
137
|
// Remove old tool files
|
|
102
138
|
if (toolsToRemove.length > 0) {
|
|
103
139
|
console.log(chalk.blue('\nšļø Removing workflow files...\n'));
|
|
@@ -116,6 +152,14 @@ export class InitCommand {
|
|
|
116
152
|
}
|
|
117
153
|
}
|
|
118
154
|
}
|
|
155
|
+
// Remove unchecked prompts
|
|
156
|
+
if (promptsToRemove.length > 0) {
|
|
157
|
+
console.log(chalk.blue('\nšļø Removing prompt templates...\n'));
|
|
158
|
+
const removedPrompts = await this.removePrompts(prompterPath, promptsToRemove);
|
|
159
|
+
for (const promptName of removedPrompts) {
|
|
160
|
+
console.log(chalk.yellow('ā') + ` Removed ${chalk.cyan(promptName)}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
119
163
|
// Generate workflow files for new tools
|
|
120
164
|
if (toolsToAdd.length > 0) {
|
|
121
165
|
console.log(chalk.blue('\nš Creating workflow files...\n'));
|
|
@@ -168,23 +212,43 @@ export class InitCommand {
|
|
|
168
212
|
}
|
|
169
213
|
}
|
|
170
214
|
}
|
|
215
|
+
// Install new prompts
|
|
216
|
+
if (promptsToAdd.length > 0) {
|
|
217
|
+
console.log(chalk.blue('\nš Installing prompt templates...\n'));
|
|
218
|
+
const installedPrompts = await this.installPrompts(projectPath, prompterPath, promptsToAdd);
|
|
219
|
+
for (const promptName of installedPrompts) {
|
|
220
|
+
console.log(chalk.green('ā') + ` Installed ${chalk.cyan(promptName)}`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
171
223
|
// Success message
|
|
172
224
|
if (isReInitialization) {
|
|
173
225
|
console.log(chalk.green('\nā
Prompter tools updated successfully!\n'));
|
|
174
|
-
if (toolsToAdd.length > 0 || toolsToRemove.length > 0) {
|
|
226
|
+
if (toolsToAdd.length > 0 || toolsToRemove.length > 0 || promptsToAdd.length > 0 || promptsToRemove.length > 0) {
|
|
175
227
|
console.log(chalk.blue('Summary:'));
|
|
176
228
|
if (toolsToAdd.length > 0) {
|
|
177
|
-
console.log(chalk.green(' Added: ') + toolsToAdd.map(t => {
|
|
229
|
+
console.log(chalk.green(' Tools Added: ') + toolsToAdd.map(t => {
|
|
178
230
|
const tool = SUPPORTED_TOOLS.find(st => st.value === t);
|
|
179
231
|
return tool ? tool.name : t;
|
|
180
232
|
}).join(', '));
|
|
181
233
|
}
|
|
182
234
|
if (toolsToRemove.length > 0) {
|
|
183
|
-
console.log(chalk.yellow(' Removed: ') + toolsToRemove.map(t => {
|
|
235
|
+
console.log(chalk.yellow(' Tools Removed: ') + toolsToRemove.map(t => {
|
|
184
236
|
const tool = SUPPORTED_TOOLS.find(st => st.value === t);
|
|
185
237
|
return tool ? tool.name : t;
|
|
186
238
|
}).join(', '));
|
|
187
239
|
}
|
|
240
|
+
if (promptsToAdd.length > 0) {
|
|
241
|
+
console.log(chalk.green(' Prompts Added: ') + promptsToAdd.map(p => {
|
|
242
|
+
const prompt = AVAILABLE_PROMPTS.find(ap => ap.value === p);
|
|
243
|
+
return prompt ? prompt.name : p;
|
|
244
|
+
}).join(', '));
|
|
245
|
+
}
|
|
246
|
+
if (promptsToRemove.length > 0) {
|
|
247
|
+
console.log(chalk.yellow(' Prompts Removed: ') + promptsToRemove.map(p => {
|
|
248
|
+
const prompt = AVAILABLE_PROMPTS.find(ap => ap.value === p);
|
|
249
|
+
return prompt ? prompt.name : p;
|
|
250
|
+
}).join(', '));
|
|
251
|
+
}
|
|
188
252
|
console.log();
|
|
189
253
|
}
|
|
190
254
|
else {
|
|
@@ -193,6 +257,9 @@ export class InitCommand {
|
|
|
193
257
|
}
|
|
194
258
|
else {
|
|
195
259
|
console.log(chalk.green('\nā
Prompter initialized successfully!\n'));
|
|
260
|
+
if (promptsToAdd.length > 0) {
|
|
261
|
+
console.log(chalk.gray(`Installed ${promptsToAdd.length} prompt template(s).\n`));
|
|
262
|
+
}
|
|
196
263
|
console.log(chalk.gray('Run `prompter guide` for next steps.\n'));
|
|
197
264
|
}
|
|
198
265
|
}
|
|
@@ -255,5 +322,63 @@ export class InitCommand {
|
|
|
255
322
|
// Directory doesn't exist or can't be removed, ignore
|
|
256
323
|
}
|
|
257
324
|
}
|
|
325
|
+
async detectInstalledPrompts(prompterPath) {
|
|
326
|
+
const installedPrompts = [];
|
|
327
|
+
for (const prompt of AVAILABLE_PROMPTS) {
|
|
328
|
+
const promptFilePath = path.join(prompterPath, prompt.sourceFile);
|
|
329
|
+
if (await this.fileExists(promptFilePath)) {
|
|
330
|
+
installedPrompts.push(prompt.value);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return installedPrompts;
|
|
334
|
+
}
|
|
335
|
+
async installPrompts(projectPath, prompterPath, selectedPrompts) {
|
|
336
|
+
const installedPrompts = [];
|
|
337
|
+
// Get the path to the prompt templates directory
|
|
338
|
+
// In production: node_modules/prompter/prompt/
|
|
339
|
+
// In development: prompt/
|
|
340
|
+
const promptSourceDir = path.join(__dirname, '../../prompt');
|
|
341
|
+
for (const promptId of selectedPrompts) {
|
|
342
|
+
const prompt = AVAILABLE_PROMPTS.find(p => p.value === promptId);
|
|
343
|
+
if (!prompt)
|
|
344
|
+
continue;
|
|
345
|
+
const sourcePath = path.join(promptSourceDir, prompt.sourceFile);
|
|
346
|
+
const destPath = path.join(prompterPath, prompt.sourceFile);
|
|
347
|
+
try {
|
|
348
|
+
// Check if source file exists
|
|
349
|
+
if (!await this.fileExists(sourcePath)) {
|
|
350
|
+
console.log(chalk.yellow(` Warning: Source file not found for ${prompt.name}`));
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
// Copy the prompt file
|
|
354
|
+
const content = await fs.readFile(sourcePath, 'utf-8');
|
|
355
|
+
await fs.writeFile(destPath, content, 'utf-8');
|
|
356
|
+
installedPrompts.push(prompt.name);
|
|
357
|
+
}
|
|
358
|
+
catch (error) {
|
|
359
|
+
console.log(chalk.red(` Error installing ${prompt.name}: ${error}`));
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return installedPrompts;
|
|
363
|
+
}
|
|
364
|
+
async removePrompts(prompterPath, promptsToRemove) {
|
|
365
|
+
const removedPrompts = [];
|
|
366
|
+
for (const promptId of promptsToRemove) {
|
|
367
|
+
const prompt = AVAILABLE_PROMPTS.find(p => p.value === promptId);
|
|
368
|
+
if (!prompt)
|
|
369
|
+
continue;
|
|
370
|
+
const filePath = path.join(prompterPath, prompt.sourceFile);
|
|
371
|
+
try {
|
|
372
|
+
if (await this.fileExists(filePath)) {
|
|
373
|
+
await fs.unlink(filePath);
|
|
374
|
+
removedPrompts.push(prompt.name);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
catch (error) {
|
|
378
|
+
console.log(chalk.red(` Error removing ${prompt.name}: ${error}`));
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return removedPrompts;
|
|
382
|
+
}
|
|
258
383
|
}
|
|
259
384
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAOhE,MAAM,OAAO,WAAW;IACpB,KAAK,CAAC,OAAO,CAAC,UAAuB,EAAE;QACnC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,MAAM,kBAAkB,GAAG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jE,IAAI,CAAC,MAAM;gBAAE,SAAS;YAEtB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;YAE5D,IAAI,CAAC;gBACD,IAAI,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;oBAClC,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;oBAC1B,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACrC,CAAC;YACL,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,oBAAoB,MAAM,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC;YACxE,CAAC;QACL,CAAC;QAED,OAAO,cAAc,CAAC;IAC1B,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.d.ts","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"AAGA,qBAAa,cAAc;IACjB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAyBjC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { spawn } from 'child_process';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
export class UpgradeCommand {
|
|
4
|
+
async execute() {
|
|
5
|
+
console.log(chalk.cyan('\nš Upgrading Prompter to the latest version...\n'));
|
|
6
|
+
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
7
|
+
const upgrade = spawn(npmCommand, ['install', '-g', '@dedesfr/prompter@latest'], {
|
|
8
|
+
stdio: 'inherit',
|
|
9
|
+
shell: true
|
|
10
|
+
});
|
|
11
|
+
upgrade.on('close', (code) => {
|
|
12
|
+
if (code === 0) {
|
|
13
|
+
console.log(chalk.green('\nā Prompter has been upgraded successfully!\n'));
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
console.error(chalk.red(`\nā Upgrade failed with exit code ${code}\n`));
|
|
17
|
+
process.exit(code || 1);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
upgrade.on('error', (error) => {
|
|
21
|
+
console.error(chalk.red('\nā Failed to run upgrade command:'), error.message);
|
|
22
|
+
console.log(chalk.yellow('\nPlease run manually: npm install -g @dedesfr/prompter@latest\n'));
|
|
23
|
+
process.exit(1);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=upgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../src/commands/upgrade.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,OAAO,cAAc;IACvB,KAAK,CAAC,OAAO;QACT,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC,CAAC;QAE9E,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;QAEpE,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,0BAA0B,CAAC,EAAE;YAC7E,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,IAAI;SACd,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;YACzB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC,CAAC;YAC/E,CAAC;iBAAM,CAAC;gBACJ,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,qCAAqC,IAAI,IAAI,CAAC,CAAC,CAAC;gBACxE,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;YAC5B,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAC1B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,oCAAoC,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YAC9E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,kEAAkE,CAAC,CAAC,CAAC;YAC9F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
package/dist/core/config.d.ts
CHANGED
|
@@ -9,7 +9,14 @@ export interface ToolChoice {
|
|
|
9
9
|
available: boolean;
|
|
10
10
|
successLabel: string;
|
|
11
11
|
}
|
|
12
|
+
export interface PromptChoice {
|
|
13
|
+
name: string;
|
|
14
|
+
value: string;
|
|
15
|
+
description: string;
|
|
16
|
+
sourceFile: string;
|
|
17
|
+
}
|
|
12
18
|
export declare const SUPPORTED_TOOLS: ToolChoice[];
|
|
19
|
+
export declare const AVAILABLE_PROMPTS: PromptChoice[];
|
|
13
20
|
export declare class PrompterConfig {
|
|
14
21
|
static ensurePrompterDir(projectPath: string): Promise<string>;
|
|
15
22
|
static prompterDirExists(projectPath: string): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC;AAEF,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,EAAE,UAAU,EAOvC,CAAC;AAEF,qBAAa,cAAc;WACV,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;WAMvD,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CASxE"}
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,aAAa,CAAC;AAEvC,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC;AAEF,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,EAAE,UAAU,EAOvC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,YAAY,EAiD3C,CAAC;AAEF,qBAAa,cAAc;WACV,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;WAMvD,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CASxE"}
|
package/dist/core/config.js
CHANGED
|
@@ -13,6 +13,56 @@ export const SUPPORTED_TOOLS = [
|
|
|
13
13
|
{ name: 'OpenCode', value: 'opencode', available: true, successLabel: 'OpenCode' },
|
|
14
14
|
{ name: 'Kilo Code', value: 'kilocode', available: true, successLabel: 'Kilo Code' }
|
|
15
15
|
];
|
|
16
|
+
export const AVAILABLE_PROMPTS = [
|
|
17
|
+
{
|
|
18
|
+
name: 'AI Humanizer',
|
|
19
|
+
value: 'ai-humanizer',
|
|
20
|
+
description: 'Transform AI-generated text into natural, human-like content',
|
|
21
|
+
sourceFile: 'ai-humanizer.md'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'Epic (Single)',
|
|
25
|
+
value: 'epic-single',
|
|
26
|
+
description: 'Generate comprehensive epic documentation',
|
|
27
|
+
sourceFile: 'epic-single.md'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'PRD Agent Generator',
|
|
31
|
+
value: 'prd-agent-generator',
|
|
32
|
+
description: 'Create AGENT.md files with Product Requirements Document prompts',
|
|
33
|
+
sourceFile: 'prd-agent-generator.md'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'PRD Generator',
|
|
37
|
+
value: 'prd-generator',
|
|
38
|
+
description: 'Generate detailed Product Requirements Documents',
|
|
39
|
+
sourceFile: 'prd-generator.md'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Product Brief',
|
|
43
|
+
value: 'product-brief',
|
|
44
|
+
description: 'Create concise product brief documents',
|
|
45
|
+
sourceFile: 'product-brief.md'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'QA Test Scenario',
|
|
49
|
+
value: 'qa-test-scenario',
|
|
50
|
+
description: 'Generate comprehensive test scenarios and test cases',
|
|
51
|
+
sourceFile: 'qa-test-scenario.md'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'Skill Creator',
|
|
55
|
+
value: 'skill-creator',
|
|
56
|
+
description: 'Create structured skill documentation for AI agents',
|
|
57
|
+
sourceFile: 'skill-creator.md'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Story (Single)',
|
|
61
|
+
value: 'story-single',
|
|
62
|
+
description: 'Generate detailed user story documentation',
|
|
63
|
+
sourceFile: 'story-single.md'
|
|
64
|
+
}
|
|
65
|
+
];
|
|
16
66
|
export class PrompterConfig {
|
|
17
67
|
static async ensurePrompterDir(projectPath) {
|
|
18
68
|
const prompterPath = path.join(projectPath, PROMPTER_DIR);
|
package/dist/core/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AAEvC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,KAAK,EAAE,iCAAiC;IACxC,GAAG,EAAE,+BAA+B;CACvC,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;AAEvC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,KAAK,EAAE,iCAAiC;IACxC,GAAG,EAAE,+BAA+B;CACvC,CAAC;AAgBF,MAAM,CAAC,MAAM,eAAe,GAAiB;IACzC,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE;IAC3F,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE;IACtF,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE;IACzE,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,gBAAgB,EAAE;IACpG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AAC,iBAAiB,CAAC,WAAmB;QAC9C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAC1D,MAAM,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAClD,OAAO,YAAY,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,WAAmB;QAC9C,IAAI,CAAC;YACD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;YAC1D,MAAM,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YAC9B,OAAO,IAAI,CAAC;QAChB,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ"}
|
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -3,18 +3,20 @@ import { InitCommand } from '../commands/init.js';
|
|
|
3
3
|
import { UpdateCommand } from '../commands/update.js';
|
|
4
4
|
import { ListCommand } from '../commands/list.js';
|
|
5
5
|
import { GuideCommand } from '../commands/guide.js';
|
|
6
|
+
import { UpgradeCommand } from '../commands/upgrade.js';
|
|
6
7
|
|
|
7
8
|
const program = new Command();
|
|
8
9
|
|
|
9
10
|
program
|
|
10
11
|
.name('prompter')
|
|
11
12
|
.description('Enhance prompts directly in your AI coding workflow')
|
|
12
|
-
.version('0.
|
|
13
|
+
.version('0.5.1');
|
|
13
14
|
|
|
14
15
|
program
|
|
15
16
|
.command('init')
|
|
16
17
|
.description('Initialize Prompter in your project')
|
|
17
18
|
.option('--tools <tools...>', 'Specify AI tools to configure (antigravity, claude, codex, github-copilot, opencode, kilocode)')
|
|
19
|
+
.option('--prompts <prompts...>', 'Specify prompts to install (ai-humanizer, epic-single, prd-agent-generator, prd-generator, product-brief, qa-test-scenario, skill-creator, story-single)')
|
|
18
20
|
.option('--no-interactive', 'Run without interactive prompts')
|
|
19
21
|
.action(async (options) => {
|
|
20
22
|
const initCommand = new InitCommand();
|
|
@@ -46,4 +48,12 @@ program
|
|
|
46
48
|
await guideCommand.execute();
|
|
47
49
|
});
|
|
48
50
|
|
|
51
|
+
program
|
|
52
|
+
.command('upgrade')
|
|
53
|
+
.description('Upgrade Prompter to the latest version')
|
|
54
|
+
.action(async () => {
|
|
55
|
+
const upgradeCommand = new UpgradeCommand();
|
|
56
|
+
await upgradeCommand.execute();
|
|
57
|
+
});
|
|
58
|
+
|
|
49
59
|
program.parse();
|
package/src/commands/init.ts
CHANGED
|
@@ -2,12 +2,18 @@ import { promises as fs } from 'fs';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { checkbox } from '@inquirer/prompts';
|
|
5
|
-
import { PROMPTER_DIR, SUPPORTED_TOOLS, PrompterConfig } from '../core/config.js';
|
|
5
|
+
import { PROMPTER_DIR, SUPPORTED_TOOLS, AVAILABLE_PROMPTS, PrompterConfig } from '../core/config.js';
|
|
6
6
|
import { projectTemplate, agentsTemplate } from '../core/templates/index.js';
|
|
7
7
|
import { registry } from '../core/configurators/slash/index.js';
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
import { dirname } from 'path';
|
|
10
|
+
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = dirname(__filename);
|
|
8
13
|
|
|
9
14
|
interface InitOptions {
|
|
10
15
|
tools?: string[];
|
|
16
|
+
prompts?: string[];
|
|
11
17
|
noInteractive?: boolean;
|
|
12
18
|
}
|
|
13
19
|
|
|
@@ -78,6 +84,33 @@ export class InitCommand {
|
|
|
78
84
|
selectedTools = currentTools;
|
|
79
85
|
}
|
|
80
86
|
|
|
87
|
+
// Select prompts
|
|
88
|
+
let selectedPrompts: string[] = [];
|
|
89
|
+
|
|
90
|
+
if (options.prompts && options.prompts.length > 0) {
|
|
91
|
+
selectedPrompts = options.prompts;
|
|
92
|
+
} else if (!options.noInteractive) {
|
|
93
|
+
try {
|
|
94
|
+
// Detect currently installed prompts (use path.join to get prompter path)
|
|
95
|
+
const prompterPathForDetection = path.join(projectPath, PROMPTER_DIR);
|
|
96
|
+
const currentPrompts = await this.detectInstalledPrompts(prompterPathForDetection);
|
|
97
|
+
|
|
98
|
+
selectedPrompts = await checkbox({
|
|
99
|
+
message: 'Select prompt templates to install:',
|
|
100
|
+
choices: AVAILABLE_PROMPTS.map(prompt => ({
|
|
101
|
+
name: `${prompt.name} - ${chalk.gray(prompt.description)}`,
|
|
102
|
+
value: prompt.value,
|
|
103
|
+
checked: currentPrompts.includes(prompt.value)
|
|
104
|
+
})),
|
|
105
|
+
pageSize: 15
|
|
106
|
+
});
|
|
107
|
+
} catch (error) {
|
|
108
|
+
// User cancelled
|
|
109
|
+
console.log(chalk.yellow(isReInitialization ? '\nRe-configuration cancelled.' : '\nInitialization cancelled.'));
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
81
114
|
// Create or ensure prompter directory
|
|
82
115
|
const prompterPath = await PrompterConfig.ensurePrompterDir(projectPath);
|
|
83
116
|
if (!isReInitialization) {
|
|
@@ -109,6 +142,13 @@ export class InitCommand {
|
|
|
109
142
|
const toolsToRemove = currentTools.filter(t => !selectedTools.includes(t));
|
|
110
143
|
const toolsToKeep = selectedTools.filter(t => currentTools.includes(t));
|
|
111
144
|
|
|
145
|
+
// Handle prompt changes
|
|
146
|
+
const prompterPathForDetection = path.join(projectPath, PROMPTER_DIR);
|
|
147
|
+
const currentPrompts = await this.detectInstalledPrompts(prompterPathForDetection);
|
|
148
|
+
const promptsToAdd = selectedPrompts.filter(p => !currentPrompts.includes(p));
|
|
149
|
+
const promptsToRemove = currentPrompts.filter(p => !selectedPrompts.includes(p));
|
|
150
|
+
const promptsToKeep = selectedPrompts.filter(p => currentPrompts.includes(p));
|
|
151
|
+
|
|
112
152
|
// Remove old tool files
|
|
113
153
|
if (toolsToRemove.length > 0) {
|
|
114
154
|
console.log(chalk.blue('\nšļø Removing workflow files...\n'));
|
|
@@ -127,6 +167,15 @@ export class InitCommand {
|
|
|
127
167
|
}
|
|
128
168
|
}
|
|
129
169
|
|
|
170
|
+
// Remove unchecked prompts
|
|
171
|
+
if (promptsToRemove.length > 0) {
|
|
172
|
+
console.log(chalk.blue('\nšļø Removing prompt templates...\n'));
|
|
173
|
+
const removedPrompts = await this.removePrompts(prompterPath, promptsToRemove);
|
|
174
|
+
for (const promptName of removedPrompts) {
|
|
175
|
+
console.log(chalk.yellow('ā') + ` Removed ${chalk.cyan(promptName)}`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
130
179
|
// Generate workflow files for new tools
|
|
131
180
|
if (toolsToAdd.length > 0) {
|
|
132
181
|
console.log(chalk.blue('\nš Creating workflow files...\n'));
|
|
@@ -182,29 +231,53 @@ export class InitCommand {
|
|
|
182
231
|
}
|
|
183
232
|
}
|
|
184
233
|
|
|
234
|
+
// Install new prompts
|
|
235
|
+
if (promptsToAdd.length > 0) {
|
|
236
|
+
console.log(chalk.blue('\nš Installing prompt templates...\n'));
|
|
237
|
+
const installedPrompts = await this.installPrompts(projectPath, prompterPath, promptsToAdd);
|
|
238
|
+
for (const promptName of installedPrompts) {
|
|
239
|
+
console.log(chalk.green('ā') + ` Installed ${chalk.cyan(promptName)}`);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
185
243
|
// Success message
|
|
186
244
|
if (isReInitialization) {
|
|
187
245
|
console.log(chalk.green('\nā
Prompter tools updated successfully!\n'));
|
|
188
|
-
if (toolsToAdd.length > 0 || toolsToRemove.length > 0) {
|
|
246
|
+
if (toolsToAdd.length > 0 || toolsToRemove.length > 0 || promptsToAdd.length > 0 || promptsToRemove.length > 0) {
|
|
189
247
|
console.log(chalk.blue('Summary:'));
|
|
190
248
|
if (toolsToAdd.length > 0) {
|
|
191
|
-
console.log(chalk.green(' Added: ') + toolsToAdd.map(t => {
|
|
249
|
+
console.log(chalk.green(' Tools Added: ') + toolsToAdd.map(t => {
|
|
192
250
|
const tool = SUPPORTED_TOOLS.find(st => st.value === t);
|
|
193
251
|
return tool ? tool.name : t;
|
|
194
252
|
}).join(', '));
|
|
195
253
|
}
|
|
196
254
|
if (toolsToRemove.length > 0) {
|
|
197
|
-
console.log(chalk.yellow(' Removed: ') + toolsToRemove.map(t => {
|
|
255
|
+
console.log(chalk.yellow(' Tools Removed: ') + toolsToRemove.map(t => {
|
|
198
256
|
const tool = SUPPORTED_TOOLS.find(st => st.value === t);
|
|
199
257
|
return tool ? tool.name : t;
|
|
200
258
|
}).join(', '));
|
|
201
259
|
}
|
|
260
|
+
if (promptsToAdd.length > 0) {
|
|
261
|
+
console.log(chalk.green(' Prompts Added: ') + promptsToAdd.map(p => {
|
|
262
|
+
const prompt = AVAILABLE_PROMPTS.find(ap => ap.value === p);
|
|
263
|
+
return prompt ? prompt.name : p;
|
|
264
|
+
}).join(', '));
|
|
265
|
+
}
|
|
266
|
+
if (promptsToRemove.length > 0) {
|
|
267
|
+
console.log(chalk.yellow(' Prompts Removed: ') + promptsToRemove.map(p => {
|
|
268
|
+
const prompt = AVAILABLE_PROMPTS.find(ap => ap.value === p);
|
|
269
|
+
return prompt ? prompt.name : p;
|
|
270
|
+
}).join(', '));
|
|
271
|
+
}
|
|
202
272
|
console.log();
|
|
203
273
|
} else {
|
|
204
274
|
console.log(chalk.gray(' No changes made.\n'));
|
|
205
275
|
}
|
|
206
276
|
} else {
|
|
207
277
|
console.log(chalk.green('\nā
Prompter initialized successfully!\n'));
|
|
278
|
+
if (promptsToAdd.length > 0) {
|
|
279
|
+
console.log(chalk.gray(`Installed ${promptsToAdd.length} prompt template(s).\n`));
|
|
280
|
+
}
|
|
208
281
|
console.log(chalk.gray('Run `prompter guide` for next steps.\n'));
|
|
209
282
|
}
|
|
210
283
|
}
|
|
@@ -277,4 +350,73 @@ export class InitCommand {
|
|
|
277
350
|
// Directory doesn't exist or can't be removed, ignore
|
|
278
351
|
}
|
|
279
352
|
}
|
|
353
|
+
|
|
354
|
+
private async detectInstalledPrompts(prompterPath: string): Promise<string[]> {
|
|
355
|
+
const installedPrompts: string[] = [];
|
|
356
|
+
|
|
357
|
+
for (const prompt of AVAILABLE_PROMPTS) {
|
|
358
|
+
const promptFilePath = path.join(prompterPath, prompt.sourceFile);
|
|
359
|
+
if (await this.fileExists(promptFilePath)) {
|
|
360
|
+
installedPrompts.push(prompt.value);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
return installedPrompts;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
private async installPrompts(projectPath: string, prompterPath: string, selectedPrompts: string[]): Promise<string[]> {
|
|
368
|
+
const installedPrompts: string[] = [];
|
|
369
|
+
|
|
370
|
+
// Get the path to the prompt templates directory
|
|
371
|
+
// In production: node_modules/prompter/prompt/
|
|
372
|
+
// In development: prompt/
|
|
373
|
+
const promptSourceDir = path.join(__dirname, '../../prompt');
|
|
374
|
+
|
|
375
|
+
for (const promptId of selectedPrompts) {
|
|
376
|
+
const prompt = AVAILABLE_PROMPTS.find(p => p.value === promptId);
|
|
377
|
+
if (!prompt) continue;
|
|
378
|
+
|
|
379
|
+
const sourcePath = path.join(promptSourceDir, prompt.sourceFile);
|
|
380
|
+
const destPath = path.join(prompterPath, prompt.sourceFile);
|
|
381
|
+
|
|
382
|
+
try {
|
|
383
|
+
// Check if source file exists
|
|
384
|
+
if (!await this.fileExists(sourcePath)) {
|
|
385
|
+
console.log(chalk.yellow(` Warning: Source file not found for ${prompt.name}`));
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// Copy the prompt file
|
|
390
|
+
const content = await fs.readFile(sourcePath, 'utf-8');
|
|
391
|
+
await fs.writeFile(destPath, content, 'utf-8');
|
|
392
|
+
installedPrompts.push(prompt.name);
|
|
393
|
+
} catch (error) {
|
|
394
|
+
console.log(chalk.red(` Error installing ${prompt.name}: ${error}`));
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
return installedPrompts;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
private async removePrompts(prompterPath: string, promptsToRemove: string[]): Promise<string[]> {
|
|
402
|
+
const removedPrompts: string[] = [];
|
|
403
|
+
|
|
404
|
+
for (const promptId of promptsToRemove) {
|
|
405
|
+
const prompt = AVAILABLE_PROMPTS.find(p => p.value === promptId);
|
|
406
|
+
if (!prompt) continue;
|
|
407
|
+
|
|
408
|
+
const filePath = path.join(prompterPath, prompt.sourceFile);
|
|
409
|
+
|
|
410
|
+
try {
|
|
411
|
+
if (await this.fileExists(filePath)) {
|
|
412
|
+
await fs.unlink(filePath);
|
|
413
|
+
removedPrompts.push(prompt.name);
|
|
414
|
+
}
|
|
415
|
+
} catch (error) {
|
|
416
|
+
console.log(chalk.red(` Error removing ${prompt.name}: ${error}`));
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return removedPrompts;
|
|
421
|
+
}
|
|
280
422
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { spawn } from 'child_process';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
|
|
4
|
+
export class UpgradeCommand {
|
|
5
|
+
async execute(): Promise<void> {
|
|
6
|
+
console.log(chalk.cyan('\nš Upgrading Prompter to the latest version...\n'));
|
|
7
|
+
|
|
8
|
+
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
|
9
|
+
|
|
10
|
+
const upgrade = spawn(npmCommand, ['install', '-g', '@dedesfr/prompter@latest'], {
|
|
11
|
+
stdio: 'inherit',
|
|
12
|
+
shell: true
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
upgrade.on('close', (code) => {
|
|
16
|
+
if (code === 0) {
|
|
17
|
+
console.log(chalk.green('\nā Prompter has been upgraded successfully!\n'));
|
|
18
|
+
} else {
|
|
19
|
+
console.error(chalk.red(`\nā Upgrade failed with exit code ${code}\n`));
|
|
20
|
+
process.exit(code || 1);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
upgrade.on('error', (error) => {
|
|
25
|
+
console.error(chalk.red('\nā Failed to run upgrade command:'), error.message);
|
|
26
|
+
console.log(chalk.yellow('\nPlease run manually: npm install -g @dedesfr/prompter@latest\n'));
|
|
27
|
+
process.exit(1);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
package/src/core/config.ts
CHANGED
|
@@ -15,6 +15,13 @@ export interface ToolChoice {
|
|
|
15
15
|
successLabel: string;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
export interface PromptChoice {
|
|
19
|
+
name: string;
|
|
20
|
+
value: string;
|
|
21
|
+
description: string;
|
|
22
|
+
sourceFile: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
export const SUPPORTED_TOOLS: ToolChoice[] = [
|
|
19
26
|
{ name: 'Antigravity', value: 'antigravity', available: true, successLabel: 'Antigravity' },
|
|
20
27
|
{ name: 'Claude Code', value: 'claude', available: true, successLabel: 'Claude Code' },
|
|
@@ -24,6 +31,57 @@ export const SUPPORTED_TOOLS: ToolChoice[] = [
|
|
|
24
31
|
{ name: 'Kilo Code', value: 'kilocode', available: true, successLabel: 'Kilo Code' }
|
|
25
32
|
];
|
|
26
33
|
|
|
34
|
+
export const AVAILABLE_PROMPTS: PromptChoice[] = [
|
|
35
|
+
{
|
|
36
|
+
name: 'AI Humanizer',
|
|
37
|
+
value: 'ai-humanizer',
|
|
38
|
+
description: 'Transform AI-generated text into natural, human-like content',
|
|
39
|
+
sourceFile: 'ai-humanizer.md'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Epic (Single)',
|
|
43
|
+
value: 'epic-single',
|
|
44
|
+
description: 'Generate comprehensive epic documentation',
|
|
45
|
+
sourceFile: 'epic-single.md'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'PRD Agent Generator',
|
|
49
|
+
value: 'prd-agent-generator',
|
|
50
|
+
description: 'Create AGENT.md files with Product Requirements Document prompts',
|
|
51
|
+
sourceFile: 'prd-agent-generator.md'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'PRD Generator',
|
|
55
|
+
value: 'prd-generator',
|
|
56
|
+
description: 'Generate detailed Product Requirements Documents',
|
|
57
|
+
sourceFile: 'prd-generator.md'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Product Brief',
|
|
61
|
+
value: 'product-brief',
|
|
62
|
+
description: 'Create concise product brief documents',
|
|
63
|
+
sourceFile: 'product-brief.md'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: 'QA Test Scenario',
|
|
67
|
+
value: 'qa-test-scenario',
|
|
68
|
+
description: 'Generate comprehensive test scenarios and test cases',
|
|
69
|
+
sourceFile: 'qa-test-scenario.md'
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'Skill Creator',
|
|
73
|
+
value: 'skill-creator',
|
|
74
|
+
description: 'Create structured skill documentation for AI agents',
|
|
75
|
+
sourceFile: 'skill-creator.md'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: 'Story (Single)',
|
|
79
|
+
value: 'story-single',
|
|
80
|
+
description: 'Generate detailed user story documentation',
|
|
81
|
+
sourceFile: 'story-single.md'
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
|
|
27
85
|
export class PrompterConfig {
|
|
28
86
|
static async ensurePrompterDir(projectPath: string): Promise<string> {
|
|
29
87
|
const prompterPath = path.join(projectPath, PROMPTER_DIR);
|