taskgraph-ai 0.0.0-stage → 0.50.1

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