taskgraph-ai 0.52.23 → 0.54.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -34
- package/dist/ai-services-unified-BPPVDTpt.js +3 -0
- package/dist/ai-services-unified-Dskm2lPO.js +1 -0
- package/dist/assets/AGENTS.md +12 -13
- package/dist/commands-DJc5m0Gi.js +126 -0
- package/dist/config-manager-CKwBfpAp.js +1 -0
- package/dist/config-manager-Db2R8Tgw.js +1 -0
- package/dist/git-utils-CRR3iPaC.js +1 -0
- package/dist/{git-utils--i2q96hv.js → git-utils-NnZtE3nY.js} +1 -1
- package/dist/init-CK_i6ZcN.js +24 -0
- package/dist/mcp-server.js +2 -2
- package/dist/research-BKsPc_oX.js +1 -0
- package/dist/research-C8rAJdp0.js +585 -0
- package/dist/{response-language-ip84ug-k.js → response-language-C8euRV2w.js} +1 -1
- package/dist/response-language-DiIdcmnK.js +1 -0
- package/dist/rolldown-runtime-BxhE39jg.js +1 -0
- package/dist/src-CK3olqVP.js +468 -0
- package/dist/src-DRpuDe-k.js +207 -0
- package/dist/tag-management-BL0w3Tk3.js +1 -0
- package/dist/task-manager-B_UFNQnE.js +1 -0
- package/dist/task-manager-BipYRXFW.js +167 -0
- package/dist/taskgraph.js +1 -1
- package/package.json +3 -8
- package/dist/ai-services-unified-CigO4oTy.js +0 -1
- package/dist/ai-services-unified-kmQRPU0g.js +0 -3
- package/dist/assets/claude/TM_COMMANDS_GUIDE.md +0 -147
- package/dist/assets/scripts_README.md +0 -443
- package/dist/commands-dFNugMWF.js +0 -116
- package/dist/config-manager-C5Ih13nA.js +0 -1
- package/dist/config-manager-DhVH8AQp.js +0 -1
- package/dist/dependency-manager-CCREovZA.js +0 -758
- package/dist/git-utils-BezpEZd4.js +0 -1
- package/dist/init-p_pWjmVE.js +0 -3139
- package/dist/research-blv_5JOT.js +0 -1
- package/dist/response-language-D9UxmXBp.js +0 -1
- package/dist/src-TZm8h0X-.js +0 -207
- package/dist/src-yE1DeXKG.js +0 -468
- package/dist/tag-management-Br2FX-YC.js +0 -1
- package/dist/task-manager-DWPIhAB7.js +0 -1
- package/index.js +0 -157
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
# TaskGraph Commands for Claude Code
|
|
2
|
-
|
|
3
|
-
Complete guide to using TaskGraph through Claude Code's slash commands.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
All TaskGraph functionality is available through the `/project:tm/` namespace with natural language support and intelligent features.
|
|
8
|
-
|
|
9
|
-
## Quick Start
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
# Install TaskGraph
|
|
13
|
-
/project:tm/setup/quick-install
|
|
14
|
-
|
|
15
|
-
# Initialize project
|
|
16
|
-
/project:tm/init/quick
|
|
17
|
-
|
|
18
|
-
# Parse requirements
|
|
19
|
-
/project:tm/parse-prd requirements.md
|
|
20
|
-
|
|
21
|
-
# Start working
|
|
22
|
-
/project:tm/next
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Command Structure
|
|
26
|
-
|
|
27
|
-
Commands are organized hierarchically to match TaskGraph's CLI:
|
|
28
|
-
- Main commands at `/project:tm/[command]`
|
|
29
|
-
- Subcommands for specific operations `/project:tm/[command]/[subcommand]`
|
|
30
|
-
- Natural language arguments accepted throughout
|
|
31
|
-
|
|
32
|
-
## Complete Command Reference
|
|
33
|
-
|
|
34
|
-
### Setup & Configuration
|
|
35
|
-
- `/project:tm/setup/install` - Full installation guide
|
|
36
|
-
- `/project:tm/setup/quick-install` - One-line install
|
|
37
|
-
- `/project:tm/init` - Initialize project
|
|
38
|
-
- `/project:tm/init/quick` - Quick init with -y
|
|
39
|
-
- `/project:tm/models` - View AI config
|
|
40
|
-
- `/project:tm/models/setup` - Configure AI
|
|
41
|
-
|
|
42
|
-
### Task Generation
|
|
43
|
-
- `/project:tm/parse-prd` - Generate from PRD
|
|
44
|
-
- `/project:tm/parse-prd/with-research` - Enhanced parsing
|
|
45
|
-
- `/project:tm/generate` - Create task files
|
|
46
|
-
|
|
47
|
-
### Task Management
|
|
48
|
-
- `/project:tm/list` - List with natural language filters
|
|
49
|
-
- `/project:tm/list/with-subtasks` - Hierarchical view
|
|
50
|
-
- `/project:tm/list/by-status <status>` - Filter by status
|
|
51
|
-
- `/project:tm/show <id>` - Task details
|
|
52
|
-
- `/project:tm/add-task` - Create task
|
|
53
|
-
- `/project:tm/update` - Update tasks
|
|
54
|
-
- `/project:tm/remove-task` - Delete task
|
|
55
|
-
|
|
56
|
-
### Status Management
|
|
57
|
-
- `/project:tm/set-status/to-pending <id>`
|
|
58
|
-
- `/project:tm/set-status/to-in-progress <id>`
|
|
59
|
-
- `/project:tm/set-status/to-done <id>`
|
|
60
|
-
- `/project:tm/set-status/to-review <id>`
|
|
61
|
-
- `/project:tm/set-status/to-deferred <id>`
|
|
62
|
-
- `/project:tm/set-status/to-cancelled <id>`
|
|
63
|
-
|
|
64
|
-
### Task Analysis
|
|
65
|
-
- `/project:tm/analyze-complexity` - AI analysis
|
|
66
|
-
- `/project:tm/complexity-report` - View report
|
|
67
|
-
- `/project:tm/expand <id>` - Break down task
|
|
68
|
-
- `/project:tm/expand/all` - Expand all complex
|
|
69
|
-
|
|
70
|
-
### Dependencies
|
|
71
|
-
- `/project:tm/add-dependency` - Add dependency
|
|
72
|
-
- `/project:tm/remove-dependency` - Remove dependency
|
|
73
|
-
- `/project:tm/validate-dependencies` - Check issues
|
|
74
|
-
- `/project:tm/fix-dependencies` - Auto-fix
|
|
75
|
-
|
|
76
|
-
### Workflows
|
|
77
|
-
- `/project:tm/workflows/smart-flow` - Adaptive workflows
|
|
78
|
-
- `/project:tm/workflows/pipeline` - Chain commands
|
|
79
|
-
- `/project:tm/workflows/auto-implement` - AI implementation
|
|
80
|
-
|
|
81
|
-
### Utilities
|
|
82
|
-
- `/project:tm/status` - Project dashboard
|
|
83
|
-
- `/project:tm/next` - Next task recommendation
|
|
84
|
-
- `/project:tm/utils/analyze` - Project analysis
|
|
85
|
-
- `/project:tm/learn` - Interactive help
|
|
86
|
-
|
|
87
|
-
## Key Features
|
|
88
|
-
|
|
89
|
-
### Natural Language Support
|
|
90
|
-
All commands understand natural language:
|
|
91
|
-
```
|
|
92
|
-
/project:tm/list pending high priority
|
|
93
|
-
/project:tm/update mark 23 as done
|
|
94
|
-
/project:tm/add-task implement OAuth login
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Smart Context
|
|
98
|
-
Commands analyze project state and provide intelligent suggestions based on:
|
|
99
|
-
- Current task status
|
|
100
|
-
- Dependencies
|
|
101
|
-
- Team patterns
|
|
102
|
-
- Project phase
|
|
103
|
-
|
|
104
|
-
### Visual Enhancements
|
|
105
|
-
- Progress bars and indicators
|
|
106
|
-
- Status badges
|
|
107
|
-
- Organized displays
|
|
108
|
-
- Clear hierarchies
|
|
109
|
-
|
|
110
|
-
## Common Workflows
|
|
111
|
-
|
|
112
|
-
### Daily Development
|
|
113
|
-
```
|
|
114
|
-
/project:tm/workflows/smart-flow morning
|
|
115
|
-
/project:tm/next
|
|
116
|
-
/project:tm/set-status/to-in-progress <id>
|
|
117
|
-
/project:tm/set-status/to-done <id>
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Task Breakdown
|
|
121
|
-
```
|
|
122
|
-
/project:tm/show <id>
|
|
123
|
-
/project:tm/expand <id>
|
|
124
|
-
/project:tm/list/with-subtasks
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Sprint Planning
|
|
128
|
-
```
|
|
129
|
-
/project:tm/analyze-complexity
|
|
130
|
-
/project:tm/workflows/pipeline init → expand/all → status
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
## Migration from Old Commands
|
|
134
|
-
|
|
135
|
-
| Old | New |
|
|
136
|
-
|-----|-----|
|
|
137
|
-
| `/project:taskgraph:list` | `/project:tm/list` |
|
|
138
|
-
| `/project:taskgraph:complete` | `/project:tm/set-status/to-done` |
|
|
139
|
-
| `/project:workflows:auto-implement` | `/project:tm/workflows/auto-implement` |
|
|
140
|
-
|
|
141
|
-
## Tips
|
|
142
|
-
|
|
143
|
-
1. Use `/project:tm/` + Tab for command discovery
|
|
144
|
-
2. Natural language is supported everywhere
|
|
145
|
-
3. Commands provide smart defaults
|
|
146
|
-
4. Chain commands for automation
|
|
147
|
-
5. Check `/project:tm/learn` for interactive help
|
|
@@ -1,443 +0,0 @@
|
|
|
1
|
-
# Meta-Development Script
|
|
2
|
-
|
|
3
|
-
This folder contains a **meta-development script** (`dev.js`) and related utilities that manage tasks for an AI-driven or traditional software development workflow. The script revolves around a `tasks.json` file, which holds an up-to-date list of development tasks.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
In an AI-driven development process—particularly with tools like [Cursor](https://www.cursor.so/)—it's beneficial to have a **single source of truth** for tasks. This script allows you to:
|
|
8
|
-
|
|
9
|
-
1. **Parse** a PRD or requirements document (`.txt`) to initialize a set of tasks (`tasks.json`).
|
|
10
|
-
2. **List** all existing tasks (IDs, statuses, titles).
|
|
11
|
-
3. **Update** tasks to accommodate new prompts or architecture changes (useful if you discover "implementation drift").
|
|
12
|
-
4. **Generate** individual task files (e.g., `task_001.txt`) for easy reference or to feed into an AI coding workflow.
|
|
13
|
-
5. **Set task status**—mark tasks as `done`, `pending`, or `deferred` based on progress.
|
|
14
|
-
6. **Expand** tasks with subtasks—break down complex tasks into smaller, more manageable subtasks.
|
|
15
|
-
7. **Research-backed subtask generation**—use the research model to generate more informed and contextually relevant subtasks.
|
|
16
|
-
8. **Clear subtasks**—remove subtasks from specified tasks to allow regeneration or restructuring.
|
|
17
|
-
9. **Show task details**—display detailed information about a specific task and its subtasks.
|
|
18
|
-
|
|
19
|
-
## Configuration (Updated)
|
|
20
|
-
|
|
21
|
-
TaskGraph configuration is now managed through two primary methods:
|
|
22
|
-
|
|
23
|
-
1. **`.taskgraph/config.json` File (Project Root - Primary)**
|
|
24
|
-
|
|
25
|
-
- Stores AI model selections (`main`, `research`, `fallback`), model parameters (`maxTokens`, `temperature`), `logLevel`, `defaultSubtasks`, `defaultPriority`, `projectName`, etc.
|
|
26
|
-
- Managed using the `taskgraph models --setup` command or the `models` MCP tool.
|
|
27
|
-
- This is the main configuration file for most settings.
|
|
28
|
-
|
|
29
|
-
2. **Environment Variables (optional)**
|
|
30
|
-
- TaskGraph needs no provider API keys; AI calls run through your signed-in Claude Code.
|
|
31
|
-
- `CLAUDE_CODE_API_KEY` optionally bills calls to a specific Anthropic API key.
|
|
32
|
-
- See the Configuration page in the TaskGraph docs for the `TASKGRAPH_*` variables.
|
|
33
|
-
|
|
34
|
-
**Important:** Settings like `MODEL`, `MAX_TOKENS`, `TEMPERATURE`, `TASKGRAPH_LOG_LEVEL`, etc., are **no longer set via `.env`**. Use `taskgraph models --setup` instead.
|
|
35
|
-
|
|
36
|
-
## How It Works
|
|
37
|
-
|
|
38
|
-
1. **`tasks.json`**:
|
|
39
|
-
|
|
40
|
-
- A JSON file at the project root containing an array of tasks (each with `id`, `title`, `description`, `status`, etc.).
|
|
41
|
-
- The `meta` field can store additional info like the project's name, version, or reference to the PRD.
|
|
42
|
-
- Tasks can have `subtasks` for more detailed implementation steps.
|
|
43
|
-
- Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending) to easily track progress.
|
|
44
|
-
|
|
45
|
-
2. **CLI Commands**
|
|
46
|
-
You can run the commands via:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
# If installed globally
|
|
50
|
-
taskgraph [command] [options]
|
|
51
|
-
|
|
52
|
-
# If using locally within the project
|
|
53
|
-
node scripts/dev.js [command] [options]
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Available commands:
|
|
57
|
-
|
|
58
|
-
- `init`: Initialize a new project
|
|
59
|
-
- `parse-prd`: Generate tasks from a PRD document
|
|
60
|
-
- `list`: Display all tasks with their status
|
|
61
|
-
- `update`: Update tasks based on new information
|
|
62
|
-
- `generate`: Create individual task files
|
|
63
|
-
- `set-status`: Change a task's status
|
|
64
|
-
- `expand`: Add subtasks to a task or all tasks
|
|
65
|
-
- `clear-subtasks`: Remove subtasks from specified tasks
|
|
66
|
-
- `next`: Determine the next task to work on based on dependencies
|
|
67
|
-
- `show`: Display detailed information about a specific task
|
|
68
|
-
- `analyze-complexity`: Analyze task complexity and generate recommendations
|
|
69
|
-
- `complexity-report`: Display the complexity analysis in a readable format
|
|
70
|
-
- `add-dependency`: Add a dependency between tasks
|
|
71
|
-
- `remove-dependency`: Remove a dependency from a task
|
|
72
|
-
- `validate-dependencies`: Check for invalid dependencies
|
|
73
|
-
- `fix-dependencies`: Fix invalid dependencies automatically
|
|
74
|
-
- `add-task`: Add a new task using AI
|
|
75
|
-
|
|
76
|
-
Run `taskgraph --help` or `node scripts/dev.js --help` to see detailed usage information.
|
|
77
|
-
|
|
78
|
-
## Listing Tasks
|
|
79
|
-
|
|
80
|
-
The `list` command allows you to view all tasks and their status:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
# List all tasks
|
|
84
|
-
taskgraph list
|
|
85
|
-
|
|
86
|
-
# List tasks with a specific status
|
|
87
|
-
taskgraph list --status=pending
|
|
88
|
-
|
|
89
|
-
# List tasks and include their subtasks
|
|
90
|
-
taskgraph list --with-subtasks
|
|
91
|
-
|
|
92
|
-
# List tasks with a specific status and include their subtasks
|
|
93
|
-
taskgraph list --status=pending --with-subtasks
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Updating Tasks
|
|
97
|
-
|
|
98
|
-
The `update` command allows you to update tasks based on new information or implementation changes:
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
# Update tasks starting from ID 4 with a new prompt
|
|
102
|
-
taskgraph update --from=4 --prompt="Refactor tasks from ID 4 onward to use Express instead of Fastify"
|
|
103
|
-
|
|
104
|
-
# Update all tasks (default from=1)
|
|
105
|
-
taskgraph update --prompt="Add authentication to all relevant tasks"
|
|
106
|
-
|
|
107
|
-
# Specify a different tasks file
|
|
108
|
-
taskgraph update --file=custom-tasks.json --from=5 --prompt="Change database from MongoDB to PostgreSQL"
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Notes:
|
|
112
|
-
|
|
113
|
-
- The `--prompt` parameter is required and should explain the changes or new context
|
|
114
|
-
- Only tasks that aren't marked as 'done' will be updated
|
|
115
|
-
- Tasks with ID >= the specified --from value will be updated
|
|
116
|
-
|
|
117
|
-
## Setting Task Status
|
|
118
|
-
|
|
119
|
-
The `set-status` command allows you to change a task's status:
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
# Mark a task as done
|
|
123
|
-
taskgraph set-status --id=3 --status=done
|
|
124
|
-
|
|
125
|
-
# Mark a task as pending
|
|
126
|
-
taskgraph set-status --id=4 --status=pending
|
|
127
|
-
|
|
128
|
-
# Mark a specific subtask as done
|
|
129
|
-
taskgraph set-status --id=3.1 --status=done
|
|
130
|
-
|
|
131
|
-
# Mark multiple tasks at once
|
|
132
|
-
taskgraph set-status --id=1,2,3 --status=done
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
Notes:
|
|
136
|
-
|
|
137
|
-
- When marking a parent task as "done", all of its subtasks will automatically be marked as "done" as well
|
|
138
|
-
- Common status values are 'done', 'pending', and 'deferred', but any string is accepted
|
|
139
|
-
- You can specify multiple task IDs by separating them with commas
|
|
140
|
-
- Subtask IDs are specified using the format `parentId.subtaskId` (e.g., `3.1`)
|
|
141
|
-
- Dependencies are updated to show completion status (✅ for completed, ⏱️ for pending) throughout the system
|
|
142
|
-
|
|
143
|
-
## Expanding Tasks
|
|
144
|
-
|
|
145
|
-
The `expand` command allows you to break down tasks into subtasks for more detailed implementation:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
# Expand a specific task with 3 subtasks (default)
|
|
149
|
-
taskgraph expand --id=3
|
|
150
|
-
|
|
151
|
-
# Expand a specific task with 5 subtasks
|
|
152
|
-
taskgraph expand --id=3 --num=5
|
|
153
|
-
|
|
154
|
-
# Expand a task with additional context
|
|
155
|
-
taskgraph expand --id=3 --prompt="Focus on security aspects"
|
|
156
|
-
|
|
157
|
-
# Expand all pending tasks that don't have subtasks
|
|
158
|
-
taskgraph expand --all
|
|
159
|
-
|
|
160
|
-
# Force regeneration of subtasks for all pending tasks
|
|
161
|
-
taskgraph expand --all --force
|
|
162
|
-
|
|
163
|
-
# Use the research model for research-backed subtask generation
|
|
164
|
-
taskgraph expand --id=3 --research
|
|
165
|
-
|
|
166
|
-
# Use the research model for research-backed generation on all pending tasks
|
|
167
|
-
taskgraph expand --all --research
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
## Clearing Subtasks
|
|
171
|
-
|
|
172
|
-
The `clear-subtasks` command allows you to remove subtasks from specified tasks:
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
# Clear subtasks from a specific task
|
|
176
|
-
taskgraph clear-subtasks --id=3
|
|
177
|
-
|
|
178
|
-
# Clear subtasks from multiple tasks
|
|
179
|
-
taskgraph clear-subtasks --id=1,2,3
|
|
180
|
-
|
|
181
|
-
# Clear subtasks from all tasks
|
|
182
|
-
taskgraph clear-subtasks --all
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
Notes:
|
|
186
|
-
|
|
187
|
-
- After clearing subtasks, task files are automatically regenerated
|
|
188
|
-
- This is useful when you want to regenerate subtasks with a different approach
|
|
189
|
-
- Can be combined with the `expand` command to immediately generate new subtasks
|
|
190
|
-
- Works with both parent tasks and individual subtasks
|
|
191
|
-
|
|
192
|
-
## AI Integration (Updated)
|
|
193
|
-
|
|
194
|
-
- The script now uses a unified AI service layer (`ai-services-unified.js`).
|
|
195
|
-
- Model selection (for example `opus`, `sonnet` or `haiku`) is determined by the configuration in `.taskgraph/config.json` based on the requested `role` (`main` or `research`).
|
|
196
|
-
- No provider API keys are needed; calls run through your signed-in Claude Code.
|
|
197
|
-
- To use the research capabilities (for example `expand --research`), configure a model for the `research` role with `taskgraph models --setup`.
|
|
198
|
-
|
|
199
|
-
## Logging
|
|
200
|
-
|
|
201
|
-
The script supports different logging levels controlled by the `TASKGRAPH_LOG_LEVEL` environment variable:
|
|
202
|
-
|
|
203
|
-
- `debug`: Detailed information, typically useful for troubleshooting
|
|
204
|
-
- `info`: Confirmation that things are working as expected (default)
|
|
205
|
-
- `warn`: Warning messages that don't prevent execution
|
|
206
|
-
- `error`: Error messages that might prevent execution
|
|
207
|
-
|
|
208
|
-
When `DEBUG=true` is set, debug logs are also written to a `dev-debug.log` file in the project root.
|
|
209
|
-
|
|
210
|
-
## Managing Task Dependencies
|
|
211
|
-
|
|
212
|
-
The `add-dependency` and `remove-dependency` commands allow you to manage task dependencies:
|
|
213
|
-
|
|
214
|
-
```bash
|
|
215
|
-
# Add a dependency to a task
|
|
216
|
-
taskgraph add-dependency --id=<id> --depends-on=<id>
|
|
217
|
-
|
|
218
|
-
# Remove a dependency from a task
|
|
219
|
-
taskgraph remove-dependency --id=<id> --depends-on=<id>
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
These commands:
|
|
223
|
-
|
|
224
|
-
1. **Allow precise dependency management**:
|
|
225
|
-
|
|
226
|
-
- Add dependencies between tasks with automatic validation
|
|
227
|
-
- Remove dependencies when they're no longer needed
|
|
228
|
-
- Update task files automatically after changes
|
|
229
|
-
|
|
230
|
-
2. **Include validation checks**:
|
|
231
|
-
|
|
232
|
-
- Prevent circular dependencies (a task depending on itself)
|
|
233
|
-
- Prevent duplicate dependencies
|
|
234
|
-
- Verify that both tasks exist before adding/removing dependencies
|
|
235
|
-
- Check if dependencies exist before attempting to remove them
|
|
236
|
-
|
|
237
|
-
3. **Provide clear feedback**:
|
|
238
|
-
|
|
239
|
-
- Success messages confirm when dependencies are added/removed
|
|
240
|
-
- Error messages explain why operations failed (if applicable)
|
|
241
|
-
|
|
242
|
-
4. **Automatically update task files**:
|
|
243
|
-
- Regenerates task files to reflect dependency changes
|
|
244
|
-
- Ensures tasks and their files stay synchronized
|
|
245
|
-
|
|
246
|
-
## Dependency Validation and Fixing
|
|
247
|
-
|
|
248
|
-
The script provides two specialized commands to ensure task dependencies remain valid and properly maintained:
|
|
249
|
-
|
|
250
|
-
### Validating Dependencies
|
|
251
|
-
|
|
252
|
-
The `validate-dependencies` command allows you to check for invalid dependencies without making changes:
|
|
253
|
-
|
|
254
|
-
```bash
|
|
255
|
-
# Check for invalid dependencies in tasks.json
|
|
256
|
-
taskgraph validate-dependencies
|
|
257
|
-
|
|
258
|
-
# Specify a different tasks file
|
|
259
|
-
taskgraph validate-dependencies --file=custom-tasks.json
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
This command:
|
|
263
|
-
|
|
264
|
-
- Scans all tasks and subtasks for non-existent dependencies
|
|
265
|
-
- Identifies potential self-dependencies (tasks referencing themselves)
|
|
266
|
-
- Reports all found issues without modifying files
|
|
267
|
-
- Provides a comprehensive summary of dependency state
|
|
268
|
-
- Gives detailed statistics on task dependencies
|
|
269
|
-
|
|
270
|
-
Use this command to audit your task structure before applying fixes.
|
|
271
|
-
|
|
272
|
-
### Fixing Dependencies
|
|
273
|
-
|
|
274
|
-
The `fix-dependencies` command proactively finds and fixes all invalid dependencies:
|
|
275
|
-
|
|
276
|
-
```bash
|
|
277
|
-
# Find and fix all invalid dependencies
|
|
278
|
-
taskgraph fix-dependencies
|
|
279
|
-
|
|
280
|
-
# Specify a different tasks file
|
|
281
|
-
taskgraph fix-dependencies --file=custom-tasks.json
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
This command:
|
|
285
|
-
|
|
286
|
-
1. **Validates all dependencies** across tasks and subtasks
|
|
287
|
-
2. **Automatically removes**:
|
|
288
|
-
- References to non-existent tasks and subtasks
|
|
289
|
-
- Self-dependencies (tasks depending on themselves)
|
|
290
|
-
3. **Fixes issues in both**:
|
|
291
|
-
- The tasks.json data structure
|
|
292
|
-
- Individual task files during regeneration
|
|
293
|
-
4. **Provides a detailed report**:
|
|
294
|
-
- Types of issues fixed (non-existent vs. self-dependencies)
|
|
295
|
-
- Number of tasks affected (tasks vs. subtasks)
|
|
296
|
-
- Where fixes were applied (tasks.json vs. task files)
|
|
297
|
-
- List of all individual fixes made
|
|
298
|
-
|
|
299
|
-
This is especially useful when tasks have been deleted or IDs have changed, potentially breaking dependency chains.
|
|
300
|
-
|
|
301
|
-
## Analyzing Task Complexity
|
|
302
|
-
|
|
303
|
-
The `analyze-complexity` command allows you to automatically assess task complexity and generate expansion recommendations:
|
|
304
|
-
|
|
305
|
-
```bash
|
|
306
|
-
# Analyze all tasks and generate expansion recommendations
|
|
307
|
-
taskgraph analyze-complexity
|
|
308
|
-
|
|
309
|
-
# Specify a custom output file
|
|
310
|
-
taskgraph analyze-complexity --output=custom-report.json
|
|
311
|
-
|
|
312
|
-
# Override the model used for analysis
|
|
313
|
-
taskgraph analyze-complexity --model=claude-3-opus-20240229
|
|
314
|
-
|
|
315
|
-
# Set a custom complexity threshold (1-10)
|
|
316
|
-
taskgraph analyze-complexity --threshold=6
|
|
317
|
-
|
|
318
|
-
# Use the research model for research-backed complexity analysis
|
|
319
|
-
taskgraph analyze-complexity --research
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
Notes:
|
|
323
|
-
|
|
324
|
-
- The command uses Claude to analyze each task's complexity (or the research model with the --research flag)
|
|
325
|
-
- Tasks are scored on a scale of 1-10
|
|
326
|
-
- Each task receives a recommended number of subtasks based on DEFAULT_SUBTASKS configuration
|
|
327
|
-
- The default output path is `scripts/task-complexity-report.json`
|
|
328
|
-
- Each task in the analysis includes a ready-to-use `expansionCommand` that can be copied directly to the terminal or executed programmatically
|
|
329
|
-
- Tasks with complexity scores below the threshold (default: 5) may not need expansion
|
|
330
|
-
- The research flag provides more contextual and informed complexity assessments
|
|
331
|
-
|
|
332
|
-
### Integration with Expand Command
|
|
333
|
-
|
|
334
|
-
The `expand` command automatically checks for and uses complexity analysis if available:
|
|
335
|
-
|
|
336
|
-
```bash
|
|
337
|
-
# Expand a task, using complexity report recommendations if available
|
|
338
|
-
taskgraph expand --id=8
|
|
339
|
-
|
|
340
|
-
# Expand all tasks, prioritizing by complexity score if a report exists
|
|
341
|
-
taskgraph expand --all
|
|
342
|
-
|
|
343
|
-
# Override recommendations with explicit values
|
|
344
|
-
taskgraph expand --id=8 --num=5 --prompt="Custom prompt"
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
When a complexity report exists:
|
|
348
|
-
|
|
349
|
-
- The `expand` command will use the recommended subtask count from the report (unless overridden)
|
|
350
|
-
- It will use the tailored expansion prompt from the report (unless a custom prompt is provided)
|
|
351
|
-
- When using `--all`, tasks are sorted by complexity score (highest first)
|
|
352
|
-
- The `--research` flag is preserved from the complexity analysis to expansion
|
|
353
|
-
|
|
354
|
-
The output report structure is:
|
|
355
|
-
|
|
356
|
-
```json
|
|
357
|
-
{
|
|
358
|
-
"meta": {
|
|
359
|
-
"generatedAt": "2023-06-15T12:34:56.789Z",
|
|
360
|
-
"tasksAnalyzed": 20,
|
|
361
|
-
"thresholdScore": 5,
|
|
362
|
-
"projectName": "Your Project Name",
|
|
363
|
-
"usedResearch": true
|
|
364
|
-
},
|
|
365
|
-
"complexityAnalysis": [
|
|
366
|
-
{
|
|
367
|
-
"taskId": 8,
|
|
368
|
-
"taskTitle": "Develop Implementation Drift Handling",
|
|
369
|
-
"complexityScore": 9.5,
|
|
370
|
-
"recommendedSubtasks": 6,
|
|
371
|
-
"expansionPrompt": "Create subtasks that handle detecting...",
|
|
372
|
-
"reasoning": "This task requires sophisticated logic...",
|
|
373
|
-
"expansionCommand": "taskgraph expand --id=8 --num=6 --prompt=\"Create subtasks...\" --research"
|
|
374
|
-
}
|
|
375
|
-
// More tasks sorted by complexity score (highest first)
|
|
376
|
-
]
|
|
377
|
-
}
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
## Finding the Next Task
|
|
381
|
-
|
|
382
|
-
The `next` command helps you determine which task to work on next based on dependencies and status:
|
|
383
|
-
|
|
384
|
-
```bash
|
|
385
|
-
# Show the next task to work on
|
|
386
|
-
taskgraph next
|
|
387
|
-
|
|
388
|
-
# Specify a different tasks file
|
|
389
|
-
taskgraph next --file=custom-tasks.json
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
This command:
|
|
393
|
-
|
|
394
|
-
1. Identifies all **eligible tasks** - pending or in-progress tasks whose dependencies are all satisfied (marked as done)
|
|
395
|
-
2. **Prioritizes** these eligible tasks by:
|
|
396
|
-
- Priority level (high > medium > low)
|
|
397
|
-
- Number of dependencies (fewer dependencies first)
|
|
398
|
-
- Task ID (lower ID first)
|
|
399
|
-
3. **Displays** comprehensive information about the selected task:
|
|
400
|
-
- Basic task details (ID, title, priority, dependencies)
|
|
401
|
-
- Detailed description and implementation details
|
|
402
|
-
- Subtasks if they exist
|
|
403
|
-
4. Provides **contextual suggested actions**:
|
|
404
|
-
- Command to mark the task as in-progress
|
|
405
|
-
- Command to mark the task as done when completed
|
|
406
|
-
- Commands for working with subtasks (update status or expand)
|
|
407
|
-
|
|
408
|
-
This feature ensures you're always working on the most appropriate task based on your project's current state and dependency structure.
|
|
409
|
-
|
|
410
|
-
## Showing Task Details
|
|
411
|
-
|
|
412
|
-
The `show` command allows you to view detailed information about a specific task:
|
|
413
|
-
|
|
414
|
-
```bash
|
|
415
|
-
# Show details for a specific task
|
|
416
|
-
taskgraph show 1
|
|
417
|
-
|
|
418
|
-
# Alternative syntax with --id option
|
|
419
|
-
taskgraph show --id=1
|
|
420
|
-
|
|
421
|
-
# Show details for a subtask
|
|
422
|
-
taskgraph show --id=1.2
|
|
423
|
-
|
|
424
|
-
# Specify a different tasks file
|
|
425
|
-
taskgraph show 3 --file=custom-tasks.json
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
This command:
|
|
429
|
-
|
|
430
|
-
1. **Displays comprehensive information** about the specified task:
|
|
431
|
-
- Basic task details (ID, title, priority, dependencies, status)
|
|
432
|
-
- Full description and implementation details
|
|
433
|
-
- Test strategy information
|
|
434
|
-
- Subtasks if they exist
|
|
435
|
-
2. **Handles both regular tasks and subtasks**:
|
|
436
|
-
- For regular tasks, shows all subtasks and their status
|
|
437
|
-
- For subtasks, shows the parent task relationship
|
|
438
|
-
3. **Provides contextual suggested actions**:
|
|
439
|
-
- Commands to update the task status
|
|
440
|
-
- Commands for working with subtasks
|
|
441
|
-
- For subtasks, provides a link to view the parent task
|
|
442
|
-
|
|
443
|
-
This command is particularly useful when you need to examine a specific task in detail before implementing it or when you want to check the status and details of a particular task.
|