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.
- package/LICENSE +201 -21
- package/README.md +1 -1
- package/dist/cli/commands/deep.js +4 -58
- package/dist/cli/commands/init.js +13 -16
- package/dist/cli/commands/plan.js +2 -2
- package/dist/core/conversation-quality-tracker.d.ts +81 -0
- package/dist/core/conversation-quality-tracker.js +195 -0
- package/dist/core/intelligence/intent-detector.js +3 -0
- package/dist/core/intelligence/pattern-library.d.ts +18 -1
- package/dist/core/intelligence/pattern-library.js +131 -0
- package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +25 -0
- package/dist/core/intelligence/patterns/conversation-summarizer.js +197 -0
- package/dist/core/intelligence/patterns/dependency-identifier.d.ts +21 -0
- package/dist/core/intelligence/patterns/dependency-identifier.js +149 -0
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +20 -0
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +129 -0
- package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +22 -0
- package/dist/core/intelligence/patterns/requirement-prioritizer.js +117 -0
- package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +22 -0
- package/dist/core/intelligence/patterns/success-metrics-enforcer.js +142 -0
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +22 -0
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +140 -0
- package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +22 -0
- package/dist/core/intelligence/patterns/user-persona-enricher.js +124 -0
- package/dist/core/intelligence/quality-assessor.js +2 -0
- package/dist/core/intelligence/types.d.ts +7 -2
- package/dist/core/intelligence/universal-optimizer.d.ts +27 -2
- package/dist/core/intelligence/universal-optimizer.js +65 -5
- package/dist/core/task-manager.d.ts +1 -2
- package/dist/core/task-manager.js +21 -26
- package/dist/templates/slash-commands/_canonical/deep.md +37 -69
- package/dist/templates/slash-commands/_canonical/fast.md +1 -0
- package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +26 -2
- package/package.json +3 -3
- package/dist/templates/instructions/README 2.md +0 -311
- package/dist/templates/instructions/core 2/clavix-mode.md +0 -275
- package/dist/templates/instructions/core 2/file-operations.md +0 -330
- package/dist/templates/instructions/core 2/verification.md +0 -377
- package/dist/templates/instructions/troubleshooting 2/jumped-to-implementation.md +0 -234
- package/dist/templates/instructions/troubleshooting 2/mode-confusion.md +0 -402
- package/dist/templates/instructions/troubleshooting 2/skipped-file-creation.md +0 -385
- package/dist/templates/slash-commands/_canonical 2/archive.md +0 -410
- package/dist/templates/slash-commands/_canonical 2/deep.md +0 -512
- package/dist/templates/slash-commands/_canonical 2/execute.md +0 -80
- package/dist/templates/slash-commands/_canonical 2/fast.md +0 -370
- package/dist/templates/slash-commands/_canonical 2/implement.md +0 -364
- package/dist/templates/slash-commands/_canonical 2/plan.md +0 -329
- package/dist/templates/slash-commands/_canonical 2/prd.md +0 -320
- package/dist/templates/slash-commands/_canonical 2/prompts.md +0 -97
- package/dist/templates/slash-commands/_canonical 2/start.md +0 -204
- package/dist/templates/slash-commands/_canonical 2/summarize.md +0 -395
|
@@ -1,364 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "Clavix: Implement"
|
|
3
|
-
description: Execute tasks from the implementation plan
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Clavix Implement - AI-Assisted Task Execution
|
|
7
|
-
|
|
8
|
-
You are helping the user implement tasks from their task plan with AI assistance.
|
|
9
|
-
|
|
10
|
-
## Instructions
|
|
11
|
-
|
|
12
|
-
1. **First-time setup - Run CLI command with optional git strategy**:
|
|
13
|
-
|
|
14
|
-
Check if `.clavix-implement-config.json` exists in the PRD output folder.
|
|
15
|
-
|
|
16
|
-
**If config file does NOT exist** (first time running implement):
|
|
17
|
-
|
|
18
|
-
a. **Check if user wants git auto-commits** (optional, only if tasks.md has >3 phases):
|
|
19
|
-
```
|
|
20
|
-
"I notice this implementation has [X] phases with [Y] tasks total.
|
|
21
|
-
|
|
22
|
-
Would you like me to create git commits automatically as I complete tasks?
|
|
23
|
-
|
|
24
|
-
Options:
|
|
25
|
-
- per-task: Commit after each task (frequent commits, detailed history)
|
|
26
|
-
- per-5-tasks: Commit every 5 tasks (balanced approach)
|
|
27
|
-
- per-phase: Commit when each phase completes (milestone commits)
|
|
28
|
-
- none: Manual git workflow (I won't create commits)
|
|
29
|
-
|
|
30
|
-
Please choose one, or I'll proceed with 'none' (manual commits)."
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
b. **Run the CLI command to initialize**:
|
|
34
|
-
```bash
|
|
35
|
-
# With git strategy (if user specified):
|
|
36
|
-
clavix implement --commit-strategy=per-phase
|
|
37
|
-
|
|
38
|
-
# Or without (defaults to 'none' - manual commits):
|
|
39
|
-
clavix implement
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
c. **This will**:
|
|
43
|
-
- Show current progress
|
|
44
|
-
- Display the next incomplete task
|
|
45
|
-
- Create `.clavix-implement-config.json` file
|
|
46
|
-
- Set git auto-commit strategy (or default to 'none')
|
|
47
|
-
|
|
48
|
-
d. Wait for command to complete, then proceed with step 2
|
|
49
|
-
|
|
50
|
-
**If config file already exists**:
|
|
51
|
-
- Skip to step 2 (implementation loop)
|
|
52
|
-
|
|
53
|
-
2. **As the AI agent, you should**:
|
|
54
|
-
|
|
55
|
-
a. **Read the configuration**:
|
|
56
|
-
- Load `.clavix-implement-config.json` from the PRD folder
|
|
57
|
-
- This contains: commit strategy, current task, and progress stats
|
|
58
|
-
|
|
59
|
-
b. **Read the PRD for context**:
|
|
60
|
-
- Open the full PRD to understand requirements
|
|
61
|
-
- Reference specific sections mentioned in tasks
|
|
62
|
-
|
|
63
|
-
c. **Read tasks.md**:
|
|
64
|
-
- Find the first incomplete task (marked `- [ ]`)
|
|
65
|
-
- This is your current task to implement
|
|
66
|
-
|
|
67
|
-
d. **Implement the task**:
|
|
68
|
-
- Write/modify code as needed
|
|
69
|
-
- Follow quality principles (clarity, structure, actionability)
|
|
70
|
-
- Use PRD requirements as your guide
|
|
71
|
-
- Ask user for clarification if needed
|
|
72
|
-
|
|
73
|
-
e. **Complete the task programmatically**:
|
|
74
|
-
- IMPORTANT: NEVER manually edit checkboxes in tasks.md
|
|
75
|
-
- Instead, run: `clavix task-complete {task-id}`
|
|
76
|
-
- The task ID is found in tasks.md (e.g., `phase-1-authentication-1`)
|
|
77
|
-
- This command automatically:
|
|
78
|
-
• Validates the task exists
|
|
79
|
-
• Updates the checkbox in tasks.md
|
|
80
|
-
• Tracks completion in config file
|
|
81
|
-
• Creates git commit (if strategy enabled)
|
|
82
|
-
• Displays the next task
|
|
83
|
-
- Example: `clavix task-complete phase-1-setup-1`
|
|
84
|
-
|
|
85
|
-
f. **Move to next task**:
|
|
86
|
-
- The task-complete command shows the next task automatically
|
|
87
|
-
- Read it and repeat the process
|
|
88
|
-
- If you get interrupted, just run `clavix implement` again to resume
|
|
89
|
-
|
|
90
|
-
3. **Session Resume**:
|
|
91
|
-
- When user runs `clavix implement` again, it automatically picks up from the last incomplete task
|
|
92
|
-
- No manual tracking needed - the checkboxes in tasks.md are the source of truth
|
|
93
|
-
|
|
94
|
-
## Task Completion Workflow
|
|
95
|
-
|
|
96
|
-
**CRITICAL: Always use the `clavix task-complete` command**
|
|
97
|
-
|
|
98
|
-
### Why task-complete is CLI-Only
|
|
99
|
-
|
|
100
|
-
The `clavix task-complete` command requires:
|
|
101
|
-
- State validation across config files
|
|
102
|
-
- Atomic checkbox updates in tasks.md
|
|
103
|
-
- Conditional git commit execution
|
|
104
|
-
- Progress tracking and next-task resolution
|
|
105
|
-
|
|
106
|
-
Therefore it's implemented as a **CLI command** (not a slash command) and called **automatically by the agent** during implementation workflow.
|
|
107
|
-
|
|
108
|
-
**Agent Responsibility:** Run `clavix task-complete {task-id}` after implementing each task.
|
|
109
|
-
**User Responsibility:** None - agent handles task completion automatically.
|
|
110
|
-
|
|
111
|
-
### Usage
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
# After implementing a task, agent runs:
|
|
115
|
-
clavix task-complete {task-id}
|
|
116
|
-
|
|
117
|
-
# Example
|
|
118
|
-
clavix task-complete phase-1-setup-1
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
The command handles:
|
|
122
|
-
- Checkbox updates in tasks.md
|
|
123
|
-
- Config file tracking
|
|
124
|
-
- Git commits (per strategy)
|
|
125
|
-
- Progress display
|
|
126
|
-
- Next task retrieval
|
|
127
|
-
|
|
128
|
-
**NEVER manually edit tasks.md checkboxes** - the command ensures proper tracking and prevents state inconsistencies.
|
|
129
|
-
|
|
130
|
-
## Important Rules
|
|
131
|
-
|
|
132
|
-
**DO**:
|
|
133
|
-
- Read tasks.md to find the current task and its ID
|
|
134
|
-
- Implement ONE task at a time
|
|
135
|
-
- Use `clavix task-complete {task-id}` after completing each task
|
|
136
|
-
- Reference the PRD for detailed requirements
|
|
137
|
-
- Ask for clarification when tasks are ambiguous
|
|
138
|
-
- Run `clavix implement` again if interrupted to resume
|
|
139
|
-
|
|
140
|
-
**DON'T**:
|
|
141
|
-
- NEVER manually edit checkboxes in tasks.md
|
|
142
|
-
- Skip tasks or implement out of order
|
|
143
|
-
- Mark tasks complete before actually implementing them
|
|
144
|
-
- Assume what code to write - use PRD as source of truth
|
|
145
|
-
- Try to track task completion manually
|
|
146
|
-
|
|
147
|
-
## Task Blocking Protocol
|
|
148
|
-
|
|
149
|
-
**When a task is blocked** (cannot be completed), follow this protocol:
|
|
150
|
-
|
|
151
|
-
### Step 1: Detect Blocking Issues
|
|
152
|
-
|
|
153
|
-
Common blocking scenarios:
|
|
154
|
-
- **Missing dependencies**: API keys, credentials, external services not available
|
|
155
|
-
- **Unclear requirements**: Task description too vague or conflicts with PRD
|
|
156
|
-
- **External blockers**: Need design assets, content, or third-party integration not ready
|
|
157
|
-
- **Technical blockers**: Required library incompatible, environment issue, access problem
|
|
158
|
-
- **Resource blockers**: Need database, server, or infrastructure not yet set up
|
|
159
|
-
|
|
160
|
-
### Step 2: Immediate User Communication
|
|
161
|
-
|
|
162
|
-
**Stop implementation and ask user immediately:**
|
|
163
|
-
```
|
|
164
|
-
"Task blocked: [Task description]
|
|
165
|
-
|
|
166
|
-
Blocking issue: [Specific blocker, e.g., 'Missing Stripe API key for payment integration']
|
|
167
|
-
|
|
168
|
-
Options to proceed:
|
|
169
|
-
1. **Provide missing resource** - [What user needs to provide]
|
|
170
|
-
2. **Break into sub-tasks** - I can implement [unblocked parts] now and defer [blocked part]
|
|
171
|
-
3. **Skip for now** - Mark as [BLOCKED], continue with next task, return later
|
|
172
|
-
|
|
173
|
-
Which option would you like?"
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Step 3: Resolution Strategies
|
|
177
|
-
|
|
178
|
-
**Option A: User Provides Resource**
|
|
179
|
-
- Wait for user to provide (API key, design, clarification)
|
|
180
|
-
- Once provided, continue with task implementation
|
|
181
|
-
|
|
182
|
-
**Option B: Create Sub-Tasks** (preferred when possible)
|
|
183
|
-
- Identify what CAN be done without the blocker
|
|
184
|
-
- Break task into unblocked sub-tasks
|
|
185
|
-
- Example: "Implement payment integration" →
|
|
186
|
-
- [x] Create payment service interface (can do now)
|
|
187
|
-
- [ ] [BLOCKED: Need Stripe API key] Integrate Stripe SDK
|
|
188
|
-
- [ ] Add payment UI components (can do now)
|
|
189
|
-
- Implement unblocked sub-tasks, mark blocked ones with [BLOCKED] tag
|
|
190
|
-
|
|
191
|
-
**Option C: Skip and Mark Blocked**
|
|
192
|
-
- Add [BLOCKED] tag to task in tasks.md: `- [ ] [BLOCKED: Missing API key] Task description`
|
|
193
|
-
- Note the blocker reason
|
|
194
|
-
- Move to next task
|
|
195
|
-
- Return to blocked tasks when unblocked
|
|
196
|
-
|
|
197
|
-
### Step 4: Track Blocked Tasks
|
|
198
|
-
|
|
199
|
-
**In tasks.md, use [BLOCKED] notation:**
|
|
200
|
-
```markdown
|
|
201
|
-
## Phase 2: Integration
|
|
202
|
-
- [x] Create API client structure
|
|
203
|
-
- [ ] [BLOCKED: Waiting for API endpoint spec] Implement data sync
|
|
204
|
-
- [ ] Add error handling for API calls
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
**At end of implement session:**
|
|
208
|
-
- List all blocked tasks
|
|
209
|
-
- Remind user what's needed to unblock each one
|
|
210
|
-
- Suggest next steps
|
|
211
|
-
|
|
212
|
-
### Common Blocking Scenarios & Resolutions
|
|
213
|
-
|
|
214
|
-
| Blocker Type | Detection | Resolution |
|
|
215
|
-
|--------------|-----------|------------|
|
|
216
|
-
| Missing API key/credentials | Code requires authentication | Ask user for credentials OR stub with mock for now |
|
|
217
|
-
| Vague requirements | Unclear what to implement | Ask specific questions OR propose implementation for approval |
|
|
218
|
-
| External dependency | Service/API not available | Create interface/mock OR skip and defer |
|
|
219
|
-
| Environment issue | Can't run/test code | Ask user to fix environment OR implement without testing (note risk) |
|
|
220
|
-
| Design/content missing | Need specific assets | Create placeholder OR wait for actual assets |
|
|
221
|
-
|
|
222
|
-
## Example Workflow
|
|
223
|
-
|
|
224
|
-
**CRITICAL WORKFLOW RULE:**
|
|
225
|
-
- Agent implements task → Agent runs `clavix task-complete` → Agent proceeds to next task
|
|
226
|
-
- User NEVER manually runs task-complete
|
|
227
|
-
- User NEVER manually edits tasks.md checkboxes
|
|
228
|
-
- This is an automated workflow, not a manual checklist
|
|
229
|
-
|
|
230
|
-
```
|
|
231
|
-
1. User runs: clavix implement
|
|
232
|
-
2. Command shows: "Next task (ID: phase-1-auth-1): Implement user authentication"
|
|
233
|
-
3. You (AI agent):
|
|
234
|
-
- Read PRD authentication requirements
|
|
235
|
-
- Implement auth logic
|
|
236
|
-
- Write tests
|
|
237
|
-
- Run: clavix task-complete phase-1-auth-1
|
|
238
|
-
- Command automatically:
|
|
239
|
-
• Marks task complete in tasks.md
|
|
240
|
-
• Updates config tracking
|
|
241
|
-
• Creates git commit (if enabled)
|
|
242
|
-
• Shows next task
|
|
243
|
-
- Continue with next task or wait for user
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
## Finding Task IDs
|
|
247
|
-
|
|
248
|
-
Task IDs are visible in several places:
|
|
249
|
-
1. When you read `tasks.md` - they're in the format `phase-X-name-Y`
|
|
250
|
-
2. In the config file (`.clavix-implement-config.json`) under `currentTask.id`
|
|
251
|
-
3. When running `clavix implement` - shown next to task description
|
|
252
|
-
|
|
253
|
-
Example tasks.md structure:
|
|
254
|
-
```markdown
|
|
255
|
-
## Phase 1: Authentication
|
|
256
|
-
|
|
257
|
-
- [ ] Implement user registration (ref: User Management)
|
|
258
|
-
Task ID: phase-1-authentication-1
|
|
259
|
-
|
|
260
|
-
- [ ] Add JWT token generation (ref: User Management)
|
|
261
|
-
Task ID: phase-1-authentication-2
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
To find the task ID programmatically, read tasks.md and look for the pattern `phase-{number}-{sanitized-phase-name}-{counter}`.
|
|
265
|
-
|
|
266
|
-
## Workflow Navigation
|
|
267
|
-
|
|
268
|
-
**You are here:** Implement (Task Execution)
|
|
269
|
-
|
|
270
|
-
**Common workflows:**
|
|
271
|
-
- **Full workflow**: `/clavix:plan` → `/clavix:implement` → [execute all tasks] → `/clavix:archive`
|
|
272
|
-
- **Resume work**: `/clavix:implement` → Continue from last incomplete task
|
|
273
|
-
- **Iterative**: `/clavix:implement` → [complete task] → [pause] → `/clavix:implement` → [continue]
|
|
274
|
-
|
|
275
|
-
**Related commands:**
|
|
276
|
-
- `/clavix:plan` - Generate/regenerate task breakdown (previous step)
|
|
277
|
-
- `/clavix:archive` - Archive completed project (final step)
|
|
278
|
-
- `/clavix:prd` - Review PRD for context during implementation
|
|
279
|
-
|
|
280
|
-
## Tips
|
|
281
|
-
|
|
282
|
-
- The implementation is meant to be iterative and collaborative
|
|
283
|
-
- User can pause/resume at any time
|
|
284
|
-
- Tasks are designed to be atomic and independently implementable
|
|
285
|
-
- Use the PRD as the authoritative source for "what to build"
|
|
286
|
-
- Use tasks.md as the guide for "in what order"
|
|
287
|
-
|
|
288
|
-
## Troubleshooting
|
|
289
|
-
|
|
290
|
-
### Issue: `.clavix-implement-config.json` not found
|
|
291
|
-
**Cause**: User hasn't run `clavix implement` CLI command first
|
|
292
|
-
**Solution** (inline):
|
|
293
|
-
- Error: "Config file not found. Run `clavix implement` first to initialize"
|
|
294
|
-
- CLI creates config and shows first task
|
|
295
|
-
- AI agent should wait for config before proceeding
|
|
296
|
-
|
|
297
|
-
### Issue: `clavix task-complete` command not found
|
|
298
|
-
**Cause**: Clavix version doesn't have task-complete command OR not in PATH
|
|
299
|
-
**Solution**:
|
|
300
|
-
- Check Clavix version: `clavix --version`
|
|
301
|
-
- Ensure Clavix is up to date: `npm install -g clavix@latest`
|
|
302
|
-
- If issue persists, report bug to Clavix maintainers
|
|
303
|
-
|
|
304
|
-
### Issue: Task ID not found by task-complete
|
|
305
|
-
**Cause**: Task ID doesn't match what's in tasks.md
|
|
306
|
-
**Solution**:
|
|
307
|
-
- Read tasks.md to see actual task IDs
|
|
308
|
-
- Task IDs follow pattern: `{sanitized-phase-name}-{counter}`
|
|
309
|
-
- Run `clavix task-complete` without arguments to see available tasks
|
|
310
|
-
- Example: `phase-1-authentication-1` not `Phase 1 Authentication 1`
|
|
311
|
-
|
|
312
|
-
### Issue: Task already marked complete
|
|
313
|
-
**Cause**: Task was completed in previous session or manually
|
|
314
|
-
**Solution**:
|
|
315
|
-
- Use `--force` flag: `clavix task-complete {task-id} --force`
|
|
316
|
-
- Or skip to next task shown by `clavix implement`
|
|
317
|
-
- Config will be updated to track the completion
|
|
318
|
-
|
|
319
|
-
### Issue: Cannot find next incomplete task in tasks.md
|
|
320
|
-
**Cause**: All tasks completed OR tasks.md corrupted
|
|
321
|
-
**Solution**:
|
|
322
|
-
- Check if all tasks are `[x]` - if yes, congratulate completion!
|
|
323
|
-
- Suggest `/clavix:archive` for completed project
|
|
324
|
-
- If tasks.md corrupted, ask user to review/regenerate
|
|
325
|
-
|
|
326
|
-
### Issue: Task description unclear or conflicts with PRD
|
|
327
|
-
**Cause**: Task breakdown was too vague or PRD changed
|
|
328
|
-
**Solution** (inline - covered by Task Blocking Protocol):
|
|
329
|
-
- Stop and ask user for clarification
|
|
330
|
-
- Reference PRD section if mentioned
|
|
331
|
-
- Propose interpretation for user approval
|
|
332
|
-
- Update task description in tasks.md after clarification
|
|
333
|
-
|
|
334
|
-
### Issue: Git commit fails (wrong strategy, hook error, etc.)
|
|
335
|
-
**Cause**: Git configuration issue or commit hook failure
|
|
336
|
-
**Solution**:
|
|
337
|
-
- Show error to user
|
|
338
|
-
- Suggest checking git status manually
|
|
339
|
-
- Ask if should continue without commit or fix issue first
|
|
340
|
-
- Note: Commits are convenience, not blocker - can proceed without
|
|
341
|
-
|
|
342
|
-
### Issue: Multiple [BLOCKED] tasks accumulating
|
|
343
|
-
**Cause**: Dependencies or blockers not being resolved
|
|
344
|
-
**Solution**:
|
|
345
|
-
- After 3+ blocked tasks, pause and report to user
|
|
346
|
-
- List all blockers and what's needed to resolve
|
|
347
|
-
- Ask user to prioritize: unblock tasks OR continue with unblocked ones
|
|
348
|
-
- Consider if project should be paused until blockers cleared
|
|
349
|
-
|
|
350
|
-
### Issue: Task completed but tests failing
|
|
351
|
-
**Cause**: Implementation doesn't meet requirements
|
|
352
|
-
**Solution**:
|
|
353
|
-
- Do NOT mark task as complete if tests fail
|
|
354
|
-
- Fix failing tests before marking [x]
|
|
355
|
-
- If tests are incorrectly written, fix tests first
|
|
356
|
-
- Task isn't done until tests pass
|
|
357
|
-
|
|
358
|
-
### Issue: Implementing in wrong order (skipped dependencies)
|
|
359
|
-
**Cause**: AI agent or user jumped ahead
|
|
360
|
-
**Solution**:
|
|
361
|
-
- Stop and review tasks.md order
|
|
362
|
-
- Check if skipped task was a dependency
|
|
363
|
-
- Implement missed dependency first
|
|
364
|
-
- Follow sequential order unless explicitly instructed otherwise
|
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: "Clavix: Plan"
|
|
3
|
-
description: Generate implementation task breakdown from PRD
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Clavix Plan - Task Breakdown Generator
|
|
7
|
-
|
|
8
|
-
You are helping the user generate an optimized implementation task breakdown from their PRD.
|
|
9
|
-
|
|
10
|
-
## Instructions
|
|
11
|
-
|
|
12
|
-
### Part A: Agent Execution Protocol
|
|
13
|
-
|
|
14
|
-
**As an AI agent, you have two execution options:**
|
|
15
|
-
|
|
16
|
-
#### **Option 1: Run CLI Command** (Recommended for most cases)
|
|
17
|
-
|
|
18
|
-
1. **Validate prerequisites**:
|
|
19
|
-
- Check if `.clavix/outputs/` directory exists
|
|
20
|
-
- Look for PRD artifacts: `full-prd.md`, `quick-prd.md`, `mini-prd.md`, or `optimized-prompt.md`
|
|
21
|
-
- **If not found**: Error inline - "No PRD found in `.clavix/outputs/`. Use `/clavix:prd` or `/clavix:summarize` first."
|
|
22
|
-
|
|
23
|
-
2. **Run the CLI command**:
|
|
24
|
-
```bash
|
|
25
|
-
clavix plan
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Or specify a project:
|
|
29
|
-
```bash
|
|
30
|
-
clavix plan --project project-name
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Or generate from saved session (auto-creates mini-prd.md):
|
|
34
|
-
```bash
|
|
35
|
-
clavix plan --session SESSION_ID
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
3. **CLI will handle**:
|
|
39
|
-
- Project selection (if multiple)
|
|
40
|
-
- Reading PRD content
|
|
41
|
-
- Generating task breakdown
|
|
42
|
-
- Creating `tasks.md` file
|
|
43
|
-
- Formatting with proper task IDs
|
|
44
|
-
|
|
45
|
-
#### **Option 2: Generate Tasks Directly** (If agent has full PRD context)
|
|
46
|
-
|
|
47
|
-
If you have the full PRD content in memory and want to generate tasks directly:
|
|
48
|
-
|
|
49
|
-
1. **Read the PRD** from `.clavix/outputs/[project-name]/`
|
|
50
|
-
2. **Generate task breakdown** following Part B principles
|
|
51
|
-
3. **Create `tasks.md`** with format specified in "Task Format Reference" below
|
|
52
|
-
4. **Save to**: `.clavix/outputs/[project-name]/tasks.md`
|
|
53
|
-
5. **Use exact format** (task IDs, checkboxes, structure)
|
|
54
|
-
|
|
55
|
-
### Part B: Behavioral Guidance (Task Breakdown Strategy)
|
|
56
|
-
|
|
57
|
-
3. **How to structure tasks** (optimized task breakdown):
|
|
58
|
-
|
|
59
|
-
**Task Granularity Principles:**
|
|
60
|
-
- **Clarity**: Each task = 1 clear action (not "Build authentication system", but "Create user registration endpoint")
|
|
61
|
-
- **Structure**: Tasks flow in implementation order (database schema → backend logic → frontend UI)
|
|
62
|
-
- **Actionability**: Tasks specify deliverable (not "Add tests", but "Write unit tests for user service with >80% coverage")
|
|
63
|
-
|
|
64
|
-
**Atomic Task Guidelines:**
|
|
65
|
-
- **Ideal size**: Completable in 15-60 minutes
|
|
66
|
-
- **Too large**: "Implement user authentication" → Break into registration, login, logout, password reset
|
|
67
|
-
- **Too small**: "Import React" → Combine with "Setup component structure"
|
|
68
|
-
- **Dependencies**: If Task B needs Task A, ensure A comes first
|
|
69
|
-
|
|
70
|
-
**Phase Organization:**
|
|
71
|
-
- Group related tasks into phases (Setup, Core Features, Testing, Polish)
|
|
72
|
-
- Each phase should be independently deployable when possible
|
|
73
|
-
- Critical path first (must-haves before nice-to-haves)
|
|
74
|
-
|
|
75
|
-
4. **Review and customize generated tasks**:
|
|
76
|
-
- The command will generate `tasks.md` in the PRD folder
|
|
77
|
-
- Tasks are organized into logical phases with quality principles
|
|
78
|
-
- Each task includes:
|
|
79
|
-
- Checkbox `- [ ]` for tracking
|
|
80
|
-
- Clear deliverable description
|
|
81
|
-
- Optional reference to PRD section `(ref: PRD Section)`
|
|
82
|
-
- **You can edit tasks.md** before implementing:
|
|
83
|
-
- Add/remove tasks
|
|
84
|
-
- Adjust granularity
|
|
85
|
-
- Reorder for better flow
|
|
86
|
-
- Add notes or sub-tasks
|
|
87
|
-
|
|
88
|
-
5. **Task Quality Labeling** (optional, for education):
|
|
89
|
-
When reviewing tasks, you can annotate improvements:
|
|
90
|
-
- **[Clarity]**: "Split vague 'Add UI' into 3 concrete tasks"
|
|
91
|
-
- **[Structure]**: "Reordered tasks: database schema before API endpoints"
|
|
92
|
-
- **[Actionability]**: "Added specific acceptance criteria (>80% test coverage)"
|
|
93
|
-
|
|
94
|
-
6. **Next steps**:
|
|
95
|
-
- Review and edit `tasks.md` if needed
|
|
96
|
-
- Then run `/clavix:implement` to start implementation
|
|
97
|
-
|
|
98
|
-
## Task Format
|
|
99
|
-
|
|
100
|
-
The generated `tasks.md` will look like:
|
|
101
|
-
|
|
102
|
-
```markdown
|
|
103
|
-
# Implementation Tasks
|
|
104
|
-
|
|
105
|
-
**Project**: [Project Name]
|
|
106
|
-
**Generated**: [Timestamp]
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
## Phase 1: Feature Name
|
|
111
|
-
|
|
112
|
-
- [ ] Task 1 description (ref: PRD Section)
|
|
113
|
-
Task ID: phase-1-feature-name-1
|
|
114
|
-
|
|
115
|
-
- [ ] Task 2 description
|
|
116
|
-
Task ID: phase-1-feature-name-2
|
|
117
|
-
|
|
118
|
-
- [ ] Task 3 description
|
|
119
|
-
Task ID: phase-1-feature-name-3
|
|
120
|
-
|
|
121
|
-
## Phase 2: Another Feature
|
|
122
|
-
|
|
123
|
-
- [ ] Task 4 description
|
|
124
|
-
Task ID: phase-2-another-feature-1
|
|
125
|
-
|
|
126
|
-
- [ ] Task 5 description
|
|
127
|
-
Task ID: phase-2-another-feature-2
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
*Generated by Clavix /clavix:plan*
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
## Task Format Reference (For Agent-Direct Generation)
|
|
135
|
-
|
|
136
|
-
**If you're generating tasks directly (Option 2), follow this exact format:**
|
|
137
|
-
|
|
138
|
-
### File Structure
|
|
139
|
-
```markdown
|
|
140
|
-
# Implementation Tasks
|
|
141
|
-
|
|
142
|
-
**Project**: {project-name}
|
|
143
|
-
**Generated**: {ISO timestamp}
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## Phase {number}: {Phase Name}
|
|
148
|
-
|
|
149
|
-
- [ ] {Task description} (ref: {PRD Section})
|
|
150
|
-
Task ID: {task-id}
|
|
151
|
-
|
|
152
|
-
## Phase {number}: {Next Phase}
|
|
153
|
-
|
|
154
|
-
- [ ] {Task description}
|
|
155
|
-
Task ID: {task-id}
|
|
156
|
-
|
|
157
|
-
---
|
|
158
|
-
|
|
159
|
-
*Generated by Clavix /clavix:plan*
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
### Task ID Format
|
|
163
|
-
|
|
164
|
-
**Pattern**: `phase-{phase-number}-{sanitized-phase-name}-{task-counter}`
|
|
165
|
-
|
|
166
|
-
**Rules**:
|
|
167
|
-
- Phase number: Sequential starting from 1
|
|
168
|
-
- Sanitized phase name: Lowercase, spaces→hyphens, remove special chars
|
|
169
|
-
- Task counter: Sequential within phase, starting from 1
|
|
170
|
-
|
|
171
|
-
**Examples**:
|
|
172
|
-
- Phase "Setup & Configuration" → Task 1 → `phase-1-setup-configuration-1`
|
|
173
|
-
- Phase "User Authentication" → Task 3 → `phase-2-user-authentication-3`
|
|
174
|
-
- Phase "API Integration" → Task 1 → `phase-3-api-integration-1`
|
|
175
|
-
|
|
176
|
-
### Checkbox Format
|
|
177
|
-
|
|
178
|
-
**Always use**: `- [ ]` for incomplete tasks (space between brackets)
|
|
179
|
-
**Completed tasks**: `- [x]` (lowercase x, no spaces)
|
|
180
|
-
|
|
181
|
-
### Task Description Format
|
|
182
|
-
|
|
183
|
-
**Basic**: `- [ ] {Clear, actionable description}`
|
|
184
|
-
**With reference**: `- [ ] {Description} (ref: {PRD Section Name})`
|
|
185
|
-
|
|
186
|
-
**Example**:
|
|
187
|
-
```markdown
|
|
188
|
-
- [ ] Create user registration API endpoint (ref: User Management)
|
|
189
|
-
Task ID: phase-1-authentication-1
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Task ID Placement
|
|
193
|
-
|
|
194
|
-
**Critical**: Task ID must be on the line immediately after the task description
|
|
195
|
-
**Format**: ` Task ID: {id}` (2 spaces indent)
|
|
196
|
-
|
|
197
|
-
### Phase Header Format
|
|
198
|
-
|
|
199
|
-
**Pattern**: `## Phase {number}: {Phase Name}`
|
|
200
|
-
**Must have**: Empty line before and after phase header
|
|
201
|
-
|
|
202
|
-
### File Save Location
|
|
203
|
-
|
|
204
|
-
**Path**: `.clavix/outputs/{project-name}/tasks.md`
|
|
205
|
-
**Create directory if not exists**: Yes
|
|
206
|
-
**Overwrite if exists**: Only with explicit user confirmation or `--overwrite` flag
|
|
207
|
-
|
|
208
|
-
## Workflow Navigation
|
|
209
|
-
|
|
210
|
-
**You are here:** Plan (Task Breakdown)
|
|
211
|
-
|
|
212
|
-
**Common workflows:**
|
|
213
|
-
- **PRD workflow**: `/clavix:prd` → `/clavix:plan` → `/clavix:implement` → `/clavix:archive`
|
|
214
|
-
- **Conversation workflow**: `/clavix:summarize` → `/clavix:plan` → `/clavix:implement` → `/clavix:archive`
|
|
215
|
-
- **Standalone**: [Existing PRD] → `/clavix:plan` → Review tasks.md → `/clavix:implement`
|
|
216
|
-
|
|
217
|
-
**Related commands:**
|
|
218
|
-
- `/clavix:prd` - Generate PRD (typical previous step)
|
|
219
|
-
- `/clavix:summarize` - Extract mini-PRD from conversation (alternative previous step)
|
|
220
|
-
- `/clavix:implement` - Execute generated tasks (next step)
|
|
221
|
-
|
|
222
|
-
## Tips
|
|
223
|
-
|
|
224
|
-
- Tasks are automatically optimized for clarity, structure, and actionability
|
|
225
|
-
- Each task is concise and actionable
|
|
226
|
-
- Tasks can reference specific PRD sections
|
|
227
|
-
- Supports mini-PRD outputs from `/clavix:summarize` and session workflows via `--session` or `--active-session`
|
|
228
|
-
- You can manually edit tasks.md before implementing
|
|
229
|
-
- Use `--overwrite` flag to regenerate if needed
|
|
230
|
-
|
|
231
|
-
## Troubleshooting
|
|
232
|
-
|
|
233
|
-
### Issue: No PRD found in `.clavix/outputs/`
|
|
234
|
-
**Cause**: User hasn't generated a PRD yet
|
|
235
|
-
|
|
236
|
-
**Agent recovery**:
|
|
237
|
-
1. Check if `.clavix/outputs/` directory exists:
|
|
238
|
-
```bash
|
|
239
|
-
ls .clavix/outputs/
|
|
240
|
-
```
|
|
241
|
-
2. If directory doesn't exist or is empty:
|
|
242
|
-
- Error: "No PRD artifacts found in `.clavix/outputs/`"
|
|
243
|
-
- Suggest recovery options:
|
|
244
|
-
- "Generate PRD with `/clavix:prd` for comprehensive planning"
|
|
245
|
-
- "Extract mini-PRD from conversation with `/clavix:summarize`"
|
|
246
|
-
- "Or use `clavix plan --session <id>` if you have a saved session"
|
|
247
|
-
3. Do NOT proceed with plan generation without PRD
|
|
248
|
-
|
|
249
|
-
### Issue: Generated tasks are too granular (100+ tasks)
|
|
250
|
-
**Cause**: Over-decomposition or large project scope
|
|
251
|
-
|
|
252
|
-
**Agent recovery**:
|
|
253
|
-
1. Review generated tasks in `tasks.md`
|
|
254
|
-
2. Identify micro-tasks that can be combined
|
|
255
|
-
3. Options for user:
|
|
256
|
-
- **Edit manually**: Combine related micro-tasks into larger atomic tasks
|
|
257
|
-
- **Regenerate**: Use `clavix plan --overwrite` after simplifying PRD
|
|
258
|
-
- **Split project**: Break into multiple PRDs if truly massive
|
|
259
|
-
4. Guideline: Each task should be 15-60 minutes, not 5 minutes
|
|
260
|
-
5. Combine setup/configuration tasks that belong together
|
|
261
|
-
|
|
262
|
-
### Issue: Generated tasks are too high-level (only 3-4 tasks)
|
|
263
|
-
**Cause**: PRD was too vague or task breakdown too coarse
|
|
264
|
-
|
|
265
|
-
**Agent recovery**:
|
|
266
|
-
1. Read the PRD to assess detail level
|
|
267
|
-
2. If PRD is vague:
|
|
268
|
-
- Suggest: "Let's improve the PRD with `/clavix:deep` first"
|
|
269
|
-
- Then regenerate tasks with `clavix plan --overwrite`
|
|
270
|
-
3. If PRD is detailed but tasks are high-level:
|
|
271
|
-
- Manually break each task into 3-5 concrete sub-tasks
|
|
272
|
-
- Or regenerate with more explicit decomposition request
|
|
273
|
-
4. Each task should have clear, testable deliverable
|
|
274
|
-
|
|
275
|
-
### Issue: Tasks don't follow logical dependency order
|
|
276
|
-
**Cause**: Generator didn't detect dependencies correctly OR agent-generated tasks weren't ordered
|
|
277
|
-
|
|
278
|
-
**Agent recovery**:
|
|
279
|
-
1. Review task order in `tasks.md`
|
|
280
|
-
2. Identify dependency violations:
|
|
281
|
-
- Database schema should precede API endpoints
|
|
282
|
-
- API endpoints should precede UI components
|
|
283
|
-
- Authentication should precede protected features
|
|
284
|
-
3. Manually reorder tasks in `tasks.md`:
|
|
285
|
-
- Cut and paste tasks to correct order
|
|
286
|
-
- Preserve task ID format
|
|
287
|
-
- Maintain phase groupings
|
|
288
|
-
4. Follow structure principle: ensure sequential coherence
|
|
289
|
-
|
|
290
|
-
### Issue: Tasks conflict with PRD or duplicate work
|
|
291
|
-
**Cause**: Misinterpretation of PRD or redundant task generation
|
|
292
|
-
|
|
293
|
-
**Agent recovery**:
|
|
294
|
-
1. Read PRD and tasks.md side-by-side
|
|
295
|
-
2. Identify conflicts or duplicates
|
|
296
|
-
3. Options:
|
|
297
|
-
- **Remove duplicates**: Delete redundant tasks from tasks.md
|
|
298
|
-
- **Align with PRD**: Edit task descriptions to match PRD requirements
|
|
299
|
-
- **Clarify PRD**: If PRD is ambiguous, update it first
|
|
300
|
-
- **Regenerate**: Use `clavix plan --overwrite` after fixing PRD
|
|
301
|
-
4. Ensure each PRD feature maps to tasks
|
|
302
|
-
|
|
303
|
-
### Issue: `tasks.md` already exists, unsure if should regenerate
|
|
304
|
-
**Cause**: Previous plan exists for this PRD
|
|
305
|
-
|
|
306
|
-
**Agent recovery**:
|
|
307
|
-
1. Read existing `tasks.md`
|
|
308
|
-
2. Count completed tasks (check for `[x]` checkboxes)
|
|
309
|
-
3. Decision tree:
|
|
310
|
-
- **No progress** (all `[ ]`): Safe to use `clavix plan --overwrite`
|
|
311
|
-
- **Some progress**: Ask user before overwriting
|
|
312
|
-
- "Tasks.md has {X} completed tasks. Regenerating will lose this progress. Options:
|
|
313
|
-
1. Keep existing tasks.md and edit manually
|
|
314
|
-
2. Overwrite and start fresh (progress lost)
|
|
315
|
-
3. Cancel plan generation"
|
|
316
|
-
- **Mostly complete**: Recommend NOT overwriting
|
|
317
|
-
4. If user confirms overwrite: Run `clavix plan --project {name} --overwrite`
|
|
318
|
-
|
|
319
|
-
### Issue: CLI command fails or no output
|
|
320
|
-
**Cause**: Missing dependencies, corrupted PRD file, or CLI error
|
|
321
|
-
|
|
322
|
-
**Agent recovery**:
|
|
323
|
-
1. Check CLI error output
|
|
324
|
-
2. Common fixes:
|
|
325
|
-
- Verify PRD file exists and is readable
|
|
326
|
-
- Check `.clavix/outputs/{project}/` has valid PRD
|
|
327
|
-
- Verify project name is correct (no typos)
|
|
328
|
-
3. Try with explicit project: `clavix plan --project {exact-name}`
|
|
329
|
-
4. If persistent: Inform user to check Clavix installation
|