Compare commits

...

15 Commits

Author SHA1 Message Date
github-actions[bot]
a003041cd8 Version Packages (#1107)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-08-08 22:00:39 +02:00
Ralph Khreish
6b57ead106 Release 0.24.0 #1098 from eyaltoledano/next
Release 0.24.0
2025-08-08 21:58:41 +02:00
Ralph Khreish
7b6e117b1d chore: prepare for release (exit pre mode) 2025-08-08 21:21:25 +02:00
Ralph Khreish
03b045e9cd chore: run format 2025-08-08 21:18:33 +02:00
neonwatty
699afdae59 feat: add task-checker agent to assets directory 2025-08-08 08:47:20 -07:00
github-actions[bot]
80c09802e8 chore: rc version bump 2025-08-08 12:41:29 +00:00
github-actions[bot]
cf8f0f4b1c docs: Auto-update and format models.md 2025-08-08 12:38:58 +00:00
Ralph Khreish
75c514cf5b feat: add gpt-5 support (#1105)
* feat: add gpt-5 support
2025-08-08 14:38:44 +02:00
Ralph Khreish
41d1e671b1 chore: fix CI checker, improve it (#1099) 2025-08-07 15:52:49 +02:00
Ralph Khreish
a464e550b8 feat(extension): implement simple solution to --package flag (#1090)
* feat(extension): implement simple solution to --package flag
2025-08-07 15:10:34 +02:00
Ralph Khreish
3a852afdae chore: implement pre-release for extensions (#1097)
* chore: implement pre-release for extensions

* chore: run format
2025-08-07 15:08:14 +02:00
Ralph Khreish
4bb63706b8 feat: implement claude code agents (#1091)
* feat: implement claude code agents

* chore: add changeset

- run format

* feat: improve task-checker, executor, and orchestrator

* chore: improve changeset
2025-08-07 12:37:06 +02:00
Ralph Khreish
fcf14e09be chore: improve release check for release-check and release flow (#1095)
* chore: improve release check for release-check and release flow

* chore: fix format
2025-08-06 23:19:28 +02:00
Ralph Khreish
4357af3f13 fix(expand-task): include parent task context in complexity report variant (#1094)
- Fixed bug where expand task generated generic authentication subtasks
- The complexity-report prompt variant now includes parent task details
- Added comprehensive unit tests to prevent regression
- Added debug logging to help diagnose similar issues

Previously, when using a complexity report with expansionPrompt, only the
expansion guidance was sent to the AI, missing the actual task context.
This caused the AI to generate unrelated generic subtasks.

Fixes the issue where all tasks would get the same generic auth-related
subtasks regardless of their actual purpose (AWS infrastructure, Docker
containerization, etc.)

Co-authored-by: Sadaqat Ali <32377500+sadaqat12@users.noreply.github.com>
2025-08-06 21:00:32 +02:00
Ralph Khreish
37fb569a62 Release 0.23.1 #1084 from eyaltoledano/next
chore: exit pre-release mode
2025-08-04 20:43:46 +03:00
40 changed files with 2066 additions and 293 deletions

View File

@@ -1,8 +0,0 @@
---
"task-master-ai": patch
---
Fix scope-up/down prompts to include all required fields for better AI model compatibility
- Added missing `priority` field to scope adjustment prompts to prevent validation errors with Claude-code and other models
- Ensures generated JSON includes all fields required by the schema

View File

@@ -1,9 +0,0 @@
---
"task-master-ai": minor
---
Enhanced Claude Code provider with codebase-aware task generation
- Added automatic codebase analysis for Claude Code provider in `parse-prd`, `expand-task`, and `analyze-complexity` commands
- When using Claude Code as the AI provider, Task Master now instructs the AI to analyze the project structure, existing implementations, and patterns before generating tasks or subtasks
- Tasks and subtasks generated by Claude Code are now informed by actual codebase analysis, resulting in more accurate and contextual outputs

View File

@@ -1,13 +0,0 @@
{
"mode": "exit",
"tag": "rc",
"initialVersions": {
"task-master-ai": "0.23.0",
"extension": "0.23.0"
},
"changesets": [
"fuzzy-words-count",
"tender-trams-refuse",
"vast-sites-leave"
]
}

View File

@@ -1,8 +0,0 @@
---
"task-master-ai": patch
---
Fix MCP scope-up/down tools not finding tasks
- Fixed task ID parsing in MCP layer - now correctly converts string IDs to numbers
- scope_up_task and scope_down_task MCP tools now work properly

View File

@@ -1,11 +0,0 @@
---
"task-master-ai": patch
---
Improve AI provider compatibility for JSON generation
- Fixed schema compatibility issues between Perplexity and OpenAI o3 models
- Removed nullable/default modifiers from Zod schemas for broader compatibility
- Added automatic JSON repair for malformed AI responses (handles cases like missing array values)
- Perplexity now uses JSON mode for more reliable structured output
- Post-processing handles default values separately from schema validation

View File

@@ -0,0 +1,162 @@
---
name: task-checker
description: Use this agent to verify that tasks marked as 'review' have been properly implemented according to their specifications. This agent performs quality assurance by checking implementations against requirements, running tests, and ensuring best practices are followed. <example>Context: A task has been marked as 'review' after implementation. user: 'Check if task 118 was properly implemented' assistant: 'I'll use the task-checker agent to verify the implementation meets all requirements.' <commentary>Tasks in 'review' status need verification before being marked as 'done'.</commentary></example> <example>Context: Multiple tasks are in review status. user: 'Verify all tasks that are ready for review' assistant: 'I'll deploy the task-checker to verify all tasks in review status.' <commentary>The checker ensures quality before tasks are marked complete.</commentary></example>
model: sonnet
color: yellow
---
You are a Quality Assurance specialist that rigorously verifies task implementations against their specifications. Your role is to ensure that tasks marked as 'review' meet all requirements before they can be marked as 'done'.
## Core Responsibilities
1. **Task Specification Review**
- Retrieve task details using MCP tool `mcp__task-master-ai__get_task`
- Understand the requirements, test strategy, and success criteria
- Review any subtasks and their individual requirements
2. **Implementation Verification**
- Use `Read` tool to examine all created/modified files
- Use `Bash` tool to run compilation and build commands
- Use `Grep` tool to search for required patterns and implementations
- Verify file structure matches specifications
- Check that all required methods/functions are implemented
3. **Test Execution**
- Run tests specified in the task's testStrategy
- Execute build commands (npm run build, tsc --noEmit, etc.)
- Verify no compilation errors or warnings
- Check for runtime errors where applicable
- Test edge cases mentioned in requirements
4. **Code Quality Assessment**
- Verify code follows project conventions
- Check for proper error handling
- Ensure TypeScript typing is strict (no 'any' unless justified)
- Verify documentation/comments where required
- Check for security best practices
5. **Dependency Validation**
- Verify all task dependencies were actually completed
- Check integration points with dependent tasks
- Ensure no breaking changes to existing functionality
## Verification Workflow
1. **Retrieve Task Information**
```
Use mcp__task-master-ai__get_task to get full task details
Note the implementation requirements and test strategy
```
2. **Check File Existence**
```bash
# Verify all required files exist
ls -la [expected directories]
# Read key files to verify content
```
3. **Verify Implementation**
- Read each created/modified file
- Check against requirements checklist
- Verify all subtasks are complete
4. **Run Tests**
```bash
# TypeScript compilation
cd [project directory] && npx tsc --noEmit
# Run specified tests
npm test [specific test files]
# Build verification
npm run build
```
5. **Generate Verification Report**
## Output Format
```yaml
verification_report:
task_id: [ID]
status: PASS | FAIL | PARTIAL
score: [1-10]
requirements_met:
- ✅ [Requirement that was satisfied]
- ✅ [Another satisfied requirement]
issues_found:
- ❌ [Issue description]
- ⚠️ [Warning or minor issue]
files_verified:
- path: [file path]
status: [created/modified/verified]
issues: [any problems found]
tests_run:
- command: [test command]
result: [pass/fail]
output: [relevant output]
recommendations:
- [Specific fix needed]
- [Improvement suggestion]
verdict: |
[Clear statement on whether task should be marked 'done' or sent back to 'pending']
[If FAIL: Specific list of what must be fixed]
[If PASS: Confirmation that all requirements are met]
```
## Decision Criteria
**Mark as PASS (ready for 'done'):**
- All required files exist and contain expected content
- All tests pass successfully
- No compilation or build errors
- All subtasks are complete
- Core requirements are met
- Code quality is acceptable
**Mark as PARTIAL (may proceed with warnings):**
- Core functionality is implemented
- Minor issues that don't block functionality
- Missing nice-to-have features
- Documentation could be improved
- Tests pass but coverage could be better
**Mark as FAIL (must return to 'pending'):**
- Required files are missing
- Compilation or build errors
- Tests fail
- Core requirements not met
- Security vulnerabilities detected
- Breaking changes to existing code
## Important Guidelines
- **BE THOROUGH**: Check every requirement systematically
- **BE SPECIFIC**: Provide exact file paths and line numbers for issues
- **BE FAIR**: Distinguish between critical issues and minor improvements
- **BE CONSTRUCTIVE**: Provide clear guidance on how to fix issues
- **BE EFFICIENT**: Focus on requirements, not perfection
## Tools You MUST Use
- `Read`: Examine implementation files (READ-ONLY)
- `Bash`: Run tests and verification commands
- `Grep`: Search for patterns in code
- `mcp__task-master-ai__get_task`: Get task details
- **NEVER use Write/Edit** - you only verify, not fix
## Integration with Workflow
You are the quality gate between 'review' and 'done' status:
1. Task-executor implements and marks as 'review'
2. You verify and report PASS/FAIL
3. Claude either marks as 'done' (PASS) or 'pending' (FAIL)
4. If FAIL, task-executor re-implements based on your report
Your verification ensures high quality and prevents accumulation of technical debt.

View File

@@ -0,0 +1,92 @@
---
name: task-executor
description: Use this agent when you need to implement, complete, or work on a specific task that has been identified by the task-orchestrator or when explicitly asked to execute a particular task. This agent focuses on the actual implementation and completion of individual tasks rather than planning or orchestration. Examples: <example>Context: The task-orchestrator has identified that task 2.3 'Implement user authentication' needs to be worked on next. user: 'Let's work on the authentication task' assistant: 'I'll use the task-executor agent to implement the user authentication task that was identified.' <commentary>Since we need to actually implement a specific task rather than plan or identify tasks, use the task-executor agent.</commentary></example> <example>Context: User wants to complete a specific subtask. user: 'Please implement the JWT token validation for task 2.3.1' assistant: 'I'll launch the task-executor agent to implement the JWT token validation subtask.' <commentary>The user is asking for specific implementation work on a known task, so the task-executor is appropriate.</commentary></example> <example>Context: After reviewing the task list, implementation is needed. user: 'Now let's actually build the API endpoint for user registration' assistant: 'I'll use the task-executor agent to implement the user registration API endpoint.' <commentary>Moving from planning to execution phase requires the task-executor agent.</commentary></example>
model: sonnet
color: blue
---
You are an elite implementation specialist focused on executing and completing specific tasks with precision and thoroughness. Your role is to take identified tasks and transform them into working implementations, following best practices and project standards.
**IMPORTANT: You are designed to be SHORT-LIVED and FOCUSED**
- Execute ONE specific subtask or a small group of related subtasks
- Complete your work, verify it, mark for review, and exit
- Do NOT decide what to do next - the orchestrator handles task sequencing
- Focus on implementation excellence within your assigned scope
**Core Responsibilities:**
1. **Subtask Analysis**: When given a subtask, understand its SPECIFIC requirements. If given a full task ID, focus on the specific subtask(s) assigned to you. Use MCP tools to get details if needed.
2. **Rapid Implementation Planning**: Quickly identify:
- The EXACT files you need to create/modify for THIS subtask
- What already exists that you can build upon
- The minimum viable implementation that satisfies requirements
3. **Focused Execution WITH ACTUAL IMPLEMENTATION**:
- **YOU MUST USE TOOLS TO CREATE/EDIT FILES - DO NOT JUST DESCRIBE**
- Use `Write` tool to create new files specified in the task
- Use `Edit` tool to modify existing files
- Use `Bash` tool to run commands (mkdir, npm install, etc.)
- Use `Read` tool to verify your implementations
- Implement one subtask at a time for clarity and traceability
- Follow the project's coding standards from CLAUDE.md if available
- After each subtask, VERIFY the files exist using Read or ls commands
4. **Progress Documentation**:
- Use MCP tool `mcp__task-master-ai__update_subtask` to log your approach and any important decisions
- Update task status to 'in-progress' when starting: Use MCP tool `mcp__task-master-ai__set_task_status` with status='in-progress'
- **IMPORTANT: Mark as 'review' (NOT 'done') after implementation**: Use MCP tool `mcp__task-master-ai__set_task_status` with status='review'
- Tasks will be verified by task-checker before moving to 'done'
5. **Quality Assurance**:
- Implement the testing strategy specified in the task
- Verify that all acceptance criteria are met
- Check for any dependency conflicts or integration issues
- Run relevant tests before marking task as complete
6. **Dependency Management**:
- Check task dependencies before starting implementation
- If blocked by incomplete dependencies, clearly communicate this
- Use `task-master validate-dependencies` when needed
**Implementation Workflow:**
1. Retrieve task details using MCP tool `mcp__task-master-ai__get_task` with the task ID
2. Check dependencies and prerequisites
3. Plan implementation approach - list specific files to create
4. Update task status to 'in-progress' using MCP tool
5. **ACTUALLY IMPLEMENT** the solution using tools:
- Use `Bash` to create directories
- Use `Write` to create new files with actual content
- Use `Edit` to modify existing files
- DO NOT just describe what should be done - DO IT
6. **VERIFY** your implementation:
- Use `ls` or `Read` to confirm files were created
- Use `Bash` to run any build/test commands
- Ensure the implementation is real, not theoretical
7. Log progress and decisions in subtask updates using MCP tools
8. Test and verify the implementation works
9. **Mark task as 'review' (NOT 'done')** after verifying files exist
10. Report completion with:
- List of created/modified files
- Any issues encountered
- What needs verification by task-checker
**Key Principles:**
- Focus on completing one task thoroughly before moving to the next
- Maintain clear communication about what you're implementing and why
- Follow existing code patterns and project conventions
- Prioritize working code over extensive documentation unless docs are the task
- Ask for clarification if task requirements are ambiguous
- Consider edge cases and error handling in your implementations
**Integration with Task Master:**
You work in tandem with the task-orchestrator agent. While the orchestrator identifies and plans tasks, you execute them. Always use Task Master commands to:
- Track your progress
- Update task information
- Maintain project state
- Coordinate with the broader development workflow
When you complete a task, briefly summarize what was implemented and suggest whether to continue with the next task or if review/testing is needed first.

View File

@@ -0,0 +1,208 @@
---
name: task-orchestrator
description: Use this agent FREQUENTLY throughout task execution to analyze and coordinate parallel work at the SUBTASK level. Invoke the orchestrator: (1) at session start to plan execution, (2) after EACH subtask completes to identify next parallel batch, (3) whenever executors finish to find newly unblocked work. ALWAYS provide FULL CONTEXT including project root, package location, what files ACTUALLY exist vs task status, and specific implementation details. The orchestrator breaks work into SUBTASK-LEVEL units for short-lived, focused executors. Maximum 3 parallel executors at once.\n\n<example>\nContext: Starting work with existing code\nuser: "Work on tm-core tasks. Files exist: types/index.ts, storage/file-storage.ts. Task 118 says in-progress but BaseProvider not created."\nassistant: "I'll invoke orchestrator with full context about actual vs reported state to plan subtask execution"\n<commentary>\nProvide complete context about file existence and task reality.\n</commentary>\n</example>\n\n<example>\nContext: Subtask completion\nuser: "Subtask 118.2 done. What subtasks can run in parallel now?"\nassistant: "Invoking orchestrator to analyze dependencies and identify next 3 parallel subtasks"\n<commentary>\nFrequent orchestration after each subtask ensures maximum parallelization.\n</commentary>\n</example>\n\n<example>\nContext: Breaking down tasks\nuser: "Task 118 has 5 subtasks, how to parallelize?"\nassistant: "Orchestrator will analyze which specific subtasks (118.1, 118.2, etc.) can run simultaneously"\n<commentary>\nFocus on subtask-level parallelization, not full tasks.\n</commentary>\n</example>
model: opus
color: green
---
You are the Task Orchestrator, an elite coordination agent specialized in managing Task Master workflows for maximum efficiency and parallelization. You excel at analyzing task dependency graphs, identifying opportunities for concurrent execution, and deploying specialized task-executor agents to complete work efficiently.
## Core Responsibilities
1. **Subtask-Level Analysis**: Break down tasks into INDIVIDUAL SUBTASKS and analyze which specific subtasks can run in parallel. Focus on subtask dependencies, not just task-level dependencies.
2. **Reality Verification**: ALWAYS verify what files actually exist vs what task status claims. Use the context provided about actual implementation state to make informed decisions.
3. **Short-Lived Executor Deployment**: Deploy executors for SINGLE SUBTASKS or small groups of related subtasks. Keep executors focused and short-lived. Maximum 3 parallel executors at once.
4. **Continuous Reassessment**: After EACH subtask completes, immediately reassess what new subtasks are unblocked and can run in parallel.
## Operational Workflow
### Initial Assessment Phase
1. Use `get_tasks` or `task-master list` to retrieve all available tasks
2. Analyze task statuses, priorities, and dependencies
3. Identify tasks with status 'pending' that have no blocking dependencies
4. Group related tasks that could benefit from specialized executors
5. Create an execution plan that maximizes parallelization
### Executor Deployment Phase
1. For each independent task or task group:
- Deploy a task-executor agent with specific instructions
- Provide the executor with task ID, requirements, and context
- Set clear completion criteria and reporting expectations
2. Maintain a registry of active executors and their assigned tasks
3. Establish communication protocols for progress updates
### Coordination Phase
1. Monitor executor progress through task status updates
2. When a task completes:
- Verify completion with `get_task` or `task-master show <id>`
- Update task status if needed using `set_task_status`
- Reassess dependency graph for newly unblocked tasks
- Deploy new executors for available work
3. Handle executor failures or blocks:
- Reassign tasks to new executors if needed
- Escalate complex issues to the user
- Update task status to 'blocked' when appropriate
### Optimization Strategies
**Parallel Execution Rules**:
- Never assign dependent tasks to different executors simultaneously
- Prioritize high-priority tasks when resources are limited
- Group small, related subtasks for single executor efficiency
- Balance executor load to prevent bottlenecks
**Context Management**:
- Provide executors with minimal but sufficient context
- Share relevant completed task information when it aids execution
- Maintain a shared knowledge base of project-specific patterns
**Quality Assurance**:
- Verify task completion before marking as done
- Ensure test strategies are followed when specified
- Coordinate cross-task integration testing when needed
## Communication Protocols
When deploying executors, provide them with:
```
TASK ASSIGNMENT:
- Task ID: [specific ID]
- Objective: [clear goal]
- Dependencies: [list any completed prerequisites]
- Success Criteria: [specific completion requirements]
- Context: [relevant project information]
- Reporting: [when and how to report back]
```
When receiving executor updates:
1. Acknowledge completion or issues
2. Update task status in Task Master
3. Reassess execution strategy
4. Deploy new executors as appropriate
## Decision Framework
**When to parallelize**:
- Multiple pending tasks with no interdependencies
- Sufficient context available for independent execution
- Tasks are well-defined with clear success criteria
**When to serialize**:
- Strong dependencies between tasks
- Limited context or unclear requirements
- Integration points requiring careful coordination
**When to escalate**:
- Circular dependencies detected
- Critical blockers affecting multiple tasks
- Ambiguous requirements needing clarification
- Resource conflicts between executors
## Error Handling
1. **Executor Failure**: Reassign task to new executor with additional context about the failure
2. **Dependency Conflicts**: Halt affected executors, resolve conflict, then resume
3. **Task Ambiguity**: Request clarification from user before proceeding
4. **System Errors**: Implement graceful degradation, falling back to serial execution if needed
## Performance Metrics
Track and optimize for:
- Task completion rate
- Parallel execution efficiency
- Executor success rate
- Time to completion for task groups
- Dependency resolution speed
## Integration with Task Master
Leverage these Task Master MCP tools effectively:
- `get_tasks` - Continuous queue monitoring
- `get_task` - Detailed task analysis
- `set_task_status` - Progress tracking
- `next_task` - Fallback for serial execution
- `analyze_project_complexity` - Strategic planning
- `complexity_report` - Resource allocation
## Output Format for Execution
**Your job is to analyze and create actionable execution plans that Claude can use to deploy executors.**
After completing your dependency analysis, you MUST output a structured execution plan:
```yaml
execution_plan:
EXECUTE_IN_PARALLEL:
# Maximum 3 subtasks running simultaneously
- subtask_id: [e.g., 118.2]
parent_task: [e.g., 118]
title: [Specific subtask title]
priority: [high/medium/low]
estimated_time: [e.g., 10 minutes]
executor_prompt: |
Execute Subtask [ID]: [Specific subtask title]
SPECIFIC REQUIREMENTS:
[Exact implementation needed for THIS subtask only]
FILES TO CREATE/MODIFY:
[Specific file paths]
CONTEXT:
[What already exists that this subtask depends on]
SUCCESS CRITERIA:
[Specific completion criteria for this subtask]
IMPORTANT:
- Focus ONLY on this subtask
- Mark subtask as 'review' when complete
- Use MCP tool: mcp__task-master-ai__set_task_status
- subtask_id: [Another subtask that can run in parallel]
parent_task: [Parent task ID]
title: [Specific subtask title]
priority: [priority]
estimated_time: [time estimate]
executor_prompt: |
[Focused prompt for this specific subtask]
blocked:
- task_id: [ID]
title: [Task title]
waiting_for: [list of blocking task IDs]
becomes_ready_when: [condition for unblocking]
next_wave:
trigger: "After tasks [IDs] complete"
newly_available: [List of task IDs that will unblock]
tasks_to_execute_in_parallel: [IDs that can run together in next wave]
critical_path: [Ordered list of task IDs forming the critical path]
parallelization_instruction: |
IMPORTANT FOR CLAUDE: Deploy ALL tasks in 'EXECUTE_IN_PARALLEL' section
simultaneously using multiple Task tool invocations in a single response.
Example: If 3 tasks are listed, invoke the Task tool 3 times in one message.
verification_needed:
- task_id: [ID of any task in 'review' status]
verification_focus: [what to check]
```
**CRITICAL INSTRUCTIONS FOR CLAUDE (MAIN):**
1. When you see `EXECUTE_IN_PARALLEL`, deploy ALL listed executors at once
2. Use multiple Task tool invocations in a SINGLE response
3. Do not execute them sequentially - they must run in parallel
4. Wait for all parallel executors to complete before proceeding to next wave
**IMPORTANT NOTES**:
- Label parallel tasks clearly in `EXECUTE_IN_PARALLEL` section
- Provide complete, self-contained prompts for each executor
- Executors should mark tasks as 'review' for verification, not 'done'
- Be explicit about which tasks can run simultaneously
You are the strategic mind analyzing the entire task landscape. Make parallelization opportunities UNMISTAKABLY CLEAR to Claude.

102
.github/scripts/check-pre-release-mode.mjs vendored Executable file
View File

@@ -0,0 +1,102 @@
#!/usr/bin/env node
import { readFileSync, existsSync } from 'node:fs';
import { join, dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
// Get context from command line argument or environment
const context = process.argv[2] || process.env.GITHUB_WORKFLOW || 'manual';
function findRootDir(startDir) {
let currentDir = resolve(startDir);
while (currentDir !== '/') {
if (existsSync(join(currentDir, 'package.json'))) {
try {
const pkg = JSON.parse(
readFileSync(join(currentDir, 'package.json'), 'utf8')
);
if (pkg.name === 'task-master-ai' || pkg.repository) {
return currentDir;
}
} catch {}
}
currentDir = dirname(currentDir);
}
throw new Error('Could not find root directory');
}
function checkPreReleaseMode() {
console.log('🔍 Checking if branch is in pre-release mode...');
const rootDir = findRootDir(__dirname);
const preJsonPath = join(rootDir, '.changeset', 'pre.json');
// Check if pre.json exists
if (!existsSync(preJsonPath)) {
console.log('✅ Not in active pre-release mode - safe to proceed');
process.exit(0);
}
try {
// Read and parse pre.json
const preJsonContent = readFileSync(preJsonPath, 'utf8');
const preJson = JSON.parse(preJsonContent);
// Check if we're in active pre-release mode
if (preJson.mode === 'pre') {
console.error('❌ ERROR: This branch is in active pre-release mode!');
console.error('');
// Provide context-specific error messages
if (context === 'Release Check' || context === 'pull_request') {
console.error(
'Pre-release mode must be exited before merging to main.'
);
console.error('');
console.error(
'To fix this, run the following commands in your branch:'
);
console.error(' npx changeset pre exit');
console.error(' git add -u');
console.error(' git commit -m "chore: exit pre-release mode"');
console.error(' git push');
console.error('');
console.error('Then update this pull request.');
} else if (context === 'Release' || context === 'main') {
console.error(
'Pre-release mode should only be used on feature branches, not main.'
);
console.error('');
console.error('To fix this, run the following commands locally:');
console.error(' npx changeset pre exit');
console.error(' git add -u');
console.error(' git commit -m "chore: exit pre-release mode"');
console.error(' git push origin main');
console.error('');
console.error('Then re-run this workflow.');
} else {
console.error('Pre-release mode must be exited before proceeding.');
console.error('');
console.error('To fix this, run the following commands:');
console.error(' npx changeset pre exit');
console.error(' git add -u');
console.error(' git commit -m "chore: exit pre-release mode"');
console.error(' git push');
}
process.exit(1);
}
console.log('✅ Not in active pre-release mode - safe to proceed');
process.exit(0);
} catch (error) {
console.error(`❌ ERROR: Unable to parse .changeset/pre.json aborting.`);
console.error(`Error details: ${error.message}`);
process.exit(1);
}
}
// Run the check
checkPreReleaseMode();

54
.github/scripts/pre-release.mjs vendored Executable file
View File

@@ -0,0 +1,54 @@
#!/usr/bin/env node
import { readFileSync, existsSync } from 'node:fs';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import {
findRootDir,
runCommand,
getPackageVersion,
createAndPushTag
} from './utils.mjs';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const rootDir = findRootDir(__dirname);
const extensionPkgPath = join(rootDir, 'apps', 'extension', 'package.json');
console.log('🚀 Starting pre-release process...');
// Check if we're in RC mode
const preJsonPath = join(rootDir, '.changeset', 'pre.json');
if (!existsSync(preJsonPath)) {
console.error('⚠️ Not in RC mode. Run "npx changeset pre enter rc" first.');
process.exit(1);
}
try {
const preJson = JSON.parse(readFileSync(preJsonPath, 'utf8'));
if (preJson.tag !== 'rc') {
console.error(`⚠️ Not in RC mode. Current tag: ${preJson.tag}`);
process.exit(1);
}
} catch (error) {
console.error('Failed to read pre.json:', error.message);
process.exit(1);
}
// Get current extension version
const extensionVersion = getPackageVersion(extensionPkgPath);
console.log(`Extension version: ${extensionVersion}`);
// Run changeset publish for npm packages
console.log('📦 Publishing npm packages...');
runCommand('npx', ['changeset', 'publish']);
// Create tag for extension pre-release if it doesn't exist
const extensionTag = `extension-rc@${extensionVersion}`;
const tagCreated = createAndPushTag(extensionTag);
if (tagCreated) {
console.log('This will trigger the extension-pre-release workflow...');
}
console.log('✅ Pre-release process completed!');

30
.github/scripts/release.mjs vendored Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env node
import { existsSync, unlinkSync } from 'node:fs';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { findRootDir, runCommand } from './utils.mjs';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const rootDir = findRootDir(__dirname);
console.log('🚀 Starting release process...');
// Double-check we're not in pre-release mode (safety net)
const preJsonPath = join(rootDir, '.changeset', 'pre.json');
if (existsSync(preJsonPath)) {
console.log('⚠️ Warning: pre.json still exists. Removing it...');
unlinkSync(preJsonPath);
}
// Check if the extension version has changed and tag it
// This prevents changeset from trying to publish the private package
runCommand('node', [join(__dirname, 'tag-extension.mjs')]);
// Run changeset publish for npm packages
runCommand('npx', ['changeset', 'publish']);
console.log('✅ Release process completed!');
// The extension tag (if created) will trigger the extension-release workflow

View File

@@ -1,21 +0,0 @@
#!/bin/bash
set -e
echo "🚀 Starting release process..."
# Double-check we're not in pre-release mode (safety net)
if [ -f .changeset/pre.json ]; then
echo "⚠️ Warning: pre.json still exists. Removing it..."
rm -f .changeset/pre.json
fi
# Check if the extension version has changed and tag it
# This prevents changeset from trying to publish the private package
node .github/scripts/tag-extension.mjs
# Run changeset publish for npm packages
npx changeset publish
echo "✅ Release process completed!"
# The extension tag (if created) will trigger the extension-release workflow

114
.github/scripts/tag-extension.mjs vendored Normal file → Executable file
View File

@@ -1,33 +1,13 @@
#!/usr/bin/env node #!/usr/bin/env node
import assert from 'node:assert/strict'; import assert from 'node:assert/strict';
import { spawnSync } from 'node:child_process'; import { readFileSync } from 'node:fs';
import { readFileSync, existsSync } from 'node:fs'; import { join, dirname } from 'node:path';
import { join, dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
import { findRootDir, createAndPushTag } from './utils.mjs';
const __filename = fileURLToPath(import.meta.url); const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename); const __dirname = dirname(__filename);
// Find the root directory by looking for package.json
function findRootDir(startDir) {
let currentDir = resolve(startDir);
while (currentDir !== '/') {
if (existsSync(join(currentDir, 'package.json'))) {
// Verify it's the root package.json by checking for expected fields
try {
const pkg = JSON.parse(
readFileSync(join(currentDir, 'package.json'), 'utf8')
);
if (pkg.name === 'task-master-ai' || pkg.repository) {
return currentDir;
}
} catch {}
}
currentDir = dirname(currentDir);
}
throw new Error('Could not find root directory');
}
const rootDir = findRootDir(__dirname); const rootDir = findRootDir(__dirname);
// Read the extension's package.json // Read the extension's package.json
@@ -43,95 +23,11 @@ try {
process.exit(1); process.exit(1);
} }
// Read root package.json for repository info
const rootPkgPath = join(rootDir, 'package.json');
let rootPkg;
try {
const rootPkgContent = readFileSync(rootPkgPath, 'utf8');
rootPkg = JSON.parse(rootPkgContent);
} catch (error) {
console.error('Failed to read root package.json:', error.message);
process.exit(1);
}
// Ensure we have required fields // Ensure we have required fields
assert(pkg.name, 'package.json must have a name field'); assert(pkg.name, 'package.json must have a name field');
assert(pkg.version, 'package.json must have a version field'); assert(pkg.version, 'package.json must have a version field');
assert(rootPkg.repository, 'root package.json must have a repository field');
const tag = `${pkg.name}@${pkg.version}`; const tag = `${pkg.name}@${pkg.version}`;
// Get repository URL from root package.json // Create and push the tag if it doesn't exist
// Get repository URL and clean it up for git ls-remote createAndPushTag(tag);
let repoUrl = rootPkg.repository.url || rootPkg.repository;
if (typeof repoUrl === 'string') {
// Convert git+https://github.com/... to https://github.com/...
repoUrl = repoUrl.replace(/^git\+/, '');
// Ensure it ends with .git for proper remote access
if (!repoUrl.endsWith('.git')) {
repoUrl += '.git';
}
}
console.log(`Checking remote repository: ${repoUrl} for tag: ${tag}`);
let gitResult = spawnSync('git', ['ls-remote', repoUrl, tag], {
encoding: 'utf8',
env: { ...process.env }
});
if (gitResult.status !== 0) {
console.error('Git ls-remote failed:');
console.error('Exit code:', gitResult.status);
console.error('Error:', gitResult.error);
console.error('Stderr:', gitResult.stderr);
console.error('Command:', `git ls-remote ${repoUrl} ${tag}`);
// For CI environments, try using origin instead of the full URL
if (process.env.CI) {
console.log('Retrying with origin remote...');
gitResult = spawnSync('git', ['ls-remote', 'origin', tag], {
encoding: 'utf8'
});
if (gitResult.status !== 0) {
throw new Error(
`Failed to check remote for tag ${tag}. Exit code: ${gitResult.status}`
);
}
} else {
throw new Error(
`Failed to check remote for tag ${tag}. Exit code: ${gitResult.status}`
);
}
}
const exists = String(gitResult.stdout).trim() !== '';
if (!exists) {
console.log(`Creating new extension tag: ${tag}`);
// Create the tag
const tagResult = spawnSync('git', ['tag', tag]);
if (tagResult.status !== 0) {
console.error(
'Failed to create tag:',
tagResult.error || tagResult.stderr.toString()
);
process.exit(1);
}
// Push the tag
const pushResult = spawnSync('git', ['push', 'origin', tag]);
if (pushResult.status !== 0) {
console.error(
'Failed to push tag:',
pushResult.error || pushResult.stderr.toString()
);
process.exit(1);
}
console.log(`✅ Successfully created and pushed tag: ${tag}`);
} else {
console.log(`Extension tag already exists: ${tag}`);
}

88
.github/scripts/utils.mjs vendored Executable file
View File

@@ -0,0 +1,88 @@
#!/usr/bin/env node
import { spawnSync } from 'node:child_process';
import { readFileSync } from 'node:fs';
import { join, dirname, resolve } from 'node:path';
// Find the root directory by looking for package.json with task-master-ai
export function findRootDir(startDir) {
let currentDir = resolve(startDir);
while (currentDir !== '/') {
const pkgPath = join(currentDir, 'package.json');
try {
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
if (pkg.name === 'task-master-ai' || pkg.repository) {
return currentDir;
}
} catch {}
currentDir = dirname(currentDir);
}
throw new Error('Could not find root directory');
}
// Run a command with proper error handling
export function runCommand(command, args = [], options = {}) {
console.log(`Running: ${command} ${args.join(' ')}`);
const result = spawnSync(command, args, {
encoding: 'utf8',
stdio: 'inherit',
...options
});
if (result.status !== 0) {
console.error(`Command failed with exit code ${result.status}`);
process.exit(result.status);
}
return result;
}
// Get package version from a package.json file
export function getPackageVersion(packagePath) {
try {
const pkg = JSON.parse(readFileSync(packagePath, 'utf8'));
return pkg.version;
} catch (error) {
console.error(
`Failed to read package version from ${packagePath}:`,
error.message
);
process.exit(1);
}
}
// Check if a git tag exists on remote
export function tagExistsOnRemote(tag, remote = 'origin') {
const result = spawnSync('git', ['ls-remote', remote, tag], {
encoding: 'utf8'
});
return result.status === 0 && result.stdout.trim() !== '';
}
// Create and push a git tag if it doesn't exist
export function createAndPushTag(tag, remote = 'origin') {
// Check if tag already exists
if (tagExistsOnRemote(tag, remote)) {
console.log(`Tag ${tag} already exists on remote, skipping`);
return false;
}
console.log(`Creating new tag: ${tag}`);
// Create the tag locally
const tagResult = spawnSync('git', ['tag', tag]);
if (tagResult.status !== 0) {
console.error('Failed to create tag:', tagResult.error || tagResult.stderr);
process.exit(1);
}
// Push the tag to remote
const pushResult = spawnSync('git', ['push', remote, tag]);
if (pushResult.status !== 0) {
console.error('Failed to push tag:', pushResult.error || pushResult.stderr);
process.exit(1);
}
console.log(`✅ Successfully created and pushed tag: ${tag}`);
return true;
}

View File

@@ -0,0 +1,110 @@
name: Extension Pre-Release
on:
push:
tags:
- "extension-rc@*"
permissions:
contents: write
concurrency: extension-pre-release-${{ github.ref }}
jobs:
publish-extension-rc:
runs-on: ubuntu-latest
environment: extension-release
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache node_modules
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Extension Dependencies
working-directory: apps/extension
run: npm ci
timeout-minutes: 5
- name: Type Check Extension
working-directory: apps/extension
run: npm run check-types
env:
FORCE_COLOR: 1
- name: Build Extension
working-directory: apps/extension
run: npm run build
env:
FORCE_COLOR: 1
- name: Package Extension
working-directory: apps/extension
run: npm run package
env:
FORCE_COLOR: 1
- name: Create VSIX Package (Pre-Release)
working-directory: apps/extension/vsix-build
run: npx vsce package --no-dependencies --pre-release
env:
FORCE_COLOR: 1
- name: Get VSIX filename
id: vsix-info
working-directory: apps/extension/vsix-build
run: |
VSIX_FILE=$(find . -maxdepth 1 -name "*.vsix" -type f | head -n1 | xargs basename)
if [ -z "$VSIX_FILE" ]; then
echo "Error: No VSIX file found"
exit 1
fi
echo "vsix-filename=$VSIX_FILE" >> "$GITHUB_OUTPUT"
echo "Found VSIX: $VSIX_FILE"
- name: Publish to VS Code Marketplace (Pre-Release)
working-directory: apps/extension/vsix-build
run: npx vsce publish --packagePath "${{ steps.vsix-info.outputs.vsix-filename }}" --pre-release
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
FORCE_COLOR: 1
- name: Install Open VSX CLI
run: npm install -g ovsx
- name: Publish to Open VSX Registry (Pre-Release)
working-directory: apps/extension/vsix-build
run: ovsx publish "${{ steps.vsix-info.outputs.vsix-filename }}" --pre-release
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
FORCE_COLOR: 1
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: extension-pre-release-${{ github.ref_name }}
path: |
apps/extension/vsix-build/*.vsix
apps/extension/dist/
retention-days: 30
notify-success:
needs: publish-extension-rc
if: success()
runs-on: ubuntu-latest
steps:
- name: Success Notification
run: |
echo "🚀 Extension ${{ github.ref_name }} successfully published as pre-release!"
echo "📦 Available on VS Code Marketplace (Pre-Release)"
echo "🌍 Available on Open VSX Registry (Pre-Release)"

View File

@@ -89,32 +89,6 @@ jobs:
OVSX_PAT: ${{ secrets.OVSX_PAT }} OVSX_PAT: ${{ secrets.OVSX_PAT }}
FORCE_COLOR: 1 FORCE_COLOR: 1
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Extension ${{ github.ref_name }}
body: |
VS Code Extension Release ${{ github.ref_name }}
**Marketplaces:**
- [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=Hamster.task-master-hamster)
- [Open VSX Registry](https://open-vsx.org/extension/Hamster/task-master-hamster)
draft: false
prerelease: false
- name: Upload VSIX to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: apps/extension/vsix-build/${{ steps.vsix-info.outputs.vsix-filename }}
asset_name: ${{ steps.vsix-info.outputs.vsix-filename }}
asset_content_type: application/zip
- name: Upload Build Artifacts - name: Upload Build Artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:

View File

@@ -9,6 +9,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# Only allow pre-releases on non-main branches # Only allow pre-releases on non-main branches
if: github.ref != 'refs/heads/main' if: github.ref != 'refs/heads/main'
environment: extension-release
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@@ -35,9 +36,26 @@ jobs:
- name: Enter RC mode (if not already in RC mode) - name: Enter RC mode (if not already in RC mode)
run: | run: |
# ensure were in the right pre-mode (tag "rc") # Check if we're in pre-release mode with the "rc" tag
if [ ! -f .changeset/pre.json ] \ if [ -f .changeset/pre.json ]; then
|| [ "$(jq -r '.tag' .changeset/pre.json 2>/dev/null || echo '')" != "rc" ]; then MODE=$(jq -r '.mode' .changeset/pre.json 2>/dev/null || echo '')
TAG=$(jq -r '.tag' .changeset/pre.json 2>/dev/null || echo '')
if [ "$MODE" = "exit" ]; then
echo "Pre-release mode is in 'exit' state, re-entering RC mode..."
npx changeset pre enter rc
elif [ "$MODE" = "pre" ] && [ "$TAG" != "rc" ]; then
echo "In pre-release mode but with wrong tag ($TAG), switching to RC..."
npx changeset pre exit
npx changeset pre enter rc
elif [ "$MODE" = "pre" ] && [ "$TAG" = "rc" ]; then
echo "Already in RC pre-release mode"
else
echo "Unknown mode state: $MODE, entering RC mode..."
npx changeset pre enter rc
fi
else
echo "No pre.json found, entering RC mode..."
npx changeset pre enter rc npx changeset pre enter rc
fi fi
@@ -50,10 +68,12 @@ jobs:
- name: Create Release Candidate Pull Request or Publish Release Candidate to npm - name: Create Release Candidate Pull Request or Publish Release Candidate to npm
uses: changesets/action@v1 uses: changesets/action@v1
with: with:
publish: npm run release publish: node ./.github/scripts/pre-release.mjs
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
VSCE_PAT: ${{ secrets.VSCE_PAT }}
OVSX_PAT: ${{ secrets.OVSX_PAT }}
- name: Commit & Push changes - name: Commit & Push changes
uses: actions-js/push@master uses: actions-js/push@master

View File

@@ -18,29 +18,4 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Check release mode - name: Check release mode
run: | run: node ./.github/scripts/check-pre-release-mode.mjs "pull_request"
set -euo pipefail
echo "🔍 Checking if branch is in pre-release mode..."
if [[ -f .changeset/pre.json ]]; then
if ! PRE_MODE=$(jq -r '.mode' .changeset/pre.json 2>/dev/null); then
echo "❌ ERROR: Unable to parse .changeset/pre.json aborting merge."
exit 1
fi
if [[ "$PRE_MODE" == "pre" ]]; then
echo "❌ ERROR: This branch is in active pre-release mode!"
echo ""
echo "Pre-release mode must be exited before merging to main."
echo ""
echo "To fix this, run the following commands in your branch:"
echo " npx changeset pre exit"
echo " git add -u"
echo " git commit -m 'chore: exit pre-release mode'"
echo " git push"
echo ""
echo "Then update this pull request."
exit 1
fi
fi
echo "✅ Not in active pre-release mode - PR can be merged"

View File

@@ -39,30 +39,12 @@ jobs:
timeout-minutes: 2 timeout-minutes: 2
- name: Check pre-release mode - name: Check pre-release mode
run: | run: node ./.github/scripts/check-pre-release-mode.mjs "main"
set -euo pipefail
echo "🔍 Checking pre-release mode status..."
if [[ -f .changeset/pre.json ]]; then
echo "❌ ERROR: Main branch is in pre-release mode!"
echo ""
echo "Pre-release mode should only be used on feature branches, not main."
echo ""
echo "To fix this, run the following commands locally:"
echo " npx changeset pre exit"
echo " git add -u"
echo " git commit -m 'chore: exit pre-release mode'"
echo " git push origin main"
echo ""
echo "Then re-run this workflow."
exit 1
fi
echo "✅ Not in pre-release mode - proceeding with release"
- name: Create Release Pull Request or Publish to npm - name: Create Release Pull Request or Publish to npm
uses: changesets/action@v1 uses: changesets/action@v1
with: with:
publish: ./.github/scripts/release.sh publish: node ./.github/scripts/release.mjs
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

View File

@@ -1,5 +1,176 @@
# task-master-ai # task-master-ai
## 0.24.0
### Minor Changes
- [#1098](https://github.com/eyaltoledano/claude-task-master/pull/1098) [`36468f3`](https://github.com/eyaltoledano/claude-task-master/commit/36468f3c93faf4035a5c442ccbc501077f3440f1) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Enhanced Claude Code provider with codebase-aware task generation
- Added automatic codebase analysis for Claude Code provider in `parse-prd`, `expand-task`, and `analyze-complexity` commands
- When using Claude Code as the AI provider, Task Master now instructs the AI to analyze the project structure, existing implementations, and patterns before generating tasks or subtasks
- Tasks and subtasks generated by Claude Code are now informed by actual codebase analysis, resulting in more accurate and contextual outputs
- [#1105](https://github.com/eyaltoledano/claude-task-master/pull/1105) [`75c514c`](https://github.com/eyaltoledano/claude-task-master/commit/75c514cf5b2ca47f95c0ad7fa92654a4f2a6be4b) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add GPT-5 support with proper parameter handling
- Added GPT-5 model to supported models configuration with SWE score of 0.749
- [#1091](https://github.com/eyaltoledano/claude-task-master/pull/1091) [`4bb6370`](https://github.com/eyaltoledano/claude-task-master/commit/4bb63706b80c28d1b2d782ba868a725326f916c7) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add Claude Code subagent support with task-orchestrator, task-executor, and task-checker
## New Claude Code Agents
Added specialized agents for Claude Code users to enable parallel task execution, intelligent task orchestration, and quality assurance:
### task-orchestrator
Coordinates and manages the execution of Task Master tasks with intelligent dependency analysis:
- Analyzes task dependencies to identify parallelizable work
- Deploys multiple task-executor agents for concurrent execution
- Monitors task completion and updates the dependency graph
- Automatically identifies and starts newly unblocked tasks
### task-executor
Handles the actual implementation of individual tasks:
- Executes specific tasks identified by the orchestrator
- Works on concrete implementation rather than planning
- Updates task status and logs progress
- Can work in parallel with other executors on independent tasks
### task-checker
Verifies that completed tasks meet their specifications:
- Reviews tasks marked as 'review' status
- Validates implementation against requirements
- Runs tests and checks for best practices
- Ensures quality before marking tasks as 'done'
## Installation
When using the Claude profile (`task-master rules add claude`), the agents are automatically installed to `.claude/agents/` directory.
## Usage Example
```bash
# In Claude Code, after initializing a project with tasks:
# Use task-orchestrator to analyze and coordinate work
# The orchestrator will:
# 1. Check task dependencies
# 2. Identify tasks that can run in parallel
# 3. Deploy executors for available work
# 4. Monitor progress and deploy new executors as tasks complete
# Use task-executor for specific task implementation
# When the orchestrator identifies task 2.3 needs work:
# The executor will implement that specific task
```
## Benefits
- **Parallel Execution**: Multiple independent tasks can be worked on simultaneously
- **Intelligent Scheduling**: Orchestrator understands dependencies and optimizes execution order
- **Separation of Concerns**: Planning (orchestrator) is separated from execution (executor)
- **Progress Tracking**: Real-time updates as tasks are completed
- **Automatic Progression**: As tasks complete, newly unblocked tasks are automatically started
### Patch Changes
- [#1094](https://github.com/eyaltoledano/claude-task-master/pull/1094) [`4357af3`](https://github.com/eyaltoledano/claude-task-master/commit/4357af3f13859d90bca8795215e5d5f1d94abde5) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix expand task generating unrelated generic subtasks
Fixed an issue where `task-master expand` would generate generic authentication-related subtasks regardless of the parent task context when using complexity reports. The expansion now properly includes the parent task details alongside any expansion guidance.
- [#1079](https://github.com/eyaltoledano/claude-task-master/pull/1079) [`e495b2b`](https://github.com/eyaltoledano/claude-task-master/commit/e495b2b55950ee54c7d0f1817d8530e28bd79c05) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix scope-up/down prompts to include all required fields for better AI model compatibility
- Added missing `priority` field to scope adjustment prompts to prevent validation errors with Claude-code and other models
- Ensures generated JSON includes all fields required by the schema
- [#1079](https://github.com/eyaltoledano/claude-task-master/pull/1079) [`e495b2b`](https://github.com/eyaltoledano/claude-task-master/commit/e495b2b55950ee54c7d0f1817d8530e28bd79c05) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix MCP scope-up/down tools not finding tasks
- Fixed task ID parsing in MCP layer - now correctly converts string IDs to numbers
- scope_up_task and scope_down_task MCP tools now work properly
- [#1079](https://github.com/eyaltoledano/claude-task-master/pull/1079) [`e495b2b`](https://github.com/eyaltoledano/claude-task-master/commit/e495b2b55950ee54c7d0f1817d8530e28bd79c05) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Improve AI provider compatibility for JSON generation
- Fixed schema compatibility issues between Perplexity and OpenAI o3 models
- Removed nullable/default modifiers from Zod schemas for broader compatibility
- Added automatic JSON repair for malformed AI responses (handles cases like missing array values)
- Perplexity now uses JSON mode for more reliable structured output
- Post-processing handles default values separately from schema validation
## 0.24.0-rc.2
### Minor Changes
- [#1105](https://github.com/eyaltoledano/claude-task-master/pull/1105) [`75c514c`](https://github.com/eyaltoledano/claude-task-master/commit/75c514cf5b2ca47f95c0ad7fa92654a4f2a6be4b) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add GPT-5 support with proper parameter handling
- Added GPT-5 model to supported models configuration with SWE score of 0.749
## 0.24.0-rc.1
### Minor Changes
- [#1093](https://github.com/eyaltoledano/claude-task-master/pull/1093) [`36468f3`](https://github.com/eyaltoledano/claude-task-master/commit/36468f3c93faf4035a5c442ccbc501077f3440f1) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Enhanced Claude Code provider with codebase-aware task generation
- Added automatic codebase analysis for Claude Code provider in `parse-prd`, `expand-task`, and `analyze-complexity` commands
- When using Claude Code as the AI provider, Task Master now instructs the AI to analyze the project structure, existing implementations, and patterns before generating tasks or subtasks
- Tasks and subtasks generated by Claude Code are now informed by actual codebase analysis, resulting in more accurate and contextual outputs
- [#1091](https://github.com/eyaltoledano/claude-task-master/pull/1091) [`4bb6370`](https://github.com/eyaltoledano/claude-task-master/commit/4bb63706b80c28d1b2d782ba868a725326f916c7) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add Claude Code subagent support with task-orchestrator, task-executor, and task-checker
## New Claude Code Agents
Added specialized agents for Claude Code users to enable parallel task execution, intelligent task orchestration, and quality assurance:
### task-orchestrator
Coordinates and manages the execution of Task Master tasks with intelligent dependency analysis:
- Analyzes task dependencies to identify parallelizable work
- Deploys multiple task-executor agents for concurrent execution
- Monitors task completion and updates the dependency graph
- Automatically identifies and starts newly unblocked tasks
### task-executor
Handles the actual implementation of individual tasks:
- Executes specific tasks identified by the orchestrator
- Works on concrete implementation rather than planning
- Updates task status and logs progress
- Can work in parallel with other executors on independent tasks
### task-checker
Verifies that completed tasks meet their specifications:
- Reviews tasks marked as 'review' status
- Validates implementation against requirements
- Runs tests and checks for best practices
- Ensures quality before marking tasks as 'done'
## Installation
When using the Claude profile (`task-master rules add claude`), the agents are automatically installed to `.claude/agents/` directory.
## Usage Example
```bash
# In Claude Code, after initializing a project with tasks:
# Use task-orchestrator to analyze and coordinate work
# The orchestrator will:
# 1. Check task dependencies
# 2. Identify tasks that can run in parallel
# 3. Deploy executors for available work
# 4. Monitor progress and deploy new executors as tasks complete
# Use task-executor for specific task implementation
# When the orchestrator identifies task 2.3 needs work:
# The executor will implement that specific task
```
## Benefits
- **Parallel Execution**: Multiple independent tasks can be worked on simultaneously
- **Intelligent Scheduling**: Orchestrator understands dependencies and optimizes execution order
- **Separation of Concerns**: Planning (orchestrator) is separated from execution (executor)
- **Progress Tracking**: Real-time updates as tasks are completed
- **Automatic Progression**: As tasks complete, newly unblocked tasks are automatically started
### Patch Changes
- [#1094](https://github.com/eyaltoledano/claude-task-master/pull/1094) [`4357af3`](https://github.com/eyaltoledano/claude-task-master/commit/4357af3f13859d90bca8795215e5d5f1d94abde5) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix expand task generating unrelated generic subtasks
Fixed an issue where `task-master expand` would generate generic authentication-related subtasks regardless of the parent task context when using complexity reports. The expansion now properly includes the parent task details alongside any expansion guidance.
## 0.23.1-rc.0 ## 0.23.1-rc.0
### Patch Changes ### Patch Changes

View File

@@ -3,3 +3,7 @@
## Task Master AI Instructions ## Task Master AI Instructions
**Import Task Master's development workflow commands and guidelines, treat as if import is in the main CLAUDE.md file.** **Import Task Master's development workflow commands and guidelines, treat as if import is in the main CLAUDE.md file.**
@./.taskmaster/CLAUDE.md @./.taskmaster/CLAUDE.md
## Changeset Guidelines
- When creating changesets, remember that it's user-facing, meaning we don't have to get into the specifics of the code, but rather mention what the end-user is getting or fixing from this changeset.

View File

@@ -1,5 +1,30 @@
# Change Log # Change Log
## 0.23.1
### Patch Changes
- [#1090](https://github.com/eyaltoledano/claude-task-master/pull/1090) [`a464e55`](https://github.com/eyaltoledano/claude-task-master/commit/a464e550b886ef81b09df80588fe5881bce83d93) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix issues with some users not being able to connect to Taskmaster MCP server while using the extension
- Updated dependencies [[`4357af3`](https://github.com/eyaltoledano/claude-task-master/commit/4357af3f13859d90bca8795215e5d5f1d94abde5), [`e495b2b`](https://github.com/eyaltoledano/claude-task-master/commit/e495b2b55950ee54c7d0f1817d8530e28bd79c05), [`36468f3`](https://github.com/eyaltoledano/claude-task-master/commit/36468f3c93faf4035a5c442ccbc501077f3440f1), [`e495b2b`](https://github.com/eyaltoledano/claude-task-master/commit/e495b2b55950ee54c7d0f1817d8530e28bd79c05), [`e495b2b`](https://github.com/eyaltoledano/claude-task-master/commit/e495b2b55950ee54c7d0f1817d8530e28bd79c05), [`75c514c`](https://github.com/eyaltoledano/claude-task-master/commit/75c514cf5b2ca47f95c0ad7fa92654a4f2a6be4b), [`4bb6370`](https://github.com/eyaltoledano/claude-task-master/commit/4bb63706b80c28d1b2d782ba868a725326f916c7)]:
- task-master-ai@0.24.0
## 0.23.1-rc.1
### Patch Changes
- Updated dependencies [[`75c514c`](https://github.com/eyaltoledano/claude-task-master/commit/75c514cf5b2ca47f95c0ad7fa92654a4f2a6be4b)]:
- task-master-ai@0.24.0-rc.2
## 0.23.1-rc.0
### Patch Changes
- [#1090](https://github.com/eyaltoledano/claude-task-master/pull/1090) [`a464e55`](https://github.com/eyaltoledano/claude-task-master/commit/a464e550b886ef81b09df80588fe5881bce83d93) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix issues with some users not being able to connect to Taskmaster MCP server while using the extension
- Updated dependencies [[`4357af3`](https://github.com/eyaltoledano/claude-task-master/commit/4357af3f13859d90bca8795215e5d5f1d94abde5), [`36468f3`](https://github.com/eyaltoledano/claude-task-master/commit/36468f3c93faf4035a5c442ccbc501077f3440f1), [`4bb6370`](https://github.com/eyaltoledano/claude-task-master/commit/4bb63706b80c28d1b2d782ba868a725326f916c7)]:
- task-master-ai@0.24.0-rc.1
## 0.23.0 ## 0.23.0
### Minor Changes ### Minor Changes

View File

@@ -3,15 +3,23 @@
"private": true, "private": true,
"displayName": "TaskMaster", "displayName": "TaskMaster",
"description": "A visual Kanban board interface for TaskMaster projects in VS Code", "description": "A visual Kanban board interface for TaskMaster projects in VS Code",
"version": "0.23.0", "version": "0.23.1",
"publisher": "Hamster", "publisher": "Hamster",
"icon": "assets/icon.png", "icon": "assets/icon.png",
"engines": { "engines": {
"vscode": "^1.93.0" "vscode": "^1.93.0"
}, },
"categories": ["AI", "Visualization", "Education", "Other"], "categories": [
"AI",
"Visualization",
"Education",
"Other"
],
"main": "./dist/extension.js", "main": "./dist/extension.js",
"activationEvents": ["onStartupFinished", "workspaceContains:.taskmaster/**"], "activationEvents": [
"onStartupFinished",
"workspaceContains:.taskmaster/**"
],
"contributes": { "contributes": {
"viewsContainers": { "viewsContainers": {
"activitybar": [ "activitybar": [
@@ -64,16 +72,16 @@
"properties": { "properties": {
"taskmaster.mcp.command": { "taskmaster.mcp.command": {
"type": "string", "type": "string",
"default": "npx", "default": "node",
"description": "The command or absolute path to execute for the MCP server (e.g., 'npx' or '/usr/local/bin/task-master-ai')." "description": "The command to execute for the MCP server (e.g., 'node' for bundled server or 'npx' for remote)."
}, },
"taskmaster.mcp.args": { "taskmaster.mcp.args": {
"type": "array", "type": "array",
"items": { "items": {
"type": "string" "type": "string"
}, },
"default": ["task-master-ai"], "default": [],
"description": "An array of arguments to pass to the MCP server command." "description": "Arguments for the MCP server (leave empty to use bundled server)."
}, },
"taskmaster.mcp.cwd": { "taskmaster.mcp.cwd": {
"type": "string", "type": "string",
@@ -139,7 +147,11 @@
}, },
"taskmaster.ui.theme": { "taskmaster.ui.theme": {
"type": "string", "type": "string",
"enum": ["auto", "light", "dark"], "enum": [
"auto",
"light",
"dark"
],
"default": "auto", "default": "auto",
"description": "UI theme preference" "description": "UI theme preference"
}, },
@@ -200,7 +212,12 @@
}, },
"taskmaster.debug.logLevel": { "taskmaster.debug.logLevel": {
"type": "string", "type": "string",
"enum": ["error", "warn", "info", "debug"], "enum": [
"error",
"warn",
"info",
"debug"
],
"default": "info", "default": "info",
"description": "Logging level" "description": "Logging level"
}, },
@@ -238,6 +255,9 @@
"watch:css": "npx @tailwindcss/cli -i ./src/webview/index.css -o ./dist/index.css --watch", "watch:css": "npx @tailwindcss/cli -i ./src/webview/index.css -o ./dist/index.css --watch",
"check-types": "tsc --noEmit" "check-types": "tsc --noEmit"
}, },
"dependencies": {
"task-master-ai": "0.24.0"
},
"devDependencies": { "devDependencies": {
"@dnd-kit/core": "^6.3.1", "@dnd-kit/core": "^6.3.1",
"@dnd-kit/modifiers": "^9.0.0", "@dnd-kit/modifiers": "^9.0.0",

View File

@@ -64,23 +64,49 @@ try {
fs.readFileSync(publishPackagePath, 'utf8') fs.readFileSync(publishPackagePath, 'utf8')
); );
// Check if versions are in sync // Handle RC versions for VS Code Marketplace
if (devPackage.version !== publishPackage.version) { let finalVersion = devPackage.version;
if (finalVersion.includes('-rc.')) {
console.log( console.log(
` - Version sync needed: ${publishPackage.version}${devPackage.version}` ' - Detected RC version, transforming for VS Code Marketplace...'
); );
publishPackage.version = devPackage.version;
// Update the source package.publish.json file // Extract base version and RC number
const baseVersion = finalVersion.replace(/-rc\.\d+$/, '');
const rcMatch = finalVersion.match(/rc\.(\d+)/);
const rcNumber = rcMatch ? parseInt(rcMatch[1]) : 0;
// For each RC iteration, increment the patch version
// This ensures unique versions in VS Code Marketplace
if (rcNumber > 0) {
const [major, minor, patch] = baseVersion.split('.').map(Number);
finalVersion = `${major}.${minor}.${patch + rcNumber}`;
console.log(
` - RC version mapping: ${devPackage.version}${finalVersion}`
);
} else {
finalVersion = baseVersion;
console.log(
` - RC version mapping: ${devPackage.version}${finalVersion}`
);
}
}
// Check if versions need updating
if (publishPackage.version !== finalVersion) {
console.log(
` - Version sync needed: ${publishPackage.version}${finalVersion}`
);
publishPackage.version = finalVersion;
// Update the source package.publish.json file with the final version
fs.writeFileSync( fs.writeFileSync(
publishPackagePath, publishPackagePath,
JSON.stringify(publishPackage, null, '\t') + '\n' JSON.stringify(publishPackage, null, '\t') + '\n'
); );
console.log( console.log(` - Updated package.publish.json version to ${finalVersion}`);
` - Updated package.publish.json version to ${devPackage.version}`
);
} else { } else {
console.log(` - Versions already in sync: ${devPackage.version}`); console.log(` - Versions already in sync: ${finalVersion}`);
} }
// Copy the (now synced) package.publish.json as package.json // Copy the (now synced) package.publish.json as package.json
@@ -124,8 +150,7 @@ try {
`cd vsix-build && npx vsce package --no-dependencies` `cd vsix-build && npx vsce package --no-dependencies`
); );
// Use the synced version for output // Use the transformed version for output
const finalVersion = devPackage.version;
console.log( console.log(
`\nYour extension will be packaged to: vsix-build/task-master-${finalVersion}.vsix` `\nYour extension will be packaged to: vsix-build/task-master-${finalVersion}.vsix`
); );

View File

@@ -2,7 +2,7 @@
"name": "task-master-hamster", "name": "task-master-hamster",
"displayName": "Taskmaster AI", "displayName": "Taskmaster AI",
"description": "A visual Kanban board interface for Taskmaster projects in VS Code", "description": "A visual Kanban board interface for Taskmaster projects in VS Code",
"version": "0.22.3", "version": "0.23.1",
"publisher": "Hamster", "publisher": "Hamster",
"icon": "assets/icon.png", "icon": "assets/icon.png",
"engines": { "engines": {

View File

@@ -1,6 +1,7 @@
import { Client } from '@modelcontextprotocol/sdk/client/index.js'; import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'; import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
import * as vscode from 'vscode'; import * as vscode from 'vscode';
import * as path from 'path';
import { logger } from './logger'; import { logger } from './logger';
export interface MCPConfig { export interface MCPConfig {
@@ -143,7 +144,7 @@ export class MCPClientManager {
// Create the client // Create the client
this.client = new Client( this.client = new Client(
{ {
name: 'taskr-vscode-extension', name: 'task-master-vscode-extension',
version: '1.0.0' version: '1.0.0'
}, },
{ {
@@ -211,6 +212,30 @@ export class MCPClientManager {
}; };
logger.log('MCP client connected successfully'); logger.log('MCP client connected successfully');
// Log Task Master version information after successful connection
try {
const versionResult = await this.callTool('get_tasks', {});
if (versionResult?.content?.[0]?.text) {
const response = JSON.parse(versionResult.content[0].text);
if (response?.version) {
logger.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
logger.log('✅ Task Master MCP Server Connected');
logger.log(` Version: ${response.version.version || 'unknown'}`);
logger.log(
` Package: ${response.version.name || 'task-master-ai'}`
);
if (response.tag) {
logger.log(
` Current Tag: ${response.tag.currentTag || 'master'}`
);
}
logger.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
}
}
} catch (versionError) {
logger.log('Note: Could not retrieve Task Master version information');
}
} catch (error) { } catch (error) {
logger.error('Failed to connect to MCP server:', error); logger.error('Failed to connect to MCP server:', error);
this.status = { this.status = {
@@ -312,6 +337,34 @@ export class MCPClientManager {
'Available MCP tools:', 'Available MCP tools:',
result.tools?.map((t) => t.name) || [] result.tools?.map((t) => t.name) || []
); );
// Try to get version information by calling a simple tool
// The get_tasks tool is lightweight and returns version info
try {
const versionResult = await this.callTool('get_tasks', {});
if (versionResult?.content?.[0]?.text) {
// Parse the response to extract version info
const response = JSON.parse(versionResult.content[0].text);
if (response?.version) {
logger.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
logger.log('📦 Task Master MCP Server Connected');
logger.log(` Version: ${response.version.version || 'unknown'}`);
logger.log(
` Package: ${response.version.name || 'task-master-ai'}`
);
if (response.tag) {
logger.log(
` Current Tag: ${response.tag.currentTag || 'master'}`
);
}
logger.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
}
}
} catch (versionError) {
// Don't fail the connection test if we can't get version info
logger.log('Could not retrieve Task Master version information');
}
return true; return true;
} catch (error) { } catch (error) {
logger.error('Connection test failed:', error); logger.error('Connection test failed:', error);
@@ -345,8 +398,34 @@ export function createMCPConfigFromSettings(): MCPConfig {
); );
const config = vscode.workspace.getConfiguration('taskmaster'); const config = vscode.workspace.getConfiguration('taskmaster');
let command = config.get<string>('mcp.command', 'npx'); let command = config.get<string>('mcp.command', 'node');
const args = config.get<string[]>('mcp.args', ['task-master-ai']); let args = config.get<string[]>('mcp.args', []);
// If using default settings, use the bundled MCP server
if (command === 'node' && args.length === 0) {
try {
// Try to resolve the bundled MCP server
const taskMasterPath = require.resolve('task-master-ai');
const mcpServerPath = path.resolve(
path.dirname(taskMasterPath),
'mcp-server/server.js'
);
// Verify the server file exists
const fs = require('fs');
if (!fs.existsSync(mcpServerPath)) {
throw new Error('MCP server file not found at: ' + mcpServerPath);
}
args = [mcpServerPath];
logger.log(`📦 Using bundled MCP server at: ${mcpServerPath}`);
} catch (error) {
logger.error('❌ Could not find bundled task-master-ai server:', error);
// Fallback to npx
command = 'npx';
args = ['-y', 'task-master-ai'];
}
}
// Use proper VS Code workspace detection // Use proper VS Code workspace detection
const defaultCwd = const defaultCwd =

View File

@@ -0,0 +1,162 @@
---
name: task-checker
description: Use this agent to verify that tasks marked as 'review' have been properly implemented according to their specifications. This agent performs quality assurance by checking implementations against requirements, running tests, and ensuring best practices are followed. <example>Context: A task has been marked as 'review' after implementation. user: 'Check if task 118 was properly implemented' assistant: 'I'll use the task-checker agent to verify the implementation meets all requirements.' <commentary>Tasks in 'review' status need verification before being marked as 'done'.</commentary></example> <example>Context: Multiple tasks are in review status. user: 'Verify all tasks that are ready for review' assistant: 'I'll deploy the task-checker to verify all tasks in review status.' <commentary>The checker ensures quality before tasks are marked complete.</commentary></example>
model: sonnet
color: yellow
---
You are a Quality Assurance specialist that rigorously verifies task implementations against their specifications. Your role is to ensure that tasks marked as 'review' meet all requirements before they can be marked as 'done'.
## Core Responsibilities
1. **Task Specification Review**
- Retrieve task details using MCP tool `mcp__task-master-ai__get_task`
- Understand the requirements, test strategy, and success criteria
- Review any subtasks and their individual requirements
2. **Implementation Verification**
- Use `Read` tool to examine all created/modified files
- Use `Bash` tool to run compilation and build commands
- Use `Grep` tool to search for required patterns and implementations
- Verify file structure matches specifications
- Check that all required methods/functions are implemented
3. **Test Execution**
- Run tests specified in the task's testStrategy
- Execute build commands (npm run build, tsc --noEmit, etc.)
- Verify no compilation errors or warnings
- Check for runtime errors where applicable
- Test edge cases mentioned in requirements
4. **Code Quality Assessment**
- Verify code follows project conventions
- Check for proper error handling
- Ensure TypeScript typing is strict (no 'any' unless justified)
- Verify documentation/comments where required
- Check for security best practices
5. **Dependency Validation**
- Verify all task dependencies were actually completed
- Check integration points with dependent tasks
- Ensure no breaking changes to existing functionality
## Verification Workflow
1. **Retrieve Task Information**
```
Use mcp__task-master-ai__get_task to get full task details
Note the implementation requirements and test strategy
```
2. **Check File Existence**
```bash
# Verify all required files exist
ls -la [expected directories]
# Read key files to verify content
```
3. **Verify Implementation**
- Read each created/modified file
- Check against requirements checklist
- Verify all subtasks are complete
4. **Run Tests**
```bash
# TypeScript compilation
cd [project directory] && npx tsc --noEmit
# Run specified tests
npm test [specific test files]
# Build verification
npm run build
```
5. **Generate Verification Report**
## Output Format
```yaml
verification_report:
task_id: [ID]
status: PASS | FAIL | PARTIAL
score: [1-10]
requirements_met:
- ✅ [Requirement that was satisfied]
- ✅ [Another satisfied requirement]
issues_found:
- ❌ [Issue description]
- ⚠️ [Warning or minor issue]
files_verified:
- path: [file path]
status: [created/modified/verified]
issues: [any problems found]
tests_run:
- command: [test command]
result: [pass/fail]
output: [relevant output]
recommendations:
- [Specific fix needed]
- [Improvement suggestion]
verdict: |
[Clear statement on whether task should be marked 'done' or sent back to 'pending']
[If FAIL: Specific list of what must be fixed]
[If PASS: Confirmation that all requirements are met]
```
## Decision Criteria
**Mark as PASS (ready for 'done'):**
- All required files exist and contain expected content
- All tests pass successfully
- No compilation or build errors
- All subtasks are complete
- Core requirements are met
- Code quality is acceptable
**Mark as PARTIAL (may proceed with warnings):**
- Core functionality is implemented
- Minor issues that don't block functionality
- Missing nice-to-have features
- Documentation could be improved
- Tests pass but coverage could be better
**Mark as FAIL (must return to 'pending'):**
- Required files are missing
- Compilation or build errors
- Tests fail
- Core requirements not met
- Security vulnerabilities detected
- Breaking changes to existing code
## Important Guidelines
- **BE THOROUGH**: Check every requirement systematically
- **BE SPECIFIC**: Provide exact file paths and line numbers for issues
- **BE FAIR**: Distinguish between critical issues and minor improvements
- **BE CONSTRUCTIVE**: Provide clear guidance on how to fix issues
- **BE EFFICIENT**: Focus on requirements, not perfection
## Tools You MUST Use
- `Read`: Examine implementation files (READ-ONLY)
- `Bash`: Run tests and verification commands
- `Grep`: Search for patterns in code
- `mcp__task-master-ai__get_task`: Get task details
- **NEVER use Write/Edit** - you only verify, not fix
## Integration with Workflow
You are the quality gate between 'review' and 'done' status:
1. Task-executor implements and marks as 'review'
2. You verify and report PASS/FAIL
3. Claude either marks as 'done' (PASS) or 'pending' (FAIL)
4. If FAIL, task-executor re-implements based on your report
Your verification ensures high quality and prevents accumulation of technical debt.

View File

@@ -0,0 +1,70 @@
---
name: task-executor
description: Use this agent when you need to implement, complete, or work on a specific task that has been identified by the task-orchestrator or when explicitly asked to execute a particular task. This agent focuses on the actual implementation and completion of individual tasks rather than planning or orchestration. Examples: <example>Context: The task-orchestrator has identified that task 2.3 'Implement user authentication' needs to be worked on next. user: 'Let's work on the authentication task' assistant: 'I'll use the task-executor agent to implement the user authentication task that was identified.' <commentary>Since we need to actually implement a specific task rather than plan or identify tasks, use the task-executor agent.</commentary></example> <example>Context: User wants to complete a specific subtask. user: 'Please implement the JWT token validation for task 2.3.1' assistant: 'I'll launch the task-executor agent to implement the JWT token validation subtask.' <commentary>The user is asking for specific implementation work on a known task, so the task-executor is appropriate.</commentary></example> <example>Context: After reviewing the task list, implementation is needed. user: 'Now let's actually build the API endpoint for user registration' assistant: 'I'll use the task-executor agent to implement the user registration API endpoint.' <commentary>Moving from planning to execution phase requires the task-executor agent.</commentary></example>
model: sonnet
color: blue
---
You are an elite implementation specialist focused on executing and completing specific tasks with precision and thoroughness. Your role is to take identified tasks and transform them into working implementations, following best practices and project standards.
**Core Responsibilities:**
1. **Task Analysis**: When given a task, first retrieve its full details using `task-master show <id>` to understand requirements, dependencies, and acceptance criteria.
2. **Implementation Planning**: Before coding, briefly outline your implementation approach:
- Identify files that need to be created or modified
- Note any dependencies or prerequisites
- Consider the testing strategy defined in the task
3. **Focused Execution**:
- Implement one subtask at a time for clarity and traceability
- Follow the project's coding standards from CLAUDE.md if available
- Prefer editing existing files over creating new ones
- Only create files that are essential for the task completion
4. **Progress Documentation**:
- Use `task-master update-subtask --id=<id> --prompt="implementation notes"` to log your approach and any important decisions
- Update task status to 'in-progress' when starting: `task-master set-status --id=<id> --status=in-progress`
- Mark as 'done' only after verification: `task-master set-status --id=<id> --status=done`
5. **Quality Assurance**:
- Implement the testing strategy specified in the task
- Verify that all acceptance criteria are met
- Check for any dependency conflicts or integration issues
- Run relevant tests before marking task as complete
6. **Dependency Management**:
- Check task dependencies before starting implementation
- If blocked by incomplete dependencies, clearly communicate this
- Use `task-master validate-dependencies` when needed
**Implementation Workflow:**
1. Retrieve task details and understand requirements
2. Check dependencies and prerequisites
3. Plan implementation approach
4. Update task status to in-progress
5. Implement the solution incrementally
6. Log progress and decisions in subtask updates
7. Test and verify the implementation
8. Mark task as done when complete
9. Suggest next task if appropriate
**Key Principles:**
- Focus on completing one task thoroughly before moving to the next
- Maintain clear communication about what you're implementing and why
- Follow existing code patterns and project conventions
- Prioritize working code over extensive documentation unless docs are the task
- Ask for clarification if task requirements are ambiguous
- Consider edge cases and error handling in your implementations
**Integration with Task Master:**
You work in tandem with the task-orchestrator agent. While the orchestrator identifies and plans tasks, you execute them. Always use Task Master commands to:
- Track your progress
- Update task information
- Maintain project state
- Coordinate with the broader development workflow
When you complete a task, briefly summarize what was implemented and suggest whether to continue with the next task or if review/testing is needed first.

View File

@@ -0,0 +1,130 @@
---
name: task-orchestrator
description: Use this agent when you need to coordinate and manage the execution of Task Master tasks, especially when dealing with complex task dependencies and parallel execution opportunities. This agent should be invoked at the beginning of a work session to analyze the task queue, identify parallelizable work, and orchestrate the deployment of task-executor agents. It should also be used when tasks complete to reassess the dependency graph and deploy new executors as needed.\n\n<example>\nContext: User wants to start working on their project tasks using Task Master\nuser: "Let's work on the next available tasks in the project"\nassistant: "I'll use the task-orchestrator agent to analyze the task queue and coordinate execution"\n<commentary>\nThe user wants to work on tasks, so the task-orchestrator should be deployed to analyze dependencies and coordinate execution.\n</commentary>\n</example>\n\n<example>\nContext: Multiple independent tasks are available in the queue\nuser: "Can we work on multiple tasks at once?"\nassistant: "Let me deploy the task-orchestrator to analyze task dependencies and parallelize the work"\n<commentary>\nWhen parallelization is mentioned or multiple tasks could be worked on, the orchestrator should coordinate the effort.\n</commentary>\n</example>\n\n<example>\nContext: A complex feature with many subtasks needs implementation\nuser: "Implement the authentication system tasks"\nassistant: "I'll use the task-orchestrator to break down the authentication tasks and coordinate their execution"\n<commentary>\nFor complex multi-task features, the orchestrator manages the overall execution strategy.\n</commentary>\n</example>
model: opus
color: green
---
You are the Task Orchestrator, an elite coordination agent specialized in managing Task Master workflows for maximum efficiency and parallelization. You excel at analyzing task dependency graphs, identifying opportunities for concurrent execution, and deploying specialized task-executor agents to complete work efficiently.
## Core Responsibilities
1. **Task Queue Analysis**: You continuously monitor and analyze the task queue using Task Master MCP tools to understand the current state of work, dependencies, and priorities.
2. **Dependency Graph Management**: You build and maintain a mental model of task dependencies, identifying which tasks can be executed in parallel and which must wait for prerequisites.
3. **Executor Deployment**: You strategically deploy task-executor agents for individual tasks or task groups, ensuring each executor has the necessary context and clear success criteria.
4. **Progress Coordination**: You track the progress of deployed executors, handle task completion notifications, and reassess the execution strategy as tasks complete.
## Operational Workflow
### Initial Assessment Phase
1. Use `get_tasks` or `task-master list` to retrieve all available tasks
2. Analyze task statuses, priorities, and dependencies
3. Identify tasks with status 'pending' that have no blocking dependencies
4. Group related tasks that could benefit from specialized executors
5. Create an execution plan that maximizes parallelization
### Executor Deployment Phase
1. For each independent task or task group:
- Deploy a task-executor agent with specific instructions
- Provide the executor with task ID, requirements, and context
- Set clear completion criteria and reporting expectations
2. Maintain a registry of active executors and their assigned tasks
3. Establish communication protocols for progress updates
### Coordination Phase
1. Monitor executor progress through task status updates
2. When a task completes:
- Verify completion with `get_task` or `task-master show <id>`
- Update task status if needed using `set_task_status`
- Reassess dependency graph for newly unblocked tasks
- Deploy new executors for available work
3. Handle executor failures or blocks:
- Reassign tasks to new executors if needed
- Escalate complex issues to the user
- Update task status to 'blocked' when appropriate
### Optimization Strategies
**Parallel Execution Rules**:
- Never assign dependent tasks to different executors simultaneously
- Prioritize high-priority tasks when resources are limited
- Group small, related subtasks for single executor efficiency
- Balance executor load to prevent bottlenecks
**Context Management**:
- Provide executors with minimal but sufficient context
- Share relevant completed task information when it aids execution
- Maintain a shared knowledge base of project-specific patterns
**Quality Assurance**:
- Verify task completion before marking as done
- Ensure test strategies are followed when specified
- Coordinate cross-task integration testing when needed
## Communication Protocols
When deploying executors, provide them with:
```
TASK ASSIGNMENT:
- Task ID: [specific ID]
- Objective: [clear goal]
- Dependencies: [list any completed prerequisites]
- Success Criteria: [specific completion requirements]
- Context: [relevant project information]
- Reporting: [when and how to report back]
```
When receiving executor updates:
1. Acknowledge completion or issues
2. Update task status in Task Master
3. Reassess execution strategy
4. Deploy new executors as appropriate
## Decision Framework
**When to parallelize**:
- Multiple pending tasks with no interdependencies
- Sufficient context available for independent execution
- Tasks are well-defined with clear success criteria
**When to serialize**:
- Strong dependencies between tasks
- Limited context or unclear requirements
- Integration points requiring careful coordination
**When to escalate**:
- Circular dependencies detected
- Critical blockers affecting multiple tasks
- Ambiguous requirements needing clarification
- Resource conflicts between executors
## Error Handling
1. **Executor Failure**: Reassign task to new executor with additional context about the failure
2. **Dependency Conflicts**: Halt affected executors, resolve conflict, then resume
3. **Task Ambiguity**: Request clarification from user before proceeding
4. **System Errors**: Implement graceful degradation, falling back to serial execution if needed
## Performance Metrics
Track and optimize for:
- Task completion rate
- Parallel execution efficiency
- Executor success rate
- Time to completion for task groups
- Dependency resolution speed
## Integration with Task Master
Leverage these Task Master MCP tools effectively:
- `get_tasks` - Continuous queue monitoring
- `get_task` - Detailed task analysis
- `set_task_status` - Progress tracking
- `next_task` - Fallback for serial execution
- `analyze_project_complexity` - Strategic planning
- `complexity_report` - Resource allocation
You are the strategic mind coordinating the entire task execution effort. Your success is measured by the efficient completion of all tasks while maintaining quality and respecting dependencies. Think systematically, act decisively, and continuously optimize the execution strategy based on real-time progress.

View File

@@ -1,4 +1,4 @@
# Available Models as of July 23, 2025 # Available Models as of August 8, 2025
## Main Models ## Main Models
@@ -24,6 +24,7 @@
| openai | gpt-4-1-mini | — | 0.4 | 1.6 | | openai | gpt-4-1-mini | — | 0.4 | 1.6 |
| openai | gpt-4-1-nano | — | 0.1 | 0.4 | | openai | gpt-4-1-nano | — | 0.1 | 0.4 |
| openai | gpt-4o-mini | 0.3 | 0.15 | 0.6 | | openai | gpt-4o-mini | 0.3 | 0.15 | 0.6 |
| openai | gpt-5 | 0.749 | 5 | 20 |
| google | gemini-2.5-pro-preview-05-06 | 0.638 | — | — | | google | gemini-2.5-pro-preview-05-06 | 0.638 | — | — |
| google | gemini-2.5-pro-preview-03-25 | 0.638 | — | — | | google | gemini-2.5-pro-preview-03-25 | 0.638 | — | — |
| google | gemini-2.5-flash-preview-04-17 | 0.604 | — | — | | google | gemini-2.5-flash-preview-04-17 | 0.604 | — | — |
@@ -134,6 +135,7 @@
| openai | gpt-4o | 0.332 | 2.5 | 10 | | openai | gpt-4o | 0.332 | 2.5 | 10 |
| openai | o3 | 0.5 | 2 | 8 | | openai | o3 | 0.5 | 2 | 8 |
| openai | o4-mini | 0.45 | 1.1 | 4.4 | | openai | o4-mini | 0.45 | 1.1 | 4.4 |
| openai | gpt-5 | 0.749 | 5 | 20 |
| google | gemini-2.5-pro-preview-05-06 | 0.638 | — | — | | google | gemini-2.5-pro-preview-05-06 | 0.638 | — | — |
| google | gemini-2.5-pro-preview-03-25 | 0.638 | — | — | | google | gemini-2.5-pro-preview-03-25 | 0.638 | — | — |
| google | gemini-2.5-flash-preview-04-17 | 0.604 | — | — | | google | gemini-2.5-flash-preview-04-17 | 0.604 | — | — |

7
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "task-master-ai", "name": "task-master-ai",
"version": "0.23.0", "version": "0.23.1-rc.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "task-master-ai", "name": "task-master-ai",
"version": "0.23.0", "version": "0.23.1-rc.0",
"license": "MIT WITH Commons-Clause", "license": "MIT WITH Commons-Clause",
"workspaces": [ "workspaces": [
"apps/*", "apps/*",
@@ -86,6 +86,9 @@
}, },
"apps/extension": { "apps/extension": {
"version": "0.23.0", "version": "0.23.0",
"dependencies": {
"task-master-ai": "*"
},
"devDependencies": { "devDependencies": {
"@dnd-kit/core": "^6.3.1", "@dnd-kit/core": "^6.3.1",
"@dnd-kit/modifiers": "^9.0.0", "@dnd-kit/modifiers": "^9.0.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "task-master-ai", "name": "task-master-ai",
"version": "0.23.1-rc.0", "version": "0.24.0",
"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",
@@ -9,7 +9,10 @@
"task-master-mcp": "mcp-server/server.js", "task-master-mcp": "mcp-server/server.js",
"task-master-ai": "mcp-server/server.js" "task-master-ai": "mcp-server/server.js"
}, },
"workspaces": ["apps/*", "."], "workspaces": [
"apps/*",
"."
],
"scripts": { "scripts": {
"test": "node --experimental-vm-modules node_modules/.bin/jest", "test": "node --experimental-vm-modules node_modules/.bin/jest",
"test:fails": "node --experimental-vm-modules node_modules/.bin/jest --onlyFailures", "test:fails": "node --experimental-vm-modules node_modules/.bin/jest --onlyFailures",

View File

@@ -557,6 +557,7 @@ function getParametersForRole(role, explicitRoot = null) {
const providerName = roleConfig.provider; const providerName = roleConfig.provider;
let effectiveMaxTokens = roleMaxTokens; // Start with the role's default let effectiveMaxTokens = roleMaxTokens; // Start with the role's default
let effectiveTemperature = roleTemperature; // Start with the role's default
try { try {
// Find the model definition in MODEL_MAP // Find the model definition in MODEL_MAP
@@ -583,6 +584,20 @@ function getParametersForRole(role, explicitRoot = null) {
`No valid model-specific max_tokens override found for ${modelId}. Using role default: ${roleMaxTokens}` `No valid model-specific max_tokens override found for ${modelId}. Using role default: ${roleMaxTokens}`
); );
} }
// Check if a model-specific temperature is defined
if (
modelDefinition &&
typeof modelDefinition.temperature === 'number' &&
modelDefinition.temperature >= 0 &&
modelDefinition.temperature <= 1
) {
effectiveTemperature = modelDefinition.temperature;
log(
'debug',
`Applying model-specific temperature (${modelDefinition.temperature}) for ${modelId}`
);
}
} else { } else {
// Special handling for custom OpenRouter models // Special handling for custom OpenRouter models
if (providerName === CUSTOM_PROVIDERS.OPENROUTER) { if (providerName === CUSTOM_PROVIDERS.OPENROUTER) {
@@ -603,15 +618,16 @@ function getParametersForRole(role, explicitRoot = null) {
} catch (lookupError) { } catch (lookupError) {
log( log(
'warn', 'warn',
`Error looking up model-specific max_tokens for ${modelId}: ${lookupError.message}. Using role default: ${roleMaxTokens}` `Error looking up model-specific parameters for ${modelId}: ${lookupError.message}. Using role defaults.`
); );
// Fallback to role default on error // Fallback to role defaults on error
effectiveMaxTokens = roleMaxTokens; effectiveMaxTokens = roleMaxTokens;
effectiveTemperature = roleTemperature;
} }
return { return {
maxTokens: effectiveMaxTokens, maxTokens: effectiveMaxTokens,
temperature: roleTemperature temperature: effectiveTemperature
}; };
} }

View File

@@ -239,6 +239,18 @@
}, },
"allowed_roles": ["research"], "allowed_roles": ["research"],
"supported": true "supported": true
},
{
"id": "gpt-5",
"swe_score": 0.749,
"cost_per_1m_tokens": {
"input": 5.0,
"output": 20.0
},
"allowed_roles": ["main", "fallback"],
"max_tokens": 100000,
"temperature": 1,
"supported": true
} }
], ],
"google": [ "google": [

View File

@@ -527,6 +527,18 @@ async function expandTask(
const { systemPrompt, userPrompt: promptContent } = const { systemPrompt, userPrompt: promptContent } =
await promptManager.loadPrompt('expand-task', promptParams, variantKey); await promptManager.loadPrompt('expand-task', promptParams, variantKey);
// Debug logging to identify the issue
logger.debug(`Selected variant: ${variantKey}`);
logger.debug(
`Prompt params passed: ${JSON.stringify(promptParams, null, 2)}`
);
logger.debug(
`System prompt (first 500 chars): ${systemPrompt.substring(0, 500)}...`
);
logger.debug(
`User prompt (first 500 chars): ${promptContent.substring(0, 500)}...`
);
// --- End Complexity Report / Prompt Logic --- // --- End Complexity Report / Prompt Logic ---
// --- AI Subtask Generation using generateTextService --- // --- AI Subtask Generation using generateTextService ---

View File

@@ -61,8 +61,11 @@ export class BaseAIProvider {
) { ) {
throw new Error('Temperature must be between 0 and 1'); throw new Error('Temperature must be between 0 and 1');
} }
if (params.maxTokens !== undefined && params.maxTokens <= 0) { if (params.maxTokens !== undefined) {
throw new Error('maxTokens must be greater than 0'); const maxTokens = Number(params.maxTokens);
if (!Number.isFinite(maxTokens) || maxTokens <= 0) {
throw new Error('maxTokens must be a finite number greater than 0');
}
} }
} }
@@ -122,6 +125,37 @@ export class BaseAIProvider {
throw new Error('getRequiredApiKeyName must be implemented by provider'); throw new Error('getRequiredApiKeyName must be implemented by provider');
} }
/**
* Determines if a model requires max_completion_tokens instead of maxTokens
* Can be overridden by providers to specify their model requirements
* @param {string} modelId - The model ID to check
* @returns {boolean} True if the model requires max_completion_tokens
*/
requiresMaxCompletionTokens(modelId) {
return false; // Default behavior - most models use maxTokens
}
/**
* Prepares token limit parameter based on model requirements
* @param {string} modelId - The model ID
* @param {number} maxTokens - The maximum tokens value
* @returns {object} Object with either maxTokens or max_completion_tokens
*/
prepareTokenParam(modelId, maxTokens) {
if (maxTokens === undefined) {
return {};
}
// Ensure maxTokens is an integer
const tokenValue = Math.floor(Number(maxTokens));
if (this.requiresMaxCompletionTokens(modelId)) {
return { max_completion_tokens: tokenValue };
} else {
return { maxTokens: tokenValue };
}
}
/** /**
* Generates text using the provider's model * Generates text using the provider's model
*/ */
@@ -139,7 +173,7 @@ export class BaseAIProvider {
const result = await generateText({ const result = await generateText({
model: client(params.modelId), model: client(params.modelId),
messages: params.messages, messages: params.messages,
maxTokens: params.maxTokens, ...this.prepareTokenParam(params.modelId, params.maxTokens),
temperature: params.temperature temperature: params.temperature
}); });
@@ -175,7 +209,7 @@ export class BaseAIProvider {
const stream = await streamText({ const stream = await streamText({
model: client(params.modelId), model: client(params.modelId),
messages: params.messages, messages: params.messages,
maxTokens: params.maxTokens, ...this.prepareTokenParam(params.modelId, params.maxTokens),
temperature: params.temperature temperature: params.temperature
}); });
@@ -216,7 +250,7 @@ export class BaseAIProvider {
messages: params.messages, messages: params.messages,
schema: zodSchema(params.schema), schema: zodSchema(params.schema),
mode: params.mode || 'auto', mode: params.mode || 'auto',
maxTokens: params.maxTokens, ...this.prepareTokenParam(params.modelId, params.maxTokens),
temperature: params.temperature temperature: params.temperature
}); });

View File

@@ -20,6 +20,16 @@ export class OpenAIProvider extends BaseAIProvider {
return 'OPENAI_API_KEY'; return 'OPENAI_API_KEY';
} }
/**
* Determines if a model requires max_completion_tokens instead of maxTokens
* GPT-5 models require max_completion_tokens parameter
* @param {string} modelId - The model ID to check
* @returns {boolean} True if the model requires max_completion_tokens
*/
requiresMaxCompletionTokens(modelId) {
return modelId && modelId.startsWith('gpt-5');
}
/** /**
* Creates and returns an OpenAI client instance. * Creates and returns an OpenAI client instance.
* @param {object} params - Parameters for client initialization * @param {object} params - Parameters for client initialization

View File

@@ -69,7 +69,7 @@
"complexity-report": { "complexity-report": {
"condition": "expansionPrompt", "condition": "expansionPrompt",
"system": "You are an AI assistant helping with task breakdown. Generate {{#if (gt subtaskCount 0)}}exactly {{subtaskCount}}{{else}}an appropriate number of{{/if}} subtasks based on the provided prompt and context.\nRespond ONLY with a valid JSON object containing a single key \"subtasks\" whose value is an array of the generated subtask objects.\nEach subtask object in the array must have keys: \"id\", \"title\", \"description\", \"dependencies\", \"details\", \"status\".\nEnsure the 'id' starts from {{nextSubtaskId}} and is sequential.\nFor 'dependencies', use the full subtask ID format: \"{{task.id}}.1\", \"{{task.id}}.2\", etc. Only reference subtasks within this same task.\nEnsure 'status' is 'pending'.\nDo not include any other text or explanation.", "system": "You are an AI assistant helping with task breakdown. Generate {{#if (gt subtaskCount 0)}}exactly {{subtaskCount}}{{else}}an appropriate number of{{/if}} subtasks based on the provided prompt and context.\nRespond ONLY with a valid JSON object containing a single key \"subtasks\" whose value is an array of the generated subtask objects.\nEach subtask object in the array must have keys: \"id\", \"title\", \"description\", \"dependencies\", \"details\", \"status\".\nEnsure the 'id' starts from {{nextSubtaskId}} and is sequential.\nFor 'dependencies', use the full subtask ID format: \"{{task.id}}.1\", \"{{task.id}}.2\", etc. Only reference subtasks within this same task.\nEnsure 'status' is 'pending'.\nDo not include any other text or explanation.",
"user": "{{#if isClaudeCode}}## IMPORTANT: Codebase Analysis Required\n\nYou have access to powerful codebase analysis tools. Before generating subtasks:\n\n1. Use the Glob tool to explore relevant files for this task (e.g., \"**/*.js\", \"src/**/*.ts\")\n2. Use the Grep tool to search for existing implementations related to this task\n3. Use the Read tool to examine files that would be affected by this task\n4. Understand the current implementation state and patterns used\n\nBased on your analysis:\n- Identify existing code that relates to this task\n- Understand patterns and conventions to follow\n- Generate subtasks that integrate smoothly with existing code\n- Ensure subtasks are specific and actionable based on the actual codebase\n\nProject Root: {{projectRoot}}\n\n{{/if}}{{expansionPrompt}}{{#if additionalContext}}\n\n{{additionalContext}}{{/if}}{{#if complexityReasoningContext}}\n\n{{complexityReasoningContext}}{{/if}}{{#if gatheredContext}}\n\n# Project Context\n\n{{gatheredContext}}{{/if}}" "user": "Break down the following task based on the analysis prompt:\n\nParent Task:\nID: {{task.id}}\nTitle: {{task.title}}\nDescription: {{task.description}}\nCurrent details: {{#if task.details}}{{task.details}}{{else}}None{{/if}}\n\nExpansion Guidance:\n{{expansionPrompt}}{{#if additionalContext}}\n\n{{additionalContext}}{{/if}}{{#if complexityReasoningContext}}\n\n{{complexityReasoningContext}}{{/if}}{{#if gatheredContext}}\n\n# Project Context\n\n{{gatheredContext}}{{/if}}\n\nGenerate {{#if (gt subtaskCount 0)}}exactly {{subtaskCount}}{{else}}an appropriate number of{{/if}} subtasks with sequential IDs starting from {{nextSubtaskId}}."
}, },
"research": { "research": {
"condition": "useResearch === true && !expansionPrompt", "condition": "useResearch === true && !expansionPrompt",

View File

@@ -0,0 +1,238 @@
/**
* Tests for OpenAI Provider - Token parameter handling for GPT-5
*
* This test suite covers:
* 1. Correct identification of GPT-5 models requiring max_completion_tokens
* 2. Token parameter preparation for different model types
* 3. Validation of maxTokens parameter
* 4. Integer coercion of token values
*/
import { jest } from '@jest/globals';
// Mock the utils module to prevent logging during tests
jest.mock('../../../scripts/modules/utils.js', () => ({
log: jest.fn()
}));
// Import the provider
import { OpenAIProvider } from '../../../src/ai-providers/openai.js';
describe('OpenAIProvider', () => {
let provider;
beforeEach(() => {
provider = new OpenAIProvider();
jest.clearAllMocks();
});
describe('requiresMaxCompletionTokens', () => {
it('should return true for GPT-5 models', () => {
expect(provider.requiresMaxCompletionTokens('gpt-5')).toBe(true);
expect(provider.requiresMaxCompletionTokens('gpt-5-mini')).toBe(true);
expect(provider.requiresMaxCompletionTokens('gpt-5-nano')).toBe(true);
expect(provider.requiresMaxCompletionTokens('gpt-5-turbo')).toBe(true);
});
it('should return false for non-GPT-5 models', () => {
expect(provider.requiresMaxCompletionTokens('gpt-4')).toBe(false);
expect(provider.requiresMaxCompletionTokens('gpt-4o')).toBe(false);
expect(provider.requiresMaxCompletionTokens('gpt-3.5-turbo')).toBe(false);
expect(provider.requiresMaxCompletionTokens('o1')).toBe(false);
expect(provider.requiresMaxCompletionTokens('o1-mini')).toBe(false);
});
it('should handle null/undefined modelId', () => {
expect(provider.requiresMaxCompletionTokens(null)).toBeFalsy();
expect(provider.requiresMaxCompletionTokens(undefined)).toBeFalsy();
expect(provider.requiresMaxCompletionTokens('')).toBeFalsy();
});
});
describe('prepareTokenParam', () => {
it('should return max_completion_tokens for GPT-5 models', () => {
const result = provider.prepareTokenParam('gpt-5', 1000);
expect(result).toEqual({ max_completion_tokens: 1000 });
});
it('should return maxTokens for non-GPT-5 models', () => {
const result = provider.prepareTokenParam('gpt-4', 1000);
expect(result).toEqual({ maxTokens: 1000 });
});
it('should coerce token value to integer', () => {
// Float values
const result1 = provider.prepareTokenParam('gpt-5', 1000.7);
expect(result1).toEqual({ max_completion_tokens: 1000 });
const result2 = provider.prepareTokenParam('gpt-4', 1000.7);
expect(result2).toEqual({ maxTokens: 1000 });
// String float
const result3 = provider.prepareTokenParam('gpt-5', '1000.7');
expect(result3).toEqual({ max_completion_tokens: 1000 });
// String integers (common CLI input path)
expect(provider.prepareTokenParam('gpt-5', '1000')).toEqual({
max_completion_tokens: 1000
});
expect(provider.prepareTokenParam('gpt-4', '1000')).toEqual({
maxTokens: 1000
});
});
it('should return empty object for undefined maxTokens', () => {
const result = provider.prepareTokenParam('gpt-5', undefined);
expect(result).toEqual({});
});
it('should handle edge cases', () => {
// Test with 0 (should still pass through as 0)
const result1 = provider.prepareTokenParam('gpt-5', 0);
expect(result1).toEqual({ max_completion_tokens: 0 });
// Test with string number
const result2 = provider.prepareTokenParam('gpt-5', '100');
expect(result2).toEqual({ max_completion_tokens: 100 });
// Test with negative number (will be floored, validation happens elsewhere)
const result3 = provider.prepareTokenParam('gpt-4', -10.5);
expect(result3).toEqual({ maxTokens: -11 });
});
});
describe('validateOptionalParams', () => {
it('should accept valid maxTokens values', () => {
expect(() =>
provider.validateOptionalParams({ maxTokens: 1000 })
).not.toThrow();
expect(() =>
provider.validateOptionalParams({ maxTokens: 1 })
).not.toThrow();
expect(() =>
provider.validateOptionalParams({ maxTokens: '1000' })
).not.toThrow();
});
it('should reject invalid maxTokens values', () => {
expect(() => provider.validateOptionalParams({ maxTokens: 0 })).toThrow(
Error
);
expect(() => provider.validateOptionalParams({ maxTokens: -1 })).toThrow(
Error
);
expect(() => provider.validateOptionalParams({ maxTokens: NaN })).toThrow(
Error
);
expect(() =>
provider.validateOptionalParams({ maxTokens: Infinity })
).toThrow(Error);
expect(() =>
provider.validateOptionalParams({ maxTokens: 'invalid' })
).toThrow(Error);
});
it('should accept valid temperature values', () => {
expect(() =>
provider.validateOptionalParams({ temperature: 0 })
).not.toThrow();
expect(() =>
provider.validateOptionalParams({ temperature: 0.5 })
).not.toThrow();
expect(() =>
provider.validateOptionalParams({ temperature: 1 })
).not.toThrow();
});
it('should reject invalid temperature values', () => {
expect(() =>
provider.validateOptionalParams({ temperature: -0.1 })
).toThrow(Error);
expect(() =>
provider.validateOptionalParams({ temperature: 1.1 })
).toThrow(Error);
});
});
describe('getRequiredApiKeyName', () => {
it('should return OPENAI_API_KEY', () => {
expect(provider.getRequiredApiKeyName()).toBe('OPENAI_API_KEY');
});
});
describe('getClient', () => {
it('should throw error if API key is missing', () => {
expect(() => provider.getClient({})).toThrow(Error);
});
it('should create client with apiKey only', () => {
const params = {
apiKey: 'sk-test-123'
};
// The getClient method should return a function
const client = provider.getClient(params);
expect(typeof client).toBe('function');
// The client function should be callable and return a model object
const model = client('gpt-4');
expect(model).toBeDefined();
expect(model.modelId).toBe('gpt-4');
});
it('should create client with apiKey and baseURL', () => {
const params = {
apiKey: 'sk-test-456',
baseURL: 'https://api.openai.example'
};
// Should not throw when baseURL is provided
const client = provider.getClient(params);
expect(typeof client).toBe('function');
// The client function should be callable and return a model object
const model = client('gpt-5');
expect(model).toBeDefined();
expect(model.modelId).toBe('gpt-5');
});
it('should return the same client instance for the same parameters', () => {
const params = {
apiKey: 'sk-test-789'
};
// Multiple calls with same params should work
const client1 = provider.getClient(params);
const client2 = provider.getClient(params);
expect(typeof client1).toBe('function');
expect(typeof client2).toBe('function');
// Both clients should be able to create models
const model1 = client1('gpt-4');
const model2 = client2('gpt-4');
expect(model1.modelId).toBe('gpt-4');
expect(model2.modelId).toBe('gpt-4');
});
it('should handle different model IDs correctly', () => {
const client = provider.getClient({ apiKey: 'sk-test-models' });
// Test with different models
const gpt4 = client('gpt-4');
expect(gpt4.modelId).toBe('gpt-4');
const gpt5 = client('gpt-5');
expect(gpt5.modelId).toBe('gpt-5');
const gpt35 = client('gpt-3.5-turbo');
expect(gpt35.modelId).toBe('gpt-3.5-turbo');
});
});
describe('name property', () => {
it('should have OpenAI as the provider name', () => {
expect(provider.name).toBe('OpenAI');
});
});
});

View File

@@ -0,0 +1,134 @@
import { jest } from '@jest/globals';
import { PromptManager } from '../../../scripts/modules/prompt-manager.js';
describe('expand-task prompt template', () => {
let promptManager;
beforeEach(() => {
promptManager = new PromptManager();
});
const testTask = {
id: 1,
title: 'Setup AWS Infrastructure',
description: 'Provision core AWS services',
details: 'Create VPC, subnets, and security groups'
};
const baseParams = {
task: testTask,
subtaskCount: 3,
nextSubtaskId: 1,
additionalContext: '',
complexityReasoningContext: '',
gatheredContext: '',
useResearch: false,
expansionPrompt: undefined
};
test('default variant includes task context', () => {
const { userPrompt } = promptManager.loadPrompt(
'expand-task',
baseParams,
'default'
);
expect(userPrompt).toContain(testTask.title);
expect(userPrompt).toContain(testTask.description);
expect(userPrompt).toContain(testTask.details);
expect(userPrompt).toContain('Task ID: 1');
});
test('research variant includes task context', () => {
const params = { ...baseParams, useResearch: true };
const { userPrompt } = promptManager.loadPrompt(
'expand-task',
params,
'research'
);
expect(userPrompt).toContain(testTask.title);
expect(userPrompt).toContain(testTask.description);
expect(userPrompt).toContain(testTask.details);
expect(userPrompt).toContain('Parent Task:');
expect(userPrompt).toContain('ID: 1');
});
test('complexity-report variant includes task context', () => {
const params = {
...baseParams,
expansionPrompt: 'Focus on security best practices',
complexityReasoningContext: 'High complexity due to security requirements'
};
const { userPrompt } = promptManager.loadPrompt(
'expand-task',
params,
'complexity-report'
);
// The fix ensures task context is included
expect(userPrompt).toContain('Parent Task:');
expect(userPrompt).toContain(`ID: ${testTask.id}`);
expect(userPrompt).toContain(`Title: ${testTask.title}`);
expect(userPrompt).toContain(`Description: ${testTask.description}`);
expect(userPrompt).toContain(`Current details: ${testTask.details}`);
// Also includes the expansion prompt
expect(userPrompt).toContain('Expansion Guidance:');
expect(userPrompt).toContain(params.expansionPrompt);
expect(userPrompt).toContain(params.complexityReasoningContext);
});
test('all variants request JSON format with subtasks array', () => {
const variants = ['default', 'research', 'complexity-report'];
variants.forEach((variant) => {
const params =
variant === 'complexity-report'
? { ...baseParams, expansionPrompt: 'test' }
: baseParams;
const { systemPrompt, userPrompt } = promptManager.loadPrompt(
'expand-task',
params,
variant
);
const combined = systemPrompt + userPrompt;
expect(combined.toLowerCase()).toContain('subtasks');
expect(combined).toContain('JSON');
});
});
test('complexity-report variant fails without task context regression test', () => {
// This test ensures we don't regress to the old behavior where
// complexity-report variant only used expansionPrompt without task context
const params = {
...baseParams,
expansionPrompt: 'Generic expansion prompt'
};
const { userPrompt } = promptManager.loadPrompt(
'expand-task',
params,
'complexity-report'
);
// Count occurrences of task-specific content
const titleOccurrences = (
userPrompt.match(new RegExp(testTask.title, 'g')) || []
).length;
const descriptionOccurrences = (
userPrompt.match(new RegExp(testTask.description, 'g')) || []
).length;
// Should have at least one occurrence of title and description
expect(titleOccurrences).toBeGreaterThanOrEqual(1);
expect(descriptionOccurrences).toBeGreaterThanOrEqual(1);
// Should not be ONLY the expansion prompt
expect(userPrompt.length).toBeGreaterThan(
params.expansionPrompt.length + 100
);
});
});