clavix 5.3.1 → 5.5.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.
package/README.md CHANGED
@@ -12,9 +12,8 @@
12
12
 
13
13
  | Version | Highlights | Details |
14
14
  | --- | --- | --- |
15
- | **v5.2.1** (Latest) | Diagnose command, DRY architecture, feature matrix | [Changelog](CHANGELOG.md) |
15
+ | **v5.5.0** (Latest) | Architecture cleanup, consolidated adapters, documentation overhaul | [Changelog](CHANGELOG.md) |
16
16
  | **v5.0.0** | Agentic-first architecture - lean template delivery | [Changelog](CHANGELOG.md#500---2025-01-27) |
17
- | **v4.12.0** | Final v4 release with full CLI commands | [Changelog](docs/archive/v4-changelog.md) |
18
17
 
19
18
  **Requirements:** Node.js >= 18.0.0
20
19
 
@@ -129,7 +128,6 @@ Clavix v5 has 4 CLI commands (for setup and diagnostics, not workflows):
129
128
  - Integrations: [docs/integrations.md](docs/integrations.md)
130
129
  - How it works: [docs/how-it-works.md](docs/how-it-works.md)
131
130
  - Philosophy: [docs/philosophy.md](docs/philosophy.md)
132
- - v4 Architecture (archived): [docs/archive/v4-architecture.md](docs/archive/v4-architecture.md)
133
131
 
134
132
  ## Requirements
135
133
 
@@ -55,7 +55,7 @@ export default class Update extends Command {
55
55
  const updateDocs = flags['docs-only'] || (!flags['docs-only'] && !flags['commands-only']);
56
56
  const updateCommands = flags['commands-only'] || (!flags['docs-only'] && !flags['commands-only']);
57
57
  let updatedCount = 0;
58
- // Update for each provider
58
+ // Update for each integration
59
59
  for (const integrationName of integrations) {
60
60
  // Handle AGENTS.md separately
61
61
  if (integrationName === 'agents-md') {
@@ -50,10 +50,5 @@ export declare abstract class BaseAdapter implements AgentAdapter {
50
50
  * Override if integration needs doc injection (like Claude Code)
51
51
  */
52
52
  injectDocumentation(_blocks: ManagedBlock[]): Promise<void>;
53
- /**
54
- * Escape special regex characters
55
- * @deprecated Use escapeRegex from utils/string-utils.js directly
56
- */
57
- protected escapeRegex(str: string): string;
58
53
  }
59
54
  //# sourceMappingURL=base-adapter.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import * as path from 'path';
2
2
  import { FileSystem } from '../../utils/file-system.js';
3
3
  import { IntegrationError } from '../../types/errors.js';
4
- import { escapeRegex } from '../../utils/string-utils.js';
4
+ import { logger } from '../../utils/logger.js';
5
5
  /**
6
6
  * Base adapter class with shared logic for all integrations
7
7
  * Ensures consistency and reduces code duplication
@@ -82,7 +82,7 @@ export class BaseAdapter {
82
82
  }
83
83
  catch (error) {
84
84
  // Log warning but continue with other files
85
- console.warn(`Failed to remove ${filePath}: ${error}`);
85
+ logger.warn(`Failed to remove ${filePath}: ${error}`);
86
86
  }
87
87
  }
88
88
  // Also remove clavix/ subdirectory if it exists (legacy cleanup)
@@ -93,7 +93,7 @@ export class BaseAdapter {
93
93
  removed++;
94
94
  }
95
95
  catch (error) {
96
- console.warn(`Failed to remove ${clavixSubdir}: ${error}`);
96
+ logger.warn(`Failed to remove ${clavixSubdir}: ${error}`);
97
97
  }
98
98
  }
99
99
  return removed;
@@ -145,12 +145,5 @@ export class BaseAdapter {
145
145
  // Default: no documentation injection
146
146
  // Override in subclasses if needed
147
147
  }
148
- /**
149
- * Escape special regex characters
150
- * @deprecated Use escapeRegex from utils/string-utils.js directly
151
- */
152
- escapeRegex(str) {
153
- return escapeRegex(str);
154
- }
155
148
  }
156
149
  //# sourceMappingURL=base-adapter.js.map
@@ -2,6 +2,7 @@ import * as path from 'path';
2
2
  import { BaseAdapter } from './base-adapter.js';
3
3
  import { FileSystem } from '../../utils/file-system.js';
4
4
  import { IntegrationError } from '../../types/errors.js';
5
+ import { escapeRegex } from '../../utils/string-utils.js';
5
6
  /**
6
7
  * Claude Code agent adapter
7
8
  */
@@ -65,7 +66,7 @@ export class ClaudeCodeAdapter extends BaseAdapter {
65
66
  const dir = path.dirname(fullPath);
66
67
  await FileSystem.ensureDir(dir);
67
68
  }
68
- const blockRegex = new RegExp(`${this.escapeRegex(startMarker)}[\\s\\S]*?${this.escapeRegex(endMarker)}`, 'g');
69
+ const blockRegex = new RegExp(`${escapeRegex(startMarker)}[\\s\\S]*?${escapeRegex(endMarker)}`, 'g');
69
70
  const wrappedContent = `${startMarker}\n${content}\n${endMarker}`;
70
71
  if (blockRegex.test(fileContent)) {
71
72
  // Replace existing block
@@ -15,6 +15,7 @@ import { AdapterConfig } from '../../types/adapter-config.js';
15
15
  import { IntegrationFeatures } from '../../types/agent.js';
16
16
  export declare class UniversalAdapter extends BaseAdapter {
17
17
  private config;
18
+ readonly features: IntegrationFeatures;
18
19
  constructor(config: AdapterConfig);
19
20
  get name(): string;
20
21
  get displayName(): string;
@@ -14,9 +14,18 @@ import { BaseAdapter } from './base-adapter.js';
14
14
  import * as path from 'path';
15
15
  export class UniversalAdapter extends BaseAdapter {
16
16
  config;
17
+ features;
17
18
  constructor(config) {
18
19
  super();
19
20
  this.config = config;
21
+ // Set features from config for interface compatibility
22
+ this.features = {
23
+ supportsSubdirectories: config.features.supportsSubdirectories,
24
+ supportsFrontmatter: config.features.supportsFrontmatter,
25
+ commandFormat: {
26
+ separator: config.features.commandSeparator,
27
+ },
28
+ };
20
29
  }
21
30
  get name() {
22
31
  return this.config.name;
@@ -1,6 +1,11 @@
1
1
  import { AgentAdapter, ValidationResult } from '../types/agent.js';
2
2
  /**
3
3
  * Agent Manager - handles agent detection and registration
4
+ *
5
+ * Uses factory pattern with ADAPTER_CONFIGS for simple adapters,
6
+ * while keeping dedicated classes for special adapters (TOML, doc injection).
7
+ *
8
+ * @since v5.5.0 - Refactored to use config-driven factory pattern
4
9
  */
5
10
  export declare class AgentManager {
6
11
  private adapters;
@@ -1,43 +1,33 @@
1
1
  import { ClaudeCodeAdapter } from './adapters/claude-code-adapter.js';
2
- import { CursorAdapter } from './adapters/cursor-adapter.js';
3
- import { DroidAdapter } from './adapters/droid-adapter.js';
4
- import { OpenCodeAdapter } from './adapters/opencode-adapter.js';
5
- import { AmpAdapter } from './adapters/amp-adapter.js';
6
- import { CrushAdapter } from './adapters/crush-adapter.js';
7
- import { WindsurfAdapter } from './adapters/windsurf-adapter.js';
8
- import { KilocodeAdapter } from './adapters/kilocode-adapter.js';
9
- import { ClineAdapter } from './adapters/cline-adapter.js';
10
- import { RoocodeAdapter } from './adapters/roocode-adapter.js';
11
- import { IntegrationError } from '../types/errors.js';
12
- import { CodeBuddyAdapter } from './adapters/codebuddy-adapter.js';
13
2
  import { GeminiAdapter } from './adapters/gemini-adapter.js';
14
3
  import { QwenAdapter } from './adapters/qwen-adapter.js';
15
- import { CodexAdapter } from './adapters/codex-adapter.js';
16
- import { AugmentAdapter } from './adapters/augment-adapter.js';
17
4
  import { LlxprtAdapter } from './adapters/llxprt-adapter.js';
5
+ import { UniversalAdapter } from './adapters/universal-adapter.js';
6
+ import { getSimpleAdapters } from './adapter-registry.js';
7
+ import { IntegrationError } from '../types/errors.js';
18
8
  /**
19
9
  * Agent Manager - handles agent detection and registration
10
+ *
11
+ * Uses factory pattern with ADAPTER_CONFIGS for simple adapters,
12
+ * while keeping dedicated classes for special adapters (TOML, doc injection).
13
+ *
14
+ * @since v5.5.0 - Refactored to use config-driven factory pattern
20
15
  */
21
16
  export class AgentManager {
22
17
  adapters = new Map();
23
18
  constructor() {
24
- // Register all built-in adapters
25
- this.registerAdapter(new ClaudeCodeAdapter());
26
- this.registerAdapter(new CursorAdapter());
27
- this.registerAdapter(new DroidAdapter());
28
- this.registerAdapter(new OpenCodeAdapter());
29
- this.registerAdapter(new AmpAdapter());
30
- this.registerAdapter(new CrushAdapter());
31
- this.registerAdapter(new WindsurfAdapter());
32
- this.registerAdapter(new KilocodeAdapter());
33
- this.registerAdapter(new LlxprtAdapter());
34
- this.registerAdapter(new ClineAdapter());
35
- this.registerAdapter(new RoocodeAdapter());
36
- this.registerAdapter(new AugmentAdapter());
37
- this.registerAdapter(new CodeBuddyAdapter());
38
- this.registerAdapter(new GeminiAdapter());
39
- this.registerAdapter(new QwenAdapter());
40
- this.registerAdapter(new CodexAdapter());
19
+ // Register special adapters (require custom logic)
20
+ this.registerAdapter(new ClaudeCodeAdapter()); // Doc injection
21
+ this.registerAdapter(new GeminiAdapter()); // TOML format
22
+ this.registerAdapter(new QwenAdapter()); // TOML format
23
+ this.registerAdapter(new LlxprtAdapter()); // TOML format
24
+ // Register simple adapters from config (using UniversalAdapter factory)
25
+ for (const config of getSimpleAdapters()) {
26
+ // Skip adapters that have special handlers registered above
27
+ if (this.adapters.has(config.name))
28
+ continue;
29
+ this.registerAdapter(new UniversalAdapter(config));
30
+ }
41
31
  }
42
32
  /**
43
33
  * Register a new agent adapter
@@ -2,6 +2,7 @@ import * as path from 'path';
2
2
  import { FileSystem } from '../utils/file-system.js';
3
3
  import { DataError } from '../types/errors.js';
4
4
  import { escapeRegex } from '../utils/string-utils.js';
5
+ import { logger } from '../utils/logger.js';
5
6
  /**
6
7
  * DocInjector - manages injection and updating of managed blocks in documentation files
7
8
  */
@@ -124,7 +125,7 @@ export class DocInjector {
124
125
  const openBrackets = (content.match(/\[/g) || []).length;
125
126
  const closeBrackets = (content.match(/\]/g) || []).length;
126
127
  if (openBrackets !== closeBrackets) {
127
- console.warn('Warning: Unbalanced brackets in markdown');
128
+ logger.warn('Unbalanced brackets in markdown');
128
129
  }
129
130
  }
130
131
  /**
@@ -20,8 +20,8 @@ Clavix helps Warp developers turn rough ideas into quality, AI-ready prompts and
20
20
  - ❌ DO NOT implement features during these workflows
21
21
 
22
22
  **IMPLEMENTATION workflows** (CODE ALLOWED):
23
- - Only after user runs execute/implement commands
24
- - Your role: Write code, execute tasks, implement features
23
+ - Only after user runs `/clavix:implement`
24
+ - Your role: Write code, implement tasks, build features
25
25
  - ✅ DO implement code during these workflows
26
26
 
27
27
  See `.clavix/instructions/core/clavix-mode.md` for complete mode documentation.
@@ -270,9 +270,11 @@ npm run validate:consistency
270
270
  - `implement.md` - Task and prompt execution workflow
271
271
 
272
272
  ### Agent Protocols
273
- - `_components/agent-protocols/decision-rules.md` - Decision logic
273
+ - `_components/agent-protocols/AGENT_MANUAL.md` - Universal agent protocols
274
+ - `_components/agent-protocols/cli-reference.md` - CLI command reference
274
275
  - `_components/agent-protocols/state-awareness.md` - Workflow state tracking
275
- - `_components/agent-protocols/error-handling.md` - Error recovery patterns
276
+ - `_components/agent-protocols/supportive-companion.md` - Conversational guidance
277
+ - `_components/agent-protocols/task-blocking.md` - Blocked task handling
276
278
 
277
279
  ### Validation
278
280
  - `scripts/validate-consistency.ts` - TypeScript ↔ Template validator
@@ -280,6 +282,6 @@ npm run validate:consistency
280
282
 
281
283
  ---
282
284
 
283
- **Last updated:** v5.1.0
285
+ **Last updated:** v5.4.0
284
286
 
285
287
  **Validation:** Run `npm run validate:consistency` before committing changes.
@@ -21,6 +21,34 @@ When you run `/clavix:archive`, I:
21
21
 
22
22
  ---
23
23
 
24
+ ## State Assertion (REQUIRED)
25
+
26
+ Before ANY action, output this confirmation:
27
+
28
+ ```
29
+ **CLAVIX MODE: Archival**
30
+ Mode: management
31
+ Purpose: Organizing completed projects
32
+ Implementation: BLOCKED (file operations only)
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Self-Correction Protocol
38
+
39
+ If you catch yourself doing any of these, STOP and correct:
40
+
41
+ 1. **Deleting Without Confirmation** - Must get explicit user confirmation for deletes
42
+ 2. **Archiving Incomplete Projects** - Should warn if tasks.md has unchecked items
43
+ 3. **Wrong Directory Operations** - Operating on wrong project directory
44
+ 4. **Skipping Safety Checks** - Not verifying project exists before operations
45
+ 5. **Silent Failures** - Not reporting when operations fail
46
+ 6. **Capability Hallucination** - Claiming Clavix can do things it cannot
47
+
48
+ **DETECT → STOP → CORRECT → RESUME**
49
+
50
+ ---
51
+
24
52
  ## CLAVIX MODE: Archival
25
53
 
26
54
  **I'm in archival mode. Organizing your completed work.**
@@ -44,6 +44,35 @@ Override auto-detection when needed:
44
44
 
45
45
  ---
46
46
 
47
+ ## State Assertion (REQUIRED)
48
+
49
+ Before ANY action, output this confirmation:
50
+
51
+ ```
52
+ **CLAVIX MODE: Implementation**
53
+ Mode: implementation
54
+ Purpose: Executing tasks or prompts with code generation
55
+ Source: [tasks.md | prompts/ | user request]
56
+ Implementation: AUTHORIZED
57
+ ```
58
+
59
+ ---
60
+
61
+ ## Self-Correction Protocol
62
+
63
+ If you catch yourself doing any of these, STOP and correct:
64
+
65
+ 1. **Skipping Auto-Detection** - Not checking for tasks.md and prompts/ before asking
66
+ 2. **Implementing Without Reading** - Starting code before reading the full task/prompt
67
+ 3. **Skipping Verification** - Not running tests after implementation
68
+ 4. **Batch Task Completion** - Marking multiple tasks done without implementing each
69
+ 5. **Ignoring Blocked Tasks** - Not reporting when a task cannot be completed
70
+ 6. **Capability Hallucination** - Claiming Clavix can do things it cannot
71
+
72
+ **DETECT → STOP → CORRECT → RESUME**
73
+
74
+ ---
75
+
47
76
  ## CLAVIX MODE: Implementation
48
77
 
49
78
  **I'm in implementation mode. Building your tasks!**
@@ -1,61 +1,49 @@
1
1
  ---
2
- name: "Clavix: Optimize Your Prompt"
3
- description: Analyze and optimize prompts with auto-detected depth
2
+ name: "Clavix: Improve Your Prompt"
3
+ description: Analyze and improve prompts with auto-detected depth
4
4
  ---
5
5
 
6
- # Clavix: Optimize Your Prompt
6
+ # Clavix: Improve Your Prompt
7
7
 
8
- ## STOP: OPTIMIZATION MODE - NOT IMPLEMENTATION
8
+ ## Important: This is Planning Mode
9
9
 
10
- **THIS IS A PROMPT OPTIMIZATION WORKFLOW. YOU MUST NOT IMPLEMENT ANYTHING.**
10
+ This is a prompt improvement workflow. Your job is to ANALYZE and IMPROVE the prompt, then STOP.
11
11
 
12
- ## Critical Understanding
12
+ **What this mode does:**
13
+ - Analyze the user's prompt for quality
14
+ - Apply improvement patterns
15
+ - Generate an optimized version
16
+ - Save to `.clavix/outputs/prompts/`
13
17
 
14
- This template exists because agents (including you) tend to "help" by doing work immediately.
15
- **That's the wrong behavior here.** Your job is to ANALYZE and IMPROVE the prompt, then STOP.
18
+ **What this mode does NOT do:**
19
+ - Write application code
20
+ - Implement features described in the prompt
21
+ - Modify files outside `.clavix/`
22
+ - Explore the codebase
16
23
 
17
- ## What "Implementation" Looks Like (ALL FORBIDDEN)
18
- - Reading project files to "understand context" before showing analysis
19
- - Writing any code files (functions, classes, components)
20
- - Creating components, features, or API endpoints
21
- - Running build/test commands on the user's project
22
- - Making git commits
23
- - ANY action that modifies files outside `.clavix/`
24
- - Exploring the codebase before outputting your analysis
25
-
26
- ## The ONLY Actions Allowed
27
- 1. Read the user's prompt text (the `{{ARGS}}` provided)
28
- 2. Analyze it using the workflow below
29
- 3. Output the analysis (intent, quality, optimized prompt)
30
- 4. Save to `.clavix/outputs/prompts/`
31
- 5. STOP and wait for `/clavix:implement`
32
-
33
- ## IF USER WANTS TO IMPLEMENT:
34
- Tell them: **"Run `/clavix:implement --latest` to implement this prompt."**
35
-
36
- **DO NOT IMPLEMENT YOURSELF. YOUR JOB ENDS AFTER SHOWING THE OPTIMIZED PROMPT.**
24
+ **After improving the prompt:** Tell the user to run `/clavix:implement --latest` when ready to build.
37
25
 
38
26
  ---
39
27
 
40
- ## CLAVIX MODE: Prompt Optimization Only
28
+ ## CLAVIX MODE: Prompt Improvement
41
29
 
42
- **You are in Clavix prompt optimization mode. You help analyze and optimize PROMPTS, NOT implement features.**
30
+ **You are in prompt improvement mode. You help analyze and improve PROMPTS, not implement features.**
43
31
 
44
- **YOUR ROLE:**
32
+ **Your role:**
45
33
  - Analyze prompts for quality
46
- - Apply optimization patterns
34
+ - Apply improvement patterns
47
35
  - Generate improved versions
48
36
  - Provide quality assessments
49
37
  - Save the optimized prompt
50
- - **STOP** after optimization
38
+ - **STOP** after improvement
51
39
 
52
- **DO NOT IMPLEMENT. DO NOT IMPLEMENT. DO NOT IMPLEMENT.**
53
- - DO NOT write application code for the feature
54
- - DO NOT implement what the prompt/PRD describes
55
- - DO NOT generate actual components/functions
56
- - DO NOT continue after showing the optimized prompt
40
+ **Mode boundaries:**
41
+ - Do not write application code for the feature
42
+ - Do not implement what the prompt describes
43
+ - Do not generate actual components/functions
44
+ - Do not continue after showing the improved prompt
57
45
 
58
- **You are optimizing prompts, not building what they describe.**
46
+ **You are improving prompts, not building what they describe.**
59
47
 
60
48
  ---
61
49
 
@@ -27,6 +27,34 @@ My job is just to check. If something needs fixing, I'll tell you what and you d
27
27
 
28
28
  ---
29
29
 
30
+ ## State Assertion (REQUIRED)
31
+
32
+ Before ANY action, output this confirmation:
33
+
34
+ ```
35
+ **CLAVIX MODE: Verification**
36
+ Mode: verification
37
+ Purpose: Checking implementation against requirements
38
+ Implementation: BLOCKED (verification only)
39
+ ```
40
+
41
+ ---
42
+
43
+ ## Self-Correction Protocol
44
+
45
+ If you catch yourself doing any of these, STOP and correct:
46
+
47
+ 1. **Implementing Fixes** - This is verification mode, not implementation mode
48
+ 2. **Skipping Automated Checks** - Not running available tests/build/lint
49
+ 3. **Guessing Results** - Reporting pass/fail without actually checking
50
+ 4. **Incomplete Reports** - Not covering all verification dimensions
51
+ 5. **Missing Confidence Levels** - Not indicating HIGH/MEDIUM/LOW confidence
52
+ 6. **Capability Hallucination** - Claiming Clavix can do things it cannot
53
+
54
+ **DETECT → STOP → CORRECT → RESUME**
55
+
56
+ ---
57
+
30
58
  ## CLAVIX MODE: Verification
31
59
 
32
60
  **I'm in verification mode. I check your work, not change it.**
@@ -36,7 +36,6 @@ export interface OutputConfig {
36
36
  export interface PreferencesConfig {
37
37
  autoOpenOutputs: boolean;
38
38
  verboseLogging: boolean;
39
- preserveSessions: boolean;
40
39
  }
41
40
  export declare const DEFAULT_CONFIG: ClavixConfig;
42
41
  /**
@@ -17,7 +17,6 @@ export const DEFAULT_CONFIG = {
17
17
  preferences: {
18
18
  autoOpenOutputs: false,
19
19
  verboseLogging: false,
20
- preserveSessions: true,
21
20
  },
22
21
  };
23
22
  /**
@@ -77,11 +77,6 @@ export declare class AgentErrorMessages {
77
77
  * Used by: implement workflow
78
78
  */
79
79
  static invalidTaskIdFormat(taskId: string): string;
80
- /**
81
- * Error: Session not found
82
- * Used by: Commands using --session flag
83
- */
84
- static sessionNotFound(sessionId: string): string;
85
80
  /**
86
81
  * Warning: Task already completed
87
82
  * Used by: implement workflow when marking already-done task
@@ -16,8 +16,7 @@ export class AgentErrorMessages {
16
16
  return ('No PRD artifacts found in .clavix/outputs/\n\n' +
17
17
  'Agent recovery options:\n' +
18
18
  ' 1. Execute /clavix:prd to generate comprehensive PRD\n' +
19
- ' 2. Execute /clavix:summarize if conversation exists\n' +
20
- ' 3. Check .clavix/sessions/ if saved session available\n\n' +
19
+ ' 2. Execute /clavix:summarize if conversation exists\n\n' +
21
20
  'Select option and execute, then retry this command.');
22
21
  }
23
22
  /**
@@ -179,19 +178,6 @@ export class AgentErrorMessages {
179
178
  ' • phase-3-api-integration-1\n\n' +
180
179
  'Check tasks.md for correct task IDs and retry.');
181
180
  }
182
- /**
183
- * Error: Session not found
184
- * Used by: Commands using --session flag
185
- */
186
- static sessionNotFound(sessionId) {
187
- return (`Session not found: ${sessionId}\n\n` +
188
- 'Agent recovery options:\n' +
189
- ' 1. Verify session ID is correct\n' +
190
- ' 2. List available sessions (if supported)\n' +
191
- ' 3. Use --active-session flag for current session\n' +
192
- ' 4. Or generate PRD without session\n\n' +
193
- 'Session may have expired or never existed.');
194
- }
195
181
  /**
196
182
  * Warning: Task already completed
197
183
  * Used by: implement workflow when marking already-done task
@@ -5,10 +5,12 @@
5
5
  * Clavix versions. It identifies files using deprecated naming conventions
6
6
  * and assists in migration to the current standard.
7
7
  *
8
- * @deprecated This module is scheduled for removal in v6.0.0.
9
- * By that version, all legacy naming patterns should be fully migrated.
10
- * After v6.0.0, the cleanup functionality will no longer be needed as
11
- * the transition period will be complete.
8
+ * Handles cleanup of:
9
+ * - fast.md, deep.md (replaced by improve.md in v4.11+)
10
+ * - Old naming patterns (clavix-{name} vs {name})
11
+ * - Subdirectory migration for Cline and Claude Code
12
+ *
13
+ * This module will be removed when v4->v5 migration support ends.
12
14
  *
13
15
  * @since v4.12.0
14
16
  */
@@ -5,10 +5,12 @@
5
5
  * Clavix versions. It identifies files using deprecated naming conventions
6
6
  * and assists in migration to the current standard.
7
7
  *
8
- * @deprecated This module is scheduled for removal in v6.0.0.
9
- * By that version, all legacy naming patterns should be fully migrated.
10
- * After v6.0.0, the cleanup functionality will no longer be needed as
11
- * the transition period will be complete.
8
+ * Handles cleanup of:
9
+ * - fast.md, deep.md (replaced by improve.md in v4.11+)
10
+ * - Old naming patterns (clavix-{name} vs {name})
11
+ * - Subdirectory migration for Cline and Claude Code
12
+ *
13
+ * This module will be removed when v4->v5 migration support ends.
12
14
  *
13
15
  * @since v4.12.0
14
16
  */
@@ -4,6 +4,7 @@ import { dirname } from 'path';
4
4
  import { FileSystem } from './file-system.js';
5
5
  import { TemplateAssembler } from '../core/template-assembler.js';
6
6
  import { CommandTransformer } from '../core/command-transformer.js';
7
+ import { DataError } from '../types/errors.js';
7
8
  const __filename = fileURLToPath(import.meta.url);
8
9
  const __dirname = dirname(__filename);
9
10
  // v4.0: Singleton assembler instance for caching
@@ -39,8 +40,8 @@ export async function loadCommandTemplates(adapter) {
39
40
  content = result.content;
40
41
  }
41
42
  catch (error) {
42
- // If assembly fails, use original content
43
- console.warn(`Template assembly warning for ${file}:`, error);
43
+ // Template assembly failures are critical - throw typed error
44
+ throw new DataError(`Template assembly failed for ${file}: ${error}`, `Check that all {{INCLUDE:}} references exist in templates directory`);
44
45
  }
45
46
  }
46
47
  // v4.8.1: Transform command references based on adapter format
@@ -6,5 +6,5 @@ export interface ParsedTomlTemplate {
6
6
  * Parse TOML-based slash command templates (Gemini/Qwen) and extract metadata.
7
7
  * Ensures the resulting prompt body does not include duplicated frontmatter.
8
8
  */
9
- export declare function parseTomlSlashCommand(content: string, templateName: string, providerName: string): ParsedTomlTemplate;
9
+ export declare function parseTomlSlashCommand(content: string, templateName: string, integrationName: string): ParsedTomlTemplate;
10
10
  //# sourceMappingURL=toml-templates.d.ts.map
@@ -2,7 +2,7 @@
2
2
  * Parse TOML-based slash command templates (Gemini/Qwen) and extract metadata.
3
3
  * Ensures the resulting prompt body does not include duplicated frontmatter.
4
4
  */
5
- export function parseTomlSlashCommand(content, templateName, providerName) {
5
+ export function parseTomlSlashCommand(content, templateName, integrationName) {
6
6
  let normalized = content.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
7
7
  if (normalized.charCodeAt(0) === 0xfeff) {
8
8
  normalized = normalized.slice(1);
@@ -10,13 +10,13 @@ export function parseTomlSlashCommand(content, templateName, providerName) {
10
10
  const descriptionMatch = normalized.match(/^\s*description\s*=\s*(['"])(.*?)\1\s*$/m);
11
11
  const promptHeaderMatch = normalized.match(/^\s*prompt\s*=\s*"""/m);
12
12
  if (!promptHeaderMatch || promptHeaderMatch.index === undefined) {
13
- throw new Error(`Template ${templateName}.toml for ${providerName} is missing a prompt = """ ... """ block.`);
13
+ throw new Error(`Template ${templateName}.toml for ${integrationName} is missing a prompt = """ ... """ block.`);
14
14
  }
15
15
  const bodyStart = promptHeaderMatch.index + promptHeaderMatch[0].length;
16
16
  const bodyRemainder = normalized.slice(bodyStart);
17
17
  const closingIndex = bodyRemainder.indexOf('"""');
18
18
  if (closingIndex === -1) {
19
- throw new Error(`Template ${templateName}.toml for ${providerName} does not terminate its prompt = """ ... """ block.`);
19
+ throw new Error(`Template ${templateName}.toml for ${integrationName} does not terminate its prompt = """ ... """ block.`);
20
20
  }
21
21
  let promptBody = bodyRemainder.slice(0, closingIndex);
22
22
  const promptLines = promptBody.split('\n');
@@ -126,5 +126,5 @@
126
126
  ]
127
127
  }
128
128
  },
129
- "version": "5.2.1"
129
+ "version": "5.5.0"
130
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavix",
3
- "version": "5.3.1",
3
+ "version": "5.5.0",
4
4
  "description": "Agentic-first prompt workflows. Markdown templates that teach AI agents how to optimize prompts, create PRDs, and manage implementation.\n\nSLASH COMMANDS (in your AI assistant):\n /clavix:improve Optimize prompts with auto-depth\n /clavix:prd Generate PRD through questions\n /clavix:plan Create task breakdown from PRD\n /clavix:implement Execute tasks with progress tracking\n /clavix:start Begin conversational session\n /clavix:summarize Extract requirements from conversation\n\nWorks with Claude Code, Cursor, Windsurf, and 19+ other AI coding tools.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",