clavix 4.11.2 → 5.0.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 (162) hide show
  1. package/README.md +72 -60
  2. package/dist/cli/commands/update.js +9 -10
  3. package/dist/templates/agents/agents.md +14 -8
  4. package/dist/templates/agents/copilot-instructions.md +1 -1
  5. package/dist/templates/instructions/core/verification.md +2 -2
  6. package/dist/templates/slash-commands/_canonical/archive.md +83 -121
  7. package/dist/templates/slash-commands/_canonical/execute.md +32 -42
  8. package/dist/templates/slash-commands/_canonical/implement.md +32 -44
  9. package/dist/templates/slash-commands/_canonical/improve.md +14 -53
  10. package/dist/templates/slash-commands/_canonical/start.md +1 -1
  11. package/dist/templates/slash-commands/_canonical/summarize.md +8 -8
  12. package/dist/templates/slash-commands/_components/agent-protocols/cli-reference.md +84 -180
  13. package/dist/templates/slash-commands/_components/agent-protocols/error-handling.md +2 -2
  14. package/dist/templates/slash-commands/_components/agent-protocols/file-formats.md +41 -59
  15. package/dist/templates/slash-commands/_components/agent-protocols/state-assertion.md +1 -1
  16. package/dist/templates/slash-commands/_components/references/intent-types.md +1 -1
  17. package/dist/templates/slash-commands/_components/sections/file-saving-protocol.md +20 -27
  18. package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +29 -46
  19. package/dist/templates/slash-commands/_components/troubleshooting/file-not-saved.md +4 -5
  20. package/dist/types/config.d.ts +57 -0
  21. package/dist/utils/legacy-command-cleanup.js +31 -4
  22. package/package.json +5 -4
  23. package/dist/cli/commands/analyze.d.ts +0 -17
  24. package/dist/cli/commands/analyze.js +0 -133
  25. package/dist/cli/commands/archive.d.ts +0 -36
  26. package/dist/cli/commands/archive.js +0 -266
  27. package/dist/cli/commands/deep.d.ts +0 -17
  28. package/dist/cli/commands/deep.js +0 -170
  29. package/dist/cli/commands/execute.d.ts +0 -15
  30. package/dist/cli/commands/execute.js +0 -168
  31. package/dist/cli/commands/fast.d.ts +0 -18
  32. package/dist/cli/commands/fast.js +0 -219
  33. package/dist/cli/commands/implement.d.ts +0 -24
  34. package/dist/cli/commands/implement.js +0 -289
  35. package/dist/cli/commands/improve.d.ts +0 -32
  36. package/dist/cli/commands/improve.js +0 -250
  37. package/dist/cli/commands/list.d.ts +0 -17
  38. package/dist/cli/commands/list.js +0 -217
  39. package/dist/cli/commands/plan.d.ts +0 -21
  40. package/dist/cli/commands/plan.js +0 -297
  41. package/dist/cli/commands/prd.d.ts +0 -24
  42. package/dist/cli/commands/prd.js +0 -321
  43. package/dist/cli/commands/prompts/clear.d.ts +0 -16
  44. package/dist/cli/commands/prompts/clear.js +0 -222
  45. package/dist/cli/commands/prompts/list.d.ts +0 -8
  46. package/dist/cli/commands/prompts/list.js +0 -88
  47. package/dist/cli/commands/show.d.ts +0 -21
  48. package/dist/cli/commands/show.js +0 -191
  49. package/dist/cli/commands/start.d.ts +0 -40
  50. package/dist/cli/commands/start.js +0 -210
  51. package/dist/cli/commands/summarize.d.ts +0 -17
  52. package/dist/cli/commands/summarize.js +0 -196
  53. package/dist/cli/commands/task-complete.d.ts +0 -27
  54. package/dist/cli/commands/task-complete.js +0 -269
  55. package/dist/cli/commands/verify.d.ts +0 -28
  56. package/dist/cli/commands/verify.js +0 -349
  57. package/dist/core/archive-manager.d.ts +0 -100
  58. package/dist/core/archive-manager.js +0 -302
  59. package/dist/core/basic-checklist-generator.d.ts +0 -35
  60. package/dist/core/basic-checklist-generator.js +0 -344
  61. package/dist/core/checklist-parser.d.ts +0 -48
  62. package/dist/core/checklist-parser.js +0 -238
  63. package/dist/core/config-manager.d.ts +0 -149
  64. package/dist/core/config-manager.js +0 -230
  65. package/dist/core/conversation-analyzer.d.ts +0 -86
  66. package/dist/core/conversation-analyzer.js +0 -387
  67. package/dist/core/conversation-quality-tracker.d.ts +0 -81
  68. package/dist/core/conversation-quality-tracker.js +0 -195
  69. package/dist/core/git-manager.d.ts +0 -126
  70. package/dist/core/git-manager.js +0 -282
  71. package/dist/core/intelligence/confidence-calculator.d.ts +0 -93
  72. package/dist/core/intelligence/confidence-calculator.js +0 -124
  73. package/dist/core/intelligence/index.d.ts +0 -11
  74. package/dist/core/intelligence/index.js +0 -15
  75. package/dist/core/intelligence/intent-detector.d.ts +0 -54
  76. package/dist/core/intelligence/intent-detector.js +0 -723
  77. package/dist/core/intelligence/pattern-library.d.ts +0 -104
  78. package/dist/core/intelligence/pattern-library.js +0 -339
  79. package/dist/core/intelligence/patterns/actionability-enhancer.d.ts +0 -27
  80. package/dist/core/intelligence/patterns/actionability-enhancer.js +0 -192
  81. package/dist/core/intelligence/patterns/alternative-phrasing-generator.d.ts +0 -29
  82. package/dist/core/intelligence/patterns/alternative-phrasing-generator.js +0 -239
  83. package/dist/core/intelligence/patterns/ambiguity-detector.d.ts +0 -22
  84. package/dist/core/intelligence/patterns/ambiguity-detector.js +0 -196
  85. package/dist/core/intelligence/patterns/assumption-explicitizer.d.ts +0 -30
  86. package/dist/core/intelligence/patterns/assumption-explicitizer.js +0 -296
  87. package/dist/core/intelligence/patterns/base-pattern.d.ts +0 -192
  88. package/dist/core/intelligence/patterns/base-pattern.js +0 -103
  89. package/dist/core/intelligence/patterns/completeness-validator.d.ts +0 -27
  90. package/dist/core/intelligence/patterns/completeness-validator.js +0 -221
  91. package/dist/core/intelligence/patterns/conciseness-filter.d.ts +0 -20
  92. package/dist/core/intelligence/patterns/conciseness-filter.js +0 -92
  93. package/dist/core/intelligence/patterns/context-precision.d.ts +0 -32
  94. package/dist/core/intelligence/patterns/context-precision.js +0 -389
  95. package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +0 -30
  96. package/dist/core/intelligence/patterns/conversation-summarizer.js +0 -277
  97. package/dist/core/intelligence/patterns/dependency-identifier.d.ts +0 -23
  98. package/dist/core/intelligence/patterns/dependency-identifier.js +0 -166
  99. package/dist/core/intelligence/patterns/domain-context-enricher.d.ts +0 -21
  100. package/dist/core/intelligence/patterns/domain-context-enricher.js +0 -198
  101. package/dist/core/intelligence/patterns/edge-case-identifier.d.ts +0 -30
  102. package/dist/core/intelligence/patterns/edge-case-identifier.js +0 -269
  103. package/dist/core/intelligence/patterns/error-tolerance-enhancer.d.ts +0 -22
  104. package/dist/core/intelligence/patterns/error-tolerance-enhancer.js +0 -179
  105. package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +0 -24
  106. package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +0 -259
  107. package/dist/core/intelligence/patterns/objective-clarifier.d.ts +0 -22
  108. package/dist/core/intelligence/patterns/objective-clarifier.js +0 -126
  109. package/dist/core/intelligence/patterns/output-format-enforcer.d.ts +0 -22
  110. package/dist/core/intelligence/patterns/output-format-enforcer.js +0 -151
  111. package/dist/core/intelligence/patterns/prd-structure-enforcer.d.ts +0 -23
  112. package/dist/core/intelligence/patterns/prd-structure-enforcer.js +0 -183
  113. package/dist/core/intelligence/patterns/prerequisite-identifier.d.ts +0 -23
  114. package/dist/core/intelligence/patterns/prerequisite-identifier.js +0 -221
  115. package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +0 -24
  116. package/dist/core/intelligence/patterns/requirement-prioritizer.js +0 -134
  117. package/dist/core/intelligence/patterns/scope-definer.d.ts +0 -26
  118. package/dist/core/intelligence/patterns/scope-definer.js +0 -236
  119. package/dist/core/intelligence/patterns/step-decomposer.d.ts +0 -31
  120. package/dist/core/intelligence/patterns/step-decomposer.js +0 -242
  121. package/dist/core/intelligence/patterns/structure-organizer.d.ts +0 -31
  122. package/dist/core/intelligence/patterns/structure-organizer.js +0 -218
  123. package/dist/core/intelligence/patterns/success-criteria-enforcer.d.ts +0 -22
  124. package/dist/core/intelligence/patterns/success-criteria-enforcer.js +0 -165
  125. package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +0 -24
  126. package/dist/core/intelligence/patterns/success-metrics-enforcer.js +0 -165
  127. package/dist/core/intelligence/patterns/technical-context-enricher.d.ts +0 -25
  128. package/dist/core/intelligence/patterns/technical-context-enricher.js +0 -165
  129. package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +0 -26
  130. package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +0 -300
  131. package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +0 -24
  132. package/dist/core/intelligence/patterns/user-persona-enricher.js +0 -141
  133. package/dist/core/intelligence/patterns/validation-checklist-creator.d.ts +0 -31
  134. package/dist/core/intelligence/patterns/validation-checklist-creator.js +0 -242
  135. package/dist/core/intelligence/quality-assessor.d.ts +0 -51
  136. package/dist/core/intelligence/quality-assessor.js +0 -505
  137. package/dist/core/intelligence/types.d.ts +0 -111
  138. package/dist/core/intelligence/types.js +0 -3
  139. package/dist/core/intelligence/universal-optimizer.d.ts +0 -84
  140. package/dist/core/intelligence/universal-optimizer.js +0 -371
  141. package/dist/core/prd-generator.d.ts +0 -76
  142. package/dist/core/prd-generator.js +0 -173
  143. package/dist/core/prompt-manager.d.ts +0 -110
  144. package/dist/core/prompt-manager.js +0 -274
  145. package/dist/core/prompt-optimizer.d.ts +0 -268
  146. package/dist/core/prompt-optimizer.js +0 -959
  147. package/dist/core/question-engine.d.ts +0 -167
  148. package/dist/core/question-engine.js +0 -356
  149. package/dist/core/session-manager.d.ts +0 -139
  150. package/dist/core/session-manager.js +0 -365
  151. package/dist/core/task-manager.d.ts +0 -211
  152. package/dist/core/task-manager.js +0 -981
  153. package/dist/core/verification-hooks.d.ts +0 -67
  154. package/dist/core/verification-hooks.js +0 -309
  155. package/dist/core/verification-manager.d.ts +0 -107
  156. package/dist/core/verification-manager.js +0 -415
  157. package/dist/index 2.js +0 -13
  158. package/dist/index.d 2.ts +0 -4
  159. package/dist/types/session.d.ts +0 -78
  160. package/dist/types/session.js +0 -8
  161. package/dist/types/verification.d.ts +0 -205
  162. package/dist/types/verification.js +0 -9
@@ -1,183 +0,0 @@
1
- import { BasePattern, } from './base-pattern.js';
2
- /**
3
- * v4.5 Pattern: PRD Structure Enforcer
4
- *
5
- * Ensures PRD prompts include all necessary sections
6
- * for comprehensive product requirement documentation.
7
- */
8
- export class PRDStructureEnforcer extends BasePattern {
9
- // -------------------------------------------------------------------------
10
- // Pattern Metadata (v4.5 unified types)
11
- // -------------------------------------------------------------------------
12
- id = 'prd-structure-enforcer';
13
- name = 'PRD Structure Enforcer';
14
- description = 'Ensure PRD prompts include all necessary sections';
15
- applicableIntents = ['prd-generation'];
16
- scope = 'comprehensive';
17
- priority = 9; // VERY HIGH - structural integrity
18
- phases = ['question-validation', 'output-generation'];
19
- // -------------------------------------------------------------------------
20
- // Configuration Schema (v4.5)
21
- // -------------------------------------------------------------------------
22
- static configSchema = {
23
- showCompletenessScore: {
24
- type: 'boolean',
25
- default: true,
26
- description: 'Show PRD completeness percentage',
27
- },
28
- includeBestPractices: {
29
- type: 'boolean',
30
- default: true,
31
- description: 'Include PRD best practices reminder',
32
- },
33
- };
34
- // -------------------------------------------------------------------------
35
- // Pattern Data
36
- // -------------------------------------------------------------------------
37
- // Required PRD sections with their purposes
38
- PRD_SECTIONS = [
39
- {
40
- id: 'problem',
41
- name: 'Problem Statement',
42
- keywords: ['problem', 'issue', 'pain point', 'challenge', 'need'],
43
- prompt: 'What problem does this solve? What pain points are being addressed?',
44
- },
45
- {
46
- id: 'users',
47
- name: 'Target Users',
48
- keywords: ['user', 'audience', 'persona', 'customer', 'stakeholder', 'who'],
49
- prompt: 'Who are the target users? What are their characteristics and needs?',
50
- },
51
- {
52
- id: 'goals',
53
- name: 'Goals & Success Metrics',
54
- keywords: ['goal', 'objective', 'success', 'metric', 'kpi', 'measure', 'outcome'],
55
- prompt: 'What are the measurable goals? How will success be measured?',
56
- },
57
- {
58
- id: 'requirements',
59
- name: 'Functional Requirements',
60
- keywords: ['feature', 'requirement', 'must', 'should', 'functionality', 'capability'],
61
- prompt: 'What specific functionality is required? List the features.',
62
- },
63
- {
64
- id: 'scope',
65
- name: 'Scope & Boundaries',
66
- keywords: ['scope', 'boundary', 'included', 'excluded', 'out of scope', 'limitation'],
67
- prompt: 'What is in scope and out of scope? What are the boundaries?',
68
- },
69
- {
70
- id: 'constraints',
71
- name: 'Constraints & Dependencies',
72
- keywords: ['constraint', 'dependency', 'limitation', 'assumption', 'prerequisite'],
73
- prompt: 'What technical or business constraints exist? What dependencies are there?',
74
- },
75
- {
76
- id: 'timeline',
77
- name: 'Timeline & Milestones',
78
- keywords: ['timeline', 'deadline', 'milestone', 'phase', 'sprint', 'release'],
79
- prompt: 'What is the timeline? What are key milestones?',
80
- },
81
- {
82
- id: 'risks',
83
- name: 'Risks & Mitigations',
84
- keywords: ['risk', 'mitigation', 'concern', 'blocker', 'issue'],
85
- prompt: 'What are potential risks? How will they be mitigated?',
86
- },
87
- ];
88
- apply(prompt, _context) {
89
- const analysis = this.analyzePRDCompleteness(prompt);
90
- if (analysis.missingSections.length === 0) {
91
- return {
92
- enhancedPrompt: prompt,
93
- improvement: {
94
- dimension: 'completeness',
95
- description: 'PRD prompt already includes key sections',
96
- impact: 'low',
97
- },
98
- applied: false,
99
- };
100
- }
101
- // Generate enhancement section
102
- const enhancementSection = this.formatEnhancementSection(analysis);
103
- const enhancedPrompt = `${prompt}\n\n${enhancementSection}`;
104
- return {
105
- enhancedPrompt,
106
- improvement: {
107
- dimension: 'completeness',
108
- description: `Added ${analysis.missingSections.length} PRD sections for consideration`,
109
- impact: 'high',
110
- },
111
- applied: true,
112
- };
113
- }
114
- analyzePRDCompleteness(prompt) {
115
- const lowerPrompt = prompt.toLowerCase();
116
- const presentSections = [];
117
- const missingSections = [];
118
- const weakSections = [];
119
- for (const section of this.PRD_SECTIONS) {
120
- const matchedKeywords = section.keywords.filter((kw) => lowerPrompt.includes(kw.toLowerCase()));
121
- if (matchedKeywords.length >= 2) {
122
- // Section is well-covered
123
- presentSections.push(section);
124
- }
125
- else if (matchedKeywords.length === 1) {
126
- // Section is mentioned but weak
127
- weakSections.push(section);
128
- }
129
- else {
130
- // Section is missing
131
- missingSections.push(section);
132
- }
133
- }
134
- // Calculate completeness score
135
- const totalSections = this.PRD_SECTIONS.length;
136
- const coveredCount = presentSections.length + weakSections.length * 0.5;
137
- const completenessScore = Math.round((coveredCount / totalSections) * 100);
138
- return {
139
- presentSections,
140
- missingSections,
141
- weakSections,
142
- completenessScore,
143
- };
144
- }
145
- formatEnhancementSection(analysis) {
146
- const lines = [
147
- '### PRD Completeness Check',
148
- '',
149
- `**Current coverage:** ${analysis.completenessScore}%`,
150
- '',
151
- ];
152
- // Critical missing sections
153
- if (analysis.missingSections.length > 0) {
154
- lines.push('**Missing sections to consider:**');
155
- lines.push('');
156
- analysis.missingSections.forEach((section) => {
157
- lines.push(`#### ${section.name}`);
158
- lines.push(`_${section.prompt}_`);
159
- lines.push('');
160
- });
161
- }
162
- // Weak sections that need elaboration
163
- if (analysis.weakSections.length > 0) {
164
- lines.push('**Sections that could be expanded:**');
165
- lines.push('');
166
- analysis.weakSections.forEach((section) => {
167
- lines.push(`- **${section.name}**: ${section.prompt}`);
168
- });
169
- lines.push('');
170
- }
171
- // Add PRD best practices reminder
172
- lines.push('---');
173
- lines.push('');
174
- lines.push('**PRD Best Practices:**');
175
- lines.push('- Be specific about user personas and their needs');
176
- lines.push('- Include measurable success criteria');
177
- lines.push('- Clearly define what is NOT in scope');
178
- lines.push('- Prioritize requirements (must-have vs nice-to-have)');
179
- lines.push('- Consider edge cases and error scenarios');
180
- return lines.join('\n');
181
- }
182
- }
183
- //# sourceMappingURL=prd-structure-enforcer.js.map
@@ -1,23 +0,0 @@
1
- import { BasePattern, PatternScope, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
- import { PatternContext, PatternResult, PromptIntent } from '../types.js';
3
- /**
4
- * v4.5 Pattern: Prerequisite Identifier
5
- *
6
- * Identifies and explicitly states prerequisites and dependencies
7
- * that must be in place before the task can be executed.
8
- */
9
- export declare class PrerequisiteIdentifier extends BasePattern {
10
- readonly id = "prerequisite-identifier";
11
- readonly name = "Prerequisite Identifier";
12
- readonly description = "Identifies and documents prerequisites and dependencies for task execution";
13
- readonly applicableIntents: PromptIntent[];
14
- readonly scope: PatternScope;
15
- readonly priority: PatternPriority;
16
- readonly phases: PatternPhase[];
17
- static readonly configSchema: PatternConfigSchema;
18
- private prerequisiteIndicators;
19
- private techPrerequisites;
20
- private intentPrerequisites;
21
- apply(prompt: string, context: PatternContext): PatternResult;
22
- }
23
- //# sourceMappingURL=prerequisite-identifier.d.ts.map
@@ -1,221 +0,0 @@
1
- import { BasePattern, } from './base-pattern.js';
2
- /**
3
- * v4.5 Pattern: Prerequisite Identifier
4
- *
5
- * Identifies and explicitly states prerequisites and dependencies
6
- * that must be in place before the task can be executed.
7
- */
8
- export class PrerequisiteIdentifier extends BasePattern {
9
- // -------------------------------------------------------------------------
10
- // Pattern Metadata (v4.5 unified types)
11
- // -------------------------------------------------------------------------
12
- id = 'prerequisite-identifier';
13
- name = 'Prerequisite Identifier';
14
- description = 'Identifies and documents prerequisites and dependencies for task execution';
15
- applicableIntents = [
16
- 'code-generation',
17
- 'planning',
18
- 'migration',
19
- 'testing',
20
- 'debugging',
21
- ];
22
- scope = 'comprehensive';
23
- priority = 6; // MEDIUM - standard enhancement
24
- phases = ['all'];
25
- // -------------------------------------------------------------------------
26
- // Configuration Schema (v4.5)
27
- // -------------------------------------------------------------------------
28
- static configSchema = {
29
- maxPrerequisites: {
30
- type: 'number',
31
- default: 8,
32
- description: 'Maximum number of prerequisites to list',
33
- validation: { min: 1, max: 15 },
34
- },
35
- maxTechnologies: {
36
- type: 'number',
37
- default: 3,
38
- description: 'Maximum number of technologies to detect',
39
- validation: { min: 1, max: 5 },
40
- },
41
- };
42
- // -------------------------------------------------------------------------
43
- // Pattern Data
44
- // -------------------------------------------------------------------------
45
- // Keywords that suggest prerequisites are already addressed
46
- prerequisiteIndicators = [
47
- 'prerequisite',
48
- 'requirements:',
49
- 'depends on',
50
- 'dependency',
51
- 'requires',
52
- 'before starting',
53
- 'first ensure',
54
- 'make sure',
55
- 'assuming',
56
- 'given that',
57
- 'setup:',
58
- 'installation:',
59
- 'configuration:',
60
- ];
61
- // Technology-specific prerequisites
62
- techPrerequisites = {
63
- react: [
64
- 'Node.js >= 16.x installed',
65
- 'npm or yarn package manager',
66
- 'React project initialized (create-react-app, Vite, or Next.js)',
67
- 'TypeScript configured (if using TS)',
68
- ],
69
- node: [
70
- 'Node.js >= 16.x installed',
71
- 'npm/yarn/pnpm package manager',
72
- 'package.json initialized',
73
- ],
74
- typescript: [
75
- 'TypeScript installed',
76
- 'tsconfig.json configured',
77
- 'Build tooling setup (tsc, esbuild, swc)',
78
- ],
79
- database: [
80
- 'Database server running',
81
- 'Database connection credentials',
82
- 'Database client/ORM installed',
83
- 'Schema/migrations up to date',
84
- ],
85
- api: [
86
- 'API endpoint accessible',
87
- 'Authentication tokens/keys available',
88
- 'API documentation available',
89
- 'Rate limits understood',
90
- ],
91
- testing: [
92
- 'Test framework installed (Jest, Vitest, etc.)',
93
- 'Test configuration files present',
94
- 'Test database/mocks available',
95
- ],
96
- docker: [
97
- 'Docker installed and running',
98
- 'Docker Compose (if using)',
99
- 'Container registry access (if pulling images)',
100
- ],
101
- aws: [
102
- 'AWS CLI installed and configured',
103
- 'IAM credentials with appropriate permissions',
104
- 'AWS SDK installed',
105
- ],
106
- git: [
107
- 'Git installed',
108
- 'Repository cloned',
109
- 'Correct branch checked out',
110
- 'No uncommitted changes (or staged appropriately)',
111
- ],
112
- };
113
- // Intent-specific prerequisites
114
- intentPrerequisites = {
115
- 'code-generation': [
116
- 'Development environment set up',
117
- 'Required dependencies installed',
118
- 'Coding standards/style guide available',
119
- ],
120
- migration: [
121
- 'Backup of existing data/code',
122
- 'Migration plan documented',
123
- 'Rollback strategy defined',
124
- 'Downtime window scheduled (if applicable)',
125
- ],
126
- testing: [
127
- 'Code to be tested is implemented',
128
- 'Test data/fixtures available',
129
- 'CI/CD pipeline configured (for automated tests)',
130
- ],
131
- debugging: [
132
- 'Bug is reproducible',
133
- 'Relevant logs available',
134
- 'Debug tools configured',
135
- 'Access to failing environment',
136
- ],
137
- planning: [
138
- 'Requirements documented',
139
- 'Stakeholder input collected',
140
- 'Timeline/constraints known',
141
- ],
142
- };
143
- apply(prompt, context) {
144
- const lowerPrompt = prompt.toLowerCase();
145
- // Check if prerequisites are already addressed
146
- const hasPrerequisites = this.prerequisiteIndicators.some((indicator) => lowerPrompt.includes(indicator.toLowerCase()));
147
- if (hasPrerequisites) {
148
- return {
149
- enhancedPrompt: prompt,
150
- improvement: {
151
- dimension: 'completeness',
152
- description: 'Prerequisites already specified',
153
- impact: 'low',
154
- },
155
- applied: false,
156
- };
157
- }
158
- // Detect technologies mentioned
159
- const detectedTech = [];
160
- const techKeywords = {
161
- react: /\b(react|jsx|tsx|component|hook|useState|useEffect)\b/i,
162
- node: /\b(node|express|koa|fastify|npm|yarn|pnpm)\b/i,
163
- typescript: /\b(typescript|ts|tsx|type|interface)\b/i,
164
- database: /\b(database|db|sql|postgres|mysql|mongo|redis|prisma|sequelize)\b/i,
165
- api: /\b(api|rest|graphql|endpoint|fetch|axios|http)\b/i,
166
- testing: /\b(test|jest|vitest|mocha|cypress|playwright)\b/i,
167
- docker: /\b(docker|container|kubernetes|k8s|compose)\b/i,
168
- aws: /\b(aws|s3|lambda|ec2|dynamodb|cloudformation)\b/i,
169
- git: /\b(git|commit|branch|merge|pull request|pr)\b/i,
170
- };
171
- for (const [tech, regex] of Object.entries(techKeywords)) {
172
- if (regex.test(prompt)) {
173
- detectedTech.push(tech);
174
- }
175
- }
176
- // Collect prerequisites
177
- const prerequisites = [];
178
- // Add intent-specific prerequisites
179
- const intent = context.intent.primaryIntent;
180
- const intentPrereqs = this.intentPrerequisites[intent] || [];
181
- prerequisites.push(...intentPrereqs);
182
- // Add tech-specific prerequisites
183
- for (const tech of detectedTech.slice(0, 3)) {
184
- // Limit to 3 technologies
185
- const techPrereqs = this.techPrerequisites[tech] || [];
186
- prerequisites.push(...techPrereqs.slice(0, 2)); // 2 per technology
187
- }
188
- // Deduplicate and limit
189
- const uniquePrereqs = [...new Set(prerequisites)].slice(0, 8);
190
- if (uniquePrereqs.length === 0) {
191
- return {
192
- enhancedPrompt: prompt,
193
- improvement: {
194
- dimension: 'completeness',
195
- description: 'No specific prerequisites detected',
196
- impact: 'low',
197
- },
198
- applied: false,
199
- };
200
- }
201
- // Build prerequisites section
202
- const prereqSection = `
203
-
204
- ## Prerequisites
205
-
206
- Before starting this task, ensure:
207
- ${uniquePrereqs.map((p) => `- [ ] ${p}`).join('\n')}
208
-
209
- **Note**: Check prerequisites to avoid blockers during implementation.`;
210
- return {
211
- enhancedPrompt: prompt + prereqSection,
212
- improvement: {
213
- dimension: 'completeness',
214
- description: `Added ${uniquePrereqs.length} prerequisites for ${detectedTech.join(', ') || intent}`,
215
- impact: 'medium',
216
- },
217
- applied: true,
218
- };
219
- }
220
- }
221
- //# sourceMappingURL=prerequisite-identifier.js.map
@@ -1,24 +0,0 @@
1
- import { BasePattern, PatternScope, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
- import { PromptIntent, PatternContext, PatternResult } from '../types.js';
3
- /**
4
- * v4.5 Pattern: Requirement Prioritizer
5
- *
6
- * Separates must-have from nice-to-have requirements in PRD content.
7
- * Helps clarify priorities and MVP scope.
8
- */
9
- export declare class RequirementPrioritizer extends BasePattern {
10
- readonly id = "requirement-prioritizer";
11
- readonly name = "Requirement Prioritizer";
12
- readonly description = "Separates must-have from nice-to-have requirements";
13
- readonly applicableIntents: PromptIntent[];
14
- readonly scope: PatternScope;
15
- readonly priority: PatternPriority;
16
- readonly phases: PatternPhase[];
17
- static readonly configSchema: PatternConfigSchema;
18
- apply(prompt: string, _context: PatternContext): PatternResult;
19
- private hasFeatureContent;
20
- private hasPrioritization;
21
- private addPrioritization;
22
- private extractFeatureSection;
23
- }
24
- //# sourceMappingURL=requirement-prioritizer.d.ts.map
@@ -1,134 +0,0 @@
1
- import { BasePattern, } from './base-pattern.js';
2
- /**
3
- * v4.5 Pattern: Requirement Prioritizer
4
- *
5
- * Separates must-have from nice-to-have requirements in PRD content.
6
- * Helps clarify priorities and MVP scope.
7
- */
8
- export class RequirementPrioritizer extends BasePattern {
9
- // -------------------------------------------------------------------------
10
- // Pattern Metadata (v4.5 unified types)
11
- // -------------------------------------------------------------------------
12
- id = 'requirement-prioritizer';
13
- name = 'Requirement Prioritizer';
14
- description = 'Separates must-have from nice-to-have requirements';
15
- applicableIntents = ['prd-generation', 'planning'];
16
- scope = 'comprehensive';
17
- priority = 7; // MEDIUM-HIGH - important enrichment
18
- phases = ['question-validation', 'output-generation'];
19
- // -------------------------------------------------------------------------
20
- // Configuration Schema (v4.5)
21
- // -------------------------------------------------------------------------
22
- static configSchema = {
23
- usePriorityLabels: {
24
- type: 'boolean',
25
- default: true,
26
- description: 'Use P0/P1/P2 priority labels',
27
- },
28
- };
29
- // -------------------------------------------------------------------------
30
- // Pattern Application
31
- // -------------------------------------------------------------------------
32
- apply(prompt, _context) {
33
- // Only apply to PRD-related content with features
34
- if (!this.hasFeatureContent(prompt)) {
35
- return {
36
- enhancedPrompt: prompt,
37
- improvement: {
38
- dimension: 'structure',
39
- description: 'No feature content to prioritize',
40
- impact: 'low',
41
- },
42
- applied: false,
43
- };
44
- }
45
- // Check if prioritization already exists
46
- if (this.hasPrioritization(prompt)) {
47
- return {
48
- enhancedPrompt: prompt,
49
- improvement: {
50
- dimension: 'structure',
51
- description: 'Requirements already prioritized',
52
- impact: 'low',
53
- },
54
- applied: false,
55
- };
56
- }
57
- // Add prioritization framework
58
- const enhanced = this.addPrioritization(prompt);
59
- return {
60
- enhancedPrompt: enhanced,
61
- improvement: {
62
- dimension: 'structure',
63
- description: 'Added requirement prioritization (must-have vs nice-to-have)',
64
- impact: 'high',
65
- },
66
- applied: true,
67
- };
68
- }
69
- hasFeatureContent(prompt) {
70
- const featureKeywords = [
71
- 'feature',
72
- 'requirement',
73
- 'functionality',
74
- 'capability',
75
- 'should',
76
- 'must',
77
- 'need',
78
- 'want',
79
- 'implement',
80
- ];
81
- return this.hasSection(prompt, featureKeywords);
82
- }
83
- hasPrioritization(prompt) {
84
- const priorityKeywords = [
85
- 'must-have',
86
- 'must have',
87
- 'nice-to-have',
88
- 'nice to have',
89
- 'p0',
90
- 'p1',
91
- 'p2',
92
- 'priority:',
93
- 'mvp',
94
- 'phase 1',
95
- 'phase 2',
96
- 'critical',
97
- 'optional',
98
- ];
99
- return this.hasSection(prompt, priorityKeywords);
100
- }
101
- addPrioritization(prompt) {
102
- // Look for feature sections and add prioritization guidance
103
- const featureSection = this.extractFeatureSection(prompt);
104
- if (!featureSection) {
105
- // No clear feature section, add prioritization note
106
- return (prompt +
107
- '\n\n### Requirement Priorities\n' +
108
- '**Must-Have (MVP):**\n- [Core features required for launch]\n\n' +
109
- '**Nice-to-Have (Post-MVP):**\n- [Features to add after initial release]');
110
- }
111
- // Features exist but aren't prioritized - add framework
112
- const priorityNote = '\n\n> **Priority Framework:** Consider categorizing features as:\n' +
113
- '> - **Must-Have (P0):** Required for MVP, blocking issues\n' +
114
- '> - **Should-Have (P1):** Important but not blocking\n' +
115
- '> - **Nice-to-Have (P2):** Enhancements for future iterations';
116
- return prompt + priorityNote;
117
- }
118
- extractFeatureSection(prompt) {
119
- // Try to find feature-related sections
120
- const featurePatterns = [
121
- /features?:?\s*\n([\s\S]*?)(?=\n##|\n\*\*[A-Z]|$)/i,
122
- /requirements?:?\s*\n([\s\S]*?)(?=\n##|\n\*\*[A-Z]|$)/i,
123
- /what we(?:'re| are) building:?\s*\n([\s\S]*?)(?=\n##|\n\*\*[A-Z]|$)/i,
124
- ];
125
- for (const pattern of featurePatterns) {
126
- const match = prompt.match(pattern);
127
- if (match) {
128
- return match[1];
129
- }
130
- }
131
- return null;
132
- }
133
- }
134
- //# sourceMappingURL=requirement-prioritizer.js.map
@@ -1,26 +0,0 @@
1
- import { BasePattern, PatternScope, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
- import { PromptIntent, PatternContext, PatternResult } from '../types.js';
3
- /**
4
- * v4.5 Pattern: Scope Definer
5
- *
6
- * Adds explicit scope boundaries to prevent scope creep
7
- * and clarify what is/isn't included.
8
- */
9
- export declare class ScopeDefiner extends BasePattern {
10
- readonly id = "scope-definer";
11
- readonly name = "Scope Definer";
12
- readonly description = "Add explicit scope boundaries to prevent scope creep";
13
- readonly applicableIntents: PromptIntent[];
14
- readonly scope: PatternScope;
15
- readonly priority: PatternPriority;
16
- readonly phases: PatternPhase[];
17
- static readonly configSchema: PatternConfigSchema;
18
- apply(prompt: string, context: PatternContext): PatternResult;
19
- private hasExistingScope;
20
- private defineScope;
21
- private extractInScope;
22
- private identifyOutOfScope;
23
- private identifyBoundaries;
24
- private formatScopeSection;
25
- }
26
- //# sourceMappingURL=scope-definer.d.ts.map