clavix 4.2.0 → 4.3.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.
Files changed (51) hide show
  1. package/LICENSE +201 -21
  2. package/README.md +1 -1
  3. package/dist/cli/commands/deep.js +4 -58
  4. package/dist/cli/commands/init.js +13 -16
  5. package/dist/cli/commands/plan.js +2 -2
  6. package/dist/core/conversation-quality-tracker.d.ts +81 -0
  7. package/dist/core/conversation-quality-tracker.js +195 -0
  8. package/dist/core/intelligence/intent-detector.js +3 -0
  9. package/dist/core/intelligence/pattern-library.d.ts +18 -1
  10. package/dist/core/intelligence/pattern-library.js +131 -0
  11. package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +25 -0
  12. package/dist/core/intelligence/patterns/conversation-summarizer.js +197 -0
  13. package/dist/core/intelligence/patterns/dependency-identifier.d.ts +21 -0
  14. package/dist/core/intelligence/patterns/dependency-identifier.js +149 -0
  15. package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +20 -0
  16. package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +129 -0
  17. package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +22 -0
  18. package/dist/core/intelligence/patterns/requirement-prioritizer.js +117 -0
  19. package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +22 -0
  20. package/dist/core/intelligence/patterns/success-metrics-enforcer.js +142 -0
  21. package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +22 -0
  22. package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +140 -0
  23. package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +22 -0
  24. package/dist/core/intelligence/patterns/user-persona-enricher.js +124 -0
  25. package/dist/core/intelligence/quality-assessor.js +2 -0
  26. package/dist/core/intelligence/types.d.ts +7 -2
  27. package/dist/core/intelligence/universal-optimizer.d.ts +27 -2
  28. package/dist/core/intelligence/universal-optimizer.js +65 -5
  29. package/dist/core/task-manager.d.ts +1 -2
  30. package/dist/core/task-manager.js +21 -26
  31. package/dist/templates/slash-commands/_canonical/deep.md +37 -69
  32. package/dist/templates/slash-commands/_canonical/fast.md +1 -0
  33. package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +26 -2
  34. package/package.json +3 -3
  35. package/dist/templates/instructions/README 2.md +0 -311
  36. package/dist/templates/instructions/core 2/clavix-mode.md +0 -275
  37. package/dist/templates/instructions/core 2/file-operations.md +0 -330
  38. package/dist/templates/instructions/core 2/verification.md +0 -377
  39. package/dist/templates/instructions/troubleshooting 2/jumped-to-implementation.md +0 -234
  40. package/dist/templates/instructions/troubleshooting 2/mode-confusion.md +0 -402
  41. package/dist/templates/instructions/troubleshooting 2/skipped-file-creation.md +0 -385
  42. package/dist/templates/slash-commands/_canonical 2/archive.md +0 -410
  43. package/dist/templates/slash-commands/_canonical 2/deep.md +0 -512
  44. package/dist/templates/slash-commands/_canonical 2/execute.md +0 -80
  45. package/dist/templates/slash-commands/_canonical 2/fast.md +0 -370
  46. package/dist/templates/slash-commands/_canonical 2/implement.md +0 -364
  47. package/dist/templates/slash-commands/_canonical 2/plan.md +0 -329
  48. package/dist/templates/slash-commands/_canonical 2/prd.md +0 -320
  49. package/dist/templates/slash-commands/_canonical 2/prompts.md +0 -97
  50. package/dist/templates/slash-commands/_canonical 2/start.md +0 -204
  51. package/dist/templates/slash-commands/_canonical 2/summarize.md +0 -395
@@ -1,410 +0,0 @@
1
- ---
2
- name: "Clavix: Archive"
3
- description: Archive completed PRD projects
4
- ---
5
-
6
- # Clavix Archive - PRD Project Archival
7
-
8
- > **⚠️ Agent Execution Note**: This command requires CLI execution. AI agents should run `clavix archive` via Bash tool to perform archival operations. Direct file manipulation is not recommended due to state tracking complexity.
9
-
10
- You are helping the user archive completed PRD projects to keep their workspace organized.
11
-
12
- ## Instructions
13
-
14
- ### Part A: Agent Execution Protocol
15
-
16
- **As an AI agent, you should:**
17
-
18
- 1. **Run the CLI command** to handle archival operations:
19
- ```bash
20
- clavix archive
21
- ```
22
-
23
- The CLI will:
24
- - Prompt user for project selection
25
- - Validate task completion status
26
- - Handle file operations safely
27
- - Update state tracking
28
-
29
- 2. **Choose the appropriate mode** based on user intent:
30
-
31
- - **Interactive mode** (no arguments): User selects from list
32
- - **Specific project**: `clavix archive [project-name]`
33
- - **Force archive incomplete**: `clavix archive [project-name] --force`
34
- - **Permanent delete**: `clavix archive [project-name] --delete`
35
- - **List archived**: `clavix archive --list`
36
- - **Restore**: `clavix archive --restore [project-name]`
37
-
38
- 3. **Before running the command**, validate:
39
- - Check if `.clavix/outputs/` directory exists
40
- - Verify user intent (archive vs delete vs restore)
41
- - Confirm project name if specified
42
-
43
- 4. **After CLI completes**, communicate results:
44
- - Confirm where project was moved
45
- - Mention restoration is possible (unless deleted)
46
- - Update user on next steps
47
-
48
- ### Part B: Understanding Archive Operations
49
-
50
- **Archive Modes**:
51
-
52
- 1. **Interactive Archive Mode**:
53
- ```bash
54
- clavix archive
55
- ```
56
-
57
- CLI behavior:
58
- - Lists all PRD projects with 100% tasks completed
59
- - Allows user to select which project to archive
60
- - Confirms before archiving
61
- - Moves the project to archive directory
62
-
63
- 2. **Archive Specific Project**:
64
- ```bash
65
- clavix archive [project-name]
66
- ```
67
-
68
- CLI behavior:
69
- - Checks task completion status
70
- - Warns if tasks are incomplete
71
- - Asks for confirmation
72
- - Archives the specific project
73
-
74
- 3. **Force Archive (Incomplete Tasks)**:
75
- ```bash
76
- clavix archive [project-name] --force
77
- ```
78
-
79
- Use when:
80
- - Project scope changed and some tasks are no longer relevant
81
- - User wants to archive work-in-progress
82
- - Tasks are incomplete but project is done
83
-
84
- 4. **Delete Project (Permanent Removal)**: **DESTRUCTIVE ACTION**
85
- ```bash
86
- clavix archive [project-name] --delete
87
- ```
88
-
89
- **WARNING**: This PERMANENTLY deletes the project. Cannot be restored.
90
-
91
- **When to delete vs archive:**
92
- - **DELETE**: Failed experiments, duplicate projects, test/demo data, abandoned prototypes with no value
93
- - **ARCHIVE**: Completed work, incomplete but potentially useful work, anything you might reference later
94
-
95
- **Delete decision tree:**
96
- ```
97
- Is this a failed experiment with no learning value? → DELETE
98
- Is this a duplicate/test project with no unique info? → DELETE
99
- Might you need to reference this code later? → ARCHIVE
100
- Could this be useful for learning/reference? → ARCHIVE
101
- Are you unsure? → ARCHIVE (safe default)
102
- ```
103
-
104
- **Safety confirmation required:**
105
- - Shows project details and task status
106
- - Requires typing project name to confirm
107
- - Warns about permanent deletion
108
- - Lists what will be permanently deleted
109
-
110
- 5. **List Archived Projects**:
111
- ```bash
112
- clavix archive --list
113
- ```
114
-
115
- Shows all projects currently in archive with their task completion status
116
-
117
- 6. **Restore from Archive**:
118
- ```bash
119
- clavix archive --restore [project-name]
120
- ```
121
-
122
- Moves a project back from archive to active outputs
123
-
124
- ## When to Archive
125
-
126
- **Good times to archive:**
127
- - All implementation tasks are completed (`tasks.md` shows 100%)
128
- - Project has been deployed/shipped to production
129
- - Feature is complete and no more work planned
130
- - User explicitly requests archival
131
- - Old/abandoned projects that won't be continued
132
-
133
- **Don't archive when:**
134
- - Tasks are still in progress (unless using --force)
135
- - Project is actively being worked on
136
- - Future enhancements are planned in current tasks
137
-
138
- ## Archive Behavior
139
-
140
- **What gets archived:**
141
- - The entire PRD project folder
142
- - All files: PRD.md, PRD-quick.md, tasks.md, .clavix-implement-config.json
143
- - Complete directory structure preserved
144
-
145
- **Where it goes:**
146
- - From: `.clavix/outputs/[project-name]/`
147
- - To: `.clavix/outputs/archive/[project-name]/`
148
-
149
- **What changes:**
150
- - Archived projects won't show in `/clavix:plan` searches
151
- - Archived projects won't show in `/clavix:implement` searches
152
- - They're still accessible in archive directory
153
- - Can be restored at any time
154
-
155
- ## Prompts Are Separate (v2.7+)
156
-
157
- Fast/deep prompts from `/clavix:fast` and `/clavix:deep` are stored separately in `.clavix/outputs/prompts/`.
158
-
159
- **Prompts are NOT archived with PRD projects.**
160
-
161
- **Manage prompts separately:**
162
- ```bash
163
- clavix prompts list # View all prompts
164
- clavix prompts clear # Cleanup prompts
165
- /clavix:prompts # Full management workflow
166
- ```
167
-
168
- **Before archiving, consider cleanup:**
169
- ```bash
170
- /clavix:prompts clear --executed
171
- ```
172
-
173
- **Prompts lifecycle:**
174
- - Independent from PRD lifecycle
175
- - Managed via `/clavix:prompts`
176
- - Clear manually when project complete
177
-
178
- ## Example Workflows
179
-
180
- ### Workflow 1: Complete Project
181
- ```
182
- User: "I've finished implementing the user authentication feature"
183
- You: "Great! Let me help you archive it."
184
-
185
- Run: clavix archive
186
-
187
- User selects: user-authentication-system
188
- System shows: All 15 tasks completed (100%)
189
- User confirms: Yes, archive it
190
-
191
- Result: Project moved to .clavix/outputs/archive/user-authentication-system/
192
- ```
193
-
194
- ### Workflow 2: Force Archive WIP
195
- ```
196
- User: "We're pivoting, I want to archive the old API design even though tasks aren't done"
197
- You: "I'll archive it with --force"
198
-
199
- Run: clavix archive old-api-design --force
200
-
201
- System shows: 8 incomplete tasks
202
- User confirms: Yes, archive anyway
203
-
204
- Result: Project archived despite incomplete tasks
205
- ```
206
-
207
- ### Workflow 3: Restore Archived Project
208
- ```
209
- User: "Actually, we need to revisit that authentication feature"
210
- You: "I'll restore it from the archive"
211
-
212
- Run: clavix archive --restore user-authentication-system
213
-
214
- Result: Project moved back to .clavix/outputs/user-authentication-system/
215
- ```
216
-
217
- ### Workflow 4: Delete Failed Experiment
218
- ```
219
- User: "I have a test project 'api-experiment-1' that I don't need anymore"
220
- You: "Is this something you might reference later, or can it be permanently deleted?"
221
-
222
- User: "It was just a quick test, no value. Delete it."
223
- You: "This will permanently delete the project. I'll run the delete command."
224
-
225
- Run: clavix archive api-experiment-1 --delete
226
-
227
- System shows:
228
- Project: api-experiment-1
229
- Tasks: 3/5 completed
230
- Files: full-prd.md, quick-prd.md, tasks.md
231
-
232
- WARNING: This action is PERMANENT and CANNOT be undone.
233
- Type the project name to confirm deletion: _
234
-
235
- User types: api-experiment-1
236
-
237
- Result: Project permanently deleted from .clavix/outputs/api-experiment-1/
238
- ```
239
-
240
- ## AI Agent Guidelines
241
-
242
- When user mentions archiving or cleaning up projects:
243
-
244
- 1. **Validate prerequisites before running CLI**:
245
- - Check if `.clavix/outputs/` directory exists
246
- - If not, inform user no projects exist to archive
247
- - Verify user intent (list, archive, restore, delete)
248
-
249
- 2. **Check completion status first**:
250
- - Run `clavix archive` (interactive mode) to see archivable projects
251
- - CLI will display projects with completion percentages
252
- - Review output and communicate options to user
253
-
254
- 3. **Execute the appropriate command**:
255
- - **Interactive selection**: `clavix archive` (let user pick from list)
256
- - **Specific project**: `clavix archive [project-name]`
257
- - **Force incomplete**: `clavix archive [project-name] --force`
258
- - **List archived**: `clavix archive --list`
259
- - **Restore**: `clavix archive --restore [project-name]`
260
- - **Delete**: `clavix archive [project-name] --delete` (with extra caution)
261
-
262
- 4. **Confirm before archiving**:
263
- - If using specific project mode, confirm project name with user
264
- - Mention the archive location (`.clavix/outputs/archive/`)
265
- - Explain that restoration is possible
266
-
267
- 5. **Use --force cautiously**:
268
- - Only when user explicitly wants to archive incomplete work
269
- - Run command and let CLI show incomplete task count
270
- - CLI will ask for user confirmation
271
- - Explain they won't lose data (just moving location)
272
-
273
- 6. **Suggest restoration when appropriate**:
274
- - If user mentions old/past work, check archive first
275
- - Run `clavix archive --list` to show what's archived
276
- - Offer to restore if needed via `clavix archive --restore [project]`
277
-
278
- 7. **Handle delete requests with extreme caution**:
279
- - Always ask: "Do you want to DELETE (permanent) or ARCHIVE (safe)?"
280
- - Explain that delete is permanent and irreversible
281
- - Suggest archive as the safer default
282
- - Use decision tree to help user decide
283
- - Only run `--delete` after clear confirmation from user
284
- - Double-check it's truly no-value content (failed experiments, duplicates, test data)
285
- - CLI will require typing project name to confirm - this is expected
286
-
287
- 8. **After CLI execution**:
288
- - Communicate success/failure clearly
289
- - Mention next steps (e.g., "Project archived, you can restore with `/clavix:archive --restore`")
290
- - If error occurs, explain and suggest recovery options
291
-
292
- ## Workflow Navigation
293
-
294
- **You are here:** Archive (Project Cleanup)
295
-
296
- **Common workflows:**
297
- - **Complete workflow**: `/clavix:implement` → [all tasks done] → `/clavix:archive` → Clean workspace
298
- - **Review and archive**: `/clavix:archive` → [select completed project] → Archive
299
- - **Restore old work**: `/clavix:archive --list` → `/clavix:archive --restore [project]` → Resume
300
-
301
- **Related commands:**
302
- - `/clavix:implement` - Complete remaining tasks before archiving
303
- - `/clavix:plan` - Review task completion status
304
- - `/clavix:prd` - Start new project after archiving old one
305
-
306
- ## Tips
307
-
308
- - Archive keeps your active projects list clean and focused
309
- - Archived projects maintain all their data (nothing is deleted)
310
- - Archive is searchable - you can still `grep` or find files in archive/
311
- - Regular archiving improves `/clavix:plan` and `/clavix:implement` performance
312
- - Use `--list` regularly to know what's been archived
313
-
314
- ## Troubleshooting
315
-
316
- ### Issue: No projects available to archive
317
- **Cause**: No projects in `.clavix/outputs/` OR all already archived
318
-
319
- **Agent recovery**:
320
- 1. Check if `.clavix/outputs/` exists: `ls .clavix/outputs/`
321
- 2. If directory doesn't exist: "No PRD projects found. Create one with `/clavix:prd`"
322
- 3. If empty: Run `clavix archive --list` to show archived projects
323
- 4. Communicate: "All projects are already archived" or "No projects exist yet"
324
-
325
- ### Issue: Trying to archive project with incomplete tasks
326
- **Cause**: User wants to archive but tasks aren't 100% done
327
-
328
- **Agent recovery**:
329
- 1. CLI will warn about incomplete tasks
330
- 2. Ask user: "Project has X incomplete tasks. Do you want to:
331
- - Complete tasks first with `/clavix:implement`
332
- - Archive anyway with `--force` (tasks remain incomplete but archived)
333
- - Cancel archival"
334
- 3. If user confirms force: Run `clavix archive [project] --force`
335
- 4. If scope changed: Explain `--force` is appropriate
336
-
337
- ### Issue: Cannot restore archived project (name conflict)
338
- **Cause**: Project with same name already exists in active outputs
339
-
340
- **Agent recovery**:
341
- 1. CLI will show error: "Project '[name]' already exists in active outputs"
342
- 2. Ask user which option:
343
- - Archive the active project first, then restore old one
344
- - Keep both (manual rename required)
345
- - Cancel restoration
346
- 3. Execute user's choice
347
-
348
- ### Issue: Unsure whether to delete or archive
349
- **Cause**: User wants to clean up but uncertain about permanence
350
-
351
- **Agent recovery**:
352
- 1. Use decision tree to guide user:
353
- ```
354
- Ask user questions:
355
- - "Is this a failed experiment with no learning value?"
356
- - "Might you need to reference this code later?"
357
- - "Are you unsure if it's valuable?"
358
- ```
359
- 2. Default recommendation: **ARCHIVE** (safer, reversible)
360
- 3. Only suggest DELETE for: duplicates, failed experiments, test data with zero value
361
- 4. Remind: "Archive is free, disk space is cheap, regret is expensive"
362
-
363
- ### Issue: CLI command fails or hangs
364
- **Cause**: File system permissions, missing directory, or process error
365
-
366
- **Agent recovery**:
367
- 1. Check error output from CLI
368
- 2. Common fixes:
369
- - Check `.clavix/outputs/` exists and is writable
370
- - Verify project name is correct (no typos)
371
- - Check if another process is accessing the files
372
- 3. Suggest: Run with full project path or retry
373
- 4. If persistent: Inform user to check file permissions
374
-
375
- ### Issue: Accidentally deleted project (used --delete instead of archive)
376
- **Cause**: User error or misunderstanding of --delete flag
377
-
378
- **Agent recovery**:
379
- 1. Acknowledge: "Project was permanently deleted via `--delete` flag"
380
- 2. Check recovery options:
381
- - "If code was committed to git, we can recover from git history"
382
- - "Check if you have local backups"
383
- - "Check if IDE has local history (VS Code, JetBrains)"
384
- 3. Prevention: "Going forward, use ARCHIVE by default. Only DELETE when absolutely certain."
385
- 4. No recovery possible from Clavix itself
386
-
387
- ### Issue: Archive directory getting too large
388
- **Cause**: Many archived projects accumulating
389
-
390
- **Agent response**:
391
- 1. Explain: "Archive is designed to grow - this is normal behavior"
392
- 2. Archived projects don't affect active command performance
393
- 3. If user truly concerned:
394
- - Review archive: `clavix archive --list`
395
- - Identify ancient/irrelevant projects
396
- - Delete only truly obsolete ones: `clavix archive [old-project] --delete`
397
- - Or suggest external backup for very old projects
398
-
399
- ### Issue: Archived project but forgot what it was about
400
- **Cause**: No naming convention or time passed
401
-
402
- **Agent recovery**:
403
- 1. Read the PRD to remind user:
404
- ```bash
405
- cat .clavix/outputs/archive/[project-name]/full-prd.md
406
- ```
407
- 2. Summarize: Problem, Goal, Features from PRD
408
- 3. Suggest: Better naming conventions going forward
409
- - Example: `2024-01-user-auth` (date-feature format)
410
- - Example: `ecommerce-checkout-v2` (project-component format)