clavix 4.10.0 → 4.11.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/analyze.d.ts +3 -0
- package/dist/cli/commands/analyze.js +11 -5
- 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/instructions/README.md +161 -188
- package/dist/templates/instructions/core/clavix-mode.md +3 -4
- package/dist/templates/instructions/core/verification.md +15 -17
- package/dist/templates/instructions/troubleshooting/jumped-to-implementation.md +1 -1
- package/dist/templates/instructions/troubleshooting/skipped-file-creation.md +7 -7
- package/dist/templates/slash-commands/_canonical/archive.md +1 -1
- package/dist/templates/slash-commands/_canonical/execute.md +39 -41
- package/dist/templates/slash-commands/_canonical/improve.md +604 -0
- package/dist/templates/slash-commands/_canonical/plan.md +1 -1
- package/dist/templates/slash-commands/_canonical/prd.md +2 -2
- package/dist/templates/slash-commands/_canonical/start.md +1 -1
- package/dist/templates/slash-commands/_canonical/summarize.md +1 -1
- package/dist/templates/slash-commands/_canonical/verify.md +9 -9
- package/dist/templates/slash-commands/_components/agent-protocols/decision-rules.md +16 -16
- package/dist/templates/slash-commands/_components/agent-protocols/self-correction.md +4 -4
- package/dist/templates/slash-commands/_components/agent-protocols/state-assertion.md +3 -4
- package/dist/templates/slash-commands/_components/agent-protocols/state-awareness.md +1 -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/templates/slash-commands/_components/troubleshooting/mode-confusion.md +1 -1
- package/dist/templates/slash-commands/_components/troubleshooting/triage-escalation.md +9 -9
- 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 +3 -1
- package/dist/templates/slash-commands/_canonical/deep.md +0 -651
- package/dist/templates/slash-commands/_canonical/fast.md +0 -535
|
@@ -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,
|
|
@@ -41,11 +41,13 @@ export declare class DocInjector {
|
|
|
41
41
|
private static validateMarkdown;
|
|
42
42
|
/**
|
|
43
43
|
* Create default AGENTS.md content
|
|
44
|
+
* v4.11: Updated for unified /clavix:improve command
|
|
44
45
|
*/
|
|
45
46
|
static getDefaultAgentsContent(): string;
|
|
46
47
|
/**
|
|
47
48
|
* Create the CLAUDE.md block content (without file wrapper)
|
|
48
49
|
* This is the single source of truth for Claude Code documentation
|
|
50
|
+
* v4.11: Updated for unified /clavix:improve command
|
|
49
51
|
*/
|
|
50
52
|
static getClaudeBlockContent(): string;
|
|
51
53
|
/**
|
|
@@ -134,6 +134,7 @@ export class DocInjector {
|
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
136
|
* Create default AGENTS.md content
|
|
137
|
+
* v4.11: Updated for unified /clavix:improve command
|
|
137
138
|
*/
|
|
138
139
|
static getDefaultAgentsContent() {
|
|
139
140
|
return `# AI Agent Instructions
|
|
@@ -145,17 +146,18 @@ This file contains instructions for AI agents working with this project.
|
|
|
145
146
|
|
|
146
147
|
Clavix is installed in this project. Use the following slash commands:
|
|
147
148
|
|
|
148
|
-
- \`/clavix:
|
|
149
|
-
- \`/clavix:deep [prompt]\` - Comprehensive prompt analysis
|
|
149
|
+
- \`/clavix:improve [prompt]\` - Optimize prompts with smart depth auto-selection
|
|
150
150
|
- \`/clavix:prd\` - Generate a PRD through guided questions
|
|
151
151
|
- \`/clavix:start\` - Start conversational mode for iterative refinement
|
|
152
152
|
- \`/clavix:summarize\` - Extract optimized prompt from conversation
|
|
153
153
|
|
|
154
154
|
**When to use:**
|
|
155
|
-
- **
|
|
156
|
-
- **
|
|
155
|
+
- **Standard depth**: Quick cleanup for simple, clear prompts
|
|
156
|
+
- **Comprehensive depth**: Thorough analysis for complex requirements
|
|
157
157
|
- **PRD mode**: Strategic planning with architecture and business impact
|
|
158
158
|
|
|
159
|
+
Clavix automatically selects the appropriate depth based on your prompt quality.
|
|
160
|
+
|
|
159
161
|
For more information, run \`clavix --help\` in your terminal.
|
|
160
162
|
<!-- CLAVIX:END -->
|
|
161
163
|
`;
|
|
@@ -163,6 +165,7 @@ For more information, run \`clavix --help\` in your terminal.
|
|
|
163
165
|
/**
|
|
164
166
|
* Create the CLAUDE.md block content (without file wrapper)
|
|
165
167
|
* This is the single source of truth for Claude Code documentation
|
|
168
|
+
* v4.11: Updated for unified /clavix:improve command
|
|
166
169
|
*/
|
|
167
170
|
static getClaudeBlockContent() {
|
|
168
171
|
return `## Clavix Integration
|
|
@@ -171,11 +174,8 @@ This project uses Clavix for prompt improvement and PRD generation. The followin
|
|
|
171
174
|
|
|
172
175
|
### Prompt Optimization Commands
|
|
173
176
|
|
|
174
|
-
#### /clavix:
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
#### /clavix:deep [prompt]
|
|
178
|
-
Comprehensive prompt analysis with alternative phrasings, edge cases, implementation examples, and potential issues. Use for complex requirements or when you want thorough exploration.
|
|
177
|
+
#### /clavix:improve [prompt]
|
|
178
|
+
Optimize prompts with smart depth auto-selection. Clavix analyzes your prompt quality and automatically selects the appropriate depth (standard or comprehensive). Use for all prompt optimization needs.
|
|
179
179
|
|
|
180
180
|
### PRD & Planning Commands
|
|
181
181
|
|
|
@@ -199,17 +199,16 @@ Analyze the current conversation and extract key requirements into a structured
|
|
|
199
199
|
### Utility Commands
|
|
200
200
|
|
|
201
201
|
#### /clavix:execute
|
|
202
|
-
Run saved prompts with lifecycle awareness. Execute previously
|
|
202
|
+
Run saved prompts with lifecycle awareness. Execute previously optimized prompts.
|
|
203
203
|
|
|
204
204
|
#### /clavix:prompts
|
|
205
|
-
Manage your saved
|
|
205
|
+
Manage your saved prompts. List, view, and organize your prompt library.
|
|
206
206
|
|
|
207
207
|
#### /clavix:archive
|
|
208
208
|
Archive completed projects. Move finished PRDs and outputs to the archive for future reference.
|
|
209
209
|
|
|
210
210
|
**When to use which mode:**
|
|
211
|
-
- **
|
|
212
|
-
- **Deep mode** (\`/clavix:deep\`): Comprehensive analysis for complex requirements
|
|
211
|
+
- **Improve mode** (\`/clavix:improve\`): Smart prompt optimization with auto-depth selection
|
|
213
212
|
- **PRD mode** (\`/clavix:prd\`): Strategic planning with architecture and business impact
|
|
214
213
|
|
|
215
214
|
**Recommended Workflow:**
|
|
@@ -39,6 +39,10 @@ export declare class IntentDetector {
|
|
|
39
39
|
private hasPerformanceTerms;
|
|
40
40
|
private isOpenEnded;
|
|
41
41
|
private needsStructure;
|
|
42
|
+
/**
|
|
43
|
+
* v4.11: Suggest optimization mode (always 'improve' for prompt optimization)
|
|
44
|
+
* For depth level suggestions, use suggestDepthLevel() instead
|
|
45
|
+
*/
|
|
42
46
|
private suggestMode;
|
|
43
47
|
/**
|
|
44
48
|
* v4.0: Enhanced analysis with secondary intents and ambiguity detection
|
|
@@ -651,24 +651,14 @@ export class IntentDetector {
|
|
|
651
651
|
const structureScore = [hasObjective, hasRequirements, hasConstraints].filter(Boolean).length;
|
|
652
652
|
return structureScore < 2;
|
|
653
653
|
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
//
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
}
|
|
663
|
-
// Open-ended without code context suggests deep mode
|
|
664
|
-
if (characteristics.isOpenEnded && !characteristics.hasCodeContext) {
|
|
665
|
-
return 'deep';
|
|
666
|
-
}
|
|
667
|
-
// Very short prompts needing structure suggest deep mode
|
|
668
|
-
if (promptLength < 50 && characteristics.needsStructure) {
|
|
669
|
-
return 'deep';
|
|
670
|
-
}
|
|
671
|
-
return 'fast';
|
|
654
|
+
/**
|
|
655
|
+
* v4.11: Suggest optimization mode (always 'improve' for prompt optimization)
|
|
656
|
+
* For depth level suggestions, use suggestDepthLevel() instead
|
|
657
|
+
*/
|
|
658
|
+
suggestMode(_intent, _characteristics, _promptLength, _confidence) {
|
|
659
|
+
// v4.11: All prompt optimization uses 'improve' mode
|
|
660
|
+
// Depth level (standard/comprehensive) is determined separately
|
|
661
|
+
return 'improve';
|
|
672
662
|
}
|
|
673
663
|
/**
|
|
674
664
|
* v4.0: Enhanced analysis with secondary intents and ambiguity detection
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BasePattern, IPatternLibrary } from './patterns/base-pattern.js';
|
|
2
|
-
import { IntentAnalysis, OptimizationMode, OptimizationPhase } from './types.js';
|
|
2
|
+
import { IntentAnalysis, OptimizationMode, OptimizationPhase, DepthLevel } from './types.js';
|
|
3
3
|
import { IntelligenceConfig } from '../../types/config.js';
|
|
4
4
|
export declare class PatternLibrary implements IPatternLibrary {
|
|
5
5
|
private patterns;
|
|
@@ -45,11 +45,12 @@ export declare class PatternLibrary implements IPatternLibrary {
|
|
|
45
45
|
completeness: number;
|
|
46
46
|
actionability: number;
|
|
47
47
|
overall: number;
|
|
48
|
-
}, mode: OptimizationMode): BasePattern[];
|
|
48
|
+
}, mode: OptimizationMode, depthLevel?: DepthLevel): BasePattern[];
|
|
49
49
|
/**
|
|
50
|
-
* Select applicable patterns for the given context
|
|
50
|
+
* v4.11: Select applicable patterns for the given context
|
|
51
|
+
* Now uses DepthLevel ('standard' | 'comprehensive') for pattern filtering
|
|
51
52
|
*/
|
|
52
|
-
selectPatterns(intent: IntentAnalysis, mode: OptimizationMode): BasePattern[];
|
|
53
|
+
selectPatterns(intent: IntentAnalysis, mode: OptimizationMode, depthLevel?: DepthLevel): BasePattern[];
|
|
53
54
|
/**
|
|
54
55
|
* v4.5: Sort patterns by priority while respecting dependency constraints.
|
|
55
56
|
* Handles runAfter (must run after specified patterns) and excludesWith (mutually exclusive).
|
|
@@ -65,10 +66,10 @@ export declare class PatternLibrary implements IPatternLibrary {
|
|
|
65
66
|
*/
|
|
66
67
|
private adjustForDependencies;
|
|
67
68
|
/**
|
|
68
|
-
* v4.
|
|
69
|
-
* Maps PRD and conversational modes to appropriate
|
|
69
|
+
* v4.11: Select patterns for specific mode with phase-awareness
|
|
70
|
+
* Maps PRD and conversational modes to appropriate depth levels for pattern selection
|
|
70
71
|
*/
|
|
71
|
-
selectPatternsForMode(mode: OptimizationMode, intent: IntentAnalysis, phase?: OptimizationPhase): BasePattern[];
|
|
72
|
+
selectPatternsForMode(mode: OptimizationMode, intent: IntentAnalysis, phase?: OptimizationPhase, depthLevel?: DepthLevel): BasePattern[];
|
|
72
73
|
/**
|
|
73
74
|
* v4.5: Check if pattern is applicable for a given phase.
|
|
74
75
|
* Uses pattern's declared phases property instead of hardcoded mappings.
|
|
@@ -79,15 +80,20 @@ export declare class PatternLibrary implements IPatternLibrary {
|
|
|
79
80
|
*/
|
|
80
81
|
private mapOptimizationPhaseToPatternPhase;
|
|
81
82
|
/**
|
|
82
|
-
* Map
|
|
83
|
+
* v4.11: Map mode and phase to depth level for pattern selection
|
|
83
84
|
*/
|
|
84
|
-
private
|
|
85
|
+
private mapToDepthLevel;
|
|
85
86
|
/**
|
|
86
87
|
* Get all registered patterns
|
|
87
88
|
*/
|
|
88
89
|
getAllPatterns(): BasePattern[];
|
|
89
90
|
/**
|
|
90
|
-
* Get patterns by
|
|
91
|
+
* v4.11: Get patterns by scope (standard or comprehensive)
|
|
92
|
+
*/
|
|
93
|
+
getPatternsByScope(scope: DepthLevel): BasePattern[];
|
|
94
|
+
/**
|
|
95
|
+
* Get patterns by mode (backward compatibility)
|
|
96
|
+
* @deprecated Use getPatternsByScope() instead
|
|
91
97
|
*/
|
|
92
98
|
getPatternsByMode(mode: OptimizationMode): BasePattern[];
|
|
93
99
|
/**
|