@dedesfr/prompter 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +53 -7
  2. package/dist/cli/index.js +9 -1
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/commands/prd-generator.d.ts +11 -0
  5. package/dist/commands/prd-generator.d.ts.map +1 -0
  6. package/dist/commands/prd-generator.js +97 -0
  7. package/dist/commands/prd-generator.js.map +1 -0
  8. package/dist/core/configurators/slash/antigravity.d.ts.map +1 -1
  9. package/dist/core/configurators/slash/antigravity.js +10 -2
  10. package/dist/core/configurators/slash/antigravity.js.map +1 -1
  11. package/dist/core/configurators/slash/base.js +1 -1
  12. package/dist/core/configurators/slash/base.js.map +1 -1
  13. package/dist/core/configurators/slash/claude.d.ts.map +1 -1
  14. package/dist/core/configurators/slash/claude.js +10 -2
  15. package/dist/core/configurators/slash/claude.js.map +1 -1
  16. package/dist/core/configurators/slash/codex.d.ts.map +1 -1
  17. package/dist/core/configurators/slash/codex.js +10 -2
  18. package/dist/core/configurators/slash/codex.js.map +1 -1
  19. package/dist/core/configurators/slash/github-copilot.d.ts.map +1 -1
  20. package/dist/core/configurators/slash/github-copilot.js +10 -2
  21. package/dist/core/configurators/slash/github-copilot.js.map +1 -1
  22. package/dist/core/configurators/slash/kilocode.d.ts.map +1 -1
  23. package/dist/core/configurators/slash/kilocode.js +10 -2
  24. package/dist/core/configurators/slash/kilocode.js.map +1 -1
  25. package/dist/core/configurators/slash/opencode.d.ts.map +1 -1
  26. package/dist/core/configurators/slash/opencode.js +10 -2
  27. package/dist/core/configurators/slash/opencode.js.map +1 -1
  28. package/dist/core/templates/slash-command-templates.d.ts +1 -1
  29. package/dist/core/templates/slash-command-templates.d.ts.map +1 -1
  30. package/dist/core/templates/slash-command-templates.js +494 -1
  31. package/dist/core/templates/slash-command-templates.js.map +1 -1
  32. package/package.json +1 -1
  33. package/prompt/epic-single.md +47 -0
  34. package/prompt/qa-test-scenario.md +133 -0
  35. package/prompt/story-single.md +70 -0
  36. package/src/cli/index.ts +10 -1
  37. package/src/commands/prd-generator.ts +118 -0
  38. package/src/core/configurators/slash/antigravity.ts +10 -2
  39. package/src/core/configurators/slash/base.ts +1 -1
  40. package/src/core/configurators/slash/claude.ts +10 -2
  41. package/src/core/configurators/slash/codex.ts +10 -2
  42. package/src/core/configurators/slash/github-copilot.ts +10 -2
  43. package/src/core/configurators/slash/kilocode.ts +10 -2
  44. package/src/core/configurators/slash/opencode.ts +10 -2
  45. package/src/core/templates/slash-command-templates.ts +499 -2
@@ -1,4 +1,4 @@
1
- export type SlashCommandId = 'enhance';
1
+ export type SlashCommandId = 'enhance' | 'prd-generator' | 'epic-single' | 'story-single' | 'qa-test-scenario';
2
2
 
3
3
  const enhanceWorkflow = `## MUST FOLLOW
4
4
  - Response Language: {User Request Language}
@@ -43,8 +43,505 @@ You are a PROMPT ENHANCER. Your only job is to rewrite the user's input into a c
43
43
  - Use \`prompter list\` to see existing enhanced prompts
44
44
  - Read \`prompter/project.md\` for project context and conventions`;
45
45
 
46
+ const prdGeneratorWorkflow = `# Role & Expertise
47
+ 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.
48
+
49
+ ---
50
+
51
+ # Primary Objective
52
+ 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.
53
+
54
+ # Context
55
+ You will receive information about a product or feature that needs documentation. This may include:
56
+ - A brief description of the feature/product idea
57
+ - Problem statements or user pain points
58
+ - Business objectives or goals
59
+ - Target users or market information
60
+ - Technical constraints or considerations
61
+ - Success metrics or KPIs
62
+
63
+ Your task is to transform this input into a structured, comprehensive PRD following the standard format below.
64
+
65
+ # Process
66
+
67
+ ## Step 1: Information Extraction
68
+ Analyze the provided information and identify:
69
+ - Core problem being solved
70
+ - Target users and their needs
71
+ - Business objectives and constraints
72
+ - Technical requirements or dependencies
73
+ - Success criteria and metrics
74
+ - Scope boundaries (what's included and excluded)
75
+
76
+ ## Step 2: Document Structure
77
+ Organize the PRD using this exact structure:
78
+
79
+ ### Overview Section
80
+ - Feature/Product name
81
+ - Target release timeline
82
+ - Team assignments (PO, Designers, Tech, QA)
83
+
84
+ ### Background Section
85
+ - Context: Why this product/feature is needed
86
+ - Current state with supporting metrics
87
+ - Problem statement with impact analysis
88
+ - Current workarounds (if any)
89
+
90
+ ### Objectives Section
91
+ - Business objectives (3-5 specific, measurable goals)
92
+ - User objectives (how users benefit)
93
+
94
+ ### Success Metrics Section
95
+ - Primary and secondary metrics in table format
96
+ - Current baseline, target values, measurement methods, timelines
97
+
98
+ ### Scope Section
99
+ - MVP 1 goals and deliverables
100
+ - In-scope features (with ✅)
101
+ - Out-of-scope items (with ❌ and reasoning)
102
+ - Future iterations roadmap
103
+
104
+ ### User Flow Section
105
+ - Main user journey from start to success
106
+ - Alternative flows and error handling
107
+ - Edge cases
108
+
109
+ ### User Stories Section
110
+ - Stories in table format with ID, description, acceptance criteria, platform
111
+ - Use Given-When-Then format for acceptance criteria
112
+
113
+ ### Analytics Section
114
+ - Event tracking requirements
115
+ - Trigger definitions and parameters
116
+ - JSON-formatted event structures
117
+
118
+ ## Step 3: Quality Enhancement
119
+ Ensure the document includes:
120
+ - Specific, actionable requirements (avoid vague language)
121
+ - Clear acceptance criteria for all user stories
122
+ - Measurable success metrics with baselines and targets
123
+ - Realistic scope boundaries
124
+ - Comprehensive error handling and edge cases
125
+
126
+ ## Step 4: Finalization
127
+ Add supporting sections:
128
+ - Open Questions table for unresolved items
129
+ - Technical and business considerations
130
+ - Migration notes (if applicable)
131
+ - References and glossary
132
+
133
+ # Input Specifications
134
+ Provide information about your product/feature including:
135
+ - **Product/Feature Name**: What you're building
136
+ - **Problem**: What user/business problem this solves
137
+ - **Target Users**: Who will use this
138
+ - **Key Features**: Main capabilities or functionality
139
+ - **Business Goals**: What success looks like
140
+ - **Constraints**: Technical, timeline, or resource limitations (optional)
141
+ - **Additional Context**: Any other relevant information
142
+
143
+ # Output Requirements
144
+
145
+ **Format:** Markdown document with clear hierarchy
146
+
147
+ **Required Sections:**
148
+ 1. Overview (with metadata table)
149
+ 2. Quick Links (template placeholders)
150
+ 3. Background (Context + Problem Statement)
151
+ 4. Objectives (Business + User)
152
+ 5. Success Metrics (table format)
153
+ 6. Scope (MVP breakdown with in/out scope)
154
+ 7. User Flow (visual flow diagram)
155
+ 8. User Stories (detailed table)
156
+ 9. Analytics & Tracking (event tracking table)
157
+ 10. Open Questions (tracking table)
158
+ 11. Notes & Considerations
159
+ 12. Appendix (References + Glossary)
160
+
161
+ **Style Guidelines:**
162
+ - Professional, clear, and actionable language
163
+ - Use tables for structured data (metrics, user stories, analytics)
164
+ - Use checkmarks (✅) for in-scope, X marks (❌) for out-of-scope
165
+ - Include placeholder links for design, technical specs, and project management tools
166
+ - Use Given-When-Then format for acceptance criteria
167
+ - Include JSON examples for analytics events
168
+ - Number user stories with US-## format
169
+
170
+ **Document Characteristics:**
171
+ - Comprehensive yet scannable
172
+ - Specific and measurable requirements
173
+ - Clear boundaries between MVP phases
174
+ - Ready for immediate use by engineering, design, and QA teams
175
+
176
+ # Quality Standards
177
+
178
+ Before finalizing, verify:
179
+ - [ ] All sections are complete with relevant content
180
+ - [ ] Success metrics have baseline, target, and measurement method
181
+ - [ ] User stories have clear acceptance criteria
182
+ - [ ] Scope clearly defines what is and isn't included
183
+ - [ ] Analytics events are properly structured with JSON format
184
+ - [ ] Tables are properly formatted and complete
185
+ - [ ] Technical and business considerations are addressed
186
+ - [ ] Document is professional and free of ambiguity
187
+
188
+ # Special Instructions
189
+
190
+ **When Information Is Limited:**
191
+ - Make intelligent assumptions based on common product patterns
192
+ - Include placeholder text in [brackets] for missing details
193
+ - Add notes indicating where stakeholder input is needed
194
+ - Provide examples in parentheses to guide completion
195
+
196
+ **For Technical Products:**
197
+ - Include additional technical considerations section
198
+ - Add API documentation and technical spec placeholders
199
+ - Specify system integration points
200
+
201
+ **For Consumer Products:**
202
+ - Emphasize user experience and flows
203
+ - Include detailed analytics tracking
204
+ - Focus on conversion metrics and user engagement
205
+
206
+ **Formatting Rules:**
207
+ - Use markdown tables for all structured data
208
+ - Maintain consistent heading hierarchy (##, ###)
209
+ - Use code blocks for user flows and JSON examples
210
+ - Include horizontal rules (---) between major sections
211
+
212
+ # Example Input Format
213
+
214
+ "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]."
215
+
216
+ # Example User Story Format
217
+
218
+ | ID | User Story | Acceptance Criteria | Design | Notes | Platform | JIRA Ticket |
219
+ |----|------------|---------------------|--------|-------|----------|-------------|
220
+ | 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 |
221
+
222
+ # Example Analytics Event Format
223
+
224
+ \`\`\`json
225
+ {
226
+ "Trigger": "Click",
227
+ "TriggerValue": "Checkout Button",
228
+ "Page": "Shopping Cart",
229
+ "Data": {
230
+ "CartValue": 149.99,
231
+ "ItemCount": 3,
232
+ "UserSegment": "Premium"
233
+ },
234
+ "Description": "User initiates checkout from cart page"
235
+ }
236
+ \`\`\`
237
+
238
+ ---
239
+
240
+ **Deliver the complete PRD immediately upon receiving product/feature information. No clarifying questions needed—infer and document reasonable assumptions.**
241
+
242
+ ## WORKFLOW STEPS
243
+ 1. Read the user's input about the product/feature
244
+ 2. Generate a unique, URL-friendly slug from the feature name (lowercase, hyphen-separated)
245
+ 3. Create the directory \`prompter/<slug>/\` if it doesn't exist
246
+ 4. Generate the complete PRD following all requirements above
247
+ 5. Save the PRD to \`prompter/<slug>/prd.md\`
248
+ 6. Report the saved file path
249
+
250
+ ## REFERENCE
251
+ - Read \`prompter/project.md\` for project context if needed`;
252
+
253
+ const epicSingleWorkflow = `Your job is to take a user requirement and structure it into **a single, well-defined Jira Epic**.
254
+
255
+ ### Input
256
+ {USER_REQUIREMENT}
257
+
258
+ ### Output Rules
259
+ - Use **Markdown format only**
260
+ - Focus on defining **one Epic** that captures the main capability or user workflow
261
+ - Title must be **business-focused**, not technical
262
+ - The Epic should represent a cohesive, deliverable outcome
263
+
264
+ ### Output Structure
265
+
266
+ ## 🧠 Epic: {Epic Title}
267
+
268
+ ### 🎯 Epic Goal
269
+ We need to {MAIN OBJECTIVE} in order for {TARGET USER} to {EXPECTED VALUE}
270
+
271
+ ### 🚀 Definition of Done
272
+ - DoD1
273
+ - DoD2
274
+ - DoD3
275
+ (add more if needed)
276
+
277
+ ### 📌 High-Level Scope (Included)
278
+ - Scope item 1
279
+ - Scope item 2
280
+ - Scope item 3
281
+
282
+ ### ❌ Out of Scope
283
+ - OOS item 1
284
+ - OOS item 2
285
+
286
+ ### 📁 Deliverables
287
+ - Deliverable 1
288
+ - Deliverable 2
289
+
290
+ ### 🧩 Dependencies
291
+ - Dependency 1 (TBD if unknown)
292
+
293
+ ### ⚠️ Risks / Assumptions
294
+ - Risk or assumption 1
295
+ - Risk or assumption 2
296
+
297
+ ### 🎯 Success Metrics
298
+ - Metric 1
299
+ - Metric 2
300
+
301
+ ## WORKFLOW STEPS
302
+ 1. Read the user's requirement input
303
+ 2. Generate a unique, URL-friendly slug from the epic title (lowercase, hyphen-separated)
304
+ 3. Create the directory \`prompter/<slug>/\` if it doesn't exist
305
+ 4. Generate the complete Epic following all requirements above
306
+ 5. Save the Epic to \`prompter/<slug>/epic.md\`
307
+ 6. Report the saved file path
308
+
309
+ ## REFERENCE
310
+ - Read \`prompter/project.md\` for project context if needed`;
311
+
312
+ const storySingleWorkflow = `### ✅ **Prompt: Generate a Single Jira Story from QA Prompt**
313
+
314
+ You are a **Jira expert, senior product manager, and QA analyst**.
315
+
316
+ Your job is to convert the **provided QA request / defect / test finding / requirement summary** into **ONE Jira User Story** that is clear, business-focused, and ready for development.
317
+
318
+ ---
319
+
320
+ ### 🔽 **Input**
321
+
322
+ \`\`\`
323
+ {QA_TEXT}
324
+ \`\`\`
325
+
326
+ ---
327
+
328
+ ### 🔼 **Output Rules**
329
+
330
+ * Use **Markdown only**
331
+ * Produce **ONE (1) User Story only**
332
+ * Must be written from **end-user perspective**
333
+ * Title must be **clear and non-technical**
334
+ * Story must be **independently deliverable and testable**
335
+ * Rewrite unclear or fragmented input into a **clean and business-focused requirement**
336
+ * If information is missing, mark it **TBD** (do NOT assume)
337
+
338
+ ---
339
+
340
+ ### 🧱 **Story Structure**
341
+
342
+ \`\`\`
343
+ ## 🧾 Story: {Story Title}
344
+
345
+ ### 🧑 As a {USER ROLE},
346
+ I want to {USER INTENT}
347
+ so that I can {BUSINESS VALUE}
348
+
349
+ ### 🔨 Acceptance Criteria (BDD Format)
350
+ - **Given** {context}
351
+ - **When** {action}
352
+ - **Then** {expected result}
353
+
354
+ (Add 4–8 acceptance criteria)
355
+
356
+ ### 📌 Expected Result
357
+ - Bullet points describing what success looks like
358
+
359
+ ### 🚫 Non-Goals (if applicable)
360
+ - Bullet points of what is explicitly NOT included
361
+
362
+ ### 🗒️ Notes (optional)
363
+ - Clarifications / constraints / dependencies / edge cases
364
+ \`\`\`
365
+
366
+ ---
367
+
368
+ ### ⚠️ Validation Rules Before Generating
369
+
370
+ The story must:
371
+
372
+ * Focus on **one user outcome only**
373
+ * Avoid **technical solutioning** (no APIs, tables, database fields, component names)
374
+ * Avoid **phrases like "fix bug", "backend update", "add field X"**
375
+ * Convert QA language into **business language**
376
+
377
+ ---
378
+
379
+ ### 🏁 Final Output
380
+
381
+ Return **ONLY the completed story in Markdown**, nothing else.
382
+
383
+ ## WORKFLOW STEPS
384
+ 1. Read the user's input (QA request/requirement)
385
+ 2. Generate a unique, URL-friendly slug from the story title (lowercase, hyphen-separated)
386
+ 3. Create the directory \`prompter/<slug>/\` if it doesn't exist
387
+ 4. Generate the complete User Story following all requirements above
388
+ 5. Save the story to \`prompter/<slug>/story.md\`
389
+ 6. Report the saved file path
390
+
391
+ ## REFERENCE
392
+ - Read \`prompter/project.md\` for project context if needed`;
393
+
394
+ const qaTestScenarioWorkflow = `# Role & Expertise
395
+ You are a Senior QA Architect and Test Strategy Expert with extensive experience in creating focused, actionable test plans. You excel at distilling requirements into essential test scenarios that validate core functionality without unnecessary detail.
396
+
397
+ # Context
398
+ You will receive a Product Requirements Document (PRD) that outlines features and requirements. Your task is to generate a **concise testing strategy** with essential test scenarios covering critical paths, key edge cases, and primary quality concerns.
399
+
400
+ # Primary Objective
401
+ Create a focused testing document that covers the most important functional requirements, critical user flows, high-risk edge cases, and key quality attributes. Prioritize clarity and actionability over exhaustive coverage.
402
+
403
+ # Process
404
+
405
+ ## 1. PRD Analysis (Focus on Essentials)
406
+ - Identify **core features** and **critical user flows**
407
+ - Extract **must-have acceptance criteria** only
408
+ - Note **high-risk areas** and integration points
409
+ - Skip minor edge cases and cosmetic details
410
+
411
+ ## 2. Test Scenario Generation (Strategic Coverage)
412
+
413
+ Generate only:
414
+
415
+ **Critical Happy Path** (2-3 scenarios per feature)
416
+ - Primary user journey validation
417
+ - Core functionality verification
418
+
419
+ **High-Risk Edge Cases** (1-2 per feature)
420
+ - Data boundary conditions
421
+ - Error states that impact functionality
422
+ - Integration failure points
423
+
424
+ **Key Quality Checks** (as needed)
425
+ - Performance bottlenecks
426
+ - Security vulnerabilities
427
+ - Critical usability issues
428
+
429
+ **Skip:** Low-priority edge cases, cosmetic issues, obvious validations
430
+
431
+ ## 3. Scenario Documentation (Streamlined Format)
432
+ Each scenario includes only:
433
+ - **ID & Story**: TS-[#] | [Feature Name]
434
+ - **Type**: Functional, Edge Case, Performance, Security
435
+ - **Priority**: CRITICAL or HIGH only
436
+ - **Test Steps**: 3-5 key actions
437
+ - **Expected Result**: One clear outcome
438
+ - **Notes**: Only if critical context needed
439
+
440
+ # Input Specifications
441
+ - **PRD Document**: User stories, features, acceptance criteria
442
+ - **Format**: Any structured or narrative format
443
+ - **Focus**: Extract essential requirements only
444
+
445
+ # Output Requirements
446
+
447
+ ## Concise Format Structure
448
+
449
+ ### Test Coverage Summary (Compact)
450
+
451
+ ## Test Coverage Overview
452
+ - **Features Covered**: [#] core features
453
+ - **Total Scenarios**: [X] (targeting 20-30 scenarios max for typical features)
454
+ - **Critical Path**: [X] scenarios
455
+ - **High-Risk Edge Cases**: [X] scenarios
456
+ - **Priority Distribution**: CRITICAL: [X] | HIGH: [X]
457
+
458
+ ---
459
+
460
+ ### Essential Test Scenarios
461
+
462
+ | ID | Feature | Scenario | Type | Priority | Steps | Expected Result |
463
+ |----|---------|----------|------|----------|-------|-----------------|
464
+ | TS-01 | [Name] | [Brief description] | Functional | CRITICAL | 1. [Action]<br>2. [Action]<br>3. [Verify] | [Clear outcome] |
465
+ | TS-02 | [Name] | [Brief description] | Edge Case | HIGH | 1. [Action]<br>2. [Action]<br>3. [Verify] | [Clear outcome] |
466
+
467
+ ---
468
+
469
+ ### Performance & Environment Notes (If Applicable)
470
+
471
+ **Performance Criteria:**
472
+ - [Key metric]: [Threshold]
473
+ - [Key metric]: [Threshold]
474
+
475
+ **Test Environments:**
476
+ - [Platform 1]: [Critical versions only]
477
+ - [Platform 2]: [Critical versions only]
478
+
479
+ ---
480
+
481
+ ### Test Data Requirements (Essential Only)
482
+
483
+ - [Critical data type]: [Min specification]
484
+ - [Edge case data]: [Key examples]
485
+
486
+ ---
487
+
488
+ ### Execution Notes
489
+
490
+ **Prerequisites:**
491
+ - [Essential setup only]
492
+
493
+ **Key Dependencies:**
494
+ - [Critical blockers only]
495
+
496
+ # Quality Standards
497
+
498
+ - **Focus on risk**: Cover high-impact scenarios, skip obvious validations
499
+ - **Be concise**: 3-5 test steps maximum per scenario
500
+ - **Prioritize ruthlessly**: Only CRITICAL and HIGH priority items
501
+ - **Target scope**: 15-30 scenarios for typical features, 30-50 for complex products
502
+ - **Clear outcomes**: One measurable result per scenario
503
+
504
+ # Special Instructions
505
+
506
+ ## Brevity Rules
507
+ - **Omit** detailed preconditions unless critical
508
+ - **Omit** low-priority scenarios entirely
509
+ - **Omit** obvious test data specifications
510
+ - **Omit** exhaustive device/browser matrices (note key platforms only)
511
+ - **Combine** related scenarios where logical
512
+
513
+ ## Prioritization (Strict)
514
+ Include only:
515
+ - **CRITICAL**: Core functionality, security, data integrity
516
+ - **HIGH**: Primary user flows, high-risk integrations
517
+ - **OMIT**: Medium/Low priority items
518
+
519
+ ## Smart Assumptions
520
+ - Standard validation (email format, required fields) is assumed tested
521
+ - Basic UI functionality is assumed working
522
+ - Focus on **what could break** or **what's unique** to this feature
523
+
524
+ # Output Delivery
525
+
526
+ Generate a **concise** testing document (targeting 50-150 lines for simple features, 150-300 for complex features). Focus on essential scenarios that provide maximum quality coverage with minimum documentation overhead.
527
+
528
+ ## WORKFLOW STEPS
529
+ 1. Read the user's input (PRD or requirements)
530
+ 2. Generate a unique, URL-friendly slug from the feature name (lowercase, hyphen-separated)
531
+ 3. Create the directory \`prompter/<slug>/\` if it doesn't exist
532
+ 4. Generate the complete QA test scenarios following all requirements above
533
+ 5. Save the test scenarios to \`prompter/<slug>/qa-test-scenarios.md\`
534
+ 6. Report the saved file path
535
+
536
+ ## REFERENCE
537
+ - Read \`prompter/project.md\` for project context if needed`;
538
+
46
539
  export const slashCommandBodies: Record<SlashCommandId, string> = {
47
- enhance: enhanceWorkflow
540
+ enhance: enhanceWorkflow,
541
+ 'prd-generator': prdGeneratorWorkflow,
542
+ 'epic-single': epicSingleWorkflow,
543
+ 'story-single': storySingleWorkflow,
544
+ 'qa-test-scenario': qaTestScenarioWorkflow
48
545
  };
49
546
 
50
547
  export function getSlashCommandBody(id: SlashCommandId): string {