clavix 5.8.0 → 5.8.1
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/dist/cli/commands/init.d.ts +0 -1
- package/dist/cli/commands/init.js +1 -42
- package/dist/cli/commands/update.d.ts +0 -1
- package/dist/cli/commands/update.js +2 -44
- package/dist/cli/helpers/init/commands.d.ts +0 -13
- package/dist/cli/helpers/init/commands.js +0 -25
- package/dist/templates/slash-commands/_canonical/archive.md +4 -1
- package/dist/templates/slash-commands/_canonical/implement.md +1 -1
- package/dist/templates/slash-commands/_canonical/improve.md +1 -1
- package/dist/templates/slash-commands/_canonical/plan.md +1 -1
- package/dist/templates/slash-commands/_canonical/prd.md +4 -1
- package/dist/templates/slash-commands/_canonical/refine.md +4 -1
- package/dist/templates/slash-commands/_canonical/start.md +7 -1
- package/dist/templates/slash-commands/_canonical/summarize.md +4 -1
- package/dist/templates/slash-commands/_canonical/verify.md +1 -1
- package/package.json +1 -1
- package/dist/utils/legacy-command-cleanup.d.ts +0 -19
- package/dist/utils/legacy-command-cleanup.js +0 -99
|
@@ -11,7 +11,6 @@ export default class Init extends Command {
|
|
|
11
11
|
private generateConfig;
|
|
12
12
|
private generateInstructions;
|
|
13
13
|
private generateSlashCommands;
|
|
14
|
-
private handleLegacyCommands;
|
|
15
14
|
private injectDocumentation;
|
|
16
15
|
private extractClavixBlock;
|
|
17
16
|
private generateQuickstart;
|
|
@@ -17,7 +17,6 @@ import { DEFAULT_CONFIG } from '../../types/config.js';
|
|
|
17
17
|
import { GeminiAdapter } from '../../core/adapters/gemini-adapter.js';
|
|
18
18
|
import { QwenAdapter } from '../../core/adapters/qwen-adapter.js';
|
|
19
19
|
import { loadCommandTemplates } from '../../utils/template-loader.js';
|
|
20
|
-
import { collectLegacyCommandFiles } from '../../utils/legacy-command-cleanup.js';
|
|
21
20
|
import { CLAVIX_BLOCK_START, CLAVIX_BLOCK_END } from '../../constants.js';
|
|
22
21
|
import { validateUserConfig } from '../../utils/schemas.js';
|
|
23
22
|
export default class Init extends Command {
|
|
@@ -274,7 +273,6 @@ export default class Init extends Command {
|
|
|
274
273
|
}
|
|
275
274
|
// Generate slash commands
|
|
276
275
|
const generatedTemplates = await this.generateSlashCommands(adapter);
|
|
277
|
-
await this.handleLegacyCommands(adapter, generatedTemplates);
|
|
278
276
|
if (adapter.name === 'gemini' || adapter.name === 'qwen') {
|
|
279
277
|
const commandPath = adapter.getCommandPath();
|
|
280
278
|
const isNamespaced = commandPath.endsWith(path.join('commands', 'clavix'));
|
|
@@ -379,16 +377,7 @@ export default class Init extends Command {
|
|
|
379
377
|
this.log(chalk.gray(` Removed ${removed} existing command(s)`));
|
|
380
378
|
}
|
|
381
379
|
// Generate slash commands
|
|
382
|
-
|
|
383
|
-
// Handle legacy command cleanup (silent in update mode)
|
|
384
|
-
const commandNames = templates.map((template) => template.name);
|
|
385
|
-
const legacyFiles = await collectLegacyCommandFiles(adapter, commandNames);
|
|
386
|
-
if (legacyFiles.length > 0) {
|
|
387
|
-
for (const file of legacyFiles) {
|
|
388
|
-
await FileSystem.remove(file);
|
|
389
|
-
}
|
|
390
|
-
this.log(chalk.gray(` Cleaned ${legacyFiles.length} legacy file(s)`));
|
|
391
|
-
}
|
|
380
|
+
await this.generateSlashCommands(adapter);
|
|
392
381
|
// Re-inject documentation blocks (Claude Code only)
|
|
393
382
|
if (integrationName === 'claude-code') {
|
|
394
383
|
this.log(chalk.gray(' ✓ Updating CLAUDE.md documentation...'));
|
|
@@ -543,36 +532,6 @@ To reconfigure integrations, run \`clavix init\` again.
|
|
|
543
532
|
await adapter.generateCommands(templates);
|
|
544
533
|
return templates;
|
|
545
534
|
}
|
|
546
|
-
async handleLegacyCommands(adapter, templates) {
|
|
547
|
-
const commandNames = templates.map((template) => template.name);
|
|
548
|
-
const legacyFiles = await collectLegacyCommandFiles(adapter, commandNames);
|
|
549
|
-
if (legacyFiles.length === 0) {
|
|
550
|
-
return;
|
|
551
|
-
}
|
|
552
|
-
const relativePaths = legacyFiles
|
|
553
|
-
.map((file) => path.relative(process.cwd(), file))
|
|
554
|
-
.sort((a, b) => a.localeCompare(b));
|
|
555
|
-
this.log(chalk.gray(` ⚠ Found ${relativePaths.length} deprecated command file(s):`));
|
|
556
|
-
for (const file of relativePaths) {
|
|
557
|
-
this.log(chalk.gray(` • ${file}`));
|
|
558
|
-
}
|
|
559
|
-
const { removeLegacy } = await inquirer.prompt([
|
|
560
|
-
{
|
|
561
|
-
type: 'confirm',
|
|
562
|
-
name: 'removeLegacy',
|
|
563
|
-
message: `Remove deprecated files for ${adapter.displayName}? Functionality is unchanged; filenames are being standardized.`,
|
|
564
|
-
default: true,
|
|
565
|
-
},
|
|
566
|
-
]);
|
|
567
|
-
if (!removeLegacy) {
|
|
568
|
-
this.log(chalk.gray(' ⊗ Kept legacy files (deprecated naming retained)'));
|
|
569
|
-
return;
|
|
570
|
-
}
|
|
571
|
-
for (const file of legacyFiles) {
|
|
572
|
-
await FileSystem.remove(file);
|
|
573
|
-
this.log(chalk.gray(` ✓ Removed ${path.relative(process.cwd(), file)}`));
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
535
|
async injectDocumentation(adapter) {
|
|
577
536
|
// Inject AGENTS.md
|
|
578
537
|
const agentsContent = DocInjector.getDefaultAgentsContent();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Command, Flags } from '@oclif/core';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
|
-
import inquirer from 'inquirer';
|
|
4
3
|
import fs from 'fs-extra';
|
|
5
4
|
import * as path from 'path';
|
|
6
5
|
import { DocInjector } from '../../core/doc-injector.js';
|
|
@@ -9,7 +8,6 @@ import { AgentsMdGenerator } from '../../core/adapters/agents-md-generator.js';
|
|
|
9
8
|
import { OctoMdGenerator } from '../../core/adapters/octo-md-generator.js';
|
|
10
9
|
import { WarpMdGenerator } from '../../core/adapters/warp-md-generator.js';
|
|
11
10
|
import { InstructionsGenerator } from '../../core/adapters/instructions-generator.js';
|
|
12
|
-
import { collectLegacyCommandFiles } from '../../utils/legacy-command-cleanup.js';
|
|
13
11
|
import { CLAVIX_BLOCK_START, CLAVIX_BLOCK_END } from '../../constants.js';
|
|
14
12
|
import { validateUserConfig, formatZodErrors } from '../../utils/schemas.js';
|
|
15
13
|
export default class Update extends Command {
|
|
@@ -187,7 +185,7 @@ export default class Update extends Command {
|
|
|
187
185
|
}
|
|
188
186
|
return updated;
|
|
189
187
|
}
|
|
190
|
-
async updateCommands(adapter,
|
|
188
|
+
async updateCommands(adapter, _force) {
|
|
191
189
|
this.log(chalk.cyan(`\n🔧 Updating slash commands for ${adapter.displayName}...`));
|
|
192
190
|
// Remove all existing commands first (force regeneration)
|
|
193
191
|
const removed = await adapter.removeAllCommands();
|
|
@@ -204,47 +202,7 @@ export default class Update extends Command {
|
|
|
204
202
|
// Generate fresh commands from templates
|
|
205
203
|
await adapter.generateCommands(templates);
|
|
206
204
|
this.log(chalk.gray(` ✓ Generated ${templates.length} command(s)`));
|
|
207
|
-
|
|
208
|
-
const commandNames = templates.map((t) => t.name);
|
|
209
|
-
const legacyRemoved = await this.handleLegacyCommands(adapter, commandNames, force);
|
|
210
|
-
return removed + templates.length + legacyRemoved;
|
|
211
|
-
}
|
|
212
|
-
async handleLegacyCommands(adapter, commandNames, force) {
|
|
213
|
-
if (commandNames.length === 0) {
|
|
214
|
-
return 0;
|
|
215
|
-
}
|
|
216
|
-
const legacyFiles = await collectLegacyCommandFiles(adapter, commandNames);
|
|
217
|
-
if (legacyFiles.length === 0) {
|
|
218
|
-
return 0;
|
|
219
|
-
}
|
|
220
|
-
const relativePaths = legacyFiles
|
|
221
|
-
.map((file) => path.relative(process.cwd(), file))
|
|
222
|
-
.sort((a, b) => a.localeCompare(b));
|
|
223
|
-
this.log(chalk.gray(` ⚠ Found ${relativePaths.length} deprecated command file(s):`));
|
|
224
|
-
for (const file of relativePaths) {
|
|
225
|
-
this.log(chalk.gray(` • ${file}`));
|
|
226
|
-
}
|
|
227
|
-
if (!force) {
|
|
228
|
-
const { removeLegacy } = await inquirer.prompt([
|
|
229
|
-
{
|
|
230
|
-
type: 'confirm',
|
|
231
|
-
name: 'removeLegacy',
|
|
232
|
-
message: `Remove deprecated files for ${adapter.displayName}? Functionality is unchanged; filenames are being standardized.`,
|
|
233
|
-
default: true,
|
|
234
|
-
},
|
|
235
|
-
]);
|
|
236
|
-
if (!removeLegacy) {
|
|
237
|
-
this.log(chalk.gray(' ⊗ Kept legacy files (deprecated naming retained)'));
|
|
238
|
-
return 0;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
let removed = 0;
|
|
242
|
-
for (const file of legacyFiles) {
|
|
243
|
-
await fs.remove(file);
|
|
244
|
-
this.log(chalk.gray(` ✓ Removed ${path.relative(process.cwd(), file)}`));
|
|
245
|
-
removed++;
|
|
246
|
-
}
|
|
247
|
-
return removed;
|
|
205
|
+
return removed + templates.length;
|
|
248
206
|
}
|
|
249
207
|
getAgentsContent() {
|
|
250
208
|
return `## Clavix Integration
|
|
@@ -7,17 +7,4 @@ import type { AgentAdapter, CommandTemplate } from '../../../types/agent.js';
|
|
|
7
7
|
* Returns the generated templates
|
|
8
8
|
*/
|
|
9
9
|
export declare function generateSlashCommands(adapter: AgentAdapter): Promise<CommandTemplate[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Collect and optionally remove legacy command files
|
|
12
|
-
* Returns paths of legacy files found
|
|
13
|
-
*/
|
|
14
|
-
export declare function collectLegacyFiles(adapter: AgentAdapter, templates: CommandTemplate[]): Promise<string[]>;
|
|
15
|
-
/**
|
|
16
|
-
* Remove legacy command files
|
|
17
|
-
*/
|
|
18
|
-
export declare function removeLegacyFiles(files: string[]): Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Get relative paths for legacy files (for display)
|
|
21
|
-
*/
|
|
22
|
-
export declare function getLegacyRelativePaths(files: string[]): string[];
|
|
23
10
|
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Slash command generation for Clavix initialization
|
|
3
3
|
*/
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
import { FileSystem } from '../../../utils/file-system.js';
|
|
6
4
|
import { loadCommandTemplates } from '../../../utils/template-loader.js';
|
|
7
|
-
import { collectLegacyCommandFiles } from '../../../utils/legacy-command-cleanup.js';
|
|
8
5
|
/**
|
|
9
6
|
* Generate slash commands for an adapter
|
|
10
7
|
* Returns the generated templates
|
|
@@ -14,26 +11,4 @@ export async function generateSlashCommands(adapter) {
|
|
|
14
11
|
await adapter.generateCommands(templates);
|
|
15
12
|
return templates;
|
|
16
13
|
}
|
|
17
|
-
/**
|
|
18
|
-
* Collect and optionally remove legacy command files
|
|
19
|
-
* Returns paths of legacy files found
|
|
20
|
-
*/
|
|
21
|
-
export async function collectLegacyFiles(adapter, templates) {
|
|
22
|
-
const commandNames = templates.map((template) => template.name);
|
|
23
|
-
return collectLegacyCommandFiles(adapter, commandNames);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Remove legacy command files
|
|
27
|
-
*/
|
|
28
|
-
export async function removeLegacyFiles(files) {
|
|
29
|
-
for (const file of files) {
|
|
30
|
-
await FileSystem.remove(file);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Get relative paths for legacy files (for display)
|
|
35
|
-
*/
|
|
36
|
-
export function getLegacyRelativePaths(files) {
|
|
37
|
-
return files.map((file) => path.relative(process.cwd(), file)).sort((a, b) => a.localeCompare(b));
|
|
38
|
-
}
|
|
39
14
|
//# sourceMappingURL=commands.js.map
|
|
@@ -274,11 +274,14 @@ Result: Project permanently deleted
|
|
|
274
274
|
|
|
275
275
|
---
|
|
276
276
|
|
|
277
|
-
## Agent Transparency (v5.8.
|
|
277
|
+
## Agent Transparency (v5.8.1)
|
|
278
278
|
|
|
279
279
|
### Agent Manual (Universal Protocols)
|
|
280
280
|
{{INCLUDE:agent-protocols/AGENT_MANUAL.md}}
|
|
281
281
|
|
|
282
|
+
### Workflow State Detection
|
|
283
|
+
{{INCLUDE:agent-protocols/state-awareness.md}}
|
|
284
|
+
|
|
282
285
|
### CLI Reference
|
|
283
286
|
{{INCLUDE:agent-protocols/cli-reference.md}}
|
|
284
287
|
|
|
@@ -344,7 +344,7 @@ The validation ensures generated PRDs are immediately usable for AI consumption
|
|
|
344
344
|
|
|
345
345
|
---
|
|
346
346
|
|
|
347
|
-
## Agent Transparency (v5.8.
|
|
347
|
+
## Agent Transparency (v5.8.1)
|
|
348
348
|
|
|
349
349
|
### Agent Manual (Universal Protocols)
|
|
350
350
|
{{INCLUDE:agent-protocols/AGENT_MANUAL.md}}
|
|
@@ -361,6 +361,9 @@ The validation ensures generated PRDs are immediately usable for AI consumption
|
|
|
361
361
|
### CLI Reference
|
|
362
362
|
{{INCLUDE:agent-protocols/cli-reference.md}}
|
|
363
363
|
|
|
364
|
+
### Recovery Patterns
|
|
365
|
+
{{INCLUDE:troubleshooting/vibecoder-recovery.md}}
|
|
366
|
+
|
|
364
367
|
---
|
|
365
368
|
|
|
366
369
|
## Troubleshooting
|
|
@@ -415,7 +415,7 @@ I'll update the PRD and add this to the refinement history. Confirm?
|
|
|
415
415
|
|
|
416
416
|
---
|
|
417
417
|
|
|
418
|
-
## Agent Transparency (v5.8.
|
|
418
|
+
## Agent Transparency (v5.8.1)
|
|
419
419
|
|
|
420
420
|
### Agent Manual (Universal Protocols)
|
|
421
421
|
{{INCLUDE:agent-protocols/AGENT_MANUAL.md}}
|
|
@@ -429,6 +429,9 @@ I'll update the PRD and add this to the refinement history. Confirm?
|
|
|
429
429
|
### Workflow State Detection
|
|
430
430
|
{{INCLUDE:agent-protocols/state-awareness.md}}
|
|
431
431
|
|
|
432
|
+
### Recovery Patterns
|
|
433
|
+
{{INCLUDE:troubleshooting/vibecoder-recovery.md}}
|
|
434
|
+
|
|
432
435
|
---
|
|
433
436
|
|
|
434
437
|
## Workflow Navigation
|
|
@@ -226,11 +226,17 @@ The goal is natural exploration of requirements, not a rigid questionnaire. Foll
|
|
|
226
226
|
|
|
227
227
|
---
|
|
228
228
|
|
|
229
|
-
## Agent Transparency (v5.8.
|
|
229
|
+
## Agent Transparency (v5.8.1)
|
|
230
230
|
|
|
231
231
|
### Agent Manual (Universal Protocols)
|
|
232
232
|
{{INCLUDE:agent-protocols/AGENT_MANUAL.md}}
|
|
233
233
|
|
|
234
|
+
### Workflow State Detection
|
|
235
|
+
{{INCLUDE:agent-protocols/state-awareness.md}}
|
|
236
|
+
|
|
237
|
+
### CLI Reference
|
|
238
|
+
{{INCLUDE:agent-protocols/cli-reference.md}}
|
|
239
|
+
|
|
234
240
|
### Conversational Companion
|
|
235
241
|
{{INCLUDE:agent-protocols/supportive-companion.md}}
|
|
236
242
|
|
|
@@ -401,7 +401,7 @@ The `/clavix:summarize` command extracts requirements from exploratory conversat
|
|
|
401
401
|
|
|
402
402
|
---
|
|
403
403
|
|
|
404
|
-
## Agent Transparency (v5.8.
|
|
404
|
+
## Agent Transparency (v5.8.1)
|
|
405
405
|
|
|
406
406
|
### Agent Manual (Universal Protocols)
|
|
407
407
|
{{INCLUDE:agent-protocols/AGENT_MANUAL.md}}
|
|
@@ -415,6 +415,9 @@ The `/clavix:summarize` command extracts requirements from exploratory conversat
|
|
|
415
415
|
### Workflow State Detection
|
|
416
416
|
{{INCLUDE:agent-protocols/state-awareness.md}}
|
|
417
417
|
|
|
418
|
+
### CLI Reference
|
|
419
|
+
{{INCLUDE:agent-protocols/cli-reference.md}}
|
|
420
|
+
|
|
418
421
|
### Recovery Patterns
|
|
419
422
|
{{INCLUDE:troubleshooting/vibecoder-recovery.md}}
|
|
420
423
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavix",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.1",
|
|
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 /clavix:refine Refine existing PRD or prompt\n /clavix:verify Verify implementation against requirements\n /clavix:archive Archive completed projects\n\nWorks with Claude Code, Cursor, Windsurf, and 20 AI coding tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legacy Command Cleanup Utility
|
|
3
|
-
*
|
|
4
|
-
* This module handles cleanup of old command naming patterns from previous
|
|
5
|
-
* Clavix versions. It identifies files using deprecated naming conventions
|
|
6
|
-
* and assists in migration to the current standard.
|
|
7
|
-
*
|
|
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.
|
|
14
|
-
*
|
|
15
|
-
* @since v4.12.0
|
|
16
|
-
*/
|
|
17
|
-
import { AgentAdapter } from '../types/agent.js';
|
|
18
|
-
export declare function collectLegacyCommandFiles(adapter: AgentAdapter, commandNames: string[]): Promise<string[]>;
|
|
19
|
-
//# sourceMappingURL=legacy-command-cleanup.d.ts.map
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legacy Command Cleanup Utility
|
|
3
|
-
*
|
|
4
|
-
* This module handles cleanup of old command naming patterns from previous
|
|
5
|
-
* Clavix versions. It identifies files using deprecated naming conventions
|
|
6
|
-
* and assists in migration to the current standard.
|
|
7
|
-
*
|
|
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.
|
|
14
|
-
*
|
|
15
|
-
* @since v4.12.0
|
|
16
|
-
*/
|
|
17
|
-
import * as path from 'path';
|
|
18
|
-
import { FileSystem } from './file-system.js';
|
|
19
|
-
/**
|
|
20
|
-
* v4.12: Deprecated commands that have been replaced
|
|
21
|
-
* - fast → improve (unified with auto-depth)
|
|
22
|
-
* - deep → improve --comprehensive
|
|
23
|
-
*/
|
|
24
|
-
const DEPRECATED_COMMANDS = ['fast', 'deep'];
|
|
25
|
-
export async function collectLegacyCommandFiles(adapter, commandNames) {
|
|
26
|
-
const legacyPaths = new Set();
|
|
27
|
-
const extension = adapter.fileExtension;
|
|
28
|
-
const commandDir = path.resolve(adapter.getCommandPath());
|
|
29
|
-
// v4.12: Clean up deprecated fast/deep commands
|
|
30
|
-
for (const deprecatedName of DEPRECATED_COMMANDS) {
|
|
31
|
-
// Check for various naming patterns across adapters
|
|
32
|
-
const candidates = [
|
|
33
|
-
path.resolve(commandDir, `${deprecatedName}${extension}`),
|
|
34
|
-
path.resolve(commandDir, `clavix-${deprecatedName}${extension}`),
|
|
35
|
-
path.resolve(commandDir, `clavix:${deprecatedName}${extension}`),
|
|
36
|
-
];
|
|
37
|
-
// For Claude Code with subdirectory structure
|
|
38
|
-
if (adapter.name === 'claude-code') {
|
|
39
|
-
const clavixDir = path.resolve(commandDir, 'clavix');
|
|
40
|
-
candidates.push(path.resolve(clavixDir, `${deprecatedName}${extension}`), path.resolve(clavixDir, `clavix-${deprecatedName}${extension}`));
|
|
41
|
-
}
|
|
42
|
-
for (const candidate of candidates) {
|
|
43
|
-
if (await FileSystem.exists(candidate)) {
|
|
44
|
-
legacyPaths.add(candidate);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
for (const name of commandNames) {
|
|
49
|
-
const newFilePath = path.resolve(commandDir, adapter.getTargetFilename(name));
|
|
50
|
-
const defaultFilePath = path.resolve(commandDir, `${name}${extension}`);
|
|
51
|
-
if (adapter.name === 'cline') {
|
|
52
|
-
const oldDir = path.resolve('.cline', 'workflows');
|
|
53
|
-
const oldCandidates = [
|
|
54
|
-
path.join(oldDir, `${name}${extension}`),
|
|
55
|
-
path.join(oldDir, `clavix-${name}${extension}`),
|
|
56
|
-
];
|
|
57
|
-
for (const candidate of oldCandidates) {
|
|
58
|
-
const resolvedCandidate = path.resolve(candidate);
|
|
59
|
-
if (resolvedCandidate !== newFilePath && (await FileSystem.exists(resolvedCandidate))) {
|
|
60
|
-
legacyPaths.add(resolvedCandidate);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (defaultFilePath !== newFilePath && (await FileSystem.exists(defaultFilePath))) {
|
|
64
|
-
legacyPaths.add(defaultFilePath);
|
|
65
|
-
}
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
if (adapter.name === 'gemini' || adapter.name === 'qwen') {
|
|
69
|
-
const namespaced = commandDir.endsWith(path.join('commands', 'clavix'));
|
|
70
|
-
if (!namespaced &&
|
|
71
|
-
defaultFilePath !== newFilePath &&
|
|
72
|
-
(await FileSystem.exists(defaultFilePath))) {
|
|
73
|
-
legacyPaths.add(defaultFilePath);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
else if (defaultFilePath !== newFilePath && (await FileSystem.exists(defaultFilePath))) {
|
|
77
|
-
legacyPaths.add(defaultFilePath);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (adapter.name === 'claude-code') {
|
|
81
|
-
const commandsDir = path.resolve('.claude', 'commands');
|
|
82
|
-
const colonFiles = await FileSystem.listFiles(commandsDir, /^clavix:.*\.md$/);
|
|
83
|
-
for (const file of colonFiles) {
|
|
84
|
-
legacyPaths.add(path.resolve(path.join(commandsDir, file)));
|
|
85
|
-
}
|
|
86
|
-
const clavixDir = path.resolve(commandsDir, 'clavix');
|
|
87
|
-
const hyphenFiles = await FileSystem.listFiles(clavixDir, /^clavix-.*\.md$/);
|
|
88
|
-
for (const file of hyphenFiles) {
|
|
89
|
-
legacyPaths.add(path.resolve(path.join(clavixDir, file)));
|
|
90
|
-
}
|
|
91
|
-
// Remove task-complete.md (CLI-only command, not a user-facing slash command)
|
|
92
|
-
const taskCompleteFile = path.resolve(clavixDir, 'task-complete.md');
|
|
93
|
-
if (await FileSystem.exists(taskCompleteFile)) {
|
|
94
|
-
legacyPaths.add(taskCompleteFile);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return Array.from(legacyPaths);
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=legacy-command-cleanup.js.map
|