- Update to ES modules syntax throughout the codebase - Add fileURLToPath and dirname imports to handle __dirname in ES modules - Upgrade Anthropic SDK from 0.10.0 to 0.39.0 - Fix JSON parsing to handle responses wrapped in Markdown code blocks - Improve documentation with clearer installation instructions - Add important notes about ES modules and SDK requirements - Update environment examples with API key format and model recommendations - Include index.js in package files list - Bump version to 1.0.2
{{projectName}}
{{projectDescription}}
A task management system for AI-driven development with Claude, designed to work seamlessly with Cursor AI.
Overview
This project uses the Claude Task Master system to manage development tasks in an AI-driven workflow. The system revolves around a tasks.json file, which holds an up-to-date list of development tasks.
Getting Started
-
Install dependencies:
npm install -
Set up your environment:
- Copy
.env.exampleto.env - Add your Anthropic API key to the
.envfile
- Copy
-
Parse your PRD to generate tasks:
npm run parse-prd -- --input=your-prd-file.txt -
View current tasks:
npm run list -
Generate task files:
npm run generate
Important Notes
- This project uses ES modules. The package.json includes
"type": "module". - The Anthropic SDK version should be 0.39.0 or higher.
- If you encounter JSON parsing errors, make sure your Anthropic API key is valid and your environment is set up correctly.
Integrating with Cursor AI
This project includes Cursor AI integration through the .cursor/rules/dev_workflow.mdc file, which provides the AI with knowledge about the task management system.
Using Cursor Agent Mode
- Open this project in Cursor
- Open Cursor's AI chat and switch to Agent mode
- The agent will automatically understand the task management workflow
Working with the Agent
You can ask the Cursor agent to:
- Generate tasks: "Please parse my PRD at scripts/prd.txt and generate tasks"
- List tasks: "What tasks are available to work on next?"
- Implement tasks: "Let's implement task 3. What does it involve?"
- Update task status: "Task 3 is now complete. Please update its status"
- Handle changes: "We're now using Express instead of Fastify. Update future tasks"
- Break down tasks: "Task 5 seems complex. Can you break it down into subtasks?"
The agent will execute the appropriate commands and guide you through the development process.
Development Workflow
The development workflow follows these steps:
-
Initial Setup: If starting a new project with a PRD document, run
npm run parse-prd -- --input=<prd-file.txt>to generate the initial tasks.json file. -
Task Discovery: When a coding session begins, run
npm run listto see the current tasks, their status, and IDs. -
Task Selection: Select the next pending task based on these criteria:
- Dependencies: Only select tasks whose dependencies are marked as 'done'
- Priority: Choose higher priority tasks first ('high' > 'medium' > 'low')
- ID order: When priorities are equal, select the task with the lowest ID
-
Task Clarification: If a task description is unclear or lacks detail:
- Check if a corresponding task file exists in the tasks/ directory
- If more information is needed, ask for clarification
- If architectural changes have occurred, run
npm run dev -- update --from=<id> --prompt="<new architectural context>"to update the task and all subsequent tasks
-
Task Breakdown: For complex tasks that need to be broken down into smaller steps:
- Use
npm run dev -- expand --id=<id> --subtasks=<number>to generate detailed subtasks - Optionally provide additional context with
--prompt="<context>"to guide subtask generation
- Use
-
Task Implementation: Implement the code necessary for the chosen task.
-
Task Verification: Before marking a task as done, verify it according to the task's specified 'testStrategy'.
-
Task Completion: When a task is completed and verified, run
npm run dev -- set-status --id=<id> --status=doneto mark it as done. -
Implementation Drift Handling: If during implementation, you discover that the approach differs significantly from what was planned, call
npm run dev -- update --from=<futureTaskId> --prompt="Detailed explanation of changes..."to rewrite subsequent tasks. -
Task File Generation: After any updates to tasks.json, run
npm run generateto regenerate the individual task files.
Command Reference
Parse PRD
npm run parse-prd -- --input=<prd-file.txt>
List Tasks
npm run list
Update Tasks
npm run dev -- update --from=<id> --prompt="<prompt>"
Generate Task Files
npm run generate
Set Task Status
npm run dev -- set-status --id=<id> --status=<status>
Expand Tasks
npm run dev -- expand --id=<id> --subtasks=<number> --prompt="<context>"
or
npm run dev -- expand --all
Task Structure
Tasks in tasks.json have the following structure:
id: Unique identifier for the tasktitle: Brief, descriptive title of the taskdescription: Concise description of what the task involvesstatus: Current state of the task (pending, done, deferred)dependencies: IDs of tasks that must be completed before this taskpriority: Importance level of the task (high, medium, low)details: In-depth instructions for implementing the tasktestStrategy: Approach for verifying the task has been completed correctlysubtasks: List of smaller, more specific tasks that make up the main task
Best Practices for AI-Driven Development
-
Start with a detailed PRD: The more detailed your PRD, the better the generated tasks will be.
-
Review generated tasks: After parsing the PRD, review the tasks to ensure they make sense and have appropriate dependencies.
-
Follow the dependency chain: Always respect task dependencies - the Cursor agent will help with this.
-
Update as you go: If your implementation diverges from the plan, use the update command to keep future tasks aligned with your current approach.
-
Break down complex tasks: Use the expand command to break down complex tasks into manageable subtasks.
-
Regenerate task files: After any updates to tasks.json, regenerate the task files to keep them in sync.
-
Communicate context to the agent: When asking the Cursor agent to help with a task, provide context about what you're trying to achieve.
Configuration
The system can be configured through environment variables in a .env file:
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)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.jsonPROJECT_VERSION: Override default version in tasks.json
Additional Documentation
For more detailed documentation on the scripts, see the scripts/README.md file.
License
Copyright (c) {{year}} {{authorName}}