clavix 5.8.0 → 5.8.2
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/cli/helpers/init/integrations.js +3 -2
- 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 +3 -1
- package/dist/templates/slash-commands/_canonical/plan.md +3 -1
- package/dist/templates/slash-commands/_canonical/prd.md +6 -1
- package/dist/templates/slash-commands/_canonical/refine.md +4 -1
- package/dist/templates/slash-commands/_canonical/start.md +9 -1
- package/dist/templates/slash-commands/_canonical/summarize.md +6 -1
- package/dist/templates/slash-commands/_canonical/verify.md +1 -1
- package/dist/templates/slash-commands/_components/MANIFEST.md +6 -5
- package/dist/templates/slash-commands/_components/agent-protocols/AGENT_MANUAL.md +6 -0
- package/dist/templates/slash-commands/_components/agent-protocols/clarifying-questions.md +99 -0
- 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
|
|
@@ -96,8 +96,9 @@ export function getDisplayNames(agentManager, integrations) {
|
|
|
96
96
|
* Determine the command separator based on selected integrations
|
|
97
97
|
*/
|
|
98
98
|
export function determineCommandSeparator(integrations) {
|
|
99
|
-
const
|
|
100
|
-
const
|
|
99
|
+
const colonList = COLON_SEPARATOR_INTEGRATIONS;
|
|
100
|
+
const usesColon = integrations.some((i) => colonList.includes(i));
|
|
101
|
+
const usesHyphen = integrations.some((i) => !colonList.includes(i));
|
|
101
102
|
if (usesColon && !usesHyphen) {
|
|
102
103
|
return { primary: ':' };
|
|
103
104
|
}
|
|
@@ -274,11 +274,14 @@ Result: Project permanently deleted
|
|
|
274
274
|
|
|
275
275
|
---
|
|
276
276
|
|
|
277
|
-
## Agent Transparency (v5.8.
|
|
277
|
+
## Agent Transparency (v5.8.2)
|
|
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
|
|
|
@@ -125,6 +125,8 @@ Clavix provides a unified **improve** mode that intelligently selects the approp
|
|
|
125
125
|
|
|
126
126
|
## Instructions
|
|
127
127
|
|
|
128
|
+
**Before beginning:** Use the Clarifying Questions Protocol (see Agent Transparency section) when you need critical information from the user (confidence < 95%). For prompt improvement, this means confirming intent, desired depth, or technical constraints when ambiguous.
|
|
129
|
+
|
|
128
130
|
1. Take the user's prompt: `{{ARGS}}`
|
|
129
131
|
|
|
130
132
|
2. **Intent Detection** - Analyze what the user is trying to achieve:
|
|
@@ -522,7 +524,7 @@ Wait for the user to decide what to do next.
|
|
|
522
524
|
|
|
523
525
|
---
|
|
524
526
|
|
|
525
|
-
## Agent Transparency (v5.8.
|
|
527
|
+
## Agent Transparency (v5.8.2)
|
|
526
528
|
|
|
527
529
|
### Agent Manual (Universal Protocols)
|
|
528
530
|
{{INCLUDE:agent-protocols/AGENT_MANUAL.md}}
|
|
@@ -79,6 +79,8 @@ Implementation: BLOCKED - I will create the plan, not the code
|
|
|
79
79
|
|
|
80
80
|
## Instructions
|
|
81
81
|
|
|
82
|
+
**Before beginning:** Use the Clarifying Questions Protocol (see Agent Transparency section) when you need critical information from the user (confidence < 95%). For task planning, this means confirming which PRD to use, technical approach preferences, or task breakdown granularity.
|
|
83
|
+
|
|
82
84
|
### Part A: Agent Execution Protocol
|
|
83
85
|
|
|
84
86
|
**As an AI agent, you must follow this strict sequence:**
|
|
@@ -219,7 +221,7 @@ Present the plan and ask:
|
|
|
219
221
|
|
|
220
222
|
---
|
|
221
223
|
|
|
222
|
-
## Agent Transparency (v5.8.
|
|
224
|
+
## Agent Transparency (v5.8.2)
|
|
223
225
|
|
|
224
226
|
### Agent Manual (Universal Protocols)
|
|
225
227
|
{{INCLUDE:agent-protocols/AGENT_MANUAL.md}}
|
|
@@ -87,6 +87,8 @@ Both documents are automatically validated for quality (Clarity, Structure, Comp
|
|
|
87
87
|
|
|
88
88
|
## Instructions
|
|
89
89
|
|
|
90
|
+
**Before beginning:** Use the Clarifying Questions Protocol (see Agent Transparency section) when you need critical information from the user (confidence < 95%). For PRD development, this means confirming ambiguous project scope, technical requirements, or feature priorities.
|
|
91
|
+
|
|
90
92
|
1. Guide the user through these strategic questions, **one at a time** with validation:
|
|
91
93
|
|
|
92
94
|
**Question 1**: What are we building and why? (Problem + goal in 2-3 sentences)
|
|
@@ -344,7 +346,7 @@ The validation ensures generated PRDs are immediately usable for AI consumption
|
|
|
344
346
|
|
|
345
347
|
---
|
|
346
348
|
|
|
347
|
-
## Agent Transparency (v5.8.
|
|
349
|
+
## Agent Transparency (v5.8.2)
|
|
348
350
|
|
|
349
351
|
### Agent Manual (Universal Protocols)
|
|
350
352
|
{{INCLUDE:agent-protocols/AGENT_MANUAL.md}}
|
|
@@ -361,6 +363,9 @@ The validation ensures generated PRDs are immediately usable for AI consumption
|
|
|
361
363
|
### CLI Reference
|
|
362
364
|
{{INCLUDE:agent-protocols/cli-reference.md}}
|
|
363
365
|
|
|
366
|
+
### Recovery Patterns
|
|
367
|
+
{{INCLUDE:troubleshooting/vibecoder-recovery.md}}
|
|
368
|
+
|
|
364
369
|
---
|
|
365
370
|
|
|
366
371
|
## 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.2)
|
|
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
|
|
@@ -79,6 +79,8 @@ Implementation: BLOCKED - I will ask questions and explore needs, not implement
|
|
|
79
79
|
|
|
80
80
|
## Instructions
|
|
81
81
|
|
|
82
|
+
**Before beginning:** Use the Clarifying Questions Protocol (see Agent Transparency section) throughout the conversation when you need critical information from the user (confidence < 95%). In conversational mode, this means probing for unclear requirements, technical constraints, or user needs.
|
|
83
|
+
|
|
82
84
|
1. Begin with a friendly introduction:
|
|
83
85
|
```
|
|
84
86
|
I'm starting Clavix conversational mode for requirements gathering.
|
|
@@ -226,11 +228,17 @@ The goal is natural exploration of requirements, not a rigid questionnaire. Foll
|
|
|
226
228
|
|
|
227
229
|
---
|
|
228
230
|
|
|
229
|
-
## Agent Transparency (v5.8.
|
|
231
|
+
## Agent Transparency (v5.8.2)
|
|
230
232
|
|
|
231
233
|
### Agent Manual (Universal Protocols)
|
|
232
234
|
{{INCLUDE:agent-protocols/AGENT_MANUAL.md}}
|
|
233
235
|
|
|
236
|
+
### Workflow State Detection
|
|
237
|
+
{{INCLUDE:agent-protocols/state-awareness.md}}
|
|
238
|
+
|
|
239
|
+
### CLI Reference
|
|
240
|
+
{{INCLUDE:agent-protocols/cli-reference.md}}
|
|
241
|
+
|
|
234
242
|
### Conversational Companion
|
|
235
243
|
{{INCLUDE:agent-protocols/supportive-companion.md}}
|
|
236
244
|
|
|
@@ -80,6 +80,8 @@ Implementation: BLOCKED - I will extract requirements, not implement them
|
|
|
80
80
|
|
|
81
81
|
## Instructions
|
|
82
82
|
|
|
83
|
+
**Before beginning:** Use the Clarifying Questions Protocol (see Agent Transparency section) when you need critical information from the user (confidence < 95%). For summarization, this means asking for missing context, unclear requirements, or ambiguous technical specifications before extraction.
|
|
84
|
+
|
|
83
85
|
1. **Pre-Extraction Validation** - Check conversation completeness:
|
|
84
86
|
|
|
85
87
|
**CHECKPOINT:** Pre-extraction validation started
|
|
@@ -401,7 +403,7 @@ The `/clavix:summarize` command extracts requirements from exploratory conversat
|
|
|
401
403
|
|
|
402
404
|
---
|
|
403
405
|
|
|
404
|
-
## Agent Transparency (v5.8.
|
|
406
|
+
## Agent Transparency (v5.8.2)
|
|
405
407
|
|
|
406
408
|
### Agent Manual (Universal Protocols)
|
|
407
409
|
{{INCLUDE:agent-protocols/AGENT_MANUAL.md}}
|
|
@@ -415,6 +417,9 @@ The `/clavix:summarize` command extracts requirements from exploratory conversat
|
|
|
415
417
|
### Workflow State Detection
|
|
416
418
|
{{INCLUDE:agent-protocols/state-awareness.md}}
|
|
417
419
|
|
|
420
|
+
### CLI Reference
|
|
421
|
+
{{INCLUDE:agent-protocols/cli-reference.md}}
|
|
422
|
+
|
|
418
423
|
### Recovery Patterns
|
|
419
424
|
{{INCLUDE:troubleshooting/vibecoder-recovery.md}}
|
|
420
425
|
|
|
@@ -10,6 +10,7 @@ Core protocols that all AI agents must follow. Shared across most commands.
|
|
|
10
10
|
| Component | Purpose | Used By |
|
|
11
11
|
|-----------|---------|---------|
|
|
12
12
|
| `AGENT_MANUAL.md` | Universal protocols (transparency, mode identification, communication patterns) | All 9 commands |
|
|
13
|
+
| `clarifying-questions.md` | Systematic protocol for asking clarifying questions (95% confidence threshold) | improve, prd, plan, start, summarize |
|
|
13
14
|
| `cli-reference.md` | CLI command reference including removed commands table | improve, prd, plan, implement, verify, archive |
|
|
14
15
|
| `state-awareness.md` | Workflow state detection (mid-PRD, mid-implementation, etc.) | prd, plan, implement, summarize |
|
|
15
16
|
| `state-assertion.md` | Required mode assertion output (MODE, Purpose, Implementation status) | Available for all commands |
|
|
@@ -46,12 +47,12 @@ Recovery patterns for common agent issues.
|
|
|
46
47
|
|
|
47
48
|
| Command | Components Used |
|
|
48
49
|
|---------|----------------|
|
|
49
|
-
| `/clavix:improve` | AGENT_MANUAL, cli-reference, improvement-explanations, quality-dimensions, escalation-factors, pattern-impact |
|
|
50
|
-
| `/clavix:prd` | AGENT_MANUAL, prd-examples, quality-dimensions, state-awareness, cli-reference |
|
|
51
|
-
| `/clavix:plan` | AGENT_MANUAL, state-awareness, cli-reference, vibecoder-recovery |
|
|
50
|
+
| `/clavix:improve` | AGENT_MANUAL (includes clarifying-questions), cli-reference, improvement-explanations, quality-dimensions, escalation-factors, pattern-impact |
|
|
51
|
+
| `/clavix:prd` | AGENT_MANUAL (includes clarifying-questions), prd-examples, quality-dimensions, state-awareness, cli-reference |
|
|
52
|
+
| `/clavix:plan` | AGENT_MANUAL (includes clarifying-questions), state-awareness, cli-reference, vibecoder-recovery |
|
|
52
53
|
| `/clavix:implement` | AGENT_MANUAL, state-awareness, task-blocking, cli-reference, vibecoder-recovery |
|
|
53
|
-
| `/clavix:start` | AGENT_MANUAL, supportive-companion, conversation-examples, vibecoder-recovery |
|
|
54
|
-
| `/clavix:summarize` | AGENT_MANUAL, improvement-explanations, quality-dimensions, state-awareness, vibecoder-recovery |
|
|
54
|
+
| `/clavix:start` | AGENT_MANUAL (includes clarifying-questions), supportive-companion, conversation-examples, vibecoder-recovery |
|
|
55
|
+
| `/clavix:summarize` | AGENT_MANUAL (includes clarifying-questions), improvement-explanations, quality-dimensions, state-awareness, vibecoder-recovery |
|
|
55
56
|
| `/clavix:refine` | AGENT_MANUAL, cli-reference, quality-dimensions, state-awareness |
|
|
56
57
|
| `/clavix:verify` | AGENT_MANUAL, cli-reference, vibecoder-recovery |
|
|
57
58
|
| `/clavix:archive` | AGENT_MANUAL, cli-reference, vibecoder-recovery |
|
|
@@ -268,6 +268,12 @@ Each Clavix command has a specific mode. Stay within your mode:
|
|
|
268
268
|
|
|
269
269
|
---
|
|
270
270
|
|
|
271
|
+
## Clarifying Questions Protocol
|
|
272
|
+
|
|
273
|
+
{{INCLUDE:agent-protocols/clarifying-questions.md}}
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
271
277
|
## Verification Block Template
|
|
272
278
|
|
|
273
279
|
At the end of workflows that produce output, include verification:
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Clarifying Questions Protocol
|
|
2
|
+
|
|
3
|
+
When the user's request requires critical information to proceed correctly, use this protocol to gather necessary details systematically.
|
|
4
|
+
|
|
5
|
+
## When to Ask Clarifying Questions
|
|
6
|
+
|
|
7
|
+
Ask clarifying questions when:
|
|
8
|
+
- **Critical ambiguity exists** - The request has multiple valid interpretations that lead to substantially different outcomes
|
|
9
|
+
- **Missing essential context** - Information necessary to complete the task successfully is absent
|
|
10
|
+
- **Technical specifications needed** - Specific versions, paths, identifiers, or constraints are required
|
|
11
|
+
- **User choice required** - Multiple valid approaches exist and the user's preference is needed
|
|
12
|
+
|
|
13
|
+
**Do NOT ask clarifying questions when:**
|
|
14
|
+
- The information is trivial or easily inferred from context
|
|
15
|
+
- You can make a reasonable default assumption and mention it
|
|
16
|
+
- The question would slow down obviously simple tasks
|
|
17
|
+
- You're seeking perfection rather than addressing genuine ambiguity
|
|
18
|
+
|
|
19
|
+
## Question Format
|
|
20
|
+
|
|
21
|
+
Use this structured format for maximum clarity and efficiency:
|
|
22
|
+
|
|
23
|
+
### a. Multiple Choice Questions
|
|
24
|
+
|
|
25
|
+
When presenting options, use clear labels and make selection easy:
|
|
26
|
+
|
|
27
|
+
**Question:** [Your question here]
|
|
28
|
+
|
|
29
|
+
**Options:**
|
|
30
|
+
- **a.** First option - brief explanation
|
|
31
|
+
- **b.** Second option - brief explanation
|
|
32
|
+
- **c.** Third option - brief explanation
|
|
33
|
+
|
|
34
|
+
**Please respond with your choice (e.g., 'a' or 'option a').**
|
|
35
|
+
|
|
36
|
+
### b. Custom Input Questions
|
|
37
|
+
|
|
38
|
+
When you need specific information not in a predefined list:
|
|
39
|
+
|
|
40
|
+
**Question:** [Your question here]
|
|
41
|
+
|
|
42
|
+
**Please provide:** [Clear description of what format/content you need]
|
|
43
|
+
|
|
44
|
+
**Example:** [Show an example of valid input]
|
|
45
|
+
|
|
46
|
+
## Confidence Threshold
|
|
47
|
+
|
|
48
|
+
**Ask clarifying questions when confidence < 95%**
|
|
49
|
+
|
|
50
|
+
If you're 95%+ confident you understand the user's intent and have the necessary information, proceed without asking. If confidence is below 95%, stop and ask.
|
|
51
|
+
|
|
52
|
+
## Best Practices
|
|
53
|
+
|
|
54
|
+
1. **Ask questions sequentially** - Don't overwhelm with multiple questions at once unless they're tightly related
|
|
55
|
+
2. **Explain why you're asking** - Briefly state what the answer will help you determine
|
|
56
|
+
3. **Limit options** - Present 2-4 options maximum for choice questions
|
|
57
|
+
4. **Make defaults clear** - If there's a sensible default, state it and ask for confirmation
|
|
58
|
+
5. **Batch related questions** - If multiple questions are interdependent, present them together
|
|
59
|
+
|
|
60
|
+
## Examples
|
|
61
|
+
|
|
62
|
+
### Good: Clear Multiple Choice
|
|
63
|
+
> I need to know where to save the configuration file to proceed correctly.
|
|
64
|
+
>
|
|
65
|
+
> **Options:**
|
|
66
|
+
> - **a.** Project root (recommended for project-specific configs)
|
|
67
|
+
> - **b.** Home directory (for user-wide settings)
|
|
68
|
+
> - **c.** Custom path (you specify)
|
|
69
|
+
>
|
|
70
|
+
> **Please respond with your choice (e.g., 'a').**
|
|
71
|
+
|
|
72
|
+
### Good: Custom Input with Context
|
|
73
|
+
> To generate the migration script, I need the database schema version.
|
|
74
|
+
>
|
|
75
|
+
> **Please provide:** The current schema version number (e.g., "2.1.0" or "v3.4")
|
|
76
|
+
>
|
|
77
|
+
> If you're unsure, you can check with: `npm run db:version`
|
|
78
|
+
|
|
79
|
+
### Bad: Unnecessary Question
|
|
80
|
+
> ❌ "Do you want me to use good coding practices?"
|
|
81
|
+
>
|
|
82
|
+
> (This is always implied - just do it)
|
|
83
|
+
|
|
84
|
+
### Bad: Analysis Paralysis
|
|
85
|
+
> ❌ "Should I use const or let for this variable?"
|
|
86
|
+
>
|
|
87
|
+
> (This is implementation detail - decide yourself based on best practices)
|
|
88
|
+
|
|
89
|
+
## Recovery Pattern
|
|
90
|
+
|
|
91
|
+
If you realize you should have asked clarifying questions AFTER starting:
|
|
92
|
+
|
|
93
|
+
1. **STOP** the current approach
|
|
94
|
+
2. **EXPLAIN** what you discovered that requires clarification
|
|
95
|
+
3. **ASK** the necessary questions
|
|
96
|
+
4. **RESUME** with the correct approach once answered
|
|
97
|
+
|
|
98
|
+
**Example:**
|
|
99
|
+
> I apologize - I started implementing the auth flow but realized I need to clarify which authentication method you want to use. Are we implementing: (a) JWT tokens, (b) Session-based auth, or (c) OAuth2?
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavix",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.2",
|
|
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
|