@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
@@ -0,0 +1,70 @@
1
+ ### โœ… **Prompt: Generate a Single Jira Story from QA Prompt**
2
+
3
+ You are a **Jira expert, senior product manager, and QA analyst**.
4
+
5
+ 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.
6
+
7
+ ---
8
+
9
+ ### ๐Ÿ”ฝ **Input**
10
+
11
+ ```
12
+ {QA_TEXT}
13
+ ```
14
+
15
+ ---
16
+
17
+ ### ๐Ÿ”ผ **Output Rules**
18
+
19
+ * Use **Markdown only**
20
+ * Produce **ONE (1) User Story only**
21
+ * Must be written from **end-user perspective**
22
+ * Title must be **clear and non-technical**
23
+ * Story must be **independently deliverable and testable**
24
+ * Rewrite unclear or fragmented input into a **clean and business-focused requirement**
25
+ * If information is missing, mark it **TBD** (do NOT assume)
26
+
27
+ ---
28
+
29
+ ### ๐Ÿงฑ **Story Structure**
30
+
31
+ ```
32
+ ## ๐Ÿงพ Story: {Story Title}
33
+
34
+ ### ๐Ÿง‘ As a {USER ROLE},
35
+ I want to {USER INTENT}
36
+ so that I can {BUSINESS VALUE}
37
+
38
+ ### ๐Ÿ”จ Acceptance Criteria (BDD Format)
39
+ - **Given** {context}
40
+ - **When** {action}
41
+ - **Then** {expected result}
42
+
43
+ (Add 4โ€“8 acceptance criteria)
44
+
45
+ ### ๐Ÿ“Œ Expected Result
46
+ - Bullet points describing what success looks like
47
+
48
+ ### ๐Ÿšซ Non-Goals (if applicable)
49
+ - Bullet points of what is explicitly NOT included
50
+
51
+ ### ๐Ÿ—’๏ธ Notes (optional)
52
+ - Clarifications / constraints / dependencies / edge cases
53
+ ```
54
+
55
+ ---
56
+
57
+ ### โš ๏ธ Validation Rules Before Generating
58
+
59
+ The story must:
60
+
61
+ * Focus on **one user outcome only**
62
+ * Avoid **technical solutioning** (no APIs, tables, database fields, component names)
63
+ * Avoid **phrases like "fix bug", "backend update", "add field X"**
64
+ * Convert QA language into **business language**
65
+
66
+ ---
67
+
68
+ ### ๐Ÿ Final Output
69
+
70
+ Return **ONLY the completed story in Markdown**, nothing else.
package/src/cli/index.ts CHANGED
@@ -2,13 +2,14 @@ import { Command } from 'commander';
2
2
  import { InitCommand } from '../commands/init.js';
3
3
  import { UpdateCommand } from '../commands/update.js';
4
4
  import { ListCommand } from '../commands/list.js';
5
+ import { PrdGeneratorCommand } from '../commands/prd-generator.js';
5
6
 
6
7
  const program = new Command();
7
8
 
8
9
  program
9
10
  .name('prompter')
10
11
  .description('Enhance prompts directly in your AI coding workflow')
11
- .version('0.1.0');
12
+ .version('0.3.0');
12
13
 
13
14
  program
14
15
  .command('init')
@@ -37,4 +38,12 @@ program
37
38
  await listCommand.execute(options);
38
39
  });
39
40
 
41
+ program
42
+ .command('prd-generator')
43
+ .description('Generate PRD workflow files for configured AI tools')
44
+ .action(async (options) => {
45
+ const prdGeneratorCommand = new PrdGeneratorCommand();
46
+ await prdGeneratorCommand.execute(options);
47
+ });
48
+
40
49
  program.parse();
@@ -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 PrdGeneratorOptions {
8
+ tools?: string[];
9
+ noInteractive?: boolean;
10
+ }
11
+
12
+ export class PrdGeneratorCommand {
13
+ async execute(options: PrdGeneratorOptions = {}): 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 PRD 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 prd-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 prd-generator workflow file
45
+ const body = configurator['getBody']('prd-generator');
46
+ const relativePath = configurator['getRelativePath']('prd-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']('prd-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โœ… PRD generator workflow files created successfully!\n`));
81
+ console.log(chalk.blue('Next steps:'));
82
+ console.log(chalk.gray(' 1. Use /prd-generator in your AI tool to create PRDs'));
83
+ console.log(chalk.gray(' 2. PRDs will be saved to prompter/<slug>/prd.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
+ }
@@ -2,11 +2,19 @@ import { SlashCommandConfigurator } from './base.js';
2
2
  import { SlashCommandId } from '../../templates/index.js';
3
3
 
4
4
  const FILE_PATHS: Record<SlashCommandId, string> = {
5
- enhance: '.agent/workflows/prompter-enhance.md'
5
+ enhance: '.agent/workflows/prompter-enhance.md',
6
+ 'prd-generator': '.agent/workflows/prd-generator.md',
7
+ 'epic-single': '.agent/workflows/epic-single.md',
8
+ 'story-single': '.agent/workflows/story-single.md',
9
+ 'qa-test-scenario': '.agent/workflows/qa-test-scenario.md'
6
10
  };
7
11
 
8
12
  const DESCRIPTIONS: Record<SlashCommandId, string> = {
9
- enhance: 'Enhance a rough prompt into a professional specification'
13
+ enhance: 'Enhance a rough prompt into a professional specification',
14
+ 'prd-generator': 'Generate a comprehensive Product Requirements Document (PRD)',
15
+ 'epic-single': 'Generate a single well-defined Jira Epic',
16
+ 'story-single': 'Generate a single Jira User Story from requirements',
17
+ 'qa-test-scenario': 'Generate focused QA test scenarios from PRD'
10
18
  };
11
19
 
12
20
  export class AntigravityConfigurator extends SlashCommandConfigurator {
@@ -9,7 +9,7 @@ export interface SlashCommandTarget {
9
9
  kind: 'slash';
10
10
  }
11
11
 
12
- const ALL_COMMANDS: SlashCommandId[] = ['enhance'];
12
+ const ALL_COMMANDS: SlashCommandId[] = ['enhance', 'prd-generator', 'epic-single', 'story-single', 'qa-test-scenario'];
13
13
 
14
14
  export abstract class SlashCommandConfigurator {
15
15
  abstract readonly toolId: string;
@@ -2,11 +2,19 @@ import { SlashCommandConfigurator } from './base.js';
2
2
  import { SlashCommandId } from '../../templates/index.js';
3
3
 
4
4
  const FILE_PATHS: Record<SlashCommandId, string> = {
5
- enhance: '.claude/commands/prompter/enhance.md'
5
+ enhance: '.claude/commands/prompter/enhance.md',
6
+ 'prd-generator': '.claude/commands/prompter/prd-generator.md',
7
+ 'epic-single': '.claude/commands/prompter/epic-single.md',
8
+ 'story-single': '.claude/commands/prompter/story-single.md',
9
+ 'qa-test-scenario': '.claude/commands/prompter/qa-test-scenario.md'
6
10
  };
7
11
 
8
12
  const DESCRIPTIONS: Record<SlashCommandId, string> = {
9
- enhance: 'Enhance a rough prompt into a professional specification'
13
+ enhance: 'Enhance a rough prompt into a professional specification',
14
+ 'prd-generator': 'Generate a comprehensive Product Requirements Document (PRD)',
15
+ 'epic-single': 'Generate a single well-defined Jira Epic',
16
+ 'story-single': 'Generate a single Jira User Story from requirements',
17
+ 'qa-test-scenario': 'Generate focused QA test scenarios from PRD'
10
18
  };
11
19
 
12
20
  export class ClaudeConfigurator extends SlashCommandConfigurator {
@@ -2,11 +2,19 @@ import { SlashCommandConfigurator } from './base.js';
2
2
  import { SlashCommandId } from '../../templates/index.js';
3
3
 
4
4
  const FILE_PATHS: Record<SlashCommandId, string> = {
5
- enhance: '.codex/prompts/prompter-enhance.md'
5
+ enhance: '.codex/prompts/prompter-enhance.md',
6
+ 'prd-generator': '.codex/prompts/prd-generator.md',
7
+ 'epic-single': '.codex/prompts/epic-single.md',
8
+ 'story-single': '.codex/prompts/story-single.md',
9
+ 'qa-test-scenario': '.codex/prompts/qa-test-scenario.md'
6
10
  };
7
11
 
8
12
  const DESCRIPTIONS: Record<SlashCommandId, string> = {
9
- enhance: 'Enhance a rough prompt into a professional specification'
13
+ enhance: 'Enhance a rough prompt into a professional specification',
14
+ 'prd-generator': 'Generate a comprehensive Product Requirements Document (PRD)',
15
+ 'epic-single': 'Generate a single well-defined Jira Epic',
16
+ 'story-single': 'Generate a single Jira User Story from requirements',
17
+ 'qa-test-scenario': 'Generate focused QA test scenarios from PRD'
10
18
  };
11
19
 
12
20
  export class CodexConfigurator extends SlashCommandConfigurator {
@@ -2,11 +2,19 @@ import { SlashCommandConfigurator } from './base.js';
2
2
  import { SlashCommandId } from '../../templates/index.js';
3
3
 
4
4
  const FILE_PATHS: Record<SlashCommandId, string> = {
5
- enhance: '.github/prompts/prompter-enhance.md'
5
+ enhance: '.github/prompts/prompter-enhance.md',
6
+ 'prd-generator': '.github/prompts/prd-generator.md',
7
+ 'epic-single': '.github/prompts/epic-single.md',
8
+ 'story-single': '.github/prompts/story-single.md',
9
+ 'qa-test-scenario': '.github/prompts/qa-test-scenario.md'
6
10
  };
7
11
 
8
12
  const DESCRIPTIONS: Record<SlashCommandId, string> = {
9
- enhance: 'Enhance a rough prompt into a professional specification'
13
+ enhance: 'Enhance a rough prompt into a professional specification',
14
+ 'prd-generator': 'Generate a comprehensive Product Requirements Document (PRD)',
15
+ 'epic-single': 'Generate a single well-defined Jira Epic',
16
+ 'story-single': 'Generate a single Jira User Story from requirements',
17
+ 'qa-test-scenario': 'Generate focused QA test scenarios from PRD'
10
18
  };
11
19
 
12
20
  export class GithubCopilotConfigurator extends SlashCommandConfigurator {
@@ -2,11 +2,19 @@ import { SlashCommandConfigurator } from './base.js';
2
2
  import { SlashCommandId } from '../../templates/index.js';
3
3
 
4
4
  const FILE_PATHS: Record<SlashCommandId, string> = {
5
- enhance: '.kilocode/workflows/prompter-enhance.md'
5
+ enhance: '.kilocode/workflows/prompter-enhance.md',
6
+ 'prd-generator': '.kilocode/workflows/prd-generator.md',
7
+ 'epic-single': '.kilocode/workflows/epic-single.md',
8
+ 'story-single': '.kilocode/workflows/story-single.md',
9
+ 'qa-test-scenario': '.kilocode/workflows/qa-test-scenario.md'
6
10
  };
7
11
 
8
12
  const DESCRIPTIONS: Record<SlashCommandId, string> = {
9
- enhance: 'Enhance a rough prompt into a professional specification'
13
+ enhance: 'Enhance a rough prompt into a professional specification',
14
+ 'prd-generator': 'Generate a comprehensive Product Requirements Document (PRD)',
15
+ 'epic-single': 'Generate a single well-defined Jira Epic',
16
+ 'story-single': 'Generate a single Jira User Story from requirements',
17
+ 'qa-test-scenario': 'Generate focused QA test scenarios from PRD'
10
18
  };
11
19
 
12
20
  export class KiloCodeConfigurator extends SlashCommandConfigurator {
@@ -2,11 +2,19 @@ import { SlashCommandConfigurator } from './base.js';
2
2
  import { SlashCommandId } from '../../templates/index.js';
3
3
 
4
4
  const FILE_PATHS: Record<SlashCommandId, string> = {
5
- enhance: '.opencode/prompts/prompter-enhance.md'
5
+ enhance: '.opencode/prompts/prompter-enhance.md',
6
+ 'prd-generator': '.opencode/prompts/prd-generator.md',
7
+ 'epic-single': '.opencode/prompts/epic-single.md',
8
+ 'story-single': '.opencode/prompts/story-single.md',
9
+ 'qa-test-scenario': '.opencode/prompts/qa-test-scenario.md'
6
10
  };
7
11
 
8
12
  const DESCRIPTIONS: Record<SlashCommandId, string> = {
9
- enhance: 'Enhance a rough prompt into a professional specification'
13
+ enhance: 'Enhance a rough prompt into a professional specification',
14
+ 'prd-generator': 'Generate a comprehensive Product Requirements Document (PRD)',
15
+ 'epic-single': 'Generate a single well-defined Jira Epic',
16
+ 'story-single': 'Generate a single Jira User Story from requirements',
17
+ 'qa-test-scenario': 'Generate focused QA test scenarios from PRD'
10
18
  };
11
19
 
12
20
  export class OpenCodeConfigurator extends SlashCommandConfigurator {