taskgraph-ai 0.52.23 → 0.54.7

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/README.md +38 -34
  2. package/dist/ai-services-unified-443pp39A.js +1 -0
  3. package/dist/ai-services-unified-C29ea2f8.js +3 -0
  4. package/dist/assets/AGENTS.md +12 -13
  5. package/dist/commands-BQrpRKx2.js +126 -0
  6. package/dist/config-manager-1Zhw_Ob5.js +1 -0
  7. package/dist/config-manager-CecOyMub.js +1 -0
  8. package/dist/git-utils-CRR3iPaC.js +1 -0
  9. package/dist/{git-utils--i2q96hv.js → git-utils-NnZtE3nY.js} +1 -1
  10. package/dist/init-Dm0XBXMD.js +24 -0
  11. package/dist/mcp-server.js +2 -2
  12. package/dist/research-BY8APYWo.js +585 -0
  13. package/dist/research-CJ_GBjgH.js +1 -0
  14. package/dist/{response-language-ip84ug-k.js → response-language-29GrZl4K.js} +1 -1
  15. package/dist/response-language-mSXkRdue.js +1 -0
  16. package/dist/rolldown-runtime-BxhE39jg.js +1 -0
  17. package/dist/src-ZjjcZr3a.js +468 -0
  18. package/dist/src-xo9dUCIC.js +207 -0
  19. package/dist/tag-management-D4lpCywn.js +1 -0
  20. package/dist/task-manager-GG4EpQXs.js +168 -0
  21. package/dist/task-manager-gnhcGsE8.js +1 -0
  22. package/dist/taskgraph.js +1 -1
  23. package/package.json +3 -8
  24. package/dist/ai-services-unified-CigO4oTy.js +0 -1
  25. package/dist/ai-services-unified-kmQRPU0g.js +0 -3
  26. package/dist/assets/claude/TM_COMMANDS_GUIDE.md +0 -147
  27. package/dist/commands-dFNugMWF.js +0 -116
  28. package/dist/config-manager-C5Ih13nA.js +0 -1
  29. package/dist/config-manager-DhVH8AQp.js +0 -1
  30. package/dist/dependency-manager-CCREovZA.js +0 -758
  31. package/dist/git-utils-BezpEZd4.js +0 -1
  32. package/dist/init-p_pWjmVE.js +0 -3139
  33. package/dist/research-blv_5JOT.js +0 -1
  34. package/dist/response-language-D9UxmXBp.js +0 -1
  35. package/dist/src-TZm8h0X-.js +0 -207
  36. package/dist/src-yE1DeXKG.js +0 -468
  37. package/dist/tag-management-Br2FX-YC.js +0 -1
  38. package/dist/task-manager-DWPIhAB7.js +0 -1
  39. package/index.js +0 -157
@@ -1,3139 +0,0 @@
1
- import{a as e}from"./ai-services-unified-kmQRPU0g.js";import{$ as t,Ct as n,Dt as r,Et as i,M as a,Ot as o,Q as s,St as c,Tt as l,_t as u,ht as d,vt as f,wt as ee,xt as p,yt as m}from"./config-manager-DhVH8AQp.js";import{r as h}from"./git-utils--i2q96hv.js";import{D as te,V as g}from"./src-yE1DeXKG.js";import _ from"chalk";import*as v from"node:path";import y from"path";import{execSync as b}from"child_process";import*as x from"node:fs";import S from"fs";import{fileURLToPath as C}from"url";import w from"readline";import ne from"os";import{randomUUID as re}from"crypto";const T=[`claude`];function ie(e){return e.filter(e=>!ae(e))}function ae(e){return T.includes(e)}const E=`tasks.json`,D=`tasks/`;function O(e){return e.trim().replace(/^#/,``).trim()}function k(e){let t=O(e);return t===`tasks.json`||t===`tasks/`}function oe(e,t){return e.map(e=>{if(k(e)){let n=O(e),r=e.match(/\s*$/)[0];return t?`# ${n}${r}`:`${n}${r}`}return e})}function se(e){let t=[],n=!1;for(let r of e)r.trim()===`# Task files`?n=!0:k(r)||(!n||r.trim())&&(n&&r.trim()&&!k(r)&&(n=!1),n||t.push(r));return t}function ce(e,t){return e.filter(e=>{let n=e.trim();return!n||k(e)||n===`# Task files`?!1:!t.has(n)})}function A(e){let t=[`# Task files`];return e?t.push(`# ${E}`,`# ${D} `):t.push(E,`${D} `),t}function le(e,t){if(e.some(k))return e;let n=[...e];for(;n.length>0&&!n[n.length-1].trim();)n.pop();return j(n),n.push(...A(t)),n}function j(e){if(e.some(e=>e.trim())){let t=e[e.length-1];t&&t.trim()&&e.push(``)}}function ue(e,t,n){if(!e||typeof e!=`string`)throw Error(`targetPath must be a non-empty string`);if(!e.endsWith(`.gitignore`))throw Error(`targetPath must end with .gitignore`);if(!t||typeof t!=`string`)throw Error(`content must be a non-empty string`);if(typeof n!=`boolean`)throw Error(`storeTasksInGit must be a boolean`)}function de(e,t,n){try{S.writeFileSync(e,t.join(`
2
- `)+`
3
- `),typeof n==`function`&&n(`success`,`Created ${e} with full template`)}catch(t){throw typeof n==`function`&&n(`error`,`Failed to create ${e}: ${t.message}`),t}}function fe(e,t,n,r){try{let i=se(S.readFileSync(e,`utf8`).split(`
4
- `)),a=ce(t,new Set(i.map(e=>e.trim()).filter(e=>e))),o=[...i];a.length>0&&(j(o),o.push(...a)),j(o),o.push(...A(n)),S.writeFileSync(e,o.join(`
5
- `)+`
6
- `),typeof r==`function`&&r(`debug`,`Updated ${e} according to user preference${a.length>0?` and merged new content`:``}`)}catch(t){throw typeof r==`function`&&r(`error`,`Failed to merge content with ${e}: ${t.message}`),t}}function pe(e){try{if(!S.existsSync(e))return;let t=S.readFileSync(e,`utf8`).split(`
7
- `).find(e=>O(e)===E);return t===void 0?void 0:t.trim().startsWith(`#`)}catch{return}}function me(e,t,n=!0,r=null){ue(e,t,n);let i=oe(t.split(`
8
- `),n);S.existsSync(e)?fe(e,i,n,r):de(e,le(i,n),r)}const he=C(import.meta.url),M=y.dirname(he);function N(){let e=[y.join(M,`assets`),y.join(M,`..`,`assets`),y.join(M,`..`,`..`,`public`,`assets`),y.join(process.cwd(),`assets`),y.join(process.cwd(),`node_modules`,`taskgraph-ai`,`dist`,`assets`),y.join(process.cwd(),`node_modules`,`taskgraph-ai`,`assets`)];for(let t of e)if(S.existsSync(t)){let e=y.join(t,`AGENTS.md`);if(S.existsSync(e))return t}throw Error(`Assets directory not found. This is likely a packaging issue.`)}function P(e){let t=N();return y.join(t,e)}function ge(e){try{let t=P(e);return S.existsSync(t)}catch{return!1}}function F(e,t=`utf8`){let n=P(e);return S.readFileSync(n,t)}const I=`taskgraph-ai`;function _e(e){return Array.isArray(e?.args)&&e.args.some(e=>typeof e==`string`&&e.includes(`taskgraph-ai`))}function L(e){let t=JSON.stringify(e,null,` `);return t=t.replace(/(\[\n\t+)([^[\]]+?)(\n\t+\])/g,(e,t,n,r)=>!n.includes(`{`)&&!n.includes(`[`)?`[${n.replace(/\n\t+/g,` `).replace(/\s+/g,` `).trim()}]`:e),t}function ve(e,n){if(!n){t(`debug`,`[MCP Config] No mcpConfigPath provided, skipping MCP configuration setup`);return}let r=y.join(e,n),i=y.dirname(r);t(`debug`,`Setting up MCP configuration at ${r}...`);let a={[I]:{command:`npx`,args:[`-y`,I],env:{TASKGRAPH_TOOLS:`core`}}};if(S.existsSync(i)||S.mkdirSync(i,{recursive:!0}),S.existsSync(r)){t(`debug`,`MCP configuration file already exists, checking for existing taskgraph-ai...`);try{let e=JSON.parse(S.readFileSync(r,`utf8`));if(e.mcpServers||={},Object.values(e.mcpServers).some(_e)){t(`debug`,`Found existing taskgraph-ai MCP configuration in mcp.json, leaving untouched`);return}e.mcpServers[`taskgraph-ai`]?t(`debug`,`taskgraph-ai server already configured in mcp.json`):(e.mcpServers[I]=a[I],t(`debug`,`Added taskgraph-ai server to existing MCP configuration`)),S.writeFileSync(r,L(e)+`
9
- `),t(`debug`,`Updated MCP configuration file`)}catch(e){t(`error`,`Failed to update MCP configuration: ${e.message}`);let n=`${r}.backup-${Date.now()}`;S.existsSync(r)&&(S.copyFileSync(r,n),t(`warn`,`Saved the old file as ${n}`));let i={mcpServers:a};S.writeFileSync(r,L(i)+`
10
- `),t(`warn`,`Created new MCP configuration file (backup of original file was created if it existed)`)}}else{let e={mcpServers:a};S.writeFileSync(r,L(e)+`
11
- `),t(`debug`,`Created MCP configuration file at ${r}`)}t(`debug`,`MCP server will use the installed taskgraph-ai package`)}function R(e){let{name:t,description:n,content:r,argumentHint:i}=e;return{type:`static`,metadata:{name:t,description:n,...i&&{argumentHint:i}},content:r}}function z(e,t,n,r){if(!r.includes(`$ARGUMENTS`))throw Error(`Dynamic slash command "${e}" must contain $ARGUMENTS placeholder`);return{type:`dynamic`,metadata:{name:e,description:t,argumentHint:n},content:r}}const ye=z(`parse-prd`,`Parse PRD`,`<prd-file>`,`Parse a PRD document to generate tasks.
12
-
13
- Arguments: $ARGUMENTS (PRD file path)
14
-
15
- ## Intelligent PRD Parsing
16
-
17
- Analyzes your requirements document and generates a complete task breakdown.
18
-
19
- ## Execution
20
-
21
- \`\`\`bash
22
- taskgraph parse-prd --input=$ARGUMENTS
23
- \`\`\`
24
-
25
- ## Parsing Process
26
-
27
- 1. **Document Analysis**
28
- - Extract key requirements
29
- - Identify technical components
30
- - Detect dependencies
31
- - Estimate complexity
32
-
33
- 2. **Task Generation**
34
- - Create 10-15 tasks by default
35
- - Include implementation tasks
36
- - Add testing tasks
37
- - Include documentation tasks
38
- - Set logical dependencies
39
-
40
- 3. **Smart Enhancements**
41
- - Group related functionality
42
- - Set appropriate priorities
43
- - Add acceptance criteria
44
- - Include test strategies
45
-
46
- ## Options
47
-
48
- Parse arguments for modifiers:
49
- - Number after filename → \`--num-tasks\`
50
- - \`research\` → Use research mode
51
- - \`comprehensive\` → Generate more tasks
52
-
53
- ## Post-Generation
54
-
55
- After parsing:
56
- 1. Display task summary
57
- 2. Show dependency graph
58
- 3. Suggest task expansion for complex items
59
- 4. Recommend sprint planning`),be=z(`parse-prd-with-research`,`Parse PRD With Research`,`<prd-file>`,`Parse PRD with enhanced research mode for better task generation.
60
-
61
- Arguments: $ARGUMENTS (PRD file path)
62
-
63
- ## Research-Enhanced Parsing
64
-
65
- Uses the research role, which runs on Claude Code with web search and fetch access, for more comprehensive task generation with current best practices.
66
-
67
- ## Execution
68
-
69
- \`\`\`bash
70
- taskgraph parse-prd --input=$ARGUMENTS --research
71
- \`\`\`
72
-
73
- ## Research Benefits
74
-
75
- 1. **Current Best Practices**
76
- - Latest framework patterns
77
- - Security considerations
78
- - Performance optimizations
79
- - Accessibility requirements
80
-
81
- 2. **Technical Deep Dive**
82
- - Implementation approaches
83
- - Library recommendations
84
- - Architecture patterns
85
- - Testing strategies
86
-
87
- 3. **Comprehensive Coverage**
88
- - Edge cases consideration
89
- - Error handling tasks
90
- - Monitoring setup
91
- - Deployment tasks
92
-
93
- ## Enhanced Output
94
-
95
- Research mode typically:
96
- - Generates more detailed tasks
97
- - Includes industry standards
98
- - Adds compliance considerations
99
- - Suggests modern tooling
100
-
101
- ## When to Use
102
-
103
- - New technology domains
104
- - Complex requirements
105
- - Regulatory compliance needed
106
- - Best practices crucial`),xe=z(`analyze-complexity`,`Analyze Complexity`,`[options]`,`Analyze task complexity and generate expansion recommendations.
107
-
108
- Arguments: $ARGUMENTS
109
-
110
- Perform deep analysis of task complexity across the project.
111
-
112
- ## Complexity Analysis
113
-
114
- Uses AI to analyze tasks and recommend which ones need breakdown.
115
-
116
- ## Execution Options
117
-
118
- \`\`\`bash
119
- taskgraph analyze-complexity [--research] [--threshold=5]
120
- \`\`\`
121
-
122
- ## Analysis Parameters
123
-
124
- - \`--research\` → Use research AI for deeper analysis
125
- - \`--threshold=5\` → Only flag tasks above complexity 5
126
- - Default: Analyze all pending tasks
127
-
128
- ## Analysis Process
129
-
130
- ### 1. **Task Evaluation**
131
- For each task, AI evaluates:
132
- - Technical complexity
133
- - Time requirements
134
- - Dependency complexity
135
- - Risk factors
136
- - Knowledge requirements
137
-
138
- ### 2. **Complexity Scoring**
139
- Assigns score 1-10 based on:
140
- - Implementation difficulty
141
- - Integration challenges
142
- - Testing requirements
143
- - Unknown factors
144
- - Technical debt risk
145
-
146
- ### 3. **Recommendations**
147
- For complex tasks:
148
- - Suggest expansion approach
149
- - Recommend subtask breakdown
150
- - Identify risk areas
151
- - Propose mitigation strategies
152
-
153
- ## Smart Analysis Features
154
-
155
- 1. **Pattern Recognition**
156
- - Similar task comparisons
157
- - Historical complexity accuracy
158
- - Team velocity consideration
159
- - Technology stack factors
160
-
161
- 2. **Contextual Factors**
162
- - Team expertise
163
- - Available resources
164
- - Timeline constraints
165
- - Business criticality
166
-
167
- 3. **Risk Assessment**
168
- - Technical risks
169
- - Timeline risks
170
- - Dependency risks
171
- - Knowledge gaps
172
-
173
- ## Output Format
174
-
175
- \`\`\`
176
- Task Complexity Analysis Report
177
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
178
-
179
- High Complexity Tasks (>7):
180
- 📍 #5 "Implement real-time sync" - Score: 9/10
181
- Factors: WebSocket complexity, state management, conflict resolution
182
- Recommendation: Expand into 5-7 subtasks
183
- Risks: Performance, data consistency
184
-
185
- 📍 #12 "Migrate database schema" - Score: 8/10
186
- Factors: Data migration, zero downtime, rollback strategy
187
- Recommendation: Expand into 4-5 subtasks
188
- Risks: Data loss, downtime
189
-
190
- Medium Complexity Tasks (5-7):
191
- 📍 #23 "Add export functionality" - Score: 6/10
192
- Consider expansion if timeline tight
193
-
194
- Low Complexity Tasks (<5):
195
- ✅ 15 tasks - No expansion needed
196
-
197
- Summary:
198
- - Expand immediately: 2 tasks
199
- - Consider expanding: 5 tasks
200
- - Keep as-is: 15 tasks
201
- \`\`\`
202
-
203
- ## Actionable Output
204
-
205
- For each high-complexity task:
206
- 1. Complexity score with reasoning
207
- 2. Specific expansion suggestions
208
- 3. Risk mitigation approaches
209
- 4. Recommended subtask structure
210
-
211
- ## Integration
212
-
213
- Results are:
214
- - Saved to \`.taskgraph/reports/complexity-analysis.md\`
215
- - Used by expand command
216
- - Inform sprint planning
217
- - Guide resource allocation
218
-
219
- ## Next Steps
220
-
221
- After analysis:
222
- \`\`\`
223
- /taskgraph:expand 5 # Expand specific task
224
- /taskgraph:expand-all # Expand all recommended
225
- /taskgraph:complexity-report # View detailed report
226
- \`\`\``),Se=z(`complexity-report`,`Complexity Report`,`[--file=<path>]`,`Display the task complexity analysis report.
227
-
228
- Arguments: $ARGUMENTS
229
-
230
- View the detailed complexity analysis generated by analyze-complexity command.
231
-
232
- ## Viewing Complexity Report
233
-
234
- Shows comprehensive task complexity analysis with actionable insights.
235
-
236
- ## Execution
237
-
238
- \`\`\`bash
239
- taskgraph complexity-report [--file=<path>]
240
- \`\`\`
241
-
242
- ## Report Location
243
-
244
- Default: \`.taskgraph/reports/complexity-analysis.md\`
245
- Custom: Specify with --file parameter
246
-
247
- ## Report Contents
248
-
249
- ### 1. **Executive Summary**
250
- \`\`\`
251
- Complexity Analysis Summary
252
- ━━━━━━━━━━━━━━━━━━━━━━━━
253
- Analysis Date: 2024-01-15
254
- Tasks Analyzed: 32
255
- High Complexity: 5 (16%)
256
- Medium Complexity: 12 (37%)
257
- Low Complexity: 15 (47%)
258
-
259
- Critical Findings:
260
- - 5 tasks need immediate expansion
261
- - 3 tasks have high technical risk
262
- - 2 tasks block critical path
263
- \`\`\`
264
-
265
- ### 2. **Detailed Task Analysis**
266
- For each complex task:
267
- - Complexity score breakdown
268
- - Contributing factors
269
- - Specific risks identified
270
- - Expansion recommendations
271
- - Similar completed tasks
272
-
273
- ### 3. **Risk Matrix**
274
- Visual representation:
275
- \`\`\`
276
- Risk vs Complexity Matrix
277
- ━━━━━━━━━━━━━━━━━━━━━━━
278
- High Risk | #5(9) #12(8) | #23(6)
279
- Med Risk | #34(7) | #45(5) #67(5)
280
- Low Risk | #78(8) | [15 tasks]
281
- | High Complex | Med Complex
282
- \`\`\`
283
-
284
- ### 4. **Recommendations**
285
-
286
- **Immediate Actions:**
287
- 1. Expand task #5 - Critical path + high complexity
288
- 2. Expand task #12 - High risk + dependencies
289
- 3. Review task #34 - Consider splitting
290
-
291
- **Sprint Planning:**
292
- - Don't schedule multiple high-complexity tasks together
293
- - Ensure expertise available for complex tasks
294
- - Build in buffer time for unknowns
295
-
296
- ## Interactive Features
297
-
298
- When viewing report:
299
- 1. **Quick Actions**
300
- - Press 'e' to expand a task
301
- - Press 'd' for task details
302
- - Press 'r' to refresh analysis
303
-
304
- 2. **Filtering**
305
- - View by complexity level
306
- - Filter by risk factors
307
- - Show only actionable items
308
-
309
- 3. **Export Options**
310
- - Markdown format
311
- - CSV for spreadsheets
312
- - JSON for tools
313
-
314
- ## Report Intelligence
315
-
316
- - Compares with historical data
317
- - Shows complexity trends
318
- - Identifies patterns
319
- - Suggests process improvements
320
-
321
- ## Integration
322
-
323
- Use report for:
324
- - Sprint planning sessions
325
- - Resource allocation
326
- - Risk assessment
327
- - Team discussions
328
- - Client updates
329
-
330
- ## Example Usage
331
-
332
- \`\`\`
333
- /taskgraph:complexity-report
334
- → Opens latest analysis
335
-
336
- /taskgraph:complexity-report --file=archived/2024-01-01.md
337
- → View historical analysis
338
-
339
- After viewing:
340
- /taskgraph:expand 5
341
- → Expand high-complexity task
342
- \`\`\``),Ce=z(`expand-task`,`Expand Task`,`<task-id>`,`Break down a complex task into subtasks.
343
-
344
- Arguments: $ARGUMENTS (task ID)
345
-
346
- ## Intelligent Task Expansion
347
-
348
- Analyzes a task and creates detailed subtasks for better manageability.
349
-
350
- ## Execution
351
-
352
- \`\`\`bash
353
- taskgraph expand --id=$ARGUMENTS
354
- \`\`\`
355
-
356
- ## Expansion Process
357
-
358
- 1. **Task Analysis**
359
- - Review task complexity
360
- - Identify components
361
- - Detect technical challenges
362
- - Estimate time requirements
363
-
364
- 2. **Subtask Generation**
365
- - Create 3-7 subtasks typically
366
- - Each subtask 1-4 hours
367
- - Logical implementation order
368
- - Clear acceptance criteria
369
-
370
- 3. **Smart Breakdown**
371
- - Setup/configuration tasks
372
- - Core implementation
373
- - Testing components
374
- - Integration steps
375
- - Documentation updates
376
-
377
- ## Enhanced Features
378
-
379
- Based on task type:
380
- - **Feature**: Setup → Implement → Test → Integrate
381
- - **Bug Fix**: Reproduce → Diagnose → Fix → Verify
382
- - **Refactor**: Analyze → Plan → Refactor → Validate
383
-
384
- ## Post-Expansion
385
-
386
- After expansion:
387
- 1. Show subtask hierarchy
388
- 2. Update time estimates
389
- 3. Suggest implementation order
390
- 4. Highlight critical path`),we=R({name:`expand-all-tasks`,description:`Expand All Tasks`,content:`Expand all pending tasks that need subtasks.
391
-
392
- ## Bulk Task Expansion
393
-
394
- Intelligently expands all tasks that would benefit from breakdown.
395
-
396
- ## Execution
397
-
398
- \`\`\`bash
399
- taskgraph expand --all
400
- \`\`\`
401
-
402
- ## Smart Selection
403
-
404
- Only expands tasks that:
405
- - Are marked as pending
406
- - Have high complexity (>5)
407
- - Lack existing subtasks
408
- - Would benefit from breakdown
409
-
410
- ## Expansion Process
411
-
412
- 1. **Analysis Phase**
413
- - Identify expansion candidates
414
- - Group related tasks
415
- - Plan expansion strategy
416
-
417
- 2. **Batch Processing**
418
- - Expand tasks in logical order
419
- - Maintain consistency
420
- - Preserve relationships
421
- - Optimize for parallelism
422
-
423
- 3. **Quality Control**
424
- - Ensure subtask quality
425
- - Avoid over-decomposition
426
- - Maintain task coherence
427
- - Update dependencies
428
-
429
- ## Options
430
-
431
- - Add \`force\` to expand all regardless of complexity
432
- - Add \`research\` for enhanced AI analysis
433
-
434
- ## Results
435
-
436
- After bulk expansion:
437
- - Summary of tasks expanded
438
- - New subtask count
439
- - Updated complexity metrics
440
- - Suggested task order`}),Te=z(`add-task`,`Add Task`,`<description>`,`Add new tasks with intelligent parsing and context awareness.
441
-
442
- Arguments: $ARGUMENTS
443
-
444
- ## Smart Task Addition
445
-
446
- Parse natural language to create well-structured tasks.
447
-
448
- ### 1. **Input Understanding**
449
-
450
- I'll intelligently parse your request:
451
- - Natural language → Structured task
452
- - Detect priority from keywords (urgent, ASAP, important)
453
- - Infer dependencies from context
454
- - Suggest complexity based on description
455
- - Determine task type (feature, bug, refactor, test, docs)
456
-
457
- ### 2. **Smart Parsing Examples**
458
-
459
- **"Add urgent task to fix login bug"**
460
- → Title: Fix login bug
461
- → Priority: high
462
- → Type: bug
463
- → Suggested complexity: medium
464
-
465
- **"Create task for API documentation after task 23 is done"**
466
- → Title: API documentation
467
- → Dependencies: [23]
468
- → Type: documentation
469
- → Priority: medium
470
-
471
- **"Need to refactor auth module - depends on 12 and 15, high complexity"**
472
- → Title: Refactor auth module
473
- → Dependencies: [12, 15]
474
- → Complexity: high
475
- → Type: refactor
476
-
477
- ### 3. **Context Enhancement**
478
-
479
- Based on current project state:
480
- - Suggest related existing tasks
481
- - Warn about potential conflicts
482
- - Recommend dependencies
483
- - Propose subtasks if complex
484
-
485
- ### 4. **Interactive Refinement**
486
-
487
- \`\`\`yaml
488
- Task Preview:
489
- ─────────────
490
- Title: [Extracted title]
491
- Priority: [Inferred priority]
492
- Dependencies: [Detected dependencies]
493
- Complexity: [Estimated complexity]
494
-
495
- Suggestions:
496
- - Similar task #34 exists, consider as dependency?
497
- - This seems complex, break into subtasks?
498
- - Tasks #45-47 work on same module
499
- \`\`\`
500
-
501
- ### 5. **Validation & Creation**
502
-
503
- Before creating:
504
- - Validate dependencies exist
505
- - Check for duplicates
506
- - Ensure logical ordering
507
- - Verify task completeness
508
-
509
- ### 6. **Smart Defaults**
510
-
511
- Intelligent defaults based on:
512
- - Task type patterns
513
- - Team conventions
514
- - Historical data
515
- - Current sprint/phase
516
-
517
- Result: High-quality tasks from minimal input.`),Ee=z(`add-subtask`,`Add Subtask`,`<parent-id> <title>`,`Add a subtask to a parent task.
518
-
519
- Arguments: $ARGUMENTS
520
-
521
- Parse arguments to create a new subtask or convert existing task.
522
-
523
- ## Adding Subtasks
524
-
525
- Creates subtasks to break down complex parent tasks into manageable pieces.
526
-
527
- ## Argument Parsing
528
-
529
- Flexible natural language:
530
- - "add subtask to 5: implement login form"
531
- - "break down 5 with: setup, implement, test"
532
- - "subtask for 5: handle edge cases"
533
- - "5: validate user input" → adds subtask to task 5
534
-
535
- ## Execution Modes
536
-
537
- ### 1. Create New Subtask
538
- \`\`\`bash
539
- taskgraph add-subtask --parent=<id> --title="<title>" --description="<desc>"
540
- \`\`\`
541
-
542
- ### 2. Convert Existing Task
543
- \`\`\`bash
544
- taskgraph add-subtask --parent=<id> --task-id=<existing-id>
545
- \`\`\`
546
-
547
- ## Smart Features
548
-
549
- 1. **Automatic Subtask Generation**
550
- - If title contains "and" or commas, create multiple
551
- - Suggest common subtask patterns
552
- - Inherit parent's context
553
-
554
- 2. **Intelligent Defaults**
555
- - Priority based on parent
556
- - Appropriate time estimates
557
- - Logical dependencies between subtasks
558
-
559
- 3. **Validation**
560
- - Check parent task complexity
561
- - Warn if too many subtasks
562
- - Ensure subtask makes sense
563
-
564
- ## Creation Process
565
-
566
- 1. Parse parent task context
567
- 2. Generate subtask with ID like "5.1"
568
- 3. Set appropriate defaults
569
- 4. Link to parent task
570
- 5. Update parent's time estimate
571
-
572
- ## Example Flows
573
-
574
- \`\`\`
575
- /taskgraph:add-subtask to 5: implement user authentication
576
- → Created subtask #5.1: "implement user authentication"
577
- → Parent task #5 now has 1 subtask
578
- → Suggested next subtasks: tests, documentation
579
-
580
- /taskgraph:add-subtask 5: setup, implement, test
581
- → Created 3 subtasks:
582
- #5.1: setup
583
- #5.2: implement
584
- #5.3: test
585
- \`\`\`
586
-
587
- ## Post-Creation
588
-
589
- - Show updated task hierarchy
590
- - Suggest logical next subtasks
591
- - Update complexity estimates
592
- - Recommend subtask order`),De=z(`remove-task`,`Remove Task`,`<task-id>`,`Remove a task permanently from the project.
593
-
594
- Arguments: $ARGUMENTS (task ID)
595
-
596
- Delete a task and handle all its relationships properly.
597
-
598
- ## Task Removal
599
-
600
- Permanently removes a task while maintaining project integrity.
601
-
602
- ## Argument Parsing
603
-
604
- - "remove task 5"
605
- - "delete 5"
606
- - "5" → remove task 5
607
- - Can include "-y" for auto-confirm
608
-
609
- ## Execution
610
-
611
- \`\`\`bash
612
- taskgraph remove-task --id=<id> [-y]
613
- \`\`\`
614
-
615
- ## Pre-Removal Analysis
616
-
617
- 1. **Task Details**
618
- - Current status
619
- - Work completed
620
- - Time invested
621
- - Associated data
622
-
623
- 2. **Relationship Check**
624
- - Tasks that depend on this
625
- - Dependencies this task has
626
- - Subtasks that will be removed
627
- - Blocking implications
628
-
629
- 3. **Impact Assessment**
630
- \`\`\`
631
- Task Removal Impact
632
- ━━━━━━━━━━━━━━━━━━
633
- Task: #5 "Implement authentication" (in-progress)
634
- Status: 60% complete (~8 hours work)
635
-
636
- Will affect:
637
- - 3 tasks depend on this (will be blocked)
638
- - Has 4 subtasks (will be deleted)
639
- - Part of critical path
640
-
641
- ⚠️ This action cannot be undone
642
- \`\`\`
643
-
644
- ## Smart Warnings
645
-
646
- - Warn if task is in-progress
647
- - Show dependent tasks that will be blocked
648
- - Highlight if part of critical path
649
- - Note any completed work being lost
650
-
651
- ## Removal Process
652
-
653
- 1. Show comprehensive impact
654
- 2. Require confirmation (unless -y)
655
- 3. Update dependent task references
656
- 4. Remove task and subtasks
657
- 5. Clean up orphaned dependencies
658
- 6. Log removal with timestamp
659
-
660
- ## Alternative Actions
661
-
662
- Suggest before deletion:
663
- - Mark as cancelled instead
664
- - Convert to documentation
665
- - Archive task data
666
- - Transfer work to another task
667
-
668
- ## Post-Removal
669
-
670
- - List affected tasks
671
- - Show broken dependencies
672
- - Update project statistics
673
- - Suggest dependency fixes
674
- - Recalculate timeline
675
-
676
- ## Example Flows
677
-
678
- \`\`\`
679
- /taskgraph:remove-task 5
680
- → Task #5 is in-progress with 8 hours logged
681
- → 3 other tasks depend on this
682
- → Suggestion: Mark as cancelled instead?
683
- Remove anyway? (y/n)
684
-
685
- /taskgraph:remove-task 5 -y
686
- → Removed: Task #5 and 4 subtasks
687
- → Updated: 3 task dependencies
688
- → Warning: Tasks #7, #8, #9 now have missing dependency
689
- → Run /taskgraph:fix-dependencies to resolve
690
- \`\`\`
691
-
692
- ## Safety Features
693
-
694
- - Confirmation required
695
- - Impact preview
696
- - Removal logging
697
- - Suggest alternatives
698
- - No cascade delete of dependents`),Oe=z(`remove-subtask`,`Remove Subtask`,`<subtask-id>`,`Remove a subtask from its parent task.
699
-
700
- Arguments: $ARGUMENTS
701
-
702
- Parse subtask ID to remove, with option to convert to standalone task.
703
-
704
- ## Removing Subtasks
705
-
706
- Remove a subtask and optionally convert it back to a standalone task.
707
-
708
- ## Argument Parsing
709
-
710
- - "remove subtask 5.1"
711
- - "delete 5.1"
712
- - "convert 5.1 to task" → remove and convert
713
- - "5.1 standalone" → convert to standalone
714
-
715
- ## Execution Options
716
-
717
- ### 1. Delete Subtask
718
- \`\`\`bash
719
- taskgraph remove-subtask --id=<parentId.subtaskId>
720
- \`\`\`
721
-
722
- ### 2. Convert to Standalone
723
- \`\`\`bash
724
- taskgraph remove-subtask --id=<parentId.subtaskId> --convert
725
- \`\`\`
726
-
727
- ## Pre-Removal Checks
728
-
729
- 1. **Validate Subtask**
730
- - Verify subtask exists
731
- - Check completion status
732
- - Review dependencies
733
-
734
- 2. **Impact Analysis**
735
- - Other subtasks that depend on it
736
- - Parent task implications
737
- - Data that will be lost
738
-
739
- ## Removal Process
740
-
741
- ### For Deletion:
742
- 1. Confirm if subtask has work done
743
- 2. Update parent task estimates
744
- 3. Remove subtask and its data
745
- 4. Clean up dependencies
746
-
747
- ### For Conversion:
748
- 1. Assign new standalone task ID
749
- 2. Preserve all task data
750
- 3. Update dependency references
751
- 4. Maintain task history
752
-
753
- ## Smart Features
754
-
755
- - Warn if subtask is in-progress
756
- - Show impact on parent task
757
- - Preserve important data
758
- - Update related estimates
759
-
760
- ## Example Flows
761
-
762
- \`\`\`
763
- /taskgraph:remove-subtask 5.1
764
- → Warning: Subtask #5.1 is in-progress
765
- → This will delete all subtask data
766
- → Parent task #5 will be updated
767
- Confirm deletion? (y/n)
768
-
769
- /taskgraph:remove-subtask 5.1 convert
770
- → Converting subtask #5.1 to standalone task #89
771
- → Preserved: All task data and history
772
- → Updated: 2 dependency references
773
- → New task #89 is now independent
774
- \`\`\`
775
-
776
- ## Post-Removal
777
-
778
- - Update parent task status
779
- - Recalculate estimates
780
- - Show updated hierarchy
781
- - Suggest next actions`),ke=z(`remove-subtasks`,`Remove Subtasks`,`<task-id>`,`Clear all subtasks from a specific task.
782
-
783
- Arguments: $ARGUMENTS (task ID)
784
-
785
- Remove all subtasks from a parent task at once.
786
-
787
- ## Clearing Subtasks
788
-
789
- Bulk removal of all subtasks from a parent task.
790
-
791
- ## Execution
792
-
793
- \`\`\`bash
794
- taskgraph remove-subtasks --id=$ARGUMENTS
795
- \`\`\`
796
-
797
- ## Pre-Clear Analysis
798
-
799
- 1. **Subtask Summary**
800
- - Number of subtasks
801
- - Completion status of each
802
- - Work already done
803
- - Dependencies affected
804
-
805
- 2. **Impact Assessment**
806
- - Data that will be lost
807
- - Dependencies to be removed
808
- - Effect on project timeline
809
- - Parent task implications
810
-
811
- ## Confirmation Required
812
-
813
- \`\`\`
814
- Remove Subtasks Confirmation
815
- ━━━━━━━━━━━━━━━━━━━━━━━━━
816
- Parent Task: #5 "Implement user authentication"
817
- Subtasks to remove: 4
818
- - #5.1 "Setup auth framework" (done)
819
- - #5.2 "Create login form" (in-progress)
820
- - #5.3 "Add validation" (pending)
821
- - #5.4 "Write tests" (pending)
822
-
823
- ⚠️ This will permanently delete all subtask data
824
- Continue? (y/n)
825
- \`\`\`
826
-
827
- ## Smart Features
828
-
829
- - Option to convert to standalone tasks
830
- - Backup task data before clearing
831
- - Preserve completed work history
832
- - Update parent task appropriately
833
-
834
- ## Process
835
-
836
- 1. List all subtasks for confirmation
837
- 2. Check for in-progress work
838
- 3. Remove all subtasks
839
- 4. Update parent task
840
- 5. Clean up dependencies
841
-
842
- ## Alternative Options
843
-
844
- Suggest alternatives:
845
- - Convert important subtasks to tasks
846
- - Keep completed subtasks
847
- - Archive instead of delete
848
- - Export subtask data first
849
-
850
- ## Post-Clear
851
-
852
- - Show updated parent task
853
- - Recalculate time estimates
854
- - Update task complexity
855
- - Suggest next steps
856
-
857
- ## Example
858
-
859
- \`\`\`
860
- /taskgraph:remove-subtasks 5
861
- → Found 4 subtasks to remove
862
- → Warning: Subtask #5.2 is in-progress
863
- → Cleared all subtasks from task #5
864
- → Updated parent task estimates
865
- → Suggestion: Consider re-expanding with better breakdown
866
- \`\`\``),Ae=R({name:`remove-all-subtasks`,description:`Remove All Subtasks`,content:`Clear all subtasks from all tasks globally.
867
-
868
- ## Global Subtask Clearing
869
-
870
- Remove all subtasks across the entire project. Use with extreme caution.
871
-
872
- ## Execution
873
-
874
- \`\`\`bash
875
- taskgraph clear-subtasks --all
876
- \`\`\`
877
-
878
- ## Pre-Clear Analysis
879
-
880
- 1. **Project-Wide Summary**
881
- \`\`\`
882
- Global Subtask Summary
883
- ━━━━━━━━━━━━━━━━━━━━
884
- Total parent tasks: 12
885
- Total subtasks: 47
886
- - Completed: 15
887
- - In-progress: 8
888
- - Pending: 24
889
-
890
- Work at risk: ~120 hours
891
- \`\`\`
892
-
893
- 2. **Critical Warnings**
894
- - In-progress subtasks that will lose work
895
- - Completed subtasks with valuable history
896
- - Complex dependency chains
897
- - Integration test results
898
-
899
- ## Double Confirmation
900
-
901
- \`\`\`
902
- ⚠️ DESTRUCTIVE OPERATION WARNING ⚠️
903
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
904
- This will remove ALL 47 subtasks from your project
905
- Including 8 in-progress and 15 completed subtasks
906
-
907
- This action CANNOT be undone
908
-
909
- Type 'CLEAR ALL SUBTASKS' to confirm:
910
- \`\`\`
911
-
912
- ## Smart Safeguards
913
-
914
- - Require explicit confirmation phrase
915
- - Create automatic backup
916
- - Log all removed data
917
- - Option to export first
918
-
919
- ## Use Cases
920
-
921
- Valid reasons for global clear:
922
- - Project restructuring
923
- - Major pivot in approach
924
- - Starting fresh breakdown
925
- - Switching to different task organization
926
-
927
- ## Process
928
-
929
- 1. Full project analysis
930
- 2. Create backup file
931
- 3. Show detailed impact
932
- 4. Require confirmation
933
- 5. Execute removal
934
- 6. Generate summary report
935
-
936
- ## Alternative Suggestions
937
-
938
- Before clearing all:
939
- - Export subtasks to file
940
- - Clear only pending subtasks
941
- - Clear by task category
942
- - Archive instead of delete
943
-
944
- ## Post-Clear Report
945
-
946
- \`\`\`
947
- Global Subtask Clear Complete
948
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━
949
- Removed: 47 subtasks from 12 tasks
950
- Backup saved: .taskgraph/backup/subtasks-20240115.json
951
- Parent tasks updated: 12
952
- Time estimates adjusted: Yes
953
-
954
- Next steps:
955
- - Review updated task list
956
- - Re-expand complex tasks as needed
957
- - Check project timeline
958
- \`\`\``}),je=z(`convert-task-to-subtask`,`Convert Task To Subtask`,`<parent-id> <task-id>`,`Convert an existing task into a subtask.
959
-
960
- Arguments: $ARGUMENTS
961
-
962
- Parse parent ID and task ID to convert.
963
-
964
- ## Task Conversion
965
-
966
- Converts an existing standalone task into a subtask of another task.
967
-
968
- ## Argument Parsing
969
-
970
- - "move task 8 under 5"
971
- - "make 8 a subtask of 5"
972
- - "nest 8 in 5"
973
- - "5 8" → make task 8 a subtask of task 5
974
-
975
- ## Execution
976
-
977
- \`\`\`bash
978
- taskgraph add-subtask --parent=<parent-id> --task-id=<task-to-convert>
979
- \`\`\`
980
-
981
- ## Pre-Conversion Checks
982
-
983
- 1. **Validation**
984
- - Both tasks exist and are valid
985
- - No circular parent relationships
986
- - Task isn't already a subtask
987
- - Logical hierarchy makes sense
988
-
989
- 2. **Impact Analysis**
990
- - Dependencies that will be affected
991
- - Tasks that depend on converting task
992
- - Priority alignment needed
993
- - Status compatibility
994
-
995
- ## Conversion Process
996
-
997
- 1. Change task ID from "8" to "5.1" (next available)
998
- 2. Update all dependency references
999
- 3. Inherit parent's context where appropriate
1000
- 4. Adjust priorities if needed
1001
- 5. Update time estimates
1002
-
1003
- ## Smart Features
1004
-
1005
- - Preserve task history
1006
- - Maintain dependencies
1007
- - Update all references
1008
- - Create conversion log
1009
-
1010
- ## Example
1011
-
1012
- \`\`\`
1013
- /taskgraph:add-subtask/from-task 5 8
1014
- → Converting: Task #8 becomes subtask #5.1
1015
- → Updated: 3 dependency references
1016
- → Parent task #5 now has 1 subtask
1017
- → Note: Subtask inherits parent's priority
1018
-
1019
- Before: #8 "Implement validation" (standalone)
1020
- After: #5.1 "Implement validation" (subtask of #5)
1021
- \`\`\`
1022
-
1023
- ## Post-Conversion
1024
-
1025
- - Show new task hierarchy
1026
- - List updated dependencies
1027
- - Verify project integrity
1028
- - Suggest related conversions`),Me=z(`add-dependency`,`Add Dependency`,`<task-id> <depends-on-id>`,`Add a dependency between tasks.
1029
-
1030
- Arguments: $ARGUMENTS
1031
-
1032
- Parse the task IDs to establish dependency relationship.
1033
-
1034
- ## Adding Dependencies
1035
-
1036
- Creates a dependency where one task must be completed before another can start.
1037
-
1038
- ## Argument Parsing
1039
-
1040
- Parse natural language or IDs:
1041
- - "make 5 depend on 3" → task 5 depends on task 3
1042
- - "5 needs 3" → task 5 depends on task 3
1043
- - "5 3" → task 5 depends on task 3
1044
- - "5 after 3" → task 5 depends on task 3
1045
-
1046
- ## Execution
1047
-
1048
- \`\`\`bash
1049
- taskgraph add-dependency --id=<task-id> --depends-on=<dependency-id>
1050
- \`\`\`
1051
-
1052
- ## Validation
1053
-
1054
- Before adding:
1055
- 1. **Verify both tasks exist**
1056
- 2. **Check for circular dependencies**
1057
- 3. **Ensure dependency makes logical sense**
1058
- 4. **Warn if creating complex chains**
1059
-
1060
- ## Smart Features
1061
-
1062
- - Detect if dependency already exists
1063
- - Suggest related dependencies
1064
- - Show impact on task flow
1065
- - Update task priorities if needed
1066
-
1067
- ## Post-Addition
1068
-
1069
- After adding dependency:
1070
- 1. Show updated dependency graph
1071
- 2. Identify any newly blocked tasks
1072
- 3. Suggest task order changes
1073
- 4. Update project timeline
1074
-
1075
- ## Example Flows
1076
-
1077
- \`\`\`
1078
- /taskgraph:add-dependency 5 needs 3
1079
- → Task #5 now depends on Task #3
1080
- → Task #5 is now blocked until #3 completes
1081
- → Suggested: Also consider if #5 needs #4
1082
- \`\`\``),Ne=z(`remove-dependency`,`Remove Dependency`,`<task-id> <depends-on-id>`,`Remove a dependency between tasks.
1083
-
1084
- Arguments: $ARGUMENTS
1085
-
1086
- Parse the task IDs to remove dependency relationship.
1087
-
1088
- ## Removing Dependencies
1089
-
1090
- Removes a dependency relationship, potentially unblocking tasks.
1091
-
1092
- ## Argument Parsing
1093
-
1094
- Parse natural language or IDs:
1095
- - "remove dependency between 5 and 3"
1096
- - "5 no longer needs 3"
1097
- - "unblock 5 from 3"
1098
- - "5 3" → remove dependency of 5 on 3
1099
-
1100
- ## Execution
1101
-
1102
- \`\`\`bash
1103
- taskgraph remove-dependency --id=<task-id> --depends-on=<dependency-id>
1104
- \`\`\`
1105
-
1106
- ## Pre-Removal Checks
1107
-
1108
- 1. **Verify dependency exists**
1109
- 2. **Check impact on task flow**
1110
- 3. **Warn if it breaks logical sequence**
1111
- 4. **Show what will be unblocked**
1112
-
1113
- ## Smart Analysis
1114
-
1115
- Before removing:
1116
- - Show why dependency might have existed
1117
- - Check if removal makes tasks executable
1118
- - Verify no critical path disruption
1119
- - Suggest alternative dependencies
1120
-
1121
- ## Post-Removal
1122
-
1123
- After removing:
1124
- 1. Show updated task status
1125
- 2. List newly unblocked tasks
1126
- 3. Update project timeline
1127
- 4. Suggest next actions
1128
-
1129
- ## Safety Features
1130
-
1131
- - Confirm if removing critical dependency
1132
- - Show tasks that become immediately actionable
1133
- - Warn about potential issues
1134
- - Keep removal history
1135
-
1136
- ## Example
1137
-
1138
- \`\`\`
1139
- /taskgraph:remove-dependency 5 from 3
1140
- → Removed: Task #5 no longer depends on #3
1141
- → Task #5 is now UNBLOCKED and ready to start
1142
- → Warning: Consider if #5 still needs #2 completed first
1143
- \`\`\``),Pe=R({name:`fix-dependencies`,description:`Fix Dependencies`,content:`Automatically fix dependency issues found during validation.
1144
-
1145
- ## Automatic Dependency Repair
1146
-
1147
- Intelligently fixes common dependency problems while preserving project logic.
1148
-
1149
- ## Execution
1150
-
1151
- \`\`\`bash
1152
- taskgraph fix-dependencies
1153
- \`\`\`
1154
-
1155
- ## What Gets Fixed
1156
-
1157
- ### 1. **Auto-Fixable Issues**
1158
- - Remove references to deleted tasks
1159
- - Break simple circular dependencies
1160
- - Remove self-dependencies
1161
- - Clean up duplicate dependencies
1162
-
1163
- ### 2. **Smart Resolutions**
1164
- - Reorder dependencies to maintain logic
1165
- - Suggest task merging for over-dependent tasks
1166
- - Flatten unnecessary dependency chains
1167
- - Remove redundant transitive dependencies
1168
-
1169
- ### 3. **Manual Review Required**
1170
- - Complex circular dependencies
1171
- - Critical path modifications
1172
- - Business logic dependencies
1173
- - High-impact changes
1174
-
1175
- ## Fix Process
1176
-
1177
- 1. **Analysis Phase**
1178
- - Run validation check
1179
- - Categorize issues by type
1180
- - Determine fix strategy
1181
-
1182
- 2. **Execution Phase**
1183
- - Apply automatic fixes
1184
- - Log all changes made
1185
- - Preserve task relationships
1186
-
1187
- 3. **Verification Phase**
1188
- - Re-validate after fixes
1189
- - Show before/after comparison
1190
- - Highlight manual fixes needed
1191
-
1192
- ## Smart Features
1193
-
1194
- - Preserves intended task flow
1195
- - Minimal disruption approach
1196
- - Creates fix history/log
1197
- - Suggests manual interventions
1198
-
1199
- ## Output Example
1200
-
1201
- \`\`\`
1202
- Dependency Auto-Fix Report
1203
- ━━━━━━━━━━━━━━━━━━━━━━━━
1204
- Fixed Automatically:
1205
- ✅ Removed 2 references to deleted tasks
1206
- ✅ Resolved 1 self-dependency
1207
- ✅ Cleaned 3 redundant dependencies
1208
-
1209
- Manual Review Needed:
1210
- ⚠️ Complex circular dependency: #12 → #15 → #18 → #12
1211
- Suggestion: Make #15 not depend on #12
1212
- ⚠️ Task #45 has 8 dependencies
1213
- Suggestion: Break into subtasks
1214
-
1215
- Run '/taskgraph:validate-dependencies' to verify fixes
1216
- \`\`\`
1217
-
1218
- ## Safety
1219
-
1220
- - Preview mode available
1221
- - Rollback capability
1222
- - Change logging
1223
- - No data loss`}),Fe=R({name:`validate-dependencies`,description:`Validate Dependencies`,content:`Validate all task dependencies for issues.
1224
-
1225
- ## Dependency Validation
1226
-
1227
- Comprehensive check for dependency problems across the entire project.
1228
-
1229
- ## Execution
1230
-
1231
- \`\`\`bash
1232
- taskgraph validate-dependencies
1233
- \`\`\`
1234
-
1235
- ## Validation Checks
1236
-
1237
- 1. **Circular Dependencies**
1238
- - A depends on B, B depends on A
1239
- - Complex circular chains
1240
- - Self-dependencies
1241
-
1242
- 2. **Missing Dependencies**
1243
- - References to non-existent tasks
1244
- - Deleted task references
1245
- - Invalid task IDs
1246
-
1247
- 3. **Logical Issues**
1248
- - Completed tasks depending on pending
1249
- - Cancelled tasks in dependency chains
1250
- - Impossible sequences
1251
-
1252
- 4. **Complexity Warnings**
1253
- - Over-complex dependency chains
1254
- - Too many dependencies per task
1255
- - Bottleneck tasks
1256
-
1257
- ## Smart Analysis
1258
-
1259
- The validation provides:
1260
- - Visual dependency graph
1261
- - Critical path analysis
1262
- - Bottleneck identification
1263
- - Suggested optimizations
1264
-
1265
- ## Report Format
1266
-
1267
- \`\`\`
1268
- Dependency Validation Report
1269
- ━━━━━━━━━━━━━━━━━━━━━━━━━━
1270
- ✅ No circular dependencies found
1271
- ⚠️ 2 warnings found:
1272
- - Task #23 has 7 dependencies (consider breaking down)
1273
- - Task #45 blocks 5 other tasks (potential bottleneck)
1274
- ❌ 1 error found:
1275
- - Task #67 depends on deleted task #66
1276
-
1277
- Critical Path: #1 → #5 → #23 → #45 → #50 (15 days)
1278
- \`\`\`
1279
-
1280
- ## Actionable Output
1281
-
1282
- For each issue found:
1283
- - Clear description
1284
- - Impact assessment
1285
- - Suggested fix
1286
- - Command to resolve
1287
-
1288
- ## Next Steps
1289
-
1290
- After validation:
1291
- - Run \`/taskgraph:fix-dependencies\` to auto-fix
1292
- - Manually adjust problematic dependencies
1293
- - Rerun to verify fixes`}),Ie=R({name:`setup-models`,description:`Setup Models`,content:`Run interactive setup to configure AI models.
1294
-
1295
- ## Interactive Model Configuration
1296
-
1297
- Guides you through setting up AI providers for TaskGraph.
1298
-
1299
- ## Execution
1300
-
1301
- \`\`\`bash
1302
- taskgraph models --setup
1303
- \`\`\`
1304
-
1305
- ## Setup Process
1306
-
1307
- 1. **Environment Check**
1308
- - Confirm Claude Code is installed and signed in
1309
- - Show current configuration
1310
-
1311
- 2. **Model Selection**
1312
- - Choose the main model (required)
1313
- - Choose the research model (recommended)
1314
- - Choose a fallback model (optional)
1315
-
1316
- TaskGraph uses Claude Code, so no API keys are needed. Available models: opus, sonnet, haiku.
1317
-
1318
- ## Smart Recommendations
1319
-
1320
- Based on your needs:
1321
- - **For best results**: opus for main, sonnet for research
1322
- - **Budget conscious**: haiku for fallback
1323
- - **Balanced**: sonnet for all roles
1324
-
1325
- ## Configuration Storage
1326
-
1327
- Model choices are saved in \`.taskgraph/config.json\`.
1328
-
1329
- ## Post-Setup
1330
-
1331
- After configuration:
1332
- - Show usage examples
1333
- - Suggest next steps
1334
- - Verify parse-prd works`}),Le=R({name:`view-models`,description:`View Models`,content:`View current AI model configuration.
1335
-
1336
- ## Model Configuration Display
1337
-
1338
- Shows the currently configured AI providers and models for TaskGraph.
1339
-
1340
- ## Execution
1341
-
1342
- \`\`\`bash
1343
- taskgraph models
1344
- \`\`\`
1345
-
1346
- ## Information Displayed
1347
-
1348
- 1. **Main Provider**
1349
- - Model ID and name
1350
- - Usage: Primary task generation
1351
-
1352
- 2. **Research Provider**
1353
- - Model ID and name
1354
- - Usage: Enhanced research mode
1355
-
1356
- 3. **Fallback Provider**
1357
- - Model ID and name
1358
- - Usage: Backup when main fails
1359
-
1360
- ## Visual Status
1361
-
1362
- \`\`\`
1363
- TaskGraph Model Configuration
1364
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1365
- Main: ✅ claude-code / sonnet
1366
- Research: ✅ claude-code / sonnet
1367
- Fallback: ✅ claude-code / sonnet
1368
-
1369
- Available Models:
1370
- - opus
1371
- - sonnet
1372
- - haiku
1373
- \`\`\`
1374
-
1375
- ## Next Actions
1376
-
1377
- Based on configuration:
1378
- - If Claude Code is missing → Suggest installing and signing in
1379
- - If no research model → Explain benefits
1380
- - If all configured → Show usage tips`}),Re=R({name:`install-taskgraph`,description:`Install TaskGraph`,content:`Check if TaskGraph is installed and install it if needed.
1381
-
1382
- This command helps you get TaskGraph set up globally on your system.
1383
-
1384
- ## Detection and Installation Process
1385
-
1386
- 1. **Check Current Installation**
1387
- \`\`\`bash
1388
- # Check if taskgraph command exists
1389
- which taskgraph || echo "TaskGraph not found"
1390
-
1391
- # Check npm global packages
1392
- npm list -g taskgraph-ai
1393
- \`\`\`
1394
-
1395
- 2. **System Requirements Check**
1396
- \`\`\`bash
1397
- # Verify Node.js is installed
1398
- node --version
1399
-
1400
- # Verify npm is installed
1401
- npm --version
1402
-
1403
- # Check Node version (need 16+)
1404
- \`\`\`
1405
-
1406
- 3. **Install TaskGraph Globally**
1407
- If not installed, run:
1408
- \`\`\`bash
1409
- npm install -g taskgraph-ai
1410
- \`\`\`
1411
-
1412
- 4. **Verify Installation**
1413
- \`\`\`bash
1414
- # Check version
1415
- taskgraph --version
1416
-
1417
- # Verify command is available
1418
- which taskgraph
1419
- \`\`\`
1420
-
1421
- 5. **Initial Setup**
1422
- \`\`\`bash
1423
- # Initialize in current directory
1424
- taskgraph init
1425
- \`\`\`
1426
-
1427
- 6. **Check the AI provider**
1428
- TaskGraph uses Claude Code, so no API keys are needed. Make sure Claude Code is installed and signed in:
1429
- \`\`\`bash
1430
- # Verify Claude Code is available
1431
- claude --version
1432
-
1433
- # Check current model configuration
1434
- taskgraph models
1435
- \`\`\`
1436
-
1437
- 7. **Quick Test**
1438
- \`\`\`bash
1439
- # Create a test PRD
1440
- echo "Build a simple hello world API" > test-prd.txt
1441
-
1442
- # Try parsing it
1443
- taskgraph parse-prd test-prd.txt -n 3
1444
- \`\`\`
1445
-
1446
- ## Troubleshooting
1447
-
1448
- If installation fails:
1449
-
1450
- **Permission Errors:**
1451
- \`\`\`bash
1452
- # Try with sudo (macOS/Linux)
1453
- sudo npm install -g taskgraph-ai
1454
-
1455
- # Or fix npm permissions
1456
- npm config set prefix ~/.npm-global
1457
- export PATH=~/.npm-global/bin:$PATH
1458
- \`\`\`
1459
-
1460
- **Network Issues:**
1461
- \`\`\`bash
1462
- # Use different registry
1463
- npm install -g taskgraph-ai --registry https://registry.npmjs.org/
1464
- \`\`\`
1465
-
1466
- **Node Version Issues:**
1467
- \`\`\`bash
1468
- # Install Node 20+ via nvm
1469
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
1470
- nvm install 20
1471
- nvm use 20
1472
- \`\`\`
1473
-
1474
- ## Success Confirmation
1475
-
1476
- Once installed, you should see:
1477
- \`\`\`
1478
- ✅ TaskGraph installed
1479
- ✅ Command 'taskgraph' available globally
1480
- ✅ AI provider configured
1481
- ✅ Ready to use slash commands!
1482
-
1483
- Try: /taskgraph:init your-prd.md
1484
- \`\`\`
1485
-
1486
- ## Next Steps
1487
-
1488
- After installation:
1489
- 1. Run \`/taskgraph:status\` to verify setup
1490
- 2. Configure AI providers with \`/taskgraph:setup-models\`
1491
- 3. Start using TaskGraph commands!`}),ze=R({name:`quick-install-taskgraph`,description:`Quick Install TaskGraph`,content:`Quick install TaskGraph globally if not already installed.
1492
-
1493
- Execute this streamlined installation:
1494
-
1495
- \`\`\`bash
1496
- # Check and install in one command
1497
- taskgraph --version 2>/dev/null || npm install -g taskgraph-ai
1498
-
1499
- # Verify installation
1500
- taskgraph --version
1501
-
1502
- # Quick setup check
1503
- taskgraph models || echo "Note: TaskGraph uses Claude Code; make sure it is installed and signed in"
1504
- \`\`\`
1505
-
1506
- If you see "command not found" after installation, you may need to:
1507
- 1. Restart your terminal
1508
- 2. Or add npm global bin to PATH: \`export PATH=$(npm bin -g):$PATH\`
1509
-
1510
- Once installed, you can use all the TaskGraph commands!
1511
-
1512
- Quick test: Run \`/taskgraph:help\` to see all available commands.`}),Be=z(`to-review`,`To Review`,`<task-id>`,`Set a task's status to review.
1513
-
1514
- Arguments: $ARGUMENTS (task ID)
1515
-
1516
- ## Marking Task for Review
1517
-
1518
- This status indicates work is complete but needs verification before final approval.
1519
-
1520
- ## When to Use Review Status
1521
-
1522
- - Code complete but needs peer review
1523
- - Implementation done but needs testing
1524
- - Documentation written but needs proofreading
1525
- - Design complete but needs stakeholder approval
1526
-
1527
- ## Execution
1528
-
1529
- \`\`\`bash
1530
- taskgraph set-status --id=$ARGUMENTS --status=review
1531
- \`\`\`
1532
-
1533
- ## Review Preparation
1534
-
1535
- When setting to review:
1536
- 1. **Generate Review Checklist**
1537
- - Link to PR/MR if applicable
1538
- - Highlight key changes
1539
- - Note areas needing attention
1540
- - Include test results
1541
-
1542
- 2. **Documentation**
1543
- - Update task with review notes
1544
- - Link relevant artifacts
1545
- - Specify reviewers if known
1546
-
1547
- 3. **Smart Actions**
1548
- - Create review reminders
1549
- - Track review duration
1550
- - Suggest reviewers based on expertise
1551
- - Prepare rollback plan if needed`),Ve=z(`to-deferred`,`To Deferred`,`<task-id>`,`Defer a task for later consideration.
1552
-
1553
- Arguments: $ARGUMENTS (task ID)
1554
-
1555
- ## Deferring a Task
1556
-
1557
- This status indicates a task is valid but not currently actionable or prioritized.
1558
-
1559
- ## Valid Reasons for Deferral
1560
-
1561
- - Waiting for external dependencies
1562
- - Reprioritized for future sprint
1563
- - Blocked by technical limitations
1564
- - Resource constraints
1565
- - Strategic timing considerations
1566
-
1567
- ## Execution
1568
-
1569
- \`\`\`bash
1570
- taskgraph set-status --id=$ARGUMENTS --status=deferred
1571
- \`\`\`
1572
-
1573
- ## Deferral Management
1574
-
1575
- When deferring:
1576
- 1. **Document Reason**
1577
- - Capture why it's being deferred
1578
- - Set reactivation criteria
1579
- - Note any partial work completed
1580
-
1581
- 2. **Impact Analysis**
1582
- - Check dependent tasks
1583
- - Update project timeline
1584
- - Notify affected stakeholders
1585
-
1586
- 3. **Future Planning**
1587
- - Set review reminders
1588
- - Tag for specific milestone
1589
- - Preserve context for reactivation
1590
- - Link to blocking issues
1591
-
1592
- ## Smart Tracking
1593
-
1594
- - Monitor deferral duration
1595
- - Alert when criteria met
1596
- - Prevent scope creep
1597
- - Regular review cycles`),He=z(`to-cancelled`,`To Cancelled`,`<task-id>`,`Cancel a task permanently.
1598
-
1599
- Arguments: $ARGUMENTS (task ID)
1600
-
1601
- ## Cancelling a Task
1602
-
1603
- This status indicates a task is no longer needed and won't be completed.
1604
-
1605
- ## Valid Reasons for Cancellation
1606
-
1607
- - Requirements changed
1608
- - Feature deprecated
1609
- - Duplicate of another task
1610
- - Strategic pivot
1611
- - Technical approach invalidated
1612
-
1613
- ## Pre-Cancellation Checks
1614
-
1615
- 1. Confirm no critical dependencies
1616
- 2. Check for partial implementation
1617
- 3. Verify cancellation rationale
1618
- 4. Document lessons learned
1619
-
1620
- ## Execution
1621
-
1622
- \`\`\`bash
1623
- taskgraph set-status --id=$ARGUMENTS --status=cancelled
1624
- \`\`\`
1625
-
1626
- ## Cancellation Impact
1627
-
1628
- When cancelling:
1629
- 1. **Dependency Updates**
1630
- - Notify dependent tasks
1631
- - Update project scope
1632
- - Recalculate timelines
1633
-
1634
- 2. **Clean-up Actions**
1635
- - Remove related branches
1636
- - Archive any work done
1637
- - Update documentation
1638
- - Close related issues
1639
-
1640
- 3. **Learning Capture**
1641
- - Document why cancelled
1642
- - Note what was learned
1643
- - Update estimation models
1644
- - Prevent future duplicates
1645
-
1646
- ## Historical Preservation
1647
-
1648
- - Keep for reference
1649
- - Tag with cancellation reason
1650
- - Link to replacement if any
1651
- - Maintain audit trail`),Ue=z(`init-project`,`Init Project`,`[prd-file]`,`Initialize a new TaskGraph project.
1652
-
1653
- Arguments: $ARGUMENTS
1654
-
1655
- Parse arguments to determine initialization preferences.
1656
-
1657
- ## Initialization Process
1658
-
1659
- 1. **Parse Arguments**
1660
- - PRD file path (if provided)
1661
- - Project name
1662
- - Auto-confirm flag (-y)
1663
-
1664
- 2. **Project Setup**
1665
- \`\`\`bash
1666
- taskgraph init
1667
- \`\`\`
1668
-
1669
- 3. **Smart Initialization**
1670
- - Detect existing project files
1671
- - Suggest project name from directory
1672
- - Check for git repository
1673
- - Verify AI provider configuration
1674
-
1675
- ## Configuration Options
1676
-
1677
- Based on arguments:
1678
- - \`quick\` / \`-y\` → Skip confirmations
1679
- - \`<file.md>\` → Use as PRD after init
1680
- - \`--name=<name>\` → Set project name
1681
- - \`--description=<desc>\` → Set description
1682
-
1683
- ## Post-Initialization
1684
-
1685
- After successful init:
1686
- 1. Show project structure created
1687
- 2. Verify AI models configured
1688
- 3. Suggest next steps:
1689
- - Parse PRD if available
1690
- - Configure AI providers
1691
- - Set up git hooks
1692
- - Create first tasks
1693
-
1694
- ## Integration
1695
-
1696
- If PRD file provided:
1697
- \`\`\`
1698
- /taskgraph:init my-prd.md
1699
- → Automatically runs parse-prd after init
1700
- \`\`\``),We=z(`init-project-quick`,`Init Project Quick`,`[prd-file]`,`Quick initialization with auto-confirmation.
1701
-
1702
- Arguments: $ARGUMENTS
1703
-
1704
- Initialize a TaskGraph project without prompts, accepting all defaults.
1705
-
1706
- ## Quick Setup
1707
-
1708
- \`\`\`bash
1709
- taskgraph init -y
1710
- \`\`\`
1711
-
1712
- ## What It Does
1713
-
1714
- 1. Creates \`.taskgraph/\` directory structure
1715
- 2. Initializes empty \`tasks.json\`
1716
- 3. Sets up default configuration
1717
- 4. Uses directory name as project name
1718
- 5. Skips all confirmation prompts
1719
-
1720
- ## Smart Defaults
1721
-
1722
- - Project name: Current directory name
1723
- - Description: "TaskGraph Project"
1724
- - Model config: Existing environment vars
1725
- - Task structure: Standard format
1726
-
1727
- ## Next Steps
1728
-
1729
- After quick init:
1730
- 1. Configure AI models if needed:
1731
- \`\`\`
1732
- /taskgraph:models/setup
1733
- \`\`\`
1734
-
1735
- 2. Parse PRD if available:
1736
- \`\`\`
1737
- /taskgraph:parse-prd <file>
1738
- \`\`\`
1739
-
1740
- 3. Or create first task:
1741
- \`\`\`
1742
- /taskgraph:add-task create initial setup
1743
- \`\`\`
1744
-
1745
- Perfect for rapid project setup!`);R({name:`generate-tasks`,description:`Generate Task Files`,content:`Generate individual task files from tasks.json.
1746
-
1747
- ## Task File Generation
1748
-
1749
- Creates separate markdown files for each task, perfect for AI agents or documentation.
1750
-
1751
- ## Execution
1752
-
1753
- \`\`\`bash
1754
- taskgraph generate
1755
- \`\`\`
1756
-
1757
- ## What It Creates
1758
-
1759
- For each task, generates a file like \`task_001.md\`:
1760
-
1761
- \`\`\`
1762
- Task ID: 1
1763
- Title: Implement user authentication
1764
- Status: pending
1765
- Priority: high
1766
- Dependencies: []
1767
- Created: 2024-01-15
1768
- Complexity: 7
1769
-
1770
- ## Description
1771
- Create a secure user authentication system with login, logout, and session management.
1772
-
1773
- ## Details
1774
- - Use JWT tokens for session management
1775
- - Implement secure password hashing
1776
- - Add remember me functionality
1777
- - Include password reset flow
1778
-
1779
- ## Test Strategy
1780
- - Unit tests for auth functions
1781
- - Integration tests for login flow
1782
- - Security testing for vulnerabilities
1783
- - Performance tests for concurrent logins
1784
-
1785
- ## Subtasks
1786
- 1.1 Setup authentication framework (pending)
1787
- 1.2 Create login endpoints (pending)
1788
- 1.3 Implement session management (pending)
1789
- 1.4 Add password reset (pending)
1790
- \`\`\`
1791
-
1792
- ## File Organization
1793
-
1794
- Creates structure:
1795
- \`\`\`
1796
- .taskgraph/
1797
- └── tasks/
1798
- ├── task_001.md
1799
- ├── task_002.md
1800
- ├── task_003.md
1801
- └── ...
1802
- \`\`\`
1803
-
1804
- ## Smart Features
1805
-
1806
- 1. **Consistent Formatting**
1807
- - Standardized structure
1808
- - Clear sections
1809
- - AI-readable format
1810
- - Markdown compatible
1811
-
1812
- 2. **Contextual Information**
1813
- - Full task details
1814
- - Related task references
1815
- - Progress indicators
1816
- - Implementation notes
1817
-
1818
- 3. **Incremental Updates**
1819
- - Only regenerate changed tasks
1820
- - Preserve custom additions
1821
- - Track generation timestamp
1822
- - Version control friendly
1823
-
1824
- ## Use Cases
1825
-
1826
- - **AI Context**: Provide task context to AI assistants
1827
- - **Documentation**: Standalone task documentation
1828
- - **Archival**: Task history preservation
1829
- - **Sharing**: Send specific tasks to team members
1830
- - **Review**: Easier task review process
1831
-
1832
- ## Post-Generation
1833
-
1834
- \`\`\`
1835
- Task File Generation Complete
1836
- ━━━━━━━━━━━━━━━━━━━━━━━━━━
1837
- Generated: 45 task files
1838
- Location: .taskgraph/tasks/
1839
- Total size: 156 KB
1840
-
1841
- New files: 5
1842
- Updated files: 12
1843
- Unchanged: 28
1844
-
1845
- Ready for:
1846
- - AI agent consumption
1847
- - Version control
1848
- - Team distribution
1849
- \`\`\`
1850
-
1851
- ## Integration Benefits
1852
-
1853
- - Git-trackable task history
1854
- - Easy task sharing
1855
- - AI tool compatibility
1856
- - Offline task access
1857
- - Backup redundancy`});const Ge=[ye,be,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie,Le,Re,ze,Be,Ve,He,Ue,We,z(`show-task`,`Show Task`,`<task-id>`,`Show detailed task information with rich context and insights.
1858
-
1859
- Arguments: $ARGUMENTS
1860
-
1861
- ## Enhanced Task Display
1862
-
1863
- Parse arguments to determine what to show and how.
1864
-
1865
- ### 1. **Smart Task Selection**
1866
-
1867
- Based on $ARGUMENTS:
1868
- - Number → Show specific task with full context
1869
- - "current" → Show active in-progress task(s)
1870
- - "next" → Show recommended next task
1871
- - "blocked" → Show all blocked tasks with reasons
1872
- - "critical" → Show critical path tasks
1873
- - Multiple IDs → Comparative view
1874
-
1875
- ### 2. **Contextual Information**
1876
-
1877
- For each task, intelligently include:
1878
-
1879
- **Core Details**
1880
- - Full task information (id, title, description, details)
1881
- - Current status with history
1882
- - Test strategy and acceptance criteria
1883
- - Priority and complexity analysis
1884
-
1885
- **Relationships**
1886
- - Dependencies (what it needs)
1887
- - Dependents (what needs it)
1888
- - Parent/subtask hierarchy
1889
- - Related tasks (similar work)
1890
-
1891
- **Time Intelligence**
1892
- - Created/updated timestamps
1893
- - Time in current status
1894
- - Estimated vs actual time
1895
- - Historical completion patterns
1896
-
1897
- ### 3. **Visual Enhancements**
1898
-
1899
- \`\`\`
1900
- 📋 Task #45: Implement User Authentication
1901
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1902
- Status: 🟡 in-progress (2 hours)
1903
- Priority: 🔴 High | Complexity: 73/100
1904
-
1905
- Dependencies: ✅ #41, ✅ #42, ⏳ #43 (blocked)
1906
- Blocks: #46, #47, #52
1907
-
1908
- Progress: ████████░░ 80% complete
1909
-
1910
- Recent Activity:
1911
- - 2h ago: Status changed to in-progress
1912
- - 4h ago: Dependency #42 completed
1913
- - Yesterday: Task expanded with 3 subtasks
1914
- \`\`\`
1915
-
1916
- ### 4. **Intelligent Insights**
1917
-
1918
- Based on task analysis:
1919
- - **Risk Assessment**: Complexity vs time remaining
1920
- - **Bottleneck Analysis**: Is this blocking critical work?
1921
- - **Recommendation**: Suggested approach or concerns
1922
- - **Similar Tasks**: How others completed similar work
1923
-
1924
- ### 5. **Action Suggestions**
1925
-
1926
- Context-aware next steps:
1927
- - If blocked → Show how to unblock
1928
- - If complex → Suggest expansion
1929
- - If in-progress → Show completion checklist
1930
- - If done → Show dependent tasks ready to start
1931
-
1932
- ### 6. **Multi-Task View**
1933
-
1934
- When showing multiple tasks:
1935
- - Common dependencies
1936
- - Optimal completion order
1937
- - Parallel work opportunities
1938
- - Combined complexity analysis`),z(`graph`,`Dependency Graph`,`[task-id]`,`Show the project's tasks as a dependency tree.
1939
-
1940
- Arguments: $ARGUMENTS
1941
-
1942
- 1. If the arguments contain a task ID, run \`taskgraph graph --id=<id>\` to show that task and everything that depends on it. Otherwise run \`taskgraph graph\`.
1943
- 2. Show the output unchanged in a code block.
1944
- 3. Then, in one or two sentences, point out what stands out: the task marked "← next", anything in progress, and any task listed as missing a dependency or stuck in a dependency loop, with the fix command the output suggests.`),z(`list-tasks`,`List Tasks`,`[filters]`,`List tasks with intelligent argument parsing.
1945
-
1946
- Parse arguments to determine filters and display options:
1947
- - Status: pending, in-progress, done, review, deferred, cancelled
1948
- - Priority: high, medium, low (or priority:high)
1949
- - Special: subtasks, tree, dependencies, blocked
1950
- - IDs: Direct numbers (e.g., "1,3,5" or "1-5")
1951
- - Complex: "pending high" = pending AND high priority
1952
-
1953
- Arguments: $ARGUMENTS
1954
-
1955
- Let me parse your request intelligently:
1956
-
1957
- 1. **Detect Filter Intent**
1958
- - If arguments contain status keywords → filter by status
1959
- - If arguments contain priority → filter by priority
1960
- - If arguments contain "subtasks" → include subtasks
1961
- - If arguments contain "tree" → hierarchical view
1962
- - If arguments contain numbers → show specific tasks
1963
- - If arguments contain "blocked" → show blocked tasks only
1964
-
1965
- 2. **Smart Combinations**
1966
- Examples of what I understand:
1967
- - "pending high" → pending tasks with high priority
1968
- - "done today" → tasks completed today
1969
- - "blocked" → tasks with unmet dependencies
1970
- - "1-5" → tasks 1 through 5
1971
- - "subtasks tree" → hierarchical view with subtasks
1972
-
1973
- 3. **Execute Appropriate Query**
1974
- Based on parsed intent, run the most specific taskgraph command
1975
-
1976
- 4. **Enhanced Display**
1977
- - Group by relevant criteria
1978
- - Show most important information first
1979
- - Use visual indicators for quick scanning
1980
- - Include relevant metrics
1981
-
1982
- 5. **Intelligent Suggestions**
1983
- Based on what you're viewing, suggest next actions:
1984
- - Many pending? → Suggest priority order
1985
- - Many blocked? → Show dependency resolution
1986
- - Looking at specific tasks? → Show related tasks`),R({name:`list-tasks-with-subtasks`,description:`List Tasks With Subtasks`,content:`List all tasks including their subtasks in a hierarchical view.
1987
-
1988
- This command shows all tasks with their nested subtasks, providing a complete project overview.
1989
-
1990
- ## Execution
1991
-
1992
- Run the TaskGraph list command with subtasks flag:
1993
- \`\`\`bash
1994
- taskgraph list --with-subtasks
1995
- \`\`\`
1996
-
1997
- ## Enhanced Display
1998
-
1999
- I'll organize the output to show:
2000
- - Parent tasks with clear indicators
2001
- - Nested subtasks with proper indentation
2002
- - Status badges for quick scanning
2003
- - Dependencies and blockers highlighted
2004
- - Progress indicators for tasks with subtasks
2005
-
2006
- ## Smart Filtering
2007
-
2008
- Based on the task hierarchy:
2009
- - Show completion percentage for parent tasks
2010
- - Highlight blocked subtask chains
2011
- - Group by functional areas
2012
- - Indicate critical path items
2013
-
2014
- This gives you a complete tree view of your project structure.`}),z(`list-tasks-by-status`,`List Tasks By Status`,`<status>`,`List tasks filtered by a specific status.
2015
-
2016
- Arguments: $ARGUMENTS
2017
-
2018
- Parse the status from arguments and list only tasks matching that status.
2019
-
2020
- ## Status Options
2021
- - \`pending\` - Not yet started
2022
- - \`in-progress\` - Currently being worked on
2023
- - \`done\` - Completed
2024
- - \`review\` - Awaiting review
2025
- - \`deferred\` - Postponed
2026
- - \`cancelled\` - Cancelled
2027
-
2028
- ## Execution
2029
-
2030
- Based on $ARGUMENTS, run:
2031
- \`\`\`bash
2032
- taskgraph list --status=$ARGUMENTS
2033
- \`\`\`
2034
-
2035
- ## Enhanced Display
2036
-
2037
- For the filtered results:
2038
- - Group by priority within the status
2039
- - Show time in current status
2040
- - Highlight tasks approaching deadlines
2041
- - Display blockers and dependencies
2042
- - Suggest next actions for each status group
2043
-
2044
- ## Intelligent Insights
2045
-
2046
- Based on the status filter:
2047
- - **Pending**: Show recommended start order
2048
- - **In-Progress**: Display idle time warnings
2049
- - **Done**: Show newly unblocked tasks
2050
- - **Review**: Indicate review duration
2051
- - **Deferred**: Show reactivation criteria
2052
- - **Cancelled**: Display impact analysis`),z(`project-status`,`Project Status`,`[focus-area]`,`Enhanced status command with comprehensive project insights.
2053
-
2054
- Arguments: $ARGUMENTS
2055
-
2056
- ## Intelligent Status Overview
2057
-
2058
- ### 1. **Executive Summary**
2059
- Quick dashboard view:
2060
- - 🏃 Active work (in-progress tasks)
2061
- - 📊 Progress metrics (% complete, velocity)
2062
- - 🚧 Blockers and risks
2063
- - ⏱️ Time analysis (estimated vs actual)
2064
- - 🎯 Sprint/milestone progress
2065
-
2066
- ### 2. **Contextual Analysis**
2067
-
2068
- Based on $ARGUMENTS, focus on:
2069
- - "sprint" → Current sprint progress and burndown
2070
- - "blocked" → Dependency chains and resolution paths
2071
- - "team" → Task distribution and workload
2072
- - "timeline" → Schedule adherence and projections
2073
- - "risk" → High complexity or overdue items
2074
-
2075
- ### 3. **Smart Insights**
2076
-
2077
- **Workflow Health:**
2078
- - Idle tasks (in-progress > 24h without updates)
2079
- - Bottlenecks (multiple tasks waiting on same dependency)
2080
- - Quick wins (low complexity, high impact)
2081
-
2082
- **Predictive Analytics:**
2083
- - Completion projections based on velocity
2084
- - Risk of missing deadlines
2085
- - Recommended task order for optimal flow
2086
-
2087
- ### 4. **Visual Intelligence**
2088
-
2089
- Dynamic visualization based on data:
2090
- \`\`\`
2091
- Sprint Progress: ████████░░ 80% (16/20 tasks)
2092
- Velocity Trend: ↗️ +15% this week
2093
- Blocked Tasks: 🔴 3 critical path items
2094
-
2095
- Priority Distribution:
2096
- High: ████████ 8 tasks (2 blocked)
2097
- Medium: ████░░░░ 4 tasks
2098
- Low: ██░░░░░░ 2 tasks
2099
- \`\`\`
2100
-
2101
- ### 5. **Actionable Recommendations**
2102
-
2103
- Based on analysis:
2104
- 1. **Immediate actions** (unblock critical path)
2105
- 2. **Today's focus** (optimal task sequence)
2106
- 3. **Process improvements** (recurring patterns)
2107
- 4. **Resource needs** (skills, time, dependencies)
2108
-
2109
- ### 6. **Historical Context**
2110
-
2111
- Compare to previous periods:
2112
- - Velocity changes
2113
- - Pattern recognition
2114
- - Improvement areas
2115
- - Success patterns to repeat`),z(`next-task`,`Next Task`,`[preference]`,`Intelligently determine and prepare the next action based on comprehensive context.
2116
-
2117
- This enhanced version of 'next' considers:
2118
- - Current task states
2119
- - Recent activity
2120
- - Time constraints
2121
- - Dependencies
2122
- - Your working patterns
2123
-
2124
- Arguments: $ARGUMENTS
2125
-
2126
- ## Intelligent Next Action
2127
-
2128
- ### 1. **Context Gathering**
2129
- Let me analyze the current situation:
2130
- - Active tasks (in-progress)
2131
- - Recently completed tasks
2132
- - Blocked tasks
2133
- - Time since last activity
2134
- - Arguments provided: $ARGUMENTS
2135
-
2136
- ### 2. **Smart Decision Tree**
2137
-
2138
- **If you have an in-progress task:**
2139
- - Has it been idle > 2 hours? → Suggest resuming or switching
2140
- - Near completion? → Show remaining steps
2141
- - Blocked? → Find alternative task
2142
-
2143
- **If no in-progress tasks:**
2144
- - Unblocked high-priority tasks? → Start highest
2145
- - Complex tasks need breakdown? → Suggest expansion
2146
- - All tasks blocked? → Show dependency resolution
2147
-
2148
- **Special arguments handling:**
2149
- - "quick" → Find task < 2 hours
2150
- - "easy" → Find low complexity task
2151
- - "important" → Find high priority regardless of complexity
2152
- - "continue" → Resume last worked task
2153
-
2154
- ### 3. **Preparation Workflow**
2155
-
2156
- Based on selected task:
2157
- 1. Show full context and history
2158
- 2. Set up development environment
2159
- 3. Run relevant tests
2160
- 4. Open related files
2161
- 5. Show similar completed tasks
2162
- 6. Estimate completion time
2163
-
2164
- ### 4. **Alternative Suggestions**
2165
-
2166
- Always provide options:
2167
- - Primary recommendation
2168
- - Quick alternative (< 1 hour)
2169
- - Strategic option (unblocks most tasks)
2170
- - Learning option (new technology/skill)
2171
-
2172
- ### 5. **Workflow Integration**
2173
-
2174
- Seamlessly connect to:
2175
- - \`/project:taskgraph:start [selected]\`
2176
- - \`/project:workflows:auto-implement\`
2177
- - \`/project:taskgraph:expand\` (if complex)
2178
- - \`/project:utils:complexity-report\` (if unsure)
2179
-
2180
- The goal: Zero friction from decision to implementation.`),z(`help`,`Help`,`[command-name]`,"Show help for TaskGraph commands.\n\nArguments: $ARGUMENTS\n\nDisplay help for TaskGraph commands and available options.\n\n## TaskGraph Command Help\n\n### Quick Navigation\n\nType `/taskgraph:` and use tab completion to explore all commands.\n\n### Command Categories\n\n#### 🚀 Setup & Installation\n- `/taskgraph:install-taskgraph` - Comprehensive installation guide\n- `/taskgraph:quick-install-taskgraph` - One-line global install\n\n#### 📋 Project Setup\n- `/taskgraph:init-project` - Initialize new project\n- `/taskgraph:init-project-quick` - Quick setup with auto-confirm\n- `/taskgraph:view-models` - View AI configuration\n- `/taskgraph:setup-models` - Configure AI providers\n\n#### 🎯 Task Generation\n- `/taskgraph:parse-prd` - Generate tasks from PRD\n- `/taskgraph:parse-prd-with-research` - Enhanced parsing\n- `/taskgraph:generate-tasks` - Create task files\n\n#### 📝 Task Management\n- `/taskgraph:list-tasks` - List all tasks\n- `/taskgraph:list-tasks-by-status` - List tasks filtered by status\n- `/taskgraph:list-tasks-with-subtasks` - List tasks with subtasks\n- `/taskgraph:graph` - Show tasks as a dependency tree\n- `/taskgraph:show-task` - Display task details\n- `/taskgraph:add-task` - Create new task\n- `/taskgraph:update-task` - Update single task\n- `/taskgraph:update-tasks-from-id` - Update multiple tasks\n- `/taskgraph:next-task` - Get next task recommendation\n\n#### 🔄 Status Management\n- `/taskgraph:to-pending` - Set task to pending\n- `/taskgraph:to-in-progress` - Set task to in-progress\n- `/taskgraph:to-done` - Set task to done\n- `/taskgraph:to-review` - Set task to review\n- `/taskgraph:to-deferred` - Set task to deferred\n- `/taskgraph:to-cancelled` - Set task to cancelled\n\n#### 🔍 Analysis & Breakdown\n- `/taskgraph:analyze-complexity` - Analyze task complexity\n- `/taskgraph:complexity-report` - View complexity report\n- `/taskgraph:expand-task` - Break down complex task\n- `/taskgraph:expand-all-tasks` - Expand all eligible tasks\n\n#### 🔗 Dependencies\n- `/taskgraph:add-dependency` - Add task dependency\n- `/taskgraph:remove-dependency` - Remove dependency\n- `/taskgraph:validate-dependencies` - Check for issues\n- `/taskgraph:fix-dependencies` - Auto-fix dependency issues\n\n#### 📦 Subtasks\n- `/taskgraph:add-subtask` - Add subtask to task\n- `/taskgraph:convert-task-to-subtask` - Convert task to subtask\n- `/taskgraph:remove-subtask` - Remove subtask\n- `/taskgraph:remove-subtasks` - Clear specific task subtasks\n- `/taskgraph:remove-all-subtasks` - Clear all subtasks\n\n#### 🗑️ Task Removal\n- `/taskgraph:remove-task` - Remove task permanently\n\n#### 🤖 Workflows\n- `/taskgraph:smart-workflow` - Intelligent workflows\n- `/taskgraph:command-pipeline` - Command chaining\n- `/taskgraph:auto-implement-tasks` - Auto-implementation\n\n#### 📊 Utilities\n- `/taskgraph:analyze-project` - Project analysis\n- `/taskgraph:project-status` - Project dashboard\n- `/taskgraph:sync-readme` - Sync README with tasks\n- `/taskgraph:learn` - Interactive learning\n- `/taskgraph:tm-main` - Main TaskGraph interface\n\n### Quick Start Examples\n\n```\n/taskgraph:list-tasks\n/taskgraph:show-task 1.2\n/taskgraph:add-task\n/taskgraph:next-task\n```\n\n### Getting Started\n\n1. Install: `/taskgraph:quick-install-taskgraph`\n2. Initialize: `/taskgraph:init-project-quick`\n3. Learn: `/taskgraph:learn`\n4. Work: `/taskgraph:smart-workflow`\n\nFor detailed command info, run the specific command with `--help` or check command documentation."),z(`to-done`,`To Done`,`<task-id>`,`Mark a task as completed.
2181
-
2182
- Arguments: $ARGUMENTS (task ID)
2183
-
2184
- ## Completing a Task
2185
-
2186
- This command validates task completion and updates project state intelligently.
2187
-
2188
- ## Pre-Completion Checks
2189
-
2190
- 1. Verify test strategy was followed
2191
- 2. Check if all subtasks are complete
2192
- 3. Validate acceptance criteria met
2193
- 4. Ensure code is committed
2194
-
2195
- ## Execution
2196
-
2197
- \`\`\`bash
2198
- taskgraph set-status --id=$ARGUMENTS --status=done
2199
- \`\`\`
2200
-
2201
- ## Post-Completion Actions
2202
-
2203
- 1. **Update Dependencies**
2204
- - Identify newly unblocked tasks
2205
- - Update sprint progress
2206
- - Recalculate project timeline
2207
-
2208
- 2. **Documentation**
2209
- - Generate completion summary
2210
- - Update CLAUDE.md with learnings
2211
- - Log implementation approach
2212
-
2213
- 3. **Next Steps**
2214
- - Show newly available tasks
2215
- - Suggest logical next task
2216
- - Update velocity metrics
2217
-
2218
- ## Celebration & Learning
2219
-
2220
- - Show impact of completion
2221
- - Display unblocked work
2222
- - Recognize achievement
2223
- - Capture lessons learned`),z(`to-pending`,`To Pending`,`<task-id>`,`Set a task's status to pending.
2224
-
2225
- Arguments: $ARGUMENTS (task ID)
2226
-
2227
- ## Setting Task to Pending
2228
-
2229
- This moves a task back to the pending state, useful for:
2230
- - Resetting erroneously started tasks
2231
- - Deferring work that was prematurely begun
2232
- - Reorganizing sprint priorities
2233
-
2234
- ## Execution
2235
-
2236
- \`\`\`bash
2237
- taskgraph set-status --id=$ARGUMENTS --status=pending
2238
- \`\`\`
2239
-
2240
- ## Validation
2241
-
2242
- Before setting to pending:
2243
- - Warn if task is currently in-progress
2244
- - Check if this will block other tasks
2245
- - Suggest documenting why it's being reset
2246
- - Preserve any work already done
2247
-
2248
- ## Smart Actions
2249
-
2250
- After setting to pending:
2251
- - Update sprint planning if needed
2252
- - Notify about freed resources
2253
- - Suggest priority reassessment
2254
- - Log the status change with context`),z(`to-in-progress`,`To In Progress`,`<task-id>`,`Start working on a task by setting its status to in-progress.
2255
-
2256
- Arguments: $ARGUMENTS (task ID)
2257
-
2258
- ## Starting Work on Task
2259
-
2260
- This command does more than just change status - it prepares your environment for productive work.
2261
-
2262
- ## Pre-Start Checks
2263
-
2264
- 1. Verify dependencies are met
2265
- 2. Check if another task is already in-progress
2266
- 3. Ensure task details are complete
2267
- 4. Validate test strategy exists
2268
-
2269
- ## Execution
2270
-
2271
- \`\`\`bash
2272
- taskgraph set-status --id=$ARGUMENTS --status=in-progress
2273
- \`\`\`
2274
-
2275
- ## Environment Setup
2276
-
2277
- After setting to in-progress:
2278
- 1. Create/checkout appropriate git branch
2279
- 2. Open relevant documentation
2280
- 3. Set up test watchers if applicable
2281
- 4. Display task details and acceptance criteria
2282
- 5. Show similar completed tasks for reference
2283
-
2284
- ## Smart Suggestions
2285
-
2286
- - Estimated completion time based on complexity
2287
- - Related files from similar tasks
2288
- - Potential blockers to watch for
2289
- - Recommended first steps`),z(`update-task`,`Update Task`,`<update-spec>`,`Update tasks with intelligent field detection and bulk operations.
2290
-
2291
- Arguments: $ARGUMENTS
2292
-
2293
- ## Intelligent Task Updates
2294
-
2295
- Parse arguments to determine update intent and execute smartly.
2296
-
2297
- ### 1. **Natural Language Processing**
2298
-
2299
- Understand update requests like:
2300
- - "mark 23 as done" → Update status to done
2301
- - "increase priority of 45" → Set priority to high
2302
- - "add dependency on 12 to task 34" → Add dependency
2303
- - "tasks 20-25 need review" → Bulk status update
2304
- - "all API tasks high priority" → Pattern-based update
2305
-
2306
- ### 2. **Smart Field Detection**
2307
-
2308
- Automatically detect what to update:
2309
- - Status keywords: done, complete, start, pause, review
2310
- - Priority changes: urgent, high, low, deprioritize
2311
- - Dependency updates: depends on, blocks, after
2312
- - Assignment: assign to, owner, responsible
2313
- - Time: estimate, spent, deadline
2314
-
2315
- ### 3. **Bulk Operations**
2316
-
2317
- Support for multiple task updates:
2318
- \`\`\`
2319
- Examples:
2320
- - "complete tasks 12, 15, 18"
2321
- - "all pending auth tasks to in-progress"
2322
- - "increase priority for tasks blocking 45"
2323
- - "defer all documentation tasks"
2324
- \`\`\`
2325
-
2326
- ### 4. **Contextual Validation**
2327
-
2328
- Before updating, check:
2329
- - Status transitions are valid
2330
- - Dependencies don't create cycles
2331
- - Priority changes make sense
2332
- - Bulk updates won't break project flow
2333
-
2334
- Show preview:
2335
- \`\`\`
2336
- Update Preview:
2337
- ─────────────────
2338
- Tasks to update: #23, #24, #25
2339
- Change: status → in-progress
2340
- Impact: Will unblock tasks #30, #31
2341
- Warning: Task #24 has unmet dependencies
2342
- \`\`\`
2343
-
2344
- ### 5. **Smart Suggestions**
2345
-
2346
- Based on update:
2347
- - Completing task? → Show newly unblocked tasks
2348
- - Changing priority? → Show impact on sprint
2349
- - Adding dependency? → Check for conflicts
2350
- - Bulk update? → Show summary of changes
2351
-
2352
- ### 6. **Workflow Integration**
2353
-
2354
- After updates:
2355
- - Auto-update dependent task states
2356
- - Trigger status recalculation
2357
- - Update sprint/milestone progress
2358
- - Log changes with context
2359
-
2360
- Result: Flexible, intelligent task updates with safety checks.`),z(`update-single-task`,`Update Single Task`,`<task-id> <changes>`,`Update a single specific task with new information.
2361
-
2362
- Arguments: $ARGUMENTS
2363
-
2364
- Parse task ID and update details.
2365
-
2366
- ## Single Task Update
2367
-
2368
- Precisely update one task with AI assistance to maintain consistency.
2369
-
2370
- ## Argument Parsing
2371
-
2372
- Natural language updates:
2373
- - "5: add caching requirement"
2374
- - "update 5 to include error handling"
2375
- - "task 5 needs rate limiting"
2376
- - "5 change priority to high"
2377
-
2378
- ## Execution
2379
-
2380
- \`\`\`bash
2381
- taskgraph update-task --id=<id> --prompt="<context>"
2382
- \`\`\`
2383
-
2384
- ## Update Types
2385
-
2386
- ### 1. **Content Updates**
2387
- - Enhance description
2388
- - Add requirements
2389
- - Clarify details
2390
- - Update acceptance criteria
2391
-
2392
- ### 2. **Metadata Updates**
2393
- - Change priority
2394
- - Adjust time estimates
2395
- - Update complexity
2396
- - Modify dependencies
2397
-
2398
- ### 3. **Strategic Updates**
2399
- - Revise approach
2400
- - Change test strategy
2401
- - Update implementation notes
2402
- - Adjust subtask needs
2403
-
2404
- ## AI-Powered Updates
2405
-
2406
- The AI:
2407
- 1. **Understands Context**
2408
- - Reads current task state
2409
- - Identifies update intent
2410
- - Maintains consistency
2411
- - Preserves important info
2412
-
2413
- 2. **Applies Changes**
2414
- - Updates relevant fields
2415
- - Keeps style consistent
2416
- - Adds without removing
2417
- - Enhances clarity
2418
-
2419
- 3. **Validates Results**
2420
- - Checks coherence
2421
- - Verifies completeness
2422
- - Maintains relationships
2423
- - Suggests related updates
2424
-
2425
- ## Example Updates
2426
-
2427
- \`\`\`
2428
- /taskgraph:update/single 5: add rate limiting
2429
- → Updating Task #5: "Implement API endpoints"
2430
-
2431
- Current: Basic CRUD endpoints
2432
- Adding: Rate limiting requirements
2433
-
2434
- Updated sections:
2435
- ✓ Description: Added rate limiting mention
2436
- ✓ Details: Added specific limits (100/min)
2437
- ✓ Test Strategy: Added rate limit tests
2438
- ✓ Complexity: Increased from 5 to 6
2439
- ✓ Time Estimate: Increased by 2 hours
2440
-
2441
- Suggestion: Also update task #6 (API Gateway) for consistency?
2442
- \`\`\`
2443
-
2444
- ## Smart Features
2445
-
2446
- 1. **Incremental Updates**
2447
- - Adds without overwriting
2448
- - Preserves work history
2449
- - Tracks what changed
2450
- - Shows diff view
2451
-
2452
- 2. **Consistency Checks**
2453
- - Related task alignment
2454
- - Subtask compatibility
2455
- - Dependency validity
2456
- - Timeline impact
2457
-
2458
- 3. **Update History**
2459
- - Timestamp changes
2460
- - Track who/what updated
2461
- - Reason for update
2462
- - Previous versions
2463
-
2464
- ## Field-Specific Updates
2465
-
2466
- Quick syntax for specific fields:
2467
- - "5 priority:high" → Update priority only
2468
- - "5 add-time:4h" → Add to time estimate
2469
- - "5 status:review" → Change status
2470
- - "5 depends:3,4" → Add dependencies
2471
-
2472
- ## Post-Update
2473
-
2474
- - Show updated task
2475
- - Highlight changes
2476
- - Check related tasks
2477
- - Update suggestions
2478
- - Timeline adjustments`),z(`update-tasks-from-id`,`Update Tasks From ID`,`<from-id> <changes>`,`Update multiple tasks starting from a specific ID.
2479
-
2480
- Arguments: $ARGUMENTS
2481
-
2482
- Parse starting task ID and update context.
2483
-
2484
- ## Bulk Task Updates
2485
-
2486
- Update multiple related tasks based on new requirements or context changes.
2487
-
2488
- ## Argument Parsing
2489
-
2490
- - "from 5: add security requirements"
2491
- - "5 onwards: update API endpoints"
2492
- - "starting at 5: change to use new framework"
2493
-
2494
- ## Execution
2495
-
2496
- \`\`\`bash
2497
- taskgraph update --from=<id> --prompt="<context>"
2498
- \`\`\`
2499
-
2500
- ## Update Process
2501
-
2502
- ### 1. **Task Selection**
2503
- Starting from specified ID:
2504
- - Include the task itself
2505
- - Include all dependent tasks
2506
- - Include related subtasks
2507
- - Smart boundary detection
2508
-
2509
- ### 2. **Context Application**
2510
- AI analyzes the update context and:
2511
- - Identifies what needs changing
2512
- - Maintains consistency
2513
- - Preserves completed work
2514
- - Updates related information
2515
-
2516
- ### 3. **Intelligent Updates**
2517
- - Modify descriptions appropriately
2518
- - Update test strategies
2519
- - Adjust time estimates
2520
- - Revise dependencies if needed
2521
-
2522
- ## Smart Features
2523
-
2524
- 1. **Scope Detection**
2525
- - Find natural task groupings
2526
- - Identify related features
2527
- - Stop at logical boundaries
2528
- - Avoid over-updating
2529
-
2530
- 2. **Consistency Maintenance**
2531
- - Keep naming conventions
2532
- - Preserve relationships
2533
- - Update cross-references
2534
- - Maintain task flow
2535
-
2536
- 3. **Change Preview**
2537
- \`\`\`
2538
- Bulk Update Preview
2539
- ━━━━━━━━━━━━━━━━━━
2540
- Starting from: Task #5
2541
- Tasks to update: 8 tasks + 12 subtasks
2542
-
2543
- Context: "add security requirements"
2544
-
2545
- Changes will include:
2546
- - Add security sections to descriptions
2547
- - Update test strategies for security
2548
- - Add security-related subtasks where needed
2549
- - Adjust time estimates (+20% average)
2550
-
2551
- Continue? (y/n)
2552
- \`\`\`
2553
-
2554
- ## Example Updates
2555
-
2556
- \`\`\`
2557
- /taskgraph:update-tasks-from-id 5: change database to PostgreSQL
2558
- → Analyzing impact starting from task #5
2559
- → Found 6 related tasks to update
2560
- → Updates will maintain consistency
2561
- → Preview changes? (y/n)
2562
-
2563
- Applied updates:
2564
- ✓ Task #5: Updated connection logic references
2565
- ✓ Task #6: Changed migration approach
2566
- ✓ Task #7: Updated query syntax notes
2567
- ✓ Task #8: Revised testing strategy
2568
- ✓ Task #9: Updated deployment steps
2569
- ✓ Task #12: Changed backup procedures
2570
- \`\`\`
2571
-
2572
- ## Safety Features
2573
-
2574
- - Preview all changes
2575
- - Selective confirmation
2576
- - Rollback capability
2577
- - Change logging
2578
- - Validation checks
2579
-
2580
- ## Post-Update
2581
-
2582
- - Summary of changes
2583
- - Consistency verification
2584
- - Suggest review tasks
2585
- - Update timeline if needed`),R({name:`tm-main`,description:`TaskGraph Main`,content:"# TaskGraph Command Reference\n\nComprehensive command structure for TaskGraph integration with Claude Code.\n\n## Command Organization\n\nCommands are organized hierarchically to match TaskGraph's CLI structure while providing enhanced Claude Code integration.\n\n## Project Setup & Configuration\n\n### `/taskgraph:init`\n- `init-project` - Initialize new project (handles PRD files intelligently)\n- `init-project-quick` - Quick setup with auto-confirmation (-y flag)\n\n### `/taskgraph:models`\n- `view-models` - View current AI model configuration\n- `setup-models` - Interactive model configuration\n- `set-main` - Set primary generation model\n- `set-research` - Set research model\n- `set-fallback` - Set fallback model\n\n## Task Generation\n\n### `/taskgraph:parse-prd`\n- `parse-prd` - Generate tasks from PRD document\n- `parse-prd-with-research` - Enhanced parsing with research mode\n\n### `/taskgraph:generate`\n- `generate-tasks` - Create individual task files from tasks.json\n\n## Task Management\n\n### `/taskgraph:list`\n- `list-tasks` - Smart listing with natural language filters\n- `list-tasks-with-subtasks` - Include subtasks in hierarchical view\n- `list-tasks-by-status` - Filter by specific status\n- `graph` - Dependency tree with the next task marked\n\n### `/taskgraph:set-status`\n- `to-pending` - Reset task to pending\n- `to-in-progress` - Start working on task\n- `to-done` - Mark task complete\n- `to-review` - Submit for review\n- `to-deferred` - Defer task\n- `to-cancelled` - Cancel task\n\n### `/taskgraph:sync-readme`\n- `sync-readme` - Export tasks to README.md with formatting\n\n### `/taskgraph:update`\n- `update-task` - Update tasks with natural language\n- `update-tasks-from-id` - Update multiple tasks from a starting point\n- `update-single-task` - Update specific task\n\n### `/taskgraph:add-task`\n- `add-task` - Add new task with AI assistance\n\n### `/taskgraph:remove-task`\n- `remove-task` - Remove task with confirmation\n\n## Subtask Management\n\n### `/taskgraph:add-subtask`\n- `add-subtask` - Add new subtask to parent\n- `convert-task-to-subtask` - Convert existing task to subtask\n\n### `/taskgraph:remove-subtask`\n- `remove-subtask` - Remove subtask (with optional conversion)\n\n### `/taskgraph:clear-subtasks`\n- `clear-subtasks` - Clear subtasks from specific task\n- `clear-all-subtasks` - Clear all subtasks globally\n\n## Task Analysis & Breakdown\n\n### `/taskgraph:analyze-complexity`\n- `analyze-complexity` - Analyze and generate expansion recommendations\n\n### `/taskgraph:complexity-report`\n- `complexity-report` - Display complexity analysis report\n\n### `/taskgraph:expand`\n- `expand-task` - Break down specific task\n- `expand-all-tasks` - Expand all eligible tasks\n- `with-research` - Enhanced expansion\n\n## Task Navigation\n\n### `/taskgraph:next`\n- `next-task` - Intelligent next task recommendation\n\n### `/taskgraph:show`\n- `show-task` - Display detailed task information\n\n### `/taskgraph:status`\n- `project-status` - Comprehensive project dashboard\n\n## Dependency Management\n\n### `/taskgraph:add-dependency`\n- `add-dependency` - Add task dependency\n\n### `/taskgraph:remove-dependency`\n- `remove-dependency` - Remove task dependency\n\n### `/taskgraph:validate-dependencies`\n- `validate-dependencies` - Check for dependency issues\n\n### `/taskgraph:fix-dependencies`\n- `fix-dependencies` - Automatically fix dependency problems\n\n## Workflows & Automation\n\n### `/taskgraph:workflows`\n- `smart-workflow` - Context-aware intelligent workflow execution\n- `command-pipeline` - Chain multiple commands together\n- `auto-implement-tasks` - Advanced auto-implementation with code generation\n\n## Utilities\n\n### `/taskgraph:utils`\n- `analyze-project` - Deep project analysis and insights\n\n### `/taskgraph:setup`\n- `install-taskgraph` - Comprehensive installation guide\n- `quick-install-taskgraph` - One-line global installation\n\n## Usage Patterns\n\n### Natural Language\nMost commands accept natural language arguments:\n```\n/taskgraph:add-task create user authentication system\n/taskgraph:update mark all API tasks as high priority\n/taskgraph:list show blocked tasks\n```\n\n### ID-Based Commands\nCommands requiring IDs intelligently parse from $ARGUMENTS:\n```\n/taskgraph:show 45\n/taskgraph:expand 23\n/taskgraph:set-status/to-done 67\n```\n\n### Smart Defaults\nCommands provide intelligent defaults and suggestions based on context."}),z(`smart-workflow`,`Smart Workflow`,`[context]`,`Execute an intelligent workflow based on current project state and recent commands.
2586
-
2587
- This command analyzes:
2588
- 1. Recent commands you've run
2589
- 2. Current project state
2590
- 3. Time of day / day of week
2591
- 4. Your working patterns
2592
-
2593
- Arguments: $ARGUMENTS
2594
-
2595
- ## Intelligent Workflow Selection
2596
-
2597
- Based on context, I'll determine the best workflow:
2598
-
2599
- ### Context Analysis
2600
- - Previous command executed
2601
- - Current task states
2602
- - Unfinished work from last session
2603
- - Your typical patterns
2604
-
2605
- ### Smart Execution
2606
-
2607
- If last command was:
2608
- - \`status\` → Likely starting work → Run daily standup
2609
- - \`complete\` → Task finished → Find next task
2610
- - \`list pending\` → Planning → Suggest sprint planning
2611
- - \`expand\` → Breaking down work → Show complexity analysis
2612
- - \`init\` → New project → Show onboarding workflow
2613
-
2614
- If no recent commands:
2615
- - Morning? → Daily standup workflow
2616
- - Many pending tasks? → Sprint planning
2617
- - Tasks blocked? → Dependency resolution
2618
- - Friday? → Weekly review
2619
-
2620
- ### Workflow Composition
2621
-
2622
- I'll chain appropriate commands:
2623
- 1. Analyze current state
2624
- 2. Execute primary workflow
2625
- 3. Suggest follow-up actions
2626
- 4. Prepare environment for coding
2627
-
2628
- ### Learning Mode
2629
-
2630
- This command learns from your patterns:
2631
- - Track command sequences
2632
- - Note time preferences
2633
- - Remember common workflows
2634
- - Adapt to your style
2635
-
2636
- Example flows detected:
2637
- - Morning: standup → next → start
2638
- - After lunch: status → continue task
2639
- - End of day: complete → commit → status`),z(`learn`,`Learn`,`[topic]`,`Learn about TaskGraph capabilities through interactive exploration.
2640
-
2641
- Arguments: $ARGUMENTS
2642
-
2643
- ## Interactive TaskGraph Learning
2644
-
2645
- Based on your input, I'll help you discover capabilities:
2646
-
2647
- ### 1. **What are you trying to do?**
2648
-
2649
- If $ARGUMENTS contains:
2650
- - "start" / "begin" → Show project initialization workflows
2651
- - "manage" / "organize" → Show task management commands
2652
- - "automate" / "auto" → Show automation workflows
2653
- - "analyze" / "report" → Show analysis tools
2654
- - "fix" / "problem" → Show troubleshooting commands
2655
- - "fast" / "quick" → Show efficiency shortcuts
2656
-
2657
- ### 2. **Intelligent Suggestions**
2658
-
2659
- Based on your project state:
2660
-
2661
- **No tasks yet?**
2662
- \`\`\`
2663
- You'll want to start with:
2664
- 1. /project:taskgraph:init <prd-file>
2665
- → Creates tasks from requirements
2666
-
2667
- 2. /project:taskgraph:parse-prd <file>
2668
- → Alternative task generation
2669
-
2670
- Try: /project:taskgraph:init demo-prd.md
2671
- \`\`\`
2672
-
2673
- **Have tasks?**
2674
- Let me analyze what you might need...
2675
- - Many pending tasks? → Learn sprint planning
2676
- - Complex tasks? → Learn task expansion
2677
- - Daily work? → Learn workflow automation
2678
-
2679
- ### 3. **Command Discovery**
2680
-
2681
- **By Category:**
2682
- - 📋 Task Management: list, show, add, update, complete
2683
- - 🔄 Workflows: auto-implement, sprint-plan, daily-standup
2684
- - 🛠️ Utilities: check-health, complexity-report, sync-memory
2685
- - 🔍 Analysis: validate-deps, show dependencies
2686
-
2687
- **By Scenario:**
2688
- - "I want to see what to work on" → \`/project:taskgraph:next\`
2689
- - "I need to break this down" → \`/project:taskgraph:expand <id>\`
2690
- - "Show me everything" → \`/project:taskgraph:status\`
2691
- - "Just do it for me" → \`/project:workflows:auto-implement\`
2692
-
2693
- ### 4. **Power User Patterns**
2694
-
2695
- **Command Chaining:**
2696
- \`\`\`
2697
- /project:taskgraph:next
2698
- /project:taskgraph:start <id>
2699
- /project:workflows:auto-implement
2700
- \`\`\`
2701
-
2702
- **Smart Filters:**
2703
- \`\`\`
2704
- /project:taskgraph:list pending high
2705
- /project:taskgraph:list blocked
2706
- /project:taskgraph:list 1-5 tree
2707
- \`\`\`
2708
-
2709
- **Automation:**
2710
- \`\`\`
2711
- /project:workflows:pipeline init → expand-all → sprint-plan
2712
- \`\`\`
2713
-
2714
- ### 5. **Learning Path**
2715
-
2716
- Based on your experience level:
2717
-
2718
- **Beginner Path:**
2719
- 1. init → Create project
2720
- 2. status → Understand state
2721
- 3. next → Find work
2722
- 4. complete → Finish task
2723
-
2724
- **Intermediate Path:**
2725
- 1. expand → Break down complex tasks
2726
- 2. sprint-plan → Organize work
2727
- 3. complexity-report → Understand difficulty
2728
- 4. validate-deps → Ensure consistency
2729
-
2730
- **Advanced Path:**
2731
- 1. pipeline → Chain operations
2732
- 2. smart-flow → Context-aware automation
2733
- 3. Custom commands → Extend the system
2734
-
2735
- ### 6. **Try This Now**
2736
-
2737
- Based on what you asked about, try:
2738
- [Specific command suggestion based on $ARGUMENTS]
2739
-
2740
- Want to learn more about a specific command?
2741
- Type: /project:help <command-name>`),z(`command-pipeline`,`Command Pipeline`,`<pipeline-spec>`,`Execute a pipeline of commands based on a specification.
2742
-
2743
- Arguments: $ARGUMENTS
2744
-
2745
- ## Command Pipeline Execution
2746
-
2747
- Parse pipeline specification from arguments. Supported formats:
2748
-
2749
- ### Simple Pipeline
2750
- \`init → expand-all → sprint-plan\`
2751
-
2752
- ### Conditional Pipeline
2753
- \`status → if:pending>10 → sprint-plan → else → next\`
2754
-
2755
- ### Iterative Pipeline
2756
- \`for:pending-tasks → expand → complexity-check\`
2757
-
2758
- ### Smart Pipeline Patterns
2759
-
2760
- **1. Project Setup Pipeline**
2761
- \`\`\`
2762
- init [prd] →
2763
- expand-all →
2764
- complexity-report →
2765
- sprint-plan →
2766
- show first-sprint
2767
- \`\`\`
2768
-
2769
- **2. Daily Work Pipeline**
2770
- \`\`\`
2771
- standup →
2772
- if:in-progress → continue →
2773
- else → next → start
2774
- \`\`\`
2775
-
2776
- **3. Task Completion Pipeline**
2777
- \`\`\`
2778
- complete [id] →
2779
- git-commit →
2780
- if:blocked-tasks-freed → show-freed →
2781
- next
2782
- \`\`\`
2783
-
2784
- **4. Quality Check Pipeline**
2785
- \`\`\`
2786
- list in-progress →
2787
- for:each → check-idle-time →
2788
- if:idle>1day → prompt-update
2789
- \`\`\`
2790
-
2791
- ### Pipeline Features
2792
-
2793
- **Variables**
2794
- - Store results: \`status → $count=pending-count\`
2795
- - Use in conditions: \`if:$count>10\`
2796
- - Pass between commands: \`expand $high-priority-tasks\`
2797
-
2798
- **Error Handling**
2799
- - On failure: \`try:complete → catch:show-blockers\`
2800
- - Skip on error: \`optional:test-run\`
2801
- - Retry logic: \`retry:3:commit\`
2802
-
2803
- **Parallel Execution**
2804
- - Parallel branches: \`[analyze | test | lint]\`
2805
- - Join results: \`parallel → join:report\`
2806
-
2807
- ### Execution Flow
2808
-
2809
- 1. Parse pipeline specification
2810
- 2. Validate command sequence
2811
- 3. Execute with state passing
2812
- 4. Handle conditions and loops
2813
- 5. Aggregate results
2814
- 6. Show summary
2815
-
2816
- This enables complex workflows like:
2817
- \`parse-prd → expand-all → filter:complex>70 → assign:senior → sprint-plan:weighted\``),z(`auto-implement-tasks`,`Auto Implement Tasks`,`[task-id]`,`Enhanced auto-implementation with intelligent code generation and testing.
2818
-
2819
- Arguments: $ARGUMENTS
2820
-
2821
- ## Intelligent Auto-Implementation
2822
-
2823
- Advanced implementation with context awareness and quality checks.
2824
-
2825
- ### 1. **Pre-Implementation Analysis**
2826
-
2827
- Before starting:
2828
- - Analyze task complexity and requirements
2829
- - Check codebase patterns and conventions
2830
- - Identify similar completed tasks
2831
- - Assess test coverage needs
2832
- - Detect potential risks
2833
-
2834
- ### 2. **Smart Implementation Strategy**
2835
-
2836
- Based on task type and context:
2837
-
2838
- **Feature Tasks**
2839
- 1. Research existing patterns
2840
- 2. Design component architecture
2841
- 3. Implement with tests
2842
- 4. Integrate with system
2843
- 5. Update documentation
2844
-
2845
- **Bug Fix Tasks**
2846
- 1. Reproduce issue
2847
- 2. Identify root cause
2848
- 3. Implement minimal fix
2849
- 4. Add regression tests
2850
- 5. Verify side effects
2851
-
2852
- **Refactoring Tasks**
2853
- 1. Analyze current structure
2854
- 2. Plan incremental changes
2855
- 3. Maintain test coverage
2856
- 4. Refactor step-by-step
2857
- 5. Verify behavior unchanged
2858
-
2859
- ### 3. **Code Intelligence**
2860
-
2861
- **Pattern Recognition**
2862
- - Learn from existing code
2863
- - Follow team conventions
2864
- - Use preferred libraries
2865
- - Match style guidelines
2866
-
2867
- **Test-Driven Approach**
2868
- - Write tests first when possible
2869
- - Ensure comprehensive coverage
2870
- - Include edge cases
2871
- - Performance considerations
2872
-
2873
- ### 4. **Progressive Implementation**
2874
-
2875
- Step-by-step with validation:
2876
- \`\`\`
2877
- Step 1/5: Setting up component structure ✓
2878
- Step 2/5: Implementing core logic ✓
2879
- Step 3/5: Adding error handling ⚡ (in progress)
2880
- Step 4/5: Writing tests ⏳
2881
- Step 5/5: Integration testing ⏳
2882
-
2883
- Current: Adding try-catch blocks and validation...
2884
- \`\`\`
2885
-
2886
- ### 5. **Quality Assurance**
2887
-
2888
- Automated checks:
2889
- - Linting and formatting
2890
- - Test execution
2891
- - Type checking
2892
- - Dependency validation
2893
- - Performance analysis
2894
-
2895
- ### 6. **Smart Recovery**
2896
-
2897
- If issues arise:
2898
- - Diagnostic analysis
2899
- - Suggestion generation
2900
- - Fallback strategies
2901
- - Manual intervention points
2902
- - Learning from failures
2903
-
2904
- ### 7. **Post-Implementation**
2905
-
2906
- After completion:
2907
- - Generate PR description
2908
- - Update documentation
2909
- - Log lessons learned
2910
- - Suggest follow-up tasks
2911
- - Update task relationships
2912
-
2913
- Result: High-quality, production-ready implementations.`),z(`analyze-project`,`Analyze Project`,`[focus-area]`,`Advanced project analysis with actionable insights and recommendations.
2914
-
2915
- Arguments: $ARGUMENTS
2916
-
2917
- ## Comprehensive Project Analysis
2918
-
2919
- Multi-dimensional analysis based on requested focus area.
2920
-
2921
- ### 1. **Analysis Modes**
2922
-
2923
- Based on $ARGUMENTS:
2924
- - "velocity" → Sprint velocity and trends
2925
- - "quality" → Code quality metrics
2926
- - "risk" → Risk assessment and mitigation
2927
- - "dependencies" → Dependency graph analysis
2928
- - "team" → Workload and skill distribution
2929
- - "architecture" → System design coherence
2930
- - Default → Full spectrum analysis
2931
-
2932
- ### 2. **Velocity Analytics**
2933
-
2934
- \`\`\`
2935
- 📊 Velocity Analysis
2936
- ━━━━━━━━━━━━━━━━━━━
2937
- Current Sprint: 24 points/week ↗️ +20%
2938
- Rolling Average: 20 points/week
2939
- Efficiency: 85% (17/20 tasks on time)
2940
-
2941
- Bottlenecks Detected:
2942
- - Code review delays (avg 4h wait)
2943
- - Test environment availability
2944
- - Dependency on external team
2945
-
2946
- Recommendations:
2947
- 1. Implement parallel review process
2948
- 2. Add staging environment
2949
- 3. Mock external dependencies
2950
- \`\`\`
2951
-
2952
- ### 3. **Risk Assessment**
2953
-
2954
- **Technical Risks**
2955
- - High complexity tasks without backup assignee
2956
- - Single points of failure in architecture
2957
- - Insufficient test coverage in critical paths
2958
- - Technical debt accumulation rate
2959
-
2960
- **Project Risks**
2961
- - Critical path dependencies
2962
- - Resource availability gaps
2963
- - Deadline feasibility analysis
2964
- - Scope creep indicators
2965
-
2966
- ### 4. **Dependency Intelligence**
2967
-
2968
- Visual dependency analysis:
2969
- \`\`\`
2970
- Critical Path:
2971
- #12 → #15 → #23 → #45 → #50 (20 days)
2972
- ↘ #24 → #46 ↗
2973
-
2974
- Optimization: Parallelize #15 and #24
2975
- Time Saved: 3 days
2976
- \`\`\`
2977
-
2978
- ### 5. **Quality Metrics**
2979
-
2980
- **Code Quality**
2981
- - Test coverage trends
2982
- - Complexity scores
2983
- - Technical debt ratio
2984
- - Review feedback patterns
2985
-
2986
- **Process Quality**
2987
- - Rework frequency
2988
- - Bug introduction rate
2989
- - Time to resolution
2990
- - Knowledge distribution
2991
-
2992
- ### 6. **Predictive Insights**
2993
-
2994
- Based on patterns:
2995
- - Completion probability by deadline
2996
- - Resource needs projection
2997
- - Risk materialization likelihood
2998
- - Suggested interventions
2999
-
3000
- ### 7. **Executive Dashboard**
3001
-
3002
- High-level summary with:
3003
- - Health score (0-100)
3004
- - Top 3 risks
3005
- - Top 3 opportunities
3006
- - Recommended actions
3007
- - Success probability
3008
-
3009
- Result: Data-driven decisions with clear action paths.`),z(`sync-readme`,`Sync README`,`[options]`,`Export tasks to README.md with professional formatting.
3010
-
3011
- Arguments: $ARGUMENTS
3012
-
3013
- Generate a well-formatted README with current task information.
3014
-
3015
- ## README Synchronization
3016
-
3017
- Creates or updates README.md with beautifully formatted task information.
3018
-
3019
- ## Argument Parsing
3020
-
3021
- Optional filters:
3022
- - "pending" → Only pending tasks
3023
- - "with-subtasks" → Include subtask details
3024
- - "by-priority" → Group by priority
3025
- - "sprint" → Current sprint only
3026
-
3027
- ## Execution
3028
-
3029
- \`\`\`bash
3030
- taskgraph sync-readme [--with-subtasks] [--status=<status>]
3031
- \`\`\`
3032
-
3033
- ## README Generation
3034
-
3035
- ### 1. **Project Header**
3036
- \`\`\`markdown
3037
- # Project Name
3038
-
3039
- ## 📋 Task Progress
3040
-
3041
- Last Updated: 2024-01-15 10:30 AM
3042
-
3043
- ### Summary
3044
- - Total Tasks: 45
3045
- - Completed: 15 (33%)
3046
- - In Progress: 5 (11%)
3047
- - Pending: 25 (56%)
3048
- \`\`\`
3049
-
3050
- ### 2. **Task Sections**
3051
- Organized by status or priority:
3052
- - Progress indicators
3053
- - Task descriptions
3054
- - Dependencies noted
3055
- - Time estimates
3056
-
3057
- ### 3. **Visual Elements**
3058
- - Progress bars
3059
- - Status badges
3060
- - Priority indicators
3061
- - Completion checkmarks
3062
-
3063
- ## Smart Features
3064
-
3065
- 1. **Intelligent Grouping**
3066
- - By feature area
3067
- - By sprint/milestone
3068
- - By assigned developer
3069
- - By priority
3070
-
3071
- 2. **Progress Tracking**
3072
- - Overall completion
3073
- - Sprint velocity
3074
- - Burndown indication
3075
- - Time tracking
3076
-
3077
- 3. **Formatting Options**
3078
- - GitHub-flavored markdown
3079
- - Task checkboxes
3080
- - Collapsible sections
3081
- - Table format available
3082
-
3083
- ## Example Output
3084
-
3085
- \`\`\`markdown
3086
- ## 🚀 Current Sprint
3087
-
3088
- ### In Progress
3089
- - [ ] 🔄 #5 **Implement user authentication** (60% complete)
3090
- - Dependencies: API design (#3 ✅)
3091
- - Subtasks: 4 (2 completed)
3092
- - Est: 8h / Spent: 5h
3093
-
3094
- ### Pending (High Priority)
3095
- - [ ] ⚡ #8 **Create dashboard UI**
3096
- - Blocked by: #5
3097
- - Complexity: High
3098
- - Est: 12h
3099
- \`\`\`
3100
-
3101
- ## Customization
3102
-
3103
- Based on arguments:
3104
- - Include/exclude sections
3105
- - Detail level control
3106
- - Custom grouping
3107
- - Filter by criteria
3108
-
3109
- ## Post-Sync
3110
-
3111
- After generation:
3112
- 1. Show diff preview
3113
- 2. Backup existing README
3114
- 3. Write new content
3115
- 4. Commit reminder
3116
- 5. Update timestamp
3117
-
3118
- ## Integration
3119
-
3120
- Works well with:
3121
- - Git workflows
3122
- - CI/CD pipelines
3123
- - Project documentation
3124
- - Team updates
3125
- - Client reports`)];var Ke=class{supportsNestedCommands=!0;get supportsCommands(){return this.commandsDir!==``}formatAll(e){return e.map(e=>this.format(e))}getFilename(e){return this.supportsNestedCommands?`${e}${this.extension}`:`tm-${e}${this.extension}`}transformArgumentPlaceholder(e){return e}postProcess(e){return e}getCommandsPath(e){return this.supportsNestedCommands?v.join(e,this.commandsDir,`tm`):v.join(e,this.commandsDir)}addSlashCommands(e,t){let n=this.getCommandsPath(e),r=[];if(!this.supportsCommands)return{success:!1,count:0,directory:n,files:[],error:`Profile "${this.name}" does not support slash commands`};try{x.existsSync(n)||x.mkdirSync(n,{recursive:!0});let e=this.formatAll(t);for(let t of e){let e=v.join(n,t.filename);x.writeFileSync(e,t.content),r.push(t.filename)}return{success:!0,count:r.length,directory:n,files:r}}catch(e){return{success:!1,count:0,directory:n,files:[],error:e instanceof Error?e.message:String(e)}}}removeSlashCommands(e,t,n=!0){let r=this.getCommandsPath(e),i=[];if(!this.supportsCommands)return{success:!1,count:0,directory:r,files:[],error:`Profile "${this.name}" does not support slash commands`};if(!x.existsSync(r))return{success:!0,count:0,directory:r,files:[]};try{let e=new Set(t.map(e=>{let t=e.metadata.name.toLowerCase();return this.supportsNestedCommands?t:`tm-${t}`})),a=x.readdirSync(r);for(let t of a){let n=v.basename(t,v.extname(t)).toLowerCase();if(e.has(n)){let e=v.join(r,t);x.rmSync(e,{force:!0}),i.push(t)}}return n&&x.readdirSync(r).length===0&&x.rmSync(r,{recursive:!0,force:!0}),{success:!0,count:i.length,directory:r,files:i}}catch(e){return{success:!1,count:i.length,directory:r,files:i,error:e instanceof Error?e.message:String(e)}}}};const B={claude:new class extends Ke{name=`claude`;displayName=`Claude Code`;commandsDir=`.claude/commands`;extension=`.md`;format(e){let t=this.buildHeader(e),n=this.transformArgumentPlaceholder(e.content);return{filename:this.getFilename(e.metadata.name),content:`${t}${n}`}}buildHeader(e){let t=[e.metadata.description,``];return e.metadata.argumentHint&&(t.push(`Arguments: $ARGUMENTS`),t.push(``)),t.join(`
3126
- `)}}};function qe(e){return B[e.toLowerCase()]}function Je(){let e=ne.homedir(),t=process.env.SHELL||``;if(t.includes(`zsh`))return y.join(e,`.zshrc`);if(t.includes(`bash`)){let t=y.join(e,`.bash_profile`);return process.platform===`darwin`?t:y.join(e,`.bashrc`)}if(t.includes(`fish`))return y.join(e,`.config`,`fish`,`config.fish`);if(process.platform===`win32`){if(process.env.PSModulePath){let t=process.env.PROFILE||y.join(e,`Documents`,`WindowsPowerShell`,`Microsoft.PowerShell_profile.ps1`),n=y.join(e,`Documents`,`PowerShell`,`Microsoft.PowerShell_profile.ps1`);return S.existsSync(n)?n:S.existsSync(t)?t:n}let t=y.join(e,`.bashrc`);if(S.existsSync(t))return t}let n=y.join(e,`.zshrc`);if(S.existsSync(n))return n;let r=y.join(e,`.bashrc`);return S.existsSync(r)?r:null}function V(e){return e.endsWith(`.ps1`)}function H(e){return e.includes(`config.fish`)}function Ye(e,t,n){if(!/^[A-Z_][A-Z0-9_]*$/i.test(e))return{success:!1,message:`Invalid environment variable name: ${e}. Must start with a letter or underscore and contain only alphanumeric characters and underscores.`};if(typeof t!=`string`||t.includes(`
3127
- `)||t.includes(`\r`))return{success:!1,message:`Invalid value: must be a single-line string without newlines`};let r=Je();if(!r)return{success:!1,message:`Could not determine shell type (zsh, bash, fish, or PowerShell)`};try{let i=y.dirname(r);if(S.existsSync(i)||S.mkdirSync(i,{recursive:!0}),!S.existsSync(r)){let e=process.platform===`darwin`&&r.endsWith(`.bash_profile`);if(V(r)||e)S.writeFileSync(r,``);else return{success:!1,shellConfigFile:r,message:`Shell config file ${r} not found`}}let a=S.readFileSync(r,`utf8`),o;if(o=V(r)?RegExp(`^\\s*\\$env:${e}\\s*=`,`m`).test(a):H(r)?RegExp(`^\\s*set\\s+-[gux]*x[gux]*\\s+${e}\\s+`,`m`).test(a):RegExp(`^\\s*export\\s+${e}\\s*=`,`m`).test(a),o)return{success:!0,shellConfigFile:r,message:`${e} already configured`,alreadyExists:!0};let s,c;V(r)?(s=`$env:${e} = "${t.replace(/["`$]/g,"`$&")}"`,c=`#`):H(r)?(s=`set -gx ${e} '${t.replace(/'/g,`'\\''`)}'`,c=`#`):(s=`export ${e}='${t.replace(/'/g,`'\\''`)}'`,c=`#`);let l=`\n${n?`${c} ${n}\n`:``}${s}\n`;return S.appendFileSync(r,l),{success:!0,shellConfigFile:r,message:`Added ${e} to ${r}`}}catch(e){return{success:!1,shellConfigFile:r,message:`Failed to modify shell config: ${e.message}`}}}function Xe(){return Ye(`ENABLE_EXPERIMENTAL_MCP_CLI`,`true`,`Claude Code deferred MCP loading (added by TaskGraph)`)}function Ze(e){let{name:n,displayName:r=n,profileDir:i=`.${n.toLowerCase()}`,rulesDir:a=`${i}/rules`,mcpConfig:o=!0,mcpConfigName:s=o?`mcp.json`:null,fileMap:c={},onAdd:l,onPostConvert:u}=e,d=s?y.join(i,s):null,f=null;try{let e=qe(n);e?.supportsCommands&&(f={profile:e,commands:Ge})}catch(e){t(`debug`,`[${r}] Slash command profile lookup failed: ${e.message}`)}return{profileName:n,displayName:r,profileDir:i,rulesDir:a,mcpConfig:o,mcpConfigName:s,mcpConfigPath:d,fileMap:c,slashCommands:f,...l&&{onAddRulesProfile:l},...u&&{onPostConvertRulesProfile:u}}}function Qe(e,n){let r=y.join(n,`AGENTS.md`),i=y.join(e,`CLAUDE.md`),a=y.join(e,`.taskgraph`,`CLAUDE.md`),o=`@./.taskgraph/CLAUDE.md`,s=`\n## TaskGraph Instructions\n**Import TaskGraph's development workflow commands and guidelines, treat as if import is in the main CLAUDE.md file.**\n${o}`;if(S.existsSync(r))try{let n=y.join(e,`.taskgraph`);if(S.existsSync(n)||S.mkdirSync(n,{recursive:!0}),S.copyFileSync(r,a),t(`debug`,`[Claude] Created TaskGraph instructions at ${a}`),S.existsSync(i)){let e=S.readFileSync(i,`utf8`);if(e.includes(o))t(`debug`,`[Claude] TaskGraph import already present in ${i}`);else{let n=e.trim()+`
3128
- `+s+`
3129
- `;S.writeFileSync(i,n),t(`debug`,`[Claude] Added TaskGraph import to existing ${i}`)}}else{let e=`# Claude Code Instructions\n${s}\n`;S.writeFileSync(i,e),t(`debug`,`[Claude] Created ${i} with TaskGraph import`)}}catch(e){t(`error`,`[Claude] Failed to set up Claude instructions: ${e.message}`)}let c=Xe();c.success?c.alreadyExists?t(`debug`,`[Claude] Deferred MCP loading already configured`):t(`debug`,`[Claude] Enabled deferred MCP loading in ${c.shellConfigFile}`):t(`debug`,`[Claude] Could not configure deferred loading: ${c.message}`)}function $e(e){let t={};if(e.mcpServers){t.mcpServers={};for(let[n,r]of Object.entries(e.mcpServers)){let e={};e.type=`stdio`,r.command&&(e.command=r.command),r.args&&(e.args=r.args),r.env&&(e.env=r.env),Object.keys(r).forEach(t=>{[`command`,`args`,`env`,`type`].includes(t)||(e[t]=r[t])}),t.mcpServers[n]=e}}return t}function et(e,n){let r=y.join(e,`.mcp.json`);if(S.existsSync(r))try{let e=$e(JSON.parse(S.readFileSync(r,`utf8`)));S.writeFileSync(r,JSON.stringify(e,null,` `)+`
3130
- `),t(`debug`,`[Claude] Transformed MCP configuration to Claude format at ${r}`)}catch(e){t(`error`,`[Claude] Failed to transform MCP configuration: ${e.message}`)}}const tt=Ze({name:`claude`,displayName:`Claude Code`,profileDir:`.`,rulesDir:`.`,mcpConfigName:`.mcp.json`,fileMap:{"AGENTS.md":`.taskgraph/CLAUDE.md`},onAdd:Qe,onPostConvert:et});var nt=/* @__PURE__ */ e({claudeProfile:()=>tt});function rt(e){return T.includes(e)}function it(e){if(!rt(e))return null;let t=nt[`${e}Profile`];if(!t)throw Error(`Profile not found: static import missing for '${e}'. Valid profiles: ${T.join(`, `)}`);return t}function at(e,n){let r=y.join(e,n.rulesDir),i=0;if(typeof n.onAddRulesProfile==`function`)try{n.onAddRulesProfile(r,N()),t(`debug`,`[Rule Transformer] Called onAddRulesProfile for ${n.profileName}`)}catch(e){t(`error`,`[Rule Transformer] onAddRulesProfile failed for ${n.profileName}: ${e.message}`),i++}if(n.mcpConfig!==!1)try{ve(e,n.mcpConfigPath),t(`debug`,`[Rule Transformer] Setup MCP configuration for ${n.profileName}`)}catch(e){t(`error`,`[Rule Transformer] MCP setup failed for ${n.profileName}: ${e.message}`)}if(typeof n.onPostConvertRulesProfile==`function`)try{n.onPostConvertRulesProfile(r,N()),t(`debug`,`[Rule Transformer] Called onPostConvertRulesProfile for ${n.profileName}`)}catch(e){t(`error`,`[Rule Transformer] onPostConvertRulesProfile failed for ${n.profileName}: ${e.message}`)}if(n.slashCommands)try{let r=n.slashCommands.profile.addSlashCommands(e,n.slashCommands.commands);r.success?t(`debug`,`[Rule Transformer] Created ${r.count} slash commands in ${r.directory}`):t(`error`,`[Rule Transformer] Failed to add slash commands for ${n.profileName}: ${r.error}`)}catch(e){t(`error`,`[Rule Transformer] Slash commands failed for ${n.profileName}: ${e.message}`)}return{success:1,failed:i}}function ot(e){try{let t=JSON.parse(S.readFileSync(e,`utf-8`));for(let e of[`main`,`research`,`fallback`])if(t.models&&t.models[e]){let n=t.models[e].provider,r=t.models[e].modelId;if(a[n]){let i=a[n].find(e=>e.id===r);i&&i.max_tokens&&(t.models[e].maxTokens=i.max_tokens)}}return S.writeFileSync(e,JSON.stringify(t,null,2)),!0}catch(e){return console.error(`Error updating config maxTokens:`,e.message),!1}}const U=`alias tm='taskgraph'`,W=`ENABLE_EXPERIMENTAL_MCP_CLI`,G={debug:0,info:1,warn:2,error:3,success:4},st=process.env.TASKGRAPH_LOG_LEVEL?G[process.env.TASKGRAPH_LOG_LEVEL.toLowerCase()]:G.info;function ct(){s()||g()}function K(e,...t){let n={debug:d.muted(`•`),info:d.brand(`→`),warn:_.yellow(`!`),error:_.red(`✗`),success:_.green(`✓`)};if(G[e]>=st){let r=n[e]||``;s()||(e===`error`?console.error(r,_.red(...t)):e===`warn`?console.warn(r,_.yellow(...t)):e===`success`?console.log(r,_.green(...t)):e===`info`?console.log(r,d.brand(...t)):console.log(r,...t))}if(process.env.DEBUG===`true`){let n=`[${e.toUpperCase()}] ${t.join(` `)}\n`;S.appendFileSync(`init-debug.log`,n)}}function lt(e,...t){K(e===`warn`||e===`error`?e:`debug`,...t)}function q(e){S.existsSync(e)||(S.mkdirSync(e,{recursive:!0}),K(`debug`,`Created directory: ${e}`))}function J(){let e=process.env.HOME||process.env.USERPROFILE;return e?[`.zshrc`,`.bashrc`,`.bash_profile`,`.profile`].map(t=>y.join(e,t)):[]}function ut(e){return[y.join(e,c),y.join(e,p),y.join(e,r),y.join(e,`.git`),y.join(e,m),y.join(e,u),y.join(e,`CLAUDE.md`),y.join(e,`.mcp.json`),...J()]}function Y(e){let t=/* @__PURE__ */ new Map;for(let n of e){let e=null;try{S.existsSync(n)&&(e=S.statSync(n).isDirectory()?``:S.readFileSync(n,`utf8`))}catch{e=null}t.set(n,e)}return t}function dt(e,t,n){let r=t=>y.join(e,t),i=e=>t.get(e)==null&&n.get(e)!=null,a=e=>t.get(e)!=null&&n.get(e)!=null&&t.get(e)!==n.get(e),o=t.get(r(`.taskgraph/config.json`))!=null||t.get(r(`.taskgraph/tasks/tasks.json`))!=null,s=[];!o&&n.get(r(`.taskgraph/config.json`))!=null?s.push({path:`${c}/`,note:`tasks, settings and PRD templates`}):o&&i(r(`.taskgraph/config.json`))&&s.push({path:p,note:`restored`}),i(r(`.git`))&&s.push({path:`.git/`,note:`new Git repository`});let l=[[m,`created`,`added TaskGraph entries`],[u,`optional settings`,`updated`],[`CLAUDE.md`,`loads TaskGraph's instructions in Claude Code`,`now imports TaskGraph's instructions`],[`.mcp.json`,`TaskGraph MCP server for Claude Code`,`added the TaskGraph MCP server`]];for(let[e,t,n]of l){let o=r(e);i(o)?s.push({path:e,note:t}):a(o)&&s.push({path:e,note:n})}let d=process.env.HOME||process.env.USERPROFILE;for(let e of J()){let r=t.get(e)||``,i=n.get(e)||``;if(i===r)continue;let a=[];i.includes(U)&&!r.includes(U)&&a.push("the `tm` alias"),i.includes(W)&&!r.includes(W)&&a.push(`deferred MCP loading`),a.length!==0&&s.push({path:d?e.replace(d,`~`):e,note:`added ${a.join(` and `)}; open a new terminal`})}return{alreadySetUp:o,changes:s}}function ft(){let e=process.env.HOME||process.env.USERPROFILE,t;if(process.env.SHELL?.includes(`zsh`))t=y.join(e,`.zshrc`);else if(process.env.SHELL?.includes(`bash`))t=y.join(e,`.bashrc`);else return K(`debug`,`Could not determine shell type. Aliases not added.`),!1;try{if(!S.existsSync(t))return K(`debug`,`Shell config file ${t} not found.`),!1;let e=S.readFileSync(t,`utf8`),n=[{name:`tm`,line:U}].filter(t=>!e.includes(t.line));if(n.length===0)return K(`debug`,`All TaskGraph aliases already exist.`),!0;let r=n.map(e=>e.line).join(`
3131
- `),i=`
3132
- # TaskGraph aliases added on ${(/* @__PURE__ */ new Date()).toLocaleDateString()}
3133
- ${r}
3134
- `;return S.appendFileSync(t,i),K(`debug`,`Added ${n.length} alias(es): ${n.map(e=>e.name).join(`, `)}`),!0}catch(e){return K(`debug`,`Failed to add aliases: ${e.message}`),!1}}function pt(e){let t=y.join(e,l);if(S.existsSync(t)){K(`debug`,`State file already exists, preserving current configuration`);return}let n={currentTag:`master`,lastSwitched:(/* @__PURE__ */ new Date()).toISOString(),branchTagMapping:{},migrationNoticeShown:!0};try{S.writeFileSync(t,JSON.stringify(n,null,2)),K(`debug`,`Created initial state file: ${t}`)}catch(e){K(`error`,`Failed to create state file: ${e.message}`)}}function mt(e){let t=y.join(e,r);if(S.existsSync(t))return;let n={master:{tasks:[],metadata:{created:(/* @__PURE__ */ new Date()).toISOString(),description:`Tasks for master context`}}};try{S.writeFileSync(t,`${JSON.stringify(n,null,2)}\n`),K(`debug`,`Created empty tasks file: ${t}`)}catch(e){K(`error`,`Failed to create tasks file: ${e.message}`)}}function X(e,t,n={}){if(!ge(e)){K(`error`,`Source file not found: ${e}`);return}let r=F(e,`utf8`);if(Object.entries(n).forEach(([e,t])=>{let n=RegExp(`\\{\\{${e}\\}\\}`,`g`);r=r.replace(n,t)}),S.existsSync(t)){let e=y.basename(t);if(e===`.gitignore`){K(`debug`,`${t} already exists, merging content...`);let e=S.readFileSync(t,`utf8`),n=new Set(e.split(`
3135
- `).map(e=>e.trim())),i=r.split(`
3136
- `).filter(e=>!n.has(e.trim()));if(i.length>0){let n=`${e.trim()}\n\n# Added by TaskGraph\n${i.join(`
3137
- `)}`;S.writeFileSync(t,n),K(`debug`,`Updated ${t} with additional entries`)}else K(`debug`,`No new content to add to ${t}`);return}if(e===`README-taskgraph.md`){K(`debug`,`${t} already exists`);let e=y.join(y.dirname(t),`README-taskgraph.md`);S.writeFileSync(e,r),K(`debug`,`Created ${e} (preserved original README-taskgraph.md)`);return}K(`debug`,`${t} already exists, skipping.`)}else S.writeFileSync(t,r),K(`debug`,`Created file: ${t}`)}async function ht(e={}){s()||ct(),e.git===!0?e.initGit=!0:e.git===!1&&(e.initGit=!1),e.gitTasks===!0?e.storeTasksInGit=!0:e.gitTasks===!1&&(e.storeTasksInGit=!1);let t=e.yes||e.name&&e.description,n;if(n=e.rulesExplicitlyProvided?e.rules:[],t){e.name,e.description,e.version,e.author;let t=e.dryRun||!1,r=e.initGit===void 0||e.initGit,i=e.storeTasksInGit??pe(y.join(process.cwd(),`.gitignore`))??!0;if(t)return $(r,i),{dryRun:!0};await Q(e.aliases!==!1,r,i,t,{...e,preferredLanguage:`English`},n)}else{K(`debug`,`Required options not provided, proceeding with prompts.`);let t;try{K(`debug`,`Init started - taskgraph_id: ${gt()}`),t=w.createInterface({input:process.stdin,output:process.stdout});let r=!0,i=!0;r=e.initGit===void 0?h()?!0:(await Z(t,_.cyan(`Initialize a Git repository in project root? (Y/n): `),e=>{let t=e.trim().toLowerCase()!==`n`,n=t?_.green(`✓`):_.dim(`–`);return _.cyan(`Initialize a Git repository in project root?`)+` `+n+` `+_.dim(t?`Yes`:`No`)})).trim().toLowerCase()!==`n`:e.initGit,i=e.storeTasksInGit===void 0?(await Z(t,_.cyan(`Store tasks in Git (tasks.json and tasks/ directory)? (Y/n): `),e=>{let t=e.trim().toLowerCase()!==`n`,n=t?_.green(`✓`):_.dim(`–`);return _.cyan(`Store tasks in Git (tasks.json and tasks/ directory)?`)+` `+n+` `+_.dim(t?`Yes`:`No`)})).trim().toLowerCase()!==`n`:e.storeTasksInGit;let a=!1;e.rulesExplicitlyProvided?K(`debug`,`Using rule profiles provided via command line: ${n.join(`, `)}`):a=(await Z(t,_.cyan(`Set up Claude Code integration (CLAUDE.md import)? (y/N): `),e=>{let t=e.trim().toLowerCase()===`y`,n=t?_.green(`✓`):_.dim(`–`);return _.cyan(`Set up Claude Code integration?`)+` `+n+` `+_.dim(t?`Yes`:`No`)})).trim().toLowerCase()===`y`;let o=(await Z(t,_.cyan(`Language for AI responses (English): `),e=>`${_.cyan(`Language for AI responses?`)} ${_.dim(e.trim()||`English`)}`)).trim()||`English`,s=e.dryRun||!1;if(s)return t.close(),$(r,i),{dryRun:!0};await Q(e.aliases!==!1,r,i,s,{...e,shouldSetupRules:a,preferredLanguage:o},a?T:n),t.close()}catch(e){t&&t.close(),K(`error`,`Error during initialization process: ${e.message}`),process.exit(1)}}}function Z(e,t,n){return new Promise(r=>{e.question(t,e=>{w.moveCursor(process.stdout,0,-1),w.cursorTo(process.stdout,0),w.clearLine(process.stdout,0),n&&process.stdout.write(n(e)+`
3138
- `),r(e)})})}function gt(){return re()}function _t(e){try{if(!S.existsSync(e)){K(`warn`,`Config file does not exist, skipping storage configuration`);return}let t=S.readFileSync(e,`utf8`),n=JSON.parse(t);n.storage||={},n.storage.type=`file`,n.storage.operatingMode=`solo`,K(`debug`,`Configured storage for local file storage`),S.writeFileSync(e,JSON.stringify(n,null,2)),K(`debug`,`Storage configuration updated in config.json`)}catch(e){K(`error`,`Failed to update storage configuration: ${e.message}`)}}async function Q(e,t,r,a,l,d=T){let g=process.cwd();K(`debug`,`Initializing project in ${g}`);let _=s()?[]:ut(g),v=Y(_);q(y.join(g,c)),q(y.join(g,i)),q(y.join(g,n)),q(y.join(g,ee)),q(y.join(g,o)),pt(g),mt(g);let x={year:(/* @__PURE__ */ new Date()).getFullYear()};function S(e){let t=it(e);t?at(g,t):K(`warn`,`Unknown rule profile: ${e}`)}X(`env.example`,y.join(g,u),x),X(`config.json`,y.join(g,p),{...x});let C=y.join(g,p);ot(C)?K(`debug`,`Updated config with correct maxTokens values`):K(`debug`,`Could not update maxTokens in config`),_t(C);try{let e=F(`gitignore`,`utf8`);me(y.join(g,m),e,r,lt)}catch(e){K(`error`,`Failed to create .gitignore: ${e.message}`)}X(`example_prd.txt`,y.join(g,f)),X(`example_prd_rpg.txt`,y.join(g,o,`example_prd_rpg.txt`));try{t===!1?K(`debug`,`Git initialization skipped due to --no-git flag.`):h()?K(`debug`,`Existing Git repository detected; skipping git init.`):(b(`git init`,{cwd:g,stdio:`ignore`}),K(`debug`,`Git repository initialized`))}catch{K(`warn`,`Git not available, skipping repository initialization`)}if(d.length>0){K(`debug`,`Setting up Claude Code integration...`);for(let e of d)S(e)}if(l.preferredLanguage&&!a)try{let e=(await import(`./response-language-D9UxmXBp.js`)).default;e(l.preferredLanguage,{projectRoot:g,silent:!0}),K(`debug`,`Response language set to: ${l.preferredLanguage}`)}catch(e){K(`warn`,`Failed to set response language: ${e.message}`)}if(!s()&&!a&&!l?.yes){console.log(``);try{b(`"${process.execPath}" "${process.argv[1]}" models --setup --no-banner`,{stdio:`inherit`,cwd:g}),console.log(``)}catch{K(`warn`,"Model setup did not finish; run `taskgraph models --setup` to retry")}}else s()&&!a&&K(`debug`,`Skipping interactive model setup in silent (MCP) mode.`);if(e&&!a&&ft(),!s()){let{alreadySetUp:e,changes:t}=dt(g,v,Y(_));console.log(`${te({folder:y.basename(g),changes:t,alreadySetUp:e,claudeCode:d.includes(`claude`),defaultModels:!!l?.yes})}\n`)}}function $(e,t){if(s())return;let n=[`Dry run; nothing was changed. Init would:`,` create ${c}/ with tasks, settings and PRD templates`,` create or update ${m} and ${u}`];e!==!1&&!h()&&n.push(` start a Git repository`),n.push(t?` keep tasks in Git`:` keep tasks out of Git`),console.log(n.join(`
3139
- `))}export{T as n,ie as r,ht as t};