clavix 5.0.1 → 5.1.0

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.
Files changed (39) hide show
  1. package/dist/cli/commands/init.js +2 -3
  2. package/dist/cli/commands/update.js +1 -2
  3. package/dist/core/doc-injector.d.ts +2 -2
  4. package/dist/core/doc-injector.js +12 -12
  5. package/dist/templates/agents/agents.md +3 -4
  6. package/dist/templates/agents/copilot-instructions.md +4 -5
  7. package/dist/templates/agents/octo.md +7 -8
  8. package/dist/templates/agents/warp.md +3 -4
  9. package/dist/templates/instructions/README.md +12 -14
  10. package/dist/templates/instructions/core/clavix-mode.md +10 -25
  11. package/dist/templates/instructions/core/mode-enforcement.md +10 -11
  12. package/dist/templates/slash-commands/_canonical/archive.md +1 -1
  13. package/dist/templates/slash-commands/_canonical/implement.md +227 -14
  14. package/dist/templates/slash-commands/_canonical/improve.md +7 -7
  15. package/dist/templates/slash-commands/_canonical/plan.md +1 -1
  16. package/dist/templates/slash-commands/_canonical/prd.md +1 -1
  17. package/dist/templates/slash-commands/_canonical/start.md +1 -1
  18. package/dist/templates/slash-commands/_canonical/summarize.md +3 -3
  19. package/dist/templates/slash-commands/_canonical/verify.md +5 -5
  20. package/package.json +1 -1
  21. package/dist/templates/slash-commands/_canonical/execute.md +0 -276
  22. package/dist/templates/slash-commands/_components/agent-protocols/assertion-checkpoints.md +0 -122
  23. package/dist/templates/slash-commands/_components/agent-protocols/file-formats.md +0 -169
  24. package/dist/templates/slash-commands/_components/agent-protocols/quality-output.md +0 -94
  25. package/dist/templates/slash-commands/_components/agent-protocols/self-correction.md +0 -61
  26. package/dist/templates/slash-commands/_components/agent-protocols/state-assertion.md +0 -51
  27. package/dist/templates/slash-commands/_components/agent-protocols/verification-methods.md +0 -184
  28. package/dist/templates/slash-commands/_components/mode-headers/implementation-mode.md +0 -21
  29. package/dist/templates/slash-commands/_components/mode-headers/planning-mode.md +0 -17
  30. package/dist/templates/slash-commands/_components/mode-headers/self-correction.md +0 -13
  31. package/dist/templates/slash-commands/_components/references/intent-types.md +0 -39
  32. package/dist/templates/slash-commands/_components/sections/file-saving-protocol.md +0 -40
  33. package/dist/templates/slash-commands/_components/sections/intent-detection.md +0 -24
  34. package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +0 -122
  35. package/dist/templates/slash-commands/_components/sections/quality-assessment.md +0 -26
  36. package/dist/templates/slash-commands/_components/sections/workflow-navigation.md +0 -13
  37. package/dist/templates/slash-commands/_components/troubleshooting/file-not-saved.md +0 -19
  38. package/dist/templates/slash-commands/_components/troubleshooting/mode-confusion.md +0 -46
  39. package/dist/templates/slash-commands/_components/troubleshooting/triage-escalation.md +0 -26
@@ -1,24 +1,46 @@
1
1
  ---
2
2
  name: "Clavix: Implement"
3
- description: Execute tasks from the implementation plan
3
+ description: Execute tasks or prompts (auto-detects source)
4
4
  ---
5
5
 
6
- # Clavix: Implement Your Tasks
6
+ # Clavix: Implement
7
7
 
8
- Time to build your project task by task! I'll work through your task list, building each feature and tracking progress.
8
+ Time to build! This command auto-detects what to implement:
9
+ - **Tasks from PRD workflow** - Your task list from `/clavix:plan`
10
+ - **Prompts from improve workflow** - Your optimized prompts from `/clavix:improve`
9
11
 
10
12
  ---
11
13
 
12
14
  ## What This Does
13
15
 
14
16
  When you run `/clavix:implement`, I:
15
- 1. **Find your task list** - Load tasks.md from your PRD output
16
- 2. **Pick up where you left off** - Find the next incomplete task
17
- 3. **Build each task** - Implement one at a time, in order
18
- 4. **Mark progress automatically** - Update checkboxes when done
19
- 5. **Create commits (optional)** - Git history as you go
17
+ 1. **Auto-detect what to build** - Check tasks.md first, then prompts/
18
+ 2. **Find your work** - Load from PRD output or saved prompts
19
+ 3. **Build systematically** - Tasks in order, or implement your prompt
20
+ 4. **Mark progress** - Update checkboxes or prompt metadata
21
+ 5. **Verify automatically** - Run tests and checks when done
20
22
 
21
- **You just say "let's build" and I handle the rest.**
23
+ **You just say "implement" and I handle the rest.**
24
+
25
+ ### Detection Priority
26
+
27
+ ```
28
+ /clavix:implement
29
+
30
+ ├─► Check .clavix/outputs/<project>/tasks.md
31
+ │ └─► If found → Task Implementation Mode
32
+
33
+ └─► Check .clavix/outputs/prompts/*.md
34
+ └─► If found → Prompt Execution Mode
35
+ └─► If neither → Ask what to build
36
+ ```
37
+
38
+ ### Explicit Flags
39
+
40
+ Override auto-detection when needed:
41
+ - `--tasks` - Force task mode (skip prompt check)
42
+ - `--prompt <id>` - Execute specific prompt by ID
43
+ - `--latest` - Execute most recent prompt
22
44
 
23
45
  ---
24
46
 
@@ -273,22 +295,169 @@ I find them automatically from tasks.md:
273
295
 
274
296
  You don't need to remember these - I handle all the tracking.
275
297
 
298
+ ---
299
+
300
+ # Prompt Execution Mode
301
+
302
+ When I detect saved prompts (or you use `--latest`/`--prompt`), I switch to prompt execution mode.
303
+
304
+ ## How Prompt Execution Works
305
+
306
+ ### The Quick Version
307
+
308
+ ```
309
+ You: /clavix:implement --latest
310
+ Me: [Finds your latest prompt]
311
+ [Reads requirements]
312
+ [Implements everything]
313
+ [Runs verification]
314
+ Me: "Done! Here's what I built..."
315
+ ```
316
+
317
+ ### The Detailed Version (v5 Agentic-First)
318
+
319
+ **Step 1: I find your prompt**
320
+
321
+ I read directly from the file system:
322
+ - List `.clavix/outputs/prompts/*.md` to find saved prompts
323
+ - Get the most recent one (by timestamp in filename or frontmatter)
324
+ - Read the prompt file: `.clavix/outputs/prompts/<id>.md`
325
+
326
+ **Step 2: I read and understand**
327
+
328
+ I parse the prompt file and extract:
329
+ - The objective (what to build)
330
+ - Requirements (specifics to implement)
331
+ - Technical constraints (how to build it)
332
+ - Success criteria (how to know it's done)
333
+
334
+ **Step 3: I implement everything**
335
+
336
+ This is where I actually write code using my native tools:
337
+ - Create new files as needed
338
+ - Modify existing files
339
+ - Write functions, components, classes
340
+ - Add tests if specified
341
+
342
+ **Step 4: I verify automatically**
343
+
344
+ After building, I verify by:
345
+ - Running tests (if test suite exists)
346
+ - Building/compiling to ensure no errors
347
+ - Checking requirements from the checklist
348
+
349
+ **Step 5: I report results**
350
+
351
+ You'll see a summary of:
352
+ - What I built
353
+ - What passed verification
354
+ - Any issues (if they exist)
355
+
356
+ ---
357
+
358
+ ## Prompt Management
359
+
360
+ **Where prompts live:**
361
+ - All prompts: `.clavix/outputs/prompts/*.md`
362
+ - Metadata: In frontmatter of each `.md` file
363
+
364
+ ### How I Access Prompts (Native Tools)
365
+
366
+ | What I Do | How I Do It |
367
+ |-----------|-------------|
368
+ | List saved prompts | List `.clavix/outputs/prompts/*.md` files |
369
+ | Get latest prompt | Find newest file by timestamp in filename |
370
+ | Get specific prompt | Read `.clavix/outputs/prompts/<id>.md` |
371
+ | Mark as executed | Edit frontmatter: `executed: true` |
372
+ | Clean up executed | Delete files where frontmatter has `executed: true` |
373
+
374
+ ### The Prompt Lifecycle
375
+
376
+ ```
377
+ 1. YOU CREATE → /clavix:improve (saves to .clavix/outputs/prompts/<id>.md)
378
+ 2. I EXECUTE → /clavix:implement --latest (reads and implements)
379
+ 3. I VERIFY → Automatic verification
380
+ 4. MARK DONE → I update frontmatter with executed: true
381
+ ```
382
+
383
+ ---
384
+
385
+ ## Automatic Verification (Prompt Mode)
386
+
387
+ **I always verify after implementing. You don't need to ask.**
388
+
389
+ ### What Happens Automatically
390
+
391
+ After I finish building, I run verification myself:
392
+
393
+ 1. **Load the checklist** - From your executed prompt (what to check)
394
+ 2. **Run automated tests** - Test suite, build, linting, type checking
395
+ 3. **Check each requirement** - Make sure everything was implemented
396
+ 4. **Generate a report** - Show you what passed and failed
397
+
398
+ ### What You'll See
399
+
400
+ ```
401
+ Implementation complete for [prompt-id]
402
+
403
+ Verification Results:
404
+ 8 items passed
405
+ 1 item needs attention: [specific issue]
406
+
407
+ Would you like me to fix the failing item?
408
+ ```
409
+
410
+ ### Understanding the Symbols
411
+
412
+ | Symbol | Meaning |
413
+ |--------|---------|
414
+ | Pass | Passed - This works |
415
+ | Fail | Failed - Needs fixing |
416
+ | Skip | Skipped - Check later |
417
+ | N/A | N/A - Doesn't apply |
418
+
419
+ ### When Things Fail
420
+
421
+ **I try to fix issues automatically:**
422
+
423
+ If verification finds problems, I'll:
424
+ 1. Tell you what failed and why
425
+ 2. Offer to fix it
426
+ 3. Re-verify after fixing
427
+
428
+ **If I can't fix it myself:**
429
+
430
+ I'll explain what's wrong and what you might need to do:
431
+ > "The database connection is failing - this might be a configuration issue.
432
+ > Can you check that your `.env` file has the correct `DATABASE_URL`?"
433
+
434
+ ---
435
+
276
436
  ## Workflow Navigation
277
437
 
278
- **Where you are:** Implement (building your tasks)
438
+ **Where you are:** Implement (building tasks or prompts)
439
+
440
+ **How you got here (two paths):**
279
441
 
280
- **How you got here:**
442
+ **PRD Path:**
281
443
  1. `/clavix:prd` → Created your requirements document
282
444
  2. `/clavix:plan` → Generated your task breakdown
283
- 3. **`/clavix:implement`** → Now building everything (you are here)
445
+ 3. **`/clavix:implement`** → Now building tasks (you are here)
446
+
447
+ **Improve Path:**
448
+ 1. `/clavix:improve` → Optimized your prompt
449
+ 2. **`/clavix:implement --latest`** → Now building prompt (you are here)
284
450
 
285
451
  **What happens after:**
286
452
  - All tasks done → `/clavix:archive` to wrap up
453
+ - Prompt complete → Verification runs automatically
287
454
  - Need to pause → Just stop. Run `/clavix:implement` again to continue
288
455
 
289
456
  **Related commands:**
290
- - `/clavix:plan` - Regenerate tasks if needed
457
+ - `/clavix:improve` - Optimize prompts (creates prompts for execution)
458
+ - `/clavix:plan` - Generate tasks from PRD
291
459
  - `/clavix:prd` - Review requirements
460
+ - `/clavix:verify` - Detailed verification (if needed)
292
461
  - `/clavix:archive` - Archive when done
293
462
 
294
463
  ---
@@ -302,7 +471,7 @@ You don't need to remember these - I handle all the tracking.
302
471
 
303
472
  ---
304
473
 
305
- ## Agent Transparency (v5.0)
474
+ ## Agent Transparency (v5.1)
306
475
 
307
476
  ### Workflow State Detection
308
477
  {{INCLUDE:agent-protocols/state-awareness.md}}
@@ -406,3 +575,47 @@ You don't need to remember these - I handle all the tracking.
406
575
  > [I fix the issues]
407
576
  >
408
577
  > ✓ Tests passing now!"
578
+
579
+ ---
580
+
581
+ ## Prompt Mode Troubleshooting
582
+
583
+ ### "No prompts found"
584
+
585
+ **What happened:** I can't find any saved prompts.
586
+
587
+ **What I'll do:**
588
+ > "I don't see any saved prompts. Let's create one first!
589
+ >
590
+ > Run `/clavix:improve 'your requirement'` and come back with `/clavix:implement --latest`"
591
+
592
+ ### "Prompt is old or stale"
593
+
594
+ **What happened:** Your prompt is more than 7 days old.
595
+
596
+ **What I'll do:**
597
+ > "This prompt is a bit old. Want me to proceed anyway, or should we create a fresh one?"
598
+
599
+ ### "Verification keeps failing"
600
+
601
+ **What happened:** I can't get verification to pass after trying.
602
+
603
+ **What I'll do:**
604
+ > "I've tried a few fixes but this item keeps failing. Here's what's happening: [details]
605
+ >
606
+ > Would you like me to:
607
+ > 1. Keep trying with a different approach
608
+ > 2. Skip this check for now
609
+ > 3. Show you what needs manual attention"
610
+
611
+ ### "Both tasks and prompts exist"
612
+
613
+ **What happened:** You have both a tasks.md and saved prompts.
614
+
615
+ **What I'll do:**
616
+ > "I found both tasks and prompts. Which should I implement?
617
+ >
618
+ > - Tasks from your PRD (8 tasks remaining)
619
+ > - Prompt: 'Add dark mode support'
620
+ >
621
+ > Or use `--tasks` or `--prompt <id>` to specify."
@@ -28,10 +28,10 @@ This template exists because agents (including you) tend to "help" by doing work
28
28
  2. Analyze it using the workflow below
29
29
  3. Output the analysis (intent, quality, optimized prompt)
30
30
  4. Save to `.clavix/outputs/prompts/`
31
- 5. STOP and wait for `/clavix:execute`
31
+ 5. STOP and wait for `/clavix:implement`
32
32
 
33
33
  ## IF USER WANTS TO IMPLEMENT:
34
- Tell them: **"Run `/clavix:execute --latest` to implement this prompt."**
34
+ Tell them: **"Run `/clavix:implement --latest` to implement this prompt."**
35
35
 
36
36
  **DO NOT IMPLEMENT YOURSELF. YOUR JOB ENDS AFTER SHOWING THE OPTIMIZED PROMPT.**
37
37
 
@@ -74,7 +74,7 @@ Implementation: BLOCKED - I will analyze and improve the prompt, not implement i
74
74
 
75
75
  ## What is Clavix Improve Mode?
76
76
 
77
- v4.11 introduces a unified **improve** mode that intelligently selects the appropriate analysis depth:
77
+ Clavix provides a unified **improve** mode that intelligently selects the appropriate analysis depth:
78
78
 
79
79
  **Smart Depth Selection:**
80
80
  - **Quality Score >= 75%**: Auto-selects **comprehensive** depth (the prompt is good, add polish)
@@ -473,7 +473,7 @@ Before outputting final message, confirm ALL of these:
473
473
  ✅ Prompt saved to: `.clavix/outputs/prompts/<actual-prompt-id>.md`
474
474
 
475
475
  Ready to build this? Just say "let's implement" or run:
476
- /clavix:execute --latest
476
+ /clavix:implement --latest
477
477
  ```
478
478
 
479
479
  **Replace `<actual-prompt-id>` with the real ID you generated (e.g., `std-20250126-143022-a3f2`).**
@@ -490,12 +490,12 @@ Wait for the user to decide what to do next.
490
490
  **You are here:** Improve Mode (Unified Prompt Intelligence)
491
491
 
492
492
  **Common workflows:**
493
- - **Quick cleanup**: `/clavix:improve` -> `/clavix:execute --latest` -> Implement
493
+ - **Quick cleanup**: `/clavix:improve` -> `/clavix:implement --latest` -> Build
494
494
  - **Force comprehensive**: `/clavix:improve --comprehensive` -> Full analysis with alternatives
495
495
  - **Strategic planning**: `/clavix:improve` -> (suggests) `/clavix:prd` -> Plan -> Implement -> Archive
496
496
 
497
497
  **Related commands:**
498
- - `/clavix:execute` - Execute saved prompt (IMPLEMENTATION starts here)
498
+ - `/clavix:implement` - Execute saved prompt or tasks (IMPLEMENTATION starts here)
499
499
  - `/clavix:prd` - Generate PRD for strategic planning
500
500
  - `/clavix:start` - Conversational exploration before prompting
501
501
  - `/clavix:verify` - Verify implementation against checklist
@@ -506,7 +506,7 @@ Wait for the user to decide what to do next.
506
506
 
507
507
  ---
508
508
 
509
- ## Agent Transparency (v5.0)
509
+ ## Agent Transparency (v5.1)
510
510
 
511
511
  ### CLI Reference (Commands I Execute)
512
512
  {{INCLUDE:agent-protocols/cli-reference.md}}
@@ -289,7 +289,7 @@ The generated `tasks.md` will look like:
289
289
 
290
290
  ---
291
291
 
292
- ## Agent Transparency (v4.9)
292
+ ## Agent Transparency (v5.1)
293
293
 
294
294
  ### Workflow State Detection
295
295
  {{INCLUDE:agent-protocols/state-awareness.md}}
@@ -328,7 +328,7 @@ The validation ensures generated PRDs are immediately usable for AI consumption
328
328
 
329
329
  ---
330
330
 
331
- ## Agent Transparency (v4.9)
331
+ ## Agent Transparency (v5.1)
332
332
 
333
333
  ### PRD Examples
334
334
  {{INCLUDE:sections/prd-examples.md}}
@@ -202,7 +202,7 @@ The goal is natural exploration of requirements, not a rigid questionnaire. Foll
202
202
 
203
203
  ---
204
204
 
205
- ## Agent Transparency (v4.9)
205
+ ## Agent Transparency (v5.1)
206
206
 
207
207
  ### Conversational Companion
208
208
  {{INCLUDE:agent-protocols/supportive-companion.md}}
@@ -117,7 +117,7 @@ Implementation: BLOCKED - I will extract requirements, not implement them
117
117
  - **Success Criteria** [confidence]: How will success be measured?
118
118
  - **Context** [confidence]: Any important background or constraints?
119
119
 
120
- **Calculate Extraction Confidence (v4.4):**
120
+ **Calculate Extraction Confidence:**
121
121
  - Start with 50% base (conversational content detected)
122
122
  - Add 20% if concrete requirements extracted
123
123
  - Add 15% if clear goals identified
@@ -177,7 +177,7 @@ Implementation: BLOCKED - I will extract requirements, not implement them
177
177
  - [Edge case 1 and how it should be handled]
178
178
  - [Open question 1 - needs clarification]
179
179
 
180
- ## Implicit Requirements (v4.4)
180
+ ## Implicit Requirements
181
181
  *Inferred from conversation context - please verify:*
182
182
  - [Category] [Requirement inferred from discussion]
183
183
  - [Category] [Another requirement]
@@ -371,7 +371,7 @@ Implementation: BLOCKED - I will extract requirements, not implement them
371
371
 
372
372
  ---
373
373
 
374
- ## Agent Transparency (v4.9)
374
+ ## Agent Transparency (v5.1)
375
375
 
376
376
  ### How to Explain Improvements
377
377
  {{INCLUDE:sections/improvement-explanations.md}}
@@ -69,8 +69,8 @@ Me: "Here's what I found:
69
69
  **Step 1: I find your work**
70
70
 
71
71
  I'll look for the prompt you implemented. Usually this is automatic:
72
- - If you just ran `/clavix:execute`, I know which prompt that was
73
- - I'll find the checklist from the deep/fast mode output
72
+ - If you just ran `/clavix:implement`, I know which prompt that was
73
+ - I'll find the checklist from the improve mode output
74
74
 
75
75
  **Step 2: I run automated checks**
76
76
 
@@ -372,7 +372,7 @@ I generate different checklists based on what you're building:
372
372
 
373
373
  **How you got here:**
374
374
  1. `/clavix:improve` → Optimized your prompt
375
- 2. `/clavix:execute` → Implemented the requirements
375
+ 2. `/clavix:implement` → Implemented the requirements
376
376
  3. **`/clavix:verify`** → Now checking it works (you are here)
377
377
 
378
378
  **What's next:**
@@ -380,13 +380,13 @@ I generate different checklists based on what you're building:
380
380
  - All passed → `/clavix:archive` to wrap up
381
381
 
382
382
  **Related commands:**
383
- - `/clavix:execute` - Run the implementation (previous step)
383
+ - `/clavix:implement` - Execute tasks or prompts (previous step)
384
384
  - `/clavix:improve --comprehensive` - Get comprehensive checklist next time
385
385
  - `/clavix:archive` - Archive when done (next step)
386
386
 
387
387
  ---
388
388
 
389
- ## Agent Transparency (v4.9)
389
+ ## Agent Transparency (v5.1)
390
390
 
391
391
  ### CLI Reference (Commands I Execute)
392
392
  {{INCLUDE:agent-protocols/cli-reference.md}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clavix",
3
- "version": "5.0.1",
3
+ "version": "5.1.0",
4
4
  "description": "Agentic-first prompt workflows. Markdown templates that teach AI agents how to optimize prompts, create PRDs, and manage implementation. Works with Claude Code, Cursor, Windsurf, and 19+ other AI coding tools.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",