clavix 2.8.2 → 2.8.3

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.
@@ -301,47 +301,209 @@ Welcome to Clavix! This directory contains your local Clavix configuration and d
301
301
 
302
302
  ## Directory Structure
303
303
 
304
- - \`config.json\` - Your Clavix configuration
305
- - \`sessions/\` - Conversational mode session files
306
- - \`outputs/\` - Generated PRDs and optimized prompts
307
- - \`templates/\` - Custom templates (optional)
304
+ \`\`\`
305
+ .clavix/
306
+ ├── config.json # Your Clavix configuration
307
+ ├── INSTRUCTIONS.md # This file
308
+ ├── sessions/ # Conversational mode session files
309
+ ├── outputs/
310
+ │ ├── <project-name>/ # Per-project outputs
311
+ │ │ ├── full-prd.md
312
+ │ │ ├── quick-prd.md
313
+ │ │ ├── tasks.md
314
+ │ │ └── .clavix-implement-config.json
315
+ │ ├── prompts/ # Saved prompts for re-execution
316
+ │ │ ├── fast/ # Fast mode prompts
317
+ │ │ └── deep/ # Deep mode prompts
318
+ │ └── archive/ # Archived completed projects
319
+ └── templates/ # Custom template overrides (optional)
320
+ \`\`\`
308
321
 
309
- ## Available Commands
322
+ ## CLI Commands Reference
310
323
 
324
+ ### Prompt Improvement
325
+ - \`clavix fast "<prompt>"\` - Quick CLEAR (C/L/E) improvements with smart triage
326
+ - \`clavix deep "<prompt>"\` - Comprehensive CLEAR (C/L/E/A/R) analysis with alternatives
327
+ - \`clavix execute [--latest]\` - Execute saved prompts from fast/deep optimization
328
+ - \`clavix prompts list\` - View all saved prompts with status (NEW/EXECUTED/OLD/STALE)
329
+ - \`clavix prompts clear\` - Cleanup prompts (\`--executed\`, \`--stale\`, \`--fast\`, \`--deep\`, \`--all\`)
330
+
331
+ ### PRD & Planning
332
+ - \`clavix prd\` - Generate PRD through guided Socratic questions
333
+ - \`clavix plan\` - Transform PRD or session into phase-based \`tasks.md\`
334
+ - \`clavix start\` - Start conversational mode for requirements gathering
335
+ - \`clavix summarize [session-id]\` - Extract mini-PRD and prompts from conversation
336
+
337
+ ### Implementation
338
+ - \`clavix implement [--commit-strategy=<type>]\` - Execute tasks with optional git auto-commits
339
+ - \`clavix task-complete <taskId>\` - Mark task complete with validation, auto-show next task
340
+
341
+ ### Project Management
342
+ - \`clavix list [--sessions|--outputs]\` - List sessions and/or output projects
343
+ - \`clavix show [session-id|--output <project>]\` - Inspect session or project details
344
+ - \`clavix archive [project] [--restore]\` - Archive completed projects or restore them
345
+
346
+ ### Configuration
311
347
  - \`clavix init\` - Initialize Clavix (you just ran this!)
312
- - \`clavix fast <prompt>\` - Quick prompt improvements with smart triage
313
- - \`clavix deep <prompt>\` - Comprehensive prompt analysis
314
- - \`clavix prd\` - Generate a PRD through guided questions
315
- - \`clavix start\` - Start conversational mode
316
- - \`clavix summarize\` - Analyze conversation and extract prompt
317
- - \`clavix list\` - List sessions and outputs
318
- - \`clavix update\` - Update Clavix managed blocks
348
+ - \`clavix config [get|set|edit|reset]\` - Manage configuration preferences
349
+ - \`clavix update [--docs-only|--commands-only]\` - Refresh managed docs and slash commands
350
+ - \`clavix version\` - Print installed version
319
351
 
320
- ## Slash Commands (AI Agent)
352
+ ## Slash Commands (AI Agents)
321
353
 
322
- If using Claude Code, the following slash commands are now available:
354
+ If using Claude Code, Cursor, or Windsurf, the following slash commands are available:
323
355
 
356
+ ### Prompt Improvement
324
357
  - \`/clavix:fast [prompt]\` - Quick prompt improvements
325
358
  - \`/clavix:deep [prompt]\` - Comprehensive prompt analysis
326
- - \`/clavix:prd\` - Generate a PRD
359
+ - \`/clavix:execute\` - Execute saved prompts
360
+ - \`/clavix:prompts\` - Manage prompt lifecycle
361
+
362
+ ### PRD & Planning
363
+ - \`/clavix:prd\` - Generate PRD through guided questions
364
+ - \`/clavix:plan\` - Generate task breakdown from PRD
327
365
  - \`/clavix:start\` - Start conversational mode
328
366
  - \`/clavix:summarize\` - Summarize conversation
329
367
 
368
+ ### Implementation
369
+ - \`/clavix:implement\` - Execute task workflow with git integration
370
+ - \`/clavix:task-complete\` - Mark task as complete
371
+
372
+ ### Project Management
373
+ - \`/clavix:archive\` - Archive completed projects
374
+
375
+ ## Workflows
376
+
377
+ ### Prompt Lifecycle (v2.7+)
378
+
379
+ 1. **Create improved prompt**:
380
+ \`\`\`bash
381
+ clavix fast "your prompt here"
382
+ # or
383
+ clavix deep "your prompt here"
384
+ \`\`\`
385
+ - CLI auto-saves to \`.clavix/outputs/prompts/fast/\` or \`deep/\`
386
+ - Slash commands require manual save per template instructions
387
+
388
+ 2. **Execute saved prompt**:
389
+ \`\`\`bash
390
+ clavix execute --latest # Most recent prompt
391
+ clavix execute # Interactive selection
392
+ \`\`\`
393
+
394
+ 3. **Manage prompts**:
395
+ \`\`\`bash
396
+ clavix prompts list # View all with status
397
+ clavix prompts clear --executed # Remove executed prompts
398
+ clavix prompts clear --stale # Remove stale (30+ days)
399
+ \`\`\`
400
+
401
+ **Prompt Status**:
402
+ - \`NEW\` - Just created, never executed
403
+ - \`EXECUTED\` - Successfully executed at least once
404
+ - \`OLD\` - 7+ days old, not executed
405
+ - \`STALE\` - 30+ days old, not executed
406
+
407
+ ### Implementation Workflow (v1.3+)
408
+
409
+ 1. **Generate PRD**:
410
+ \`\`\`bash
411
+ clavix prd
412
+ # Creates: .clavix/outputs/<project>/full-prd.md + quick-prd.md
413
+ \`\`\`
414
+
415
+ 2. **Create task breakdown**:
416
+ \`\`\`bash
417
+ clavix plan
418
+ # Creates: .clavix/outputs/<project>/tasks.md
419
+ \`\`\`
420
+
421
+ 3. **Execute tasks with git integration**:
422
+ \`\`\`bash
423
+ # Manual commits (default):
424
+ clavix implement
425
+
426
+ # Or with auto-commit strategy:
427
+ clavix implement --commit-strategy=per-phase
428
+ \`\`\`
429
+
430
+ 4. **Mark tasks complete**:
431
+ \`\`\`bash
432
+ clavix task-complete <taskId>
433
+ # Validates completion, optionally commits, shows next task
434
+ \`\`\`
435
+
436
+ 5. **Archive when done**:
437
+ \`\`\`bash
438
+ clavix archive my-project
439
+ \`\`\`
440
+
441
+ ### Git Auto-Commit Strategies (v2.8.1)
442
+
443
+ When using \`clavix implement --commit-strategy=<type>\`:
444
+
445
+ - \`none\` (default) - Manual git workflow, full control
446
+ - \`per-task\` - Commit after each completed task (detailed history)
447
+ - \`per-5-tasks\` - Commit every 5 tasks (balanced)
448
+ - \`per-phase\` - Commit when phase completes (milestone-based)
449
+
450
+ **Recommendation**: Use \`none\` for most projects. Only enable auto-commits for large implementations with clear phases.
451
+
330
452
  ## When to Use Which Mode
331
453
 
332
- - **Fast mode** (\`/clavix:fast\`): Quick cleanup for simple prompts
333
- - **Deep mode** (\`/clavix:deep\`): Comprehensive analysis for complex requirements
334
- - **PRD mode** (\`/clavix:prd\`): Strategic planning with architecture and business impact
454
+ - **Fast mode**: Quick cleanup for simple prompts (1-2 iterations)
455
+ - **Deep mode**: Complex requirements needing comprehensive analysis (3-5 alternatives)
456
+ - **PRD mode**: Strategic planning with architecture, risks, and business impact
457
+ - **Conversational mode** (\`start\`/\`summarize\`): Natural discussion → extract structured requirements
458
+
459
+ ## Typical Workflows
460
+
461
+ **Improve a prompt quickly**:
462
+ \`\`\`bash
463
+ clavix fast "Add user authentication"
464
+ clavix execute --latest
465
+ \`\`\`
466
+
467
+ **Create and execute strategy**:
468
+ \`\`\`bash
469
+ clavix prd # Generate PRD
470
+ clavix plan # Create tasks.md
471
+ clavix implement # Execute with manual commits
472
+ \`\`\`
473
+
474
+ **Capture conversation**:
475
+ \`\`\`bash
476
+ clavix start # Record conversation
477
+ # ... discuss requirements ...
478
+ clavix summarize # Extract mini-PRD + prompt
479
+ \`\`\`
480
+
481
+ **Stay organized**:
482
+ \`\`\`bash
483
+ clavix list # See all projects
484
+ clavix show --output my-project
485
+ clavix archive my-project
486
+ \`\`\`
335
487
 
336
488
  ## Customization
337
489
 
338
- You can customize templates by adding files to the \`templates/\` directory.
339
- See documentation for template format details.
490
+ Create custom templates in \`.clavix/templates/\` to override defaults:
491
+ - \`fast.txt\` - Custom fast mode template
492
+ - \`deep.txt\` - Custom deep mode template
493
+ - \`prd-questions.txt\` - Custom PRD questions
494
+
495
+ Edit configuration:
496
+ \`\`\`bash
497
+ clavix config edit # Opens config.json in $EDITOR
498
+ clavix config set key=value
499
+ \`\`\`
340
500
 
341
501
  ## Need Help?
342
502
 
343
- - Documentation: https://github.com/Bob5k/Clavix
344
- - Issues: https://github.com/Bob5k/Clavix/issues
503
+ - **Documentation**: https://github.com/ClavixDev/Clavix
504
+ - **Issues**: https://github.com/ClavixDev/Clavix/issues
505
+ - **Version**: Run \`clavix version\` to check your installed version
506
+ - **Update managed blocks**: Run \`clavix update\` to refresh documentation
345
507
  `;
346
508
  await FileSystem.writeFileAtomic('.clavix/INSTRUCTIONS.md', instructions);
347
509
  }
@@ -130,7 +130,7 @@ export class TaskManager {
130
130
  * Generate phases from core features with intelligent grouping
131
131
  * CRITICAL FIX: Group related features instead of 1 phase per bullet
132
132
  */
133
- generatePhasesFromCoreFeatures(coreContent, options) {
133
+ generatePhasesFromCoreFeatures(coreContent, _options) {
134
134
  const bullets = this.extractListItems(coreContent);
135
135
  if (bullets.length === 0) {
136
136
  return [];
@@ -188,7 +188,6 @@ export class TaskManager {
188
188
  'Integration & Release': [],
189
189
  };
190
190
  features.forEach((feature) => {
191
- const lower = feature.toLowerCase();
192
191
  // Config/setup phase
193
192
  if (/\b(config|configuration|setup|install|package|tsconfig|dependencies|environment)\b/i.test(feature)) {
194
193
  groups['Configuration & Setup'].push(feature);
@@ -291,7 +290,6 @@ export class TaskManager {
291
290
  */
292
291
  buildFeatureTaskDescriptions(feature) {
293
292
  const formattedFeature = this.formatInlineText(feature);
294
- const featureLower = feature.toLowerCase();
295
293
  // Detect task type
296
294
  const isConfig = /\b(config|configuration|setup|install|update.*json|tsconfig|package\.json)\b/i.test(feature);
297
295
  const isTest = /\b(test|testing|coverage|validation|verify)\b/i.test(feature);
@@ -627,6 +625,7 @@ export class TaskManager {
627
625
  const checkbox = task.completed ? '[x]' : '[ ]';
628
626
  const reference = task.prdReference ? ` (ref: ${task.prdReference})` : '';
629
627
  content += `- ${checkbox} ${task.description}${reference}\n`;
628
+ content += ` Task ID: ${task.id}\n`;
630
629
  }
631
630
  content += '\n';
632
631
  }
@@ -653,7 +652,8 @@ export class TaskManager {
653
652
  const lines = content.split('\n');
654
653
  let currentPhase = null;
655
654
  let taskCounter = 0;
656
- for (const line of lines) {
655
+ for (let i = 0; i < lines.length; i++) {
656
+ const line = lines[i];
657
657
  // Check for phase header (## Phase Name)
658
658
  const phaseMatch = line.match(/^##\s+(.+)$/);
659
659
  if (phaseMatch) {
@@ -674,8 +674,21 @@ export class TaskManager {
674
674
  const description = taskMatch[2].trim();
675
675
  const reference = taskMatch[3]?.trim();
676
676
  taskCounter++;
677
+ // Check next line for Task ID
678
+ let taskId;
679
+ const nextLine = i + 1 < lines.length ? lines[i + 1] : null;
680
+ const taskIdMatch = nextLine?.trim().match(/^Task ID:\s+(.+)$/);
681
+ if (taskIdMatch) {
682
+ // Use Task ID from file (preferred)
683
+ taskId = taskIdMatch[1].trim();
684
+ i++; // Skip the Task ID line in next iteration
685
+ }
686
+ else {
687
+ // Fallback: regenerate ID from phase name (backward compatibility)
688
+ taskId = `${this.sanitizeId(currentPhase.name)}-${taskCounter}`;
689
+ }
677
690
  currentPhase.tasks.push({
678
- id: `${this.sanitizeId(currentPhase.name)}-${taskCounter}`,
691
+ id: taskId,
679
692
  description,
680
693
  phase: currentPhase.name,
681
694
  completed,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavix",
3
- "version": "2.8.2",
3
+ "version": "2.8.3",
4
4
  "description": "Transform vague ideas into production-ready prompts. AI agent tool with CLI interface using the CLEAR framework to analyze, improve, and generate PRDs for AI coding assistants (Claude Code, Cursor, Windsurf, and more)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -73,7 +73,7 @@
73
73
  "@typescript-eslint/parser": "^8.46.4",
74
74
  "copyfiles": "^2.4.1",
75
75
  "eslint": "^8.57.0",
76
- "jest": "^30.2.0",
76
+ "jest": "^29.7.0",
77
77
  "prettier": "^3.6.2",
78
78
  "ts-jest": "^29.4.5",
79
79
  "ts-node": "^10.9.2",