No longer need the templates folder and its files.
This commit is contained in:
@@ -36,8 +36,6 @@ The script can be configured through environment variables in a `.env` file at t
|
|||||||
npm install task-master-ai
|
npm install task-master-ai
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
### Initialize a new project
|
### Initialize a new project
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -69,6 +67,22 @@ cd claude-task-master
|
|||||||
node scripts/init.js
|
node scripts/init.js
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Task Structure
|
||||||
|
|
||||||
|
Tasks in tasks.json have the following structure:
|
||||||
|
|
||||||
|
- `id`: Unique identifier for the task (Example: `1`)
|
||||||
|
- `title`: Brief, descriptive title of the task (Example: `"Initialize Repo"`)
|
||||||
|
- `description`: Concise description of what the task involves (Example: `"Create a new repository, set up initial structure."`)
|
||||||
|
- `status`: Current state of the task (Example: `"pending"`, `"done"`, `"deferred"`)
|
||||||
|
- `dependencies`: IDs of tasks that must be completed before this task (Example: `[1, 2]`)
|
||||||
|
- Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending)
|
||||||
|
- This helps quickly identify which prerequisite tasks are blocking work
|
||||||
|
- `priority`: Importance level of the task (Example: `"high"`, `"medium"`, `"low"`)
|
||||||
|
- `details`: In-depth implementation instructions (Example: `"Use GitHub client ID/secret, handle callback, set session token."`)
|
||||||
|
- `testStrategy`: Verification approach (Example: `"Deploy and call endpoint to confirm 'Hello World' response."`)
|
||||||
|
- `subtasks`: List of smaller, more specific tasks that make up the main task (Example: `[{"id": 1, "title": "Configure OAuth", ...}]`)
|
||||||
|
|
||||||
## Integrating with Cursor AI
|
## Integrating with Cursor AI
|
||||||
|
|
||||||
Claude Task Master is designed to work seamlessly with [Cursor AI](https://www.cursor.so/), providing a structured workflow for AI-driven development.
|
Claude Task Master is designed to work seamlessly with [Cursor AI](https://www.cursor.so/), providing a structured workflow for AI-driven development.
|
||||||
@@ -127,7 +141,7 @@ What tasks are available to work on next?
|
|||||||
|
|
||||||
The agent will:
|
The agent will:
|
||||||
- Run `node scripts/dev.js list` to see all tasks
|
- Run `node scripts/dev.js list` to see all tasks
|
||||||
- Run `node scripts/dev.js list --with-subtasks` to see tasks with their subtasks
|
- Run `node scripts/dev.js next` to determine the next task to work on
|
||||||
- Analyze dependencies to determine which tasks are ready to be worked on
|
- Analyze dependencies to determine which tasks are ready to be worked on
|
||||||
- Prioritize tasks based on priority level and ID order
|
- Prioritize tasks based on priority level and ID order
|
||||||
- Suggest the next task(s) to implement
|
- Suggest the next task(s) to implement
|
||||||
@@ -227,77 +241,95 @@ The agent will execute:
|
|||||||
node scripts/dev.js expand --id=5 --research
|
node scripts/dev.js expand --id=5 --research
|
||||||
```
|
```
|
||||||
|
|
||||||
You can also apply research-backed generation to all tasks:
|
## Command Reference
|
||||||
```
|
|
||||||
Please break down all pending tasks using research-backed generation.
|
|
||||||
```
|
|
||||||
|
|
||||||
The agent will execute:
|
Here's a comprehensive reference of all available commands:
|
||||||
```bash
|
|
||||||
node scripts/dev.js expand --all --research
|
|
||||||
```
|
|
||||||
|
|
||||||
## Manual Command Reference
|
|
||||||
|
|
||||||
While the Cursor agent will handle most commands for you, you can also run them manually:
|
|
||||||
|
|
||||||
### Parse PRD
|
### Parse PRD
|
||||||
```bash
|
```bash
|
||||||
|
# Parse a PRD file and generate tasks
|
||||||
npm run parse-prd -- --input=<prd-file.txt>
|
npm run parse-prd -- --input=<prd-file.txt>
|
||||||
|
|
||||||
|
# Limit the number of tasks generated
|
||||||
|
npm run dev -- parse-prd --input=<prd-file.txt> --tasks=10
|
||||||
```
|
```
|
||||||
|
|
||||||
### List Tasks
|
### List Tasks
|
||||||
```bash
|
```bash
|
||||||
|
# List all tasks
|
||||||
npm run list
|
npm run list
|
||||||
```
|
|
||||||
|
|
||||||
# List tasks with a specific status
|
# List tasks with a specific status
|
||||||
```bash
|
|
||||||
npm run dev -- list --status=<status>
|
npm run dev -- list --status=<status>
|
||||||
```
|
|
||||||
|
|
||||||
# List tasks with subtasks
|
# List tasks with subtasks
|
||||||
```bash
|
|
||||||
npm run dev -- list --with-subtasks
|
npm run dev -- list --with-subtasks
|
||||||
```
|
|
||||||
|
|
||||||
# List tasks with a specific status and include subtasks
|
# List tasks with a specific status and include subtasks
|
||||||
```bash
|
|
||||||
npm run dev -- list --status=<status> --with-subtasks
|
npm run dev -- list --status=<status> --with-subtasks
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Show Next Task
|
||||||
|
```bash
|
||||||
|
# Show the next task to work on based on dependencies and status
|
||||||
|
npm run dev -- next
|
||||||
|
```
|
||||||
|
|
||||||
|
### Show Specific Task
|
||||||
|
```bash
|
||||||
|
# Show details of a specific task
|
||||||
|
npm run dev -- show <id>
|
||||||
|
# or
|
||||||
|
npm run dev -- show --id=<id>
|
||||||
|
|
||||||
|
# View a specific subtask (e.g., subtask 2 of task 1)
|
||||||
|
npm run dev -- show 1.2
|
||||||
|
```
|
||||||
|
|
||||||
### Update Tasks
|
### Update Tasks
|
||||||
```bash
|
```bash
|
||||||
|
# Update tasks from a specific ID and provide context
|
||||||
npm run dev -- update --from=<id> --prompt="<prompt>"
|
npm run dev -- update --from=<id> --prompt="<prompt>"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Generate Task Files
|
### Generate Task Files
|
||||||
```bash
|
```bash
|
||||||
|
# Generate individual task files from tasks.json
|
||||||
npm run generate
|
npm run generate
|
||||||
```
|
```
|
||||||
|
|
||||||
### Set Task Status
|
### Set Task Status
|
||||||
```bash
|
```bash
|
||||||
|
# Set status of a single task
|
||||||
npm run dev -- set-status --id=<id> --status=<status>
|
npm run dev -- set-status --id=<id> --status=<status>
|
||||||
|
|
||||||
|
# Set status for multiple tasks
|
||||||
|
npm run dev -- set-status --id=1,2,3 --status=<status>
|
||||||
|
|
||||||
|
# Set status for subtasks
|
||||||
|
npm run dev -- set-status --id=1.1,1.2 --status=<status>
|
||||||
```
|
```
|
||||||
|
|
||||||
When marking a task as "done", all of its subtasks will automatically be marked as "done" as well.
|
When marking a task as "done", all of its subtasks will automatically be marked as "done" as well.
|
||||||
|
|
||||||
### Expand Tasks
|
### Expand Tasks
|
||||||
```bash
|
```bash
|
||||||
npm run dev -- expand --id=<id> --subtasks=<number> --prompt="<context>"
|
# Expand a specific task with subtasks
|
||||||
```
|
npm run dev -- expand --id=<id> --subtasks=<number>
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npm run dev -- expand --all
|
|
||||||
```
|
|
||||||
|
|
||||||
For research-backed subtask generation:
|
# Expand with additional context
|
||||||
```bash
|
npm run dev -- expand --id=<id> --prompt="<context>"
|
||||||
|
|
||||||
|
# Expand all pending tasks
|
||||||
|
npm run dev -- expand --all
|
||||||
|
|
||||||
|
# Force regeneration of subtasks for tasks that already have them
|
||||||
|
npm run dev -- expand --all --force
|
||||||
|
|
||||||
|
# Research-backed subtask generation for a specific task
|
||||||
npm run dev -- expand --id=<id> --research
|
npm run dev -- expand --id=<id> --research
|
||||||
```
|
|
||||||
or
|
# Research-backed generation for all tasks
|
||||||
```bash
|
|
||||||
npm run dev -- expand --all --research
|
npm run dev -- expand --all --research
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -313,6 +345,27 @@ npm run dev -- clear-subtasks --id=1,2,3
|
|||||||
npm run dev -- clear-subtasks --all
|
npm run dev -- clear-subtasks --all
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Analyze Task Complexity
|
||||||
|
```bash
|
||||||
|
# Analyze complexity of all tasks
|
||||||
|
npm run dev -- analyze-complexity
|
||||||
|
|
||||||
|
# Save report to a custom location
|
||||||
|
npm run dev -- analyze-complexity --output=my-report.json
|
||||||
|
|
||||||
|
# Use a specific LLM model
|
||||||
|
npm run dev -- analyze-complexity --model=claude-3-opus-20240229
|
||||||
|
|
||||||
|
# Set a custom complexity threshold (1-10)
|
||||||
|
npm run dev -- analyze-complexity --threshold=6
|
||||||
|
|
||||||
|
# Use an alternative tasks file
|
||||||
|
npm run dev -- analyze-complexity --file=custom-tasks.json
|
||||||
|
|
||||||
|
# Use Perplexity AI for research-backed complexity analysis
|
||||||
|
npm run dev -- analyze-complexity --research
|
||||||
|
```
|
||||||
|
|
||||||
### Managing Task Dependencies
|
### Managing Task Dependencies
|
||||||
```bash
|
```bash
|
||||||
# Add a dependency to a task
|
# Add a dependency to a task
|
||||||
@@ -328,113 +381,17 @@ npm run dev -- validate-dependencies
|
|||||||
npm run dev -- fix-dependencies
|
npm run dev -- fix-dependencies
|
||||||
```
|
```
|
||||||
|
|
||||||
## Task Structure
|
## Feature Details
|
||||||
|
|
||||||
Tasks in tasks.json have the following structure:
|
|
||||||
|
|
||||||
- `id`: Unique identifier for the task
|
|
||||||
- `title`: Brief, descriptive title of the task
|
|
||||||
- `description`: Concise description of what the task involves
|
|
||||||
- `status`: Current state of the task (pending, done, deferred)
|
|
||||||
- `dependencies`: IDs of tasks that must be completed before this task
|
|
||||||
- `priority`: Importance level of the task (high, medium, low)
|
|
||||||
- `details`: In-depth instructions for implementing the task
|
|
||||||
- `testStrategy`: Approach for verifying the task has been completed correctly
|
|
||||||
- `subtasks`: List of smaller, more specific tasks that make up the main task
|
|
||||||
|
|
||||||
Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending) throughout the system, making it easy to see which prerequisite tasks are done and which still need work.
|
|
||||||
|
|
||||||
## Best Practices for AI-Driven Development
|
|
||||||
|
|
||||||
1. **Start with a detailed PRD**: The more detailed your PRD, the better the generated tasks will be.
|
|
||||||
|
|
||||||
2. **Review generated tasks**: After parsing the PRD, review the tasks to ensure they make sense and have appropriate dependencies.
|
|
||||||
|
|
||||||
3. **Follow the dependency chain**: Always respect task dependencies - the Cursor agent will help with this.
|
|
||||||
|
|
||||||
4. **Update as you go**: If your implementation diverges from the plan, use the update command to keep future tasks aligned with your current approach.
|
|
||||||
|
|
||||||
5. **Break down complex tasks**: Use the expand command to break down complex tasks into manageable subtasks.
|
|
||||||
|
|
||||||
6. **Regenerate task files**: After any updates to tasks.json, regenerate the task files to keep them in sync.
|
|
||||||
|
|
||||||
7. **Communicate context to the agent**: When asking the Cursor agent to help with a task, provide context about what you're trying to achieve.
|
|
||||||
|
|
||||||
## Example Cursor AI Interactions
|
|
||||||
|
|
||||||
### Starting a new project
|
|
||||||
```
|
|
||||||
I've just initialized a new project with Claude Task Master. I have a PRD at scripts/prd.txt.
|
|
||||||
Can you help me parse it and set up the initial tasks?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Working on tasks
|
|
||||||
```
|
|
||||||
What's the next task I should work on? Please consider dependencies and priorities.
|
|
||||||
```
|
|
||||||
|
|
||||||
### Implementing a specific task
|
|
||||||
```
|
|
||||||
I'd like to implement task 4. Can you help me understand what needs to be done and how to approach it?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Managing subtasks
|
|
||||||
```
|
|
||||||
I need to regenerate the subtasks for task 3 with a different approach. Can you help me clear and regenerate them?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Handling changes
|
|
||||||
```
|
|
||||||
We've decided to use MongoDB instead of PostgreSQL. Can you update all future tasks to reflect this change?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Completing work
|
|
||||||
```
|
|
||||||
I've finished implementing the authentication system described in task 2. All tests are passing.
|
|
||||||
Please mark it as complete and tell me what I should work on next.
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
For more detailed documentation on the scripts and command-line options, see the [scripts/README.md](scripts/README.md) file in your initialized project.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT
|
|
||||||
|
|
||||||
### Analyzing Task Complexity
|
### Analyzing Task Complexity
|
||||||
|
|
||||||
To analyze the complexity of tasks and automatically generate expansion recommendations:
|
The `analyze-complexity` command:
|
||||||
|
- Analyzes each task using AI to assess its complexity on a scale of 1-10
|
||||||
```bash
|
|
||||||
npm run dev -- analyze-complexity
|
|
||||||
```
|
|
||||||
|
|
||||||
This command:
|
|
||||||
- Analyzes each task using AI to assess its complexity
|
|
||||||
- Recommends optimal number of subtasks based on configured DEFAULT_SUBTASKS
|
- Recommends optimal number of subtasks based on configured DEFAULT_SUBTASKS
|
||||||
- Generates tailored prompts for expanding each task
|
- Generates tailored prompts for expanding each task
|
||||||
- Creates a comprehensive JSON report with ready-to-use commands
|
- Creates a comprehensive JSON report with ready-to-use commands
|
||||||
- Saves the report to scripts/task-complexity-report.json by default
|
- Saves the report to scripts/task-complexity-report.json by default
|
||||||
|
|
||||||
Options:
|
|
||||||
```bash
|
|
||||||
# Save report to a custom location
|
|
||||||
npm run dev -- analyze-complexity --output=my-report.json
|
|
||||||
|
|
||||||
# Use a specific LLM model
|
|
||||||
npm run dev -- analyze-complexity --model=claude-3-opus-20240229
|
|
||||||
|
|
||||||
# Set a custom complexity threshold (1-10)
|
|
||||||
npm run dev -- analyze-complexity --threshold=6
|
|
||||||
|
|
||||||
# Use an alternative tasks file
|
|
||||||
npm run dev -- analyze-complexity --file=custom-tasks.json
|
|
||||||
|
|
||||||
# Use Perplexity AI for research-backed complexity analysis
|
|
||||||
npm run dev -- analyze-complexity --research
|
|
||||||
```
|
|
||||||
|
|
||||||
The generated report contains:
|
The generated report contains:
|
||||||
- Complexity analysis for each task (scored 1-10)
|
- Complexity analysis for each task (scored 1-10)
|
||||||
- Recommended number of subtasks based on complexity
|
- Recommended number of subtasks based on complexity
|
||||||
@@ -443,15 +400,7 @@ The generated report contains:
|
|||||||
|
|
||||||
### Smart Task Expansion
|
### Smart Task Expansion
|
||||||
|
|
||||||
The `expand` command now automatically checks for and uses the complexity report:
|
The `expand` command automatically checks for and uses the complexity report:
|
||||||
|
|
||||||
```bash
|
|
||||||
# Expand a task, using complexity report recommendations if available
|
|
||||||
npm run dev -- expand --id=8
|
|
||||||
|
|
||||||
# Expand all tasks, prioritizing by complexity score if a report exists
|
|
||||||
npm run dev -- expand --all
|
|
||||||
```
|
|
||||||
|
|
||||||
When a complexity report exists:
|
When a complexity report exists:
|
||||||
- Tasks are automatically expanded using the recommended subtask count and prompts
|
- Tasks are automatically expanded using the recommended subtask count and prompts
|
||||||
@@ -472,17 +421,9 @@ npm run dev -- expand --id=8
|
|||||||
npm run dev -- expand --all
|
npm run dev -- expand --all
|
||||||
```
|
```
|
||||||
|
|
||||||
This integration ensures that task expansion is informed by thorough complexity analysis, resulting in better subtask organization and more efficient development.
|
|
||||||
|
|
||||||
### Finding the Next Task
|
### Finding the Next Task
|
||||||
|
|
||||||
To find the next task to work on based on dependencies and status:
|
The `next` command:
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev -- next
|
|
||||||
```
|
|
||||||
|
|
||||||
This command:
|
|
||||||
- Identifies tasks that are pending/in-progress and have all dependencies satisfied
|
- Identifies tasks that are pending/in-progress and have all dependencies satisfied
|
||||||
- Prioritizes tasks by priority level, dependency count, and task ID
|
- Prioritizes tasks by priority level, dependency count, and task ID
|
||||||
- Displays comprehensive information about the selected task:
|
- Displays comprehensive information about the selected task:
|
||||||
@@ -494,24 +435,9 @@ This command:
|
|||||||
- Command to mark the task as done
|
- Command to mark the task as done
|
||||||
- Commands for working with subtasks
|
- Commands for working with subtasks
|
||||||
|
|
||||||
Example Cursor AI interaction:
|
|
||||||
```
|
|
||||||
What's the next task I should work on?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Viewing Specific Task Details
|
### Viewing Specific Task Details
|
||||||
|
|
||||||
To view detailed information about a specific task:
|
The `show` command:
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev -- show 1
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npm run dev -- show --id=1.2
|
|
||||||
```
|
|
||||||
|
|
||||||
This command:
|
|
||||||
- Displays comprehensive details about a specific task or subtask
|
- Displays comprehensive details about a specific task or subtask
|
||||||
- Shows task status, priority, dependencies, and detailed implementation notes
|
- Shows task status, priority, dependencies, and detailed implementation notes
|
||||||
- For parent tasks, displays all subtasks and their status
|
- For parent tasks, displays all subtasks and their status
|
||||||
@@ -519,46 +445,25 @@ This command:
|
|||||||
- Provides contextual action suggestions based on the task's state
|
- Provides contextual action suggestions based on the task's state
|
||||||
- Works with both regular tasks and subtasks (using the format taskId.subtaskId)
|
- Works with both regular tasks and subtasks (using the format taskId.subtaskId)
|
||||||
|
|
||||||
Example Cursor AI interaction:
|
|
||||||
```
|
|
||||||
Show me the details for task 3
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```
|
|
||||||
Tell me more about subtask 2.1
|
|
||||||
```
|
|
||||||
|
|
||||||
## Task Structure
|
|
||||||
|
|
||||||
Tasks in tasks.json have the following structure:
|
|
||||||
|
|
||||||
- `id`: Unique identifier for the task
|
|
||||||
- `title`: Brief, descriptive title of the task
|
|
||||||
- `description`: Concise description of what the task involves
|
|
||||||
- `status`: Current state of the task (pending, done, deferred)
|
|
||||||
- `dependencies`: IDs of tasks that must be completed before this task
|
|
||||||
- `priority`: Importance level of the task (high, medium, low)
|
|
||||||
- `details`: In-depth instructions for implementing the task
|
|
||||||
- `testStrategy`: Approach for verifying the task has been completed correctly
|
|
||||||
- `subtasks`: List of smaller, more specific tasks that make up the main task
|
|
||||||
|
|
||||||
Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending) throughout the system, making it easy to see which prerequisite tasks are done and which still need work.
|
|
||||||
|
|
||||||
## Best Practices for AI-Driven Development
|
## Best Practices for AI-Driven Development
|
||||||
|
|
||||||
1. **Start with a detailed PRD**: The more detailed your PRD, the better the generated tasks will be.
|
1. **Start with a detailed PRD**: The more detailed your PRD, the better the generated tasks will be.
|
||||||
|
|
||||||
2. **Review generated tasks**: After parsing the PRD, review the tasks to ensure they make sense and have appropriate dependencies.
|
2. **Review generated tasks**: After parsing the PRD, review the tasks to ensure they make sense and have appropriate dependencies.
|
||||||
|
|
||||||
3. **Follow the dependency chain**: Always respect task dependencies - the Cursor agent will help with this.
|
3. **Analyze task complexity**: Use the complexity analysis feature to identify which tasks should be broken down further.
|
||||||
|
|
||||||
4. **Update as you go**: If your implementation diverges from the plan, use the update command to keep future tasks aligned with your current approach.
|
4. **Follow the dependency chain**: Always respect task dependencies - the Cursor agent will help with this.
|
||||||
|
|
||||||
5. **Break down complex tasks**: Use the expand command to break down complex tasks into manageable subtasks.
|
5. **Update as you go**: If your implementation diverges from the plan, use the update command to keep future tasks aligned with your current approach.
|
||||||
|
|
||||||
6. **Regenerate task files**: After any updates to tasks.json, regenerate the task files to keep them in sync.
|
6. **Break down complex tasks**: Use the expand command to break down complex tasks into manageable subtasks.
|
||||||
|
|
||||||
7. **Communicate context to the agent**: When asking the Cursor agent to help with a task, provide context about what you're trying to achieve.
|
7. **Regenerate task files**: After any updates to tasks.json, regenerate the task files to keep them in sync.
|
||||||
|
|
||||||
|
8. **Communicate context to the agent**: When asking the Cursor agent to help with a task, provide context about what you're trying to achieve.
|
||||||
|
|
||||||
|
9. **Validate dependencies**: Periodically run the validate-dependencies command to check for invalid or circular dependencies.
|
||||||
|
|
||||||
## Example Cursor AI Interactions
|
## Example Cursor AI Interactions
|
||||||
|
|
||||||
@@ -594,56 +499,7 @@ I've finished implementing the authentication system described in task 2. All te
|
|||||||
Please mark it as complete and tell me what I should work on next.
|
Please mark it as complete and tell me what I should work on next.
|
||||||
```
|
```
|
||||||
|
|
||||||
## Documentation
|
### Analyzing complexity
|
||||||
|
|
||||||
For more detailed documentation on the scripts and command-line options, see the [scripts/README.md](scripts/README.md) file in your initialized project.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT
|
|
||||||
|
|
||||||
### Analyzing Task Complexity
|
|
||||||
|
|
||||||
To analyze the complexity of tasks and automatically generate expansion recommendations:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev -- analyze-complexity
|
|
||||||
```
|
```
|
||||||
|
Can you analyze the complexity of our tasks to help me understand which ones need to be broken down further?
|
||||||
This command:
|
|
||||||
- Analyzes each task using AI to assess its complexity
|
|
||||||
- Recommends optimal number of subtasks based on configured DEFAULT_SUBTASKS
|
|
||||||
- Generates tailored prompts for expanding each task
|
|
||||||
- Creates a comprehensive JSON report with ready-to-use commands
|
|
||||||
- Saves the report to scripts/task-complexity-report.json by default
|
|
||||||
|
|
||||||
Options:
|
|
||||||
```bash
|
|
||||||
# Save report to a custom location
|
|
||||||
npm run dev -- analyze-complexity --output=my-report.json
|
|
||||||
|
|
||||||
# Use a specific LLM model
|
|
||||||
npm run dev -- analyze-complexity --model=claude-3-opus-20240229
|
|
||||||
|
|
||||||
# Set a custom complexity threshold (1-10)
|
|
||||||
npm run dev -- analyze-complexity --threshold=6
|
|
||||||
|
|
||||||
# Use an alternative tasks file
|
|
||||||
npm run dev -- analyze-complexity --file=custom-tasks.json
|
|
||||||
|
|
||||||
# Use Perplexity AI for research-backed complexity analysis
|
|
||||||
npm run dev -- analyze-complexity --research
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The generated report contains:
|
|
||||||
- Complexity analysis for each task (scored 1-10)
|
|
||||||
- Recommended number of subtasks based on complexity
|
|
||||||
- AI-generated expansion prompts customized for each task
|
|
||||||
- Ready-to-run expansion commands directly within each task analysis
|
|
||||||
|
|
||||||
### Smart Task Expansion
|
|
||||||
|
|
||||||
The `expand` command now automatically checks for and uses the complexity report:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Expand a task, using complexity report recommendations if available
|
|
||||||
503
README.md
503
README.md
@@ -34,9 +34,508 @@ This will create the necessary file structure for your project, including:
|
|||||||
- `tasks.json` - Empty tasks file
|
- `tasks.json` - Empty tasks file
|
||||||
- `tasks/` - Directory for task files
|
- `tasks/` - Directory for task files
|
||||||
|
|
||||||
## Documentation
|
# Documentation
|
||||||
|
|
||||||
For more detailed documentation, see the README.md file in your initialized project.
|
## Requirements
|
||||||
|
|
||||||
|
- Node.js 14.0.0 or higher
|
||||||
|
- Anthropic API key (Claude API)
|
||||||
|
- Anthropic SDK version 0.39.0 or higher
|
||||||
|
- OpenAI SDK (for Perplexity API integration, optional)
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The script can be configured through environment variables in a `.env` file at the root of the project:
|
||||||
|
|
||||||
|
### Required Configuration
|
||||||
|
- `ANTHROPIC_API_KEY`: Your Anthropic API key for Claude
|
||||||
|
|
||||||
|
### Optional Configuration
|
||||||
|
- `MODEL`: Specify which Claude model to use (default: "claude-3-7-sonnet-20250219")
|
||||||
|
- `MAX_TOKENS`: Maximum tokens for model responses (default: 4000)
|
||||||
|
- `TEMPERATURE`: Temperature for model responses (default: 0.7)
|
||||||
|
- `PERPLEXITY_API_KEY`: Your Perplexity API key for research-backed subtask generation
|
||||||
|
- `PERPLEXITY_MODEL`: Specify which Perplexity model to use (default: "sonar-medium-online")
|
||||||
|
- `DEBUG`: Enable debug logging (default: false)
|
||||||
|
- `LOG_LEVEL`: Log level - debug, info, warn, error (default: info)
|
||||||
|
- `DEFAULT_SUBTASKS`: Default number of subtasks when expanding (default: 3)
|
||||||
|
- `DEFAULT_PRIORITY`: Default priority for generated tasks (default: medium)
|
||||||
|
- `PROJECT_NAME`: Override default project name in tasks.json
|
||||||
|
- `PROJECT_VERSION`: Override default version in tasks.json
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install task-master-ai
|
||||||
|
```
|
||||||
|
|
||||||
|
### Initialize a new project
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npx claude-task-init
|
||||||
|
```
|
||||||
|
|
||||||
|
This will prompt you for project details and set up a new project with the necessary files and structure.
|
||||||
|
|
||||||
|
### Important Notes
|
||||||
|
|
||||||
|
1. This package uses ES modules. Your package.json should include `"type": "module"`.
|
||||||
|
2. The Anthropic SDK version should be 0.39.0 or higher.
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### If `npx claude-task-init` doesn't respond:
|
||||||
|
|
||||||
|
Try running it with Node directly:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
node node_modules/claude-task-master/scripts/init.js
|
||||||
|
```
|
||||||
|
|
||||||
|
Or clone the repository and run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/eyaltoledano/claude-task-master.git
|
||||||
|
cd claude-task-master
|
||||||
|
node scripts/init.js
|
||||||
|
```
|
||||||
|
|
||||||
|
## Task Structure
|
||||||
|
|
||||||
|
Tasks in tasks.json have the following structure:
|
||||||
|
|
||||||
|
- `id`: Unique identifier for the task (Example: `1`)
|
||||||
|
- `title`: Brief, descriptive title of the task (Example: `"Initialize Repo"`)
|
||||||
|
- `description`: Concise description of what the task involves (Example: `"Create a new repository, set up initial structure."`)
|
||||||
|
- `status`: Current state of the task (Example: `"pending"`, `"done"`, `"deferred"`)
|
||||||
|
- `dependencies`: IDs of tasks that must be completed before this task (Example: `[1, 2]`)
|
||||||
|
- Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending)
|
||||||
|
- This helps quickly identify which prerequisite tasks are blocking work
|
||||||
|
- `priority`: Importance level of the task (Example: `"high"`, `"medium"`, `"low"`)
|
||||||
|
- `details`: In-depth implementation instructions (Example: `"Use GitHub client ID/secret, handle callback, set session token."`)
|
||||||
|
- `testStrategy`: Verification approach (Example: `"Deploy and call endpoint to confirm 'Hello World' response."`)
|
||||||
|
- `subtasks`: List of smaller, more specific tasks that make up the main task (Example: `[{"id": 1, "title": "Configure OAuth", ...}]`)
|
||||||
|
|
||||||
|
## Integrating with Cursor AI
|
||||||
|
|
||||||
|
Claude Task Master is designed to work seamlessly with [Cursor AI](https://www.cursor.so/), providing a structured workflow for AI-driven development.
|
||||||
|
|
||||||
|
### Setup with Cursor
|
||||||
|
|
||||||
|
1. After initializing your project, open it in Cursor
|
||||||
|
2. The `.cursor/rules/dev_workflow.mdc` file is automatically loaded by Cursor, providing the AI with knowledge about the task management system
|
||||||
|
3. Place your PRD document in the `scripts/` directory (e.g., `scripts/prd.txt`)
|
||||||
|
4. Open Cursor's AI chat and switch to Agent mode
|
||||||
|
|
||||||
|
### Initial Task Generation
|
||||||
|
|
||||||
|
In Cursor's AI chat, instruct the agent to generate tasks from your PRD:
|
||||||
|
|
||||||
|
```
|
||||||
|
Please use the dev.js script to parse my PRD and generate tasks. The PRD is located at scripts/prd.txt.
|
||||||
|
```
|
||||||
|
|
||||||
|
The agent will execute:
|
||||||
|
```bash
|
||||||
|
node scripts/dev.js parse-prd --input=scripts/prd.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
This will:
|
||||||
|
- Parse your PRD document
|
||||||
|
- Generate a structured `tasks.json` file with tasks, dependencies, priorities, and test strategies
|
||||||
|
- The agent will understand this process due to the Cursor rules
|
||||||
|
|
||||||
|
### Generate Individual Task Files
|
||||||
|
|
||||||
|
Next, ask the agent to generate individual task files:
|
||||||
|
|
||||||
|
```
|
||||||
|
Please generate individual task files from tasks.json
|
||||||
|
```
|
||||||
|
|
||||||
|
The agent will execute:
|
||||||
|
```bash
|
||||||
|
node scripts/dev.js generate
|
||||||
|
```
|
||||||
|
|
||||||
|
This creates individual task files in the `tasks/` directory (e.g., `task_001.txt`, `task_002.txt`), making it easier to reference specific tasks.
|
||||||
|
|
||||||
|
## AI-Driven Development Workflow
|
||||||
|
|
||||||
|
The Cursor agent is pre-configured (via the rules file) to follow this workflow:
|
||||||
|
|
||||||
|
### 1. Task Discovery and Selection
|
||||||
|
|
||||||
|
Ask the agent to list available tasks:
|
||||||
|
|
||||||
|
```
|
||||||
|
What tasks are available to work on next?
|
||||||
|
```
|
||||||
|
|
||||||
|
The agent will:
|
||||||
|
- Run `node scripts/dev.js list` to see all tasks
|
||||||
|
- Run `node scripts/dev.js next` to determine the next task to work on
|
||||||
|
- Analyze dependencies to determine which tasks are ready to be worked on
|
||||||
|
- Prioritize tasks based on priority level and ID order
|
||||||
|
- Suggest the next task(s) to implement
|
||||||
|
|
||||||
|
### 2. Task Implementation
|
||||||
|
|
||||||
|
When implementing a task, the agent will:
|
||||||
|
- Reference the task's details section for implementation specifics
|
||||||
|
- Consider dependencies on previous tasks
|
||||||
|
- Follow the project's coding standards
|
||||||
|
- Create appropriate tests based on the task's testStrategy
|
||||||
|
|
||||||
|
You can ask:
|
||||||
|
```
|
||||||
|
Let's implement task 3. What does it involve?
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Task Verification
|
||||||
|
|
||||||
|
Before marking a task as complete, verify it according to:
|
||||||
|
- The task's specified testStrategy
|
||||||
|
- Any automated tests in the codebase
|
||||||
|
- Manual verification if required
|
||||||
|
|
||||||
|
### 4. Task Completion
|
||||||
|
|
||||||
|
When a task is completed, tell the agent:
|
||||||
|
|
||||||
|
```
|
||||||
|
Task 3 is now complete. Please update its status.
|
||||||
|
```
|
||||||
|
|
||||||
|
The agent will execute:
|
||||||
|
```bash
|
||||||
|
node scripts/dev.js set-status --id=3 --status=done
|
||||||
|
```
|
||||||
|
|
||||||
|
### 5. Handling Implementation Drift
|
||||||
|
|
||||||
|
If during implementation, you discover that:
|
||||||
|
- The current approach differs significantly from what was planned
|
||||||
|
- Future tasks need to be modified due to current implementation choices
|
||||||
|
- New dependencies or requirements have emerged
|
||||||
|
|
||||||
|
Tell the agent:
|
||||||
|
```
|
||||||
|
We've changed our approach. We're now using Express instead of Fastify. Please update all future tasks to reflect this change.
|
||||||
|
```
|
||||||
|
|
||||||
|
The agent will execute:
|
||||||
|
```bash
|
||||||
|
node scripts/dev.js update --from=4 --prompt="Now we are using Express instead of Fastify."
|
||||||
|
```
|
||||||
|
|
||||||
|
This will rewrite or re-scope subsequent tasks in tasks.json while preserving completed work.
|
||||||
|
|
||||||
|
### 6. Breaking Down Complex Tasks
|
||||||
|
|
||||||
|
For complex tasks that need more granularity:
|
||||||
|
|
||||||
|
```
|
||||||
|
Task 5 seems complex. Can you break it down into subtasks?
|
||||||
|
```
|
||||||
|
|
||||||
|
The agent will execute:
|
||||||
|
```bash
|
||||||
|
node scripts/dev.js expand --id=5 --subtasks=3
|
||||||
|
```
|
||||||
|
|
||||||
|
You can provide additional context:
|
||||||
|
```
|
||||||
|
Please break down task 5 with a focus on security considerations.
|
||||||
|
```
|
||||||
|
|
||||||
|
The agent will execute:
|
||||||
|
```bash
|
||||||
|
node scripts/dev.js expand --id=5 --prompt="Focus on security aspects"
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also expand all pending tasks:
|
||||||
|
```
|
||||||
|
Please break down all pending tasks into subtasks.
|
||||||
|
```
|
||||||
|
|
||||||
|
The agent will execute:
|
||||||
|
```bash
|
||||||
|
node scripts/dev.js expand --all
|
||||||
|
```
|
||||||
|
|
||||||
|
For research-backed subtask generation using Perplexity AI:
|
||||||
|
```
|
||||||
|
Please break down task 5 using research-backed generation.
|
||||||
|
```
|
||||||
|
|
||||||
|
The agent will execute:
|
||||||
|
```bash
|
||||||
|
node scripts/dev.js expand --id=5 --research
|
||||||
|
```
|
||||||
|
|
||||||
|
## Command Reference
|
||||||
|
|
||||||
|
Here's a comprehensive reference of all available commands:
|
||||||
|
|
||||||
|
### Parse PRD
|
||||||
|
```bash
|
||||||
|
# Parse a PRD file and generate tasks
|
||||||
|
npm run parse-prd -- --input=<prd-file.txt>
|
||||||
|
|
||||||
|
# Limit the number of tasks generated
|
||||||
|
npm run dev -- parse-prd --input=<prd-file.txt> --tasks=10
|
||||||
|
```
|
||||||
|
|
||||||
|
### List Tasks
|
||||||
|
```bash
|
||||||
|
# List all tasks
|
||||||
|
npm run list
|
||||||
|
|
||||||
|
# List tasks with a specific status
|
||||||
|
npm run dev -- list --status=<status>
|
||||||
|
|
||||||
|
# List tasks with subtasks
|
||||||
|
npm run dev -- list --with-subtasks
|
||||||
|
|
||||||
|
# List tasks with a specific status and include subtasks
|
||||||
|
npm run dev -- list --status=<status> --with-subtasks
|
||||||
|
```
|
||||||
|
|
||||||
|
### Show Next Task
|
||||||
|
```bash
|
||||||
|
# Show the next task to work on based on dependencies and status
|
||||||
|
npm run dev -- next
|
||||||
|
```
|
||||||
|
|
||||||
|
### Show Specific Task
|
||||||
|
```bash
|
||||||
|
# Show details of a specific task
|
||||||
|
npm run dev -- show <id>
|
||||||
|
# or
|
||||||
|
npm run dev -- show --id=<id>
|
||||||
|
|
||||||
|
# View a specific subtask (e.g., subtask 2 of task 1)
|
||||||
|
npm run dev -- show 1.2
|
||||||
|
```
|
||||||
|
|
||||||
|
### Update Tasks
|
||||||
|
```bash
|
||||||
|
# Update tasks from a specific ID and provide context
|
||||||
|
npm run dev -- update --from=<id> --prompt="<prompt>"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Generate Task Files
|
||||||
|
```bash
|
||||||
|
# Generate individual task files from tasks.json
|
||||||
|
npm run generate
|
||||||
|
```
|
||||||
|
|
||||||
|
### Set Task Status
|
||||||
|
```bash
|
||||||
|
# Set status of a single task
|
||||||
|
npm run dev -- set-status --id=<id> --status=<status>
|
||||||
|
|
||||||
|
# Set status for multiple tasks
|
||||||
|
npm run dev -- set-status --id=1,2,3 --status=<status>
|
||||||
|
|
||||||
|
# Set status for subtasks
|
||||||
|
npm run dev -- set-status --id=1.1,1.2 --status=<status>
|
||||||
|
```
|
||||||
|
|
||||||
|
When marking a task as "done", all of its subtasks will automatically be marked as "done" as well.
|
||||||
|
|
||||||
|
### Expand Tasks
|
||||||
|
```bash
|
||||||
|
# Expand a specific task with subtasks
|
||||||
|
npm run dev -- expand --id=<id> --subtasks=<number>
|
||||||
|
|
||||||
|
# Expand with additional context
|
||||||
|
npm run dev -- expand --id=<id> --prompt="<context>"
|
||||||
|
|
||||||
|
# Expand all pending tasks
|
||||||
|
npm run dev -- expand --all
|
||||||
|
|
||||||
|
# Force regeneration of subtasks for tasks that already have them
|
||||||
|
npm run dev -- expand --all --force
|
||||||
|
|
||||||
|
# Research-backed subtask generation for a specific task
|
||||||
|
npm run dev -- expand --id=<id> --research
|
||||||
|
|
||||||
|
# Research-backed generation for all tasks
|
||||||
|
npm run dev -- expand --all --research
|
||||||
|
```
|
||||||
|
|
||||||
|
### Clear Subtasks
|
||||||
|
```bash
|
||||||
|
# Clear subtasks from a specific task
|
||||||
|
npm run dev -- clear-subtasks --id=<id>
|
||||||
|
|
||||||
|
# Clear subtasks from multiple tasks
|
||||||
|
npm run dev -- clear-subtasks --id=1,2,3
|
||||||
|
|
||||||
|
# Clear subtasks from all tasks
|
||||||
|
npm run dev -- clear-subtasks --all
|
||||||
|
```
|
||||||
|
|
||||||
|
### Analyze Task Complexity
|
||||||
|
```bash
|
||||||
|
# Analyze complexity of all tasks
|
||||||
|
npm run dev -- analyze-complexity
|
||||||
|
|
||||||
|
# Save report to a custom location
|
||||||
|
npm run dev -- analyze-complexity --output=my-report.json
|
||||||
|
|
||||||
|
# Use a specific LLM model
|
||||||
|
npm run dev -- analyze-complexity --model=claude-3-opus-20240229
|
||||||
|
|
||||||
|
# Set a custom complexity threshold (1-10)
|
||||||
|
npm run dev -- analyze-complexity --threshold=6
|
||||||
|
|
||||||
|
# Use an alternative tasks file
|
||||||
|
npm run dev -- analyze-complexity --file=custom-tasks.json
|
||||||
|
|
||||||
|
# Use Perplexity AI for research-backed complexity analysis
|
||||||
|
npm run dev -- analyze-complexity --research
|
||||||
|
```
|
||||||
|
|
||||||
|
### Managing Task Dependencies
|
||||||
|
```bash
|
||||||
|
# Add a dependency to a task
|
||||||
|
npm run dev -- add-dependency --id=<id> --depends-on=<id>
|
||||||
|
|
||||||
|
# Remove a dependency from a task
|
||||||
|
npm run dev -- remove-dependency --id=<id> --depends-on=<id>
|
||||||
|
|
||||||
|
# Validate dependencies without fixing them
|
||||||
|
npm run dev -- validate-dependencies
|
||||||
|
|
||||||
|
# Find and fix invalid dependencies automatically
|
||||||
|
npm run dev -- fix-dependencies
|
||||||
|
```
|
||||||
|
|
||||||
|
## Feature Details
|
||||||
|
|
||||||
|
### Analyzing Task Complexity
|
||||||
|
|
||||||
|
The `analyze-complexity` command:
|
||||||
|
- Analyzes each task using AI to assess its complexity on a scale of 1-10
|
||||||
|
- Recommends optimal number of subtasks based on configured DEFAULT_SUBTASKS
|
||||||
|
- Generates tailored prompts for expanding each task
|
||||||
|
- Creates a comprehensive JSON report with ready-to-use commands
|
||||||
|
- Saves the report to scripts/task-complexity-report.json by default
|
||||||
|
|
||||||
|
The generated report contains:
|
||||||
|
- Complexity analysis for each task (scored 1-10)
|
||||||
|
- Recommended number of subtasks based on complexity
|
||||||
|
- AI-generated expansion prompts customized for each task
|
||||||
|
- Ready-to-run expansion commands directly within each task analysis
|
||||||
|
|
||||||
|
### Smart Task Expansion
|
||||||
|
|
||||||
|
The `expand` command automatically checks for and uses the complexity report:
|
||||||
|
|
||||||
|
When a complexity report exists:
|
||||||
|
- Tasks are automatically expanded using the recommended subtask count and prompts
|
||||||
|
- When expanding all tasks, they're processed in order of complexity (highest first)
|
||||||
|
- Research-backed generation is preserved from the complexity analysis
|
||||||
|
- You can still override recommendations with explicit command-line options
|
||||||
|
|
||||||
|
Example workflow:
|
||||||
|
```bash
|
||||||
|
# Generate the complexity analysis report with research capabilities
|
||||||
|
npm run dev -- analyze-complexity --research
|
||||||
|
|
||||||
|
# Review the report in scripts/task-complexity-report.json
|
||||||
|
|
||||||
|
# Expand tasks using the optimized recommendations
|
||||||
|
npm run dev -- expand --id=8
|
||||||
|
# or expand all tasks
|
||||||
|
npm run dev -- expand --all
|
||||||
|
```
|
||||||
|
|
||||||
|
### Finding the Next Task
|
||||||
|
|
||||||
|
The `next` command:
|
||||||
|
- Identifies tasks that are pending/in-progress and have all dependencies satisfied
|
||||||
|
- Prioritizes tasks by priority level, dependency count, and task ID
|
||||||
|
- Displays comprehensive information about the selected task:
|
||||||
|
- Basic task details (ID, title, priority, dependencies)
|
||||||
|
- Implementation details
|
||||||
|
- Subtasks (if they exist)
|
||||||
|
- Provides contextual suggested actions:
|
||||||
|
- Command to mark the task as in-progress
|
||||||
|
- Command to mark the task as done
|
||||||
|
- Commands for working with subtasks
|
||||||
|
|
||||||
|
### Viewing Specific Task Details
|
||||||
|
|
||||||
|
The `show` command:
|
||||||
|
- Displays comprehensive details about a specific task or subtask
|
||||||
|
- Shows task status, priority, dependencies, and detailed implementation notes
|
||||||
|
- For parent tasks, displays all subtasks and their status
|
||||||
|
- For subtasks, shows parent task relationship
|
||||||
|
- Provides contextual action suggestions based on the task's state
|
||||||
|
- Works with both regular tasks and subtasks (using the format taskId.subtaskId)
|
||||||
|
|
||||||
|
## Best Practices for AI-Driven Development
|
||||||
|
|
||||||
|
1. **Start with a detailed PRD**: The more detailed your PRD, the better the generated tasks will be.
|
||||||
|
|
||||||
|
2. **Review generated tasks**: After parsing the PRD, review the tasks to ensure they make sense and have appropriate dependencies.
|
||||||
|
|
||||||
|
3. **Analyze task complexity**: Use the complexity analysis feature to identify which tasks should be broken down further.
|
||||||
|
|
||||||
|
4. **Follow the dependency chain**: Always respect task dependencies - the Cursor agent will help with this.
|
||||||
|
|
||||||
|
5. **Update as you go**: If your implementation diverges from the plan, use the update command to keep future tasks aligned with your current approach.
|
||||||
|
|
||||||
|
6. **Break down complex tasks**: Use the expand command to break down complex tasks into manageable subtasks.
|
||||||
|
|
||||||
|
7. **Regenerate task files**: After any updates to tasks.json, regenerate the task files to keep them in sync.
|
||||||
|
|
||||||
|
8. **Communicate context to the agent**: When asking the Cursor agent to help with a task, provide context about what you're trying to achieve.
|
||||||
|
|
||||||
|
9. **Validate dependencies**: Periodically run the validate-dependencies command to check for invalid or circular dependencies.
|
||||||
|
|
||||||
|
## Example Cursor AI Interactions
|
||||||
|
|
||||||
|
### Starting a new project
|
||||||
|
```
|
||||||
|
I've just initialized a new project with Claude Task Master. I have a PRD at scripts/prd.txt.
|
||||||
|
Can you help me parse it and set up the initial tasks?
|
||||||
|
```
|
||||||
|
|
||||||
|
### Working on tasks
|
||||||
|
```
|
||||||
|
What's the next task I should work on? Please consider dependencies and priorities.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Implementing a specific task
|
||||||
|
```
|
||||||
|
I'd like to implement task 4. Can you help me understand what needs to be done and how to approach it?
|
||||||
|
```
|
||||||
|
|
||||||
|
### Managing subtasks
|
||||||
|
```
|
||||||
|
I need to regenerate the subtasks for task 3 with a different approach. Can you help me clear and regenerate them?
|
||||||
|
```
|
||||||
|
|
||||||
|
### Handling changes
|
||||||
|
```
|
||||||
|
We've decided to use MongoDB instead of PostgreSQL. Can you update all future tasks to reflect this change?
|
||||||
|
```
|
||||||
|
|
||||||
|
### Completing work
|
||||||
|
```
|
||||||
|
I've finished implementing the authentication system described in task 2. All tests are passing.
|
||||||
|
Please mark it as complete and tell me what I should work on next.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Analyzing complexity
|
||||||
|
```
|
||||||
|
Can you analyze the complexity of our tasks to help me understand which ones need to be broken down further?
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "task-master-ai",
|
"name": "task-master-ai",
|
||||||
"version": "0.9.9",
|
"version": "0.9.11",
|
||||||
"description": "A task management system for ambitious AI-driven development that doesn't overwhelm and confuse Cursor.",
|
"description": "A task management system for ambitious AI-driven development that doesn't overwhelm and confuse Cursor.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -1,643 +0,0 @@
|
|||||||
# Task Master
|
|
||||||
### by [@eyaltoledano](https://x.com/eyaltoledano)
|
|
||||||
|
|
||||||
A task management system for AI-driven development with Claude, designed to work seamlessly with Cursor AI.
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
- Node.js 14.0.0 or higher
|
|
||||||
- Anthropic API key (Claude API)
|
|
||||||
- Anthropic SDK version 0.39.0 or higher
|
|
||||||
- OpenAI SDK (for Perplexity API integration, optional)
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
The script can be configured through environment variables in a `.env` file at the root of the project:
|
|
||||||
|
|
||||||
### Required Configuration
|
|
||||||
- `ANTHROPIC_API_KEY`: Your Anthropic API key for Claude
|
|
||||||
|
|
||||||
### Optional Configuration
|
|
||||||
- `MODEL`: Specify which Claude model to use (default: "claude-3-7-sonnet-20250219")
|
|
||||||
- `MAX_TOKENS`: Maximum tokens for model responses (default: 4000)
|
|
||||||
- `TEMPERATURE`: Temperature for model responses (default: 0.7)
|
|
||||||
- `PERPLEXITY_API_KEY`: Your Perplexity API key for research-backed subtask generation
|
|
||||||
- `PERPLEXITY_MODEL`: Specify which Perplexity model to use (default: "sonar-medium-online")
|
|
||||||
- `DEBUG`: Enable debug logging (default: false)
|
|
||||||
- `LOG_LEVEL`: Log level - debug, info, warn, error (default: info)
|
|
||||||
- `DEFAULT_SUBTASKS`: Default number of subtasks when expanding (default: 3)
|
|
||||||
- `DEFAULT_PRIORITY`: Default priority for generated tasks (default: medium)
|
|
||||||
- `PROJECT_NAME`: Override default project name in tasks.json
|
|
||||||
- `PROJECT_VERSION`: Override default version in tasks.json
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm install task-master-ai
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
### Initialize a new project
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npx claude-task-init
|
|
||||||
```
|
|
||||||
|
|
||||||
This will prompt you for project details and set up a new project with the necessary files and structure.
|
|
||||||
|
|
||||||
### Important Notes
|
|
||||||
|
|
||||||
1. This package uses ES modules. Your package.json should include `"type": "module"`.
|
|
||||||
2. The Anthropic SDK version should be 0.39.0 or higher.
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
### If `npx claude-task-init` doesn't respond:
|
|
||||||
|
|
||||||
Try running it with Node directly:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
node node_modules/claude-task-master/scripts/init.js
|
|
||||||
```
|
|
||||||
|
|
||||||
Or clone the repository and run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/eyaltoledano/claude-task-master.git
|
|
||||||
cd claude-task-master
|
|
||||||
node scripts/init.js
|
|
||||||
```
|
|
||||||
|
|
||||||
## Integrating with Cursor AI
|
|
||||||
|
|
||||||
Claude Task Master is designed to work seamlessly with [Cursor AI](https://www.cursor.so/), providing a structured workflow for AI-driven development.
|
|
||||||
|
|
||||||
### Setup with Cursor
|
|
||||||
|
|
||||||
1. After initializing your project, open it in Cursor
|
|
||||||
2. The `.cursor/rules/dev_workflow.mdc` file is automatically loaded by Cursor, providing the AI with knowledge about the task management system
|
|
||||||
3. Place your PRD document in the `scripts/` directory (e.g., `scripts/prd.txt`)
|
|
||||||
4. Open Cursor's AI chat and switch to Agent mode
|
|
||||||
|
|
||||||
### Initial Task Generation
|
|
||||||
|
|
||||||
In Cursor's AI chat, instruct the agent to generate tasks from your PRD:
|
|
||||||
|
|
||||||
```
|
|
||||||
Please use the dev.js script to parse my PRD and generate tasks. The PRD is located at scripts/prd.txt.
|
|
||||||
```
|
|
||||||
|
|
||||||
The agent will execute:
|
|
||||||
```bash
|
|
||||||
node scripts/dev.js parse-prd --input=scripts/prd.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
This will:
|
|
||||||
- Parse your PRD document
|
|
||||||
- Generate a structured `tasks.json` file with tasks, dependencies, priorities, and test strategies
|
|
||||||
- The agent will understand this process due to the Cursor rules
|
|
||||||
|
|
||||||
### Generate Individual Task Files
|
|
||||||
|
|
||||||
Next, ask the agent to generate individual task files:
|
|
||||||
|
|
||||||
```
|
|
||||||
Please generate individual task files from tasks.json
|
|
||||||
```
|
|
||||||
|
|
||||||
The agent will execute:
|
|
||||||
```bash
|
|
||||||
node scripts/dev.js generate
|
|
||||||
```
|
|
||||||
|
|
||||||
This creates individual task files in the `tasks/` directory (e.g., `task_001.txt`, `task_002.txt`), making it easier to reference specific tasks.
|
|
||||||
|
|
||||||
## AI-Driven Development Workflow
|
|
||||||
|
|
||||||
The Cursor agent is pre-configured (via the rules file) to follow this workflow:
|
|
||||||
|
|
||||||
### 1. Task Discovery and Selection
|
|
||||||
|
|
||||||
Ask the agent to list available tasks:
|
|
||||||
|
|
||||||
```
|
|
||||||
What tasks are available to work on next?
|
|
||||||
```
|
|
||||||
|
|
||||||
The agent will:
|
|
||||||
- Run `node scripts/dev.js list` to see all tasks
|
|
||||||
- Run `node scripts/dev.js list --with-subtasks` to see tasks with their subtasks
|
|
||||||
- Analyze dependencies to determine which tasks are ready to be worked on
|
|
||||||
- Prioritize tasks based on priority level and ID order
|
|
||||||
- Suggest the next task(s) to implement
|
|
||||||
|
|
||||||
### 2. Task Implementation
|
|
||||||
|
|
||||||
When implementing a task, the agent will:
|
|
||||||
- Reference the task's details section for implementation specifics
|
|
||||||
- Consider dependencies on previous tasks
|
|
||||||
- Follow the project's coding standards
|
|
||||||
- Create appropriate tests based on the task's testStrategy
|
|
||||||
|
|
||||||
You can ask:
|
|
||||||
```
|
|
||||||
Let's implement task 3. What does it involve?
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. Task Verification
|
|
||||||
|
|
||||||
Before marking a task as complete, verify it according to:
|
|
||||||
- The task's specified testStrategy
|
|
||||||
- Any automated tests in the codebase
|
|
||||||
- Manual verification if required
|
|
||||||
|
|
||||||
### 4. Task Completion
|
|
||||||
|
|
||||||
When a task is completed, tell the agent:
|
|
||||||
|
|
||||||
```
|
|
||||||
Task 3 is now complete. Please update its status.
|
|
||||||
```
|
|
||||||
|
|
||||||
The agent will execute:
|
|
||||||
```bash
|
|
||||||
node scripts/dev.js set-status --id=3 --status=done
|
|
||||||
```
|
|
||||||
|
|
||||||
### 5. Handling Implementation Drift
|
|
||||||
|
|
||||||
If during implementation, you discover that:
|
|
||||||
- The current approach differs significantly from what was planned
|
|
||||||
- Future tasks need to be modified due to current implementation choices
|
|
||||||
- New dependencies or requirements have emerged
|
|
||||||
|
|
||||||
Tell the agent:
|
|
||||||
```
|
|
||||||
We've changed our approach. We're now using Express instead of Fastify. Please update all future tasks to reflect this change.
|
|
||||||
```
|
|
||||||
|
|
||||||
The agent will execute:
|
|
||||||
```bash
|
|
||||||
node scripts/dev.js update --from=4 --prompt="Now we are using Express instead of Fastify."
|
|
||||||
```
|
|
||||||
|
|
||||||
This will rewrite or re-scope subsequent tasks in tasks.json while preserving completed work.
|
|
||||||
|
|
||||||
### 6. Breaking Down Complex Tasks
|
|
||||||
|
|
||||||
For complex tasks that need more granularity:
|
|
||||||
|
|
||||||
```
|
|
||||||
Task 5 seems complex. Can you break it down into subtasks?
|
|
||||||
```
|
|
||||||
|
|
||||||
The agent will execute:
|
|
||||||
```bash
|
|
||||||
node scripts/dev.js expand --id=5 --subtasks=3
|
|
||||||
```
|
|
||||||
|
|
||||||
You can provide additional context:
|
|
||||||
```
|
|
||||||
Please break down task 5 with a focus on security considerations.
|
|
||||||
```
|
|
||||||
|
|
||||||
The agent will execute:
|
|
||||||
```bash
|
|
||||||
node scripts/dev.js expand --id=5 --prompt="Focus on security aspects"
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also expand all pending tasks:
|
|
||||||
```
|
|
||||||
Please break down all pending tasks into subtasks.
|
|
||||||
```
|
|
||||||
|
|
||||||
The agent will execute:
|
|
||||||
```bash
|
|
||||||
node scripts/dev.js expand --all
|
|
||||||
```
|
|
||||||
|
|
||||||
For research-backed subtask generation using Perplexity AI:
|
|
||||||
```
|
|
||||||
Please break down task 5 using research-backed generation.
|
|
||||||
```
|
|
||||||
|
|
||||||
The agent will execute:
|
|
||||||
```bash
|
|
||||||
node scripts/dev.js expand --id=5 --research
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also apply research-backed generation to all tasks:
|
|
||||||
```
|
|
||||||
Please break down all pending tasks using research-backed generation.
|
|
||||||
```
|
|
||||||
|
|
||||||
The agent will execute:
|
|
||||||
```bash
|
|
||||||
node scripts/dev.js expand --all --research
|
|
||||||
```
|
|
||||||
|
|
||||||
## Manual Command Reference
|
|
||||||
|
|
||||||
While the Cursor agent will handle most commands for you, you can also run them manually:
|
|
||||||
|
|
||||||
### Parse PRD
|
|
||||||
```bash
|
|
||||||
npm run parse-prd -- --input=<prd-file.txt>
|
|
||||||
```
|
|
||||||
|
|
||||||
### List Tasks
|
|
||||||
```bash
|
|
||||||
npm run list
|
|
||||||
```
|
|
||||||
|
|
||||||
# List tasks with a specific status
|
|
||||||
```bash
|
|
||||||
npm run dev -- list --status=<status>
|
|
||||||
```
|
|
||||||
|
|
||||||
# List tasks with subtasks
|
|
||||||
```bash
|
|
||||||
npm run dev -- list --with-subtasks
|
|
||||||
```
|
|
||||||
|
|
||||||
# List tasks with a specific status and include subtasks
|
|
||||||
```bash
|
|
||||||
npm run dev -- list --status=<status> --with-subtasks
|
|
||||||
```
|
|
||||||
|
|
||||||
### Update Tasks
|
|
||||||
```bash
|
|
||||||
npm run dev -- update --from=<id> --prompt="<prompt>"
|
|
||||||
```
|
|
||||||
|
|
||||||
### Generate Task Files
|
|
||||||
```bash
|
|
||||||
npm run generate
|
|
||||||
```
|
|
||||||
|
|
||||||
### Set Task Status
|
|
||||||
```bash
|
|
||||||
npm run dev -- set-status --id=<id> --status=<status>
|
|
||||||
```
|
|
||||||
|
|
||||||
When marking a task as "done", all of its subtasks will automatically be marked as "done" as well.
|
|
||||||
|
|
||||||
### Expand Tasks
|
|
||||||
```bash
|
|
||||||
npm run dev -- expand --id=<id> --subtasks=<number> --prompt="<context>"
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npm run dev -- expand --all
|
|
||||||
```
|
|
||||||
|
|
||||||
For research-backed subtask generation:
|
|
||||||
```bash
|
|
||||||
npm run dev -- expand --id=<id> --research
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npm run dev -- expand --all --research
|
|
||||||
```
|
|
||||||
|
|
||||||
### Clear Subtasks
|
|
||||||
```bash
|
|
||||||
# Clear subtasks from a specific task
|
|
||||||
npm run dev -- clear-subtasks --id=<id>
|
|
||||||
|
|
||||||
# Clear subtasks from multiple tasks
|
|
||||||
npm run dev -- clear-subtasks --id=1,2,3
|
|
||||||
|
|
||||||
# Clear subtasks from all tasks
|
|
||||||
npm run dev -- clear-subtasks --all
|
|
||||||
```
|
|
||||||
|
|
||||||
### Managing Task Dependencies
|
|
||||||
```bash
|
|
||||||
# Add a dependency to a task
|
|
||||||
npm run dev -- add-dependency --id=<id> --depends-on=<id>
|
|
||||||
|
|
||||||
# Remove a dependency from a task
|
|
||||||
npm run dev -- remove-dependency --id=<id> --depends-on=<id>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Task Structure
|
|
||||||
|
|
||||||
Tasks in tasks.json have the following structure:
|
|
||||||
|
|
||||||
- `id`: Unique identifier for the task
|
|
||||||
- `title`: Brief, descriptive title of the task
|
|
||||||
- `description`: Concise description of what the task involves
|
|
||||||
- `status`: Current state of the task (pending, done, deferred)
|
|
||||||
- `dependencies`: IDs of tasks that must be completed before this task
|
|
||||||
- `priority`: Importance level of the task (high, medium, low)
|
|
||||||
- `details`: In-depth instructions for implementing the task
|
|
||||||
- `testStrategy`: Approach for verifying the task has been completed correctly
|
|
||||||
- `subtasks`: List of smaller, more specific tasks that make up the main task
|
|
||||||
|
|
||||||
Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending) throughout the system, making it easy to see which prerequisite tasks are done and which still need work.
|
|
||||||
|
|
||||||
## Best Practices for AI-Driven Development
|
|
||||||
|
|
||||||
1. **Start with a detailed PRD**: The more detailed your PRD, the better the generated tasks will be.
|
|
||||||
|
|
||||||
2. **Review generated tasks**: After parsing the PRD, review the tasks to ensure they make sense and have appropriate dependencies.
|
|
||||||
|
|
||||||
3. **Follow the dependency chain**: Always respect task dependencies - the Cursor agent will help with this.
|
|
||||||
|
|
||||||
4. **Update as you go**: If your implementation diverges from the plan, use the update command to keep future tasks aligned with your current approach.
|
|
||||||
|
|
||||||
5. **Break down complex tasks**: Use the expand command to break down complex tasks into manageable subtasks.
|
|
||||||
|
|
||||||
6. **Regenerate task files**: After any updates to tasks.json, regenerate the task files to keep them in sync.
|
|
||||||
|
|
||||||
7. **Communicate context to the agent**: When asking the Cursor agent to help with a task, provide context about what you're trying to achieve.
|
|
||||||
|
|
||||||
## Example Cursor AI Interactions
|
|
||||||
|
|
||||||
### Starting a new project
|
|
||||||
```
|
|
||||||
I've just initialized a new project with Claude Task Master. I have a PRD at scripts/prd.txt.
|
|
||||||
Can you help me parse it and set up the initial tasks?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Working on tasks
|
|
||||||
```
|
|
||||||
What's the next task I should work on? Please consider dependencies and priorities.
|
|
||||||
```
|
|
||||||
|
|
||||||
### Implementing a specific task
|
|
||||||
```
|
|
||||||
I'd like to implement task 4. Can you help me understand what needs to be done and how to approach it?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Managing subtasks
|
|
||||||
```
|
|
||||||
I need to regenerate the subtasks for task 3 with a different approach. Can you help me clear and regenerate them?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Handling changes
|
|
||||||
```
|
|
||||||
We've decided to use MongoDB instead of PostgreSQL. Can you update all future tasks to reflect this change?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Completing work
|
|
||||||
```
|
|
||||||
I've finished implementing the authentication system described in task 2. All tests are passing.
|
|
||||||
Please mark it as complete and tell me what I should work on next.
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
For more detailed documentation on the scripts and command-line options, see the [scripts/README.md](scripts/README.md) file in your initialized project.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT
|
|
||||||
|
|
||||||
### Analyzing Task Complexity
|
|
||||||
|
|
||||||
To analyze the complexity of tasks and automatically generate expansion recommendations:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev -- analyze-complexity
|
|
||||||
```
|
|
||||||
|
|
||||||
This command:
|
|
||||||
- Analyzes each task using AI to assess its complexity
|
|
||||||
- Recommends optimal number of subtasks based on configured DEFAULT_SUBTASKS
|
|
||||||
- Generates tailored prompts for expanding each task
|
|
||||||
- Creates a comprehensive JSON report with ready-to-use commands
|
|
||||||
- Saves the report to scripts/task-complexity-report.json by default
|
|
||||||
|
|
||||||
Options:
|
|
||||||
```bash
|
|
||||||
# Save report to a custom location
|
|
||||||
npm run dev -- analyze-complexity --output=my-report.json
|
|
||||||
|
|
||||||
# Use a specific LLM model
|
|
||||||
npm run dev -- analyze-complexity --model=claude-3-opus-20240229
|
|
||||||
|
|
||||||
# Set a custom complexity threshold (1-10)
|
|
||||||
npm run dev -- analyze-complexity --threshold=6
|
|
||||||
|
|
||||||
# Use an alternative tasks file
|
|
||||||
npm run dev -- analyze-complexity --file=custom-tasks.json
|
|
||||||
|
|
||||||
# Use Perplexity AI for research-backed complexity analysis
|
|
||||||
npm run dev -- analyze-complexity --research
|
|
||||||
```
|
|
||||||
|
|
||||||
The generated report contains:
|
|
||||||
- Complexity analysis for each task (scored 1-10)
|
|
||||||
- Recommended number of subtasks based on complexity
|
|
||||||
- AI-generated expansion prompts customized for each task
|
|
||||||
- Ready-to-run expansion commands directly within each task analysis
|
|
||||||
|
|
||||||
### Smart Task Expansion
|
|
||||||
|
|
||||||
The `expand` command now automatically checks for and uses the complexity report:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Expand a task, using complexity report recommendations if available
|
|
||||||
npm run dev -- expand --id=8
|
|
||||||
|
|
||||||
# Expand all tasks, prioritizing by complexity score if a report exists
|
|
||||||
npm run dev -- expand --all
|
|
||||||
```
|
|
||||||
|
|
||||||
When a complexity report exists:
|
|
||||||
- Tasks are automatically expanded using the recommended subtask count and prompts
|
|
||||||
- When expanding all tasks, they're processed in order of complexity (highest first)
|
|
||||||
- Research-backed generation is preserved from the complexity analysis
|
|
||||||
- You can still override recommendations with explicit command-line options
|
|
||||||
|
|
||||||
Example workflow:
|
|
||||||
```bash
|
|
||||||
# Generate the complexity analysis report with research capabilities
|
|
||||||
npm run dev -- analyze-complexity --research
|
|
||||||
|
|
||||||
# Review the report in scripts/task-complexity-report.json
|
|
||||||
|
|
||||||
# Expand tasks using the optimized recommendations
|
|
||||||
npm run dev -- expand --id=8
|
|
||||||
# or expand all tasks
|
|
||||||
npm run dev -- expand --all
|
|
||||||
```
|
|
||||||
|
|
||||||
This integration ensures that task expansion is informed by thorough complexity analysis, resulting in better subtask organization and more efficient development.
|
|
||||||
|
|
||||||
### Finding the Next Task
|
|
||||||
|
|
||||||
To find the next task to work on based on dependencies and status:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev -- next
|
|
||||||
```
|
|
||||||
|
|
||||||
This command:
|
|
||||||
- Identifies tasks that are pending/in-progress and have all dependencies satisfied
|
|
||||||
- Prioritizes tasks by priority level, dependency count, and task ID
|
|
||||||
- Displays comprehensive information about the selected task:
|
|
||||||
- Basic task details (ID, title, priority, dependencies)
|
|
||||||
- Implementation details
|
|
||||||
- Subtasks (if they exist)
|
|
||||||
- Provides contextual suggested actions:
|
|
||||||
- Command to mark the task as in-progress
|
|
||||||
- Command to mark the task as done
|
|
||||||
- Commands for working with subtasks
|
|
||||||
|
|
||||||
Example Cursor AI interaction:
|
|
||||||
```
|
|
||||||
What's the next task I should work on?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Viewing Specific Task Details
|
|
||||||
|
|
||||||
To view detailed information about a specific task:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev -- show 1
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npm run dev -- show --id=1.2
|
|
||||||
```
|
|
||||||
|
|
||||||
This command:
|
|
||||||
- Displays comprehensive details about a specific task or subtask
|
|
||||||
- Shows task status, priority, dependencies, and detailed implementation notes
|
|
||||||
- For parent tasks, displays all subtasks and their status
|
|
||||||
- For subtasks, shows parent task relationship
|
|
||||||
- Provides contextual action suggestions based on the task's state
|
|
||||||
- Works with both regular tasks and subtasks (using the format taskId.subtaskId)
|
|
||||||
|
|
||||||
Example Cursor AI interaction:
|
|
||||||
```
|
|
||||||
Show me the details for task 3
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```
|
|
||||||
Tell me more about subtask 2.1
|
|
||||||
```
|
|
||||||
|
|
||||||
## Task Structure
|
|
||||||
|
|
||||||
Tasks in tasks.json have the following structure:
|
|
||||||
|
|
||||||
- `id`: Unique identifier for the task
|
|
||||||
- `title`: Brief, descriptive title of the task
|
|
||||||
- `description`: Concise description of what the task involves
|
|
||||||
- `status`: Current state of the task (pending, done, deferred)
|
|
||||||
- `dependencies`: IDs of tasks that must be completed before this task
|
|
||||||
- `priority`: Importance level of the task (high, medium, low)
|
|
||||||
- `details`: In-depth instructions for implementing the task
|
|
||||||
- `testStrategy`: Approach for verifying the task has been completed correctly
|
|
||||||
- `subtasks`: List of smaller, more specific tasks that make up the main task
|
|
||||||
|
|
||||||
Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending) throughout the system, making it easy to see which prerequisite tasks are done and which still need work.
|
|
||||||
|
|
||||||
## Best Practices for AI-Driven Development
|
|
||||||
|
|
||||||
1. **Start with a detailed PRD**: The more detailed your PRD, the better the generated tasks will be.
|
|
||||||
|
|
||||||
2. **Review generated tasks**: After parsing the PRD, review the tasks to ensure they make sense and have appropriate dependencies.
|
|
||||||
|
|
||||||
3. **Follow the dependency chain**: Always respect task dependencies - the Cursor agent will help with this.
|
|
||||||
|
|
||||||
4. **Update as you go**: If your implementation diverges from the plan, use the update command to keep future tasks aligned with your current approach.
|
|
||||||
|
|
||||||
5. **Break down complex tasks**: Use the expand command to break down complex tasks into manageable subtasks.
|
|
||||||
|
|
||||||
6. **Regenerate task files**: After any updates to tasks.json, regenerate the task files to keep them in sync.
|
|
||||||
|
|
||||||
7. **Communicate context to the agent**: When asking the Cursor agent to help with a task, provide context about what you're trying to achieve.
|
|
||||||
|
|
||||||
## Example Cursor AI Interactions
|
|
||||||
|
|
||||||
### Starting a new project
|
|
||||||
```
|
|
||||||
I've just initialized a new project with Claude Task Master. I have a PRD at scripts/prd.txt.
|
|
||||||
Can you help me parse it and set up the initial tasks?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Working on tasks
|
|
||||||
```
|
|
||||||
What's the next task I should work on? Please consider dependencies and priorities.
|
|
||||||
```
|
|
||||||
|
|
||||||
### Implementing a specific task
|
|
||||||
```
|
|
||||||
I'd like to implement task 4. Can you help me understand what needs to be done and how to approach it?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Managing subtasks
|
|
||||||
```
|
|
||||||
I need to regenerate the subtasks for task 3 with a different approach. Can you help me clear and regenerate them?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Handling changes
|
|
||||||
```
|
|
||||||
We've decided to use MongoDB instead of PostgreSQL. Can you update all future tasks to reflect this change?
|
|
||||||
```
|
|
||||||
|
|
||||||
### Completing work
|
|
||||||
```
|
|
||||||
I've finished implementing the authentication system described in task 2. All tests are passing.
|
|
||||||
Please mark it as complete and tell me what I should work on next.
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
For more detailed documentation on the scripts and command-line options, see the [scripts/README.md](scripts/README.md) file in your initialized project.
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT
|
|
||||||
|
|
||||||
### Analyzing Task Complexity
|
|
||||||
|
|
||||||
To analyze the complexity of tasks and automatically generate expansion recommendations:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run dev -- analyze-complexity
|
|
||||||
```
|
|
||||||
|
|
||||||
This command:
|
|
||||||
- Analyzes each task using AI to assess its complexity
|
|
||||||
- Recommends optimal number of subtasks based on configured DEFAULT_SUBTASKS
|
|
||||||
- Generates tailored prompts for expanding each task
|
|
||||||
- Creates a comprehensive JSON report with ready-to-use commands
|
|
||||||
- Saves the report to scripts/task-complexity-report.json by default
|
|
||||||
|
|
||||||
Options:
|
|
||||||
```bash
|
|
||||||
# Save report to a custom location
|
|
||||||
npm run dev -- analyze-complexity --output=my-report.json
|
|
||||||
|
|
||||||
# Use a specific LLM model
|
|
||||||
npm run dev -- analyze-complexity --model=claude-3-opus-20240229
|
|
||||||
|
|
||||||
# Set a custom complexity threshold (1-10)
|
|
||||||
npm run dev -- analyze-complexity --threshold=6
|
|
||||||
|
|
||||||
# Use an alternative tasks file
|
|
||||||
npm run dev -- analyze-complexity --file=custom-tasks.json
|
|
||||||
|
|
||||||
# Use Perplexity AI for research-backed complexity analysis
|
|
||||||
npm run dev -- analyze-complexity --research
|
|
||||||
```
|
|
||||||
|
|
||||||
The generated report contains:
|
|
||||||
- Complexity analysis for each task (scored 1-10)
|
|
||||||
- Recommended number of subtasks based on complexity
|
|
||||||
- AI-generated expansion prompts customized for each task
|
|
||||||
- Ready-to-run expansion commands directly within each task analysis
|
|
||||||
|
|
||||||
### Smart Task Expansion
|
|
||||||
|
|
||||||
The `expand` command now automatically checks for and uses the complexity report:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Expand a task, using complexity report recommendations if available
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
---
|
|
||||||
description: Guidelines for creating and maintaining Cursor rules to ensure consistency and effectiveness.
|
|
||||||
globs: .cursor/rules/*.mdc
|
|
||||||
alwaysApply: true
|
|
||||||
---
|
|
||||||
|
|
||||||
- **Required Rule Structure:**
|
|
||||||
```markdown
|
|
||||||
---
|
|
||||||
description: Clear, one-line description of what the rule enforces
|
|
||||||
globs: path/to/files/*.ext, other/path/**/*
|
|
||||||
alwaysApply: boolean
|
|
||||||
---
|
|
||||||
|
|
||||||
- **Main Points in Bold**
|
|
||||||
- Sub-points with details
|
|
||||||
- Examples and explanations
|
|
||||||
```
|
|
||||||
|
|
||||||
- **File References:**
|
|
||||||
- Use `[filename](mdc:path/to/file)` ([filename](mdc:filename)) to reference files
|
|
||||||
- Example: [prisma.mdc](mdc:.cursor/rules/prisma.mdc) for rule references
|
|
||||||
- Example: [schema.prisma](mdc:prisma/schema.prisma) for code references
|
|
||||||
|
|
||||||
- **Code Examples:**
|
|
||||||
- Use language-specific code blocks
|
|
||||||
```typescript
|
|
||||||
// ✅ DO: Show good examples
|
|
||||||
const goodExample = true;
|
|
||||||
|
|
||||||
// ❌ DON'T: Show anti-patterns
|
|
||||||
const badExample = false;
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Rule Content Guidelines:**
|
|
||||||
- Start with high-level overview
|
|
||||||
- Include specific, actionable requirements
|
|
||||||
- Show examples of correct implementation
|
|
||||||
- Reference existing code when possible
|
|
||||||
- Keep rules DRY by referencing other rules
|
|
||||||
|
|
||||||
- **Rule Maintenance:**
|
|
||||||
- Update rules when new patterns emerge
|
|
||||||
- Add examples from actual codebase
|
|
||||||
- Remove outdated patterns
|
|
||||||
- Cross-reference related rules
|
|
||||||
|
|
||||||
- **Best Practices:**
|
|
||||||
- Use bullet points for clarity
|
|
||||||
- Keep descriptions concise
|
|
||||||
- Include both DO and DON'T examples
|
|
||||||
- Reference actual code over theoretical examples
|
|
||||||
- Use consistent formatting across rules
|
|
||||||
5201
templates/dev.js
5201
templates/dev.js
File diff suppressed because it is too large
Load Diff
@@ -1,221 +0,0 @@
|
|||||||
---
|
|
||||||
description: Guide for using meta-development script (scripts/dev.js) to manage task-driven development workflows
|
|
||||||
globs: **/*
|
|
||||||
alwaysApply: true
|
|
||||||
---
|
|
||||||
|
|
||||||
- **Development Workflow Process**
|
|
||||||
- Start new projects by running `node scripts/dev.js parse-prd --input=<prd-file.txt>` to generate initial tasks.json
|
|
||||||
- Begin coding sessions with `node scripts/dev.js list` to see current tasks, status, and IDs
|
|
||||||
- Analyze task complexity with `node scripts/dev.js analyze-complexity --research` before breaking down tasks
|
|
||||||
- Select tasks based on dependencies (all marked 'done'), priority level, and ID order
|
|
||||||
- Clarify tasks by checking task files in tasks/ directory or asking for user input
|
|
||||||
- View specific task details using `node scripts/dev.js show --id=<id>` to understand implementation requirements
|
|
||||||
- Break down complex tasks using `node scripts/dev.js expand --id=<id>` with appropriate flags
|
|
||||||
- Clear existing subtasks if needed using `node scripts/dev.js clear-subtasks --id=<id>` before regenerating
|
|
||||||
- Implement code following task details, dependencies, and project standards
|
|
||||||
- Verify tasks according to test strategies before marking as complete
|
|
||||||
- Mark completed tasks with `node scripts/dev.js set-status --id=<id> --status=done`
|
|
||||||
- Update dependent tasks when implementation differs from original plan
|
|
||||||
- Generate task files with `node scripts/dev.js generate` after updating tasks.json
|
|
||||||
- Respect dependency chains and task priorities when selecting work
|
|
||||||
- Report progress regularly using the list command
|
|
||||||
|
|
||||||
- **Task Complexity Analysis**
|
|
||||||
- Run `node scripts/dev.js analyze-complexity --research` for comprehensive analysis
|
|
||||||
- Review complexity report in scripts/task-complexity-report.json
|
|
||||||
- Focus on tasks with highest complexity scores (8-10) for detailed breakdown
|
|
||||||
- Use analysis results to determine appropriate subtask allocation
|
|
||||||
- Note that reports are automatically used by the expand command
|
|
||||||
|
|
||||||
- **Task Breakdown Process**
|
|
||||||
- For tasks with complexity analysis, use `node scripts/dev.js expand --id=<id>`
|
|
||||||
- Otherwise use `node scripts/dev.js expand --id=<id> --subtasks=<number>`
|
|
||||||
- Add `--research` flag to leverage Perplexity AI for research-backed expansion
|
|
||||||
- Use `--prompt="<context>"` to provide additional context when needed
|
|
||||||
- Review and adjust generated subtasks as necessary
|
|
||||||
- Use `--all` flag to expand multiple pending tasks at once
|
|
||||||
- If subtasks need regeneration, clear them first with `clear-subtasks` command
|
|
||||||
|
|
||||||
- **Implementation Drift Handling**
|
|
||||||
- When implementation differs significantly from planned approach
|
|
||||||
- When future tasks need modification due to current implementation choices
|
|
||||||
- When new dependencies or requirements emerge
|
|
||||||
- Call `node scripts/dev.js update --from=<futureTaskId> --prompt="<explanation>"` to update tasks.json
|
|
||||||
|
|
||||||
- **Task Status Management**
|
|
||||||
- Use 'pending' for tasks ready to be worked on
|
|
||||||
- Use 'done' for completed and verified tasks
|
|
||||||
- Use 'deferred' for postponed tasks
|
|
||||||
- Add custom status values as needed for project-specific workflows
|
|
||||||
|
|
||||||
- **Task File Format Reference**
|
|
||||||
```
|
|
||||||
# Task ID: <id>
|
|
||||||
# Title: <title>
|
|
||||||
# Status: <status>
|
|
||||||
# Dependencies: <comma-separated list of dependency IDs>
|
|
||||||
# Priority: <priority>
|
|
||||||
# Description: <brief description>
|
|
||||||
# Details:
|
|
||||||
<detailed implementation notes>
|
|
||||||
|
|
||||||
# Test Strategy:
|
|
||||||
<verification approach>
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Command Reference: parse-prd**
|
|
||||||
- Syntax: `node scripts/dev.js parse-prd --input=<prd-file.txt>`
|
|
||||||
- Description: Parses a PRD document and generates a tasks.json file with structured tasks
|
|
||||||
- Parameters:
|
|
||||||
- `--input=<file>`: Path to the PRD text file (default: sample-prd.txt)
|
|
||||||
- Example: `node scripts/dev.js parse-prd --input=requirements.txt`
|
|
||||||
- Notes: Will overwrite existing tasks.json file. Use with caution.
|
|
||||||
|
|
||||||
- **Command Reference: update**
|
|
||||||
- Syntax: `node scripts/dev.js update --from=<id> --prompt="<prompt>"`
|
|
||||||
- Description: Updates tasks with ID >= specified ID based on the provided prompt
|
|
||||||
- Parameters:
|
|
||||||
- `--from=<id>`: Task ID from which to start updating (required)
|
|
||||||
- `--prompt="<text>"`: Explanation of changes or new context (required)
|
|
||||||
- Example: `node scripts/dev.js update --from=4 --prompt="Now we are using Express instead of Fastify."`
|
|
||||||
- Notes: Only updates tasks not marked as 'done'. Completed tasks remain unchanged.
|
|
||||||
|
|
||||||
- **Command Reference: generate**
|
|
||||||
- Syntax: `node scripts/dev.js generate`
|
|
||||||
- Description: Generates individual task files in tasks/ directory based on tasks.json
|
|
||||||
- Parameters: None
|
|
||||||
- Example: `node scripts/dev.js generate`
|
|
||||||
- Notes: Overwrites existing task files. Creates tasks/ directory if needed.
|
|
||||||
|
|
||||||
- **Command Reference: set-status**
|
|
||||||
- Syntax: `node scripts/dev.js set-status --id=<id> --status=<status>`
|
|
||||||
- Description: Updates the status of a specific task in tasks.json
|
|
||||||
- Parameters:
|
|
||||||
- `--id=<id>`: ID of the task to update (required)
|
|
||||||
- `--status=<status>`: New status value (required)
|
|
||||||
- Example: `node scripts/dev.js set-status --id=3 --status=done`
|
|
||||||
- Notes: Common values are 'done', 'pending', and 'deferred', but any string is accepted.
|
|
||||||
|
|
||||||
- **Command Reference: list**
|
|
||||||
- Syntax: `node scripts/dev.js list`
|
|
||||||
- Description: Lists all tasks in tasks.json with IDs, titles, and status
|
|
||||||
- Parameters: None
|
|
||||||
- Example: `node scripts/dev.js list`
|
|
||||||
- Notes: Provides quick overview of project progress. Use at start of sessions.
|
|
||||||
|
|
||||||
- **Command Reference: expand**
|
|
||||||
- Syntax: `node scripts/dev.js expand --id=<id> [--num=<number>] [--research] [--prompt="<context>"]`
|
|
||||||
- Description: Expands a task with subtasks for detailed implementation
|
|
||||||
- Parameters:
|
|
||||||
- `--id=<id>`: ID of task to expand (required unless using --all)
|
|
||||||
- `--all`: Expand all pending tasks, prioritized by complexity
|
|
||||||
- `--num=<number>`: Number of subtasks to generate (default: from complexity report)
|
|
||||||
- `--research`: Use Perplexity AI for research-backed generation
|
|
||||||
- `--prompt="<text>"`: Additional context for subtask generation
|
|
||||||
- `--force`: Regenerate subtasks even for tasks that already have them
|
|
||||||
- Example: `node scripts/dev.js expand --id=3 --num=5 --research --prompt="Focus on security aspects"`
|
|
||||||
- Notes: Uses complexity report recommendations if available.
|
|
||||||
|
|
||||||
- **Command Reference: analyze-complexity**
|
|
||||||
- Syntax: `node scripts/dev.js analyze-complexity [options]`
|
|
||||||
- Description: Analyzes task complexity and generates expansion recommendations
|
|
||||||
- Parameters:
|
|
||||||
- `--output=<file>, -o`: Output file path (default: scripts/task-complexity-report.json)
|
|
||||||
- `--model=<model>, -m`: Override LLM model to use
|
|
||||||
- `--threshold=<number>, -t`: Minimum score for expansion recommendation (default: 5)
|
|
||||||
- `--file=<path>, -f`: Use alternative tasks.json file
|
|
||||||
- `--research, -r`: Use Perplexity AI for research-backed analysis
|
|
||||||
- Example: `node scripts/dev.js analyze-complexity --research`
|
|
||||||
- Notes: Report includes complexity scores, recommended subtasks, and tailored prompts.
|
|
||||||
|
|
||||||
- **Command Reference: clear-subtasks**
|
|
||||||
- Syntax: `node scripts/dev.js clear-subtasks --id=<id>`
|
|
||||||
- Description: Removes subtasks from specified tasks to allow regeneration
|
|
||||||
- Parameters:
|
|
||||||
- `--id=<id>`: ID or comma-separated IDs of tasks to clear subtasks from
|
|
||||||
- `--all`: Clear subtasks from all tasks
|
|
||||||
- Examples:
|
|
||||||
- `node scripts/dev.js clear-subtasks --id=3`
|
|
||||||
- `node scripts/dev.js clear-subtasks --id=1,2,3`
|
|
||||||
- `node scripts/dev.js clear-subtasks --all`
|
|
||||||
- Notes:
|
|
||||||
- Task files are automatically regenerated after clearing subtasks
|
|
||||||
- Can be combined with expand command to immediately generate new subtasks
|
|
||||||
- Works with both parent tasks and individual subtasks
|
|
||||||
|
|
||||||
- **Task Structure Fields**
|
|
||||||
- **id**: Unique identifier for the task (Example: `1`)
|
|
||||||
- **title**: Brief, descriptive title (Example: `"Initialize Repo"`)
|
|
||||||
- **description**: Concise summary of what the task involves (Example: `"Create a new repository, set up initial structure."`)
|
|
||||||
- **status**: Current state of the task (Example: `"pending"`, `"done"`, `"deferred"`)
|
|
||||||
- **dependencies**: IDs of prerequisite tasks (Example: `[1, 2]`)
|
|
||||||
- Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending)
|
|
||||||
- This helps quickly identify which prerequisite tasks are blocking work
|
|
||||||
- **priority**: Importance level (Example: `"high"`, `"medium"`, `"low"`)
|
|
||||||
- **details**: In-depth implementation instructions (Example: `"Use GitHub client ID/secret, handle callback, set session token."`)
|
|
||||||
- **testStrategy**: Verification approach (Example: `"Deploy and call endpoint to confirm 'Hello World' response."`)
|
|
||||||
- **subtasks**: List of smaller, more specific tasks (Example: `[{"id": 1, "title": "Configure OAuth", ...}]`)
|
|
||||||
|
|
||||||
- **Environment Variables Configuration**
|
|
||||||
- **ANTHROPIC_API_KEY** (Required): Your Anthropic API key for Claude (Example: `ANTHROPIC_API_KEY=sk-ant-api03-...`)
|
|
||||||
- **MODEL** (Default: `"claude-3-7-sonnet-20250219"`): Claude model to use (Example: `MODEL=claude-3-opus-20240229`)
|
|
||||||
- **MAX_TOKENS** (Default: `"4000"`): Maximum tokens for responses (Example: `MAX_TOKENS=8000`)
|
|
||||||
- **TEMPERATURE** (Default: `"0.7"`): Temperature for model responses (Example: `TEMPERATURE=0.5`)
|
|
||||||
- **DEBUG** (Default: `"false"`): Enable debug logging (Example: `DEBUG=true`)
|
|
||||||
- **LOG_LEVEL** (Default: `"info"`): Console output level (Example: `LOG_LEVEL=debug`)
|
|
||||||
- **DEFAULT_SUBTASKS** (Default: `"3"`): Default subtask count (Example: `DEFAULT_SUBTASKS=5`)
|
|
||||||
- **DEFAULT_PRIORITY** (Default: `"medium"`): Default priority (Example: `DEFAULT_PRIORITY=high`)
|
|
||||||
- **PROJECT_NAME** (Default: `"MCP SaaS MVP"`): Project name in metadata (Example: `PROJECT_NAME=My Awesome Project`)
|
|
||||||
- **PROJECT_VERSION** (Default: `"1.0.0"`): Version in metadata (Example: `PROJECT_VERSION=2.1.0`)
|
|
||||||
- **PERPLEXITY_API_KEY**: For research-backed features (Example: `PERPLEXITY_API_KEY=pplx-...`)
|
|
||||||
- **PERPLEXITY_MODEL** (Default: `"sonar-medium-online"`): Perplexity model (Example: `PERPLEXITY_MODEL=sonar-large-online`)
|
|
||||||
|
|
||||||
- **Determining the Next Task**
|
|
||||||
- Run `node scripts/dev.js next` to show the next task to work on
|
|
||||||
- The next command identifies tasks with all dependencies satisfied
|
|
||||||
- Tasks are prioritized by priority level, dependency count, and ID
|
|
||||||
- The command shows comprehensive task information including:
|
|
||||||
- Basic task details and description
|
|
||||||
- Implementation details
|
|
||||||
- Subtasks (if they exist)
|
|
||||||
- Contextual suggested actions
|
|
||||||
- Recommended before starting any new development work
|
|
||||||
- Respects your project's dependency structure
|
|
||||||
- Ensures tasks are completed in the appropriate sequence
|
|
||||||
- Provides ready-to-use commands for common task actions
|
|
||||||
|
|
||||||
- **Viewing Specific Task Details**
|
|
||||||
- Run `node scripts/dev.js show --id=<id>` or `node scripts/dev.js show <id>` to view a specific task
|
|
||||||
- Use dot notation for subtasks: `node scripts/dev.js show 1.2` (shows subtask 2 of task 1)
|
|
||||||
- Displays comprehensive information similar to the next command, but for a specific task
|
|
||||||
- For parent tasks, shows all subtasks and their current status
|
|
||||||
- For subtasks, shows parent task information and relationship
|
|
||||||
- Provides contextual suggested actions appropriate for the specific task
|
|
||||||
- Useful for examining task details before implementation or checking status
|
|
||||||
|
|
||||||
- **Managing Task Dependencies**
|
|
||||||
- Use `node scripts/dev.js add-dependency --id=<id> --depends-on=<id>` to add a dependency
|
|
||||||
- Use `node scripts/dev.js remove-dependency --id=<id> --depends-on=<id>` to remove a dependency
|
|
||||||
- The system prevents circular dependencies and duplicate dependency entries
|
|
||||||
- Dependencies are checked for existence before being added or removed
|
|
||||||
- Task files are automatically regenerated after dependency changes
|
|
||||||
- Dependencies are visualized with status indicators in task listings and files
|
|
||||||
|
|
||||||
- **Command Reference: add-dependency**
|
|
||||||
- Syntax: `node scripts/dev.js add-dependency --id=<id> --depends-on=<id>`
|
|
||||||
- Description: Adds a dependency relationship between two tasks
|
|
||||||
- Parameters:
|
|
||||||
- `--id=<id>`: ID of task that will depend on another task (required)
|
|
||||||
- `--depends-on=<id>`: ID of task that will become a dependency (required)
|
|
||||||
- Example: `node scripts/dev.js add-dependency --id=22 --depends-on=21`
|
|
||||||
- Notes: Prevents circular dependencies and duplicates; updates task files automatically
|
|
||||||
|
|
||||||
- **Command Reference: remove-dependency**
|
|
||||||
- Syntax: `node scripts/dev.js remove-dependency --id=<id> --depends-on=<id>`
|
|
||||||
- Description: Removes a dependency relationship between two tasks
|
|
||||||
- Parameters:
|
|
||||||
- `--id=<id>`: ID of task to remove dependency from (required)
|
|
||||||
- `--depends-on=<id>`: ID of task to remove as a dependency (required)
|
|
||||||
- Example: `node scripts/dev.js remove-dependency --id=22 --depends-on=21`
|
|
||||||
- Notes: Checks if dependency actually exists; updates task files automatically
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
# Required
|
|
||||||
ANTHROPIC_API_KEY=your-api-key-here # Format: sk-ant-api03-...
|
|
||||||
PERPLEXITY_API_KEY=pplx-abcde
|
|
||||||
|
|
||||||
# Optional - defaults shown
|
|
||||||
MODEL=claude-3-7-sonnet-20250219 # Recommended models: claude-3-7-sonnet-20250219, claude-3-opus-20240229
|
|
||||||
MAX_TOKENS=4000 # Maximum tokens for model responses
|
|
||||||
TEMPERATURE=0.7 # Temperature for model responses (0.0-1.0)
|
|
||||||
DEBUG=false # Enable debug logging (true/false)
|
|
||||||
LOG_LEVEL=info # Log level (debug, info, warn, error)
|
|
||||||
DEFAULT_SUBTASKS=3 # Default number of subtasks when expanding
|
|
||||||
DEFAULT_PRIORITY=medium # Default priority for generated tasks (high, medium, low)
|
|
||||||
PROJECT_NAME={{projectName}} # Project name for tasks.json metadata
|
|
||||||
PROJECT_VERSION={{projectVersion}} # Project version for tasks.json metadata
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
<context>
|
|
||||||
# Overview
|
|
||||||
[Provide a high-level overview of your product here. Explain what problem it solves, who it's for, and why it's valuable.]
|
|
||||||
|
|
||||||
# Core Features
|
|
||||||
[List and describe the main features of your product. For each feature, include:
|
|
||||||
- What it does
|
|
||||||
- Why it's important
|
|
||||||
- How it works at a high level]
|
|
||||||
|
|
||||||
# User Experience
|
|
||||||
[Describe the user journey and experience. Include:
|
|
||||||
- User personas
|
|
||||||
- Key user flows
|
|
||||||
- UI/UX considerations]
|
|
||||||
</context>
|
|
||||||
<PRD>
|
|
||||||
# Technical Architecture
|
|
||||||
[Outline the technical implementation details:
|
|
||||||
- System components
|
|
||||||
- Data models
|
|
||||||
- APIs and integrations
|
|
||||||
- Infrastructure requirements]
|
|
||||||
|
|
||||||
# Development Roadmap
|
|
||||||
[Break down the development process into phases:
|
|
||||||
- MVP requirements
|
|
||||||
- Future enhancements
|
|
||||||
- Do not think about timelines whatsoever -- all that matters is scope and detailing exactly what needs to be build in each phase so it can later be cut up into tasks]
|
|
||||||
|
|
||||||
# Logical Dependency Chain
|
|
||||||
[Define the logical order of development:
|
|
||||||
- Which features need to be built first (foundation)
|
|
||||||
- Getting as quickly as possible to something usable/visible front end that works
|
|
||||||
- Properly pacing and scoping each feature so it is atomic but can also be built upon and improved as development approaches]
|
|
||||||
|
|
||||||
# Risks and Mitigations
|
|
||||||
[Identify potential risks and how they'll be addressed:
|
|
||||||
- Technical challenges
|
|
||||||
- Figuring out the MVP that we can build upon
|
|
||||||
- Resource constraints]
|
|
||||||
|
|
||||||
# Appendix
|
|
||||||
[Include any additional information:
|
|
||||||
- Research findings
|
|
||||||
- Technical specifications]
|
|
||||||
</PRD>
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
dev-debug.log
|
|
||||||
|
|
||||||
# Dependency directories
|
|
||||||
node_modules/
|
|
||||||
|
|
||||||
# Environment variables
|
|
||||||
.env
|
|
||||||
|
|
||||||
# Editor directories and files
|
|
||||||
.idea
|
|
||||||
.vscode
|
|
||||||
*.suo
|
|
||||||
*.ntvs*
|
|
||||||
*.njsproj
|
|
||||||
*.sln
|
|
||||||
*.sw?
|
|
||||||
|
|
||||||
# OS specific
|
|
||||||
.DS_Store
|
|
||||||
|
|
||||||
# Task files
|
|
||||||
tasks.json
|
|
||||||
tasks/
|
|
||||||
@@ -1,376 +0,0 @@
|
|||||||
# Meta-Development Script
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
|
|
||||||
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:
|
|
||||||
|
|
||||||
1. **Parse** a PRD or requirements document (`.txt`) to initialize a set of tasks (`tasks.json`).
|
|
||||||
2. **List** all existing tasks (IDs, statuses, titles).
|
|
||||||
3. **Update** tasks to accommodate new prompts or architecture changes (useful if you discover "implementation drift").
|
|
||||||
4. **Generate** individual task files (e.g., `task_001.txt`) for easy reference or to feed into an AI coding workflow.
|
|
||||||
5. **Set task status**—mark tasks as `done`, `pending`, or `deferred` based on progress.
|
|
||||||
6. **Expand** tasks with subtasks—break down complex tasks into smaller, more manageable subtasks.
|
|
||||||
7. **Research-backed subtask generation**—use Perplexity AI to generate more informed and contextually relevant subtasks.
|
|
||||||
8. **Clear subtasks**—remove subtasks from specified tasks to allow regeneration or restructuring.
|
|
||||||
9. **Show task details**—display detailed information about a specific task and its subtasks.
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
The script can be configured through environment variables in a `.env` file at the root of the project:
|
|
||||||
|
|
||||||
### Required Configuration
|
|
||||||
- `ANTHROPIC_API_KEY`: Your Anthropic API key for Claude
|
|
||||||
|
|
||||||
### Optional Configuration
|
|
||||||
- `MODEL`: Specify which Claude model to use (default: "claude-3-7-sonnet-20250219")
|
|
||||||
- `MAX_TOKENS`: Maximum tokens for model responses (default: 4000)
|
|
||||||
- `TEMPERATURE`: Temperature for model responses (default: 0.7)
|
|
||||||
- `PERPLEXITY_API_KEY`: Your Perplexity API key for research-backed subtask generation
|
|
||||||
- `PERPLEXITY_MODEL`: Specify which Perplexity model to use (default: "sonar-medium-online")
|
|
||||||
- `DEBUG`: Enable debug logging (default: false)
|
|
||||||
- `LOG_LEVEL`: Log level - debug, info, warn, error (default: info)
|
|
||||||
- `DEFAULT_SUBTASKS`: Default number of subtasks when expanding (default: 3)
|
|
||||||
- `DEFAULT_PRIORITY`: Default priority for generated tasks (default: medium)
|
|
||||||
- `PROJECT_NAME`: Override default project name in tasks.json
|
|
||||||
- `PROJECT_VERSION`: Override default version in tasks.json
|
|
||||||
|
|
||||||
## How It Works
|
|
||||||
|
|
||||||
1. **`tasks.json`**:
|
|
||||||
- A JSON file at the project root containing an array of tasks (each with `id`, `title`, `description`, `status`, etc.).
|
|
||||||
- The `meta` field can store additional info like the project's name, version, or reference to the PRD.
|
|
||||||
- Tasks can have `subtasks` for more detailed implementation steps.
|
|
||||||
- Dependencies are displayed with status indicators (✅ for completed, ⏱️ for pending) to easily track progress.
|
|
||||||
|
|
||||||
2. **Script Commands**
|
|
||||||
You can run the script via:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
node scripts/dev.js [command] [options]
|
|
||||||
```
|
|
||||||
|
|
||||||
Available commands:
|
|
||||||
|
|
||||||
- `parse-prd`: Generate tasks from a PRD document
|
|
||||||
- `list`: Display all tasks with their status
|
|
||||||
- `update`: Update tasks based on new information
|
|
||||||
- `generate`: Create individual task files
|
|
||||||
- `set-status`: Change a task's status
|
|
||||||
- `expand`: Add subtasks to a task or all tasks
|
|
||||||
- `clear-subtasks`: Remove subtasks from specified tasks
|
|
||||||
- `next`: Determine the next task to work on based on dependencies
|
|
||||||
- `show`: Display detailed information about a specific task
|
|
||||||
|
|
||||||
Run `node scripts/dev.js` without arguments to see detailed usage information.
|
|
||||||
|
|
||||||
## Listing Tasks
|
|
||||||
|
|
||||||
The `list` command allows you to view all tasks and their status:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# List all tasks
|
|
||||||
node scripts/dev.js list
|
|
||||||
|
|
||||||
# List tasks with a specific status
|
|
||||||
node scripts/dev.js list --status=pending
|
|
||||||
|
|
||||||
# List tasks and include their subtasks
|
|
||||||
node scripts/dev.js list --with-subtasks
|
|
||||||
|
|
||||||
# List tasks with a specific status and include their subtasks
|
|
||||||
node scripts/dev.js list --status=pending --with-subtasks
|
|
||||||
```
|
|
||||||
|
|
||||||
## Updating Tasks
|
|
||||||
|
|
||||||
The `update` command allows you to update tasks based on new information or implementation changes:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Update tasks starting from ID 4 with a new prompt
|
|
||||||
node scripts/dev.js update --from=4 --prompt="Refactor tasks from ID 4 onward to use Express instead of Fastify"
|
|
||||||
|
|
||||||
# Update all tasks (default from=1)
|
|
||||||
node scripts/dev.js update --prompt="Add authentication to all relevant tasks"
|
|
||||||
|
|
||||||
# Specify a different tasks file
|
|
||||||
node scripts/dev.js update --file=custom-tasks.json --from=5 --prompt="Change database from MongoDB to PostgreSQL"
|
|
||||||
```
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
- The `--prompt` parameter is required and should explain the changes or new context
|
|
||||||
- Only tasks that aren't marked as 'done' will be updated
|
|
||||||
- Tasks with ID >= the specified --from value will be updated
|
|
||||||
|
|
||||||
## Setting Task Status
|
|
||||||
|
|
||||||
The `set-status` command allows you to change a task's status:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Mark a task as done
|
|
||||||
node scripts/dev.js set-status --id=3 --status=done
|
|
||||||
|
|
||||||
# Mark a task as pending
|
|
||||||
node scripts/dev.js set-status --id=4 --status=pending
|
|
||||||
|
|
||||||
# Mark a specific subtask as done
|
|
||||||
node scripts/dev.js set-status --id=3.1 --status=done
|
|
||||||
|
|
||||||
# Mark multiple tasks at once
|
|
||||||
node scripts/dev.js set-status --id=1,2,3 --status=done
|
|
||||||
```
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
- When marking a parent task as "done", all of its subtasks will automatically be marked as "done" as well
|
|
||||||
- Common status values are 'done', 'pending', and 'deferred', but any string is accepted
|
|
||||||
- You can specify multiple task IDs by separating them with commas
|
|
||||||
- Subtask IDs are specified using the format `parentId.subtaskId` (e.g., `3.1`)
|
|
||||||
- Dependencies are updated to show completion status (✅ for completed, ⏱️ for pending) throughout the system
|
|
||||||
|
|
||||||
## Expanding Tasks
|
|
||||||
|
|
||||||
The `expand` command allows you to break down tasks into subtasks for more detailed implementation:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Expand a specific task with 3 subtasks (default)
|
|
||||||
node scripts/dev.js expand --id=3
|
|
||||||
|
|
||||||
# Expand a specific task with 5 subtasks
|
|
||||||
node scripts/dev.js expand --id=3 --num=5
|
|
||||||
|
|
||||||
# Expand a task with additional context
|
|
||||||
node scripts/dev.js expand --id=3 --prompt="Focus on security aspects"
|
|
||||||
|
|
||||||
# Expand all pending tasks that don't have subtasks
|
|
||||||
node scripts/dev.js expand --all
|
|
||||||
|
|
||||||
# Force regeneration of subtasks for all pending tasks
|
|
||||||
node scripts/dev.js expand --all --force
|
|
||||||
|
|
||||||
# Use Perplexity AI for research-backed subtask generation
|
|
||||||
node scripts/dev.js expand --id=3 --research
|
|
||||||
|
|
||||||
# Use Perplexity AI for research-backed generation on all pending tasks
|
|
||||||
node scripts/dev.js expand --all --research
|
|
||||||
```
|
|
||||||
|
|
||||||
## Clearing Subtasks
|
|
||||||
|
|
||||||
The `clear-subtasks` command allows you to remove subtasks from specified tasks:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Clear subtasks from a specific task
|
|
||||||
node scripts/dev.js clear-subtasks --id=3
|
|
||||||
|
|
||||||
# Clear subtasks from multiple tasks
|
|
||||||
node scripts/dev.js clear-subtasks --id=1,2,3
|
|
||||||
|
|
||||||
# Clear subtasks from all tasks
|
|
||||||
node scripts/dev.js clear-subtasks --all
|
|
||||||
```
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
- After clearing subtasks, task files are automatically regenerated
|
|
||||||
- This is useful when you want to regenerate subtasks with a different approach
|
|
||||||
- Can be combined with the `expand` command to immediately generate new subtasks
|
|
||||||
- Works with both parent tasks and individual subtasks
|
|
||||||
|
|
||||||
## AI Integration
|
|
||||||
|
|
||||||
The script integrates with two AI services:
|
|
||||||
|
|
||||||
1. **Anthropic Claude**: Used for parsing PRDs, generating tasks, and creating subtasks.
|
|
||||||
2. **Perplexity AI**: Used for research-backed subtask generation when the `--research` flag is specified.
|
|
||||||
|
|
||||||
The Perplexity integration uses the OpenAI client to connect to Perplexity's API, which provides enhanced research capabilities for generating more informed subtasks. If the Perplexity API is unavailable or encounters an error, the script will automatically fall back to using Anthropic's Claude.
|
|
||||||
|
|
||||||
To use the Perplexity integration:
|
|
||||||
1. Obtain a Perplexity API key
|
|
||||||
2. Add `PERPLEXITY_API_KEY` to your `.env` file
|
|
||||||
3. Optionally specify `PERPLEXITY_MODEL` in your `.env` file (default: "sonar-medium-online")
|
|
||||||
4. Use the `--research` flag with the `expand` command
|
|
||||||
|
|
||||||
## Logging
|
|
||||||
|
|
||||||
The script supports different logging levels controlled by the `LOG_LEVEL` environment variable:
|
|
||||||
- `debug`: Detailed information, typically useful for troubleshooting
|
|
||||||
- `info`: Confirmation that things are working as expected (default)
|
|
||||||
- `warn`: Warning messages that don't prevent execution
|
|
||||||
- `error`: Error messages that might prevent execution
|
|
||||||
|
|
||||||
When `DEBUG=true` is set, debug logs are also written to a `dev-debug.log` file in the project root.
|
|
||||||
|
|
||||||
## Analyzing Task Complexity
|
|
||||||
|
|
||||||
The `analyze-complexity` command allows you to automatically assess task complexity and generate expansion recommendations:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Analyze all tasks and generate expansion recommendations
|
|
||||||
node scripts/dev.js analyze-complexity
|
|
||||||
|
|
||||||
# Specify a custom output file
|
|
||||||
node scripts/dev.js analyze-complexity --output=custom-report.json
|
|
||||||
|
|
||||||
# Override the model used for analysis
|
|
||||||
node scripts/dev.js analyze-complexity --model=claude-3-opus-20240229
|
|
||||||
|
|
||||||
# Set a custom complexity threshold (1-10)
|
|
||||||
node scripts/dev.js analyze-complexity --threshold=6
|
|
||||||
|
|
||||||
# Use Perplexity AI for research-backed complexity analysis
|
|
||||||
node scripts/dev.js analyze-complexity --research
|
|
||||||
```
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
- The command uses Claude to analyze each task's complexity (or Perplexity with --research flag)
|
|
||||||
- Tasks are scored on a scale of 1-10
|
|
||||||
- Each task receives a recommended number of subtasks based on DEFAULT_SUBTASKS configuration
|
|
||||||
- The default output path is `scripts/task-complexity-report.json`
|
|
||||||
- Each task in the analysis includes a ready-to-use `expansionCommand` that can be copied directly to the terminal or executed programmatically
|
|
||||||
- Tasks with complexity scores below the threshold (default: 5) may not need expansion
|
|
||||||
- The research flag provides more contextual and informed complexity assessments
|
|
||||||
|
|
||||||
### Integration with Expand Command
|
|
||||||
|
|
||||||
The `expand` command automatically checks for and uses complexity analysis if available:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Expand a task, using complexity report recommendations if available
|
|
||||||
node scripts/dev.js expand --id=8
|
|
||||||
|
|
||||||
# Expand all tasks, prioritizing by complexity score if a report exists
|
|
||||||
node scripts/dev.js expand --all
|
|
||||||
|
|
||||||
# Override recommendations with explicit values
|
|
||||||
node scripts/dev.js expand --id=8 --num=5 --prompt="Custom prompt"
|
|
||||||
```
|
|
||||||
|
|
||||||
When a complexity report exists:
|
|
||||||
- The `expand` command will use the recommended subtask count from the report (unless overridden)
|
|
||||||
- It will use the tailored expansion prompt from the report (unless a custom prompt is provided)
|
|
||||||
- When using `--all`, tasks are sorted by complexity score (highest first)
|
|
||||||
- The `--research` flag is preserved from the complexity analysis to expansion
|
|
||||||
|
|
||||||
The output report structure is:
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"meta": {
|
|
||||||
"generatedAt": "2023-06-15T12:34:56.789Z",
|
|
||||||
"tasksAnalyzed": 20,
|
|
||||||
"thresholdScore": 5,
|
|
||||||
"projectName": "Your Project Name",
|
|
||||||
"usedResearch": true
|
|
||||||
},
|
|
||||||
"complexityAnalysis": [
|
|
||||||
{
|
|
||||||
"taskId": 8,
|
|
||||||
"taskTitle": "Develop Implementation Drift Handling",
|
|
||||||
"complexityScore": 9.5,
|
|
||||||
"recommendedSubtasks": 6,
|
|
||||||
"expansionPrompt": "Create subtasks that handle detecting...",
|
|
||||||
"reasoning": "This task requires sophisticated logic...",
|
|
||||||
"expansionCommand": "node scripts/dev.js expand --id=8 --num=6 --prompt=\"Create subtasks...\" --research"
|
|
||||||
},
|
|
||||||
// More tasks sorted by complexity score (highest first)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Finding the Next Task
|
|
||||||
|
|
||||||
The `next` command helps you determine which task to work on next based on dependencies and status:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Show the next task to work on
|
|
||||||
node scripts/dev.js next
|
|
||||||
|
|
||||||
# Specify a different tasks file
|
|
||||||
node scripts/dev.js next --file=custom-tasks.json
|
|
||||||
```
|
|
||||||
|
|
||||||
This command:
|
|
||||||
|
|
||||||
1. Identifies all **eligible tasks** - pending or in-progress tasks whose dependencies are all satisfied (marked as done)
|
|
||||||
2. **Prioritizes** these eligible tasks by:
|
|
||||||
- Priority level (high > medium > low)
|
|
||||||
- Number of dependencies (fewer dependencies first)
|
|
||||||
- Task ID (lower ID first)
|
|
||||||
3. **Displays** comprehensive information about the selected task:
|
|
||||||
- Basic task details (ID, title, priority, dependencies)
|
|
||||||
- Detailed description and implementation details
|
|
||||||
- Subtasks if they exist
|
|
||||||
4. Provides **contextual suggested actions**:
|
|
||||||
- Command to mark the task as in-progress
|
|
||||||
- Command to mark the task as done when completed
|
|
||||||
- Commands for working with subtasks (update status or expand)
|
|
||||||
|
|
||||||
This feature ensures you're always working on the most appropriate task based on your project's current state and dependency structure.
|
|
||||||
|
|
||||||
## Showing Task Details
|
|
||||||
|
|
||||||
The `show` command allows you to view detailed information about a specific task:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Show details for a specific task
|
|
||||||
node scripts/dev.js show 1
|
|
||||||
|
|
||||||
# Alternative syntax with --id option
|
|
||||||
node scripts/dev.js show --id=1
|
|
||||||
|
|
||||||
# Show details for a subtask
|
|
||||||
node scripts/dev.js show --id=1.2
|
|
||||||
|
|
||||||
# Specify a different tasks file
|
|
||||||
node scripts/dev.js show 3 --file=custom-tasks.json
|
|
||||||
```
|
|
||||||
|
|
||||||
This command:
|
|
||||||
|
|
||||||
1. **Displays comprehensive information** about the specified task:
|
|
||||||
- Basic task details (ID, title, priority, dependencies, status)
|
|
||||||
- Full description and implementation details
|
|
||||||
- Test strategy information
|
|
||||||
- Subtasks if they exist
|
|
||||||
2. **Handles both regular tasks and subtasks**:
|
|
||||||
- For regular tasks, shows all subtasks and their status
|
|
||||||
- For subtasks, shows the parent task relationship
|
|
||||||
3. **Provides contextual suggested actions**:
|
|
||||||
- Commands to update the task status
|
|
||||||
- Commands for working with subtasks
|
|
||||||
- For subtasks, provides a link to view the parent task
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
## Managing Task Dependencies
|
|
||||||
|
|
||||||
The `add-dependency` and `remove-dependency` commands allow you to manage task dependencies:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Add a dependency to a task
|
|
||||||
node scripts/dev.js add-dependency --id=<id> --depends-on=<id>
|
|
||||||
|
|
||||||
# Remove a dependency from a task
|
|
||||||
node scripts/dev.js remove-dependency --id=<id> --depends-on=<id>
|
|
||||||
```
|
|
||||||
|
|
||||||
These commands:
|
|
||||||
|
|
||||||
1. **Allow precise dependency management**:
|
|
||||||
- Add dependencies between tasks with automatic validation
|
|
||||||
- Remove dependencies when they're no longer needed
|
|
||||||
- Update task files automatically after changes
|
|
||||||
|
|
||||||
2. **Include validation checks**:
|
|
||||||
- Prevent circular dependencies (a task depending on itself)
|
|
||||||
- Prevent duplicate dependencies
|
|
||||||
- Verify that both tasks exist before adding/removing dependencies
|
|
||||||
- Check if dependencies exist before attempting to remove them
|
|
||||||
|
|
||||||
3. **Provide clear feedback**:
|
|
||||||
- Success messages confirm when dependencies are added/removed
|
|
||||||
- Error messages explain why operations failed (if applicable)
|
|
||||||
|
|
||||||
4. **Automatically update task files**:
|
|
||||||
- Regenerates task files to reflect dependency changes
|
|
||||||
- Ensures tasks and their files stay synchronized
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
---
|
|
||||||
description: Guidelines for continuously improving Cursor rules based on emerging code patterns and best practices.
|
|
||||||
globs: **/*
|
|
||||||
alwaysApply: true
|
|
||||||
---
|
|
||||||
|
|
||||||
- **Rule Improvement Triggers:**
|
|
||||||
- New code patterns not covered by existing rules
|
|
||||||
- Repeated similar implementations across files
|
|
||||||
- Common error patterns that could be prevented
|
|
||||||
- New libraries or tools being used consistently
|
|
||||||
- Emerging best practices in the codebase
|
|
||||||
|
|
||||||
- **Analysis Process:**
|
|
||||||
- Compare new code with existing rules
|
|
||||||
- Identify patterns that should be standardized
|
|
||||||
- Look for references to external documentation
|
|
||||||
- Check for consistent error handling patterns
|
|
||||||
- Monitor test patterns and coverage
|
|
||||||
|
|
||||||
- **Rule Updates:**
|
|
||||||
- **Add New Rules When:**
|
|
||||||
- A new technology/pattern is used in 3+ files
|
|
||||||
- Common bugs could be prevented by a rule
|
|
||||||
- Code reviews repeatedly mention the same feedback
|
|
||||||
- New security or performance patterns emerge
|
|
||||||
|
|
||||||
- **Modify Existing Rules When:**
|
|
||||||
- Better examples exist in the codebase
|
|
||||||
- Additional edge cases are discovered
|
|
||||||
- Related rules have been updated
|
|
||||||
- Implementation details have changed
|
|
||||||
|
|
||||||
- **Example Pattern Recognition:**
|
|
||||||
```typescript
|
|
||||||
// If you see repeated patterns like:
|
|
||||||
const data = await prisma.user.findMany({
|
|
||||||
select: { id: true, email: true },
|
|
||||||
where: { status: 'ACTIVE' }
|
|
||||||
});
|
|
||||||
|
|
||||||
// Consider adding to [prisma.mdc](mdc:.cursor/rules/prisma.mdc):
|
|
||||||
// - Standard select fields
|
|
||||||
// - Common where conditions
|
|
||||||
// - Performance optimization patterns
|
|
||||||
```
|
|
||||||
|
|
||||||
- **Rule Quality Checks:**
|
|
||||||
- Rules should be actionable and specific
|
|
||||||
- Examples should come from actual code
|
|
||||||
- References should be up to date
|
|
||||||
- Patterns should be consistently enforced
|
|
||||||
|
|
||||||
- **Continuous Improvement:**
|
|
||||||
- Monitor code review comments
|
|
||||||
- Track common development questions
|
|
||||||
- Update rules after major refactors
|
|
||||||
- Add links to relevant documentation
|
|
||||||
- Cross-reference related rules
|
|
||||||
|
|
||||||
- **Rule Deprecation:**
|
|
||||||
- Mark outdated patterns as deprecated
|
|
||||||
- Remove rules that no longer apply
|
|
||||||
- Update references to deprecated rules
|
|
||||||
- Document migration paths for old patterns
|
|
||||||
|
|
||||||
- **Documentation Updates:**
|
|
||||||
- Keep examples synchronized with code
|
|
||||||
- Update references to external docs
|
|
||||||
- Maintain links between related rules
|
|
||||||
- Document breaking changes
|
|
||||||
|
|
||||||
Follow [cursor_rules.mdc](mdc:.cursor/rules/cursor_rules.mdc) for proper rule formatting and structure.
|
|
||||||
Reference in New Issue
Block a user