@dedesfr/prompter 0.8.23 → 0.9.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 (100) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/dist/cli/index.js +1 -1
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/commands/init.d.ts +1 -7
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +32 -294
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/update.d.ts.map +1 -1
  9. package/dist/commands/update.js +17 -40
  10. package/dist/commands/update.js.map +1 -1
  11. package/dist/core/configurators/slash/antigravity.d.ts +2 -5
  12. package/dist/core/configurators/slash/antigravity.d.ts.map +1 -1
  13. package/dist/core/configurators/slash/antigravity.js +2 -57
  14. package/dist/core/configurators/slash/antigravity.js.map +1 -1
  15. package/dist/core/configurators/slash/base.d.ts +6 -18
  16. package/dist/core/configurators/slash/base.d.ts.map +1 -1
  17. package/dist/core/configurators/slash/base.js +8 -77
  18. package/dist/core/configurators/slash/base.js.map +1 -1
  19. package/dist/core/configurators/slash/claude.d.ts +2 -5
  20. package/dist/core/configurators/slash/claude.d.ts.map +1 -1
  21. package/dist/core/configurators/slash/claude.js +2 -57
  22. package/dist/core/configurators/slash/claude.js.map +1 -1
  23. package/dist/core/configurators/slash/codex.d.ts +2 -5
  24. package/dist/core/configurators/slash/codex.d.ts.map +1 -1
  25. package/dist/core/configurators/slash/codex.js +2 -57
  26. package/dist/core/configurators/slash/codex.js.map +1 -1
  27. package/dist/core/configurators/slash/droid.d.ts +2 -5
  28. package/dist/core/configurators/slash/droid.d.ts.map +1 -1
  29. package/dist/core/configurators/slash/droid.js +2 -32
  30. package/dist/core/configurators/slash/droid.js.map +1 -1
  31. package/dist/core/configurators/slash/forge.d.ts +2 -5
  32. package/dist/core/configurators/slash/forge.d.ts.map +1 -1
  33. package/dist/core/configurators/slash/forge.js +2 -32
  34. package/dist/core/configurators/slash/forge.js.map +1 -1
  35. package/dist/core/configurators/slash/github-copilot.d.ts +2 -7
  36. package/dist/core/configurators/slash/github-copilot.d.ts.map +1 -1
  37. package/dist/core/configurators/slash/github-copilot.js +2 -96
  38. package/dist/core/configurators/slash/github-copilot.js.map +1 -1
  39. package/dist/core/configurators/slash/index.d.ts +1 -1
  40. package/dist/core/configurators/slash/index.d.ts.map +1 -1
  41. package/dist/core/configurators/slash/index.js +1 -1
  42. package/dist/core/configurators/slash/index.js.map +1 -1
  43. package/dist/core/configurators/slash/kilocode.d.ts +2 -5
  44. package/dist/core/configurators/slash/kilocode.d.ts.map +1 -1
  45. package/dist/core/configurators/slash/kilocode.js +2 -57
  46. package/dist/core/configurators/slash/kilocode.js.map +1 -1
  47. package/dist/core/configurators/slash/opencode.d.ts +2 -5
  48. package/dist/core/configurators/slash/opencode.d.ts.map +1 -1
  49. package/dist/core/configurators/slash/opencode.js +2 -57
  50. package/dist/core/configurators/slash/opencode.js.map +1 -1
  51. package/dist/core/configurators/slash/registry.d.ts +4 -4
  52. package/dist/core/configurators/slash/registry.d.ts.map +1 -1
  53. package/dist/core/configurators/slash/registry.js.map +1 -1
  54. package/dist/core/templates/index.d.ts +0 -1
  55. package/dist/core/templates/index.d.ts.map +1 -1
  56. package/dist/core/templates/index.js +0 -1
  57. package/dist/core/templates/index.js.map +1 -1
  58. package/package.json +1 -1
  59. package/skills/ai-humanizer/SKILL.md +50 -0
  60. package/skills/api-contract-generator/SKILL.md +243 -0
  61. package/skills/apply/SKILL.md +23 -0
  62. package/skills/archive/SKILL.md +27 -0
  63. package/skills/design-system/SKILL.md +216 -0
  64. package/skills/document-explainer/SKILL.md +155 -0
  65. package/skills/enhance/SKILL.md +47 -0
  66. package/skills/epic-generator/SKILL.md +204 -0
  67. package/skills/epic-single/SKILL.md +63 -0
  68. package/skills/erd-generator/SKILL.md +138 -0
  69. package/skills/fsd-generator/SKILL.md +163 -0
  70. package/skills/prd-agent-generator/SKILL.md +132 -0
  71. package/skills/prd-generator/SKILL.md +211 -0
  72. package/skills/product-brief/SKILL.md +141 -0
  73. package/skills/proposal/SKILL.md +28 -0
  74. package/skills/qa-test-scenario/SKILL.md +149 -0
  75. package/skills/skill-creator/SKILL.md +173 -0
  76. package/skills/story-generator/SKILL.md +285 -0
  77. package/skills/story-single/SKILL.md +86 -0
  78. package/skills/tdd-generator/SKILL.md +300 -0
  79. package/skills/tdd-lite-generator/SKILL.md +230 -0
  80. package/skills/wireframe-generator/SKILL.md +227 -0
  81. package/src/cli/index.ts +1 -1
  82. package/src/commands/init.ts +32 -334
  83. package/src/commands/update.ts +20 -47
  84. package/src/core/configurators/slash/antigravity.ts +2 -62
  85. package/src/core/configurators/slash/base.ts +11 -105
  86. package/src/core/configurators/slash/claude.ts +2 -62
  87. package/src/core/configurators/slash/codex.ts +2 -62
  88. package/src/core/configurators/slash/droid.ts +2 -36
  89. package/src/core/configurators/slash/forge.ts +2 -36
  90. package/src/core/configurators/slash/github-copilot.ts +2 -106
  91. package/src/core/configurators/slash/index.ts +1 -1
  92. package/src/core/configurators/slash/kilocode.ts +2 -62
  93. package/src/core/configurators/slash/opencode.ts +2 -62
  94. package/src/core/configurators/slash/registry.ts +5 -5
  95. package/src/core/templates/index.ts +0 -1
  96. package/dist/core/templates/slash-command-templates.d.ts +0 -7
  97. package/dist/core/templates/slash-command-templates.d.ts.map +0 -1
  98. package/dist/core/templates/slash-command-templates.js +0 -1041
  99. package/dist/core/templates/slash-command-templates.js.map +0 -1
  100. package/src/core/templates/slash-command-templates.ts +0 -1068
@@ -1,98 +1,26 @@
1
1
  import { promises as fs } from 'fs';
2
2
  import path from 'path';
3
- import { SlashCommandId, TemplateManager } from '../../templates/index.js';
4
- import { PROMPTER_MARKERS } from '../../config.js';
5
3
  import { SkillMetadata } from '../../skill-discovery.js';
6
4
 
7
- export interface SlashCommandTarget {
8
- id: SlashCommandId;
9
- path: string;
10
- kind: 'slash';
11
- }
12
-
13
5
  export interface SkillTarget {
14
6
  name: string;
15
7
  path: string;
16
8
  kind: 'skill';
17
9
  }
18
10
 
19
- 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', 'apply', 'archive', 'design-system', 'erd-generator', 'fsd-generator', 'proposal', 'tdd-generator', 'tdd-lite-generator', 'wireframe-generator', 'document-explainer'];
20
-
21
- export abstract class SlashCommandConfigurator {
11
+ export abstract class ToolConfigurator {
22
12
  abstract readonly toolId: string;
23
13
  abstract readonly isAvailable: boolean;
24
14
 
25
- getTargets(filterIds?: SlashCommandId[]): SlashCommandTarget[] {
26
- // If filterIds is undefined, generate all commands
27
- // If filterIds is an empty array, generate nothing
28
- // If filterIds has items, generate only those
29
- const commandsToGenerate = filterIds === undefined
30
- ? ALL_COMMANDS
31
- : ALL_COMMANDS.filter(id => filterIds.includes(id));
32
-
33
- return commandsToGenerate.map((id) => ({
34
- id,
35
- path: this.getRelativePath(id),
36
- kind: 'slash'
37
- }));
38
- }
39
-
40
- async generateAll(projectPath: string, filterIds?: SlashCommandId[]): Promise<string[]> {
41
- const createdOrUpdated: string[] = [];
42
-
43
- for (const target of this.getTargets(filterIds)) {
44
- const body = this.getBody(target.id);
45
- const filePath = path.join(projectPath, target.path);
46
-
47
- // Ensure directory exists
48
- await fs.mkdir(path.dirname(filePath), { recursive: true });
49
-
50
- if (await this.fileExists(filePath)) {
51
- await this.updateBody(filePath, body);
52
- } else {
53
- const frontmatter = this.getFrontmatter(target.id);
54
- const sections: string[] = [];
55
- if (frontmatter) {
56
- sections.push(frontmatter.trim());
57
- }
58
- sections.push(`${PROMPTER_MARKERS.start}\n${body}\n${PROMPTER_MARKERS.end}`);
59
- const content = sections.join('\n') + '\n';
60
- await fs.writeFile(filePath, content, 'utf-8');
61
- }
62
-
63
- createdOrUpdated.push(target.path);
64
- }
65
-
66
- return createdOrUpdated;
67
- }
68
-
69
- async updateExisting(projectPath: string): Promise<string[]> {
70
- const updated: string[] = [];
71
-
72
- for (const target of this.getTargets()) {
73
- const filePath = path.join(projectPath, target.path);
74
- if (await this.fileExists(filePath)) {
75
- const body = this.getBody(target.id);
76
- await this.updateBody(filePath, body);
77
- updated.push(target.path);
78
- }
79
- }
80
-
81
- return updated;
82
- }
83
-
84
- protected abstract getRelativePath(id: SlashCommandId): string;
85
- protected abstract getFrontmatter(id: SlashCommandId): string | undefined;
86
-
87
15
  /**
88
- * Returns the relative directory path where the skill's full directory
89
- * will be placed inside the tool's config dir.
90
- * e.g. `.claude/skills/laravel-code-review`
16
+ * Returns the relative directory path where a skill directory is placed
17
+ * inside the tool's config dir. e.g. `.claude/skills/laravel-code-review`
91
18
  */
92
19
  protected abstract getSkillTargetDir(skillName: string): string;
93
20
 
94
- protected getBody(id: SlashCommandId): string {
95
- return TemplateManager.getSlashCommandBody(id).trim();
21
+ /** Returns the directory where all skills for this tool are placed, e.g. `.claude/skills` */
22
+ getSkillsRootDir(): string {
23
+ return path.dirname(this.getSkillTargetDir('__placeholder__'));
96
24
  }
97
25
 
98
26
  // --- Skill directory management ---
@@ -149,6 +77,11 @@ export abstract class SlashCommandConfigurator {
149
77
  return removed;
150
78
  }
151
79
 
80
+ async removeAllDeployedSkills(projectPath: string): Promise<void> {
81
+ const dir = path.join(projectPath, this.getSkillsRootDir());
82
+ await fs.rm(dir, { recursive: true, force: true });
83
+ }
84
+
152
85
  private async copyDir(src: string, dest: string): Promise<void> {
153
86
  await fs.mkdir(dest, { recursive: true });
154
87
  const entries = await fs.readdir(src, { withFileTypes: true });
@@ -173,31 +106,4 @@ export abstract class SlashCommandConfigurator {
173
106
  return false;
174
107
  }
175
108
  }
176
-
177
- // --- Shared helpers ---
178
-
179
- protected async updateBody(filePath: string, body: string): Promise<void> {
180
- const content = await fs.readFile(filePath, 'utf-8');
181
- const startIndex = content.indexOf(PROMPTER_MARKERS.start);
182
- const endIndex = content.indexOf(PROMPTER_MARKERS.end);
183
-
184
- if (startIndex === -1 || endIndex === -1 || endIndex <= startIndex) {
185
- throw new Error(`Missing Prompter markers in ${filePath}`);
186
- }
187
-
188
- const before = content.slice(0, startIndex + PROMPTER_MARKERS.start.length);
189
- const after = content.slice(endIndex);
190
- const updatedContent = `${before}\n${body}\n${after}`;
191
-
192
- await fs.writeFile(filePath, updatedContent, 'utf-8');
193
- }
194
-
195
- private async fileExists(filePath: string): Promise<boolean> {
196
- try {
197
- await fs.access(filePath);
198
- return true;
199
- } catch {
200
- return false;
201
- }
202
- }
203
109
  }
@@ -1,69 +1,9 @@
1
- import { SlashCommandConfigurator } from './base.js';
2
- import { SlashCommandId } from '../../templates/index.js';
1
+ import { ToolConfigurator } from './base.js';
3
2
 
4
- const FILE_PATHS: Record<SlashCommandId, string> = {
5
- enhance: '.claude/commands/prompter/enhance.md',
6
- 'prd-generator': '.claude/commands/prompter/prd-generator.md',
7
- 'prd-agent-generator': '.claude/commands/prompter/prd-agent-generator.md',
8
- 'product-brief': '.claude/commands/prompter/product-brief.md',
9
- 'epic-single': '.claude/commands/prompter/epic-single.md',
10
- 'epic-generator': '.claude/commands/prompter/epic-generator.md',
11
- 'story-single': '.claude/commands/prompter/story-single.md',
12
- 'story-generator': '.claude/commands/prompter/story-generator.md',
13
- 'qa-test-scenario': '.claude/commands/prompter/qa-test-scenario.md',
14
- 'skill-creator': '.claude/commands/prompter/skill-creator.md',
15
- 'ai-humanizer': '.claude/commands/prompter/ai-humanizer.md',
16
- 'api-contract-generator': '.claude/commands/prompter/api-contract-generator.md',
17
- 'apply': '.claude/commands/prompter/apply.md',
18
- 'archive': '.claude/commands/prompter/archive.md',
19
- 'design-system': '.claude/commands/prompter/design-system.md',
20
- 'erd-generator': '.claude/commands/prompter/erd-generator.md',
21
- 'fsd-generator': '.claude/commands/prompter/fsd-generator.md',
22
- 'proposal': '.claude/commands/prompter/proposal.md',
23
- 'tdd-generator': '.claude/commands/prompter/tdd-generator.md',
24
- 'tdd-lite-generator': '.claude/commands/prompter/tdd-lite-generator.md',
25
- 'wireframe-generator': '.claude/commands/prompter/wireframe-generator.md',
26
- 'document-explainer': '.claude/commands/prompter/document-explainer.md'
27
- };
28
-
29
- const DESCRIPTIONS: Record<SlashCommandId, string> = {
30
- enhance: 'Enhance a rough prompt into a professional specification',
31
- 'prd-generator': 'Generate a comprehensive Product Requirements Document (PRD)',
32
- 'prd-agent-generator': 'Generate a PRD with autonomous assumptions (non-interactive mode)',
33
- 'product-brief': 'Generate an executive-level product brief (1-page summary)',
34
- 'epic-single': 'Generate a single well-defined Jira Epic',
35
- 'epic-generator': 'Generate a comprehensive set of EPICs from documentation',
36
- 'story-single': 'Generate a single Jira User Story from requirements',
37
- 'story-generator': 'Generate comprehensive user stories from EPICs and FSD',
38
- 'qa-test-scenario': 'Generate focused QA test scenarios from PRD',
39
- 'skill-creator': 'Create a modular skill package that extends AI agent capabilities',
40
- 'ai-humanizer': 'Humanize and proofread AI-generated content for natural, publication-ready output',
41
- 'api-contract-generator': 'Generate OpenAPI specification from FSD and ERD',
42
- 'apply': 'Implement and apply an approved change proposal',
43
- 'archive': 'Archive a completed change and update specs',
44
- 'design-system': 'Generate comprehensive design system documentation for components and tokens',
45
- 'erd-generator': 'Generate Entity Relationship Diagram from FSD',
46
- 'fsd-generator': 'Generate Functional Specification Document from PRD',
47
- 'proposal': 'Create a new change proposal with spec deltas',
48
- 'tdd-generator': 'Generate comprehensive Technical Design Document',
49
- 'tdd-lite-generator': 'Generate lean Technical Design Document (TDD-Lite)',
50
- 'wireframe-generator': 'Generate UI/UX wireframes from technical specs',
51
- 'document-explainer': 'Analyze and explain complex documents into clear, actionable insights'
52
- };
53
-
54
- export class ClaudeConfigurator extends SlashCommandConfigurator {
3
+ export class ClaudeConfigurator extends ToolConfigurator {
55
4
  readonly toolId = 'claude';
56
5
  readonly isAvailable = true;
57
6
 
58
- protected getRelativePath(id: SlashCommandId): string {
59
- return FILE_PATHS[id];
60
- }
61
-
62
- protected getFrontmatter(id: SlashCommandId): string | undefined {
63
- // Claude Code uses the filename as the command name
64
- return undefined;
65
- }
66
-
67
7
  protected getSkillTargetDir(skillName: string): string {
68
8
  return `.claude/skills/${skillName}`;
69
9
  }
@@ -1,69 +1,9 @@
1
- import { SlashCommandConfigurator } from './base.js';
2
- import { SlashCommandId } from '../../templates/index.js';
1
+ import { ToolConfigurator } from './base.js';
3
2
 
4
- const FILE_PATHS: Record<SlashCommandId, string> = {
5
- enhance: '.codex/prompts/prompter-enhance.md',
6
- 'prd-generator': '.codex/prompts/prd-generator.md',
7
- 'prd-agent-generator': '.codex/prompts/prd-agent-generator.md',
8
- 'product-brief': '.codex/prompts/product-brief.md',
9
- 'epic-single': '.codex/prompts/epic-single.md',
10
- 'epic-generator': '.codex/prompts/epic-generator.md',
11
- 'story-single': '.codex/prompts/story-single.md',
12
- 'story-generator': '.codex/prompts/story-generator.md',
13
- 'qa-test-scenario': '.codex/prompts/qa-test-scenario.md',
14
- 'skill-creator': '.codex/prompts/skill-creator.md',
15
- 'ai-humanizer': '.codex/prompts/ai-humanizer.md',
16
- 'api-contract-generator': '.codex/prompts/api-contract-generator.md',
17
- 'apply': '.codex/prompts/apply.md',
18
- 'archive': '.codex/prompts/archive.md',
19
- 'design-system': '.codex/prompts/design-system.md',
20
- 'erd-generator': '.codex/prompts/erd-generator.md',
21
- 'fsd-generator': '.codex/prompts/fsd-generator.md',
22
- 'proposal': '.codex/prompts/proposal.md',
23
- 'tdd-generator': '.codex/prompts/tdd-generator.md',
24
- 'tdd-lite-generator': '.codex/prompts/tdd-lite-generator.md',
25
- 'wireframe-generator': '.codex/prompts/wireframe-generator.md',
26
- 'document-explainer': '.codex/prompts/document-explainer.md'
27
- };
28
-
29
- const DESCRIPTIONS: Record<SlashCommandId, string> = {
30
- enhance: 'Enhance a rough prompt into a professional specification',
31
- 'prd-generator': 'Generate a comprehensive Product Requirements Document (PRD)',
32
- 'prd-agent-generator': 'Generate a PRD with autonomous assumptions (non-interactive mode)',
33
- 'product-brief': 'Generate an executive-level product brief (1-page summary)',
34
- 'epic-single': 'Generate a single well-defined Jira Epic',
35
- 'epic-generator': 'Generate a comprehensive set of EPICs from documentation',
36
- 'story-single': 'Generate a single Jira User Story from requirements',
37
- 'story-generator': 'Generate comprehensive user stories from EPICs and FSD',
38
- 'qa-test-scenario': 'Generate focused QA test scenarios from PRD',
39
- 'skill-creator': 'Create a modular skill package that extends AI agent capabilities',
40
- 'ai-humanizer': 'Humanize and proofread AI-generated content for natural, publication-ready output',
41
- 'api-contract-generator': 'Generate OpenAPI specification from FSD and ERD',
42
- 'apply': 'Implement and apply an approved change proposal',
43
- 'archive': 'Archive a completed change and update specs',
44
- 'design-system': 'Generate comprehensive design system documentation for components and tokens',
45
- 'erd-generator': 'Generate Entity Relationship Diagram from FSD',
46
- 'fsd-generator': 'Generate Functional Specification Document from PRD',
47
- 'proposal': 'Create a new change proposal with spec deltas',
48
- 'tdd-generator': 'Generate comprehensive Technical Design Document',
49
- 'tdd-lite-generator': 'Generate lean Technical Design Document (TDD-Lite)',
50
- 'wireframe-generator': 'Generate UI/UX wireframes from technical specs',
51
- 'document-explainer': 'Analyze and explain complex documents into clear, actionable insights'
52
- };
53
-
54
- export class CodexConfigurator extends SlashCommandConfigurator {
3
+ export class CodexConfigurator extends ToolConfigurator {
55
4
  readonly toolId = 'codex';
56
5
  readonly isAvailable = true;
57
6
 
58
- protected getRelativePath(id: SlashCommandId): string {
59
- return FILE_PATHS[id];
60
- }
61
-
62
- protected getFrontmatter(id: SlashCommandId): string | undefined {
63
- const description = DESCRIPTIONS[id];
64
- return `---\ndescription: ${description}\n---`;
65
- }
66
-
67
7
  protected getSkillTargetDir(skillName: string): string {
68
8
  return `.codex/skills/${skillName}`;
69
9
  }
@@ -1,43 +1,9 @@
1
- import { SlashCommandConfigurator } from './base.js';
2
- import { SlashCommandId } from '../../templates/index.js';
1
+ import { ToolConfigurator } from './base.js';
3
2
 
4
- const FILE_PATHS: Record<SlashCommandId, string> = {
5
- enhance: '.factory/commands/prompter/enhance.md',
6
- 'prd-generator': '.factory/commands/prompter/prd-generator.md',
7
- 'prd-agent-generator': '.factory/commands/prompter/prd-agent-generator.md',
8
- 'product-brief': '.factory/commands/prompter/product-brief.md',
9
- 'epic-single': '.factory/commands/prompter/epic-single.md',
10
- 'epic-generator': '.factory/commands/prompter/epic-generator.md',
11
- 'story-single': '.factory/commands/prompter/story-single.md',
12
- 'story-generator': '.factory/commands/prompter/story-generator.md',
13
- 'qa-test-scenario': '.factory/commands/prompter/qa-test-scenario.md',
14
- 'skill-creator': '.factory/commands/prompter/skill-creator.md',
15
- 'ai-humanizer': '.factory/commands/prompter/ai-humanizer.md',
16
- 'api-contract-generator': '.factory/commands/prompter/api-contract-generator.md',
17
- 'apply': '.factory/commands/prompter/apply.md',
18
- 'archive': '.factory/commands/prompter/archive.md',
19
- 'design-system': '.factory/commands/prompter/design-system.md',
20
- 'erd-generator': '.factory/commands/prompter/erd-generator.md',
21
- 'fsd-generator': '.factory/commands/prompter/fsd-generator.md',
22
- 'proposal': '.factory/commands/prompter/proposal.md',
23
- 'tdd-generator': '.factory/commands/prompter/tdd-generator.md',
24
- 'tdd-lite-generator': '.factory/commands/prompter/tdd-lite-generator.md',
25
- 'wireframe-generator': '.factory/commands/prompter/wireframe-generator.md',
26
- 'document-explainer': '.factory/commands/prompter/document-explainer.md'
27
- };
28
-
29
- export class DroidConfigurator extends SlashCommandConfigurator {
3
+ export class DroidConfigurator extends ToolConfigurator {
30
4
  readonly toolId = 'droid';
31
5
  readonly isAvailable = true;
32
6
 
33
- protected getRelativePath(id: SlashCommandId): string {
34
- return FILE_PATHS[id];
35
- }
36
-
37
- protected getFrontmatter(id: SlashCommandId): string | undefined {
38
- return undefined;
39
- }
40
-
41
7
  protected getSkillTargetDir(skillName: string): string {
42
8
  return `.factory/skills/${skillName}`;
43
9
  }
@@ -1,43 +1,9 @@
1
- import { SlashCommandConfigurator } from './base.js';
2
- import { SlashCommandId } from '../../templates/index.js';
1
+ import { ToolConfigurator } from './base.js';
3
2
 
4
- const FILE_PATHS: Record<SlashCommandId, string> = {
5
- enhance: '.forge/commands/prompter/enhance.md',
6
- 'prd-generator': '.forge/commands/prompter/prd-generator.md',
7
- 'prd-agent-generator': '.forge/commands/prompter/prd-agent-generator.md',
8
- 'product-brief': '.forge/commands/prompter/product-brief.md',
9
- 'epic-single': '.forge/commands/prompter/epic-single.md',
10
- 'epic-generator': '.forge/commands/prompter/epic-generator.md',
11
- 'story-single': '.forge/commands/prompter/story-single.md',
12
- 'story-generator': '.forge/commands/prompter/story-generator.md',
13
- 'qa-test-scenario': '.forge/commands/prompter/qa-test-scenario.md',
14
- 'skill-creator': '.forge/commands/prompter/skill-creator.md',
15
- 'ai-humanizer': '.forge/commands/prompter/ai-humanizer.md',
16
- 'api-contract-generator': '.forge/commands/prompter/api-contract-generator.md',
17
- 'apply': '.forge/commands/prompter/apply.md',
18
- 'archive': '.forge/commands/prompter/archive.md',
19
- 'design-system': '.forge/commands/prompter/design-system.md',
20
- 'erd-generator': '.forge/commands/prompter/erd-generator.md',
21
- 'fsd-generator': '.forge/commands/prompter/fsd-generator.md',
22
- 'proposal': '.forge/commands/prompter/proposal.md',
23
- 'tdd-generator': '.forge/commands/prompter/tdd-generator.md',
24
- 'tdd-lite-generator': '.forge/commands/prompter/tdd-lite-generator.md',
25
- 'wireframe-generator': '.forge/commands/prompter/wireframe-generator.md',
26
- 'document-explainer': '.forge/commands/prompter/document-explainer.md'
27
- };
28
-
29
- export class ForgeConfigurator extends SlashCommandConfigurator {
3
+ export class ForgeConfigurator extends ToolConfigurator {
30
4
  readonly toolId = 'forge';
31
5
  readonly isAvailable = true;
32
6
 
33
- protected getRelativePath(id: SlashCommandId): string {
34
- return FILE_PATHS[id];
35
- }
36
-
37
- protected getFrontmatter(id: SlashCommandId): string | undefined {
38
- return undefined;
39
- }
40
-
41
7
  protected getSkillTargetDir(skillName: string): string {
42
8
  return `.forge/skills/${skillName}`;
43
9
  }
@@ -1,114 +1,10 @@
1
- import { SlashCommandConfigurator } from './base.js';
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';
1
+ import { ToolConfigurator } from './base.js';
6
2
 
7
- const FILE_PATHS: Record<SlashCommandId, string> = {
8
- enhance: '.github/prompts/prompter-enhance.prompt.md',
9
- 'prd-generator': '.github/prompts/prd-generator.prompt.md',
10
- 'prd-agent-generator': '.github/prompts/prd-agent-generator.prompt.md',
11
- 'product-brief': '.github/prompts/product-brief.prompt.md',
12
- 'epic-single': '.github/prompts/epic-single.prompt.md',
13
- 'epic-generator': '.github/prompts/epic-generator.prompt.md',
14
- 'story-single': '.github/prompts/story-single.prompt.md',
15
- 'story-generator': '.github/prompts/story-generator.prompt.md',
16
- 'qa-test-scenario': '.github/prompts/qa-test-scenario.prompt.md',
17
- 'skill-creator': '.github/prompts/skill-creator.prompt.md',
18
- 'ai-humanizer': '.github/prompts/ai-humanizer.prompt.md',
19
- 'api-contract-generator': '.github/prompts/api-contract-generator.prompt.md',
20
- 'apply': '.github/prompts/apply.prompt.md',
21
- 'archive': '.github/prompts/archive.prompt.md',
22
- 'design-system': '.github/prompts/design-system.prompt.md',
23
- 'erd-generator': '.github/prompts/erd-generator.prompt.md',
24
- 'fsd-generator': '.github/prompts/fsd-generator.prompt.md',
25
- 'proposal': '.github/prompts/proposal.prompt.md',
26
- 'tdd-generator': '.github/prompts/tdd-generator.prompt.md',
27
- 'tdd-lite-generator': '.github/prompts/tdd-lite-generator.prompt.md',
28
- 'wireframe-generator': '.github/prompts/wireframe-generator.prompt.md',
29
- 'document-explainer': '.github/prompts/document-explainer.prompt.md'
30
- };
31
-
32
- const DESCRIPTIONS: Record<SlashCommandId, string> = {
33
- enhance: 'Enhance a rough prompt into a professional specification',
34
- 'prd-generator': 'Generate a comprehensive Product Requirements Document (PRD)',
35
- 'prd-agent-generator': 'Generate a PRD with autonomous assumptions (non-interactive mode)',
36
- 'product-brief': 'Generate an executive-level product brief (1-page summary)',
37
- 'epic-single': 'Generate a single well-defined Jira Epic',
38
- 'epic-generator': 'Generate a comprehensive set of EPICs from documentation',
39
- 'story-single': 'Generate a single Jira User Story from requirements',
40
- 'story-generator': 'Generate comprehensive user stories from EPICs and FSD',
41
- 'qa-test-scenario': 'Generate focused QA test scenarios from PRD',
42
- 'skill-creator': 'Create a modular skill package that extends AI agent capabilities',
43
- 'ai-humanizer': 'Humanize and proofread AI-generated content for natural, publication-ready output',
44
- 'api-contract-generator': 'Generate OpenAPI specification from FSD and ERD',
45
- 'apply': 'Implement and apply an approved change proposal',
46
- 'archive': 'Archive a completed change and update specs',
47
- 'design-system': 'Generate comprehensive design system documentation for components and tokens',
48
- 'erd-generator': 'Generate Entity Relationship Diagram from FSD',
49
- 'fsd-generator': 'Generate Functional Specification Document from PRD',
50
- 'proposal': 'Create a new change proposal with spec deltas',
51
- 'tdd-generator': 'Generate comprehensive Technical Design Document',
52
- 'tdd-lite-generator': 'Generate lean Technical Design Document (TDD-Lite)',
53
- 'wireframe-generator': 'Generate UI/UX wireframes from technical specs',
54
- 'document-explainer': 'Analyze and explain complex documents into clear, actionable insights'
55
- };
56
-
57
- export class GithubCopilotConfigurator extends SlashCommandConfigurator {
3
+ export class GithubCopilotConfigurator extends ToolConfigurator {
58
4
  readonly toolId = 'github-copilot';
59
5
  readonly isAvailable = true;
60
6
 
61
- protected getRelativePath(id: SlashCommandId): string {
62
- return FILE_PATHS[id];
63
- }
64
-
65
- protected getFrontmatter(id: SlashCommandId): string | undefined {
66
- const description = DESCRIPTIONS[id];
67
- return `---\ndescription: ${description}\n---`;
68
- }
69
-
70
- async generateAll(projectPath: string, filterIds?: SlashCommandId[]): Promise<string[]> {
71
- const createdOrUpdated: string[] = [];
72
-
73
- for (const target of this.getTargets(filterIds)) {
74
- const body = this.getBody(target.id);
75
- const filePath = path.join(projectPath, target.path);
76
-
77
- // Ensure directory exists
78
- await fs.mkdir(path.dirname(filePath), { recursive: true });
79
-
80
- const exists = await this.checkFileExists(filePath);
81
- if (exists) {
82
- await this.updateBody(filePath, body);
83
- } else {
84
- const frontmatter = this.getFrontmatter(target.id);
85
- const sections: string[] = [];
86
- if (frontmatter) {
87
- sections.push(frontmatter.trim());
88
- }
89
- // Add $ARGUMENTS after frontmatter
90
- sections.push('$ARGUMENTS');
91
- sections.push(`${PROMPTER_MARKERS.start}\n${body}\n${PROMPTER_MARKERS.end}`);
92
- const content = sections.join('\n') + '\n';
93
- await fs.writeFile(filePath, content, 'utf-8');
94
- }
95
-
96
- createdOrUpdated.push(target.path);
97
- }
98
-
99
- return createdOrUpdated;
100
- }
101
-
102
7
  protected getSkillTargetDir(skillName: string): string {
103
8
  return `.github/skills/${skillName}`;
104
9
  }
105
-
106
- private async checkFileExists(filePath: string): Promise<boolean> {
107
- try {
108
- await fs.access(filePath);
109
- return true;
110
- } catch {
111
- return false;
112
- }
113
- }
114
10
  }
@@ -1,4 +1,4 @@
1
- export { SlashCommandConfigurator } from './base.js';
1
+ export { ToolConfigurator } from './base.js';
2
2
  export { ConfiguratorRegistry, registry } from './registry.js';
3
3
  export { AntigravityConfigurator } from './antigravity.js';
4
4
  export { ClaudeConfigurator } from './claude.js';
@@ -1,69 +1,9 @@
1
- import { SlashCommandConfigurator } from './base.js';
2
- import { SlashCommandId } from '../../templates/index.js';
1
+ import { ToolConfigurator } from './base.js';
3
2
 
4
- const FILE_PATHS: Record<SlashCommandId, string> = {
5
- enhance: '.kilocode/workflows/prompter-enhance.md',
6
- 'prd-generator': '.kilocode/workflows/prd-generator.md',
7
- 'prd-agent-generator': '.kilocode/workflows/prd-agent-generator.md',
8
- 'product-brief': '.kilocode/workflows/product-brief.md',
9
- 'epic-single': '.kilocode/workflows/epic-single.md',
10
- 'epic-generator': '.kilocode/workflows/epic-generator.md',
11
- 'story-single': '.kilocode/workflows/story-single.md',
12
- 'story-generator': '.kilocode/workflows/story-generator.md',
13
- 'qa-test-scenario': '.kilocode/workflows/qa-test-scenario.md',
14
- 'skill-creator': '.kilocode/workflows/skill-creator.md',
15
- 'ai-humanizer': '.kilocode/workflows/ai-humanizer.md',
16
- 'api-contract-generator': '.kilocode/workflows/api-contract-generator.md',
17
- 'apply': '.kilocode/workflows/apply.md',
18
- 'archive': '.kilocode/workflows/archive.md',
19
- 'design-system': '.kilocode/workflows/design-system.md',
20
- 'erd-generator': '.kilocode/workflows/erd-generator.md',
21
- 'fsd-generator': '.kilocode/workflows/fsd-generator.md',
22
- 'proposal': '.kilocode/workflows/proposal.md',
23
- 'tdd-generator': '.kilocode/workflows/tdd-generator.md',
24
- 'tdd-lite-generator': '.kilocode/workflows/tdd-lite-generator.md',
25
- 'wireframe-generator': '.kilocode/workflows/wireframe-generator.md',
26
- 'document-explainer': '.kilocode/workflows/document-explainer.md'
27
- };
28
-
29
- const DESCRIPTIONS: Record<SlashCommandId, string> = {
30
- enhance: 'Enhance a rough prompt into a professional specification',
31
- 'prd-generator': 'Generate a comprehensive Product Requirements Document (PRD)',
32
- 'prd-agent-generator': 'Generate a PRD with autonomous assumptions (non-interactive mode)',
33
- 'product-brief': 'Generate an executive-level product brief (1-page summary)',
34
- 'epic-single': 'Generate a single well-defined Jira Epic',
35
- 'epic-generator': 'Generate a comprehensive set of EPICs from documentation',
36
- 'story-single': 'Generate a single Jira User Story from requirements',
37
- 'story-generator': 'Generate comprehensive user stories from EPICs and FSD',
38
- 'qa-test-scenario': 'Generate focused QA test scenarios from PRD',
39
- 'skill-creator': 'Create a modular skill package that extends AI agent capabilities',
40
- 'ai-humanizer': 'Humanize and proofread AI-generated content for natural, publication-ready output',
41
- 'api-contract-generator': 'Generate OpenAPI specification from FSD and ERD',
42
- 'apply': 'Implement and apply an approved change proposal',
43
- 'archive': 'Archive a completed change and update specs',
44
- 'design-system': 'Generate comprehensive design system documentation for components and tokens',
45
- 'erd-generator': 'Generate Entity Relationship Diagram from FSD',
46
- 'fsd-generator': 'Generate Functional Specification Document from PRD',
47
- 'proposal': 'Create a new change proposal with spec deltas',
48
- 'tdd-generator': 'Generate comprehensive Technical Design Document',
49
- 'tdd-lite-generator': 'Generate lean Technical Design Document (TDD-Lite)',
50
- 'wireframe-generator': 'Generate UI/UX wireframes from technical specs',
51
- 'document-explainer': 'Analyze and explain complex documents into clear, actionable insights'
52
- };
53
-
54
- export class KiloCodeConfigurator extends SlashCommandConfigurator {
3
+ export class KiloCodeConfigurator extends ToolConfigurator {
55
4
  readonly toolId = 'kilocode';
56
5
  readonly isAvailable = true;
57
6
 
58
- protected getRelativePath(id: SlashCommandId): string {
59
- return FILE_PATHS[id];
60
- }
61
-
62
- protected getFrontmatter(id: SlashCommandId): string | undefined {
63
- const description = DESCRIPTIONS[id];
64
- return `---\ndescription: ${description}\n---`;
65
- }
66
-
67
7
  protected getSkillTargetDir(skillName: string): string {
68
8
  return `.kilocode/skills/${skillName}`;
69
9
  }