@dedesfr/prompter 0.3.2 → 0.3.4

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.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: Generate a single well-defined Jira Epic
3
3
  ---
4
+ $ARGUMENTS
4
5
  <!-- prompter-managed-start -->
5
6
  Your job is to take a user requirement and structure it into **a single, well-defined Jira Epic**.
6
7
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: Generate a comprehensive Product Requirements Document (PRD)
3
3
  ---
4
+ $ARGUMENTS
4
5
  <!-- prompter-managed-start -->
5
6
  # Role & Expertise
6
7
  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.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: Enhance a rough prompt into a professional specification
3
3
  ---
4
+ $ARGUMENTS
4
5
  <!-- prompter-managed-start -->
5
6
  ## MUST FOLLOW
6
7
  - Response Language: {User Request Language}
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: Generate focused QA test scenarios from PRD
3
3
  ---
4
+ $ARGUMENTS
4
5
  <!-- prompter-managed-start -->
5
6
  # Role & Expertise
6
7
  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.
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  description: Generate a single Jira User Story from requirements
3
3
  ---
4
+ $ARGUMENTS
4
5
  <!-- prompter-managed-start -->
5
6
  ### ✅ **Prompt: Generate a Single Jira Story from QA Prompt**
6
7
 
package/dist/cli/index.js CHANGED
@@ -7,7 +7,7 @@ const program = new Command();
7
7
  program
8
8
  .name('prompter')
9
9
  .description('Enhance prompts directly in your AI coding workflow')
10
- .version('0.3.2');
10
+ .version('0.3.3');
11
11
  program
12
12
  .command('init')
13
13
  .description('Initialize Prompter in your project')
@@ -5,5 +5,7 @@ export declare class GithubCopilotConfigurator extends SlashCommandConfigurator
5
5
  readonly isAvailable = true;
6
6
  protected getRelativePath(id: SlashCommandId): string;
7
7
  protected getFrontmatter(id: SlashCommandId): string | undefined;
8
+ generateAll(projectPath: string): Promise<string[]>;
9
+ private checkFileExists;
8
10
  }
9
11
  //# sourceMappingURL=github-copilot.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"github-copilot.d.ts","sourceRoot":"","sources":["../../../../src/core/configurators/slash/github-copilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAkB1D,qBAAa,yBAA0B,SAAQ,wBAAwB;IACnE,QAAQ,CAAC,MAAM,oBAAoB;IACnC,QAAQ,CAAC,WAAW,QAAQ;IAE5B,SAAS,CAAC,eAAe,CAAC,EAAE,EAAE,cAAc,GAAG,MAAM;IAIrD,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;CAInE"}
1
+ {"version":3,"file":"github-copilot.d.ts","sourceRoot":"","sources":["../../../../src/core/configurators/slash/github-copilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAqB1D,qBAAa,yBAA0B,SAAQ,wBAAwB;IACnE,QAAQ,CAAC,MAAM,oBAAoB;IACnC,QAAQ,CAAC,WAAW,QAAQ;IAE5B,SAAS,CAAC,eAAe,CAAC,EAAE,EAAE,cAAc,GAAG,MAAM;IAIrD,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAK1D,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAgC3C,eAAe;CAQhC"}
@@ -1,10 +1,13 @@
1
1
  import { SlashCommandConfigurator } from './base.js';
2
+ import { promises as fs } from 'fs';
3
+ import path from 'path';
4
+ import { PROMPTER_MARKERS } from '../../config.js';
2
5
  const FILE_PATHS = {
3
- enhance: '.github/prompts/prompter-enhance.md',
4
- 'prd-generator': '.github/prompts/prd-generator.md',
5
- 'epic-single': '.github/prompts/epic-single.md',
6
- 'story-single': '.github/prompts/story-single.md',
7
- 'qa-test-scenario': '.github/prompts/qa-test-scenario.md'
6
+ enhance: '.github/prompts/prompter-enhance.prompt.md',
7
+ 'prd-generator': '.github/prompts/prd-generator.prompt.md',
8
+ 'epic-single': '.github/prompts/epic-single.prompt.md',
9
+ 'story-single': '.github/prompts/story-single.prompt.md',
10
+ 'qa-test-scenario': '.github/prompts/qa-test-scenario.prompt.md'
8
11
  };
9
12
  const DESCRIPTIONS = {
10
13
  enhance: 'Enhance a rough prompt into a professional specification',
@@ -23,5 +26,41 @@ export class GithubCopilotConfigurator extends SlashCommandConfigurator {
23
26
  const description = DESCRIPTIONS[id];
24
27
  return `---\ndescription: ${description}\n---`;
25
28
  }
29
+ async generateAll(projectPath) {
30
+ const createdOrUpdated = [];
31
+ for (const target of this.getTargets()) {
32
+ const body = this.getBody(target.id);
33
+ const filePath = path.join(projectPath, target.path);
34
+ // Ensure directory exists
35
+ await fs.mkdir(path.dirname(filePath), { recursive: true });
36
+ const exists = await this.checkFileExists(filePath);
37
+ if (exists) {
38
+ await this.updateBody(filePath, body);
39
+ }
40
+ else {
41
+ const frontmatter = this.getFrontmatter(target.id);
42
+ const sections = [];
43
+ if (frontmatter) {
44
+ sections.push(frontmatter.trim());
45
+ }
46
+ // Add $ARGUMENTS after frontmatter
47
+ sections.push('$ARGUMENTS');
48
+ sections.push(`${PROMPTER_MARKERS.start}\n${body}\n${PROMPTER_MARKERS.end}`);
49
+ const content = sections.join('\n') + '\n';
50
+ await fs.writeFile(filePath, content, 'utf-8');
51
+ }
52
+ createdOrUpdated.push(target.path);
53
+ }
54
+ return createdOrUpdated;
55
+ }
56
+ async checkFileExists(filePath) {
57
+ try {
58
+ await fs.access(filePath);
59
+ return true;
60
+ }
61
+ catch {
62
+ return false;
63
+ }
64
+ }
26
65
  }
27
66
  //# sourceMappingURL=github-copilot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"github-copilot.js","sourceRoot":"","sources":["../../../../src/core/configurators/slash/github-copilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAGrD,MAAM,UAAU,GAAmC;IAC/C,OAAO,EAAE,qCAAqC;IAC9C,eAAe,EAAE,kCAAkC;IACnD,aAAa,EAAE,gCAAgC;IAC/C,cAAc,EAAE,iCAAiC;IACjD,kBAAkB,EAAE,qCAAqC;CAC5D,CAAC;AAEF,MAAM,YAAY,GAAmC;IACjD,OAAO,EAAE,0DAA0D;IACnE,eAAe,EAAE,8DAA8D;IAC/E,aAAa,EAAE,0CAA0C;IACzD,cAAc,EAAE,qDAAqD;IACrE,kBAAkB,EAAE,6CAA6C;CACpE,CAAC;AAEF,MAAM,OAAO,yBAA0B,SAAQ,wBAAwB;IAC1D,MAAM,GAAG,gBAAgB,CAAC;IAC1B,WAAW,GAAG,IAAI,CAAC;IAElB,eAAe,CAAC,EAAkB;QACxC,OAAO,UAAU,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;IAES,cAAc,CAAC,EAAkB;QACvC,MAAM,WAAW,GAAG,YAAY,CAAC,EAAE,CAAC,CAAC;QACrC,OAAO,qBAAqB,WAAW,OAAO,CAAC;IACnD,CAAC;CACJ"}
1
+ {"version":3,"file":"github-copilot.js","sourceRoot":"","sources":["../../../../src/core/configurators/slash/github-copilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAErD,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MA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AAC;gBACT,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC1C,CAAC;iBAAM,CAAC;gBACJ,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACnD,MAAM,QAAQ,GAAa,EAAE,CAAC;gBAC9B,IAAI,WAAW,EAAE,CAAC;oBACd,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;gBACtC,CAAC;gBACD,mCAAmC;gBACnC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAC5B,QAAQ,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,KAAK,KAAK,IAAI,KAAK,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC;gBAC7E,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;gBAC3C,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACnD,CAAC;YAED,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;QAED,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,QAAgB;QAC1C,IAAI,CAAC;YACD,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC1B,OAAO,IAAI,CAAC;QAChB,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ"}
@@ -1,2 +1,2 @@
1
- export declare const projectTemplate = "# Project Context\n\nThis file provides context about your project for the Prompter workflow.\n\n## Project Overview\n\n<!-- Describe your project here -->\n\n## Technology Stack\n\n<!-- List your preferred technologies -->\n\n## Conventions\n\n<!-- Document any coding conventions or preferences -->\n\n## Notes\n\n<!-- Any additional context that should influence prompt enhancement -->\n";
1
+ export declare const projectTemplate = "# Project Context\n\n## Purpose\n[Describe your project's purpose and goals]\n\n## Tech Stack\n- [List your primary technologies]\n- [e.g., TypeScript, React, Node.js]\n\n## Project Conventions\n\n### Code Style\n[Describe your code style preferences, formatting rules, and naming conventions]\n\n### Architecture Patterns\n[Document your architectural decisions and patterns]\n\n### Testing Strategy\n[Explain your testing approach and requirements]\n\n### Git Workflow\n[Describe your branching strategy and commit conventions]\n\n## Domain Context\n[Add domain-specific knowledge that AI assistants need to understand]\n\n## Important Constraints\n[List any technical, business, or regulatory constraints]\n\n## External Dependencies\n[Document key external services, APIs, or systems]\n";
2
2
  //# sourceMappingURL=project-template.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"project-template.d.ts","sourceRoot":"","sources":["../../../src/core/templates/project-template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,2YAmB3B,CAAC"}
1
+ {"version":3,"file":"project-template.d.ts","sourceRoot":"","sources":["../../../src/core/templates/project-template.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,2xBA+B3B,CAAC"}
@@ -1,21 +1,33 @@
1
1
  export const projectTemplate = `# Project Context
2
2
 
3
- This file provides context about your project for the Prompter workflow.
3
+ ## Purpose
4
+ [Describe your project's purpose and goals]
4
5
 
5
- ## Project Overview
6
+ ## Tech Stack
7
+ - [List your primary technologies]
8
+ - [e.g., TypeScript, React, Node.js]
6
9
 
7
- <!-- Describe your project here -->
10
+ ## Project Conventions
8
11
 
9
- ## Technology Stack
12
+ ### Code Style
13
+ [Describe your code style preferences, formatting rules, and naming conventions]
10
14
 
11
- <!-- List your preferred technologies -->
15
+ ### Architecture Patterns
16
+ [Document your architectural decisions and patterns]
12
17
 
13
- ## Conventions
18
+ ### Testing Strategy
19
+ [Explain your testing approach and requirements]
14
20
 
15
- <!-- Document any coding conventions or preferences -->
21
+ ### Git Workflow
22
+ [Describe your branching strategy and commit conventions]
16
23
 
17
- ## Notes
24
+ ## Domain Context
25
+ [Add domain-specific knowledge that AI assistants need to understand]
18
26
 
19
- <!-- Any additional context that should influence prompt enhancement -->
27
+ ## Important Constraints
28
+ [List any technical, business, or regulatory constraints]
29
+
30
+ ## External Dependencies
31
+ [Document key external services, APIs, or systems]
20
32
  `;
21
33
  //# sourceMappingURL=project-template.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"project-template.js","sourceRoot":"","sources":["../../../src/core/templates/project-template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;CAmB9B,CAAC"}
1
+ {"version":3,"file":"project-template.js","sourceRoot":"","sources":["../../../src/core/templates/project-template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B9B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedesfr/prompter",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Enhance prompts directly in your AI coding workflow",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/cli/index.ts CHANGED
@@ -9,7 +9,7 @@ const program = new Command();
9
9
  program
10
10
  .name('prompter')
11
11
  .description('Enhance prompts directly in your AI coding workflow')
12
- .version('0.3.2');
12
+ .version('0.3.3');
13
13
 
14
14
  program
15
15
  .command('init')
@@ -1,12 +1,15 @@
1
1
  import { SlashCommandConfigurator } from './base.js';
2
2
  import { SlashCommandId } from '../../templates/index.js';
3
+ import { promises as fs } from 'fs';
4
+ import path from 'path';
5
+ import { PROMPTER_MARKERS } from '../../config.js';
3
6
 
4
7
  const FILE_PATHS: Record<SlashCommandId, string> = {
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'
8
+ enhance: '.github/prompts/prompter-enhance.prompt.md',
9
+ 'prd-generator': '.github/prompts/prd-generator.prompt.md',
10
+ 'epic-single': '.github/prompts/epic-single.prompt.md',
11
+ 'story-single': '.github/prompts/story-single.prompt.md',
12
+ 'qa-test-scenario': '.github/prompts/qa-test-scenario.prompt.md'
10
13
  };
11
14
 
12
15
  const DESCRIPTIONS: Record<SlashCommandId, string> = {
@@ -29,4 +32,45 @@ export class GithubCopilotConfigurator extends SlashCommandConfigurator {
29
32
  const description = DESCRIPTIONS[id];
30
33
  return `---\ndescription: ${description}\n---`;
31
34
  }
35
+
36
+ async generateAll(projectPath: string): Promise<string[]> {
37
+ const createdOrUpdated: string[] = [];
38
+
39
+ for (const target of this.getTargets()) {
40
+ const body = this.getBody(target.id);
41
+ const filePath = path.join(projectPath, target.path);
42
+
43
+ // Ensure directory exists
44
+ await fs.mkdir(path.dirname(filePath), { recursive: true });
45
+
46
+ const exists = await this.checkFileExists(filePath);
47
+ if (exists) {
48
+ await this.updateBody(filePath, body);
49
+ } else {
50
+ const frontmatter = this.getFrontmatter(target.id);
51
+ const sections: string[] = [];
52
+ if (frontmatter) {
53
+ sections.push(frontmatter.trim());
54
+ }
55
+ // Add $ARGUMENTS after frontmatter
56
+ sections.push('$ARGUMENTS');
57
+ sections.push(`${PROMPTER_MARKERS.start}\n${body}\n${PROMPTER_MARKERS.end}`);
58
+ const content = sections.join('\n') + '\n';
59
+ await fs.writeFile(filePath, content, 'utf-8');
60
+ }
61
+
62
+ createdOrUpdated.push(target.path);
63
+ }
64
+
65
+ return createdOrUpdated;
66
+ }
67
+
68
+ private async checkFileExists(filePath: string): Promise<boolean> {
69
+ try {
70
+ await fs.access(filePath);
71
+ return true;
72
+ } catch {
73
+ return false;
74
+ }
75
+ }
32
76
  }
@@ -1,20 +1,32 @@
1
1
  export const projectTemplate = `# Project Context
2
2
 
3
- This file provides context about your project for the Prompter workflow.
3
+ ## Purpose
4
+ [Describe your project's purpose and goals]
4
5
 
5
- ## Project Overview
6
+ ## Tech Stack
7
+ - [List your primary technologies]
8
+ - [e.g., TypeScript, React, Node.js]
6
9
 
7
- <!-- Describe your project here -->
10
+ ## Project Conventions
8
11
 
9
- ## Technology Stack
12
+ ### Code Style
13
+ [Describe your code style preferences, formatting rules, and naming conventions]
10
14
 
11
- <!-- List your preferred technologies -->
15
+ ### Architecture Patterns
16
+ [Document your architectural decisions and patterns]
12
17
 
13
- ## Conventions
18
+ ### Testing Strategy
19
+ [Explain your testing approach and requirements]
14
20
 
15
- <!-- Document any coding conventions or preferences -->
21
+ ### Git Workflow
22
+ [Describe your branching strategy and commit conventions]
16
23
 
17
- ## Notes
24
+ ## Domain Context
25
+ [Add domain-specific knowledge that AI assistants need to understand]
18
26
 
19
- <!-- Any additional context that should influence prompt enhancement -->
27
+ ## Important Constraints
28
+ [List any technical, business, or regulatory constraints]
29
+
30
+ ## External Dependencies
31
+ [Document key external services, APIs, or systems]
20
32
  `;