clavix 2.4.0 → 2.4.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/README.md +0 -116
- package/bin/clavix.js +1 -4
- package/dist/cli/commands/implement.js +20 -34
- package/dist/cli/commands/plan.js +15 -39
- package/dist/cli/commands/prd.js +7 -12
- package/dist/cli/commands/start.js +4 -9
- package/dist/cli/commands/summarize.js +15 -22
- package/dist/index.js +1 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,119 +54,3 @@ clavix prd
|
|
|
54
54
|
|
|
55
55
|
## License
|
|
56
56
|
MIT
|
|
57
|
-
```
|
|
58
|
-
Create a login page
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
**Improved:**
|
|
62
|
-
```markdown
|
|
63
|
-
# Objective
|
|
64
|
-
Build a secure user authentication login page
|
|
65
|
-
|
|
66
|
-
# Requirements
|
|
67
|
-
- Email and password input fields with validation
|
|
68
|
-
- "Remember me" checkbox
|
|
69
|
-
- "Forgot password" link
|
|
70
|
-
- Show clear error messages for invalid credentials
|
|
71
|
-
- Responsive design for mobile and desktop
|
|
72
|
-
|
|
73
|
-
# Technical Constraints
|
|
74
|
-
- Use React with TypeScript
|
|
75
|
-
- Integrate with existing JWT authentication API
|
|
76
|
-
- Follow WCAG 2.1 AA accessibility standards
|
|
77
|
-
- Support password managers
|
|
78
|
-
|
|
79
|
-
# Expected Output
|
|
80
|
-
- Fully functional login component
|
|
81
|
-
- Unit tests with >80% coverage
|
|
82
|
-
- Integration with auth context
|
|
83
|
-
|
|
84
|
-
# Success Criteria
|
|
85
|
-
- Users can log in successfully
|
|
86
|
-
- Invalid credentials show appropriate errors
|
|
87
|
-
- Page is accessible via keyboard navigation
|
|
88
|
-
- Loads in < 2 seconds
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Example 2: Slash Command Usage
|
|
92
|
-
|
|
93
|
-
In Claude Code:
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
/clavix:fast Create a dashboard for analytics
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
Claude will:
|
|
100
|
-
1. Analyze your prompt
|
|
101
|
-
2. Check if deep analysis is needed (smart triage)
|
|
102
|
-
3. Identify gaps, ambiguities, and strengths
|
|
103
|
-
4. Show changes made summary
|
|
104
|
-
5. Generate a structured, improved prompt
|
|
105
|
-
6. Display it ready for immediate use
|
|
106
|
-
|
|
107
|
-
For comprehensive analysis:
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
/clavix:deep Create a dashboard for analytics
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Provides all fast mode features plus alternative phrasings, edge cases, implementation examples, and more.
|
|
114
|
-
|
|
115
|
-
### Example 3: When to Use Which Mode
|
|
116
|
-
|
|
117
|
-
**Use Fast Mode when:**
|
|
118
|
-
- You have a simple, straightforward prompt
|
|
119
|
-
- You need quick cleanup and structure
|
|
120
|
-
- Time is a priority
|
|
121
|
-
|
|
122
|
-
**Use Deep Mode when:**
|
|
123
|
-
- Requirements are complex or ambiguous
|
|
124
|
-
- You want to explore alternative approaches
|
|
125
|
-
- You need to think through edge cases
|
|
126
|
-
- You're planning a significant feature
|
|
127
|
-
|
|
128
|
-
**Use PRD Mode when:**
|
|
129
|
-
- You need strategic planning
|
|
130
|
-
- Architecture decisions are required
|
|
131
|
-
- Business impact and scalability matter
|
|
132
|
-
|
|
133
|
-
## Requirements
|
|
134
|
-
|
|
135
|
-
- Node.js >= 18.0.0
|
|
136
|
-
- npm or yarn
|
|
137
|
-
|
|
138
|
-
## Development
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
# build dist
|
|
142
|
-
npm run build
|
|
143
|
-
|
|
144
|
-
# run tests
|
|
145
|
-
npm test
|
|
146
|
-
|
|
147
|
-
# lint / format
|
|
148
|
-
npm run lint
|
|
149
|
-
npm run format:check
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
## License
|
|
153
|
-
|
|
154
|
-
MIT
|
|
155
|
-
|
|
156
|
-
## Links
|
|
157
|
-
|
|
158
|
-
- [GitHub Repository](https://github.com/Bob5k/Clavix)
|
|
159
|
-
- [Issue Tracker](https://github.com/Bob5k/Clavix/issues)
|
|
160
|
-
- [Changelog](CHANGELOG.md)
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## Star History
|
|
165
|
-
|
|
166
|
-
<a href="https://www.star-history.com/#Bob5k/Clavix&type=date&legend=top-left">
|
|
167
|
-
<picture>
|
|
168
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=Bob5k/Clavix&type=date&theme=dark&legend=top-left" />
|
|
169
|
-
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=Bob5k/Clavix&type=date&legend=top-left" />
|
|
170
|
-
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=Bob5k/Clavix&type=date&legend=top-left" />
|
|
171
|
-
</picture>
|
|
172
|
-
</a>
|
package/bin/clavix.js
CHANGED
|
@@ -46,7 +46,7 @@ const fs = __importStar(require("fs-extra"));
|
|
|
46
46
|
class Implement extends core_1.Command {
|
|
47
47
|
async run() {
|
|
48
48
|
const { flags } = await this.parse(Implement);
|
|
49
|
-
console.log(chalk_1.default.bold.cyan('\
|
|
49
|
+
console.log(chalk_1.default.bold.cyan('\nTask Implementation\n'));
|
|
50
50
|
try {
|
|
51
51
|
const manager = new task_manager_1.TaskManager();
|
|
52
52
|
const gitManager = new git_manager_1.GitManager();
|
|
@@ -67,10 +67,9 @@ class Implement extends core_1.Command {
|
|
|
67
67
|
const prdPath = await manager.findPrdDirectory(flags.project);
|
|
68
68
|
tasksPath = path.join(prdPath, 'tasks.md');
|
|
69
69
|
if (!(await fs.pathExists(tasksPath))) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return;
|
|
70
|
+
this.error(chalk_1.default.red('No tasks.md found!') +
|
|
71
|
+
'\n\n' +
|
|
72
|
+
chalk_1.default.yellow('Hint: Run ') + chalk_1.default.cyan('clavix plan') + chalk_1.default.yellow(' first to generate task breakdown'));
|
|
74
73
|
}
|
|
75
74
|
console.log(chalk_1.default.dim(`Found: ${tasksPath}\n`));
|
|
76
75
|
}
|
|
@@ -84,14 +83,14 @@ class Implement extends core_1.Command {
|
|
|
84
83
|
console.log();
|
|
85
84
|
// Check if all tasks are done
|
|
86
85
|
if (stats.remaining === 0) {
|
|
87
|
-
console.log(chalk_1.default.bold.green('
|
|
86
|
+
console.log(chalk_1.default.bold.green('All tasks completed!\n'));
|
|
88
87
|
console.log(chalk_1.default.gray('Great work! All implementation tasks are done.\n'));
|
|
89
88
|
return;
|
|
90
89
|
}
|
|
91
90
|
// Find next task
|
|
92
91
|
const nextTask = manager.findFirstIncompleteTask(phases);
|
|
93
92
|
if (!nextTask) {
|
|
94
|
-
console.log(chalk_1.default.yellow('
|
|
93
|
+
console.log(chalk_1.default.yellow('Warning: No incomplete tasks found\n'));
|
|
95
94
|
return;
|
|
96
95
|
}
|
|
97
96
|
// Display next task
|
|
@@ -143,14 +142,14 @@ class Implement extends core_1.Command {
|
|
|
143
142
|
commitStrategy = response.strategy;
|
|
144
143
|
}
|
|
145
144
|
if (commitStrategy !== 'none') {
|
|
146
|
-
console.log(chalk_1.default.green(
|
|
145
|
+
console.log(chalk_1.default.green(`Auto-commit enabled: ${commitStrategy}\n`));
|
|
147
146
|
}
|
|
148
147
|
else {
|
|
149
148
|
console.log(chalk_1.default.dim('Auto-commit disabled\n'));
|
|
150
149
|
}
|
|
151
150
|
}
|
|
152
151
|
else {
|
|
153
|
-
console.log(chalk_1.default.yellow('
|
|
152
|
+
console.log(chalk_1.default.yellow('Warning: Not a git repository - auto-commits disabled\n'));
|
|
154
153
|
}
|
|
155
154
|
}
|
|
156
155
|
// Display implementation instructions
|
|
@@ -172,10 +171,10 @@ class Implement extends core_1.Command {
|
|
|
172
171
|
stats,
|
|
173
172
|
timestamp: new Date().toISOString(),
|
|
174
173
|
}, { spaces: 2 });
|
|
175
|
-
console.log(chalk_1.default.bold.green('
|
|
174
|
+
console.log(chalk_1.default.bold.green('Ready to implement!\n'));
|
|
176
175
|
console.log(chalk_1.default.dim('Configuration saved to:'));
|
|
177
176
|
console.log(chalk_1.default.dim(` ${configPath}\n`));
|
|
178
|
-
console.log(chalk_1.default.yellow('
|
|
177
|
+
console.log(chalk_1.default.yellow('Important Notes for AI Agent:\n'));
|
|
179
178
|
console.log(chalk_1.default.gray(' • Follow the tasks in order from tasks.md'));
|
|
180
179
|
console.log(chalk_1.default.gray(' • Mark each completed task: change [ ] to [x]'));
|
|
181
180
|
console.log(chalk_1.default.gray(` • Current task: ${nextTask.description}`));
|
|
@@ -184,21 +183,11 @@ class Implement extends core_1.Command {
|
|
|
184
183
|
}
|
|
185
184
|
console.log(chalk_1.default.gray(' • Use PRD as reference for implementation details'));
|
|
186
185
|
console.log();
|
|
187
|
-
console.log(chalk_1.default.dim('
|
|
186
|
+
console.log(chalk_1.default.dim('Tip: The AI agent can run "clavix implement" again to resume progress\n'));
|
|
188
187
|
}
|
|
189
188
|
catch (error) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
// Provide helpful hints
|
|
193
|
-
if (error.message.includes('tasks.md')) {
|
|
194
|
-
console.log(chalk_1.default.yellow('💡 Make sure you have generated a task plan first:'));
|
|
195
|
-
console.log(chalk_1.default.gray(' Run'), chalk_1.default.cyan('clavix plan'), chalk_1.default.gray('to create tasks.md\n'));
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
else {
|
|
199
|
-
console.log(chalk_1.default.red('\n✗ An unexpected error occurred\n'));
|
|
200
|
-
}
|
|
201
|
-
this.exit(1);
|
|
189
|
+
const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
|
|
190
|
+
this.error(chalk_1.default.red(errorMessage));
|
|
202
191
|
}
|
|
203
192
|
}
|
|
204
193
|
/**
|
|
@@ -245,10 +234,9 @@ class Implement extends core_1.Command {
|
|
|
245
234
|
}
|
|
246
235
|
// No PRD projects found
|
|
247
236
|
if (prdProjects.length === 0) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
return null;
|
|
237
|
+
this.error(chalk_1.default.yellow('Warning: No PRD projects found in .clavix/outputs/') +
|
|
238
|
+
'\n\n' +
|
|
239
|
+
chalk_1.default.gray('Hint: Create a PRD first using ') + chalk_1.default.cyan('clavix prd'));
|
|
252
240
|
}
|
|
253
241
|
// Only one PRD - auto-select
|
|
254
242
|
if (prdProjects.length === 1) {
|
|
@@ -301,7 +289,7 @@ class Implement extends core_1.Command {
|
|
|
301
289
|
* @param projectName Name of the PRD project
|
|
302
290
|
*/
|
|
303
291
|
async handleNoTasks(projectName) {
|
|
304
|
-
console.log(chalk_1.default.yellow(`\
|
|
292
|
+
console.log(chalk_1.default.yellow(`\nWarning: Project "${projectName}" has no tasks generated yet.\n`));
|
|
305
293
|
const response = await inquirer_1.default.prompt([
|
|
306
294
|
{
|
|
307
295
|
type: 'confirm',
|
|
@@ -327,13 +315,11 @@ class Implement extends core_1.Command {
|
|
|
327
315
|
console.error(chalk_1.default.yellow(stderr));
|
|
328
316
|
}
|
|
329
317
|
// After plan completes, continue with implementation
|
|
330
|
-
console.log(chalk_1.default.green('\
|
|
318
|
+
console.log(chalk_1.default.green('\nTasks generated! Continuing with implementation...\n'));
|
|
331
319
|
}
|
|
332
320
|
catch (error) {
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
this.exit(1);
|
|
321
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
322
|
+
this.error(chalk_1.default.red(`Running clavix plan failed: ${errorMessage}`));
|
|
337
323
|
}
|
|
338
324
|
}
|
|
339
325
|
else {
|
|
@@ -48,7 +48,7 @@ const file_system_1 = require("../../utils/file-system");
|
|
|
48
48
|
class Plan extends core_1.Command {
|
|
49
49
|
async run() {
|
|
50
50
|
const { flags } = await this.parse(Plan);
|
|
51
|
-
console.log(chalk_1.default.bold.cyan('\
|
|
51
|
+
console.log(chalk_1.default.bold.cyan('\nTask Plan Generator\n'));
|
|
52
52
|
console.log(chalk_1.default.gray('Analyzing PRD and generating implementation tasks...\n'));
|
|
53
53
|
try {
|
|
54
54
|
this.validateSessionFlags(flags.session, flags['active-session']);
|
|
@@ -69,10 +69,9 @@ class Plan extends core_1.Command {
|
|
|
69
69
|
if (!prdPath) {
|
|
70
70
|
selectedProject = await this.resolveProjectDirectory(manager, flags.project);
|
|
71
71
|
if (!selectedProject) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return;
|
|
72
|
+
this.error(chalk_1.default.red('No PRD projects found in .clavix/outputs/') +
|
|
73
|
+
'\n\n' +
|
|
74
|
+
chalk_1.default.gray("Hint: Run 'clavix prd' to generate a PRD, 'clavix summarize' to create a mini-PRD, or use 'clavix plan --session <id>'"));
|
|
76
75
|
}
|
|
77
76
|
prdPath = selectedProject.path;
|
|
78
77
|
projectName = selectedProject.name;
|
|
@@ -84,7 +83,7 @@ class Plan extends core_1.Command {
|
|
|
84
83
|
// Check if tasks.md already exists
|
|
85
84
|
const tasksPath = path.join(prdPath, 'tasks.md');
|
|
86
85
|
if (await fs.pathExists(tasksPath) && !flags.overwrite) {
|
|
87
|
-
console.log(chalk_1.default.yellow('
|
|
86
|
+
console.log(chalk_1.default.yellow('Warning: tasks.md already exists.'));
|
|
88
87
|
console.log(chalk_1.default.gray(`Location: ${tasksPath}`));
|
|
89
88
|
console.log(chalk_1.default.gray('Use --overwrite to regenerate tasks.md.\n'));
|
|
90
89
|
return;
|
|
@@ -92,16 +91,14 @@ class Plan extends core_1.Command {
|
|
|
92
91
|
console.log(chalk_1.default.dim('Looking for PRD artifacts...'));
|
|
93
92
|
const availableSources = await manager.detectAvailableSources(prdPath);
|
|
94
93
|
if (availableSources.length === 0) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return;
|
|
94
|
+
this.error(chalk_1.default.red('No PRD artifacts found in this directory') +
|
|
95
|
+
'\n\n' +
|
|
96
|
+
chalk_1.default.gray('Hint: Generate a PRD with clavix prd, run clavix summarize, or supply a session via --session'));
|
|
99
97
|
}
|
|
100
98
|
if (sourcePreference !== 'auto' && !availableSources.includes(sourcePreference)) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return;
|
|
99
|
+
this.error(chalk_1.default.red(`Preferred source "${sourcePreference}" not found in ${prdPath}`) +
|
|
100
|
+
'\n\n' +
|
|
101
|
+
chalk_1.default.gray(`Hint: Available sources: ${availableSources.join(', ') || 'none'}. Override with --source`));
|
|
105
102
|
}
|
|
106
103
|
if (availableSources.length > 1 && sourcePreference === 'auto') {
|
|
107
104
|
console.log(chalk_1.default.dim(`Found multiple sources (${availableSources.join(', ')}). Selecting best match...`));
|
|
@@ -123,7 +120,7 @@ class Plan extends core_1.Command {
|
|
|
123
120
|
console.log(chalk_1.default.dim(`Using source: ${chosenSourceFile} (override with --source to pick a different artifact).`));
|
|
124
121
|
}
|
|
125
122
|
// Display results
|
|
126
|
-
console.log(chalk_1.default.bold.green('\
|
|
123
|
+
console.log(chalk_1.default.bold.green('\nTask plan generated successfully!\n'));
|
|
127
124
|
if (generatedFromSession) {
|
|
128
125
|
console.log(chalk_1.default.bold('Generated artifacts:'));
|
|
129
126
|
generatedArtifacts.forEach((artifact) => {
|
|
@@ -158,32 +155,11 @@ class Plan extends core_1.Command {
|
|
|
158
155
|
console.log(chalk_1.default.gray(' 2. Edit if needed (add/remove/modify tasks)'));
|
|
159
156
|
console.log(chalk_1.default.gray(' 3. Run'), chalk_1.default.cyan('clavix implement'), chalk_1.default.gray('to start implementation'));
|
|
160
157
|
console.log();
|
|
161
|
-
console.log(chalk_1.default.dim('
|
|
158
|
+
console.log(chalk_1.default.dim('Tip: Tasks follow CLEAR framework principles for optimal AI execution\n'));
|
|
162
159
|
}
|
|
163
160
|
catch (error) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if (error.message.includes('Session has no messages')) {
|
|
167
|
-
console.log(chalk_1.default.gray('Add conversation messages with clavix start before running plan --session.\n'));
|
|
168
|
-
}
|
|
169
|
-
else if (error.message.includes('Session not found')) {
|
|
170
|
-
console.log(chalk_1.default.gray('Check the session ID with clavix list.\n'));
|
|
171
|
-
}
|
|
172
|
-
else if (error.message.includes('No active session')) {
|
|
173
|
-
console.log(chalk_1.default.gray('Start a session with clavix start before using --active-session.\n'));
|
|
174
|
-
}
|
|
175
|
-
else if (error.message.includes('PRD project not found')) {
|
|
176
|
-
console.log(chalk_1.default.gray("Run 'clavix list' to see available outputs or specify a valid project name.\n"));
|
|
177
|
-
}
|
|
178
|
-
else if (error.message.includes('No PRD')) {
|
|
179
|
-
console.log(chalk_1.default.yellow('💡 Create a PRD first:'));
|
|
180
|
-
console.log(chalk_1.default.gray(' Run'), chalk_1.default.cyan('clavix prd'), chalk_1.default.gray('to generate a new PRD.\n'));
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
else {
|
|
184
|
-
console.log(chalk_1.default.red('\n✗ An unexpected error occurred\n'));
|
|
185
|
-
}
|
|
186
|
-
this.exit(1);
|
|
161
|
+
const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
|
|
162
|
+
this.error(chalk_1.default.red(errorMessage));
|
|
187
163
|
}
|
|
188
164
|
}
|
|
189
165
|
validateSessionFlags(session, activeSession) {
|
package/dist/cli/commands/prd.js
CHANGED
|
@@ -47,7 +47,7 @@ const prompt_optimizer_1 = require("../../core/prompt-optimizer");
|
|
|
47
47
|
class Prd extends core_1.Command {
|
|
48
48
|
async run() {
|
|
49
49
|
const { flags } = await this.parse(Prd);
|
|
50
|
-
console.log(chalk_1.default.bold.cyan('\
|
|
50
|
+
console.log(chalk_1.default.bold.cyan('\nPRD Generator\n'));
|
|
51
51
|
console.log(chalk_1.default.gray("Let's create a comprehensive Product Requirements Document through strategic questions.\n"));
|
|
52
52
|
try {
|
|
53
53
|
// Initialize QuestionEngine
|
|
@@ -138,7 +138,7 @@ class Prd extends core_1.Command {
|
|
|
138
138
|
if (answer && answer.toString().trim() && question) {
|
|
139
139
|
const submitResult = engine.submitAnswer(question.id, answer);
|
|
140
140
|
if (submitResult !== true) {
|
|
141
|
-
console.log(chalk_1.default.red(`\n
|
|
141
|
+
console.log(chalk_1.default.red(`\n${submitResult}\n`));
|
|
142
142
|
continue; // Ask again
|
|
143
143
|
}
|
|
144
144
|
answers[question.id] = answer;
|
|
@@ -147,7 +147,7 @@ class Prd extends core_1.Command {
|
|
|
147
147
|
question = engine.getNextQuestion();
|
|
148
148
|
}
|
|
149
149
|
// All questions answered
|
|
150
|
-
console.log(chalk_1.default.bold.green('\
|
|
150
|
+
console.log(chalk_1.default.bold.green('\nAll questions answered!\n'));
|
|
151
151
|
// Generate PRDs
|
|
152
152
|
console.log(chalk_1.default.dim('Generating PRD documents...\n'));
|
|
153
153
|
const generator = new prd_generator_1.PrdGenerator();
|
|
@@ -157,7 +157,7 @@ class Prd extends core_1.Command {
|
|
|
157
157
|
outputDir: '.clavix/outputs',
|
|
158
158
|
});
|
|
159
159
|
// Display success message
|
|
160
|
-
console.log(chalk_1.default.bold.green('
|
|
160
|
+
console.log(chalk_1.default.bold.green('PRD documents generated successfully!\n'));
|
|
161
161
|
console.log(chalk_1.default.bold('Output location:'));
|
|
162
162
|
console.log(chalk_1.default.cyan(` ${outputPath}`));
|
|
163
163
|
console.log();
|
|
@@ -169,16 +169,11 @@ class Prd extends core_1.Command {
|
|
|
169
169
|
if (!flags['skip-validation']) {
|
|
170
170
|
await this.validatePrdWithClear(outputPath);
|
|
171
171
|
}
|
|
172
|
-
console.log(chalk_1.default.gray('
|
|
172
|
+
console.log(chalk_1.default.gray('Tip: Use quick-prd.md as input for your AI agent to start development\n'));
|
|
173
173
|
}
|
|
174
174
|
catch (error) {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
console.log(chalk_1.default.red('\n✗ An unexpected error occurred\n'));
|
|
180
|
-
}
|
|
181
|
-
this.exit(1);
|
|
175
|
+
const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
|
|
176
|
+
this.error(chalk_1.default.red(errorMessage));
|
|
182
177
|
}
|
|
183
178
|
}
|
|
184
179
|
/**
|
|
@@ -71,13 +71,8 @@ class Start extends core_1.Command {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
catch (error) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
console.log(chalk_1.default.red('\n✗ An unexpected error occurred\n'));
|
|
79
|
-
}
|
|
80
|
-
this.exit(1);
|
|
74
|
+
const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
|
|
75
|
+
this.error(chalk_1.default.red(errorMessage));
|
|
81
76
|
}
|
|
82
77
|
}
|
|
83
78
|
/**
|
|
@@ -198,7 +193,7 @@ class Start extends core_1.Command {
|
|
|
198
193
|
console.log();
|
|
199
194
|
const session = await this.sessionManager.getSession(this.sessionId);
|
|
200
195
|
if (session) {
|
|
201
|
-
console.log(chalk_1.default.bold.green('
|
|
196
|
+
console.log(chalk_1.default.bold.green('Session saved successfully!\n'));
|
|
202
197
|
console.log(chalk_1.default.bold('Session Details:'));
|
|
203
198
|
console.log(chalk_1.default.gray(' Session ID:'), chalk_1.default.cyan(session.id));
|
|
204
199
|
console.log(chalk_1.default.gray(' Project:'), chalk_1.default.cyan(session.projectName));
|
|
@@ -222,7 +217,7 @@ class Start extends core_1.Command {
|
|
|
222
217
|
console.log();
|
|
223
218
|
}
|
|
224
219
|
else {
|
|
225
|
-
console.log(chalk_1.default.yellow('
|
|
220
|
+
console.log(chalk_1.default.yellow('Warning: Could not retrieve session information\n'));
|
|
226
221
|
}
|
|
227
222
|
console.log(chalk_1.default.gray('━'.repeat(60)));
|
|
228
223
|
console.log();
|
|
@@ -46,7 +46,7 @@ const prompt_optimizer_1 = require("../../core/prompt-optimizer");
|
|
|
46
46
|
class Summarize extends core_1.Command {
|
|
47
47
|
async run() {
|
|
48
48
|
const { args, flags } = await this.parse(Summarize);
|
|
49
|
-
console.log(chalk_1.default.bold.cyan('\
|
|
49
|
+
console.log(chalk_1.default.bold.cyan('\nConversation Summarizer\n'));
|
|
50
50
|
try {
|
|
51
51
|
const manager = new session_manager_1.SessionManager();
|
|
52
52
|
const analyzer = new conversation_analyzer_1.ConversationAnalyzer();
|
|
@@ -56,29 +56,28 @@ class Summarize extends core_1.Command {
|
|
|
56
56
|
console.log(chalk_1.default.dim(`Loading session ${args.sessionId}...\n`));
|
|
57
57
|
session = await manager.getSession(args.sessionId);
|
|
58
58
|
if (!session) {
|
|
59
|
-
|
|
60
|
-
this.exit(1);
|
|
59
|
+
this.error(chalk_1.default.red(`Session not found: ${args.sessionId}`));
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
62
|
else if (flags.active) {
|
|
64
63
|
console.log(chalk_1.default.dim('Loading most recent active session...\n'));
|
|
65
64
|
session = await manager.getActiveSession();
|
|
66
65
|
if (!session) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
this.error(chalk_1.default.red('No active session found') +
|
|
67
|
+
'\n\n' +
|
|
68
|
+
chalk_1.default.gray('Hint: Use ') + chalk_1.default.cyan('clavix list') + chalk_1.default.gray(' to see all sessions'));
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
else {
|
|
73
72
|
// Try to get active session by default
|
|
74
73
|
session = await manager.getActiveSession();
|
|
75
74
|
if (!session) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
75
|
+
this.error(chalk_1.default.yellow('Warning: No active session found') +
|
|
76
|
+
'\n\n' +
|
|
77
|
+
chalk_1.default.gray('Usage:') +
|
|
78
|
+
'\n' + chalk_1.default.gray(' • ') + chalk_1.default.cyan('clavix summarize <session-id>') + chalk_1.default.gray(' - Summarize specific session') +
|
|
79
|
+
'\n' + chalk_1.default.gray(' • ') + chalk_1.default.cyan('clavix summarize --active') + chalk_1.default.gray(' - Summarize most recent active session') +
|
|
80
|
+
'\n' + chalk_1.default.gray(' • ') + chalk_1.default.cyan('clavix list') + chalk_1.default.gray(' - View all sessions'));
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
// Display session info
|
|
@@ -90,8 +89,7 @@ class Summarize extends core_1.Command {
|
|
|
90
89
|
console.log();
|
|
91
90
|
// Check if session has messages
|
|
92
91
|
if (session.messages.length === 0) {
|
|
93
|
-
|
|
94
|
-
this.exit(1);
|
|
92
|
+
this.error(chalk_1.default.yellow('Warning: Session has no messages to analyze'));
|
|
95
93
|
}
|
|
96
94
|
// Analyze conversation
|
|
97
95
|
console.log(chalk_1.default.dim('Analyzing conversation...\n'));
|
|
@@ -116,7 +114,7 @@ class Summarize extends core_1.Command {
|
|
|
116
114
|
await this.applyClearOptimization(optimizedPromptContent, outputDir);
|
|
117
115
|
}
|
|
118
116
|
// Display success
|
|
119
|
-
console.log(chalk_1.default.bold.green('
|
|
117
|
+
console.log(chalk_1.default.bold.green('Analysis complete!\n'));
|
|
120
118
|
console.log(chalk_1.default.bold('Generated files:'));
|
|
121
119
|
console.log(chalk_1.default.gray(' • ') + chalk_1.default.cyan('mini-prd.md') + chalk_1.default.dim(' - Structured requirements document'));
|
|
122
120
|
console.log(chalk_1.default.gray(' • ') + chalk_1.default.cyan('optimized-prompt.md') + chalk_1.default.dim(' - AI-ready development prompt'));
|
|
@@ -139,13 +137,8 @@ class Summarize extends core_1.Command {
|
|
|
139
137
|
console.log();
|
|
140
138
|
}
|
|
141
139
|
catch (error) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
console.log(chalk_1.default.red('\n✗ An unexpected error occurred\n'));
|
|
147
|
-
}
|
|
148
|
-
this.exit(1);
|
|
140
|
+
const errorMessage = error instanceof Error ? error.message : 'An unexpected error occurred';
|
|
141
|
+
this.error(chalk_1.default.red(errorMessage));
|
|
149
142
|
}
|
|
150
143
|
}
|
|
151
144
|
/**
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clavix",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Transform vague ideas into production-ready prompts. CLI tool using the CLEAR framework to analyze, improve, and generate PRDs for AI coding assistants (Claude Code, Cursor, Windsurf, and more)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|