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,18 +1,12 @@
1
- ## Saving the {{OUTPUT_TYPE}} (REQUIRED)
1
+ ## Saving the {{OUTPUT_TYPE}} (REQUIRED - v5 Agentic-First)
2
2
 
3
- After displaying the {{OUTPUT_DESC}}, you MUST save it to ensure it's available for the prompt lifecycle workflow.
3
+ After displaying the {{OUTPUT_DESC}}, you MUST save it using your native tools.
4
4
 
5
- **If user ran CLI command** (`clavix {{CLI_COMMAND}} "prompt"`):
6
- - {{OUTPUT_TYPE}} is automatically saved ✓
7
- - Skip to "Executing the Saved {{OUTPUT_TYPE}}" section below
8
-
9
- **If you are executing this slash command** (`/clavix:{{SLASH_COMMAND}}`):
10
- - You MUST save the {{OUTPUT_TYPE}} manually
11
- - Follow these steps:
5
+ **In v5, you save files directly - no CLI commands involved.**
12
6
 
13
7
  ### Step 1: Create Directory Structure
14
8
  ```bash
15
- mkdir -p .clavix/outputs/prompts/{{OUTPUT_DIR}}
9
+ mkdir -p .clavix/outputs/prompts
16
10
  ```
17
11
 
18
12
  ### Step 2: Generate Unique {{OUTPUT_TYPE}} ID
@@ -21,27 +15,26 @@ Create a unique identifier using this format:
21
15
  - **Example**: `{{OUTPUT_DIR}}-20250117-143022-a3f2`
22
16
  - Use current timestamp + random 4-character suffix
23
17
 
24
- ### Step 3: Save {{OUTPUT_TYPE}} File
18
+ ### Step 3: Save {{OUTPUT_TYPE}} File with Frontmatter
25
19
  Use the Write tool to create the {{OUTPUT_TYPE}} file at:
26
- - **Path**: `.clavix/outputs/prompts/{{OUTPUT_DIR}}/<{{OUTPUT_TYPE}}-id>.md`
27
-
28
- ### Step 4: Update Index File
29
- Use the Write tool to update the index at `.clavix/outputs/prompts/{{OUTPUT_DIR}}/.index.json`:
20
+ - **Path**: `.clavix/outputs/prompts/<{{OUTPUT_TYPE}}-id>.md`
30
21
 
31
- **If index file doesn't exist**, create it with:
32
- ```json
33
- {
34
- "version": "1.0",
35
- "prompts": []
36
- }
37
- ```
22
+ **File format:**
23
+ ```markdown
24
+ ---
25
+ id: <{{OUTPUT_TYPE}}-id>
26
+ timestamp: <ISO-8601 timestamp>
27
+ executed: false
28
+ originalPrompt: "<user's original text>"
29
+ ---
38
30
 
39
- **Then add a new metadata entry** to the `prompts` array.
31
+ # {{OUTPUT_TYPE}}
40
32
 
41
- **Important**: Read the existing index first, append the new entry to the `prompts` array, then write the updated index back.
33
+ <content here>
34
+ ```
42
35
 
43
- ### Step 5: Verify Saving Succeeded
36
+ ### Step 4: Verify Saving Succeeded
44
37
  Confirm:
45
- - File exists at `.clavix/outputs/prompts/{{OUTPUT_DIR}}/<{{OUTPUT_TYPE}}-id>.md`
46
- - Index file updated with new entry
38
+ - File exists at `.clavix/outputs/prompts/<{{OUTPUT_TYPE}}-id>.md`
39
+ - File has valid frontmatter with id, timestamp, executed fields
47
40
  - Display success message: `✓ {{OUTPUT_TYPE}} saved: <{{OUTPUT_TYPE}}-id>.md`
@@ -29,8 +29,8 @@ Patterns: 7 applied (comprehensive depth)
29
29
  StructureOrganizer → Reorganized into 4 sections
30
30
  TechnicalContextEnricher → Added React 18, TypeScript context
31
31
  CompletenessValidator → Flagged 3 missing requirements
32
- EdgeCaseIdentifier → Added 4 edge cases (auth, network, state, browser)
33
- ValidationChecklistCreatorGenerated 6-item verification checklist
32
+ DomainContextEnricher → Added best practices for React components
33
+ SuccessCriteriaEnforcerAdded measurable acceptance criteria
34
34
  ```
35
35
 
36
36
  ### Pattern Impact Indicators
@@ -43,43 +43,32 @@ Patterns: 7 applied (comprehensive depth)
43
43
 
44
44
  ### Available Patterns Reference
45
45
 
46
- **Standard Patterns (both scopes):**
46
+ **v4.12: Core Patterns (standard + comprehensive, scope='both'):**
47
47
  | Pattern | Priority | What It Does |
48
48
  |---------|----------|--------------|
49
- | ConcisenessFilter | 4 | Removes pleasantries, filler words, redundant phrases |
50
49
  | ObjectiveClarifier | 9 | Adds clear objective/goal statement if missing |
51
- | StructureOrganizer | 8 | Reorders into logical flow: context→requirements→constraints→output |
52
- | ActionabilityEnhancer | 4 | Converts vague language to specific, actionable terms |
53
- | TechnicalContextEnricher | 5 | Adds missing technical context (frameworks, tools, versions) |
54
- | CompletenessValidator | 6 | Identifies and flags missing required elements |
55
- | StepDecomposer | 5 | Breaks complex prompts into sequential steps |
56
- | ContextPrecisionBooster | 6 | Adds precise context when missing |
57
50
  | AmbiguityDetector | 9 | Identifies and flags ambiguous terms |
51
+ | StructureOrganizer | 8 | Reorders into logical flow: context→requirements→constraints→output |
58
52
  | OutputFormatEnforcer | 7 | Adds explicit output format specifications |
59
53
  | SuccessCriteriaEnforcer | 7 | Adds measurable success criteria |
54
+ | ContextPrecisionBooster | 6 | Adds precise context when missing |
55
+ | CompletenessValidator | 6 | Identifies and flags missing required elements |
56
+ | TechnicalContextEnricher | 5 | Adds missing technical context (frameworks, tools, versions) |
57
+ | StepDecomposer | 5 | Breaks complex prompts into sequential steps |
60
58
  | DomainContextEnricher | 5 | Adds domain-specific best practices |
59
+ | ConcisenessFilter | 4 | Removes pleasantries, filler words, redundant phrases |
60
+ | ActionabilityEnhancer | 4 | Converts vague language to specific, actionable terms |
61
61
 
62
- **Comprehensive Depth Exclusive Patterns:**
62
+ **v4.12 PRD Mode Patterns (comprehensive only):**
63
63
  | Pattern | Priority | What It Does |
64
64
  |---------|----------|--------------|
65
- | AlternativePhrasingGenerator | 3 | Generates 2-3 alternative prompt structures |
66
- | EdgeCaseIdentifier | 4 | Identifies domain-specific edge cases |
67
- | ValidationChecklistCreator | 3 | Creates implementation verification checklist |
68
- | AssumptionExplicitizer | 6 | Makes implicit assumptions explicit |
69
- | ScopeDefiner | 5 | Adds explicit scope boundaries |
70
65
  | PRDStructureEnforcer | 9 | Ensures PRD completeness (PRD mode only) |
71
- | ErrorToleranceEnhancer | 5 | Adds error handling requirements |
72
- | PrerequisiteIdentifier | 6 | Identifies prerequisites and dependencies |
73
-
74
- **v4.3.2 PRD Mode Patterns (comprehensive):**
75
- | Pattern | Priority | What It Does |
76
- |---------|----------|--------------|
77
66
  | RequirementPrioritizer | 7 | Separates must-have from nice-to-have requirements |
78
- | UserPersonaEnricher | 6 | Adds missing user context and personas |
79
67
  | SuccessMetricsEnforcer | 7 | Ensures measurable success criteria exist |
68
+ | UserPersonaEnricher | 6 | Adds missing user context and personas |
80
69
  | DependencyIdentifier | 5 | Identifies technical and external dependencies |
81
70
 
82
- **v4.3.2 Conversational Mode Patterns (comprehensive):**
71
+ **v4.12 Conversational Mode Patterns (comprehensive only):**
83
72
  | Pattern | Priority | What It Does |
84
73
  |---------|----------|--------------|
85
74
  | ConversationSummarizer | 8 | Extracts structured requirements from messages |
@@ -107,23 +96,17 @@ Skipped patterns:
107
96
  ### Pattern Categories Summary
108
97
 
109
98
  ```
110
- Standard (both scopes):
111
- ConcisenessFilter, ObjectiveClarifier, StructureOrganizer,
112
- ActionabilityEnhancer, TechnicalContextEnricher, CompletenessValidator,
113
- StepDecomposer, ContextPrecisionBooster,
114
- AmbiguityDetector, OutputFormatEnforcer, SuccessCriteriaEnforcer,
115
- DomainContextEnricher
116
-
117
- Comprehensive only:
118
- AlternativePhrasingGenerator, EdgeCaseIdentifier, ValidationChecklistCreator,
119
- AssumptionExplicitizer, ScopeDefiner, PRDStructureEnforcer,
120
- ErrorToleranceEnhancer, PrerequisiteIdentifier
121
-
122
- v4.3.2 PRD mode (comprehensive):
123
- RequirementPrioritizer, UserPersonaEnricher, SuccessMetricsEnforcer,
124
- DependencyIdentifier
125
-
126
- v4.3.2 Conversational mode (comprehensive):
99
+ v4.12: Core patterns (standard + comprehensive, 12 patterns):
100
+ ObjectiveClarifier, AmbiguityDetector, StructureOrganizer,
101
+ OutputFormatEnforcer, SuccessCriteriaEnforcer, ContextPrecisionBooster,
102
+ CompletenessValidator, TechnicalContextEnricher, StepDecomposer,
103
+ DomainContextEnricher, ConcisenessFilter, ActionabilityEnhancer
104
+
105
+ PRD mode (comprehensive only, 5 patterns):
106
+ PRDStructureEnforcer, RequirementPrioritizer, SuccessMetricsEnforcer,
107
+ UserPersonaEnricher, DependencyIdentifier
108
+
109
+ Conversational mode (comprehensive only, 3 patterns):
127
110
  ConversationSummarizer, TopicCoherenceAnalyzer, ImplicitRequirementExtractor
128
111
  ```
129
112
 
@@ -131,9 +114,9 @@ v4.3.2 Conversational mode (comprehensive):
131
114
 
132
115
  | Depth | Patterns Available | Typical Applied |
133
116
  |------|-------------------|-----------------|
134
- | Standard | 12 patterns | 4-7 patterns |
135
- | Comprehensive | 27 patterns | 8-14 patterns |
136
- | PRD mode | 12+ patterns | 8-12 patterns |
137
- | Conversational | 3+ patterns | 1-3 patterns |
117
+ | Standard | 12 patterns | 4-8 patterns |
118
+ | Comprehensive | 20 patterns | 8-15 patterns |
119
+ | PRD mode | 17 patterns | 8-12 patterns |
120
+ | Conversational | 15 patterns | 6-10 patterns |
138
121
 
139
- **Note:** Comprehensive depth has access to all 27 patterns. Pattern selection varies by intent - some patterns only apply to specific intents (e.g., PRDStructureEnforcer only for prd-generation), so typical applied count is 8-14.
122
+ **Note:** v4.12 has 20 total patterns after removing 7 boilerplate patterns that generated static output. Pattern selection varies by intent - some patterns only apply to specific intents (e.g., PRDStructureEnforcer only for prd-generation). Standard depth gets 12 core patterns; comprehensive adds mode-specific patterns.
@@ -2,13 +2,12 @@
2
2
 
3
3
  **Error: Cannot create directory**
4
4
  ```bash
5
- mkdir -p .clavix/outputs/prompts/{{OUTPUT_DIR}}
5
+ mkdir -p .clavix/outputs/prompts
6
6
  ```
7
7
 
8
- **Error: Index file corrupted or invalid JSON**
9
- ```bash
10
- echo '{"version":"1.0","prompts":[]}' > .clavix/outputs/prompts/{{OUTPUT_DIR}}/.index.json
11
- ```
8
+ **Error: Prompt file has invalid frontmatter**
9
+ - Re-save the file with valid YAML frontmatter
10
+ - Ensure id, timestamp, and executed fields are present in frontmatter
12
11
 
13
12
  **Error: Duplicate {{OUTPUT_TYPE}} ID**
14
13
  - Generate a new ID with a different timestamp or random suffix
@@ -14,12 +14,69 @@ export interface ClavixConfig {
14
14
  * v4.4 Intelligence Configuration
15
15
  * Configure pattern behavior, enable/disable patterns, adjust priorities
16
16
  * v4.11: Removed defaultMode (fast/deep replaced by improve with auto-detection)
17
+ * v4.12: Added escalation thresholds configuration
17
18
  */
18
19
  export interface IntelligenceConfig {
19
20
  /** Pattern-specific settings */
20
21
  patterns?: PatternSettingsConfig;
21
22
  /** Enable verbose pattern logging */
22
23
  verbosePatternLogs?: boolean;
24
+ /** v4.12: Escalation threshold configuration */
25
+ escalation?: EscalationThresholdsConfig;
26
+ /** v4.12: Quality assessment weight overrides */
27
+ qualityWeights?: QualityWeightsConfig;
28
+ }
29
+ /**
30
+ * v4.12: Configurable escalation thresholds
31
+ * These control when comprehensive analysis is recommended vs standard
32
+ */
33
+ export interface EscalationThresholdsConfig {
34
+ /**
35
+ * Quality score threshold for comprehensive mode (default: 75)
36
+ * Prompts >= this score get comprehensive analysis
37
+ */
38
+ comprehensiveAbove?: number;
39
+ /**
40
+ * Quality score threshold for standard mode floor (default: 60)
41
+ * Prompts between standardFloor and comprehensiveAbove get standard optimization
42
+ */
43
+ standardFloor?: number;
44
+ /**
45
+ * Intent confidence threshold for auto-proceed (default: 50)
46
+ * Below this, ask user to confirm intent
47
+ */
48
+ intentConfidenceMin?: number;
49
+ /**
50
+ * Escalation score threshold for strong recommendation (default: 75)
51
+ * Above this, strongly recommend comprehensive mode
52
+ */
53
+ strongRecommendAbove?: number;
54
+ /**
55
+ * Escalation score threshold for suggestion (default: 45)
56
+ * Above this, suggest comprehensive mode as option
57
+ */
58
+ suggestAbove?: number;
59
+ }
60
+ /**
61
+ * v4.12: Quality dimension weight overrides by intent
62
+ * Allows customizing how quality scores are weighted per intent type
63
+ */
64
+ export interface QualityWeightsConfig {
65
+ /** Override weights for specific intents */
66
+ byIntent?: Record<string, QualityDimensionWeights>;
67
+ /** Default weights for all intents (overrides built-in defaults) */
68
+ defaults?: QualityDimensionWeights;
69
+ }
70
+ /**
71
+ * Weight distribution across quality dimensions (must sum to 100)
72
+ */
73
+ export interface QualityDimensionWeights {
74
+ clarity?: number;
75
+ efficiency?: number;
76
+ structure?: number;
77
+ completeness?: number;
78
+ actionability?: number;
79
+ specificity?: number;
23
80
  }
24
81
  /**
25
82
  * Pattern-specific settings
@@ -1,9 +1,34 @@
1
1
  import * as path from 'path';
2
2
  import { FileSystem } from './file-system.js';
3
+ /**
4
+ * v4.12: Deprecated commands that have been replaced
5
+ * - fast → improve (unified with auto-depth)
6
+ * - deep → improve --comprehensive
7
+ */
8
+ const DEPRECATED_COMMANDS = ['fast', 'deep'];
3
9
  export async function collectLegacyCommandFiles(adapter, commandNames) {
4
10
  const legacyPaths = new Set();
5
11
  const extension = adapter.fileExtension;
6
12
  const commandDir = path.resolve(adapter.getCommandPath());
13
+ // v4.12: Clean up deprecated fast/deep commands
14
+ for (const deprecatedName of DEPRECATED_COMMANDS) {
15
+ // Check for various naming patterns across adapters
16
+ const candidates = [
17
+ path.resolve(commandDir, `${deprecatedName}${extension}`),
18
+ path.resolve(commandDir, `clavix-${deprecatedName}${extension}`),
19
+ path.resolve(commandDir, `clavix:${deprecatedName}${extension}`),
20
+ ];
21
+ // For Claude Code with subdirectory structure
22
+ if (adapter.name === 'claude-code') {
23
+ const clavixDir = path.resolve(commandDir, 'clavix');
24
+ candidates.push(path.resolve(clavixDir, `${deprecatedName}${extension}`), path.resolve(clavixDir, `clavix-${deprecatedName}${extension}`));
25
+ }
26
+ for (const candidate of candidates) {
27
+ if (await FileSystem.exists(candidate)) {
28
+ legacyPaths.add(candidate);
29
+ }
30
+ }
31
+ }
7
32
  for (const name of commandNames) {
8
33
  const newFilePath = path.resolve(commandDir, adapter.getTargetFilename(name));
9
34
  const defaultFilePath = path.resolve(commandDir, `${name}${extension}`);
@@ -15,22 +40,24 @@ export async function collectLegacyCommandFiles(adapter, commandNames) {
15
40
  ];
16
41
  for (const candidate of oldCandidates) {
17
42
  const resolvedCandidate = path.resolve(candidate);
18
- if (resolvedCandidate !== newFilePath && await FileSystem.exists(resolvedCandidate)) {
43
+ if (resolvedCandidate !== newFilePath && (await FileSystem.exists(resolvedCandidate))) {
19
44
  legacyPaths.add(resolvedCandidate);
20
45
  }
21
46
  }
22
- if (defaultFilePath !== newFilePath && await FileSystem.exists(defaultFilePath)) {
47
+ if (defaultFilePath !== newFilePath && (await FileSystem.exists(defaultFilePath))) {
23
48
  legacyPaths.add(defaultFilePath);
24
49
  }
25
50
  continue;
26
51
  }
27
52
  if (adapter.name === 'gemini' || adapter.name === 'qwen') {
28
53
  const namespaced = commandDir.endsWith(path.join('commands', 'clavix'));
29
- if (!namespaced && defaultFilePath !== newFilePath && await FileSystem.exists(defaultFilePath)) {
54
+ if (!namespaced &&
55
+ defaultFilePath !== newFilePath &&
56
+ (await FileSystem.exists(defaultFilePath))) {
30
57
  legacyPaths.add(defaultFilePath);
31
58
  }
32
59
  }
33
- else if (defaultFilePath !== newFilePath && await FileSystem.exists(defaultFilePath)) {
60
+ else if (defaultFilePath !== newFilePath && (await FileSystem.exists(defaultFilePath))) {
34
61
  legacyPaths.add(defaultFilePath);
35
62
  }
36
63
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "clavix",
3
- "version": "4.11.2",
4
- "description": "Clavix Intelligence™ for AI coding. Automatically optimizes prompts with intent detection, quality assessment, and adaptive patterns—no framework to learn. Works with Claude Code, Cursor, Windsurf, and 19+ other AI coding tools.",
3
+ "version": "5.0.0",
4
+ "description": "Agentic-first prompt workflows. Markdown templates that teach AI agents how to optimize prompts, create PRDs, and manage implementation. Works with Claude Code, Cursor, Windsurf, and 19+ other AI coding tools.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -42,7 +42,7 @@
42
42
  "ai",
43
43
  "prompt",
44
44
  "prompt-optimization",
45
- "prompt-intelligence",
45
+ "prompt-structuring",
46
46
  "intent-detection",
47
47
  "quality-assessment",
48
48
  "prd",
@@ -53,7 +53,8 @@
53
53
  "developer-tools",
54
54
  "prompt-engineering",
55
55
  "ai-coding-tools",
56
- "requirements"
56
+ "requirements",
57
+ "workflow"
57
58
  ],
58
59
  "author": "ClavixDev",
59
60
  "license": "Apache-2.0",
@@ -1,17 +0,0 @@
1
- import { Command } from '@oclif/core';
2
- export default class Analyze extends Command {
3
- static description: string;
4
- static examples: string[];
5
- static flags: {
6
- pretty: import("@oclif/core/interfaces").BooleanFlag<boolean>;
7
- };
8
- static args: {
9
- prompt: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
10
- };
11
- run(): Promise<void>;
12
- /**
13
- * v4.11: Calculate escalation with unified improve mode
14
- */
15
- private calculateEscalation;
16
- }
17
- //# sourceMappingURL=analyze.d.ts.map
@@ -1,133 +0,0 @@
1
- import { Command, Args, Flags } from '@oclif/core';
2
- import { UniversalOptimizer } from '../../core/intelligence/index.js';
3
- export default class Analyze extends Command {
4
- static description = 'Analyze a prompt and return structured JSON with intent, quality, and escalation data';
5
- static examples = [
6
- '<%= config.bin %> <%= command.id %> "Create a login page"',
7
- '<%= config.bin %> <%= command.id %> "Build an API for user management" --pretty',
8
- ];
9
- static flags = {
10
- pretty: Flags.boolean({
11
- char: 'p',
12
- description: 'Pretty-print the JSON output',
13
- default: false,
14
- }),
15
- };
16
- static args = {
17
- prompt: Args.string({
18
- description: 'The prompt to analyze',
19
- required: true,
20
- }),
21
- };
22
- async run() {
23
- const { args, flags } = await this.parse(Analyze);
24
- if (!args.prompt || args.prompt.trim().length === 0) {
25
- const errorOutput = {
26
- error: 'No prompt provided',
27
- message: 'Please provide a prompt to analyze',
28
- };
29
- console.log(JSON.stringify(errorOutput, null, flags.pretty ? 2 : 0));
30
- this.exit(1);
31
- return;
32
- }
33
- const optimizer = new UniversalOptimizer();
34
- // v4.11: Use 'improve' mode for analysis
35
- const result = await optimizer.optimize(args.prompt, 'improve');
36
- // Calculate escalation score and recommendation
37
- const escalation = this.calculateEscalation(result);
38
- // Build the analysis result
39
- const analysisResult = {
40
- intent: result.intent.primaryIntent,
41
- confidence: result.intent.confidence,
42
- quality: {
43
- overall: Math.round(result.quality.overall),
44
- clarity: Math.round(result.quality.clarity),
45
- efficiency: Math.round(result.quality.efficiency),
46
- structure: Math.round(result.quality.structure),
47
- completeness: Math.round(result.quality.completeness),
48
- actionability: Math.round(result.quality.actionability),
49
- specificity: Math.round(result.quality.specificity ?? 0),
50
- },
51
- escalation,
52
- characteristics: {
53
- hasCodeContext: result.intent.characteristics.hasCodeContext,
54
- hasTechnicalTerms: result.intent.characteristics.hasTechnicalTerms,
55
- isOpenEnded: result.intent.characteristics.isOpenEnded,
56
- needsStructure: result.intent.characteristics.needsStructure,
57
- },
58
- };
59
- // Output as JSON
60
- console.log(JSON.stringify(analysisResult, null, flags.pretty ? 2 : 0));
61
- }
62
- /**
63
- * v4.11: Calculate escalation with unified improve mode
64
- */
65
- calculateEscalation(result) {
66
- const factors = [];
67
- let score = 0;
68
- // Quality-based factors
69
- if (result.quality.overall < 50) {
70
- score += 30;
71
- factors.push('low overall quality');
72
- }
73
- else if (result.quality.overall < 65) {
74
- score += 15;
75
- factors.push('moderate quality - could be improved');
76
- }
77
- if (result.quality.clarity < 50) {
78
- score += 15;
79
- factors.push('unclear objective');
80
- }
81
- if (result.quality.completeness < 50) {
82
- score += 20;
83
- factors.push('missing technical requirements');
84
- }
85
- if (result.quality.actionability < 50) {
86
- score += 15;
87
- factors.push('vague scope');
88
- }
89
- // Intent-based factors
90
- if (result.intent.primaryIntent === 'planning') {
91
- score += 15;
92
- factors.push('planning intent - benefits from exploration');
93
- }
94
- if (result.intent.primaryIntent === 'prd-generation') {
95
- score += 25;
96
- factors.push('PRD generation - needs strategic planning');
97
- }
98
- // Characteristics-based factors
99
- if (result.intent.characteristics.isOpenEnded && result.intent.characteristics.needsStructure) {
100
- score += 10;
101
- factors.push('open-ended without structure');
102
- }
103
- // Confidence-based factors
104
- if (result.intent.confidence < 70) {
105
- score += 10;
106
- factors.push('low intent confidence');
107
- }
108
- // v4.11: Determine recommendation based on score and intent
109
- let recommend = 'improve';
110
- let recommendedDepth = 'standard';
111
- if (result.intent.primaryIntent === 'prd-generation') {
112
- recommend = 'prd';
113
- }
114
- else if (score >= 60 || result.quality.overall < 50) {
115
- recommendedDepth = 'comprehensive';
116
- }
117
- else if (score >= 35) {
118
- recommendedDepth = 'comprehensive';
119
- }
120
- // Check for strategic keywords that suggest PRD mode
121
- const strategicIntents = ['planning', 'prd-generation', 'documentation'];
122
- if (strategicIntents.includes(result.intent.primaryIntent) && score >= 50) {
123
- recommend = 'prd';
124
- }
125
- return {
126
- score: Math.min(100, score),
127
- recommend,
128
- recommendedDepth: recommend === 'improve' ? recommendedDepth : undefined,
129
- factors,
130
- };
131
- }
132
- }
133
- //# sourceMappingURL=analyze.js.map
@@ -1,36 +0,0 @@
1
- import { Command } from '@oclif/core';
2
- export default class Archive extends Command {
3
- static description: string;
4
- static examples: string[];
5
- static args: {
6
- project: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
- };
8
- static flags: {
9
- list: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
- force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
- yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
- restore: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
- };
14
- run(): Promise<void>;
15
- /**
16
- * Interactive archive mode - show list of archivable projects
17
- */
18
- private interactiveArchive;
19
- /**
20
- * Archive a specific project by name
21
- */
22
- private archiveSpecificProject;
23
- /**
24
- * List all archived projects
25
- */
26
- private listArchivedProjects;
27
- /**
28
- * Restore an archived project
29
- */
30
- private restoreProject;
31
- /**
32
- * Display project details (helper for formatting)
33
- */
34
- private displayProjectInfo;
35
- }
36
- //# sourceMappingURL=archive.d.ts.map