clavix 4.4.0 → 4.6.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 (74) hide show
  1. package/dist/core/adapters/instructions-generator.d.ts +2 -1
  2. package/dist/core/adapters/instructions-generator.js +21 -8
  3. package/dist/core/intelligence/confidence-calculator.d.ts +93 -0
  4. package/dist/core/intelligence/confidence-calculator.js +124 -0
  5. package/dist/core/intelligence/index.d.ts +1 -0
  6. package/dist/core/intelligence/index.js +2 -0
  7. package/dist/core/intelligence/intent-detector.js +10 -8
  8. package/dist/core/intelligence/pattern-library.d.ts +34 -12
  9. package/dist/core/intelligence/pattern-library.js +120 -85
  10. package/dist/core/intelligence/patterns/actionability-enhancer.d.ts +10 -10
  11. package/dist/core/intelligence/patterns/actionability-enhancer.js +31 -6
  12. package/dist/core/intelligence/patterns/alternative-phrasing-generator.d.ts +10 -8
  13. package/dist/core/intelligence/patterns/alternative-phrasing-generator.js +21 -3
  14. package/dist/core/intelligence/patterns/ambiguity-detector.d.ts +10 -8
  15. package/dist/core/intelligence/patterns/ambiguity-detector.js +31 -3
  16. package/dist/core/intelligence/patterns/assumption-explicitizer.d.ts +10 -8
  17. package/dist/core/intelligence/patterns/assumption-explicitizer.js +26 -3
  18. package/dist/core/intelligence/patterns/base-pattern.d.ts +166 -8
  19. package/dist/core/intelligence/patterns/base-pattern.js +64 -4
  20. package/dist/core/intelligence/patterns/completeness-validator.d.ts +10 -10
  21. package/dist/core/intelligence/patterns/completeness-validator.js +26 -5
  22. package/dist/core/intelligence/patterns/conciseness-filter.d.ts +15 -7
  23. package/dist/core/intelligence/patterns/conciseness-filter.js +36 -4
  24. package/dist/core/intelligence/patterns/context-precision.d.ts +10 -8
  25. package/dist/core/intelligence/patterns/context-precision.js +28 -5
  26. package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +11 -9
  27. package/dist/core/intelligence/patterns/conversation-summarizer.js +40 -16
  28. package/dist/core/intelligence/patterns/dependency-identifier.d.ts +11 -9
  29. package/dist/core/intelligence/patterns/dependency-identifier.js +21 -4
  30. package/dist/core/intelligence/patterns/domain-context-enricher.d.ts +10 -8
  31. package/dist/core/intelligence/patterns/domain-context-enricher.js +27 -3
  32. package/dist/core/intelligence/patterns/edge-case-identifier.d.ts +10 -8
  33. package/dist/core/intelligence/patterns/edge-case-identifier.js +21 -3
  34. package/dist/core/intelligence/patterns/error-tolerance-enhancer.d.ts +10 -8
  35. package/dist/core/intelligence/patterns/error-tolerance-enhancer.js +22 -4
  36. package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +11 -9
  37. package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +27 -4
  38. package/dist/core/intelligence/patterns/objective-clarifier.d.ts +15 -7
  39. package/dist/core/intelligence/patterns/objective-clarifier.js +46 -17
  40. package/dist/core/intelligence/patterns/output-format-enforcer.d.ts +10 -8
  41. package/dist/core/intelligence/patterns/output-format-enforcer.js +20 -3
  42. package/dist/core/intelligence/patterns/prd-structure-enforcer.d.ts +10 -8
  43. package/dist/core/intelligence/patterns/prd-structure-enforcer.js +25 -3
  44. package/dist/core/intelligence/patterns/prerequisite-identifier.d.ts +10 -8
  45. package/dist/core/intelligence/patterns/prerequisite-identifier.js +28 -4
  46. package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +11 -9
  47. package/dist/core/intelligence/patterns/requirement-prioritizer.js +21 -4
  48. package/dist/core/intelligence/patterns/scope-definer.d.ts +10 -8
  49. package/dist/core/intelligence/patterns/scope-definer.js +27 -3
  50. package/dist/core/intelligence/patterns/step-decomposer.d.ts +10 -8
  51. package/dist/core/intelligence/patterns/step-decomposer.js +21 -3
  52. package/dist/core/intelligence/patterns/structure-organizer.d.ts +10 -10
  53. package/dist/core/intelligence/patterns/structure-organizer.js +25 -5
  54. package/dist/core/intelligence/patterns/success-criteria-enforcer.d.ts +10 -8
  55. package/dist/core/intelligence/patterns/success-criteria-enforcer.js +20 -3
  56. package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +11 -9
  57. package/dist/core/intelligence/patterns/success-metrics-enforcer.js +27 -4
  58. package/dist/core/intelligence/patterns/technical-context-enricher.d.ts +16 -7
  59. package/dist/core/intelligence/patterns/technical-context-enricher.js +71 -38
  60. package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +11 -9
  61. package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +22 -4
  62. package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +11 -9
  63. package/dist/core/intelligence/patterns/user-persona-enricher.js +21 -4
  64. package/dist/core/intelligence/patterns/validation-checklist-creator.d.ts +11 -8
  65. package/dist/core/intelligence/patterns/validation-checklist-creator.js +31 -3
  66. package/dist/templates/slash-commands/_canonical/archive.md +1 -1
  67. package/dist/templates/slash-commands/_canonical/deep.md +5 -2
  68. package/dist/templates/slash-commands/_canonical/fast.md +10 -2
  69. package/dist/templates/slash-commands/_canonical/prd.md +4 -1
  70. package/dist/templates/slash-commands/_components/agent-protocols/assertion-checkpoints.md +122 -0
  71. package/dist/templates/slash-commands/_components/agent-protocols/decision-rules.md +29 -0
  72. package/dist/templates/slash-commands/_components/references/intent-types.md +3 -1
  73. package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +14 -12
  74. package/package.json +1 -1
@@ -1,18 +1,20 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
2
  import { PatternContext, PatternResult, PromptIntent } from '../types.js';
3
3
  /**
4
- * PrerequisiteIdentifier Pattern (v4.1)
4
+ * v4.5 Pattern: Prerequisite Identifier
5
5
  *
6
6
  * Identifies and explicitly states prerequisites and dependencies
7
7
  * that must be in place before the task can be executed.
8
8
  */
9
9
  export declare class PrerequisiteIdentifier extends BasePattern {
10
- id: string;
11
- name: string;
12
- description: string;
13
- applicableIntents: PromptIntent[];
14
- mode: 'fast' | 'deep' | 'both';
15
- priority: number;
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 mode: PatternMode;
15
+ readonly priority: PatternPriority;
16
+ readonly phases: PatternPhase[];
17
+ static readonly configSchema: PatternConfigSchema;
16
18
  private prerequisiteIndicators;
17
19
  private techPrerequisites;
18
20
  private intentPrerequisites;
@@ -1,11 +1,14 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, } from './base-pattern.js';
2
2
  /**
3
- * PrerequisiteIdentifier Pattern (v4.1)
3
+ * v4.5 Pattern: Prerequisite Identifier
4
4
  *
5
5
  * Identifies and explicitly states prerequisites and dependencies
6
6
  * that must be in place before the task can be executed.
7
7
  */
8
8
  export class PrerequisiteIdentifier extends BasePattern {
9
+ // -------------------------------------------------------------------------
10
+ // Pattern Metadata (v4.5 unified types)
11
+ // -------------------------------------------------------------------------
9
12
  id = 'prerequisite-identifier';
10
13
  name = 'Prerequisite Identifier';
11
14
  description = 'Identifies and documents prerequisites and dependencies for task execution';
@@ -16,8 +19,29 @@ export class PrerequisiteIdentifier extends BasePattern {
16
19
  'testing',
17
20
  'debugging',
18
21
  ];
19
- mode = 'deep'; // Only in deep mode
20
- priority = 6; // Medium priority
22
+ mode = 'deep';
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
+ // -------------------------------------------------------------------------
21
45
  // Keywords that suggest prerequisites are already addressed
22
46
  prerequisiteIndicators = [
23
47
  'prerequisite',
@@ -1,18 +1,20 @@
1
- import { BasePattern } from './base-pattern.js';
2
- import { PromptIntent, OptimizationMode, PatternContext, PatternResult } from '../types.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
+ import { PromptIntent, PatternContext, PatternResult } from '../types.js';
3
3
  /**
4
- * v4.3.2 PRD Pattern: RequirementPrioritizer
4
+ * v4.5 Pattern: Requirement Prioritizer
5
5
  *
6
6
  * Separates must-have from nice-to-have requirements in PRD content.
7
7
  * Helps clarify priorities and MVP scope.
8
8
  */
9
9
  export declare class RequirementPrioritizer extends BasePattern {
10
- id: string;
11
- name: string;
12
- description: string;
13
- applicableIntents: PromptIntent[];
14
- mode: OptimizationMode | 'both';
15
- priority: number;
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 mode: PatternMode;
15
+ readonly priority: PatternPriority;
16
+ readonly phases: PatternPhase[];
17
+ static readonly configSchema: PatternConfigSchema;
16
18
  apply(prompt: string, _context: PatternContext): PatternResult;
17
19
  private hasFeatureContent;
18
20
  private hasPrioritization;
@@ -1,17 +1,34 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, } from './base-pattern.js';
2
2
  /**
3
- * v4.3.2 PRD Pattern: RequirementPrioritizer
3
+ * v4.5 Pattern: Requirement Prioritizer
4
4
  *
5
5
  * Separates must-have from nice-to-have requirements in PRD content.
6
6
  * Helps clarify priorities and MVP scope.
7
7
  */
8
8
  export class RequirementPrioritizer extends BasePattern {
9
+ // -------------------------------------------------------------------------
10
+ // Pattern Metadata (v4.5 unified types)
11
+ // -------------------------------------------------------------------------
9
12
  id = 'requirement-prioritizer';
10
- name = 'RequirementPrioritizer';
13
+ name = 'Requirement Prioritizer';
11
14
  description = 'Separates must-have from nice-to-have requirements';
12
15
  applicableIntents = ['prd-generation', 'planning'];
13
16
  mode = 'deep';
14
- priority = 7;
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
+ // -------------------------------------------------------------------------
15
32
  apply(prompt, _context) {
16
33
  // Only apply to PRD-related content with features
17
34
  if (!this.hasFeatureContent(prompt)) {
@@ -1,18 +1,20 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
2
  import { PromptIntent, PatternContext, PatternResult } from '../types.js';
3
3
  /**
4
- * v4.0 Deep Mode Pattern: Scope Definer
4
+ * v4.5 Pattern: Scope Definer
5
5
  *
6
6
  * Adds explicit scope boundaries to prevent scope creep
7
7
  * and clarify what is/isn't included.
8
8
  */
9
9
  export declare class ScopeDefiner extends BasePattern {
10
- id: string;
11
- name: string;
12
- description: string;
13
- applicableIntents: PromptIntent[];
14
- mode: "deep";
15
- priority: number;
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 mode: PatternMode;
15
+ readonly priority: PatternPriority;
16
+ readonly phases: PatternPhase[];
17
+ static readonly configSchema: PatternConfigSchema;
16
18
  apply(prompt: string, context: PatternContext): PatternResult;
17
19
  private hasExistingScope;
18
20
  private defineScope;
@@ -1,11 +1,14 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, } from './base-pattern.js';
2
2
  /**
3
- * v4.0 Deep Mode Pattern: Scope Definer
3
+ * v4.5 Pattern: Scope Definer
4
4
  *
5
5
  * Adds explicit scope boundaries to prevent scope creep
6
6
  * and clarify what is/isn't included.
7
7
  */
8
8
  export class ScopeDefiner extends BasePattern {
9
+ // -------------------------------------------------------------------------
10
+ // Pattern Metadata (v4.5 unified types)
11
+ // -------------------------------------------------------------------------
9
12
  id = 'scope-definer';
10
13
  name = 'Scope Definer';
11
14
  description = 'Add explicit scope boundaries to prevent scope creep';
@@ -17,7 +20,28 @@ export class ScopeDefiner extends BasePattern {
17
20
  'documentation',
18
21
  ];
19
22
  mode = 'deep';
20
- priority = 5;
23
+ priority = 5; // MEDIUM-LOW - supplementary
24
+ phases = ['all'];
25
+ // -------------------------------------------------------------------------
26
+ // Configuration Schema (v4.5)
27
+ // -------------------------------------------------------------------------
28
+ static configSchema = {
29
+ maxInScopeItems: {
30
+ type: 'number',
31
+ default: 5,
32
+ description: 'Maximum number of in-scope items to list',
33
+ validation: { min: 1, max: 10 },
34
+ },
35
+ maxOutOfScopeItems: {
36
+ type: 'number',
37
+ default: 5,
38
+ description: 'Maximum number of out-of-scope items to list',
39
+ validation: { min: 1, max: 10 },
40
+ },
41
+ };
42
+ // -------------------------------------------------------------------------
43
+ // Pattern Application
44
+ // -------------------------------------------------------------------------
21
45
  apply(prompt, context) {
22
46
  // Check if prompt already has scope definition
23
47
  if (this.hasExistingScope(prompt)) {
@@ -1,18 +1,20 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
2
  import { PromptIntent, PatternContext, PatternResult } from '../types.js';
3
3
  /**
4
- * v4.0 Both Mode Pattern: Step-by-Step Decomposer
4
+ * v4.5 Pattern: Step-by-Step Decomposer
5
5
  *
6
6
  * Breaks complex prompts into clear sequential steps.
7
7
  * Applicable in both fast and deep modes.
8
8
  */
9
9
  export declare class StepDecomposer extends BasePattern {
10
- id: string;
11
- name: string;
12
- description: string;
13
- applicableIntents: PromptIntent[];
14
- mode: "both";
15
- priority: number;
10
+ readonly id = "step-decomposer";
11
+ readonly name = "Step-by-Step Decomposer";
12
+ readonly description = "Break complex prompts into clear sequential steps";
13
+ readonly applicableIntents: PromptIntent[];
14
+ readonly mode: PatternMode;
15
+ readonly priority: PatternPriority;
16
+ readonly phases: PatternPhase[];
17
+ static readonly configSchema: PatternConfigSchema;
16
18
  apply(prompt: string, context: PatternContext): PatternResult;
17
19
  private needsDecomposition;
18
20
  private hasSteps;
@@ -1,11 +1,14 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, } from './base-pattern.js';
2
2
  /**
3
- * v4.0 Both Mode Pattern: Step-by-Step Decomposer
3
+ * v4.5 Pattern: Step-by-Step Decomposer
4
4
  *
5
5
  * Breaks complex prompts into clear sequential steps.
6
6
  * Applicable in both fast and deep modes.
7
7
  */
8
8
  export class StepDecomposer extends BasePattern {
9
+ // -------------------------------------------------------------------------
10
+ // Pattern Metadata (v4.5 unified types)
11
+ // -------------------------------------------------------------------------
9
12
  id = 'step-decomposer';
10
13
  name = 'Step-by-Step Decomposer';
11
14
  description = 'Break complex prompts into clear sequential steps';
@@ -18,7 +21,22 @@ export class StepDecomposer extends BasePattern {
18
21
  'documentation',
19
22
  ];
20
23
  mode = 'both';
21
- priority = 7;
24
+ priority = 5; // MEDIUM-LOW - supplementary
25
+ phases = ['all'];
26
+ // -------------------------------------------------------------------------
27
+ // Configuration Schema (v4.5)
28
+ // -------------------------------------------------------------------------
29
+ static configSchema = {
30
+ minWordsForDecomposition: {
31
+ type: 'number',
32
+ default: 100,
33
+ description: 'Minimum word count before decomposition is applied',
34
+ validation: { min: 50, max: 500 },
35
+ },
36
+ };
37
+ // -------------------------------------------------------------------------
38
+ // Pattern Application
39
+ // -------------------------------------------------------------------------
22
40
  apply(prompt, context) {
23
41
  // Check if prompt is complex enough to benefit from decomposition
24
42
  if (!this.needsDecomposition(prompt)) {
@@ -1,20 +1,20 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
2
  import { PatternContext, PatternResult, PromptIntent } from '../types.js';
3
3
  /**
4
- * Structure Organizer Pattern
4
+ * v4.5 Pattern: Structure Organizer
5
5
  *
6
6
  * Reorders information logically following the flow:
7
7
  * Objective → Requirements → Technical Constraints → Expected Output → Success Criteria
8
- *
9
- * Priority: HIGH (8)
10
8
  */
11
9
  export declare class StructureOrganizer extends BasePattern {
12
- id: string;
13
- name: string;
14
- description: string;
15
- applicableIntents: PromptIntent[];
16
- mode: 'fast' | 'deep' | 'both';
17
- priority: number;
10
+ readonly id = "structure-organizer";
11
+ readonly name = "Structure Organizer";
12
+ readonly description = "Reorders information into logical sections";
13
+ readonly applicableIntents: PromptIntent[];
14
+ readonly mode: PatternMode;
15
+ readonly priority: PatternPriority;
16
+ readonly phases: PatternPhase[];
17
+ static readonly configSchema: PatternConfigSchema;
18
18
  apply(prompt: string, _context: PatternContext): PatternResult;
19
19
  private detectSections;
20
20
  private isWellOrdered;
@@ -1,13 +1,14 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, } from './base-pattern.js';
2
2
  /**
3
- * Structure Organizer Pattern
3
+ * v4.5 Pattern: Structure Organizer
4
4
  *
5
5
  * Reorders information logically following the flow:
6
6
  * Objective → Requirements → Technical Constraints → Expected Output → Success Criteria
7
- *
8
- * Priority: HIGH (8)
9
7
  */
10
8
  export class StructureOrganizer extends BasePattern {
9
+ // -------------------------------------------------------------------------
10
+ // Pattern Metadata (v4.5 unified types)
11
+ // -------------------------------------------------------------------------
11
12
  id = 'structure-organizer';
12
13
  name = 'Structure Organizer';
13
14
  description = 'Reorders information into logical sections';
@@ -19,7 +20,26 @@ export class StructureOrganizer extends BasePattern {
19
20
  'documentation',
20
21
  ];
21
22
  mode = 'both';
22
- priority = 8; // High priority
23
+ priority = 8; // HIGH - core enhancement
24
+ phases = ['all'];
25
+ // -------------------------------------------------------------------------
26
+ // Configuration Schema (v4.5)
27
+ // -------------------------------------------------------------------------
28
+ static configSchema = {
29
+ addHeadersIfMissing: {
30
+ type: 'boolean',
31
+ default: true,
32
+ description: 'Add markdown headers if not present',
33
+ },
34
+ reorderSections: {
35
+ type: 'boolean',
36
+ default: true,
37
+ description: 'Reorder sections to follow logical flow',
38
+ },
39
+ };
40
+ // -------------------------------------------------------------------------
41
+ // Pattern Application
42
+ // -------------------------------------------------------------------------
23
43
  apply(prompt, _context) {
24
44
  // Detect existing sections
25
45
  const sections = this.detectSections(prompt);
@@ -1,18 +1,20 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
2
  import { PatternContext, PatternResult, PromptIntent } from '../types.js';
3
3
  /**
4
- * SuccessCriteriaEnforcer Pattern (v4.1)
4
+ * v4.5 Pattern: Success Criteria Enforcer
5
5
  *
6
6
  * Ensures prompts include measurable success criteria. Agents need to know
7
7
  * when they've successfully completed a task - this pattern adds that clarity.
8
8
  */
9
9
  export declare class SuccessCriteriaEnforcer extends BasePattern {
10
- id: string;
11
- name: string;
12
- description: string;
13
- applicableIntents: PromptIntent[];
14
- mode: 'fast' | 'deep' | 'both';
15
- priority: number;
10
+ readonly id = "success-criteria-enforcer";
11
+ readonly name = "Success Criteria Enforcer";
12
+ readonly description = "Adds measurable success criteria for task completion validation";
13
+ readonly applicableIntents: PromptIntent[];
14
+ readonly mode: PatternMode;
15
+ readonly priority: PatternPriority;
16
+ readonly phases: PatternPhase[];
17
+ static readonly configSchema: PatternConfigSchema;
16
18
  private successIndicators;
17
19
  private intentCriteria;
18
20
  apply(prompt: string, context: PatternContext): PatternResult;
@@ -1,11 +1,14 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, } from './base-pattern.js';
2
2
  /**
3
- * SuccessCriteriaEnforcer Pattern (v4.1)
3
+ * v4.5 Pattern: Success Criteria Enforcer
4
4
  *
5
5
  * Ensures prompts include measurable success criteria. Agents need to know
6
6
  * when they've successfully completed a task - this pattern adds that clarity.
7
7
  */
8
8
  export class SuccessCriteriaEnforcer extends BasePattern {
9
+ // -------------------------------------------------------------------------
10
+ // Pattern Metadata (v4.5 unified types)
11
+ // -------------------------------------------------------------------------
9
12
  id = 'success-criteria-enforcer';
10
13
  name = 'Success Criteria Enforcer';
11
14
  description = 'Adds measurable success criteria for task completion validation';
@@ -19,7 +22,21 @@ export class SuccessCriteriaEnforcer extends BasePattern {
19
22
  'prd-generation',
20
23
  ];
21
24
  mode = 'both';
22
- priority = 6; // Medium priority
25
+ priority = 7; // MEDIUM-HIGH - important enrichment
26
+ phases = ['all'];
27
+ // -------------------------------------------------------------------------
28
+ // Configuration Schema (v4.5)
29
+ // -------------------------------------------------------------------------
30
+ static configSchema = {
31
+ showCheckboxes: {
32
+ type: 'boolean',
33
+ default: true,
34
+ description: 'Show criteria as checkboxes for progress tracking',
35
+ },
36
+ };
37
+ // -------------------------------------------------------------------------
38
+ // Pattern Data
39
+ // -------------------------------------------------------------------------
23
40
  // Indicators that success criteria already exist
24
41
  successIndicators = [
25
42
  'success criteria',
@@ -1,18 +1,20 @@
1
- import { BasePattern } from './base-pattern.js';
2
- import { PromptIntent, OptimizationMode, PatternContext, PatternResult } from '../types.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema } from './base-pattern.js';
2
+ import { PromptIntent, PatternContext, PatternResult } from '../types.js';
3
3
  /**
4
- * v4.3.2 PRD Pattern: SuccessMetricsEnforcer
4
+ * v4.5 Pattern: Success Metrics Enforcer
5
5
  *
6
6
  * Ensures measurable success criteria exist in PRD content.
7
7
  * Adds KPIs and metrics when missing.
8
8
  */
9
9
  export declare class SuccessMetricsEnforcer extends BasePattern {
10
- id: string;
11
- name: string;
12
- description: string;
13
- applicableIntents: PromptIntent[];
14
- mode: OptimizationMode | 'both';
15
- priority: number;
10
+ readonly id = "success-metrics-enforcer";
11
+ readonly name = "Success Metrics Enforcer";
12
+ readonly description = "Ensures measurable success criteria exist";
13
+ readonly applicableIntents: PromptIntent[];
14
+ readonly mode: PatternMode;
15
+ readonly priority: PatternPriority;
16
+ readonly phases: PatternPhase[];
17
+ static readonly configSchema: PatternConfigSchema;
16
18
  apply(prompt: string, _context: PatternContext): PatternResult;
17
19
  private hasSuccessMetrics;
18
20
  private needsMetrics;
@@ -1,17 +1,40 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, } from './base-pattern.js';
2
2
  /**
3
- * v4.3.2 PRD Pattern: SuccessMetricsEnforcer
3
+ * v4.5 Pattern: Success Metrics Enforcer
4
4
  *
5
5
  * Ensures measurable success criteria exist in PRD content.
6
6
  * Adds KPIs and metrics when missing.
7
7
  */
8
8
  export class SuccessMetricsEnforcer extends BasePattern {
9
+ // -------------------------------------------------------------------------
10
+ // Pattern Metadata (v4.5 unified types)
11
+ // -------------------------------------------------------------------------
9
12
  id = 'success-metrics-enforcer';
10
- name = 'SuccessMetricsEnforcer';
13
+ name = 'Success Metrics Enforcer';
11
14
  description = 'Ensures measurable success criteria exist';
12
15
  applicableIntents = ['prd-generation', 'planning'];
13
16
  mode = 'deep';
14
- priority = 7;
17
+ priority = 7; // MEDIUM-HIGH - important enrichment
18
+ phases = ['question-validation', 'output-generation'];
19
+ // -------------------------------------------------------------------------
20
+ // Configuration Schema (v4.5)
21
+ // -------------------------------------------------------------------------
22
+ static configSchema = {
23
+ maxKPIs: {
24
+ type: 'number',
25
+ default: 4,
26
+ description: 'Maximum number of KPIs to suggest',
27
+ validation: { min: 1, max: 8 },
28
+ },
29
+ includeMeasurementGuidance: {
30
+ type: 'boolean',
31
+ default: true,
32
+ description: 'Include guidance on how to measure success',
33
+ },
34
+ };
35
+ // -------------------------------------------------------------------------
36
+ // Pattern Application
37
+ // -------------------------------------------------------------------------
15
38
  apply(prompt, _context) {
16
39
  // Check if success metrics already exist
17
40
  if (this.hasSuccessMetrics(prompt)) {
@@ -1,12 +1,21 @@
1
- import { BasePattern } from './base-pattern.js';
1
+ import { BasePattern, PatternMode, PatternPriority, PatternPhase, PatternConfigSchema, PatternDependency } from './base-pattern.js';
2
2
  import { PatternContext, PatternResult, PromptIntent } from '../types.js';
3
+ /**
4
+ * v4.5 Pattern: Technical Context Enricher
5
+ *
6
+ * Adds missing technical context (language, framework, versions).
7
+ * Detects technologies and suggests version specifications.
8
+ */
3
9
  export declare class TechnicalContextEnricher extends BasePattern {
4
- id: string;
5
- name: string;
6
- description: string;
7
- applicableIntents: PromptIntent[];
8
- mode: 'fast' | 'deep' | 'both';
9
- priority: number;
10
+ readonly id = "technical-context-enricher";
11
+ readonly name = "Technical Context Enricher";
12
+ readonly description = "Adds missing technical context (language, framework, versions)";
13
+ readonly applicableIntents: PromptIntent[];
14
+ readonly mode: PatternMode;
15
+ readonly priority: PatternPriority;
16
+ readonly phases: PatternPhase[];
17
+ readonly dependencies: PatternDependency;
18
+ static readonly configSchema: PatternConfigSchema;
10
19
  apply(prompt: string, context: PatternContext): PatternResult;
11
20
  private hasTechnicalContext;
12
21
  private detectLanguage;