clavix 4.9.0 → 4.11.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/analyze.d.ts +17 -0
- package/dist/cli/commands/analyze.js +133 -0
- package/dist/cli/commands/execute.d.ts +2 -2
- package/dist/cli/commands/execute.js +23 -21
- package/dist/cli/commands/improve.d.ts +32 -0
- package/dist/cli/commands/improve.js +250 -0
- package/dist/cli/commands/init.js +35 -29
- package/dist/cli/commands/prd.js +14 -13
- package/dist/cli/commands/prompts/clear.d.ts +2 -2
- package/dist/cli/commands/prompts/clear.js +32 -26
- package/dist/cli/commands/prompts/list.js +14 -19
- package/dist/cli/commands/summarize.js +23 -14
- package/dist/cli/commands/verify.d.ts +2 -2
- package/dist/cli/commands/verify.js +26 -24
- package/dist/core/doc-injector.d.ts +2 -0
- package/dist/core/doc-injector.js +12 -13
- package/dist/core/intelligence/intent-detector.d.ts +4 -0
- package/dist/core/intelligence/intent-detector.js +8 -18
- package/dist/core/intelligence/pattern-library.d.ts +16 -10
- package/dist/core/intelligence/pattern-library.js +47 -35
- package/dist/core/intelligence/patterns/actionability-enhancer.d.ts +2 -2
- package/dist/core/intelligence/patterns/actionability-enhancer.js +1 -1
- package/dist/core/intelligence/patterns/alternative-phrasing-generator.d.ts +2 -2
- package/dist/core/intelligence/patterns/alternative-phrasing-generator.js +1 -1
- package/dist/core/intelligence/patterns/ambiguity-detector.d.ts +2 -2
- package/dist/core/intelligence/patterns/ambiguity-detector.js +1 -1
- package/dist/core/intelligence/patterns/assumption-explicitizer.d.ts +2 -2
- package/dist/core/intelligence/patterns/assumption-explicitizer.js +1 -1
- package/dist/core/intelligence/patterns/base-pattern.d.ts +10 -7
- package/dist/core/intelligence/patterns/base-pattern.js +7 -3
- package/dist/core/intelligence/patterns/completeness-validator.d.ts +2 -2
- package/dist/core/intelligence/patterns/completeness-validator.js +1 -1
- package/dist/core/intelligence/patterns/conciseness-filter.d.ts +2 -2
- package/dist/core/intelligence/patterns/conciseness-filter.js +1 -1
- package/dist/core/intelligence/patterns/context-precision.d.ts +2 -2
- package/dist/core/intelligence/patterns/context-precision.js +1 -1
- package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +2 -2
- package/dist/core/intelligence/patterns/conversation-summarizer.js +1 -1
- package/dist/core/intelligence/patterns/dependency-identifier.d.ts +2 -2
- package/dist/core/intelligence/patterns/dependency-identifier.js +1 -1
- package/dist/core/intelligence/patterns/domain-context-enricher.d.ts +2 -2
- package/dist/core/intelligence/patterns/domain-context-enricher.js +1 -1
- package/dist/core/intelligence/patterns/edge-case-identifier.d.ts +2 -2
- package/dist/core/intelligence/patterns/edge-case-identifier.js +1 -1
- package/dist/core/intelligence/patterns/error-tolerance-enhancer.d.ts +2 -2
- package/dist/core/intelligence/patterns/error-tolerance-enhancer.js +1 -1
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +2 -2
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +1 -1
- package/dist/core/intelligence/patterns/objective-clarifier.d.ts +2 -2
- package/dist/core/intelligence/patterns/objective-clarifier.js +1 -1
- package/dist/core/intelligence/patterns/output-format-enforcer.d.ts +2 -2
- package/dist/core/intelligence/patterns/output-format-enforcer.js +1 -1
- package/dist/core/intelligence/patterns/prd-structure-enforcer.d.ts +2 -2
- package/dist/core/intelligence/patterns/prd-structure-enforcer.js +1 -1
- package/dist/core/intelligence/patterns/prerequisite-identifier.d.ts +2 -2
- package/dist/core/intelligence/patterns/prerequisite-identifier.js +1 -1
- package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +2 -2
- package/dist/core/intelligence/patterns/requirement-prioritizer.js +1 -1
- package/dist/core/intelligence/patterns/scope-definer.d.ts +2 -2
- package/dist/core/intelligence/patterns/scope-definer.js +1 -1
- package/dist/core/intelligence/patterns/step-decomposer.d.ts +2 -2
- package/dist/core/intelligence/patterns/step-decomposer.js +1 -1
- package/dist/core/intelligence/patterns/structure-organizer.d.ts +2 -2
- package/dist/core/intelligence/patterns/structure-organizer.js +1 -1
- package/dist/core/intelligence/patterns/success-criteria-enforcer.d.ts +2 -2
- package/dist/core/intelligence/patterns/success-criteria-enforcer.js +1 -1
- package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +2 -2
- package/dist/core/intelligence/patterns/success-metrics-enforcer.js +1 -1
- package/dist/core/intelligence/patterns/technical-context-enricher.d.ts +2 -2
- package/dist/core/intelligence/patterns/technical-context-enricher.js +1 -1
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +2 -2
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +1 -1
- package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +2 -2
- package/dist/core/intelligence/patterns/user-persona-enricher.js +1 -1
- package/dist/core/intelligence/patterns/validation-checklist-creator.d.ts +2 -2
- package/dist/core/intelligence/patterns/validation-checklist-creator.js +1 -1
- package/dist/core/intelligence/types.d.ts +6 -3
- package/dist/core/intelligence/universal-optimizer.d.ts +20 -15
- package/dist/core/intelligence/universal-optimizer.js +44 -29
- package/dist/core/prompt-manager.d.ts +24 -22
- package/dist/core/prompt-manager.js +65 -92
- package/dist/core/verification-manager.d.ts +8 -7
- package/dist/core/verification-manager.js +34 -41
- package/dist/templates/agents/octo.md +6 -8
- package/dist/templates/slash-commands/_canonical/execute.md +52 -41
- package/dist/templates/slash-commands/_canonical/implement.md +28 -0
- package/dist/templates/slash-commands/_canonical/improve.md +604 -0
- package/dist/templates/slash-commands/_canonical/verify.md +1 -1
- package/dist/templates/slash-commands/_components/agent-protocols/cli-reference.md +12 -0
- package/dist/templates/slash-commands/_components/agent-protocols/self-correction.md +20 -1
- package/dist/templates/slash-commands/_components/sections/escalation-factors.md +25 -25
- package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +27 -33
- package/dist/types/config.d.ts +1 -2
- package/dist/types/verification.d.ts +7 -6
- package/dist/types/verification.js +2 -1
- package/package.json +1 -1
- package/dist/templates/slash-commands/_canonical/deep.md +0 -616
- package/dist/templates/slash-commands/_canonical/fast.md +0 -503
|
@@ -223,13 +223,17 @@ export default class Init extends Command {
|
|
|
223
223
|
console.log(chalk.gray(' ✓ Created detailed workflow guides for generic integrations'));
|
|
224
224
|
}
|
|
225
225
|
// Success message
|
|
226
|
+
// v4.11: Use generic command names - format varies by integration
|
|
227
|
+
// (claude-code uses colon like /clavix:improve, droid uses hyphen like /clavix-improve)
|
|
226
228
|
console.log(chalk.bold.green('\n✅ Clavix initialized successfully!\n'));
|
|
227
229
|
console.log(chalk.gray('Next steps:'));
|
|
228
230
|
console.log(chalk.gray(' • Slash commands are now available in your AI agent'));
|
|
229
|
-
console.log(chalk.gray(' • Run'), chalk.cyan('clavix --help'), chalk.gray('to see all commands'));
|
|
230
|
-
console.log(chalk.gray(' •
|
|
231
|
-
console.log(chalk.gray('
|
|
232
|
-
console.log(chalk.gray('
|
|
231
|
+
console.log(chalk.gray(' • Run'), chalk.cyan('clavix --help'), chalk.gray('to see all CLI commands'));
|
|
232
|
+
console.log(chalk.gray(' • Available slash commands:'));
|
|
233
|
+
console.log(chalk.gray(' ◦'), chalk.cyan('improve'), chalk.gray('- Smart prompt optimization with auto depth selection'));
|
|
234
|
+
console.log(chalk.gray(' ◦'), chalk.cyan('prd'), chalk.gray('- Generate PRD through guided questions'));
|
|
235
|
+
console.log(chalk.gray(' ◦'), chalk.cyan('execute'), chalk.gray('- Run saved prompts'));
|
|
236
|
+
console.log(chalk.gray('\n Command format varies by integration (colon vs hyphen)\n'));
|
|
233
237
|
}
|
|
234
238
|
catch (error) {
|
|
235
239
|
const { getErrorMessage, toError } = await import('../../utils/error-utils.js');
|
|
@@ -276,21 +280,19 @@ Welcome to Clavix! This directory contains your local Clavix configuration and d
|
|
|
276
280
|
│ │ ├── quick-prd.md
|
|
277
281
|
│ │ ├── tasks.md
|
|
278
282
|
│ │ └── .clavix-implement-config.json
|
|
279
|
-
│ ├── prompts/ # Saved prompts for re-execution
|
|
280
|
-
│ │ ├── fast/ # Fast mode prompts
|
|
281
|
-
│ │ └── deep/ # Deep mode prompts
|
|
283
|
+
│ ├── prompts/ # Saved prompts for re-execution (v4.11 unified)
|
|
282
284
|
│ └── archive/ # Archived completed projects
|
|
283
285
|
└── templates/ # Custom template overrides (optional)
|
|
284
286
|
\`\`\`
|
|
285
287
|
|
|
286
288
|
## CLI Commands Reference
|
|
287
289
|
|
|
288
|
-
### Prompt Improvement
|
|
289
|
-
- \`clavix
|
|
290
|
-
- \`clavix
|
|
291
|
-
- \`clavix execute [--latest]\` - Execute saved prompts
|
|
290
|
+
### Prompt Improvement (v4.11)
|
|
291
|
+
- \`clavix improve "<prompt>"\` - Smart prompt optimization with auto depth selection
|
|
292
|
+
- \`clavix improve "<prompt>" --comprehensive\` - Force comprehensive depth analysis
|
|
293
|
+
- \`clavix execute [--latest]\` - Execute saved prompts
|
|
292
294
|
- \`clavix prompts list\` - View all saved prompts with status (NEW/EXECUTED/OLD/STALE)
|
|
293
|
-
- \`clavix prompts clear\` - Cleanup prompts (\`--executed\`, \`--stale\`, \`--
|
|
295
|
+
- \`clavix prompts clear\` - Cleanup prompts (\`--executed\`, \`--stale\`, \`--standard\`, \`--comprehensive\`, \`--all\`)
|
|
294
296
|
|
|
295
297
|
### PRD & Planning
|
|
296
298
|
- \`clavix prd\` - Generate PRD through guided Socratic questions
|
|
@@ -319,11 +321,13 @@ If using Claude Code, Cursor, or Windsurf, the following slash commands are avai
|
|
|
319
321
|
|
|
320
322
|
**Note:** Running \`clavix init\` or \`clavix update\` will regenerate all slash commands from templates. Any manual edits to generated commands will be lost. If you need custom commands, create new command files instead of modifying generated ones.
|
|
321
323
|
|
|
322
|
-
|
|
323
|
-
- \`/clavix:
|
|
324
|
-
- \`/clavix
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
**Command format varies by integration:**
|
|
325
|
+
- Claude Code, Gemini, Qwen: \`/clavix:improve\` (colon format)
|
|
326
|
+
- Cursor, Droid, Windsurf, etc.: \`/clavix-improve\` (hyphen format)
|
|
327
|
+
|
|
328
|
+
### Prompt Improvement (v4.11)
|
|
329
|
+
- \`improve [prompt]\` - Smart optimization with auto depth selection
|
|
330
|
+
- \`execute\` - Execute saved prompts
|
|
327
331
|
|
|
328
332
|
### PRD & Planning
|
|
329
333
|
- \`/clavix:prd\` - Generate PRD through guided questions
|
|
@@ -339,15 +343,17 @@ If using Claude Code, Cursor, or Windsurf, the following slash commands are avai
|
|
|
339
343
|
|
|
340
344
|
## Workflows
|
|
341
345
|
|
|
342
|
-
### Prompt Lifecycle (
|
|
346
|
+
### Prompt Lifecycle (v4.11)
|
|
343
347
|
|
|
344
348
|
1. **Create improved prompt**:
|
|
345
349
|
\`\`\`bash
|
|
346
|
-
clavix
|
|
347
|
-
#
|
|
348
|
-
|
|
350
|
+
clavix improve "your prompt here"
|
|
351
|
+
# Clavix auto-selects depth based on quality analysis:
|
|
352
|
+
# - <60% quality: standard depth (basic fixes)
|
|
353
|
+
# - 60-74%: asks user to choose
|
|
354
|
+
# - >=75%: comprehensive depth (polish)
|
|
349
355
|
\`\`\`
|
|
350
|
-
- CLI auto-saves to \`.clavix/outputs/prompts
|
|
356
|
+
- CLI auto-saves to \`.clavix/outputs/prompts/\`
|
|
351
357
|
- Slash commands require manual save per template instructions
|
|
352
358
|
|
|
353
359
|
2. **Execute saved prompt**:
|
|
@@ -414,18 +420,19 @@ When using \`clavix implement --commit-strategy=<type>\`:
|
|
|
414
420
|
|
|
415
421
|
**Recommendation**: Use \`none\` for most projects. Only enable auto-commits for large implementations with clear phases.
|
|
416
422
|
|
|
417
|
-
## When to Use Which Mode
|
|
423
|
+
## When to Use Which Mode (v4.11)
|
|
418
424
|
|
|
419
|
-
- **
|
|
420
|
-
-
|
|
425
|
+
- **Improve mode**: Smart prompt optimization with auto depth selection
|
|
426
|
+
- Standard depth: Quick cleanup for simpler prompts
|
|
427
|
+
- Comprehensive depth: Thorough analysis for complex requirements
|
|
421
428
|
- **PRD mode**: Strategic planning with architecture, risks, and business impact
|
|
422
429
|
- **Conversational mode** (\`start\`/\`summarize\`): Natural discussion → extract structured requirements
|
|
423
430
|
|
|
424
431
|
## Typical Workflows
|
|
425
432
|
|
|
426
|
-
**Improve a prompt
|
|
433
|
+
**Improve a prompt** (v4.11 unified):
|
|
427
434
|
\`\`\`bash
|
|
428
|
-
clavix
|
|
435
|
+
clavix improve "Add user authentication"
|
|
429
436
|
clavix execute --latest
|
|
430
437
|
\`\`\`
|
|
431
438
|
|
|
@@ -453,8 +460,7 @@ clavix archive my-project
|
|
|
453
460
|
## Customization
|
|
454
461
|
|
|
455
462
|
Create custom templates in \`.clavix/templates/\` to override defaults:
|
|
456
|
-
- \`
|
|
457
|
-
- \`deep.txt\` - Custom deep mode template
|
|
463
|
+
- \`improve.txt\` - Custom improve mode template
|
|
458
464
|
- \`prd-questions.txt\` - Custom PRD questions
|
|
459
465
|
|
|
460
466
|
Edit configuration:
|
package/dist/cli/commands/prd.js
CHANGED
|
@@ -43,8 +43,7 @@ export default class Prd extends Command {
|
|
|
43
43
|
// Initialize QuestionEngine
|
|
44
44
|
const engine = new QuestionEngine();
|
|
45
45
|
// Determine template path
|
|
46
|
-
const templatePath = flags.template ||
|
|
47
|
-
path.join(__dirname, '../../templates/prd-questions.md');
|
|
46
|
+
const templatePath = flags.template || path.join(__dirname, '../../templates/prd-questions.md');
|
|
48
47
|
// Load question flow
|
|
49
48
|
console.log(chalk.dim('Loading questions...\n'));
|
|
50
49
|
const flow = await engine.loadFlow(templatePath);
|
|
@@ -113,12 +112,13 @@ export default class Prd extends Command {
|
|
|
113
112
|
name: 'answer',
|
|
114
113
|
message: question.text,
|
|
115
114
|
default: question.default,
|
|
116
|
-
validate: question.validate ||
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
validate: question.validate ||
|
|
116
|
+
((input) => {
|
|
117
|
+
if (currentQuestion.required && !input.trim()) {
|
|
118
|
+
return 'This field is required';
|
|
119
|
+
}
|
|
120
|
+
return true;
|
|
121
|
+
}),
|
|
122
122
|
},
|
|
123
123
|
]);
|
|
124
124
|
answer = response.answer;
|
|
@@ -172,10 +172,11 @@ export default class Prd extends Command {
|
|
|
172
172
|
const firstAnswer = Object.values(answers)[0];
|
|
173
173
|
if (typeof firstAnswer === 'string') {
|
|
174
174
|
// Extract first few words, convert to kebab-case
|
|
175
|
-
const words = firstAnswer
|
|
175
|
+
const words = firstAnswer
|
|
176
|
+
.toLowerCase()
|
|
176
177
|
.replace(/[^a-z0-9\s]/g, '')
|
|
177
178
|
.split(/\s+/)
|
|
178
|
-
.filter(w => w.length > 0)
|
|
179
|
+
.filter((w) => w.length > 0)
|
|
179
180
|
.slice(0, 3);
|
|
180
181
|
if (words.length > 0) {
|
|
181
182
|
return words.join('-');
|
|
@@ -273,9 +274,9 @@ export default class Prd extends Command {
|
|
|
273
274
|
const prdContent = await fs.readFile(quickPrdPath, 'utf-8');
|
|
274
275
|
console.log(chalk.bold.cyan('✅ Validating Quick PRD Quality\n'));
|
|
275
276
|
console.log(chalk.gray('Analyzing for AI consumption quality...\n'));
|
|
276
|
-
// Run quality assessment
|
|
277
|
+
// Run quality assessment (v4.11: use improve mode)
|
|
277
278
|
const optimizer = new UniversalOptimizer();
|
|
278
|
-
const result = await optimizer.optimize(prdContent, '
|
|
279
|
+
const result = await optimizer.optimize(prdContent, 'improve');
|
|
279
280
|
const getScoreColor = (score) => {
|
|
280
281
|
if (score >= 80)
|
|
281
282
|
return chalk.green;
|
|
@@ -311,7 +312,7 @@ export default class Prd extends Command {
|
|
|
311
312
|
}
|
|
312
313
|
}
|
|
313
314
|
}
|
|
314
|
-
catch
|
|
315
|
+
catch {
|
|
315
316
|
console.log(chalk.yellow('⚠️ Could not validate PRD quality'));
|
|
316
317
|
console.log(chalk.gray('Continuing without validation...\n'));
|
|
317
318
|
}
|
|
@@ -3,8 +3,8 @@ export default class PromptsClear extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
standard: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
comprehensive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
executed: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
stale: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
10
|
all: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -6,19 +6,21 @@ export default class PromptsClear extends Command {
|
|
|
6
6
|
static description = 'Clear saved prompts with safety checks';
|
|
7
7
|
static examples = [
|
|
8
8
|
'<%= config.bin %> <%= command.id %>',
|
|
9
|
-
'<%= config.bin %> <%= command.id %> --
|
|
10
|
-
'<%= config.bin %> <%= command.id %> --
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --standard',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --comprehensive',
|
|
11
11
|
'<%= config.bin %> <%= command.id %> --executed',
|
|
12
12
|
'<%= config.bin %> <%= command.id %> --stale',
|
|
13
13
|
'<%= config.bin %> <%= command.id %> --all',
|
|
14
14
|
];
|
|
15
15
|
static flags = {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
standard: Flags.boolean({
|
|
17
|
+
char: 's',
|
|
18
|
+
description: 'Clear all standard depth prompts',
|
|
18
19
|
default: false,
|
|
19
20
|
}),
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
comprehensive: Flags.boolean({
|
|
22
|
+
char: 'c',
|
|
23
|
+
description: 'Clear all comprehensive depth prompts',
|
|
22
24
|
default: false,
|
|
23
25
|
}),
|
|
24
26
|
executed: Flags.boolean({
|
|
@@ -44,11 +46,11 @@ export default class PromptsClear extends Command {
|
|
|
44
46
|
try {
|
|
45
47
|
// Build filters
|
|
46
48
|
const filters = {};
|
|
47
|
-
if (flags.
|
|
48
|
-
filters.
|
|
49
|
+
if (flags.standard && !flags.comprehensive) {
|
|
50
|
+
filters.depthUsed = 'standard';
|
|
49
51
|
}
|
|
50
|
-
else if (flags.
|
|
51
|
-
filters.
|
|
52
|
+
else if (flags.comprehensive && !flags.standard) {
|
|
53
|
+
filters.depthUsed = 'comprehensive';
|
|
52
54
|
}
|
|
53
55
|
if (flags.executed) {
|
|
54
56
|
filters.executed = true;
|
|
@@ -57,7 +59,11 @@ export default class PromptsClear extends Command {
|
|
|
57
59
|
filters.stale = true;
|
|
58
60
|
}
|
|
59
61
|
// Interactive mode
|
|
60
|
-
if (!flags.
|
|
62
|
+
if (!flags.standard &&
|
|
63
|
+
!flags.comprehensive &&
|
|
64
|
+
!flags.executed &&
|
|
65
|
+
!flags.stale &&
|
|
66
|
+
!flags.all) {
|
|
61
67
|
await this.interactiveClear(promptManager);
|
|
62
68
|
return;
|
|
63
69
|
}
|
|
@@ -69,15 +75,16 @@ export default class PromptsClear extends Command {
|
|
|
69
75
|
}
|
|
70
76
|
// Display what will be deleted
|
|
71
77
|
console.log(chalk.bold.cyan(`\n📋 Prompts to Delete (${toDelete.length}):\n`));
|
|
72
|
-
toDelete.forEach(p => {
|
|
78
|
+
toDelete.forEach((p) => {
|
|
73
79
|
const status = p.executed ? chalk.green('✓') : chalk.gray('○');
|
|
74
80
|
const age = p.ageInDays === 0 ? 'today' : `${p.ageInDays}d ago`;
|
|
75
|
-
|
|
81
|
+
const depthLabel = p.depthUsed === 'comprehensive' ? 'comp' : 'std';
|
|
82
|
+
console.log(` ${status} [${depthLabel}] ${p.id} (${age})`);
|
|
76
83
|
console.log(` ${chalk.gray(p.originalPrompt.substring(0, 60))}...`);
|
|
77
84
|
});
|
|
78
85
|
console.log();
|
|
79
86
|
// Safety check for unexecuted prompts
|
|
80
|
-
const unexecuted = toDelete.filter(p => !p.executed);
|
|
87
|
+
const unexecuted = toDelete.filter((p) => !p.executed);
|
|
81
88
|
if (unexecuted.length > 0 && !flags.force) {
|
|
82
89
|
console.log(chalk.yellow(`⚠️ Warning: ${unexecuted.length} unexecuted prompts will be deleted\n`));
|
|
83
90
|
const { proceed } = await inquirer.prompt([
|
|
@@ -115,7 +122,7 @@ export default class PromptsClear extends Command {
|
|
|
115
122
|
const stats = await promptManager.getStorageStats();
|
|
116
123
|
if (stats.totalPrompts > 0) {
|
|
117
124
|
console.log(chalk.gray(`Remaining prompts: ${stats.totalPrompts}`));
|
|
118
|
-
console.log(chalk.gray(`
|
|
125
|
+
console.log(chalk.gray(` Standard: ${stats.standardPrompts} | Comprehensive: ${stats.comprehensivePrompts}`));
|
|
119
126
|
console.log(chalk.gray(` Executed: ${stats.executedPrompts} | Pending: ${stats.pendingPrompts}\n`));
|
|
120
127
|
}
|
|
121
128
|
}
|
|
@@ -134,8 +141,8 @@ export default class PromptsClear extends Command {
|
|
|
134
141
|
{ name: 'Executed prompts only (safe)', value: 'executed' },
|
|
135
142
|
{ name: 'Stale prompts (>30 days old)', value: 'stale' },
|
|
136
143
|
{ name: 'Old prompts (>7 days old)', value: 'old' },
|
|
137
|
-
{ name: '
|
|
138
|
-
{ name: '
|
|
144
|
+
{ name: 'Standard depth prompts only', value: 'standard' },
|
|
145
|
+
{ name: 'Comprehensive depth prompts only', value: 'comprehensive' },
|
|
139
146
|
{ name: chalk.red('All prompts (dangerous)'), value: 'all' },
|
|
140
147
|
{ name: 'Cancel', value: 'cancel' },
|
|
141
148
|
];
|
|
@@ -162,26 +169,25 @@ export default class PromptsClear extends Command {
|
|
|
162
169
|
else if (selection === 'old') {
|
|
163
170
|
filters.old = true;
|
|
164
171
|
}
|
|
165
|
-
else if (selection === '
|
|
166
|
-
filters.
|
|
172
|
+
else if (selection === 'standard') {
|
|
173
|
+
filters.depthUsed = 'standard';
|
|
167
174
|
}
|
|
168
|
-
else if (selection === '
|
|
169
|
-
filters.
|
|
175
|
+
else if (selection === 'comprehensive') {
|
|
176
|
+
filters.depthUsed = 'comprehensive';
|
|
170
177
|
}
|
|
171
178
|
// 'all' means no filters
|
|
172
179
|
// Get matching prompts
|
|
173
|
-
const toDelete = selection === 'all'
|
|
174
|
-
? allPrompts
|
|
175
|
-
: await manager.listPrompts(filters);
|
|
180
|
+
const toDelete = selection === 'all' ? allPrompts : await manager.listPrompts(filters);
|
|
176
181
|
if (toDelete.length === 0) {
|
|
177
182
|
console.log(chalk.yellow('\n⚠️ No prompts match the selected criteria\n'));
|
|
178
183
|
return;
|
|
179
184
|
}
|
|
180
185
|
// Show preview
|
|
181
186
|
console.log(chalk.cyan(`\nWill delete ${toDelete.length} prompt(s):\n`));
|
|
182
|
-
toDelete.slice(0, 5).forEach(p => {
|
|
187
|
+
toDelete.slice(0, 5).forEach((p) => {
|
|
183
188
|
const status = p.executed ? chalk.green('✓') : chalk.gray('○');
|
|
184
|
-
|
|
189
|
+
const depthLabel = p.depthUsed === 'comprehensive' ? 'comp' : 'std';
|
|
190
|
+
console.log(` ${status} [${depthLabel}] ${p.id}`);
|
|
185
191
|
});
|
|
186
192
|
if (toDelete.length > 5) {
|
|
187
193
|
console.log(chalk.gray(` ... and ${toDelete.length - 5} more`));
|
|
@@ -3,9 +3,7 @@ import chalk from 'chalk';
|
|
|
3
3
|
import { PromptManager } from '../../../core/prompt-manager.js';
|
|
4
4
|
export default class PromptsList extends Command {
|
|
5
5
|
static description = 'List all saved prompts with age warnings and storage statistics';
|
|
6
|
-
static examples = [
|
|
7
|
-
'<%= config.bin %> <%= command.id %>',
|
|
8
|
-
];
|
|
6
|
+
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
9
7
|
async run() {
|
|
10
8
|
const promptManager = new PromptManager();
|
|
11
9
|
try {
|
|
@@ -15,28 +13,27 @@ export default class PromptsList extends Command {
|
|
|
15
13
|
if (prompts.length === 0) {
|
|
16
14
|
console.log(chalk.gray('No prompts saved yet.\n'));
|
|
17
15
|
console.log(chalk.cyan('Generate an optimized prompt:'));
|
|
18
|
-
console.log(chalk.cyan(' /clavix:
|
|
19
|
-
console.log(chalk.cyan(' /clavix:deep "your requirement"'));
|
|
16
|
+
console.log(chalk.cyan(' /clavix:improve "your requirement"'));
|
|
20
17
|
console.log();
|
|
21
18
|
return;
|
|
22
19
|
}
|
|
23
|
-
// Display prompts grouped by
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
console.log(chalk.bold('
|
|
28
|
-
this.displayPrompts(
|
|
20
|
+
// Display prompts grouped by depth
|
|
21
|
+
const standardPrompts = prompts.filter((p) => p.depthUsed === 'standard');
|
|
22
|
+
const comprehensivePrompts = prompts.filter((p) => p.depthUsed === 'comprehensive');
|
|
23
|
+
if (standardPrompts.length > 0) {
|
|
24
|
+
console.log(chalk.bold('Standard Depth Prompts:'));
|
|
25
|
+
this.displayPrompts(standardPrompts);
|
|
29
26
|
console.log();
|
|
30
27
|
}
|
|
31
|
-
if (
|
|
32
|
-
console.log(chalk.bold('
|
|
33
|
-
this.displayPrompts(
|
|
28
|
+
if (comprehensivePrompts.length > 0) {
|
|
29
|
+
console.log(chalk.bold('Comprehensive Depth Prompts:'));
|
|
30
|
+
this.displayPrompts(comprehensivePrompts);
|
|
34
31
|
console.log();
|
|
35
32
|
}
|
|
36
33
|
// Display storage statistics
|
|
37
34
|
console.log(chalk.bold('📊 Storage Statistics:\n'));
|
|
38
35
|
console.log(chalk.gray(` Total Prompts: ${stats.totalPrompts}`));
|
|
39
|
-
console.log(chalk.gray(`
|
|
36
|
+
console.log(chalk.gray(` Standard: ${stats.standardPrompts} | Comprehensive: ${stats.comprehensivePrompts}`));
|
|
40
37
|
console.log(chalk.gray(` Executed: ${stats.executedPrompts} | Pending: ${stats.pendingPrompts}`));
|
|
41
38
|
if (stats.oldestPromptAge > 0) {
|
|
42
39
|
console.log(chalk.gray(` Oldest: ${stats.oldestPromptAge} days`));
|
|
@@ -61,7 +58,7 @@ export default class PromptsList extends Command {
|
|
|
61
58
|
}
|
|
62
59
|
}
|
|
63
60
|
displayPrompts(prompts) {
|
|
64
|
-
prompts.forEach(p => {
|
|
61
|
+
prompts.forEach((p) => {
|
|
65
62
|
const status = p.executed ? chalk.green('✓') : chalk.gray('○');
|
|
66
63
|
const ageInDays = p.ageInDays || 0;
|
|
67
64
|
// Age warning coloring
|
|
@@ -82,9 +79,7 @@ export default class PromptsList extends Command {
|
|
|
82
79
|
ageStr = chalk.gray(`${ageInDays}d`);
|
|
83
80
|
}
|
|
84
81
|
// Truncate original prompt for display
|
|
85
|
-
const promptPreview = p.originalPrompt.length > 50
|
|
86
|
-
? p.originalPrompt.substring(0, 50) + '...'
|
|
87
|
-
: p.originalPrompt;
|
|
82
|
+
const promptPreview = p.originalPrompt.length > 50 ? p.originalPrompt.substring(0, 50) + '...' : p.originalPrompt;
|
|
88
83
|
console.log(` ${status} ${chalk.dim(p.id)} (${ageStr})${ageWarning}`);
|
|
89
84
|
console.log(` ${chalk.gray(promptPreview)}`);
|
|
90
85
|
});
|
|
@@ -80,8 +80,7 @@ export default class Summarize extends Command {
|
|
|
80
80
|
this.displayAnalysisSummary(analysis);
|
|
81
81
|
// Generate outputs
|
|
82
82
|
console.log(chalk.dim('\nGenerating output files...\n'));
|
|
83
|
-
const outputDir = flags.output ||
|
|
84
|
-
path.join('.clavix/outputs', this.sanitizeProjectName(session.projectName));
|
|
83
|
+
const outputDir = flags.output || path.join('.clavix/outputs', this.sanitizeProjectName(session.projectName));
|
|
85
84
|
await FileSystem.ensureDir(outputDir);
|
|
86
85
|
// Generate mini-PRD
|
|
87
86
|
const miniPrdContent = analyzer.generateMiniPrd(session, analysis);
|
|
@@ -97,17 +96,27 @@ export default class Summarize extends Command {
|
|
|
97
96
|
// Display success
|
|
98
97
|
console.log(chalk.bold.green('\n✓ Analysis complete!\n'));
|
|
99
98
|
console.log(chalk.bold('Generated files:'));
|
|
100
|
-
console.log(chalk.gray(' • ') +
|
|
99
|
+
console.log(chalk.gray(' • ') +
|
|
100
|
+
chalk.cyan('mini-prd.md') +
|
|
101
|
+
chalk.dim(' - Structured requirements document'));
|
|
101
102
|
console.log(chalk.gray(' • ') + chalk.cyan('original-prompt.md') + chalk.dim(' - Raw extracted prompt'));
|
|
102
|
-
console.log(chalk.gray(' • ') +
|
|
103
|
+
console.log(chalk.gray(' • ') +
|
|
104
|
+
chalk.cyan('optimized-prompt.md') +
|
|
105
|
+
chalk.dim(' - Enhanced AI-ready prompt'));
|
|
103
106
|
console.log();
|
|
104
107
|
console.log(chalk.bold('Output location:'));
|
|
105
108
|
console.log(chalk.dim(` ${outputDir}`));
|
|
106
109
|
console.log();
|
|
107
110
|
console.log(chalk.bold('💡 Next steps:'));
|
|
108
|
-
console.log(chalk.gray(' • Use ') +
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
console.log(chalk.gray(' • Use ') +
|
|
112
|
+
chalk.cyan('optimized-prompt.md') +
|
|
113
|
+
chalk.gray(' for best AI results'));
|
|
114
|
+
console.log(chalk.gray(' • Share ') +
|
|
115
|
+
chalk.cyan('mini-prd.md') +
|
|
116
|
+
chalk.gray(' with your team for alignment'));
|
|
117
|
+
console.log(chalk.gray(' • Run ') +
|
|
118
|
+
chalk.cyan('clavix implement') +
|
|
119
|
+
chalk.gray(' to start development'));
|
|
111
120
|
console.log();
|
|
112
121
|
}
|
|
113
122
|
catch (error) {
|
|
@@ -129,7 +138,7 @@ export default class Summarize extends Command {
|
|
|
129
138
|
}
|
|
130
139
|
if (analysis.technicalConstraints.length > 0) {
|
|
131
140
|
console.log(chalk.bold('Technical Constraints:'));
|
|
132
|
-
analysis.technicalConstraints.slice(0, 3).forEach(constraint => {
|
|
141
|
+
analysis.technicalConstraints.slice(0, 3).forEach((constraint) => {
|
|
133
142
|
console.log(chalk.gray(` • ${constraint}`));
|
|
134
143
|
});
|
|
135
144
|
if (analysis.technicalConstraints.length > 3) {
|
|
@@ -139,7 +148,7 @@ export default class Summarize extends Command {
|
|
|
139
148
|
}
|
|
140
149
|
if (analysis.successCriteria.length > 0) {
|
|
141
150
|
console.log(chalk.bold('Success Criteria:'));
|
|
142
|
-
analysis.successCriteria.slice(0, 3).forEach(criterion => {
|
|
151
|
+
analysis.successCriteria.slice(0, 3).forEach((criterion) => {
|
|
143
152
|
console.log(chalk.gray(` ✓ ${criterion}`));
|
|
144
153
|
});
|
|
145
154
|
if (analysis.successCriteria.length > 3) {
|
|
@@ -151,8 +160,9 @@ export default class Summarize extends Command {
|
|
|
151
160
|
async applyOptimization(rawPrompt, outputDir) {
|
|
152
161
|
try {
|
|
153
162
|
console.log(chalk.dim('Optimizing extracted prompt...\n'));
|
|
163
|
+
// v4.11: Use improve mode
|
|
154
164
|
const optimizer = new UniversalOptimizer();
|
|
155
|
-
const result = await optimizer.optimize(rawPrompt, '
|
|
165
|
+
const result = await optimizer.optimize(rawPrompt, 'improve');
|
|
156
166
|
// Display optimization results
|
|
157
167
|
console.log(chalk.bold('✨ Optimization Results:\n'));
|
|
158
168
|
console.log(chalk.cyan(` Intent: ${result.intent.primaryIntent}`));
|
|
@@ -167,21 +177,20 @@ export default class Summarize extends Command {
|
|
|
167
177
|
const optimizedPath = path.join(outputDir, 'optimized-prompt.md');
|
|
168
178
|
await FileSystem.writeFileAtomic(optimizedPath, result.enhanced);
|
|
169
179
|
}
|
|
170
|
-
catch
|
|
180
|
+
catch {
|
|
171
181
|
console.log(chalk.yellow('⚠️ Could not optimize prompt'));
|
|
172
182
|
console.log(chalk.gray('Using original extracted version...\n'));
|
|
173
183
|
// Fallback: copy original to optimized
|
|
174
|
-
const originalPath = path.join(outputDir, 'original-prompt.md');
|
|
175
184
|
const optimizedPath = path.join(outputDir, 'optimized-prompt.md');
|
|
176
185
|
await FileSystem.writeFileAtomic(optimizedPath, rawPrompt);
|
|
177
186
|
}
|
|
178
187
|
}
|
|
179
188
|
sanitizeProjectName(name) {
|
|
180
|
-
return name
|
|
189
|
+
return (name
|
|
181
190
|
.toLowerCase()
|
|
182
191
|
.replace(/[^a-z0-9-]/g, '-')
|
|
183
192
|
.replace(/-+/g, '-')
|
|
184
|
-
.replace(/^-|-$/g, '') || 'unnamed-project';
|
|
193
|
+
.replace(/^-|-$/g, '') || 'unnamed-project');
|
|
185
194
|
}
|
|
186
195
|
}
|
|
187
196
|
//# sourceMappingURL=summarize.js.map
|
|
@@ -4,8 +4,8 @@ export default class Verify extends Command {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
latest: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
standard: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
comprehensive: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
id: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
status: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
'retry-failed': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -7,11 +7,11 @@ import { ChecklistParser } from '../../core/checklist-parser.js';
|
|
|
7
7
|
import { BasicChecklistGenerator } from '../../core/basic-checklist-generator.js';
|
|
8
8
|
import { IntentDetector } from '../../core/intelligence/intent-detector.js';
|
|
9
9
|
export default class Verify extends Command {
|
|
10
|
-
static description = 'Verify implementation against checklist from
|
|
10
|
+
static description = 'Verify implementation against checklist from improve mode';
|
|
11
11
|
static examples = [
|
|
12
12
|
'<%= config.bin %> <%= command.id %> --latest',
|
|
13
|
-
'<%= config.bin %> <%= command.id %> --latest --
|
|
14
|
-
'<%= config.bin %> <%= command.id %> --id
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --latest --comprehensive',
|
|
14
|
+
'<%= config.bin %> <%= command.id %> --id comp-20250117-143022-a3f2',
|
|
15
15
|
'<%= config.bin %> <%= command.id %> --status',
|
|
16
16
|
'<%= config.bin %> <%= command.id %> --retry-failed',
|
|
17
17
|
];
|
|
@@ -20,12 +20,14 @@ export default class Verify extends Command {
|
|
|
20
20
|
description: 'Verify latest executed prompt',
|
|
21
21
|
default: false,
|
|
22
22
|
}),
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
standard: Flags.boolean({
|
|
24
|
+
char: 's',
|
|
25
|
+
description: 'Filter to standard depth prompts only (use with --latest)',
|
|
25
26
|
default: false,
|
|
26
27
|
}),
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
comprehensive: Flags.boolean({
|
|
29
|
+
char: 'c',
|
|
30
|
+
description: 'Filter to comprehensive depth prompts only (use with --latest)',
|
|
29
31
|
default: false,
|
|
30
32
|
}),
|
|
31
33
|
id: Flags.string({
|
|
@@ -66,8 +68,7 @@ export default class Verify extends Command {
|
|
|
66
68
|
if (allPrompts.length === 0) {
|
|
67
69
|
console.log(chalk.yellow('\n⚠️ No prompts found\n'));
|
|
68
70
|
console.log(chalk.cyan('Generate an optimized prompt first:'));
|
|
69
|
-
console.log(chalk.cyan(' /clavix:
|
|
70
|
-
console.log(chalk.cyan(' /clavix:deep "your requirement"'));
|
|
71
|
+
console.log(chalk.cyan(' /clavix:improve "your requirement"'));
|
|
71
72
|
console.log();
|
|
72
73
|
return;
|
|
73
74
|
}
|
|
@@ -85,12 +86,12 @@ export default class Verify extends Command {
|
|
|
85
86
|
// Auto-select latest with optional filtering
|
|
86
87
|
else if (flags.latest) {
|
|
87
88
|
let filtered = allPrompts;
|
|
88
|
-
// Filter by
|
|
89
|
-
if (flags.
|
|
90
|
-
filtered = allPrompts.filter((p) => p.
|
|
89
|
+
// Filter by depth
|
|
90
|
+
if (flags.standard && !flags.comprehensive) {
|
|
91
|
+
filtered = allPrompts.filter((p) => p.depthUsed === 'standard');
|
|
91
92
|
}
|
|
92
|
-
else if (flags.
|
|
93
|
-
filtered = allPrompts.filter((p) => p.
|
|
93
|
+
else if (flags.comprehensive && !flags.standard) {
|
|
94
|
+
filtered = allPrompts.filter((p) => p.depthUsed === 'comprehensive');
|
|
94
95
|
}
|
|
95
96
|
// Filter to executed prompts preferably
|
|
96
97
|
const executedFiltered = filtered.filter((p) => p.executed);
|
|
@@ -98,8 +99,8 @@ export default class Verify extends Command {
|
|
|
98
99
|
filtered = executedFiltered;
|
|
99
100
|
}
|
|
100
101
|
if (filtered.length === 0) {
|
|
101
|
-
const
|
|
102
|
-
console.log(chalk.yellow(`\n⚠️ No ${
|
|
102
|
+
const depth = flags.standard ? 'standard' : flags.comprehensive ? 'comprehensive' : 'any';
|
|
103
|
+
console.log(chalk.yellow(`\n⚠️ No ${depth} prompts found\n`));
|
|
103
104
|
return;
|
|
104
105
|
}
|
|
105
106
|
selectedPrompt = filtered[0];
|
|
@@ -136,8 +137,9 @@ export default class Verify extends Command {
|
|
|
136
137
|
const executed = p.executed ? chalk.green('✓') : chalk.gray('○');
|
|
137
138
|
const age = p.ageInDays === 0 ? 'today' : `${p.ageInDays}d ago`;
|
|
138
139
|
const ageColor = (p.ageInDays || 0) > 30 ? chalk.red : (p.ageInDays || 0) > 7 ? chalk.yellow : chalk.gray;
|
|
140
|
+
const depthLabel = p.depthUsed === 'comprehensive' ? 'comp' : 'std';
|
|
139
141
|
return {
|
|
140
|
-
name: `${executed} [${
|
|
142
|
+
name: `${executed} [${depthLabel}] ${p.originalPrompt.substring(0, 50)}... ${ageColor(`(${age})`)}`,
|
|
141
143
|
value: p.id,
|
|
142
144
|
short: p.id,
|
|
143
145
|
};
|
|
@@ -188,7 +190,7 @@ export default class Verify extends Command {
|
|
|
188
190
|
}
|
|
189
191
|
async runVerification(prompt, options) {
|
|
190
192
|
console.log(chalk.bold.cyan(`\n🔍 Verifying: ${prompt.id}\n`));
|
|
191
|
-
console.log(chalk.gray(`
|
|
193
|
+
console.log(chalk.gray(`Depth: ${prompt.depthUsed}`));
|
|
192
194
|
console.log(chalk.gray(`Created: ${new Date(prompt.timestamp).toLocaleDateString()}`));
|
|
193
195
|
console.log();
|
|
194
196
|
// Load prompt content
|
|
@@ -199,16 +201,16 @@ export default class Verify extends Command {
|
|
|
199
201
|
}
|
|
200
202
|
// Parse checklist from prompt
|
|
201
203
|
let checklist = this.checklistParser.parse(promptData.content);
|
|
202
|
-
// Handle
|
|
203
|
-
if (!checklist.hasChecklist && prompt.
|
|
204
|
-
console.log(chalk.yellow('⚠️ No checklist found (
|
|
204
|
+
// Handle standard depth - generate basic checklist if none exists
|
|
205
|
+
if (!checklist.hasChecklist && prompt.depthUsed === 'standard') {
|
|
206
|
+
console.log(chalk.yellow('⚠️ No checklist found (standard depth prompt)'));
|
|
205
207
|
console.log(chalk.cyan('Generating basic checklist based on intent...\n'));
|
|
206
208
|
// Detect intent from original prompt
|
|
207
209
|
const intent = this.intentDetector.analyze(prompt.originalPrompt);
|
|
208
210
|
checklist = this.basicChecklistGenerator.generateFromPrompt(prompt.originalPrompt, intent.primaryIntent);
|
|
209
211
|
console.log(chalk.gray(`Intent: ${intent.primaryIntent} (${intent.confidence}% confidence)`));
|
|
210
212
|
console.log(chalk.gray(`Generated ${checklist.totalItems} checklist items\n`));
|
|
211
|
-
console.log(chalk.yellow('💡 For comprehensive checklists, use /clavix:
|
|
213
|
+
console.log(chalk.yellow('💡 For comprehensive checklists, use /clavix:improve --comprehensive\n'));
|
|
212
214
|
}
|
|
213
215
|
if (!checklist.hasChecklist) {
|
|
214
216
|
console.log(chalk.yellow('No checklist items to verify.'));
|
|
@@ -218,8 +220,8 @@ export default class Verify extends Command {
|
|
|
218
220
|
let report = await this.verificationManager.loadReport(prompt.id);
|
|
219
221
|
if (!report) {
|
|
220
222
|
report = await this.verificationManager.initializeVerification(prompt.id);
|
|
221
|
-
// Update with parsed checklist if from
|
|
222
|
-
if (prompt.
|
|
223
|
+
// Update with parsed checklist if from standard depth
|
|
224
|
+
if (prompt.depthUsed === 'standard') {
|
|
223
225
|
report.items = [...checklist.validationItems, ...checklist.edgeCases, ...checklist.risks];
|
|
224
226
|
report.results = report.items.map((item) => ({
|
|
225
227
|
itemId: item.id,
|