clavix 4.8.1 → 4.10.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 (25) hide show
  1. package/dist/cli/commands/analyze.d.ts +14 -0
  2. package/dist/cli/commands/analyze.js +127 -0
  3. package/dist/templates/slash-commands/_canonical/archive.md +67 -81
  4. package/dist/templates/slash-commands/_canonical/deep.md +88 -47
  5. package/dist/templates/slash-commands/_canonical/execute.md +200 -155
  6. package/dist/templates/slash-commands/_canonical/fast.md +78 -37
  7. package/dist/templates/slash-commands/_canonical/implement.md +310 -300
  8. package/dist/templates/slash-commands/_canonical/plan.md +33 -17
  9. package/dist/templates/slash-commands/_canonical/prd.md +36 -21
  10. package/dist/templates/slash-commands/_canonical/start.md +34 -33
  11. package/dist/templates/slash-commands/_canonical/summarize.md +39 -47
  12. package/dist/templates/slash-commands/_canonical/verify.md +324 -186
  13. package/dist/templates/slash-commands/_components/agent-protocols/cli-reference.md +214 -0
  14. package/dist/templates/slash-commands/_components/agent-protocols/error-handling.md +145 -88
  15. package/dist/templates/slash-commands/_components/agent-protocols/self-correction.md +20 -1
  16. package/dist/templates/slash-commands/_components/agent-protocols/supportive-companion.md +216 -0
  17. package/dist/templates/slash-commands/_components/agent-protocols/task-blocking.md +224 -0
  18. package/dist/templates/slash-commands/_components/references/quality-dimensions.md +152 -44
  19. package/dist/templates/slash-commands/_components/sections/conversation-examples.md +302 -0
  20. package/dist/templates/slash-commands/_components/sections/escalation-factors.md +119 -87
  21. package/dist/templates/slash-commands/_components/sections/improvement-explanations.md +171 -0
  22. package/dist/templates/slash-commands/_components/sections/pattern-impact.md +208 -0
  23. package/dist/templates/slash-commands/_components/sections/prd-examples.md +289 -0
  24. package/dist/templates/slash-commands/_components/troubleshooting/vibecoder-recovery.md +223 -0
  25. package/package.json +1 -1
@@ -3,408 +3,418 @@ name: "Clavix: Implement"
3
3
  description: Execute tasks from the implementation plan
4
4
  ---
5
5
 
6
- # Clavix Implement - AI-Assisted Task Execution
6
+ # Clavix: Implement Your Tasks
7
7
 
8
- You are helping the user implement tasks from their task plan with AI assistance.
8
+ Time to build your project task by task! I'll work through your task list, building each feature and tracking progress.
9
+
10
+ ---
11
+
12
+ ## What This Does
13
+
14
+ 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
20
+
21
+ **You just say "let's build" and I handle the rest.**
9
22
 
10
23
  ---
11
24
 
12
25
  ## CLAVIX MODE: Implementation
13
26
 
14
- **You are in Clavix implementation mode. You ARE authorized to write code and implement features.**
27
+ **I'm in implementation mode. Building your tasks!**
15
28
 
16
- **YOUR ROLE:**
29
+ **What I'll do:**
17
30
  - ✓ Read and understand task requirements
18
- - ✓ Implement tasks from tasks.md
31
+ - ✓ Implement tasks from your task list
19
32
  - ✓ Write production-quality code
20
- - ✓ Follow PRD specifications
21
- - ✓ Run `clavix task-complete` after each task
33
+ - ✓ Follow your PRD specifications
34
+ - ✓ Mark tasks complete automatically
35
+ - ✓ Create git commits (if you want)
22
36
 
23
- **IMPLEMENTATION AUTHORIZED:**
24
- - ✓ Writing functions, classes, and components
25
- - ✓ Creating new files and modifying existing ones
26
- - ✓ Implementing features described in tasks.md
27
- - ✓ Writing tests for implemented code
37
+ **What I'm authorized to create:**
38
+ - ✓ Functions, classes, and components
39
+ - ✓ New files and modifications
40
+ - ✓ Tests for implemented code
41
+ - ✓ Configuration files
28
42
 
29
- **MODE ENTRY VALIDATION:**
30
- Before implementing, verify:
31
- 1. Source documents exist (tasks.md in .clavix/outputs/)
32
- 2. Output assertion: "Entering IMPLEMENTATION mode. I will implement tasks from tasks.md."
43
+ **Before I start, I'll confirm:**
44
+ > "Starting task implementation. Working on: [task description]..."
33
45
 
34
46
  For complete mode documentation, see: `.clavix/instructions/core/clavix-mode.md`
35
47
 
36
48
  ---
37
49
 
38
- ## Instructions
50
+ ## How It Works
39
51
 
40
- 1. **First-time setup - Run CLI command with optional git strategy**:
52
+ ### The Quick Version
41
53
 
42
- Check if `.clavix-implement-config.json` exists in the PRD output folder.
54
+ ```
55
+ You: /clavix:implement
56
+ Me: "Found your task list! 8 tasks in 3 phases."
57
+ "Starting with: Set up project structure"
58
+ [I build it]
59
+ [I mark it done]
60
+ "Done! Moving to next task: Create database models"
61
+ [I build it]
62
+ ...
63
+ Me: "All tasks complete! Your project is built."
64
+ ```
43
65
 
44
- **If config file does NOT exist** (first time running implement):
66
+ ### The Detailed Version
45
67
 
46
- a. **Check if user wants git auto-commits** (optional, only if tasks.md has >3 phases):
47
- ```
48
- "I notice this implementation has [X] phases with [Y] tasks total.
68
+ **First time I run:**
49
69
 
50
- Would you like me to create git commits automatically as I complete tasks?
70
+ 1. **I check for your task list** - Load tasks.md from your PRD folder
71
+ 2. **I ask about git commits** (only if you have lots of tasks):
72
+ > "You've got 12 tasks. Want me to create git commits as I go?
73
+ >
74
+ > Options:
75
+ > - **per-task**: Commit after each task (detailed history)
76
+ > - **per-phase**: Commit when phases complete (milestone commits)
77
+ > - **none**: I won't touch git (you handle commits)
78
+ >
79
+ > Which do you prefer? (I'll default to 'none' if you don't care)"
51
80
 
52
- Options:
53
- - per-task: Commit after each task (frequent commits, detailed history)
54
- - per-5-tasks: Commit every 5 tasks (balanced approach)
55
- - per-phase: Commit when each phase completes (milestone commits)
56
- - none: Manual git workflow (I won't create commits)
81
+ 3. **I initialize tracking** - Run `clavix implement` to set up progress tracking
82
+ 4. **I start building** - First incomplete task
57
83
 
58
- Please choose one, or I'll proceed with 'none' (manual commits)."
59
- ```
84
+ **Each task I work on:**
60
85
 
61
- b. **Run the CLI command to initialize**:
62
- ```bash
63
- # With git strategy (if user specified):
64
- clavix implement --commit-strategy=per-phase
86
+ 1. **Read the task** - Understand what needs to be built
87
+ 2. **Check the PRD** - Make sure I understand the requirements
88
+ 3. **Implement it** - Write code, create files, build features
89
+ 4. **Mark it complete** - Run `clavix task-complete {task-id}` automatically
90
+ 5. **Move to next** - The command shows me what's next
65
91
 
66
- # Or without (defaults to 'none' - manual commits):
67
- clavix implement
68
- ```
92
+ **If we get interrupted:**
69
93
 
70
- c. **This will**:
71
- - Show current progress
72
- - Display the next incomplete task
73
- - Create `.clavix-implement-config.json` file
74
- - Set git auto-commit strategy (or default to 'none')
94
+ No problem! Just run `/clavix:implement` again and I pick up where we left off.
95
+ The checkboxes in tasks.md track exactly what's done.
75
96
 
76
- d. Wait for command to complete, then proceed with step 2
97
+ ## ⚠️ Critical Command: task-complete
77
98
 
78
- **If config file already exists**:
79
- - Skip to step 2 (implementation loop)
99
+ **After finishing EACH task, I MUST run:**
100
+ ```bash
101
+ clavix task-complete <task-id>
102
+ ```
80
103
 
81
- 2. **As the AI agent, you should**:
104
+ **Why this matters:**
105
+ - Updates tasks.md automatically (checkboxes)
106
+ - Tracks progress correctly in config
107
+ - Triggers git commits (if enabled)
108
+ - Shows me the next task
82
109
 
83
- a. **Read the configuration**:
84
- - Load `.clavix-implement-config.json` from the PRD folder
85
- - This contains: commit strategy, current task, and progress stats
110
+ **NEVER manually edit tasks.md checkboxes** - always use this command.
86
111
 
87
- b. **Read the PRD for context**:
88
- - Open the full PRD to understand requirements
89
- - Reference specific sections mentioned in tasks
112
+ ---
90
113
 
91
- c. **Read tasks.md**:
92
- - Find the first incomplete task (marked `- [ ]`)
93
- - This is your current task to implement
114
+ ## How I Mark Tasks Complete
94
115
 
95
- d. **Implement the task**:
96
- - Write/modify code as needed
97
- - Follow quality principles (clarity, structure, actionability)
98
- - Use PRD requirements as your guide
99
- - Ask user for clarification if needed
116
+ **I handle this automatically - you don't need to do anything.**
100
117
 
101
- e. **Complete the task programmatically**:
102
- - IMPORTANT: NEVER manually edit checkboxes in tasks.md
103
- - Instead, run: `clavix task-complete {task-id}`
104
- - The task ID is found in tasks.md (e.g., `phase-1-authentication-1`)
105
- - This command automatically:
106
- • Validates the task exists
107
- • Updates the checkbox in tasks.md
108
- • Tracks completion in config file
109
- • Creates git commit (if strategy enabled)
110
- • Displays the next task
111
- - Example: `clavix task-complete phase-1-setup-1`
118
+ ### What Happens Behind the Scenes
112
119
 
113
- f. **Move to next task**:
114
- - The task-complete command shows the next task automatically
115
- - Read it and repeat the process
116
- - If you get interrupted, just run `clavix implement` again to resume
120
+ After I finish implementing a task, I run:
121
+ ```bash
122
+ clavix task-complete {task-id}
123
+ ```
117
124
 
118
- 3. **Session Resume**:
119
- - When user runs `clavix implement` again, it automatically picks up from the last incomplete task
120
- - No manual tracking needed - the checkboxes in tasks.md are the source of truth
125
+ This does several things:
126
+ - Updates the checkbox in tasks.md ([ ] [x])
127
+ - Tracks progress in the config file
128
+ - Creates a git commit (if you enabled that)
129
+ - Shows me the next task
121
130
 
122
- ## Task Completion Workflow
131
+ ### Why I Don't Edit Checkboxes Manually
123
132
 
124
- **CRITICAL: Always use the `clavix task-complete` command**
133
+ The command keeps everything in sync. If I edited the file directly, the progress tracking could get confused. Trust the system!
125
134
 
126
- ### Why task-complete is CLI-Only
135
+ ### What You'll See
127
136
 
128
- The `clavix task-complete` command requires:
129
- - State validation across config files
130
- - Atomic checkbox updates in tasks.md
131
- - Conditional git commit execution
132
- - Progress tracking and next-task resolution
137
+ ```
138
+ Task complete: "Set up project structure" (phase-1-setup-1)
133
139
 
134
- Therefore it's implemented as a **CLI command** (not a slash command) and called **automatically by the agent** during implementation workflow.
140
+ Progress: 2/8 tasks (25%)
135
141
 
136
- **Agent Responsibility:** Run `clavix task-complete {task-id}` after implementing each task.
137
- **User Responsibility:** None - agent handles task completion automatically.
142
+ Next up: "Create database models"
143
+ Starting now...
144
+ ```
138
145
 
139
- ### Usage
146
+ ## My Rules for Implementation
140
147
 
141
- ```bash
142
- # After implementing a task, agent runs:
143
- clavix task-complete {task-id}
148
+ **I will:**
149
+ - Build one task at a time, in order
150
+ - Check the PRD when I need more context
151
+ - Ask you if something's unclear
152
+ - Mark tasks done only after they're really done
153
+ - Create git commits (if you asked for them)
144
154
 
145
- # Example
146
- clavix task-complete phase-1-setup-1
147
- ```
155
+ **I won't:**
156
+ - Skip tasks or jump around
157
+ - Mark something done that isn't working
158
+ - Guess what you want - I'll ask instead
159
+ - Edit checkboxes manually (I use the command)
148
160
 
149
- The command handles:
150
- - Checkbox updates in tasks.md
151
- - Config file tracking
152
- - Git commits (per strategy)
153
- - Progress display
154
- - Next task retrieval
161
+ ## Finding Your Way Around
155
162
 
156
- **NEVER manually edit tasks.md checkboxes** - the command ensures proper tracking and prevents state inconsistencies.
163
+ Need to see what projects exist or check progress? I use these commands:
157
164
 
158
- ## Important Rules
165
+ | What I Need | Command I Run |
166
+ |-------------|---------------|
167
+ | See all projects | `clavix list` |
168
+ | Check a specific project | `clavix show --output <project>` |
169
+ | See active sessions | `clavix list --sessions` |
170
+ | Find archived work | `clavix list --archived` |
159
171
 
160
- **DO**:
161
- - Read tasks.md to find the current task and its ID
162
- - Implement ONE task at a time
163
- - Use `clavix task-complete {task-id}` after completing each task
164
- - Reference the PRD for detailed requirements
165
- - Ask for clarification when tasks are ambiguous
166
- - Run `clavix implement` again if interrupted to resume
172
+ ## When I Can't Continue (Blocked Tasks)
167
173
 
168
- **DON'T**:
169
- - NEVER manually edit checkboxes in tasks.md
170
- - Skip tasks or implement out of order
171
- - Mark tasks complete before actually implementing them
172
- - Assume what code to write - use PRD as source of truth
173
- - Try to track task completion manually
174
+ Sometimes I hit a wall. Here's what happens:
174
175
 
175
- ## Task Blocking Protocol
176
+ ### Common Blockers
176
177
 
177
- **When a task is blocked** (cannot be completed), follow this protocol:
178
+ - **Missing something**: API key, credentials, design files
179
+ - **Unclear what to do**: Task is vague or conflicts with the PRD
180
+ - **Waiting on something**: External service, content, or assets not ready
181
+ - **Technical issue**: Can't install a library, environment problem
178
182
 
179
- ### Step 1: Detect Blocking Issues
183
+ ### What I'll Do
180
184
 
181
- Common blocking scenarios:
182
- - **Missing dependencies**: API keys, credentials, external services not available
183
- - **Unclear requirements**: Task description too vague or conflicts with PRD
184
- - **External blockers**: Need design assets, content, or third-party integration not ready
185
- - **Technical blockers**: Required library incompatible, environment issue, access problem
186
- - **Resource blockers**: Need database, server, or infrastructure not yet set up
185
+ **I'll stop and tell you:**
186
+ > "I'm stuck on: [task description]
187
+ >
188
+ > The problem: [e.g., 'I need a Stripe API key to set up payments']
189
+ >
190
+ > We can:
191
+ > 1. **You give me what I need** - [specific thing needed]
192
+ > 2. **I do what I can** - Build the parts that don't need [blocker]
193
+ > 3. **Skip for now** - Move on, come back to this later
194
+ >
195
+ > What would you like?"
187
196
 
188
- ### Step 2: Immediate User Communication
197
+ ### My Preferred Approach
189
198
 
190
- **Stop implementation and ask user immediately:**
191
- ```
192
- "Task blocked: [Task description]
199
+ If possible, I'll break the task into pieces and do what I can:
193
200
 
194
- Blocking issue: [Specific blocker, e.g., 'Missing Stripe API key for payment integration']
201
+ ```
202
+ Original: "Set up payment integration"
195
203
 
196
- Options to proceed:
197
- 1. **Provide missing resource** - [What user needs to provide]
198
- 2. **Break into sub-tasks** - I can implement [unblocked parts] now and defer [blocked part]
199
- 3. **Skip for now** - Mark as [BLOCKED], continue with next task, return later
204
+ What I can do now:
205
+ Create the payment service structure
206
+ Build the payment UI components
207
+ Set up the checkout flow
200
208
 
201
- Which option would you like?"
209
+ What's blocked:
210
+ ○ [BLOCKED: Need Stripe key] Connect to Stripe API
202
211
  ```
203
212
 
204
- ### Step 3: Resolution Strategies
213
+ This way we make progress even when something's missing.
205
214
 
206
- **Option A: User Provides Resource**
207
- - Wait for user to provide (API key, design, clarification)
208
- - Once provided, continue with task implementation
215
+ ### Tracking Blocked Tasks
209
216
 
210
- **Option B: Create Sub-Tasks** (preferred when possible)
211
- - Identify what CAN be done without the blocker
212
- - Break task into unblocked sub-tasks
213
- - Example: "Implement payment integration"
214
- - [x] Create payment service interface (can do now)
215
- - [ ] [BLOCKED: Need Stripe API key] Integrate Stripe SDK
216
- - [ ] Add payment UI components (can do now)
217
- - Implement unblocked sub-tasks, mark blocked ones with [BLOCKED] tag
217
+ I mark blocked tasks in tasks.md:
218
+ ```markdown
219
+ - [x] Create payment service structure
220
+ - [ ] [BLOCKED: Need Stripe API key] Connect to Stripe
221
+ - [x] Build checkout UI
222
+ ```
218
223
 
219
- **Option C: Skip and Mark Blocked**
220
- - Add [BLOCKED] tag to task in tasks.md: `- [ ] [BLOCKED: Missing API key] Task description`
221
- - Note the blocker reason
222
- - Move to next task
223
- - Return to blocked tasks when unblocked
224
+ At the end of our session, I'll remind you:
225
+ > "Just a heads up - we have 2 blocked tasks waiting for:
226
+ > - Stripe API key (payment integration)
227
+ > - Design mockups (dashboard layout)
228
+ >
229
+ > Let me know when you have these!"
224
230
 
225
- ### Step 4: Track Blocked Tasks
231
+ ## Example: What a Session Looks Like
226
232
 
227
- **In tasks.md, use [BLOCKED] notation:**
228
- ```markdown
229
- ## Phase 2: Integration
230
- - [x] Create API client structure
231
- - [ ] [BLOCKED: Waiting for API endpoint spec] Implement data sync
232
- - [ ] Add error handling for API calls
233
233
  ```
234
+ You: /clavix:implement
234
235
 
235
- **At end of implement session:**
236
- - List all blocked tasks
237
- - Remind user what's needed to unblock each one
238
- - Suggest next steps
236
+ Me: "Found your task list! Let me see where we are..."
239
237
 
240
- ### Common Blocking Scenarios & Resolutions
238
+ "📋 Progress: 0/8 tasks complete
241
239
 
242
- | Blocker Type | Detection | Resolution |
243
- |--------------|-----------|------------|
244
- | Missing API key/credentials | Code requires authentication | Ask user for credentials OR stub with mock for now |
245
- | Vague requirements | Unclear what to implement | Ask specific questions OR propose implementation for approval |
246
- | External dependency | Service/API not available | Create interface/mock OR skip and defer |
247
- | Environment issue | Can't run/test code | Ask user to fix environment OR implement without testing (note risk) |
248
- | Design/content missing | Need specific assets | Create placeholder OR wait for actual assets |
240
+ Starting with: Set up project structure (phase-1-setup-1)
249
241
 
250
- ## Example Workflow
242
+ Let me build this..."
251
243
 
252
- **CRITICAL WORKFLOW RULE:**
253
- - Agent implements task → Agent runs `clavix task-complete` → Agent proceeds to next task
254
- - User NEVER manually runs task-complete
255
- - User NEVER manually edits tasks.md checkboxes
256
- - This is an automated workflow, not a manual checklist
244
+ [I create folders, initial files, configure package.json]
257
245
 
258
- ```
259
- 1. User runs: clavix implement
260
- 2. Command shows: "Next task (ID: phase-1-auth-1): Implement user authentication"
261
- 3. You (AI agent):
262
- - Read PRD authentication requirements
263
- - Implement auth logic
264
- - Write tests
265
- - Run: clavix task-complete phase-1-auth-1
266
- - Command automatically:
267
- • Marks task complete in tasks.md
268
- Updates config tracking
269
- • Creates git commit (if enabled)
270
- Shows next task
271
- - Continue with next task or wait for user
246
+ "✓ Done! Setting up next task..."
247
+
248
+ "Working on: Create database models (phase-1-database-1)
249
+
250
+ I see this needs PostgreSQL with Prisma. Let me check your .env..."
251
+
252
+ [I create Prisma schema, run migrations]
253
+
254
+ "✓ Done! 2/8 tasks complete (25%)
255
+
256
+ Next: Set up authentication..."
257
+
258
+ [... continues through all tasks ...]
259
+
260
+ Me: "🎉 All 8 tasks complete!
261
+
262
+ Your project is built. Here's what we created:
263
+ - Project structure with TypeScript
264
+ - Database models with Prisma
265
+ - Auth system with JWT
266
+ - [... etc]
267
+
268
+ Ready to test it out?"
272
269
  ```
273
270
 
274
- ## Finding Task IDs
271
+ ## How I Find Tasks
275
272
 
276
- Task IDs are visible in several places:
277
- 1. When you read `tasks.md` - they're in the format `phase-X-name-Y`
278
- 2. In the config file (`.clavix-implement-config.json`) under `currentTask.id`
279
- 3. When running `clavix implement` - shown next to task description
273
+ Task IDs look like: `phase-1-setup-1`, `phase-2-auth-3`
280
274
 
281
- Example tasks.md structure:
275
+ I find them automatically from tasks.md:
282
276
  ```markdown
283
- ## Phase 1: Authentication
277
+ ## Phase 1: Setup
284
278
 
285
- - [ ] Implement user registration (ref: User Management)
286
- Task ID: phase-1-authentication-1
279
+ - [ ] Set up project structure
280
+ Task ID: phase-1-setup-1
287
281
 
288
- - [ ] Add JWT token generation (ref: User Management)
289
- Task ID: phase-1-authentication-2
282
+ - [ ] Create database models
283
+ Task ID: phase-1-setup-2
290
284
  ```
291
285
 
292
- To find the task ID programmatically, read tasks.md and look for the pattern `phase-{number}-{sanitized-phase-name}-{counter}`.
286
+ You don't need to remember these - I handle all the tracking.
293
287
 
294
288
  ## Workflow Navigation
295
289
 
296
- **You are here:** Implement (Task Execution)
290
+ **Where you are:** Implement (building your tasks)
297
291
 
298
- **Common workflows:**
299
- - **Full workflow**: `/clavix:plan` → `/clavix:implement` [execute all tasks] → `/clavix:archive`
300
- - **Resume work**: `/clavix:implement` → Continue from last incomplete task
301
- - **Iterative**: `/clavix:implement`[complete task] [pause] `/clavix:implement` → [continue]
292
+ **How you got here:**
293
+ 1. `/clavix:prd` → Created your requirements document
294
+ 2. `/clavix:plan` → Generated your task breakdown
295
+ 3. **`/clavix:implement`**Now building everything (you are here)
296
+
297
+ **What happens after:**
298
+ - All tasks done → `/clavix:archive` to wrap up
299
+ - Need to pause → Just stop. Run `/clavix:implement` again to continue
302
300
 
303
301
  **Related commands:**
304
- - `/clavix:plan` - Generate/regenerate task breakdown (previous step)
305
- - `/clavix:archive` - Archive completed project (final step)
306
- - `/clavix:prd` - Review PRD for context during implementation
302
+ - `/clavix:plan` - Regenerate tasks if needed
303
+ - `/clavix:prd` - Review requirements
304
+ - `/clavix:archive` - Archive when done
305
+
306
+ ---
307
307
 
308
- ## Tips
308
+ ## Tips for Success
309
309
 
310
- - The implementation is meant to be iterative and collaborative
311
- - User can pause/resume at any time
312
- - Tasks are designed to be atomic and independently implementable
313
- - Use the PRD as the authoritative source for "what to build"
314
- - Use tasks.md as the guide for "in what order"
310
+ - **Pause anytime** - We can always pick up where we left off
311
+ - **Ask questions** - If a task is unclear, I'll stop and ask
312
+ - **Trust the PRD** - It's our source of truth for what to build
313
+ - **One at a time** - I build tasks in order so nothing breaks
315
314
 
316
315
  ---
317
316
 
318
- ## Agent Transparency (v4.4)
317
+ ## Agent Transparency (v4.9)
319
318
 
320
319
  ### Workflow State Detection
321
320
  {{INCLUDE:agent-protocols/state-awareness.md}}
322
321
 
323
- ### Error Classification
322
+ ### Error Handling
324
323
  {{INCLUDE:agent-protocols/error-handling.md}}
325
324
 
326
- ### File Format Reference
327
- {{INCLUDE:agent-protocols/file-formats.md}}
325
+ ### Task Blocking Protocol
326
+ {{INCLUDE:agent-protocols/task-blocking.md}}
327
+
328
+ ### CLI Reference (Commands I Execute)
329
+ {{INCLUDE:agent-protocols/cli-reference.md}}
328
330
 
329
331
  ### Agent Decision Rules
330
332
  {{INCLUDE:agent-protocols/decision-rules.md}}
331
333
 
334
+ ### Recovery Patterns
335
+ {{INCLUDE:troubleshooting/vibecoder-recovery.md}}
336
+
332
337
  ---
333
338
 
334
- ## Troubleshooting
335
-
336
- ### Issue: `.clavix-implement-config.json` not found
337
- **Cause**: User hasn't run `clavix implement` CLI command first
338
- **Solution** (inline):
339
- - Error: "Config file not found. Run `clavix implement` first to initialize"
340
- - CLI creates config and shows first task
341
- - AI agent should wait for config before proceeding
342
-
343
- ### Issue: `clavix task-complete` command not found
344
- **Cause**: Clavix version doesn't have task-complete command OR not in PATH
345
- **Solution**:
346
- - Check Clavix version: `clavix --version`
347
- - Ensure Clavix is up to date: `npm install -g clavix@latest`
348
- - If issue persists, report bug to Clavix maintainers
349
-
350
- ### Issue: Task ID not found by task-complete
351
- **Cause**: Task ID doesn't match what's in tasks.md
352
- **Solution**:
353
- - Read tasks.md to see actual task IDs
354
- - Task IDs follow pattern: `{sanitized-phase-name}-{counter}`
355
- - Run `clavix task-complete` without arguments to see available tasks
356
- - Example: `phase-1-authentication-1` not `Phase 1 Authentication 1`
357
-
358
- ### Issue: Task already marked complete
359
- **Cause**: Task was completed in previous session or manually
360
- **Solution**:
361
- - Use `--force` flag: `clavix task-complete {task-id} --force`
362
- - Or skip to next task shown by `clavix implement`
363
- - Config will be updated to track the completion
364
-
365
- ### Issue: Cannot find next incomplete task in tasks.md
366
- **Cause**: All tasks completed OR tasks.md corrupted
367
- **Solution**:
368
- - Check if all tasks are `[x]` - if yes, congratulate completion!
369
- - Suggest `/clavix:archive` for completed project
370
- - If tasks.md corrupted, ask user to review/regenerate
371
-
372
- ### Issue: Task description unclear or conflicts with PRD
373
- **Cause**: Task breakdown was too vague or PRD changed
374
- **Solution** (inline - covered by Task Blocking Protocol):
375
- - Stop and ask user for clarification
376
- - Reference PRD section if mentioned
377
- - Propose interpretation for user approval
378
- - Update task description in tasks.md after clarification
379
-
380
- ### Issue: Git commit fails (wrong strategy, hook error, etc.)
381
- **Cause**: Git configuration issue or commit hook failure
382
- **Solution**:
383
- - Show error to user
384
- - Suggest checking git status manually
385
- - Ask if should continue without commit or fix issue first
386
- - Note: Commits are convenience, not blocker - can proceed without
387
-
388
- ### Issue: Multiple [BLOCKED] tasks accumulating
389
- **Cause**: Dependencies or blockers not being resolved
390
- **Solution**:
391
- - After 3+ blocked tasks, pause and report to user
392
- - List all blockers and what's needed to resolve
393
- - Ask user to prioritize: unblock tasks OR continue with unblocked ones
394
- - Consider if project should be paused until blockers cleared
395
-
396
- ### Issue: Task completed but tests failing
397
- **Cause**: Implementation doesn't meet requirements
398
- **Solution**:
399
- - Do NOT mark task as complete if tests fail
400
- - Fix failing tests before marking [x]
401
- - If tests are incorrectly written, fix tests first
402
- - Task isn't done until tests pass
403
-
404
- ### Issue: Implementing in wrong order (skipped dependencies)
405
- **Cause**: AI agent or user jumped ahead
406
- **Solution**:
407
- - Stop and review tasks.md order
408
- - Check if skipped task was a dependency
409
- - Implement missed dependency first
410
- - Follow sequential order unless explicitly instructed otherwise
339
+ ## When Things Go Wrong
340
+
341
+ ### "Can't find your task list"
342
+
343
+ **What happened:** I can't find tasks.md in your PRD folder.
344
+
345
+ **What I'll do:**
346
+ > "I don't see a task list. Let me check...
347
+ >
348
+ > - Did you run `/clavix:plan` first?
349
+ > - Is there a PRD folder in .clavix/outputs/?"
350
+
351
+ ### "Task command not working"
352
+
353
+ **What happened:** The `clavix task-complete` command isn't recognized.
354
+
355
+ **What I'll do:**
356
+ > "Having trouble with the task command. Let me check your Clavix version..."
357
+ >
358
+ > If it's outdated, I'll suggest: "Try `npm install -g clavix@latest` to update"
359
+
360
+ ### "Can't find that task ID"
361
+
362
+ **What happened:** The task ID doesn't match what's in tasks.md.
363
+
364
+ **What I'll do:** Read tasks.md again and find the correct ID. They look like `phase-1-setup-1` not "Phase 1 Setup 1".
365
+
366
+ ### "Already done that one"
367
+
368
+ **What happened:** Task was marked complete before.
369
+
370
+ **What I'll do:** Skip it and move to the next incomplete task.
371
+
372
+ ### "All done!"
373
+
374
+ **What happened:** All tasks are marked complete.
375
+
376
+ **What I'll say:**
377
+ > "🎉 All tasks complete! Your project is built.
378
+ >
379
+ > Ready to archive this project? Run `/clavix:archive`"
380
+
381
+ ### "I don't understand this task"
382
+
383
+ **What happened:** Task description is too vague.
384
+
385
+ **What I'll do:** Stop and ask you:
386
+ > "This task says 'Implement data layer' but I'm not sure what that means.
387
+ > Can you tell me more about what you want here?"
388
+
389
+ ### "Git commit failed"
390
+
391
+ **What happened:** Something went wrong with auto-commits.
392
+
393
+ **What I'll do:**
394
+ > "Git commit didn't work - might be a hook issue or uncommitted changes.
395
+ >
396
+ > No worries, I'll keep building. You can commit manually later."
397
+
398
+ ### "Too many blocked tasks"
399
+
400
+ **What happened:** We've got 3+ tasks that need something to continue.
401
+
402
+ **What I'll do:** Stop and give you a summary:
403
+ > "We've got several blocked tasks piling up:
404
+ >
405
+ > - Payment: Need Stripe API key
406
+ > - Email: Need SendGrid credentials
407
+ > - Maps: Need Google Maps API key
408
+ >
409
+ > Want to provide these now, or should I continue with unblocked tasks?"
410
+
411
+ ### "Tests are failing"
412
+
413
+ **What happened:** I built the feature but tests aren't passing.
414
+
415
+ **What I'll do:** Keep working until tests pass before marking done:
416
+ > "Tests are failing for this task. Let me see what's wrong...
417
+ >
418
+ > [I fix the issues]
419
+ >
420
+ > ✓ Tests passing now!"