@dedesfr/prompter 0.1.0 → 0.2.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/CHANGELOG.md ADDED
@@ -0,0 +1,50 @@
1
+ # CHANGELOG
2
+
3
+ ## [0.2.0] - 2026-01-19
4
+
5
+ ### ✨ Added
6
+ - **Re-configurable AI Tools**: `prompter init` now allows re-selection of AI tools at any time, even after initial setup
7
+ - Add new AI tools to existing configuration
8
+ - Remove unused AI tools
9
+ - Switch between different AI tools seamlessly
10
+ - Interactive checkbox interface with current tools pre-selected
11
+ - Non-interactive mode with `--tools` flag for automation
12
+
13
+ ### šŸ”„ Changed
14
+ - `prompter init` no longer blocks on already-initialized projects
15
+ - Tool selection now shows currently configured tools before prompting
16
+ - Success messages now context-aware (initialization vs re-configuration)
17
+ - Improved user feedback with change summaries (Added/Removed/Kept)
18
+
19
+ ### šŸ›”ļø Safety
20
+ - Enhanced prompts in `prompter/<slug>/` always preserved
21
+ - `prompter/project.md` preserved during re-configuration
22
+ - `AGENTS.md` preserved if already exists
23
+ - Automatic cleanup of empty directories when removing tools
24
+ - Cancel-safe operation (Ctrl+C) at any time
25
+
26
+ ### šŸ“š Documentation
27
+ - Added comprehensive re-configuration guide (`docs/reconfigure-tools.md`)
28
+ - Added before/after comparison (`docs/before-after-comparison.md`)
29
+ - Added usage scenarios guide (`docs/usage-scenarios.md`)
30
+ - Added implementation summary (`docs/implementation-summary.md`)
31
+ - Updated README with re-configuration examples
32
+
33
+ ### šŸ”§ Technical
34
+ - Added `detectConfiguredTools()` method to scan for existing workflow files
35
+ - Added `removeToolFiles()` method for clean tool removal
36
+ - Added `removeEmptyDirs()` method for automatic directory cleanup
37
+ - Improved file existence checking and preservation logic
38
+
39
+ ### šŸŽÆ Backward Compatibility
40
+ - 100% backward compatible with existing installations
41
+ - No breaking changes to command syntax or behavior
42
+ - Fresh projects work identically to previous versions
43
+ - No changes to workflow file format
44
+ - No changes to other commands (`update`, `list`)
45
+
46
+ ## [0.1.0] - Previous Release
47
+ - Initial release with `init`, `update`, and `list` commands
48
+ - Support for 6 AI tools: Antigravity, Claude Code, Codex, GitHub Copilot, OpenCode, Kilo Code
49
+ - Universal support via AGENTS.md
50
+ - Workflow file generation with managed markers
package/README.md CHANGED
@@ -41,12 +41,24 @@ prompter init
41
41
  ## Commands
42
42
 
43
43
  ```bash
44
- prompter init # Initialize Prompter in your project
44
+ prompter init # Initialize Prompter (or re-configure tools)
45
45
  prompter update # Update workflow files to latest version
46
46
  prompter list # List all enhanced prompts
47
47
  prompter list --json # Output as JSON
48
48
  ```
49
49
 
50
+ ### Re-configuring Tools
51
+
52
+ You can run `prompter init` again at any time to add, remove, or switch AI tools. See [docs/reconfigure-tools.md](docs/reconfigure-tools.md) for details.
53
+
54
+ ```bash
55
+ # Add or remove tools interactively
56
+ prompter init
57
+
58
+ # Or specify tools directly
59
+ prompter init --tools github-copilot,claude
60
+ ```
61
+
50
62
  ## Output Structure
51
63
 
52
64
  ```
@@ -5,6 +5,9 @@ interface InitOptions {
5
5
  export declare class InitCommand {
6
6
  execute(options?: InitOptions): Promise<void>;
7
7
  private fileExists;
8
+ private detectConfiguredTools;
9
+ private removeToolFiles;
10
+ private removeEmptyDirs;
8
11
  }
9
12
  export {};
10
13
  //# sourceMappingURL=init.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAQA,UAAU,WAAW;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qBAAa,WAAW;IACd,OAAO,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;YAgFzC,UAAU;CAQ3B"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAQA,UAAU,WAAW;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qBAAa,WAAW;IACd,OAAO,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;YAmKzC,UAAU;YASV,qBAAqB;YAwBrB,eAAe;YAkBf,eAAe;CAiBhC"}
@@ -8,12 +8,24 @@ import { registry } from '../core/configurators/slash/index.js';
8
8
  export class InitCommand {
9
9
  async execute(options = {}) {
10
10
  const projectPath = process.cwd();
11
- console.log(chalk.blue('\nšŸš€ Initializing Prompter...\n'));
12
- // Check if already initialized
13
- if (await PrompterConfig.prompterDirExists(projectPath)) {
14
- console.log(chalk.yellow('āš ļø Prompter is already initialized in this project.'));
15
- console.log(chalk.gray(' Use `prompter update` to refresh workflow files.\n'));
16
- return;
11
+ const isReInitialization = await PrompterConfig.prompterDirExists(projectPath);
12
+ if (isReInitialization) {
13
+ console.log(chalk.blue('\nšŸ”„ Re-configuring Prompter tools...\n'));
14
+ }
15
+ else {
16
+ console.log(chalk.blue('\nšŸš€ Initializing Prompter...\n'));
17
+ }
18
+ // Detect currently configured tools if re-initializing
19
+ let currentTools = [];
20
+ if (isReInitialization) {
21
+ currentTools = await this.detectConfiguredTools(projectPath);
22
+ if (currentTools.length > 0) {
23
+ console.log(chalk.gray('Currently configured tools: ') + chalk.cyan(currentTools.map(t => {
24
+ const tool = SUPPORTED_TOOLS.find(st => st.value === t);
25
+ return tool ? tool.name : t;
26
+ }).join(', ')));
27
+ console.log();
28
+ }
17
29
  }
18
30
  // Select tools
19
31
  let selectedTools = [];
@@ -22,28 +34,45 @@ export class InitCommand {
22
34
  }
23
35
  else if (!options.noInteractive) {
24
36
  try {
37
+ const message = isReInitialization
38
+ ? 'Select AI tools to configure (check/uncheck to add/remove):'
39
+ : 'Select AI tools to configure:';
25
40
  selectedTools = await checkbox({
26
- message: 'Select AI tools to configure:',
41
+ message,
27
42
  choices: SUPPORTED_TOOLS.map(tool => ({
28
43
  name: tool.name,
29
44
  value: tool.value,
30
- checked: tool.value === 'antigravity' // Default check Antigravity
45
+ checked: isReInitialization
46
+ ? currentTools.includes(tool.value)
47
+ : tool.value === 'antigravity' // Default check Antigravity for new init
31
48
  }))
32
49
  });
33
50
  }
34
51
  catch (error) {
35
52
  // User cancelled
36
- console.log(chalk.yellow('\nInitialization cancelled.'));
53
+ console.log(chalk.yellow(isReInitialization ? '\nRe-configuration cancelled.' : '\nInitialization cancelled.'));
37
54
  return;
38
55
  }
39
56
  }
40
- // Create prompter directory
57
+ else if (isReInitialization && selectedTools.length === 0) {
58
+ // In non-interactive re-init without tools specified, keep current tools
59
+ selectedTools = currentTools;
60
+ }
61
+ // Create or ensure prompter directory
41
62
  const prompterPath = await PrompterConfig.ensurePrompterDir(projectPath);
42
- console.log(chalk.green('āœ“') + ` Created ${chalk.cyan(PROMPTER_DIR + '/')}`);
43
- // Create project.md
63
+ if (!isReInitialization) {
64
+ console.log(chalk.green('āœ“') + ` Created ${chalk.cyan(PROMPTER_DIR + '/')}`);
65
+ }
66
+ // Create project.md if not exists
44
67
  const projectMdPath = path.join(prompterPath, 'project.md');
45
- await fs.writeFile(projectMdPath, projectTemplate, 'utf-8');
46
- console.log(chalk.green('āœ“') + ` Created ${chalk.cyan(PROMPTER_DIR + '/project.md')}`);
68
+ const projectMdExists = await this.fileExists(projectMdPath);
69
+ if (!projectMdExists) {
70
+ await fs.writeFile(projectMdPath, projectTemplate, 'utf-8');
71
+ console.log(chalk.green('āœ“') + ` Created ${chalk.cyan(PROMPTER_DIR + '/project.md')}`);
72
+ }
73
+ else if (isReInitialization) {
74
+ console.log(chalk.gray(' project.md already exists, keeping it'));
75
+ }
47
76
  // Create AGENTS.md for universal support
48
77
  const agentsMdPath = path.join(projectPath, 'AGENTS.md');
49
78
  const agentsExists = await this.fileExists(agentsMdPath);
@@ -54,10 +83,32 @@ export class InitCommand {
54
83
  else {
55
84
  console.log(chalk.gray(' AGENTS.md already exists, skipping'));
56
85
  }
57
- // Generate workflow files for selected tools
58
- if (selectedTools.length > 0) {
86
+ // Handle tool changes
87
+ const toolsToAdd = selectedTools.filter(t => !currentTools.includes(t));
88
+ const toolsToRemove = currentTools.filter(t => !selectedTools.includes(t));
89
+ const toolsToKeep = selectedTools.filter(t => currentTools.includes(t));
90
+ // Remove old tool files
91
+ if (toolsToRemove.length > 0) {
92
+ console.log(chalk.blue('\nšŸ—‘ļø Removing workflow files...\n'));
93
+ for (const toolId of toolsToRemove) {
94
+ const configurator = registry.get(toolId);
95
+ if (configurator) {
96
+ try {
97
+ const files = await this.removeToolFiles(projectPath, configurator);
98
+ for (const file of files) {
99
+ console.log(chalk.yellow('āœ“') + ` Removed ${chalk.cyan(file)}`);
100
+ }
101
+ }
102
+ catch (error) {
103
+ console.log(chalk.red('āœ—') + ` Failed to remove files for ${toolId}: ${error}`);
104
+ }
105
+ }
106
+ }
107
+ }
108
+ // Generate workflow files for new tools
109
+ if (toolsToAdd.length > 0) {
59
110
  console.log(chalk.blue('\nšŸ“ Creating workflow files...\n'));
60
- for (const toolId of selectedTools) {
111
+ for (const toolId of toolsToAdd) {
61
112
  const configurator = registry.get(toolId);
62
113
  if (configurator) {
63
114
  try {
@@ -72,12 +123,46 @@ export class InitCommand {
72
123
  }
73
124
  }
74
125
  }
126
+ // Show kept tools
127
+ if (isReInitialization && toolsToKeep.length > 0 && (toolsToAdd.length > 0 || toolsToRemove.length > 0)) {
128
+ console.log(chalk.blue('\n✨ Keeping existing tools:\n'));
129
+ for (const toolId of toolsToKeep) {
130
+ const tool = SUPPORTED_TOOLS.find(t => t.value === toolId);
131
+ if (tool) {
132
+ console.log(chalk.gray(' • ') + chalk.cyan(tool.name));
133
+ }
134
+ }
135
+ }
75
136
  // Success message
76
- console.log(chalk.green('\nāœ… Prompter initialized successfully!\n'));
77
- console.log(chalk.blue('Next steps:'));
78
- console.log(chalk.gray(' 1. Edit prompter/project.md to describe your project'));
79
- console.log(chalk.gray(' 2. Use /prompter-enhance to transform prompts'));
80
- console.log(chalk.gray(' 3. Run `prompter list` to see enhanced prompts\n'));
137
+ if (isReInitialization) {
138
+ console.log(chalk.green('\nāœ… Prompter tools updated successfully!\n'));
139
+ if (toolsToAdd.length > 0 || toolsToRemove.length > 0) {
140
+ console.log(chalk.blue('Summary:'));
141
+ if (toolsToAdd.length > 0) {
142
+ console.log(chalk.green(' Added: ') + toolsToAdd.map(t => {
143
+ const tool = SUPPORTED_TOOLS.find(st => st.value === t);
144
+ return tool ? tool.name : t;
145
+ }).join(', '));
146
+ }
147
+ if (toolsToRemove.length > 0) {
148
+ console.log(chalk.yellow(' Removed: ') + toolsToRemove.map(t => {
149
+ const tool = SUPPORTED_TOOLS.find(st => st.value === t);
150
+ return tool ? tool.name : t;
151
+ }).join(', '));
152
+ }
153
+ console.log();
154
+ }
155
+ else {
156
+ console.log(chalk.gray(' No changes made.\n'));
157
+ }
158
+ }
159
+ else {
160
+ console.log(chalk.green('\nāœ… Prompter initialized successfully!\n'));
161
+ console.log(chalk.blue('Next steps:'));
162
+ console.log(chalk.gray(' 1. Edit prompter/project.md to describe your project'));
163
+ console.log(chalk.gray(' 2. Use /prompter-enhance to transform prompts'));
164
+ console.log(chalk.gray(' 3. Run `prompter list` to see enhanced prompts\n'));
165
+ }
81
166
  }
82
167
  async fileExists(filePath) {
83
168
  try {
@@ -88,5 +173,55 @@ export class InitCommand {
88
173
  return false;
89
174
  }
90
175
  }
176
+ async detectConfiguredTools(projectPath) {
177
+ const configuredTools = [];
178
+ const allConfigurators = registry.getAll();
179
+ for (const configurator of allConfigurators) {
180
+ const targets = configurator.getTargets();
181
+ let hasFiles = false;
182
+ for (const target of targets) {
183
+ const filePath = path.join(projectPath, target.path);
184
+ if (await this.fileExists(filePath)) {
185
+ hasFiles = true;
186
+ break;
187
+ }
188
+ }
189
+ if (hasFiles) {
190
+ configuredTools.push(configurator.toolId);
191
+ }
192
+ }
193
+ return configuredTools;
194
+ }
195
+ async removeToolFiles(projectPath, configurator) {
196
+ const removedFiles = [];
197
+ const targets = configurator.getTargets();
198
+ for (const target of targets) {
199
+ const filePath = path.join(projectPath, target.path);
200
+ if (await this.fileExists(filePath)) {
201
+ await fs.unlink(filePath);
202
+ removedFiles.push(target.path);
203
+ // Remove empty parent directories
204
+ await this.removeEmptyDirs(path.dirname(filePath), projectPath);
205
+ }
206
+ }
207
+ return removedFiles;
208
+ }
209
+ async removeEmptyDirs(dirPath, projectPath) {
210
+ // Don't remove the project directory itself
211
+ if (dirPath === projectPath || dirPath === path.dirname(projectPath)) {
212
+ return;
213
+ }
214
+ try {
215
+ const files = await fs.readdir(dirPath);
216
+ if (files.length === 0) {
217
+ await fs.rmdir(dirPath);
218
+ // Recursively check parent
219
+ await this.removeEmptyDirs(path.dirname(dirPath), projectPath);
220
+ }
221
+ }
222
+ catch {
223
+ // Directory doesn't exist or can't be removed, ignore
224
+ }
225
+ }
91
226
  }
92
227
  //# 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;QAElC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iCAAiC,CAAC,C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AK,CAAC,eAAe,CAAC,OAAe,EAAE,WAAmB;QAC9D,4CAA4C;QAC5C,IAAI,OAAO,KAAK,WAAW,IAAI,OAAO,KAAK,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YACnE,OAAO;QACX,CAAC;QAED,IAAI,CAAC;YACD,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACxC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACrB,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACxB,2BAA2B;gBAC3B,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC;YACnE,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACL,sDAAsD;QAC1D,CAAC;IACL,CAAC;CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedesfr/prompter",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Enhance prompts directly in your AI coding workflow",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -0,0 +1,195 @@
1
+ # Role & Expertise
2
+ You are an experienced Product Manager specializing in creating comprehensive Product Requirements Documents (PRDs). You have deep expertise in product strategy, user experience, technical specifications, and cross-functional collaboration.
3
+
4
+ ---
5
+
6
+ # Primary Objective
7
+ Generate a complete, professional Product Requirements Document (PRD) that clearly defines a product or feature's purpose, scope, requirements, and success criteria. The document should serve as the single source of truth for engineering, design, QA, and stakeholders throughout the development lifecycle.
8
+
9
+ # Context
10
+ You will receive information about a product or feature that needs documentation. This may include:
11
+ - A brief description of the feature/product idea
12
+ - Problem statements or user pain points
13
+ - Business objectives or goals
14
+ - Target users or market information
15
+ - Technical constraints or considerations
16
+ - Success metrics or KPIs
17
+
18
+ Your task is to transform this input into a structured, comprehensive PRD following the standard format below.
19
+
20
+ # Process
21
+
22
+ ## Step 1: Information Extraction
23
+ Analyze the provided information and identify:
24
+ - Core problem being solved
25
+ - Target users and their needs
26
+ - Business objectives and constraints
27
+ - Technical requirements or dependencies
28
+ - Success criteria and metrics
29
+ - Scope boundaries (what's included and excluded)
30
+
31
+ ## Step 2: Document Structure
32
+ Organize the PRD using this exact structure:
33
+
34
+ ### Overview Section
35
+ - Feature/Product name
36
+ - Target release timeline
37
+ - Team assignments (PO, Designers, Tech, QA)
38
+
39
+ ### Background Section
40
+ - Context: Why this product/feature is needed
41
+ - Current state with supporting metrics
42
+ - Problem statement with impact analysis
43
+ - Current workarounds (if any)
44
+
45
+ ### Objectives Section
46
+ - Business objectives (3-5 specific, measurable goals)
47
+ - User objectives (how users benefit)
48
+
49
+ ### Success Metrics Section
50
+ - Primary and secondary metrics in table format
51
+ - Current baseline, target values, measurement methods, timelines
52
+
53
+ ### Scope Section
54
+ - MVP 1 goals and deliverables
55
+ - In-scope features (with āœ…)
56
+ - Out-of-scope items (with āŒ and reasoning)
57
+ - Future iterations roadmap
58
+
59
+ ### User Flow Section
60
+ - Main user journey from start to success
61
+ - Alternative flows and error handling
62
+ - Edge cases
63
+
64
+ ### User Stories Section
65
+ - Stories in table format with ID, description, acceptance criteria, platform
66
+ - Use Given-When-Then format for acceptance criteria
67
+
68
+ ### Analytics Section
69
+ - Event tracking requirements
70
+ - Trigger definitions and parameters
71
+ - JSON-formatted event structures
72
+
73
+ ## Step 3: Quality Enhancement
74
+ Ensure the document includes:
75
+ - Specific, actionable requirements (avoid vague language)
76
+ - Clear acceptance criteria for all user stories
77
+ - Measurable success metrics with baselines and targets
78
+ - Realistic scope boundaries
79
+ - Comprehensive error handling and edge cases
80
+
81
+ ## Step 4: Finalization
82
+ Add supporting sections:
83
+ - Open Questions table for unresolved items
84
+ - Technical and business considerations
85
+ - Migration notes (if applicable)
86
+ - References and glossary
87
+
88
+ # Input Specifications
89
+ Provide information about your product/feature including:
90
+ - **Product/Feature Name**: What you're building
91
+ - **Problem**: What user/business problem this solves
92
+ - **Target Users**: Who will use this
93
+ - **Key Features**: Main capabilities or functionality
94
+ - **Business Goals**: What success looks like
95
+ - **Constraints**: Technical, timeline, or resource limitations (optional)
96
+ - **Additional Context**: Any other relevant information
97
+
98
+ # Output Requirements
99
+
100
+ **Format:** Markdown document with clear hierarchy
101
+
102
+ **Required Sections:**
103
+ 1. Overview (with metadata table)
104
+ 2. Quick Links (template placeholders)
105
+ 3. Background (Context + Problem Statement)
106
+ 4. Objectives (Business + User)
107
+ 5. Success Metrics (table format)
108
+ 6. Scope (MVP breakdown with in/out scope)
109
+ 7. User Flow (visual flow diagram)
110
+ 8. User Stories (detailed table)
111
+ 9. Analytics & Tracking (event tracking table)
112
+ 10. Open Questions (tracking table)
113
+ 11. Notes & Considerations
114
+ 12. Appendix (References + Glossary)
115
+
116
+ **Style Guidelines:**
117
+ - Professional, clear, and actionable language
118
+ - Use tables for structured data (metrics, user stories, analytics)
119
+ - Use checkmarks (āœ…) for in-scope, X marks (āŒ) for out-of-scope
120
+ - Include placeholder links for design, technical specs, and project management tools
121
+ - Use Given-When-Then format for acceptance criteria
122
+ - Include JSON examples for analytics events
123
+ - Number user stories with US-## format
124
+
125
+ **Document Characteristics:**
126
+ - Comprehensive yet scannable
127
+ - Specific and measurable requirements
128
+ - Clear boundaries between MVP phases
129
+ - Ready for immediate use by engineering, design, and QA teams
130
+
131
+ # Quality Standards
132
+
133
+ Before finalizing, verify:
134
+ - [ ] All sections are complete with relevant content
135
+ - [ ] Success metrics have baseline, target, and measurement method
136
+ - [ ] User stories have clear acceptance criteria
137
+ - [ ] Scope clearly defines what is and isn't included
138
+ - [ ] Analytics events are properly structured with JSON format
139
+ - [ ] Tables are properly formatted and complete
140
+ - [ ] Technical and business considerations are addressed
141
+ - [ ] Document is professional and free of ambiguity
142
+
143
+ # Special Instructions
144
+
145
+ **When Information Is Limited:**
146
+ - Make intelligent assumptions based on common product patterns
147
+ - Include placeholder text in [brackets] for missing details
148
+ - Add notes indicating where stakeholder input is needed
149
+ - Provide examples in parentheses to guide completion
150
+
151
+ **For Technical Products:**
152
+ - Include additional technical considerations section
153
+ - Add API documentation and technical spec placeholders
154
+ - Specify system integration points
155
+
156
+ **For Consumer Products:**
157
+ - Emphasize user experience and flows
158
+ - Include detailed analytics tracking
159
+ - Focus on conversion metrics and user engagement
160
+
161
+ **Formatting Rules:**
162
+ - Use markdown tables for all structured data
163
+ - Maintain consistent heading hierarchy (##, ###)
164
+ - Use code blocks for user flows and JSON examples
165
+ - Include horizontal rules (---) between major sections
166
+
167
+ # Example Input Format
168
+
169
+ "Create a PRD for [Feature Name]: [Brief description]. This will solve [Problem] for [Target Users]. Key features include [Feature 1], [Feature 2], [Feature 3]. Success will be measured by [Metric]. We need this by [Timeline]."
170
+
171
+ # Example User Story Format
172
+
173
+ | ID | User Story | Acceptance Criteria | Design | Notes | Platform | JIRA Ticket |
174
+ |----|------------|---------------------|--------|-------|----------|-------------|
175
+ | US-01 | As a returning user, I want to see my purchase history so that I can reorder items quickly | **Given** I'm logged into my account<br>**When** I navigate to "My Orders"<br>**Then** I see my last 10 orders sorted by date<br>**And** each order shows items, date, and total<br>**And** I can click "Reorder" on any item | [Figma link] | Cache for performance | iOS/Android/Web | PROJ-123 |
176
+
177
+ # Example Analytics Event Format
178
+
179
+ ```json
180
+ {
181
+ "Trigger": "Click",
182
+ "TriggerValue": "Checkout Button",
183
+ "Page": "Shopping Cart",
184
+ "Data": {
185
+ "CartValue": 149.99,
186
+ "ItemCount": 3,
187
+ "UserSegment": "Premium"
188
+ },
189
+ "Description": "User initiates checkout from cart page"
190
+ }
191
+ ```
192
+
193
+ ---
194
+
195
+ **Deliver the complete PRD immediately upon receiving product/feature information. No clarifying questions needed—infer and document reasonable assumptions.**
@@ -14,14 +14,25 @@ interface InitOptions {
14
14
  export class InitCommand {
15
15
  async execute(options: InitOptions = {}): Promise<void> {
16
16
  const projectPath = process.cwd();
17
+ const isReInitialization = await PrompterConfig.prompterDirExists(projectPath);
17
18
 
18
- console.log(chalk.blue('\nšŸš€ Initializing Prompter...\n'));
19
+ if (isReInitialization) {
20
+ console.log(chalk.blue('\nšŸ”„ Re-configuring Prompter tools...\n'));
21
+ } else {
22
+ console.log(chalk.blue('\nšŸš€ Initializing Prompter...\n'));
23
+ }
19
24
 
20
- // Check if already initialized
21
- if (await PrompterConfig.prompterDirExists(projectPath)) {
22
- console.log(chalk.yellow('āš ļø Prompter is already initialized in this project.'));
23
- console.log(chalk.gray(' Use `prompter update` to refresh workflow files.\n'));
24
- return;
25
+ // Detect currently configured tools if re-initializing
26
+ let currentTools: string[] = [];
27
+ if (isReInitialization) {
28
+ currentTools = await this.detectConfiguredTools(projectPath);
29
+ if (currentTools.length > 0) {
30
+ console.log(chalk.gray('Currently configured tools: ') + chalk.cyan(currentTools.map(t => {
31
+ const tool = SUPPORTED_TOOLS.find(st => st.value === t);
32
+ return tool ? tool.name : t;
33
+ }).join(', ')));
34
+ console.log();
35
+ }
25
36
  }
26
37
 
27
38
  // Select tools
@@ -31,29 +42,45 @@ export class InitCommand {
31
42
  selectedTools = options.tools;
32
43
  } else if (!options.noInteractive) {
33
44
  try {
45
+ const message = isReInitialization
46
+ ? 'Select AI tools to configure (check/uncheck to add/remove):'
47
+ : 'Select AI tools to configure:';
48
+
34
49
  selectedTools = await checkbox({
35
- message: 'Select AI tools to configure:',
50
+ message,
36
51
  choices: SUPPORTED_TOOLS.map(tool => ({
37
52
  name: tool.name,
38
53
  value: tool.value,
39
- checked: tool.value === 'antigravity' // Default check Antigravity
54
+ checked: isReInitialization
55
+ ? currentTools.includes(tool.value)
56
+ : tool.value === 'antigravity' // Default check Antigravity for new init
40
57
  }))
41
58
  });
42
59
  } catch (error) {
43
60
  // User cancelled
44
- console.log(chalk.yellow('\nInitialization cancelled.'));
61
+ console.log(chalk.yellow(isReInitialization ? '\nRe-configuration cancelled.' : '\nInitialization cancelled.'));
45
62
  return;
46
63
  }
64
+ } else if (isReInitialization && selectedTools.length === 0) {
65
+ // In non-interactive re-init without tools specified, keep current tools
66
+ selectedTools = currentTools;
47
67
  }
48
68
 
49
- // Create prompter directory
69
+ // Create or ensure prompter directory
50
70
  const prompterPath = await PrompterConfig.ensurePrompterDir(projectPath);
51
- console.log(chalk.green('āœ“') + ` Created ${chalk.cyan(PROMPTER_DIR + '/')}`);
71
+ if (!isReInitialization) {
72
+ console.log(chalk.green('āœ“') + ` Created ${chalk.cyan(PROMPTER_DIR + '/')}`);
73
+ }
52
74
 
53
- // Create project.md
75
+ // Create project.md if not exists
54
76
  const projectMdPath = path.join(prompterPath, 'project.md');
55
- await fs.writeFile(projectMdPath, projectTemplate, 'utf-8');
56
- console.log(chalk.green('āœ“') + ` Created ${chalk.cyan(PROMPTER_DIR + '/project.md')}`);
77
+ const projectMdExists = await this.fileExists(projectMdPath);
78
+ if (!projectMdExists) {
79
+ await fs.writeFile(projectMdPath, projectTemplate, 'utf-8');
80
+ console.log(chalk.green('āœ“') + ` Created ${chalk.cyan(PROMPTER_DIR + '/project.md')}`);
81
+ } else if (isReInitialization) {
82
+ console.log(chalk.gray(' project.md already exists, keeping it'));
83
+ }
57
84
 
58
85
  // Create AGENTS.md for universal support
59
86
  const agentsMdPath = path.join(projectPath, 'AGENTS.md');
@@ -65,11 +92,34 @@ export class InitCommand {
65
92
  console.log(chalk.gray(' AGENTS.md already exists, skipping'));
66
93
  }
67
94
 
68
- // Generate workflow files for selected tools
69
- if (selectedTools.length > 0) {
95
+ // Handle tool changes
96
+ const toolsToAdd = selectedTools.filter(t => !currentTools.includes(t));
97
+ const toolsToRemove = currentTools.filter(t => !selectedTools.includes(t));
98
+ const toolsToKeep = selectedTools.filter(t => currentTools.includes(t));
99
+
100
+ // Remove old tool files
101
+ if (toolsToRemove.length > 0) {
102
+ console.log(chalk.blue('\nšŸ—‘ļø Removing workflow files...\n'));
103
+ for (const toolId of toolsToRemove) {
104
+ const configurator = registry.get(toolId);
105
+ if (configurator) {
106
+ try {
107
+ const files = await this.removeToolFiles(projectPath, configurator);
108
+ for (const file of files) {
109
+ console.log(chalk.yellow('āœ“') + ` Removed ${chalk.cyan(file)}`);
110
+ }
111
+ } catch (error) {
112
+ console.log(chalk.red('āœ—') + ` Failed to remove files for ${toolId}: ${error}`);
113
+ }
114
+ }
115
+ }
116
+ }
117
+
118
+ // Generate workflow files for new tools
119
+ if (toolsToAdd.length > 0) {
70
120
  console.log(chalk.blue('\nšŸ“ Creating workflow files...\n'));
71
121
 
72
- for (const toolId of selectedTools) {
122
+ for (const toolId of toolsToAdd) {
73
123
  const configurator = registry.get(toolId);
74
124
  if (configurator) {
75
125
  try {
@@ -84,12 +134,45 @@ export class InitCommand {
84
134
  }
85
135
  }
86
136
 
137
+ // Show kept tools
138
+ if (isReInitialization && toolsToKeep.length > 0 && (toolsToAdd.length > 0 || toolsToRemove.length > 0)) {
139
+ console.log(chalk.blue('\n✨ Keeping existing tools:\n'));
140
+ for (const toolId of toolsToKeep) {
141
+ const tool = SUPPORTED_TOOLS.find(t => t.value === toolId);
142
+ if (tool) {
143
+ console.log(chalk.gray(' • ') + chalk.cyan(tool.name));
144
+ }
145
+ }
146
+ }
147
+
87
148
  // Success message
88
- console.log(chalk.green('\nāœ… Prompter initialized successfully!\n'));
89
- console.log(chalk.blue('Next steps:'));
90
- console.log(chalk.gray(' 1. Edit prompter/project.md to describe your project'));
91
- console.log(chalk.gray(' 2. Use /prompter-enhance to transform prompts'));
92
- console.log(chalk.gray(' 3. Run `prompter list` to see enhanced prompts\n'));
149
+ if (isReInitialization) {
150
+ console.log(chalk.green('\nāœ… Prompter tools updated successfully!\n'));
151
+ if (toolsToAdd.length > 0 || toolsToRemove.length > 0) {
152
+ console.log(chalk.blue('Summary:'));
153
+ if (toolsToAdd.length > 0) {
154
+ console.log(chalk.green(' Added: ') + toolsToAdd.map(t => {
155
+ const tool = SUPPORTED_TOOLS.find(st => st.value === t);
156
+ return tool ? tool.name : t;
157
+ }).join(', '));
158
+ }
159
+ if (toolsToRemove.length > 0) {
160
+ console.log(chalk.yellow(' Removed: ') + toolsToRemove.map(t => {
161
+ const tool = SUPPORTED_TOOLS.find(st => st.value === t);
162
+ return tool ? tool.name : t;
163
+ }).join(', '));
164
+ }
165
+ console.log();
166
+ } else {
167
+ console.log(chalk.gray(' No changes made.\n'));
168
+ }
169
+ } else {
170
+ console.log(chalk.green('\nāœ… Prompter initialized successfully!\n'));
171
+ console.log(chalk.blue('Next steps:'));
172
+ console.log(chalk.gray(' 1. Edit prompter/project.md to describe your project'));
173
+ console.log(chalk.gray(' 2. Use /prompter-enhance to transform prompts'));
174
+ console.log(chalk.gray(' 3. Run `prompter list` to see enhanced prompts\n'));
175
+ }
93
176
  }
94
177
 
95
178
  private async fileExists(filePath: string): Promise<boolean> {
@@ -100,4 +183,64 @@ export class InitCommand {
100
183
  return false;
101
184
  }
102
185
  }
186
+
187
+ private async detectConfiguredTools(projectPath: string): Promise<string[]> {
188
+ const configuredTools: string[] = [];
189
+ const allConfigurators = registry.getAll();
190
+
191
+ for (const configurator of allConfigurators) {
192
+ const targets = configurator.getTargets();
193
+ let hasFiles = false;
194
+
195
+ for (const target of targets) {
196
+ const filePath = path.join(projectPath, target.path);
197
+ if (await this.fileExists(filePath)) {
198
+ hasFiles = true;
199
+ break;
200
+ }
201
+ }
202
+
203
+ if (hasFiles) {
204
+ configuredTools.push(configurator.toolId);
205
+ }
206
+ }
207
+
208
+ return configuredTools;
209
+ }
210
+
211
+ private async removeToolFiles(projectPath: string, configurator: any): Promise<string[]> {
212
+ const removedFiles: string[] = [];
213
+ const targets = configurator.getTargets();
214
+
215
+ for (const target of targets) {
216
+ const filePath = path.join(projectPath, target.path);
217
+ if (await this.fileExists(filePath)) {
218
+ await fs.unlink(filePath);
219
+ removedFiles.push(target.path);
220
+
221
+ // Remove empty parent directories
222
+ await this.removeEmptyDirs(path.dirname(filePath), projectPath);
223
+ }
224
+ }
225
+
226
+ return removedFiles;
227
+ }
228
+
229
+ private async removeEmptyDirs(dirPath: string, projectPath: string): Promise<void> {
230
+ // Don't remove the project directory itself
231
+ if (dirPath === projectPath || dirPath === path.dirname(projectPath)) {
232
+ return;
233
+ }
234
+
235
+ try {
236
+ const files = await fs.readdir(dirPath);
237
+ if (files.length === 0) {
238
+ await fs.rmdir(dirPath);
239
+ // Recursively check parent
240
+ await this.removeEmptyDirs(path.dirname(dirPath), projectPath);
241
+ }
242
+ } catch {
243
+ // Directory doesn't exist or can't be removed, ignore
244
+ }
245
+ }
103
246
  }