@dedesfr/prompter 0.6.4 → 0.6.6

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 (59) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cli/index.js +2 -58
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/commands/epic-generator.d.ts +11 -0
  5. package/dist/commands/epic-generator.d.ts.map +1 -0
  6. package/dist/commands/epic-generator.js +97 -0
  7. package/dist/commands/epic-generator.js.map +1 -0
  8. package/dist/commands/story-generator.d.ts +11 -0
  9. package/dist/commands/story-generator.d.ts.map +1 -0
  10. package/dist/commands/story-generator.js +97 -0
  11. package/dist/commands/story-generator.js.map +1 -0
  12. package/dist/core/config.d.ts.map +1 -1
  13. package/dist/core/config.js +12 -0
  14. package/dist/core/config.js.map +1 -1
  15. package/dist/core/configurators/slash/antigravity.d.ts.map +1 -1
  16. package/dist/core/configurators/slash/antigravity.js +4 -0
  17. package/dist/core/configurators/slash/antigravity.js.map +1 -1
  18. package/dist/core/configurators/slash/base.js +1 -1
  19. package/dist/core/configurators/slash/base.js.map +1 -1
  20. package/dist/core/configurators/slash/claude.d.ts.map +1 -1
  21. package/dist/core/configurators/slash/claude.js +4 -0
  22. package/dist/core/configurators/slash/claude.js.map +1 -1
  23. package/dist/core/configurators/slash/codex.d.ts.map +1 -1
  24. package/dist/core/configurators/slash/codex.js +4 -0
  25. package/dist/core/configurators/slash/codex.js.map +1 -1
  26. package/dist/core/configurators/slash/github-copilot.d.ts.map +1 -1
  27. package/dist/core/configurators/slash/github-copilot.js +4 -0
  28. package/dist/core/configurators/slash/github-copilot.js.map +1 -1
  29. package/dist/core/configurators/slash/kilocode.d.ts.map +1 -1
  30. package/dist/core/configurators/slash/kilocode.js +4 -0
  31. package/dist/core/configurators/slash/kilocode.js.map +1 -1
  32. package/dist/core/configurators/slash/opencode.d.ts.map +1 -1
  33. package/dist/core/configurators/slash/opencode.js +4 -0
  34. package/dist/core/configurators/slash/opencode.js.map +1 -1
  35. package/dist/core/prompt-templates.d.ts +2 -0
  36. package/dist/core/prompt-templates.d.ts.map +1 -1
  37. package/dist/core/prompt-templates.js +346 -0
  38. package/dist/core/prompt-templates.js.map +1 -1
  39. package/dist/core/templates/slash-command-templates.d.ts +1 -1
  40. package/dist/core/templates/slash-command-templates.d.ts.map +1 -1
  41. package/dist/core/templates/slash-command-templates.js +3 -1
  42. package/dist/core/templates/slash-command-templates.js.map +1 -1
  43. package/docs/tasks.md +1 -1
  44. package/package.json +1 -1
  45. package/prompt/epic-generator.md +163 -0
  46. package/prompt/story-generator.md +177 -0
  47. package/src/cli/index.ts +2 -65
  48. package/src/commands/epic-generator.ts +118 -0
  49. package/src/commands/story-generator.ts +118 -0
  50. package/src/core/config.ts +12 -0
  51. package/src/core/configurators/slash/antigravity.ts +4 -0
  52. package/src/core/configurators/slash/base.ts +1 -1
  53. package/src/core/configurators/slash/claude.ts +4 -0
  54. package/src/core/configurators/slash/codex.ts +4 -0
  55. package/src/core/configurators/slash/github-copilot.ts +4 -0
  56. package/src/core/configurators/slash/kilocode.ts +4 -0
  57. package/src/core/configurators/slash/opencode.ts +4 -0
  58. package/src/core/prompt-templates.ts +348 -0
  59. package/src/core/templates/slash-command-templates.ts +5 -1
@@ -0,0 +1,118 @@
1
+ import { promises as fs } from 'fs';
2
+ import path from 'path';
3
+ import chalk from 'chalk';
4
+ import { PrompterConfig, PROMPTER_DIR, PROMPTER_MARKERS } from '../core/config.js';
5
+ import { registry } from '../core/configurators/slash/index.js';
6
+
7
+ interface StoryGeneratorOptions {
8
+ tools?: string[];
9
+ noInteractive?: boolean;
10
+ }
11
+
12
+ export class StoryGeneratorCommand {
13
+ async execute(options: StoryGeneratorOptions = {}): Promise<void> {
14
+ const projectPath = process.cwd();
15
+
16
+ // Check if initialized
17
+ if (!await PrompterConfig.prompterDirExists(projectPath)) {
18
+ console.log(chalk.red('\nāŒ Prompter is not initialized in this project.\n'));
19
+ console.log(chalk.gray(' Run `prompter init` first.\n'));
20
+ process.exitCode = 1;
21
+ return;
22
+ }
23
+
24
+ console.log(chalk.blue('\nšŸ“ Generating Story Generator workflow files...\n'));
25
+
26
+ // Detect currently configured tools
27
+ const configuredTools = await this.detectConfiguredTools(projectPath);
28
+
29
+ if (configuredTools.length === 0) {
30
+ console.log(chalk.yellow('āš ļø No tools configured yet.\n'));
31
+ console.log(chalk.gray(' Run `prompter init` to configure AI tools first.\n'));
32
+ process.exitCode = 1;
33
+ return;
34
+ }
35
+
36
+ // Generate story-generator workflow files for all configured tools
37
+ let successCount = 0;
38
+ let failCount = 0;
39
+
40
+ for (const toolId of configuredTools) {
41
+ const configurator = registry.get(toolId);
42
+ if (configurator) {
43
+ try {
44
+ // Generate only the story-generator workflow file
45
+ const body = configurator['getBody']('story-generator');
46
+ const relativePath = configurator['getRelativePath']('story-generator');
47
+ const filePath = path.join(projectPath, relativePath);
48
+
49
+ // Ensure directory exists
50
+ await fs.mkdir(path.dirname(filePath), { recursive: true });
51
+
52
+ // Check if file exists
53
+ const fileExists = await this.fileExists(filePath);
54
+
55
+ if (fileExists) {
56
+ console.log(chalk.yellow('āš ļø') + ` ${chalk.cyan(relativePath)} already exists, skipping`);
57
+ continue;
58
+ }
59
+
60
+ // Get frontmatter if needed
61
+ const frontmatter = configurator['getFrontmatter']('story-generator');
62
+ const sections: string[] = [];
63
+ if (frontmatter) {
64
+ sections.push(frontmatter.trim());
65
+ }
66
+ sections.push(`${PROMPTER_MARKERS.start}\n${body}\n${PROMPTER_MARKERS.end}`);
67
+ const content = sections.join('\n') + '\n';
68
+
69
+ await fs.writeFile(filePath, content, 'utf-8');
70
+ console.log(chalk.green('āœ“') + ` Created ${chalk.cyan(relativePath)}`);
71
+ successCount++;
72
+ } catch (error) {
73
+ console.log(chalk.red('āœ—') + ` Failed to create files for ${toolId}: ${error}`);
74
+ failCount++;
75
+ }
76
+ }
77
+ }
78
+
79
+ // Success message
80
+ console.log(chalk.green(`\nāœ… Story Generator workflow files created successfully!\n`));
81
+ console.log(chalk.blue('Next steps:'));
82
+ console.log(chalk.gray(' 1. Use /story-generator in your AI tool to generate user stories'));
83
+ console.log(chalk.gray(' 2. Stories will be saved to prompter/<slug>/stories.md\n'));
84
+ }
85
+
86
+ private async fileExists(filePath: string): Promise<boolean> {
87
+ try {
88
+ await fs.access(filePath);
89
+ return true;
90
+ } catch {
91
+ return false;
92
+ }
93
+ }
94
+
95
+ private async detectConfiguredTools(projectPath: string): Promise<string[]> {
96
+ const configuredTools: string[] = [];
97
+ const allConfigurators = registry.getAll();
98
+
99
+ for (const configurator of allConfigurators) {
100
+ const targets = configurator.getTargets();
101
+ let hasFiles = false;
102
+
103
+ for (const target of targets) {
104
+ const filePath = path.join(projectPath, target.path);
105
+ if (await this.fileExists(filePath)) {
106
+ hasFiles = true;
107
+ break;
108
+ }
109
+ }
110
+
111
+ if (hasFiles) {
112
+ configuredTools.push(configurator.toolId);
113
+ }
114
+ }
115
+
116
+ return configuredTools;
117
+ }
118
+ }
@@ -56,6 +56,12 @@ export const AVAILABLE_PROMPTS: PromptChoice[] = [
56
56
  description: 'Generate comprehensive epic documentation',
57
57
  sourceFile: 'epic-single.md'
58
58
  },
59
+ {
60
+ name: 'Epic Generator',
61
+ value: 'epic-generator',
62
+ description: 'Generate comprehensive EPICs from FSD and TDD documentation',
63
+ sourceFile: 'epic-generator.md'
64
+ },
59
65
  {
60
66
  name: 'ERD Generator',
61
67
  value: 'erd-generator',
@@ -104,6 +110,12 @@ export const AVAILABLE_PROMPTS: PromptChoice[] = [
104
110
  description: 'Generate detailed user story documentation',
105
111
  sourceFile: 'story-single.md'
106
112
  },
113
+ {
114
+ name: 'Story Generator',
115
+ value: 'story-generator',
116
+ description: 'Generate comprehensive user stories from EPICs and FSD',
117
+ sourceFile: 'story-generator.md'
118
+ },
107
119
  {
108
120
  name: 'TDD Generator',
109
121
  value: 'tdd-generator',
@@ -7,7 +7,9 @@ const FILE_PATHS: Record<SlashCommandId, string> = {
7
7
  'prd-agent-generator': '.agent/workflows/prd-agent-generator.md',
8
8
  'product-brief': '.agent/workflows/product-brief.md',
9
9
  'epic-single': '.agent/workflows/epic-single.md',
10
+ 'epic-generator': '.agent/workflows/epic-generator.md',
10
11
  'story-single': '.agent/workflows/story-single.md',
12
+ 'story-generator': '.agent/workflows/story-generator.md',
11
13
  'qa-test-scenario': '.agent/workflows/qa-test-scenario.md',
12
14
  'skill-creator': '.agent/workflows/skill-creator.md',
13
15
  'ai-humanizer': '.agent/workflows/ai-humanizer.md',
@@ -26,7 +28,9 @@ const DESCRIPTIONS: Record<SlashCommandId, string> = {
26
28
  'prd-agent-generator': 'Generate a PRD with autonomous assumptions (non-interactive mode)',
27
29
  'product-brief': 'Generate an executive-level product brief (1-page summary)',
28
30
  'epic-single': 'Generate a single well-defined Jira Epic',
31
+ 'epic-generator': 'Generate a comprehensive set of EPICs from documentation',
29
32
  'story-single': 'Generate a single Jira User Story from requirements',
33
+ 'story-generator': 'Generate comprehensive user stories from EPICs and FSD',
30
34
  'qa-test-scenario': 'Generate focused QA test scenarios from PRD',
31
35
  'skill-creator': 'Create a modular skill package that extends AI agent capabilities',
32
36
  'ai-humanizer': 'Humanize and proofread AI-generated content for natural, publication-ready output',
@@ -9,7 +9,7 @@ export interface SlashCommandTarget {
9
9
  kind: 'slash';
10
10
  }
11
11
 
12
- const ALL_COMMANDS: SlashCommandId[] = ['enhance', 'prd-generator', 'prd-agent-generator', 'product-brief', 'epic-single', 'story-single', 'qa-test-scenario', 'skill-creator', 'ai-humanizer', 'api-contract-generator', 'erd-generator', 'fsd-generator', 'tdd-generator', 'tdd-lite-generator', 'wireframe-generator', 'document-explainer'];
12
+ const ALL_COMMANDS: SlashCommandId[] = ['enhance', 'prd-generator', 'prd-agent-generator', 'product-brief', 'epic-single', 'epic-generator', 'story-single', 'story-generator', 'qa-test-scenario', 'skill-creator', 'ai-humanizer', 'api-contract-generator', 'erd-generator', 'fsd-generator', 'tdd-generator', 'tdd-lite-generator', 'wireframe-generator', 'document-explainer'];
13
13
 
14
14
  export abstract class SlashCommandConfigurator {
15
15
  abstract readonly toolId: string;
@@ -7,7 +7,9 @@ const FILE_PATHS: Record<SlashCommandId, string> = {
7
7
  'prd-agent-generator': '.claude/commands/prompter/prd-agent-generator.md',
8
8
  'product-brief': '.claude/commands/prompter/product-brief.md',
9
9
  'epic-single': '.claude/commands/prompter/epic-single.md',
10
+ 'epic-generator': '.claude/commands/prompter/epic-generator.md',
10
11
  'story-single': '.claude/commands/prompter/story-single.md',
12
+ 'story-generator': '.claude/commands/prompter/story-generator.md',
11
13
  'qa-test-scenario': '.claude/commands/prompter/qa-test-scenario.md',
12
14
  'skill-creator': '.claude/commands/prompter/skill-creator.md',
13
15
  'ai-humanizer': '.claude/commands/prompter/ai-humanizer.md',
@@ -26,7 +28,9 @@ const DESCRIPTIONS: Record<SlashCommandId, string> = {
26
28
  'prd-agent-generator': 'Generate a PRD with autonomous assumptions (non-interactive mode)',
27
29
  'product-brief': 'Generate an executive-level product brief (1-page summary)',
28
30
  'epic-single': 'Generate a single well-defined Jira Epic',
31
+ 'epic-generator': 'Generate a comprehensive set of EPICs from documentation',
29
32
  'story-single': 'Generate a single Jira User Story from requirements',
33
+ 'story-generator': 'Generate comprehensive user stories from EPICs and FSD',
30
34
  'qa-test-scenario': 'Generate focused QA test scenarios from PRD',
31
35
  'skill-creator': 'Create a modular skill package that extends AI agent capabilities',
32
36
  'ai-humanizer': 'Humanize and proofread AI-generated content for natural, publication-ready output',
@@ -7,7 +7,9 @@ const FILE_PATHS: Record<SlashCommandId, string> = {
7
7
  'prd-agent-generator': '.codex/prompts/prd-agent-generator.md',
8
8
  'product-brief': '.codex/prompts/product-brief.md',
9
9
  'epic-single': '.codex/prompts/epic-single.md',
10
+ 'epic-generator': '.codex/prompts/epic-generator.md',
10
11
  'story-single': '.codex/prompts/story-single.md',
12
+ 'story-generator': '.codex/prompts/story-generator.md',
11
13
  'qa-test-scenario': '.codex/prompts/qa-test-scenario.md',
12
14
  'skill-creator': '.codex/prompts/skill-creator.md',
13
15
  'ai-humanizer': '.codex/prompts/ai-humanizer.md',
@@ -26,7 +28,9 @@ const DESCRIPTIONS: Record<SlashCommandId, string> = {
26
28
  'prd-agent-generator': 'Generate a PRD with autonomous assumptions (non-interactive mode)',
27
29
  'product-brief': 'Generate an executive-level product brief (1-page summary)',
28
30
  'epic-single': 'Generate a single well-defined Jira Epic',
31
+ 'epic-generator': 'Generate a comprehensive set of EPICs from documentation',
29
32
  'story-single': 'Generate a single Jira User Story from requirements',
33
+ 'story-generator': 'Generate comprehensive user stories from EPICs and FSD',
30
34
  'qa-test-scenario': 'Generate focused QA test scenarios from PRD',
31
35
  'skill-creator': 'Create a modular skill package that extends AI agent capabilities',
32
36
  'ai-humanizer': 'Humanize and proofread AI-generated content for natural, publication-ready output',
@@ -10,7 +10,9 @@ const FILE_PATHS: Record<SlashCommandId, string> = {
10
10
  'prd-agent-generator': '.github/prompts/prd-agent-generator.prompt.md',
11
11
  'product-brief': '.github/prompts/product-brief.prompt.md',
12
12
  'epic-single': '.github/prompts/epic-single.prompt.md',
13
+ 'epic-generator': '.github/prompts/epic-generator.prompt.md',
13
14
  'story-single': '.github/prompts/story-single.prompt.md',
15
+ 'story-generator': '.github/prompts/story-generator.prompt.md',
14
16
  'qa-test-scenario': '.github/prompts/qa-test-scenario.prompt.md',
15
17
  'skill-creator': '.github/prompts/skill-creator.prompt.md',
16
18
  'ai-humanizer': '.github/prompts/ai-humanizer.prompt.md',
@@ -29,7 +31,9 @@ const DESCRIPTIONS: Record<SlashCommandId, string> = {
29
31
  'prd-agent-generator': 'Generate a PRD with autonomous assumptions (non-interactive mode)',
30
32
  'product-brief': 'Generate an executive-level product brief (1-page summary)',
31
33
  'epic-single': 'Generate a single well-defined Jira Epic',
34
+ 'epic-generator': 'Generate a comprehensive set of EPICs from documentation',
32
35
  'story-single': 'Generate a single Jira User Story from requirements',
36
+ 'story-generator': 'Generate comprehensive user stories from EPICs and FSD',
33
37
  'qa-test-scenario': 'Generate focused QA test scenarios from PRD',
34
38
  'skill-creator': 'Create a modular skill package that extends AI agent capabilities',
35
39
  'ai-humanizer': 'Humanize and proofread AI-generated content for natural, publication-ready output',
@@ -7,7 +7,9 @@ const FILE_PATHS: Record<SlashCommandId, string> = {
7
7
  'prd-agent-generator': '.kilocode/workflows/prd-agent-generator.md',
8
8
  'product-brief': '.kilocode/workflows/product-brief.md',
9
9
  'epic-single': '.kilocode/workflows/epic-single.md',
10
+ 'epic-generator': '.kilocode/workflows/epic-generator.md',
10
11
  'story-single': '.kilocode/workflows/story-single.md',
12
+ 'story-generator': '.kilocode/workflows/story-generator.md',
11
13
  'qa-test-scenario': '.kilocode/workflows/qa-test-scenario.md',
12
14
  'skill-creator': '.kilocode/workflows/skill-creator.md',
13
15
  'ai-humanizer': '.kilocode/workflows/ai-humanizer.md',
@@ -26,7 +28,9 @@ const DESCRIPTIONS: Record<SlashCommandId, string> = {
26
28
  'prd-agent-generator': 'Generate a PRD with autonomous assumptions (non-interactive mode)',
27
29
  'product-brief': 'Generate an executive-level product brief (1-page summary)',
28
30
  'epic-single': 'Generate a single well-defined Jira Epic',
31
+ 'epic-generator': 'Generate a comprehensive set of EPICs from documentation',
29
32
  'story-single': 'Generate a single Jira User Story from requirements',
33
+ 'story-generator': 'Generate comprehensive user stories from EPICs and FSD',
30
34
  'qa-test-scenario': 'Generate focused QA test scenarios from PRD',
31
35
  'skill-creator': 'Create a modular skill package that extends AI agent capabilities',
32
36
  'ai-humanizer': 'Humanize and proofread AI-generated content for natural, publication-ready output',
@@ -7,7 +7,9 @@ const FILE_PATHS: Record<SlashCommandId, string> = {
7
7
  'prd-agent-generator': '.opencode/command/prd-agent-generator.md',
8
8
  'product-brief': '.opencode/command/product-brief.md',
9
9
  'epic-single': '.opencode/command/epic-single.md',
10
+ 'epic-generator': '.opencode/command/epic-generator.md',
10
11
  'story-single': '.opencode/command/story-single.md',
12
+ 'story-generator': '.opencode/command/story-generator.md',
11
13
  'qa-test-scenario': '.opencode/command/qa-test-scenario.md',
12
14
  'skill-creator': '.opencode/command/skill-creator.md',
13
15
  'ai-humanizer': '.opencode/command/ai-humanizer.md',
@@ -26,7 +28,9 @@ const DESCRIPTIONS: Record<SlashCommandId, string> = {
26
28
  'prd-agent-generator': 'Generate a PRD with autonomous assumptions (non-interactive mode)',
27
29
  'product-brief': 'Generate an executive-level product brief (1-page summary)',
28
30
  'epic-single': 'Generate a single well-defined Jira Epic',
31
+ 'epic-generator': 'Generate a comprehensive set of EPICs from documentation',
29
32
  'story-single': 'Generate a single Jira User Story from requirements',
33
+ 'story-generator': 'Generate comprehensive user stories from EPICs and FSD',
30
34
  'qa-test-scenario': 'Generate focused QA test scenarios from PRD',
31
35
  'skill-creator': 'Create a modular skill package that extends AI agent capabilities',
32
36
  'ai-humanizer': 'Humanize and proofread AI-generated content for natural, publication-ready output',
@@ -1443,6 +1443,352 @@ The story must:
1443
1443
  Return **ONLY the completed story in Markdown**, nothing else.
1444
1444
  `;
1445
1445
 
1446
+ export const EPIC_GENERATOR_TEMPLATE = `# EPIC Generation Prompt
1447
+
1448
+ # Role & Expertise
1449
+ You are a Senior Product Owner and Business Analyst with 10+ years of experience in Agile software development. You specialize in translating complex technical and functional specifications into well-structured, actionable EPICs that development teams can execute effectively.
1450
+
1451
+ # Context
1452
+ You will analyze project documentation to extract and generate comprehensive EPICs for agile project planning. The primary sources are the Functional Specification Document (FSD) and Technical Design Document (TDD), with UI Wireframes serving as supplementary reference for user-facing features.
1453
+
1454
+ # Primary Objective
1455
+ Generate a complete set of EPICs that capture all major feature areas, business capabilities, and technical deliverables defined in the provided documentation. Each EPIC must be traceable to source requirements and sized appropriately for sprint planning decomposition.
1456
+
1457
+ # Input Documents
1458
+ 1. **FSD (Functional Specification Document)** - PRIMARY
1459
+ - Business requirements and functional capabilities
1460
+ - User workflows and business rules
1461
+ - Acceptance criteria foundations
1462
+
1463
+ 2. **TDD (Technical Design Document)** - PRIMARY
1464
+ - System architecture components
1465
+ - Integration points and APIs
1466
+ - Technical constraints and dependencies
1467
+
1468
+ 3. **UI Wireframes** - SUPPLEMENTARY
1469
+ - User interface flows
1470
+ - Screen-level functionality
1471
+ - User interaction patterns
1472
+
1473
+ # Process
1474
+
1475
+ ## Phase 1: Document Analysis
1476
+ 1. Extract all functional requirements from FSD
1477
+ - Identify business capabilities
1478
+ - Map user journeys and workflows
1479
+ - Note business rules and validations
1480
+ 2. Extract technical components from TDD
1481
+ - Identify system modules and services
1482
+ - Map integration dependencies
1483
+ - Note technical constraints
1484
+ 3. Cross-reference UI Wireframes
1485
+ - Link screens to functional requirements
1486
+ - Identify user-facing features
1487
+ - Note UI-specific requirements
1488
+
1489
+ ## Phase 2: EPIC Identification
1490
+ 1. Group related requirements into logical feature areas
1491
+ 2. Identify natural boundaries based on:
1492
+ - Business domain separation
1493
+ - Technical component boundaries
1494
+ - User journey completeness
1495
+ - Dependency chains
1496
+ 3. Validate each EPIC can be independently deliverable
1497
+
1498
+ ## Phase 3: EPIC Definition
1499
+ For each identified EPIC, define:
1500
+ - Clear business value statement
1501
+ - Scope boundaries (in/out)
1502
+ - High-level acceptance criteria
1503
+ - Dependencies and prerequisites
1504
+ - Estimated complexity tier
1505
+
1506
+ ## Phase 4: Validation
1507
+ 1. Verify complete coverage of all requirements
1508
+ 2. Check for gaps between documents
1509
+ 3. Identify any conflicting requirements
1510
+ 4. Flag assumptions made
1511
+
1512
+ # Output Format
1513
+
1514
+ ## Executive Summary
1515
+ - Total EPICs identified: [number]
1516
+ - Complexity distribution: [High/Medium/Low counts]
1517
+ - Key dependencies identified: [summary]
1518
+ - Coverage gaps or conflicts: [if any]
1519
+
1520
+ ## EPIC Catalog
1521
+
1522
+ ### EPIC-[XXX]: [EPIC Title]
1523
+
1524
+ **Business Value Statement:**
1525
+ [2-3 sentences describing the business outcome and user benefit]
1526
+
1527
+ **Description:**
1528
+ [Detailed description of what this EPIC delivers]
1529
+
1530
+ **Source Traceability:**
1531
+ | Document | Reference | Section/Page |
1532
+ |----------|-----------|--------------|
1533
+ | FSD | [Requirement ID] | [Location] |
1534
+ | TDD | [Component/Section] | [Location] |
1535
+ | Wireframe | [Screen Name] | [If applicable] |
1536
+
1537
+ **Scope Definition:**
1538
+ | In Scope | Out of Scope |
1539
+ |----------|--------------|
1540
+ | [Item 1] | [Item 1] |
1541
+ | [Item 2] | [Item 2] |
1542
+
1543
+ **High-Level Acceptance Criteria:**
1544
+ - [ ] [Criterion 1]
1545
+ - [ ] [Criterion 2]
1546
+ - [ ] [Criterion 3]
1547
+ - [ ] [Criterion 4]
1548
+
1549
+ **Dependencies:**
1550
+ - **Prerequisite EPICs:** [EPIC-XXX, EPIC-XXX] or None
1551
+ - **External Dependencies:** [Systems, teams, data]
1552
+ - **Technical Prerequisites:** [Infrastructure, APIs, etc.]
1553
+
1554
+ **Complexity Assessment:**
1555
+ - **Size:** [S / M / L / XL]
1556
+ - **Technical Complexity:** [Low / Medium / High]
1557
+ - **Integration Complexity:** [Low / Medium / High]
1558
+ - **Estimated Story Count:** [Range]
1559
+
1560
+ **Risks & Assumptions:**
1561
+ - **Assumptions:** [List key assumptions]
1562
+ - **Risks:** [List identified risks]
1563
+
1564
+ ---
1565
+
1566
+ [Repeat for each EPIC]
1567
+
1568
+ ## Dependency Map
1569
+
1570
+ [Visual or text representation of EPIC dependencies]
1571
+ EPIC-001 ──► EPIC-003
1572
+ EPIC-002 ──► EPIC-003
1573
+ EPIC-003 ──► EPIC-005
1574
+
1575
+ ## Traceability Matrix
1576
+ | Requirement ID | FSD Section | TDD Component | Wireframe | EPIC |
1577
+ |----------------|-------------|---------------|-----------|------|
1578
+ | [REQ-001] | [Section] | [Component] | [Screen] | [EPIC-XXX] |
1579
+
1580
+ ## Gaps & Recommendations
1581
+ 1. **Identified Gaps:** [Requirements not fully covered]
1582
+ 2. **Conflicts Found:** [Contradictions between documents]
1583
+ 3. **Recommendations:** [Suggested clarifications needed]
1584
+
1585
+ # Quality Standards
1586
+ - Every functional requirement must map to at least one EPIC
1587
+ - Each EPIC must have clear, measurable acceptance criteria
1588
+ - Dependencies must form a valid directed acyclic graph (no circular dependencies)
1589
+ - EPIC sizing should allow decomposition into 5-15 user stories
1590
+ - Business value must be articulated in user/business terms, not technical terms
1591
+ - All assumptions must be explicitly stated
1592
+
1593
+ # Special Instructions
1594
+ - If FSD and TDD conflict, note the conflict and use FSD as the authority for functional scope
1595
+ - If wireframes show features not in FSD/TDD, flag as "Potential Scope Addition"
1596
+ - Group infrastructure/DevOps requirements into dedicated technical EPICs
1597
+ - Non-functional requirements (security, performance) should be integrated into relevant EPICs AND have a dedicated NFR EPIC if substantial
1598
+ - Use consistent naming convention: EPIC-[3-digit number]: [Verb] [Object] [Qualifier]
1599
+
1600
+ # Verification Checklist
1601
+ After generating EPICs, verify:
1602
+ - [ ] 100% of FSD functional requirements are covered
1603
+ - [ ] All TDD components have corresponding EPICs
1604
+ - [ ] No orphaned wireframe screens
1605
+ - [ ] Dependency chain is logical and achievable
1606
+ - [ ] Each EPIC is independently valuable
1607
+ - [ ] Complexity assessments are consistent
1608
+ - [ ] Traceability is complete and accurate
1609
+ `;
1610
+
1611
+ export const STORY_GENERATOR_TEMPLATE = `# Story Generation Prompt
1612
+
1613
+ # Role & Expertise
1614
+ You are a Senior Business Analyst and Agile Product Owner with 10+ years of experience translating functional specifications into well-structured user stories. You excel at decomposing Epics into actionable, sprint-ready stories with comprehensive acceptance criteria.
1615
+
1616
+ # Context
1617
+ You will receive two primary inputs:
1618
+ 1. **Epics** (Primary Resource) - High-level feature descriptions defining the scope
1619
+ 2. **FSD (Functional Specification Document)** (Secondary Resource) - Detailed functional requirements, business rules, and technical specifications
1620
+
1621
+ Your task is to synthesize these inputs into complete, development-ready user stories.
1622
+
1623
+ # Primary Objective
1624
+ Generate comprehensive user stories from provided Epics, enriched with details from the FSD, following industry-standard Agile practices.
1625
+
1626
+ # Process
1627
+ 1. **Epic Analysis**
1628
+ - Identify the core business value and user need
1629
+ - Determine story boundaries and natural decomposition points
1630
+ - Map dependencies between potential stories
1631
+
1632
+ 2. **FSD Integration**
1633
+ - Extract relevant functional requirements for each story
1634
+ - Identify business rules that impact acceptance criteria
1635
+ - Note technical constraints and integration points
1636
+ - Pull UI/UX specifications where applicable
1637
+
1638
+ 3. **Story Construction**
1639
+ - Write clear user story statements
1640
+ - Define comprehensive acceptance criteria
1641
+ - Add technical notes and dependencies
1642
+ - Estimate relative complexity
1643
+
1644
+ 4. **Quality Verification**
1645
+ - Ensure stories follow INVEST principles
1646
+ - Verify traceability back to Epic and FSD
1647
+ - Confirm acceptance criteria are testable
1648
+
1649
+ # Input Specifications
1650
+ **Epic Format Expected:**
1651
+ - Epic ID/Name
1652
+ - Description/Goal
1653
+ - Business Value
1654
+ - Scope boundaries (in/out)
1655
+
1656
+ **FSD Format Expected:**
1657
+ - Functional requirements
1658
+ - Business rules
1659
+ - User flows/workflows
1660
+ - Data requirements
1661
+ - Integration specifications
1662
+ - UI/UX requirements (if available)
1663
+
1664
+ # Output Requirements
1665
+
1666
+ For each Epic, generate stories in this exact format:
1667
+
1668
+ ---
1669
+
1670
+ ## Epic: [Epic Name/ID]
1671
+
1672
+ ### Story [Number]: [Concise Story Title]
1673
+
1674
+ **User Story:**
1675
+ As a [specific user role],
1676
+ I want to [action/capability],
1677
+ So that [business value/outcome].
1678
+
1679
+ **Description:**
1680
+ [2-3 sentences providing additional context, referencing FSD sections where applicable]
1681
+
1682
+ **Acceptance Criteria:**
1683
+ \`\`\`gherkin
1684
+ GIVEN [precondition/context]
1685
+ WHEN [action/trigger]
1686
+ THEN [expected outcome]
1687
+
1688
+ GIVEN [precondition/context]
1689
+ WHEN [alternative action]
1690
+ THEN [expected outcome]
1691
+ \`\`\`
1692
+
1693
+ **Business Rules:**
1694
+ - BR-1: [Rule from FSD]
1695
+ - BR-2: [Rule from FSD]
1696
+
1697
+ **Technical Notes:**
1698
+ - [Integration requirements]
1699
+ - [Data considerations]
1700
+ - [API/System dependencies]
1701
+
1702
+ **FSD Reference:** [Section/Requirement IDs traced from FSD]
1703
+
1704
+ **Dependencies:** [Other story IDs or external dependencies]
1705
+
1706
+ **Story Points:** [Fibonacci estimate: 1, 2, 3, 5, 8, 13]
1707
+
1708
+ **Priority:** [Must Have / Should Have / Could Have / Won't Have]
1709
+
1710
+ ---
1711
+
1712
+ # Quality Standards
1713
+ - **INVEST Compliant:** Each story must be Independent, Negotiable, Valuable, Estimable, Small, Testable
1714
+ - **Acceptance Criteria:** Minimum 3 criteria per story, written in Gherkin format (Given/When/Then)
1715
+ - **Traceability:** Every story must reference source Epic and relevant FSD sections
1716
+ - **Granularity:** Stories should be completable within a single sprint (typically 1-8 story points)
1717
+ - **Completeness:** Include edge cases and error scenarios in acceptance criteria
1718
+
1719
+ # Special Instructions
1720
+ 1. **Decomposition Rules:**
1721
+ - If an Epic contains multiple user roles, create separate stories per role
1722
+ - If workflows have distinct phases, split into sequential stories
1723
+ - CRUD operations should be separate stories unless trivially simple
1724
+
1725
+ 2. **Acceptance Criteria Guidelines:**
1726
+ - Include happy path scenarios
1727
+ - Include at least one error/edge case scenario
1728
+ - Include validation rules from FSD
1729
+ - Make criteria specific and measurable
1730
+
1731
+ 3. **When FSD Details Are Missing:**
1732
+ - Flag with "[CLARIFICATION NEEDED]" tag
1733
+ - Provide reasonable assumption with "[ASSUMPTION]" tag
1734
+ - Continue with story generation
1735
+
1736
+ 4. **Output Organization:**
1737
+ - Group stories by Epic
1738
+ - Order stories by logical implementation sequence
1739
+ - Highlight cross-Epic dependencies
1740
+
1741
+ # Example Output
1742
+
1743
+ ## Epic: User Authentication
1744
+
1745
+ ### Story 1: User Login with Email
1746
+
1747
+ **User Story:**
1748
+ As a registered user,
1749
+ I want to log in using my email and password,
1750
+ So that I can access my personalized dashboard securely.
1751
+
1752
+ **Description:**
1753
+ Enable standard email/password authentication as specified in FSD Section 3.2. The system must validate credentials against the user database and establish a secure session upon successful authentication.
1754
+
1755
+ **Acceptance Criteria:**
1756
+ \`\`\`gherkin
1757
+ GIVEN I am on the login page
1758
+ WHEN I enter valid email and password and click "Login"
1759
+ THEN I am redirected to my dashboard and see a welcome message
1760
+
1761
+ GIVEN I am on the login page
1762
+ WHEN I enter invalid credentials and click "Login"
1763
+ THEN I see an error message "Invalid email or password" and remain on login page
1764
+
1765
+ GIVEN I have failed login 5 times
1766
+ WHEN I attempt to login again
1767
+ THEN my account is temporarily locked for 15 minutes per BR-AUTH-03
1768
+ \`\`\`
1769
+
1770
+ **Business Rules:**
1771
+ - BR-AUTH-01: Passwords must be minimum 8 characters
1772
+ - BR-AUTH-03: Account lockout after 5 failed attempts
1773
+
1774
+ **Technical Notes:**
1775
+ - Integrate with OAuth 2.0 service (per FSD 3.2.4)
1776
+ - Session timeout: 30 minutes of inactivity
1777
+ - Password hashing: bcrypt with salt
1778
+
1779
+ **FSD Reference:** Section 3.2, Requirements FR-AUTH-001 through FR-AUTH-008
1780
+
1781
+ **Dependencies:** None (foundational story)
1782
+
1783
+ **Story Points:** 5
1784
+
1785
+ **Priority:** Must Have
1786
+
1787
+ ---
1788
+
1789
+ Now process the provided Epic(s) and FSD to generate comprehensive user stories.
1790
+ `;
1791
+
1446
1792
  export const API_CONTRACT_GENERATOR_TEMPLATE = `# API Contract Generator Prompt
1447
1793
 
1448
1794
  # Role & Expertise
@@ -2725,6 +3071,7 @@ export const PROMPT_TEMPLATES: Record<string, string> = {
2725
3071
  'ai-humanizer': AI_HUMANIZER_TEMPLATE,
2726
3072
  'api-contract-generator': API_CONTRACT_GENERATOR_TEMPLATE,
2727
3073
  'document-explainer': DOCUMENT_EXPLAINER_TEMPLATE,
3074
+ 'epic-generator': EPIC_GENERATOR_TEMPLATE,
2728
3075
  'epic-single': EPIC_SINGLE_TEMPLATE,
2729
3076
  'erd-generator': ERD_GENERATOR_TEMPLATE,
2730
3077
  'fsd-generator': FSD_GENERATOR_TEMPLATE,
@@ -2733,6 +3080,7 @@ export const PROMPT_TEMPLATES: Record<string, string> = {
2733
3080
  'product-brief': PRODUCT_BRIEF_TEMPLATE,
2734
3081
  'qa-test-scenario': QA_TEST_SCENARIO_TEMPLATE,
2735
3082
  'skill-creator': SKILL_CREATOR_TEMPLATE,
3083
+ 'story-generator': STORY_GENERATOR_TEMPLATE,
2736
3084
  'story-single': STORY_SINGLE_TEMPLATE,
2737
3085
  'tdd-generator': TDD_GENERATOR_TEMPLATE,
2738
3086
  'tdd-lite-generator': TDD_LITE_GENERATOR_TEMPLATE,