diff --git a/.changeset/eleven-horses-shop.md b/.changeset/eleven-horses-shop.md new file mode 100644 index 00000000..84b63caf --- /dev/null +++ b/.changeset/eleven-horses-shop.md @@ -0,0 +1,5 @@ +--- +"task-master-ai": patch +--- + +Fix for tasks not found when using string IDs diff --git a/.changeset/fix-tag-complexity-detection.md b/.changeset/fix-tag-complexity-detection.md new file mode 100644 index 00000000..4c74d978 --- /dev/null +++ b/.changeset/fix-tag-complexity-detection.md @@ -0,0 +1,7 @@ +--- +"task-master-ai": patch +--- + +Fix tag-specific complexity report detection in expand command + +The expand command now correctly finds and uses tag-specific complexity reports (e.g., `task-complexity-report_feature-xyz.json`) when operating in a tag context. Previously, it would always look for the generic `task-complexity-report.json` file due to a default value in the CLI option definition. \ No newline at end of file diff --git a/.changeset/floppy-news-buy-1.md b/.changeset/floppy-news-buy-1.md new file mode 100644 index 00000000..b2674d1a --- /dev/null +++ b/.changeset/floppy-news-buy-1.md @@ -0,0 +1,38 @@ +--- +"task-master-ai": minor +--- + +Add new `scope-up` and `scope-down` commands for dynamic task complexity adjustment + +This release introduces two powerful new commands that allow you to dynamically adjust the complexity of your tasks and subtasks without recreating them from scratch. + +**New CLI Commands:** +- `task-master scope-up` - Increase task complexity (add more detail, requirements, or implementation steps) +- `task-master scope-down` - Decrease task complexity (simplify, remove unnecessary details, or streamline) + +**Key Features:** +- **Multiple tasks**: Support comma-separated IDs to adjust multiple tasks at once (`--id=5,7,12`) +- **Strength levels**: Choose adjustment intensity with `--strength=light|regular|heavy` (defaults to regular) +- **Custom prompts**: Use `--prompt` flag to specify exactly how you want tasks adjusted +- **MCP integration**: Available as `scope_up_task` and `scope_down_task` tools in Cursor and other MCP environments +- **Smart context**: AI considers your project context and task dependencies when making adjustments + +**Usage Examples:** +```bash +# Make a task more detailed +task-master scope-up --id=5 + +# Simplify multiple tasks with light touch +task-master scope-down --id=10,11,12 --strength=light + +# Custom adjustment with specific instructions +task-master scope-up --id=7 --prompt="Add more error handling and edge cases" +``` + +**Why use this?** +- **Iterative refinement**: Adjust task complexity as your understanding evolves +- **Project phase adaptation**: Scale tasks up for implementation, down for planning +- **Team coordination**: Adjust complexity based on team member experience levels +- **Milestone alignment**: Fine-tune tasks to match project phase requirements + +Perfect for agile workflows where task requirements change as you learn more about the problem space. \ No newline at end of file diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 00000000..12116993 --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,14 @@ +{ + "mode": "pre", + "tag": "rc", + "initialVersions": { + "task-master-ai": "0.22.0", + "extension": "0.20.0" + }, + "changesets": [ + "eleven-horses-shop", + "fix-tag-complexity-detection", + "floppy-news-buy-1", + "sour-pans-beam-1" + ] +} diff --git a/.changeset/sour-pans-beam-1.md b/.changeset/sour-pans-beam-1.md new file mode 100644 index 00000000..79d7dc25 --- /dev/null +++ b/.changeset/sour-pans-beam-1.md @@ -0,0 +1,42 @@ +--- +"extension": minor +--- + +πŸŽ‰ **Introducing TaskMaster Extension!** + +We're thrilled to launch the first version of our Code extension, bringing the power of TaskMaster directly into your favorite code editor. While this is our initial release and we've kept things focused, it already packs powerful features to supercharge your development workflow. + +## ✨ Key Features + +### πŸ“‹ Visual Task Management +- **Kanban Board View**: Visualize all your tasks in an intuitive board layout directly in VS Code +- **Drag & Drop**: Easily change task status by dragging cards between columns +- **Real-time Updates**: See changes instantly as you work through your project + +### 🏷️ Multi-Context Support +- **Tag Switching**: Seamlessly switch between different project contexts/tags +- **Isolated Workflows**: Keep different features or experiments organized separately + +### πŸ€– AI-Powered Task Updates +- **Smart Updates**: Use TaskMaster's AI capabilities to update tasks and subtasks +- **Context-Aware**: Leverages your existing TaskMaster configuration and models + +### πŸ“Š Rich Task Information +- **Complexity Scores**: See task complexity ratings at a glance +- **Subtask Visualization**: Expand tasks to view and manage subtasks +- **Dependency Graphs**: Understand task relationships and dependencies visually + +### βš™οΈ Configuration Management +- **Visual Config Editor**: View and understand your `.taskmaster/config.json` settings +- **Easy Access**: No more manual JSON editing for common configuration tasks + +### πŸš€ Quick Actions +- **Status Updates**: Change task status with a single click +- **Task Details**: Access full task information without leaving VS Code +- **Integrated Commands**: All TaskMaster commands available through the command palette + +## 🎯 What's Next? + +This is just the beginning! We wanted to get a solid foundation into your hands quickly. The extension will evolve rapidly with your feedback, adding more advanced features, better visualizations, and deeper integration with your development workflow. + +Thank you for being part of the TaskMaster journey. Your workflow has never looked better! πŸš€ diff --git a/.cursor/rules/test_workflow.mdc b/.cursor/rules/test_workflow.mdc new file mode 100644 index 00000000..2ec6fe97 --- /dev/null +++ b/.cursor/rules/test_workflow.mdc @@ -0,0 +1,803 @@ +--- +description: +globs: +alwaysApply: true +--- +# Test Workflow & Development Process + +## **Initial Testing Framework Setup** + +Before implementing the TDD workflow, ensure your project has a proper testing framework configured. This section covers setup for different technology stacks. + +### **Detecting Project Type & Framework Needs** + +**AI Agent Assessment Checklist:** +1. **Language Detection**: Check for `package.json` (Node.js/JavaScript), `requirements.txt` (Python), `Cargo.toml` (Rust), etc. +2. **Existing Tests**: Look for test files (`.test.`, `.spec.`, `_test.`) or test directories +3. **Framework Detection**: Check for existing test runners in dependencies +4. **Project Structure**: Analyze directory structure for testing patterns + +### **JavaScript/Node.js Projects (Jest Setup)** + +#### **Prerequisites Check** +```bash +# Verify Node.js project +ls package.json # Should exist + +# Check for existing testing setup +ls jest.config.js jest.config.ts # Check for Jest config +grep -E "(jest|vitest|mocha)" package.json # Check for test runners +``` + +#### **Jest Installation & Configuration** + +**Step 1: Install Dependencies** +```bash +# Core Jest dependencies +npm install --save-dev jest + +# TypeScript support (if using TypeScript) +npm install --save-dev ts-jest @types/jest + +# Additional useful packages +npm install --save-dev supertest @types/supertest # For API testing +npm install --save-dev jest-watch-typeahead # Enhanced watch mode +``` + +**Step 2: Create Jest Configuration** + +Create `jest.config.js` with the following production-ready configuration: + +```javascript +/** @type {import('jest').Config} */ +module.exports = { + // Use ts-jest preset for TypeScript support + preset: 'ts-jest', + + // Test environment + testEnvironment: 'node', + + // Roots for test discovery + roots: ['/src', '/tests'], + + // Test file patterns + testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'], + + // Transform files + transform: { + '^.+\\.ts$': [ + 'ts-jest', + { + tsconfig: { + target: 'es2020', + module: 'commonjs', + esModuleInterop: true, + allowSyntheticDefaultImports: true, + skipLibCheck: true, + strict: false, + noImplicitAny: false, + }, + }, + ], + '^.+\\.js$': [ + 'ts-jest', + { + useESM: false, + tsconfig: { + target: 'es2020', + module: 'commonjs', + esModuleInterop: true, + allowSyntheticDefaultImports: true, + allowJs: true, + }, + }, + ], + }, + + // Module file extensions + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], + + // Transform ignore patterns - adjust for ES modules + transformIgnorePatterns: ['node_modules/(?!(your-es-module-deps|.*\\.mjs$))'], + + // Coverage configuration + collectCoverage: true, + coverageDirectory: 'coverage', + coverageReporters: [ + 'text', // Console output + 'text-summary', // Brief summary + 'lcov', // For IDE integration + 'html', // Detailed HTML report + ], + + // Files to collect coverage from + collectCoverageFrom: [ + 'src/**/*.ts', + '!src/**/*.d.ts', + '!src/**/*.test.ts', + '!src/**/index.ts', // Often just exports + '!src/generated/**', // Generated code + '!src/config/database.ts', // Database config (tested via integration) + ], + + // Coverage thresholds - TaskMaster standards + coverageThreshold: { + global: { + branches: 70, + functions: 80, + lines: 80, + statements: 80, + }, + // Higher standards for critical business logic + './src/utils/': { + branches: 85, + functions: 90, + lines: 90, + statements: 90, + }, + './src/middleware/': { + branches: 80, + functions: 85, + lines: 85, + statements: 85, + }, + }, + + // Setup files + setupFilesAfterEnv: ['/tests/setup.ts'], + + // Global teardown to prevent worker process leaks + globalTeardown: '/tests/teardown.ts', + + // Module path mapping (if needed) + moduleNameMapper: { + '^@/(.*)$': '/src/$1', + }, + + // Clear mocks between tests + clearMocks: true, + + // Restore mocks after each test + restoreMocks: true, + + // Global test timeout + testTimeout: 10000, + + // Projects for different test types + projects: [ + // Unit tests - for pure functions only + { + displayName: 'unit', + testMatch: ['/src/**/*.test.ts'], + testPathIgnorePatterns: ['.*\\.integration\\.test\\.ts$', '/tests/'], + preset: 'ts-jest', + testEnvironment: 'node', + collectCoverageFrom: [ + 'src/**/*.ts', + '!src/**/*.d.ts', + '!src/**/*.test.ts', + '!src/**/*.integration.test.ts', + ], + coverageThreshold: { + global: { + branches: 70, + functions: 80, + lines: 80, + statements: 80, + }, + }, + }, + // Integration tests - real database/services + { + displayName: 'integration', + testMatch: [ + '/src/**/*.integration.test.ts', + '/tests/integration/**/*.test.ts', + ], + preset: 'ts-jest', + testEnvironment: 'node', + setupFilesAfterEnv: ['/tests/setup/integration.ts'], + testTimeout: 10000, + }, + // E2E tests - full workflows + { + displayName: 'e2e', + testMatch: ['/tests/e2e/**/*.test.ts'], + preset: 'ts-jest', + testEnvironment: 'node', + setupFilesAfterEnv: ['/tests/setup/e2e.ts'], + testTimeout: 30000, + }, + ], + + // Verbose output for better debugging + verbose: true, + + // Run projects sequentially to avoid conflicts + maxWorkers: 1, + + // Enable watch mode plugins + watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'], +}; +``` + +**Step 3: Update package.json Scripts** + +Add these scripts to your `package.json`: + +```json +{ + "scripts": { + "test": "jest", + "test:watch": "jest --watch", + "test:coverage": "jest --coverage", + "test:unit": "jest --selectProjects unit", + "test:integration": "jest --selectProjects integration", + "test:e2e": "jest --selectProjects e2e", + "test:ci": "jest --ci --coverage --watchAll=false" + } +} +``` + +**Step 4: Create Test Setup Files** + +Create essential test setup files: + +```typescript +// tests/setup.ts - Global setup +import { jest } from '@jest/globals'; + +// Global test configuration +beforeAll(() => { + // Set test timeout + jest.setTimeout(10000); +}); + +afterEach(() => { + // Clean up mocks after each test + jest.clearAllMocks(); +}); +``` + +```typescript +// tests/setup/integration.ts - Integration test setup +import { PrismaClient } from '@prisma/client'; + +const prisma = new PrismaClient(); + +beforeAll(async () => { + // Connect to test database + await prisma.$connect(); +}); + +afterAll(async () => { + // Cleanup and disconnect + await prisma.$disconnect(); +}); + +beforeEach(async () => { + // Clean test data before each test + // Add your cleanup logic here +}); +``` + +```typescript +// tests/teardown.ts - Global teardown +export default async () => { + // Global cleanup after all tests + console.log('Global test teardown complete'); +}; +``` + +**Step 5: Create Initial Test Structure** + +```bash +# Create test directories +mkdir -p tests/{setup,fixtures,unit,integration,e2e} +mkdir -p tests/unit/src/{utils,services,middleware} + +# Create sample test fixtures +mkdir tests/fixtures +``` + +### **Generic Testing Framework Setup (Any Language)** + +#### **Framework Selection Guide** + +**Python Projects:** +- **pytest**: Recommended for most Python projects +- **unittest**: Built-in, suitable for simple projects +- **Coverage**: Use `coverage.py` for code coverage + +```bash +# Python setup example +pip install pytest pytest-cov +echo "[tool:pytest]" > pytest.ini +echo "testpaths = tests" >> pytest.ini +echo "addopts = --cov=src --cov-report=html --cov-report=term" >> pytest.ini +``` + +**Go Projects:** +- **Built-in testing**: Use Go's built-in `testing` package +- **Coverage**: Built-in with `go test -cover` + +```bash +# Go setup example +go mod init your-project +mkdir -p tests +# Tests are typically *_test.go files alongside source +``` + +**Rust Projects:** +- **Built-in testing**: Use Rust's built-in test framework +- **cargo-tarpaulin**: For coverage analysis + +```bash +# Rust setup example +cargo new your-project +cd your-project +cargo install cargo-tarpaulin # For coverage +``` + +**Java Projects:** +- **JUnit 5**: Modern testing framework +- **Maven/Gradle**: Build tools with testing integration + +```xml + + + org.junit.jupiter + junit-jupiter + 5.9.2 + test + +``` + +#### **Universal Testing Principles** + +**Coverage Standards (Adapt to Your Language):** +- **Global Minimum**: 70-80% line coverage +- **Critical Code**: 85-90% coverage +- **New Features**: Must meet or exceed standards +- **Legacy Code**: Gradual improvement strategy + +**Test Organization:** +- **Unit Tests**: Fast, isolated, no external dependencies +- **Integration Tests**: Test component interactions +- **E2E Tests**: Test complete user workflows +- **Performance Tests**: Load and stress testing (if applicable) + +**Naming Conventions:** +- **Test Files**: `*.test.*`, `*_test.*`, or language-specific patterns +- **Test Functions**: Descriptive names (e.g., `should_return_error_for_invalid_input`) +- **Test Directories**: Organized by test type and mirroring source structure + +#### **TaskMaster Integration for Any Framework** + +**Document Testing Setup in Subtasks:** +```bash +# Update subtask with testing framework setup +task-master update-subtask --id=X.Y --prompt="Testing framework setup: +- Installed [Framework Name] with coverage support +- Configured [Coverage Tool] with thresholds: 80% lines, 70% branches +- Created test directory structure: unit/, integration/, e2e/ +- Added test scripts to build configuration +- All setup tests passing" +``` + +**Testing Framework Verification:** +```bash +# Verify setup works +[test-command] # e.g., npm test, pytest, go test, cargo test + +# Check coverage reporting +[coverage-command] # e.g., npm run test:coverage + +# Update task with verification +task-master update-subtask --id=X.Y --prompt="Testing framework verified: +- Sample tests running successfully +- Coverage reporting functional +- CI/CD integration ready +- Ready to begin TDD workflow" +``` + +## **Test-Driven Development (TDD) Integration** + +### **Core TDD Cycle with Jest** +```bash +# 1. Start development with watch mode +npm run test:watch + +# 2. Write failing test first +# Create test file: src/utils/newFeature.test.ts +# Write test that describes expected behavior + +# 3. Implement minimum code to make test pass +# 4. Refactor while keeping tests green +# 5. Add edge cases and error scenarios +``` + +### **TDD Workflow Per Subtask** +```bash +# When starting a new subtask: +task-master set-status --id=4.1 --status=in-progress + +# Begin TDD cycle: +npm run test:watch # Keep running during development + +# Document TDD progress in subtask: +task-master update-subtask --id=4.1 --prompt="TDD Progress: +- Written 3 failing tests for core functionality +- Implemented basic feature, tests now passing +- Adding edge case tests for error handling" + +# Complete subtask with test summary: +task-master update-subtask --id=4.1 --prompt="Implementation complete: +- Feature implemented with 8 unit tests +- Coverage: 95% statements, 88% branches +- All tests passing, TDD cycle complete" +``` + +## **Testing Commands & Usage** + +### **Development Commands** +```bash +# Primary development command - use during coding +npm run test:watch # Watch mode with Jest +npm run test:watch -- --testNamePattern="auth" # Watch specific tests + +# Targeted testing during development +npm run test:unit # Run only unit tests +npm run test:unit -- --coverage # Unit tests with coverage + +# Integration testing when APIs are ready +npm run test:integration # Run integration tests +npm run test:integration -- --detectOpenHandles # Debug hanging tests + +# End-to-end testing for workflows +npm run test:e2e # Run E2E tests +npm run test:e2e -- --timeout=30000 # Extended timeout for E2E +``` + +### **Quality Assurance Commands** +```bash +# Full test suite with coverage (before commits) +npm run test:coverage # Complete coverage analysis + +# All tests (CI/CD pipeline) +npm test # Run all test projects + +# Specific test file execution +npm test -- auth.test.ts # Run specific test file +npm test -- --testNamePattern="should handle errors" # Run specific tests +``` + +## **Test Implementation Patterns** + +### **Unit Test Development** +```typescript +// βœ… DO: Follow established patterns from auth.test.ts +describe('FeatureName', () => { + beforeEach(() => { + jest.clearAllMocks(); + // Setup mocks with proper typing + }); + + describe('functionName', () => { + it('should handle normal case', () => { + // Test implementation with specific assertions + }); + + it('should throw error for invalid input', async () => { + // Error scenario testing + await expect(functionName(invalidInput)) + .rejects.toThrow('Specific error message'); + }); + }); +}); +``` + +### **Integration Test Development** +```typescript +// βœ… DO: Use supertest for API endpoint testing +import request from 'supertest'; +import { app } from '../../src/app'; + +describe('POST /api/auth/register', () => { + beforeEach(async () => { + await integrationTestUtils.cleanupTestData(); + }); + + it('should register user successfully', async () => { + const userData = createTestUser(); + + const response = await request(app) + .post('/api/auth/register') + .send(userData) + .expect(201); + + expect(response.body).toMatchObject({ + id: expect.any(String), + email: userData.email + }); + + // Verify database state + const user = await prisma.user.findUnique({ + where: { email: userData.email } + }); + expect(user).toBeTruthy(); + }); +}); +``` + +### **E2E Test Development** +```typescript +// βœ… DO: Test complete user workflows +describe('User Authentication Flow', () => { + it('should complete registration β†’ login β†’ protected access', async () => { + // Step 1: Register + const userData = createTestUser(); + await request(app) + .post('/api/auth/register') + .send(userData) + .expect(201); + + // Step 2: Login + const loginResponse = await request(app) + .post('/api/auth/login') + .send({ email: userData.email, password: userData.password }) + .expect(200); + + const { token } = loginResponse.body; + + // Step 3: Access protected resource + await request(app) + .get('/api/profile') + .set('Authorization', `Bearer ${token}`) + .expect(200); + }, 30000); // Extended timeout for E2E +}); +``` + +## **Mocking & Test Utilities** + +### **Established Mocking Patterns** +```typescript +// βœ… DO: Use established bcrypt mocking pattern +jest.mock('bcrypt'); +import bcrypt from 'bcrypt'; +const mockHash = bcrypt.hash as jest.MockedFunction; +const mockCompare = bcrypt.compare as jest.MockedFunction; + +// βœ… DO: Use Prisma mocking for unit tests +jest.mock('@prisma/client', () => ({ + PrismaClient: jest.fn().mockImplementation(() => ({ + user: { + create: jest.fn(), + findUnique: jest.fn(), + }, + $connect: jest.fn(), + $disconnect: jest.fn(), + })), +})); +``` + +### **Test Fixtures Usage** +```typescript +// βœ… DO: Use centralized test fixtures +import { createTestUser, adminUser, invalidUser } from '../fixtures/users'; + +describe('User Service', () => { + it('should handle admin user creation', async () => { + const userData = createTestUser(adminUser); + // Test implementation + }); + + it('should reject invalid user data', async () => { + const userData = createTestUser(invalidUser); + // Error testing + }); +}); +``` + +## **Coverage Standards & Monitoring** + +### **Coverage Thresholds** +- **Global Standards**: 80% lines/functions, 70% branches +- **Critical Code**: 90% utils, 85% middleware +- **New Features**: Must meet or exceed global thresholds +- **Legacy Code**: Gradual improvement with each change + +### **Coverage Reporting & Analysis** +```bash +# Generate coverage reports +npm run test:coverage + +# View detailed HTML report +open coverage/lcov-report/index.html + +# Coverage files generated: +# - coverage/lcov-report/index.html # Detailed HTML report +# - coverage/lcov.info # LCOV format for IDE integration +# - coverage/coverage-final.json # JSON format for tooling +``` + +### **Coverage Quality Checks** +```typescript +// βœ… DO: Test all code paths +describe('validateInput', () => { + it('should return true for valid input', () => { + expect(validateInput('valid')).toBe(true); + }); + + it('should return false for various invalid inputs', () => { + expect(validateInput('')).toBe(false); // Empty string + expect(validateInput(null)).toBe(false); // Null value + expect(validateInput(undefined)).toBe(false); // Undefined + }); + + it('should throw for unexpected input types', () => { + expect(() => validateInput(123)).toThrow('Invalid input type'); + }); +}); +``` + +## **Testing During Development Phases** + +### **Feature Development Phase** +```bash +# 1. Start feature development +task-master set-status --id=X.Y --status=in-progress + +# 2. Begin TDD cycle +npm run test:watch + +# 3. Document test progress in subtask +task-master update-subtask --id=X.Y --prompt="Test development: +- Created test file with 5 failing tests +- Implemented core functionality +- Tests passing, adding error scenarios" + +# 4. Verify coverage before completion +npm run test:coverage + +# 5. Update subtask with final test status +task-master update-subtask --id=X.Y --prompt="Testing complete: +- 12 unit tests with full coverage +- All edge cases and error scenarios covered +- Ready for integration testing" +``` + +### **Integration Testing Phase** +```bash +# After API endpoints are implemented +npm run test:integration + +# Update integration test templates +# Replace placeholder tests with real endpoint calls + +# Document integration test results +task-master update-subtask --id=X.Y --prompt="Integration tests: +- Updated auth endpoint tests +- Database integration verified +- All HTTP status codes and responses tested" +``` + +### **Pre-Commit Testing Phase** +```bash +# Before committing code +npm run test:coverage # Verify all tests pass with coverage +npm run test:unit # Quick unit test verification +npm run test:integration # Integration test verification (if applicable) + +# Commit pattern for test updates +git add tests/ src/**/*.test.ts +git commit -m "test(task-X): Add comprehensive tests for Feature Y + +- Unit tests with 95% coverage (exceeds 90% threshold) +- Integration tests for API endpoints +- Test fixtures for data generation +- Proper mocking patterns established + +Task X: Feature Y - Testing complete" +``` + +## **Error Handling & Debugging** + +### **Test Debugging Techniques** +```typescript +// βœ… DO: Use test utilities for debugging +import { testUtils } from '../setup'; + +it('should debug complex operation', () => { + testUtils.withConsole(() => { + // Console output visible only for this test + console.log('Debug info:', complexData); + service.complexOperation(); + }); +}); + +// βœ… DO: Use proper async debugging +it('should handle async operations', async () => { + const promise = service.asyncOperation(); + + // Test intermediate state + expect(service.isProcessing()).toBe(true); + + const result = await promise; + expect(result).toBe('expected'); + expect(service.isProcessing()).toBe(false); +}); +``` + +### **Common Test Issues & Solutions** +```bash +# Hanging tests (common with database connections) +npm run test:integration -- --detectOpenHandles + +# Memory leaks in tests +npm run test:unit -- --logHeapUsage + +# Slow tests identification +npm run test:coverage -- --verbose + +# Mock not working properly +# Check: mock is declared before imports +# Check: jest.clearAllMocks() in beforeEach +# Check: TypeScript typing is correct +``` + +## **Continuous Integration Integration** + +### **CI/CD Pipeline Testing** +```yaml +# Example GitHub Actions integration +- name: Run tests + run: | + npm ci + npm run test:coverage + +- name: Upload coverage reports + uses: codecov/codecov-action@v3 + with: + file: ./coverage/lcov.info +``` + +### **Pre-commit Hooks** +```bash +# Setup pre-commit testing (recommended) +# In package.json scripts: +"pre-commit": "npm run test:unit && npm run test:integration" + +# Husky integration example: +npx husky add .husky/pre-commit "npm run test:unit" +``` + +## **Test Maintenance & Evolution** + +### **Adding Tests for New Features** +1. **Create test file** alongside source code or in `tests/unit/` +2. **Follow established patterns** from `src/utils/auth.test.ts` +3. **Use existing fixtures** from `tests/fixtures/` +4. **Apply proper mocking** patterns for dependencies +5. **Meet coverage thresholds** for the module + +### **Updating Integration/E2E Tests** +1. **Update templates** in `tests/integration/` when APIs change +2. **Modify E2E workflows** in `tests/e2e/` for new user journeys +3. **Update test fixtures** for new data requirements +4. **Maintain database cleanup** utilities + +### **Test Performance Optimization** +- **Parallel execution**: Jest runs tests in parallel by default +- **Test isolation**: Use proper setup/teardown for independence +- **Mock optimization**: Mock heavy dependencies appropriately +- **Database efficiency**: Use transaction rollbacks where possible + +--- + +**Key References:** +- [Testing Standards](mdc:.cursor/rules/tests.mdc) +- [Git Workflow](mdc:.cursor/rules/git_workflow.mdc) +- [Development Workflow](mdc:.cursor/rules/dev_workflow.mdc) +- [Jest Configuration](mdc:jest.config.js) \ No newline at end of file diff --git a/.github/scripts/release.sh b/.github/scripts/release.sh new file mode 100755 index 00000000..ce66c3d1 --- /dev/null +++ b/.github/scripts/release.sh @@ -0,0 +1,21 @@ +#!/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 \ No newline at end of file diff --git a/.github/scripts/tag-extension.mjs b/.github/scripts/tag-extension.mjs new file mode 100644 index 00000000..18f297b6 --- /dev/null +++ b/.github/scripts/tag-extension.mjs @@ -0,0 +1,77 @@ +#!/usr/bin/env node +import assert from 'node:assert/strict'; +import { spawnSync } from 'node:child_process'; +import { readFileSync } from 'node:fs'; +import { join, dirname } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +// Read the extension's package.json +const extensionDir = join(__dirname, '..', 'apps', 'extension'); +const pkgPath = join(extensionDir, 'package.json'); + +let pkg; +try { + const pkgContent = readFileSync(pkgPath, 'utf8'); + pkg = JSON.parse(pkgContent); +} catch (error) { + console.error('Failed to read package.json:', error.message); + process.exit(1); +} + +// Read root package.json for repository info +const rootPkgPath = join(__dirname, '..', '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 +assert(pkg.name, 'package.json must have a name 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}`; + +// Get repository URL from root package.json +const repoUrl = rootPkg.repository.url; + +const { status, stdout, error } = spawnSync('git', ['ls-remote', repoUrl, tag]); + +assert.equal(status, 0, error); + +const exists = String(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}`); +} diff --git a/.github/workflows/extension-ci.yml b/.github/workflows/extension-ci.yml new file mode 100644 index 00000000..4914852f --- /dev/null +++ b/.github/workflows/extension-ci.yml @@ -0,0 +1,143 @@ +name: Extension CI + +on: + push: + branches: + - main + - next + paths: + - 'apps/extension/**' + - '.github/workflows/extension-ci.yml' + pull_request: + branches: + - main + - next + paths: + - 'apps/extension/**' + - '.github/workflows/extension-ci.yml' + +permissions: + contents: read + +jobs: + setup: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - 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 + + typecheck: + needs: setup + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + + - name: Restore 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 if cache miss + working-directory: apps/extension + run: npm ci + timeout-minutes: 3 + + - name: Type Check Extension + working-directory: apps/extension + run: npm run check-types + env: + FORCE_COLOR: 1 + + build: + needs: setup + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + + - name: Restore 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 if cache miss + working-directory: apps/extension + run: npm ci + timeout-minutes: 3 + + - 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: Verify Package Contents + working-directory: apps/extension + run: | + echo "Checking vsix-build contents..." + ls -la vsix-build/ + echo "Checking dist contents..." + ls -la vsix-build/dist/ + echo "Checking package.json exists..." + test -f vsix-build/package.json + + - name: Create VSIX Package (Test) + working-directory: apps/extension/vsix-build + run: npx vsce package --no-dependencies + env: + FORCE_COLOR: 1 + + - name: Upload Extension Artifact + uses: actions/upload-artifact@v4 + with: + name: extension-package + path: | + apps/extension/vsix-build/*.vsix + apps/extension/dist/ + retention-days: 30 + diff --git a/.github/workflows/extension-release.yml b/.github/workflows/extension-release.yml new file mode 100644 index 00000000..244c490f --- /dev/null +++ b/.github/workflows/extension-release.yml @@ -0,0 +1,137 @@ +name: Extension Release + +on: + push: + tags: + - "extension@*" + +permissions: + contents: write + +concurrency: extension-release-${{ github.ref }} + +jobs: + publish-extension: + 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 + working-directory: apps/extension/vsix-build + run: npx vsce package --no-dependencies + 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 + working-directory: apps/extension/vsix-build + run: npx vsce publish --packagePath "${{ steps.vsix-info.outputs.vsix-filename }}" + 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 + working-directory: apps/extension/vsix-build + run: ovsx publish "${{ steps.vsix-info.outputs.vsix-filename }}" + env: + OVSX_PAT: ${{ secrets.OVSX_PAT }} + 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 + uses: actions/upload-artifact@v4 + with: + name: extension-release-${{ github.ref_name }} + path: | + apps/extension/vsix-build/*.vsix + apps/extension/dist/ + retention-days: 90 + + notify-success: + needs: publish-extension + if: success() + runs-on: ubuntu-latest + steps: + - name: Success Notification + run: | + echo "πŸŽ‰ Extension ${{ github.ref_name }} successfully published!" + echo "πŸ“¦ Available on VS Code Marketplace" + echo "🌍 Available on Open VSX Registry" + echo "🏷️ GitHub release created: ${{ github.ref_name }}" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a19fb49a..3ddb07dc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,11 @@ on: concurrency: ${{ github.workflow }}-${{ github.ref }} +permissions: + contents: write + pull-requests: write + id-token: write + jobs: release: runs-on: ubuntu-latest @@ -33,13 +38,31 @@ jobs: run: npm ci timeout-minutes: 2 - - name: Exit pre-release mode (safety check) - run: npx changeset pre exit || true + - name: Exit pre-release mode and clean up + run: | + echo "πŸ”„ Ensuring we're not in pre-release mode for main branch..." + + # Exit pre-release mode if we're in it + npx changeset pre exit || echo "Not in pre-release mode" + + # Remove pre.json file if it exists (belt and suspenders approach) + if [ -f .changeset/pre.json ]; then + echo "🧹 Removing pre.json file..." + rm -f .changeset/pre.json + fi + + # Verify the file is gone + if [ ! -f .changeset/pre.json ]; then + echo "βœ… pre.json successfully removed" + else + echo "❌ Failed to remove pre.json" + exit 1 + fi - name: Create Release Pull Request or Publish to npm uses: changesets/action@v1 with: - publish: npm run release + publish: ./.github/scripts/release.sh env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index f7060852..e13582fb 100644 --- a/.gitignore +++ b/.gitignore @@ -87,3 +87,10 @@ dev-debug.log *.njsproj *.sln *.sw? + +# VS Code extension test files +.vscode-test/ +apps/extension/.vscode-test/ + +# apps/extension +apps/extension/vsix-build/ \ No newline at end of file diff --git a/.taskmaster/docs/research/2025-08-01_do-we-need-to-add-new-commands-or-can-we-just-weap.md b/.taskmaster/docs/research/2025-08-01_do-we-need-to-add-new-commands-or-can-we-just-weap.md new file mode 100644 index 00000000..15b8e04b --- /dev/null +++ b/.taskmaster/docs/research/2025-08-01_do-we-need-to-add-new-commands-or-can-we-just-weap.md @@ -0,0 +1,153 @@ +--- +title: Research Session +query: "do we need to add new commands or can we just weaponize the gh cli tool" +date: 2025-08-01 +time: 2:27:52 p.m. +timestamp: 2025-08-01T11:27:52.249Z +exchanges: 3 +--- + +# Research Session + +## Initial Query + +**Question:** do we need to add new commands or can we just weaponize the gh cli tool + +**Response:** + +For the implementation of the `task-master git` command suite to automate git workflows (Task 97), it is possible to leverage the existing **GitHub CLI (`gh`) tool** rather than creating entirely new git commands from scratch. The GitHub CLI provides a rich set of commands that cover many GitHub-related operations such as branch management, pull request handling, workflow triggering, and release management, which can be scripted and integrated into your CLI tool[1][2][3][4]. + +### Key Points Supporting Weaponizing GitHub CLI: + +- **Comprehensive GitHub Operations**: The `gh` CLI supports creating branches, managing pull requests, releases, tags, and even triggering and monitoring GitHub Actions workflows. This aligns well with the requirements of automated branch management, commit generation, and PR description generation in Task 97[1][3]. + +- **Scripting and Automation Friendly**: GitHub CLI commands can be scripted and integrated into custom workflows or CLI tools. You can create aliases or wrap `gh` commands inside your own CLI commands to provide a seamless user experience while relying on the battle-tested GitHub CLI for underlying operations[1][3]. + +- **Authentication and Permissions**: `gh` uses environment variables like `GH_TOKEN` or `GITHUB_TOKEN` for authentication, which can be securely managed in CI/CD pipelines or local environments. This simplifies integration without needing to implement custom authentication logic[3][4]. + +- **Extensibility**: If some specific git workflow features are not directly supported by `gh`, you can extend it with custom scripts or combine it with native git commands. This hybrid approach reduces the need to reinvent core git operations while allowing customization[1]. + +### Considerations for Your Project: + +- Since Task 97 requires **automated branch management** (branch creation, validation, switching, cleanup), **intelligent commit generation**, and **PR description generation**, you can implement these by invoking `gh` commands programmatically within your `task-master git` commands. + +- For example, branch creation and switching can be done with native git commands wrapped in your CLI, while PR creation and management can be handled via `gh pr create`, `gh pr merge`, etc. + +- You may still need to implement some **custom logic** for commit type detection, branch name validation, and PR description generation based on your task metadata, but the underlying git and GitHub operations can be delegated to `gh`. + +- This approach aligns with your existing CLI foundation (Task 2) and leverages a well-supported tool, reducing development effort and increasing reliability. + +### Summary + +You **do not necessarily need to add entirely new git commands** for Task 97. Instead, you can **weaponize the GitHub CLI (`gh`) tool** by wrapping and scripting its commands within your `task-master git` command suite. This will allow you to automate git workflows efficiently, maintain consistency, and leverage GitHub’s API capabilities without reinventing the wheel[1][2][3][4]. + +If there are gaps in `gh` functionality for your specific workflow needs, you can supplement with native git commands or custom scripts, but the core git and GitHub operations should be handled by `gh` for best results. + +--- + +## Follow-up 1 + +**Question:** how does this relate to git worktrees? i hear that they get super complicated when trying to implement them. + +**Response:** + +Git worktrees allow you to have multiple working directories attached to the same Git repository, each checked out to different branches simultaneously. This enables parallel development workflows without the overhead of cloning the repository multiple times or constantly switching branches in a single working directory[2][3]. + +However, **implementing or managing git worktrees can get complicated** for several reasons: + +- **Complexity for users and tooling:** Managing multiple active worktrees requires careful tracking of which directory corresponds to which branch. This can be confusing and error-prone, especially for novices or when many worktrees are in use simultaneously. Mistakes like committing to the wrong branch or working in the wrong directory are common risks[1]. + +- **Maintenance overhead:** Worktrees accumulate over time and need to be pruned or cleaned up regularly (`git worktree prune`) to avoid clutter and potential confusion. This adds an extra maintenance step to the workflow[1]. + +- **Syncing and update challenges:** Each worktree is a separate checkout and can become outdated if not regularly updated from the main repository. This can lead to merge conflicts or redundant work if branches diverge significantly[1]. + +- **Tooling and integration limitations:** Not all Git tools, scripts, or GUIs fully support worktrees or are optimized for them. This can cause inconsistencies or require additional custom tooling to manage worktrees effectively[1]. + +- **Performance considerations:** Managing multiple worktrees simultaneously can have performance implications, especially in very large repositories, due to the overhead of maintaining multiple checkouts and metadata[1]. + +In the context of your project, which involves automating git workflows and possibly wrapping or extending git/GitHub CLI commands, these complexities imply: + +- If you consider supporting git worktrees in your `task-master git` command suite, you will need to handle the complexity of managing multiple directories and branches carefully. + +- You might need to implement additional logic or tooling to track and manage worktrees, avoid user confusion, and ensure synchronization between them. + +- Since your project already plans to leverage the GitHub CLI (`gh`) and native git commands, you could integrate worktree commands (`git worktree add`, `git worktree remove`, `git worktree list`) but should be prepared for the added complexity in workflow management and user documentation. + +- Custom wrappers or managers (like the one described in [3]) can help reduce friction by automating worktree creation, switching, and cleanup, which might be a useful approach to consider. + +Overall, **git worktrees provide powerful parallel branch management but introduce complexity in implementation and user experience** that must be carefully managed through tooling, automation, and clear documentation[1][3][4]. + +--- + +**Summary Table of Git Worktree Challenges and Considerations** + +| Aspect | Description | Implication for Project | +|-------------------------|-----------------------------------------------------------------------------------------------|----------------------------------------------------------| +| User Complexity | Confusing multiple directories and branches | Need clear UI/UX and safeguards | +| Maintenance Overhead | Requires pruning and cleanup of stale worktrees | Automate cleanup or provide commands | +| Syncing Issues | Worktrees can become outdated or diverge | Implement update checks and sync workflows | +| Tooling Support | Limited support in some Git tools and GUIs | May require custom tooling or wrappers | +| Performance | Overhead in large repos with many worktrees | Monitor and optimize performance | +| Workflow Automation | Manual worktree management is tedious | Build custom managers or wrappers to simplify usage | + +--- + +Given your project’s focus on automating git workflows and leveraging existing CLI tools, **implementing git worktree support is feasible but will require careful design to handle these complexities effectively**. You may want to start with basic worktree commands and incrementally add automation and safeguards as needed. + +--- + +## Follow-up 2 + +**Question:** since we already have a way to have separated task lists per branch, couldn't we do the same thing for worktrees? each taskmaster list (tag) would have its own worktree based on the name of the tag? + +**Response:** + +Yes, you can apply a similar approach used for separated task lists per branch to git worktrees by associating each taskmaster list (tag) with its own git worktree named after the tag. This means each tag would correspond to a dedicated worktree directory checked out to a branch or commit related to that tag, enabling isolated parallel work environments for each task list. + +### How This Maps to Git Worktrees + +- **Git worktrees** allow multiple working directories linked to the same repository, each checked out to a different branch or commit[1][2]. This lets you work on multiple branches simultaneously without switching contexts in a single directory. + +- When you create a worktree with `git worktree add []`, Git creates a new linked working tree at ``, optionally checking out a specified branch or creating a new one[1][2]. Naming the worktree directory after the tag (taskmaster list) is straightforward and semantically clear. + +- This setup mirrors your existing branch-based task list separation but extends it to physical directories, which can improve workflow isolation and reduce context switching. + +### Benefits for Your Project + +- **Isolated environments per task list/tag:** Each tag’s worktree can have its own checked-out branch, allowing independent development, testing, or review without interference. + +- **Parallel workflows:** Developers can switch between worktrees (directories) instead of switching branches in one directory, reducing errors and improving productivity. + +- **Automation potential:** Your `task-master git` commands can automate creating, switching, and cleaning up these worktrees based on tags, similar to how you manage branches and task lists. + +### Challenges and Considerations + +- **Complexity in management:** Git worktrees add complexity in tracking multiple directories and ensuring users operate in the correct one[1]. Your CLI should provide clear commands and feedback to avoid confusion. + +- **Maintenance overhead:** Worktrees need pruning and cleanup (`git worktree prune` or `git worktree remove`) to avoid clutter[1]. Automating cleanup in your tool would be beneficial. + +- **Syncing and updates:** Each worktree is a separate checkout and can become outdated. Your automation should include commands to update or rebase worktrees as needed. + +- **Tooling support:** Not all Git tools or scripts fully support worktrees, so your CLI wrappers should handle edge cases and provide a consistent experience[1][3]. + +### Practical Implementation Ideas + +- When a new tag (taskmaster list) is created, run `git worktree add` to create a new worktree directory named after the tag. + +- Store metadata linking tags to worktree paths in your taskmaster configuration to track and manage them. + +- Provide commands like `task-master worktree list`, `task-master worktree add `, and `task-master worktree remove ` to manage these worktrees. + +- Integrate with GitHub CLI (`gh`) and native git commands to automate branch creation, PR handling, and syncing within each worktree. + +- Consider inspiration from existing tools like [wt](https://github.com/taecontrol/wt) that automate worktree environment setup and teardown[3]. + +### Summary + +Using git worktrees per taskmaster tag is a feasible and potentially powerful extension of your current branch-based task list separation. It offers isolated, parallel working directories aligned with your tags, improving workflow clarity and reducing branch-switching overhead. However, it requires careful tooling and automation to manage complexity, maintenance, and synchronization effectively. Given your project’s focus on automating git workflows and leveraging CLI tools, implementing this feature incrementally with robust user feedback and cleanup commands would be a practical approach. + + +--- + +*Generated by Task Master Research Command* +*Timestamp: 2025-08-01T11:27:52.249Z* diff --git a/.taskmaster/reports/task-complexity-report.json b/.taskmaster/reports/task-complexity-report.json index 67d523af..3f8f88b2 100644 --- a/.taskmaster/reports/task-complexity-report.json +++ b/.taskmaster/reports/task-complexity-report.json @@ -1,373 +1,21 @@ { "meta": { - "generatedAt": "2025-05-27T16:34:53.088Z", + "generatedAt": "2025-08-02T14:28:59.851Z", "tasksAnalyzed": 1, - "totalTasks": 84, - "analysisCount": 45, + "totalTasks": 93, + "analysisCount": 1, "thresholdScore": 5, "projectName": "Taskmaster", - "usedResearch": true + "usedResearch": false }, "complexityAnalysis": [ { "taskId": 24, "taskTitle": "Implement AI-Powered Test Generation Command", - "complexityScore": 7, - "recommendedSubtasks": 5, - "expansionPrompt": "Break down the implementation of the AI-powered test generation command into detailed subtasks covering: command structure setup, AI prompt engineering, test file generation logic, integration with Claude API, and comprehensive error handling.", - "reasoning": "This task involves complex integration with an AI service (Claude), requires sophisticated prompt engineering, and needs to generate structured code files. The existing 3 subtasks are a good start but could be expanded to include more detailed steps for AI integration, error handling, and test file formatting." - }, - { - "taskId": 26, - "taskTitle": "Implement Context Foundation for AI Operations", - "complexityScore": 6, - "recommendedSubtasks": 4, - "expansionPrompt": "The current 4 subtasks for implementing the context foundation appear comprehensive. Consider if any additional subtasks are needed for testing, documentation, or integration with existing systems.", - "reasoning": "This task involves creating a foundation for context integration with several well-defined components. The existing 4 subtasks cover the main implementation areas (context-file flag, cursor rules integration, context extraction utility, and command handler updates). The complexity is moderate as it requires careful integration with existing systems but has clear requirements." - }, - { - "taskId": 27, - "taskTitle": "Implement Context Enhancements for AI Operations", - "complexityScore": 7, - "recommendedSubtasks": 4, - "expansionPrompt": "The current 4 subtasks for implementing context enhancements appear well-structured. Consider if any additional subtasks are needed for testing, documentation, or performance optimization.", - "reasoning": "This task builds upon the foundation from Task #26 and adds more sophisticated context handling features. The 4 existing subtasks cover the main implementation areas (code context extraction, task history context, PRD context integration, and context formatting). The complexity is higher than the foundation task due to the need for intelligent context selection and optimization." - }, - { - "taskId": 28, - "taskTitle": "Implement Advanced ContextManager System", - "complexityScore": 8, - "recommendedSubtasks": 5, - "expansionPrompt": "The current 5 subtasks for implementing the advanced ContextManager system appear comprehensive. Consider if any additional subtasks are needed for testing, documentation, or backward compatibility with previous context implementations.", - "reasoning": "This task represents the most complex phase of the context implementation, requiring a sophisticated class design, optimization algorithms, and integration with multiple systems. The 5 existing subtasks cover the core implementation areas, but the complexity is high due to the need for intelligent context prioritization, token management, and performance monitoring." - }, - { - "taskId": 40, - "taskTitle": "Implement 'plan' Command for Task Implementation Planning", - "complexityScore": 5, - "recommendedSubtasks": 4, - "expansionPrompt": "The current 4 subtasks for implementing the 'plan' command appear well-structured. Consider if any additional subtasks are needed for testing, documentation, or integration with existing task management workflows.", - "reasoning": "This task involves creating a new command that leverages AI to generate implementation plans. The existing 4 subtasks cover the main implementation areas (retrieving task content, generating plans with AI, formatting in XML, and error handling). The complexity is moderate as it builds on existing patterns for task updates but requires careful AI integration." - }, - { - "taskId": 41, - "taskTitle": "Implement Visual Task Dependency Graph in Terminal", - "complexityScore": 8, - "recommendedSubtasks": 10, - "expansionPrompt": "The current 10 subtasks for implementing the visual task dependency graph appear comprehensive. Consider if any additional subtasks are needed for performance optimization with large graphs or additional visualization options.", - "reasoning": "This task involves creating a sophisticated visualization system for terminal display, which is inherently complex due to layout algorithms, ASCII/Unicode rendering, and handling complex dependency relationships. The 10 existing subtasks cover all major aspects of implementation, from CLI interface to accessibility features." - }, - { - "taskId": 42, - "taskTitle": "Implement MCP-to-MCP Communication Protocol", - "complexityScore": 9, - "recommendedSubtasks": 8, - "expansionPrompt": "The current 8 subtasks for implementing the MCP-to-MCP communication protocol appear well-structured. Consider if any additional subtasks are needed for security hardening, performance optimization, or comprehensive documentation.", - "reasoning": "This task involves designing and implementing a complex communication protocol between different MCP tools and servers. It requires sophisticated adapter patterns, client-server architecture, and handling of multiple operational modes. The complexity is very high due to the need for standardization, security, and backward compatibility." - }, - { - "taskId": 44, - "taskTitle": "Implement Task Automation with Webhooks and Event Triggers", - "complexityScore": 8, - "recommendedSubtasks": 7, - "expansionPrompt": "The current 7 subtasks for implementing task automation with webhooks appear comprehensive. Consider if any additional subtasks are needed for security testing, rate limiting implementation, or webhook monitoring tools.", - "reasoning": "This task involves creating a sophisticated event system with webhooks for integration with external services. The complexity is high due to the need for secure authentication, reliable delivery mechanisms, and handling of various webhook formats and protocols. The existing subtasks cover the main implementation areas but security and monitoring could be emphasized more." - }, - { - "taskId": 45, - "taskTitle": "Implement GitHub Issue Import Feature", - "complexityScore": 6, - "recommendedSubtasks": 5, - "expansionPrompt": "The current 5 subtasks for implementing the GitHub issue import feature appear well-structured. Consider if any additional subtasks are needed for handling GitHub API rate limiting, caching, or supporting additional issue metadata.", - "reasoning": "This task involves integrating with the GitHub API to import issues as tasks. The complexity is moderate as it requires API authentication, data mapping, and error handling. The existing 5 subtasks cover the main implementation areas from design to end-to-end implementation." - }, - { - "taskId": 46, - "taskTitle": "Implement ICE Analysis Command for Task Prioritization", - "complexityScore": 7, - "recommendedSubtasks": 5, - "expansionPrompt": "The current 5 subtasks for implementing the ICE analysis command appear comprehensive. Consider if any additional subtasks are needed for visualization of ICE scores or integration with other prioritization methods.", - "reasoning": "This task involves creating an AI-powered analysis system for task prioritization using the ICE methodology. The complexity is high due to the need for sophisticated scoring algorithms, AI integration, and report generation. The existing subtasks cover the main implementation areas from algorithm design to integration with existing systems." - }, - { - "taskId": 47, - "taskTitle": "Enhance Task Suggestion Actions Card Workflow", - "complexityScore": 6, - "recommendedSubtasks": 6, - "expansionPrompt": "The current 6 subtasks for enhancing the task suggestion actions card workflow appear well-structured. Consider if any additional subtasks are needed for user testing, accessibility improvements, or performance optimization.", - "reasoning": "This task involves redesigning the UI workflow for task expansion and management. The complexity is moderate as it requires careful UX design and state management but builds on existing components. The 6 existing subtasks cover the main implementation areas from design to testing." - }, - { - "taskId": 48, - "taskTitle": "Refactor Prompts into Centralized Structure", - "complexityScore": 4, - "recommendedSubtasks": 3, - "expansionPrompt": "The current 3 subtasks for refactoring prompts into a centralized structure appear appropriate. Consider if any additional subtasks are needed for prompt versioning, documentation, or testing.", - "reasoning": "This task involves a straightforward refactoring to improve code organization. The complexity is relatively low as it primarily involves moving code rather than creating new functionality. The 3 existing subtasks cover the main implementation areas from directory structure to integration." - }, - { - "taskId": 49, - "taskTitle": "Implement Code Quality Analysis Command", "complexityScore": 8, "recommendedSubtasks": 6, - "expansionPrompt": "The current 6 subtasks for implementing the code quality analysis command appear comprehensive. Consider if any additional subtasks are needed for performance optimization with large codebases or integration with existing code quality tools.", - "reasoning": "This task involves creating a sophisticated code analysis system with pattern recognition, best practice verification, and AI-powered recommendations. The complexity is high due to the need for code parsing, complex analysis algorithms, and integration with AI services. The existing subtasks cover the main implementation areas from algorithm design to user interface." - }, - { - "taskId": 50, - "taskTitle": "Implement Test Coverage Tracking System by Task", - "complexityScore": 9, - "recommendedSubtasks": 5, - "expansionPrompt": "The current 5 subtasks for implementing the test coverage tracking system appear well-structured. Consider if any additional subtasks are needed for integration with CI/CD systems, performance optimization, or visualization tools.", - "reasoning": "This task involves creating a complex system that maps test coverage to specific tasks and subtasks. The complexity is very high due to the need for sophisticated data structures, integration with coverage tools, and AI-powered test generation. The existing subtasks are comprehensive and cover the main implementation areas from data structure design to AI integration." - }, - { - "taskId": 51, - "taskTitle": "Implement Perplexity Research Command", - "complexityScore": 6, - "recommendedSubtasks": 5, - "expansionPrompt": "The current 5 subtasks for implementing the Perplexity research command appear comprehensive. Consider if any additional subtasks are needed for caching optimization, result formatting, or integration with other research tools.", - "reasoning": "This task involves creating a new command that integrates with the Perplexity AI API for research. The complexity is moderate as it requires API integration, context extraction, and result formatting. The 5 existing subtasks cover the main implementation areas from API client to caching system." - }, - { - "taskId": 52, - "taskTitle": "Implement Task Suggestion Command for CLI", - "complexityScore": 6, - "recommendedSubtasks": 5, - "expansionPrompt": "The current 5 subtasks for implementing the task suggestion command appear well-structured. Consider if any additional subtasks are needed for suggestion quality evaluation, user feedback collection, or integration with existing task workflows.", - "reasoning": "This task involves creating a new CLI command that generates contextually relevant task suggestions using AI. The complexity is moderate as it requires AI integration, context collection, and interactive CLI interfaces. The existing subtasks cover the main implementation areas from data collection to user interface." - }, - { - "taskId": 53, - "taskTitle": "Implement Subtask Suggestion Feature for Parent Tasks", - "complexityScore": 6, - "recommendedSubtasks": 6, - "expansionPrompt": "The current 6 subtasks for implementing the subtask suggestion feature appear comprehensive. Consider if any additional subtasks are needed for suggestion quality metrics, user feedback collection, or performance optimization.", - "reasoning": "This task involves creating a feature that suggests contextually relevant subtasks for parent tasks. The complexity is moderate as it builds on existing task management systems but requires sophisticated AI integration and context analysis. The 6 existing subtasks cover the main implementation areas from validation to testing." - }, - { - "taskId": 55, - "taskTitle": "Implement Positional Arguments Support for CLI Commands", - "complexityScore": 5, - "recommendedSubtasks": 5, - "expansionPrompt": "The current 5 subtasks for implementing positional arguments support appear well-structured. Consider if any additional subtasks are needed for backward compatibility testing, documentation updates, or user experience improvements.", - "reasoning": "This task involves modifying the command parsing logic to support positional arguments alongside the existing flag-based syntax. The complexity is moderate as it requires careful handling of different argument styles and edge cases. The 5 existing subtasks cover the main implementation areas from analysis to documentation." - }, - { - "taskId": 57, - "taskTitle": "Enhance Task-Master CLI User Experience and Interface", - "complexityScore": 7, - "recommendedSubtasks": 6, - "expansionPrompt": "The current 6 subtasks for enhancing the CLI user experience appear comprehensive. Consider if any additional subtasks are needed for accessibility testing, internationalization, or performance optimization.", - "reasoning": "This task involves a significant overhaul of the CLI interface to improve user experience. The complexity is high due to the breadth of changes (logging, visual elements, interactive components, etc.) and the need for consistent design across all commands. The 6 existing subtasks cover the main implementation areas from log management to help systems." - }, - { - "taskId": 60, - "taskTitle": "Implement Mentor System with Round-Table Discussion Feature", - "complexityScore": 8, - "recommendedSubtasks": 7, - "expansionPrompt": "The current 7 subtasks for implementing the mentor system appear well-structured. Consider if any additional subtasks are needed for mentor personality consistency, discussion quality evaluation, or performance optimization with multiple mentors.", - "reasoning": "This task involves creating a sophisticated mentor simulation system with round-table discussions. The complexity is high due to the need for personality simulation, complex LLM integration, and structured discussion management. The 7 existing subtasks cover the main implementation areas from architecture to testing." - }, - { - "taskId": 62, - "taskTitle": "Add --simple Flag to Update Commands for Direct Text Input", - "complexityScore": 4, - "recommendedSubtasks": 8, - "expansionPrompt": "The current 8 subtasks for implementing the --simple flag appear comprehensive. Consider if any additional subtasks are needed for user experience testing or documentation updates.", - "reasoning": "This task involves adding a simple flag option to bypass AI processing for updates. The complexity is relatively low as it primarily involves modifying existing command handlers and adding a flag. The 8 existing subtasks are very detailed and cover all aspects of implementation from command parsing to testing." - }, - { - "taskId": 63, - "taskTitle": "Add pnpm Support for the Taskmaster Package", - "complexityScore": 5, - "recommendedSubtasks": 8, - "expansionPrompt": "The current 8 subtasks for adding pnpm support appear comprehensive. Consider if any additional subtasks are needed for CI/CD integration, performance comparison, or documentation updates.", - "reasoning": "This task involves ensuring the package works correctly with pnpm as an alternative package manager. The complexity is moderate as it requires careful testing of installation processes and scripts across different environments. The 8 existing subtasks cover all major aspects from documentation to binary verification." - }, - { - "taskId": 64, - "taskTitle": "Add Yarn Support for Taskmaster Installation", - "complexityScore": 5, - "recommendedSubtasks": 9, - "expansionPrompt": "The current 9 subtasks for adding Yarn support appear comprehensive. Consider if any additional subtasks are needed for performance testing, CI/CD integration, or compatibility with different Yarn versions.", - "reasoning": "This task involves ensuring the package works correctly with Yarn as an alternative package manager. The complexity is moderate as it requires careful testing of installation processes and scripts across different environments. The 9 existing subtasks are very detailed and cover all aspects from configuration to testing." - }, - { - "taskId": 65, - "taskTitle": "Add Bun Support for Taskmaster Installation", - "complexityScore": 6, - "recommendedSubtasks": 6, - "expansionPrompt": "The current 6 subtasks for adding Bun support appear well-structured. Consider if any additional subtasks are needed for handling Bun-specific issues, performance testing, or documentation updates.", - "reasoning": "This task involves adding support for the newer Bun package manager. The complexity is slightly higher than the other package manager tasks due to Bun's differences from Node.js and potential compatibility issues. The 6 existing subtasks cover the main implementation areas from research to documentation." - }, - { - "taskId": 67, - "taskTitle": "Add CLI JSON output and Cursor keybindings integration", - "complexityScore": 5, - "recommendedSubtasks": 5, - "expansionPrompt": "The current 5 subtasks for implementing JSON output and Cursor keybindings appear well-structured. Consider if any additional subtasks are needed for testing across different operating systems, documentation updates, or user experience improvements.", - "reasoning": "This task involves two distinct features: adding JSON output to CLI commands and creating a keybindings installation command. The complexity is moderate as it requires careful handling of different output formats and OS-specific file paths. The 5 existing subtasks cover the main implementation areas for both features." - }, - { - "taskId": 68, - "taskTitle": "Ability to create tasks without parsing PRD", - "complexityScore": 3, - "recommendedSubtasks": 2, - "expansionPrompt": "The current 2 subtasks for implementing task creation without PRD appear appropriate. Consider if any additional subtasks are needed for validation, error handling, or integration with existing task management workflows.", - "reasoning": "This task involves a relatively simple modification to allow task creation without requiring a PRD document. The complexity is low as it primarily involves creating a form interface and saving functionality. The 2 existing subtasks cover the main implementation areas of UI design and data saving." - }, - { - "taskId": 72, - "taskTitle": "Implement PDF Generation for Project Progress and Dependency Overview", - "complexityScore": 7, - "recommendedSubtasks": 6, - "expansionPrompt": "The current 6 subtasks for implementing PDF generation appear comprehensive. Consider if any additional subtasks are needed for handling large projects, additional visualization options, or integration with existing reporting tools.", - "reasoning": "This task involves creating a feature to generate PDF reports of project progress and dependency visualization. The complexity is high due to the need for PDF generation, data collection, and visualization integration. The 6 existing subtasks cover the main implementation areas from library selection to export options." - }, - { - "taskId": 75, - "taskTitle": "Integrate Google Search Grounding for Research Role", - "complexityScore": 5, - "recommendedSubtasks": 4, - "expansionPrompt": "The current 4 subtasks for integrating Google Search Grounding appear well-structured. Consider if any additional subtasks are needed for testing with different query types, error handling, or performance optimization.", - "reasoning": "This task involves updating the AI service layer to enable Google Search Grounding for research roles. The complexity is moderate as it requires careful integration with the existing AI service architecture and conditional logic. The 4 existing subtasks cover the main implementation areas from service layer modification to testing." - }, - { - "taskId": 76, - "taskTitle": "Develop E2E Test Framework for Taskmaster MCP Server (FastMCP over stdio)", - "complexityScore": 8, - "recommendedSubtasks": 7, - "expansionPrompt": "The current 7 subtasks for developing the E2E test framework appear comprehensive. Consider if any additional subtasks are needed for test result reporting, CI/CD integration, or performance benchmarking.", - "reasoning": "This task involves creating a sophisticated end-to-end testing framework for the MCP server. The complexity is high due to the need for subprocess management, protocol handling, and robust test case definition. The 7 existing subtasks cover the main implementation areas from architecture to documentation." - }, - { - "taskId": 77, - "taskTitle": "Implement AI Usage Telemetry for Taskmaster (with external analytics endpoint)", - "complexityScore": 7, - "recommendedSubtasks": 18, - "expansionPrompt": "The current 18 subtasks for implementing AI usage telemetry appear very comprehensive. Consider if any additional subtasks are needed for security hardening, privacy compliance, or user feedback collection.", - "reasoning": "This task involves creating a telemetry system to track AI usage metrics. The complexity is high due to the need for secure data transmission, comprehensive data collection, and integration across multiple commands. The 18 existing subtasks are extremely detailed and cover all aspects of implementation from core utility to provider-specific updates." - }, - { - "taskId": 80, - "taskTitle": "Implement Unique User ID Generation and Storage During Installation", - "complexityScore": 4, - "recommendedSubtasks": 5, - "expansionPrompt": "The current 5 subtasks for implementing unique user ID generation appear well-structured. Consider if any additional subtasks are needed for privacy compliance, security auditing, or integration with the telemetry system.", - "reasoning": "This task involves generating and storing a unique user identifier during installation. The complexity is relatively low as it primarily involves UUID generation and configuration file management. The 5 existing subtasks cover the main implementation areas from script structure to documentation." - }, - { - "taskId": 81, - "taskTitle": "Task #81: Implement Comprehensive Local Telemetry System with Future Server Integration Capability", - "complexityScore": 8, - "recommendedSubtasks": 6, - "expansionPrompt": "The current 6 subtasks for implementing the comprehensive local telemetry system appear well-structured. Consider if any additional subtasks are needed for data migration, storage optimization, or visualization tools.", - "reasoning": "This task involves expanding the telemetry system to capture additional metrics and implement local storage with future server integration capability. The complexity is high due to the breadth of data collection, storage requirements, and privacy considerations. The 6 existing subtasks cover the main implementation areas from data collection to user-facing benefits." - }, - { - "taskId": 82, - "taskTitle": "Update supported-models.json with token limit fields", - "complexityScore": 3, - "recommendedSubtasks": 1, - "expansionPrompt": "This task appears straightforward enough to be implemented without further subtasks. Focus on researching accurate token limit values for each model and ensuring backward compatibility.", - "reasoning": "This task involves a simple update to the supported-models.json file to include new token limit fields. The complexity is low as it primarily involves research and data entry. No subtasks are necessary as the task is well-defined and focused." - }, - { - "taskId": 83, - "taskTitle": "Update config-manager.js defaults and getters", - "complexityScore": 4, - "recommendedSubtasks": 1, - "expansionPrompt": "This task appears straightforward enough to be implemented without further subtasks. Focus on updating the DEFAULTS object and related getter functions while maintaining backward compatibility.", - "reasoning": "This task involves updating the config-manager.js module to replace maxTokens with more specific token limit fields. The complexity is relatively low as it primarily involves modifying existing code rather than creating new functionality. No subtasks are necessary as the task is well-defined and focused." - }, - { - "taskId": 84, - "taskTitle": "Implement token counting utility", - "complexityScore": 5, - "recommendedSubtasks": 1, - "expansionPrompt": "This task appears well-defined enough to be implemented without further subtasks. Focus on implementing accurate token counting for different models and proper fallback mechanisms.", - "reasoning": "This task involves creating a utility function to count tokens for different AI models. The complexity is moderate as it requires integration with the tiktoken library and handling different tokenization schemes. No subtasks are necessary as the task is well-defined and focused." - }, - { - "taskId": 69, - "taskTitle": "Enhance Analyze Complexity for Specific Task IDs", - "complexityScore": 7, - "recommendedSubtasks": 6, - "expansionPrompt": "Break down the task 'Enhance Analyze Complexity for Specific Task IDs' into 6 subtasks focusing on: 1) Core logic modification to accept ID parameters, 2) Report merging functionality, 3) CLI interface updates, 4) MCP tool integration, 5) Documentation updates, and 6) Comprehensive testing across all components.", - "reasoning": "This task involves modifying existing functionality across multiple components (core logic, CLI, MCP) with complex logic for filtering tasks and merging reports. The implementation requires careful handling of different parameter combinations and edge cases. The task has interdependent components that need to work together seamlessly, and the report merging functionality adds significant complexity." - }, - { - "taskId": 70, - "taskTitle": "Implement 'diagram' command for Mermaid diagram generation", - "complexityScore": 6, - "recommendedSubtasks": 5, - "expansionPrompt": "Break down the 'diagram' command implementation into 5 subtasks: 1) Command interface and parameter handling, 2) Task data extraction and transformation to Mermaid syntax, 3) Diagram rendering with status color coding, 4) Output formatting and file export functionality, and 5) Error handling and edge case management.", - "reasoning": "This task requires implementing a new feature rather than modifying existing code, which reduces complexity from integration challenges. However, it involves working with visualization logic, dependency mapping, and multiple output formats. The color coding based on status and handling of dependency relationships adds moderate complexity. The task is well-defined but requires careful attention to diagram formatting and error handling." - }, - { - "taskId": 85, - "taskTitle": "Update ai-services-unified.js for dynamic token limits", - "complexityScore": 7, - "recommendedSubtasks": 5, - "expansionPrompt": "Break down the update of ai-services-unified.js for dynamic token limits into subtasks such as: (1) Import and integrate the token counting utility, (2) Refactor _unifiedServiceRunner to calculate and enforce dynamic token limits, (3) Update error handling for token limit violations, (4) Add and verify logging for token usage, (5) Write and execute tests for various prompt and model scenarios.", - "reasoning": "This task involves significant code changes to a core function, integration of a new utility, dynamic logic for multiple models, and robust error handling. It also requires comprehensive testing for edge cases and integration, making it moderately complex and best managed by splitting into focused subtasks." - }, - { - "taskId": 87, - "taskTitle": "Implement validation and error handling", - "complexityScore": 5, - "recommendedSubtasks": 4, - "expansionPrompt": "Decompose this task into: (1) Add validation logic for model and config loading, (2) Implement error handling and fallback mechanisms, (3) Enhance logging and reporting for token usage, (4) Develop helper functions for configuration suggestions and improvements.", - "reasoning": "This task is primarily about adding validation, error handling, and logging. While important for robustness, the logic is straightforward and can be modularized into a few clear subtasks." - }, - { - "taskId": 89, - "taskTitle": "Introduce Prioritize Command with Enhanced Priority Levels", - "complexityScore": 6, - "recommendedSubtasks": 5, - "expansionPrompt": "Expand this task into: (1) Implement the prioritize command with all required flags and shorthands, (2) Update CLI output and help documentation for new priority levels, (3) Ensure backward compatibility with existing commands, (4) Add error handling for invalid inputs, (5) Write and run tests for all command scenarios.", - "reasoning": "This CLI feature requires command parsing, updating internal logic for new priority levels, documentation, and robust error handling. The complexity is moderate due to the need for backward compatibility and comprehensive testing." - }, - { - "taskId": 90, - "taskTitle": "Implement Subtask Progress Analyzer and Reporting System", - "complexityScore": 8, - "recommendedSubtasks": 6, - "expansionPrompt": "Break down the analyzer implementation into: (1) Design and implement progress tracking logic, (2) Develop status validation and issue detection, (3) Build the reporting system with multiple output formats, (4) Integrate analyzer with the existing task management system, (5) Optimize for performance and scalability, (6) Write unit, integration, and performance tests.", - "reasoning": "This is a complex, multi-faceted feature involving data analysis, reporting, integration, and performance optimization. It touches many parts of the system and requires careful design, making it one of the most complex tasks in the list." - }, - { - "taskId": 91, - "taskTitle": "Implement Move Command for Tasks and Subtasks", - "complexityScore": 7, - "recommendedSubtasks": 5, - "expansionPrompt": "Expand this task into: (1) Implement move logic for tasks and subtasks, (2) Handle edge cases (invalid ids, non-existent parents, circular dependencies), (3) Update CLI to support move command with flags, (4) Ensure data integrity and update relationships, (5) Write and execute tests for various move scenarios.", - "reasoning": "Moving tasks and subtasks requires careful handling of hierarchical data, edge cases, and data integrity. The command must be robust and user-friendly, necessitating multiple focused subtasks for safe implementation." - }, - { - "taskId": 92, - "taskTitle": "Add Global Joke Flag to All CLI Commands", - "complexityScore": 8, - "recommendedSubtasks": 7, - "expansionPrompt": "Break down the implementation of the global --joke flag into the following subtasks: (1) Update CLI foundation to support global flags, (2) Develop the joke-service module with joke management and category support, (3) Integrate joke output into existing output utilities, (4) Update all CLI commands for joke flag compatibility, (5) Add configuration options for joke categories and custom jokes, (6) Implement comprehensive testing (flag recognition, output, content, integration, performance, regression), (7) Update documentation and usage examples.", - "reasoning": "This task requires changes across the CLI foundation, output utilities, all command modules, and configuration management. It introduces a new service module, global flag handling, and output logic that must not interfere with existing features (including JSON output). The need for robust testing and backward compatibility further increases complexity. The scope spans multiple code areas and requires careful integration, justifying a high complexity score and a detailed subtask breakdown to manage risk and ensure maintainability.[2][3][5]" - }, - { - "taskId": 94, - "taskTitle": "Implement Standalone 'research' CLI Command for AI-Powered Queries", - "complexityScore": 7, - "recommendedSubtasks": 6, - "expansionPrompt": "Break down the implementation of the 'research' CLI command into logical subtasks covering command registration, parameter handling, context gathering, AI service integration, output formatting, and documentation.", - "reasoning": "This task has moderate to high complexity (7/10) due to multiple interconnected components: CLI argument parsing, integration with AI services, context gathering from various sources, and output formatting with different modes. The cyclomatic complexity would be significant with multiple decision paths for handling different flags and options. The task requires understanding existing patterns and extending the codebase in a consistent manner, suggesting the need for careful decomposition into manageable subtasks." - }, - { - "taskId": 86, - "taskTitle": "Implement GitHub Issue Export Feature", - "complexityScore": 9, - "recommendedSubtasks": 10, - "expansionPrompt": "Break down the implementation of the GitHub Issue Export Feature into detailed subtasks covering: command structure and CLI integration, GitHub API client development, authentication and error handling, task-to-issue mapping logic, content formatting and markdown conversion, bidirectional linking and metadata management, extensible architecture and adapter interfaces, configuration and settings management, documentation, and comprehensive testing (unit, integration, edge cases, performance).", - "reasoning": "This task involves designing and implementing a robust, extensible export system with deep integration into GitHub, including bidirectional workflows, complex data mapping, error handling, and support for future platforms. The requirements span CLI design, API integration, content transformation, metadata management, extensibility, configuration, and extensive testing. The breadth and depth of these requirements, along with the need for maintainability and future extensibility, place this task at a high complexity level. Breaking it into at least 10 subtasks will ensure each major component and concern is addressed systematically, reducing risk and improving quality." + "expansionPrompt": "Expand task 24 'Implement AI-Powered Test Generation Command' into 6 subtasks, focusing on: 1) Command structure implementation, 2) AI prompt engineering for test generation, 3) Test file generation and output, 4) Framework-specific template implementation, 5) MCP tool integration, and 6) Documentation and help system integration. Include detailed implementation steps, dependencies, and testing approaches for each subtask.", + "reasoning": "This task has high complexity due to several challenging aspects: 1) AI integration requiring sophisticated prompt engineering, 2) Test generation across multiple frameworks, 3) File system operations with proper error handling, 4) MCP tool integration, 5) Complex configuration requirements, and 6) Framework-specific template generation. The task already has 5 subtasks but could benefit from reorganization based on the updated implementation details in the info blocks, particularly around framework support and configuration." } ] } diff --git a/.taskmaster/state.json b/.taskmaster/state.json index 7674db09..a5984cf1 100644 --- a/.taskmaster/state.json +++ b/.taskmaster/state.json @@ -1,6 +1,6 @@ { "currentTag": "master", - "lastSwitched": "2025-07-22T13:32:03.558Z", + "lastSwitched": "2025-08-01T14:09:25.838Z", "branchTagMapping": { "v017-adds": "v017-adds", "next": "next" diff --git a/.taskmaster/tasks/tasks.json b/.taskmaster/tasks/tasks.json index cde5d76f..baf73c66 100644 --- a/.taskmaster/tasks/tasks.json +++ b/.taskmaster/tasks/tasks.json @@ -2571,42 +2571,42 @@ "testStrategy": "Testing should verify both the protocol design and implementation:\n\n1. Unit tests for the adapter pattern, ensuring it correctly translates between Taskmaster's internal models and the MCP protocol.\n2. Integration tests with a mock MCP tool or server to validate the full request/response cycle.\n3. Specific tests for the reference implementation (e.g., GitHub-MCP or Postgres-MCP), including authentication flows.\n4. Error handling tests that simulate network failures, timeouts, and malformed responses.\n5. Performance tests to ensure the communication does not introduce significant latency.\n6. Security tests to verify that authentication and encryption mechanisms are functioning correctly.\n7. End-to-end tests demonstrating Taskmaster's ability to programmatically interact with external MCP tools and execute tasks.\n8. Compatibility tests with different versions of the protocol to ensure backward compatibility.\n9. Tests for mode switching:\n - Validate that Taskmaster correctly operates in solo/local mode using the `tasks.json` file.\n - Validate that Taskmaster correctly operates in multiplayer/remote mode with external MCP integrations (e.g., GitHub-MCP or Postgres-MCP).\n - Ensure seamless switching between modes without data loss or corruption.\n10. A test harness should be created to simulate an MCP tool or server for testing purposes without relying on external dependencies. Test cases should be documented thoroughly to serve as examples for other implementations.", "subtasks": [ { - "id": "42-1", + "id": 42, "title": "Define MCP-to-MCP communication protocol", "status": "pending" }, { - "id": "42-2", + "id": 42, "title": "Implement adapter pattern for MCP integration", "status": "pending" }, { - "id": "42-3", + "id": 42, "title": "Develop client module for MCP tool discovery and interaction", "status": "pending" }, { - "id": "42-4", + "id": 42, "title": "Provide reference implementation for GitHub-MCP integration", "status": "pending" }, { - "id": "42-5", + "id": 42, "title": "Add support for solo/local and multiplayer/remote modes", "status": "pending" }, { - "id": "42-6", + "id": 42, "title": "Update core modules to support dynamic mode-based operations", "status": "pending" }, { - "id": "42-7", + "id": 42, "title": "Document protocol and mode-switching functionality", "status": "pending" }, { - "id": "42-8", + "id": 42, "title": "Update terminology to reflect MCP server-based communication", "status": "pending" } @@ -5403,7 +5403,7 @@ "id": 92, "title": "Implement Project Root Environment Variable Support in MCP Configuration", "description": "Add support for a 'TASK_MASTER_PROJECT_ROOT' environment variable in MCP configuration, allowing it to be set in both mcp.json and .env, with precedence over other methods. This will define the root directory for the MCP server and take precedence over all other project root resolution methods. The implementation should be backward compatible with existing workflows that don't use this variable.", - "status": "review", + "status": "done", "dependencies": [ 1, 3, @@ -5417,49 +5417,49 @@ "id": 1, "title": "Update configuration loader to check for TASK_MASTER_PROJECT_ROOT environment variable", "description": "Modify the configuration loading system to check for the TASK_MASTER_PROJECT_ROOT environment variable as the primary source for project root directory. Ensure proper error handling if the variable is set but points to a non-existent or inaccessible directory.", - "status": "pending" + "status": "done" }, { "id": 2, "title": "Add support for 'projectRoot' in configuration files", "description": "Implement support for a 'projectRoot' key in mcp_config.toml and mcp.json configuration files as a fallback when the environment variable is not set. Update the configuration parser to recognize and validate this field.", - "status": "pending" + "status": "done" }, { "id": 3, "title": "Refactor project root resolution logic with clear precedence rules", "description": "Create a unified project root resolution function that follows the precedence order: 1) TASK_MASTER_PROJECT_ROOT environment variable, 2) 'projectRoot' in config files, 3) existing resolution methods. Ensure this function is used consistently throughout the codebase.", - "status": "pending" + "status": "done" }, { "id": 4, "title": "Update all MCP tools to use the new project root resolution", "description": "Identify all MCP tools and components that need to access the project root and update them to use the new resolution logic. Ensure consistent behavior across all parts of the system.", - "status": "pending" + "status": "done" }, { "id": 5, "title": "Add comprehensive tests for the new project root resolution", "description": "Create unit and integration tests to verify the correct behavior of the project root resolution logic under various configurations and edge cases.", - "status": "pending" + "status": "done" }, { "id": 6, "title": "Update documentation with new configuration options", "description": "Update the project documentation to clearly explain the new TASK_MASTER_PROJECT_ROOT environment variable, the 'projectRoot' configuration option, and the precedence rules. Include examples of different configuration scenarios.", - "status": "pending" + "status": "done" }, { "id": 7, "title": "Implement validation for project root directory", "description": "Add validation to ensure the specified project root directory exists and has the necessary permissions. Provide clear error messages when validation fails.", - "status": "pending" + "status": "done" }, { "id": 8, "title": "Implement support for loading environment variables from .env files", "description": "Add functionality to load the TASK_MASTER_PROJECT_ROOT variable from .env files in the workspace, following best practices for environment variable management in MCP servers.", - "status": "pending" + "status": "done" } ] }, @@ -5806,93 +5806,43 @@ }, { "id": 97, - "title": "Implement Git Workflow Integration", - "description": "Add `task-master git` command suite to automate git workflows based on established patterns from Task 4, eliminating manual overhead and ensuring 100% consistency", + "title": "Implement Basic Git Branch Management for Tasks", + "description": "Develop a simple Git integration module that provides essential branch management capabilities for tasks, including creation and tracking", "status": "pending", "dependencies": [], - "priority": "high", - "details": "Create a comprehensive git workflow automation system that integrates deeply with TaskMaster's task management. The feature will:\n\n1. **Automated Branch Management**:\n - Create branches following `task-{id}` naming convention\n - Validate branch names and prevent conflicts\n - Handle branch switching with uncommitted changes\n - Clean up local and remote branches post-merge\n\n2. **Intelligent Commit Generation**:\n - Auto-detect commit type (feat/fix/test/refactor/docs) from file changes\n - Generate standardized commit messages with task context\n - Support subtask-specific commits with proper references\n - Include coverage delta in test commits\n\n3. **PR Automation**:\n - Generate comprehensive PR descriptions from task/subtask data\n - Include implementation details, test coverage, breaking changes\n - Format using GitHub markdown with task hierarchy\n - Auto-populate PR template with relevant metadata\n\n4. **Workflow State Management**:\n - Track current task branch and status\n - Validate task readiness before PR creation\n - Ensure all subtasks completed before finishing\n - Handle merge conflicts gracefully\n\n5. **Integration Points**:\n - Seamless integration with existing task commands\n - MCP server support for IDE integrations\n - GitHub CLI (`gh`) authentication support\n - Coverage report parsing and display\n\n**Technical Architecture**:\n- Modular command structure in `scripts/modules/task-manager/git-*`\n- Git operations wrapper using simple-git or native child_process\n- Template engine for commit/PR generation in `scripts/modules/`\n- State persistence in `.taskmaster/git-state.json`\n- Error recovery and rollback mechanisms\n\n**Key Files to Create**:\n- `scripts/modules/task-manager/git-start.js` - Branch creation and task status update\n- `scripts/modules/task-manager/git-commit.js` - Intelligent commit message generation\n- `scripts/modules/task-manager/git-pr.js` - PR creation with auto-generated description\n- `scripts/modules/task-manager/git-finish.js` - Post-merge cleanup and status update\n- `scripts/modules/task-manager/git-status.js` - Current git workflow state display\n- `scripts/modules/git-operations.js` - Core git functionality wrapper\n- `scripts/modules/commit-analyzer.js` - File change analysis for commit types\n- `scripts/modules/pr-description-generator.js` - PR description template generator\n\n**MCP Integration Files**:\n- `mcp-server/src/core/direct-functions/git-start.js`\n- `mcp-server/src/core/direct-functions/git-commit.js`\n- `mcp-server/src/core/direct-functions/git-pr.js`\n- `mcp-server/src/core/direct-functions/git-finish.js`\n- `mcp-server/src/core/direct-functions/git-status.js`\n- `mcp-server/src/tools/git-start.js`\n- `mcp-server/src/tools/git-commit.js`\n- `mcp-server/src/tools/git-pr.js`\n- `mcp-server/src/tools/git-finish.js`\n- `mcp-server/src/tools/git-status.js`\n\n**Configuration**:\n- Add git workflow settings to `.taskmasterconfig`\n- Support for custom commit prefixes and PR templates\n- Branch naming pattern customization\n- Remote repository detection and validation", - "testStrategy": "Implement comprehensive test suite following Task 4's TDD approach:\n\n1. **Unit Tests** (target: 95%+ coverage):\n - Git operations wrapper with mocked git commands\n - Commit type detection with various file change scenarios\n - PR description generation with different task structures\n - Branch name validation and generation\n - State management and persistence\n\n2. **Integration Tests**:\n - Full workflow simulation in test repository\n - Error handling for git conflicts and failures\n - Multi-task workflow scenarios\n - Coverage integration with real test runs\n - GitHub API interaction (mocked)\n\n3. **E2E Tests**:\n - Complete task lifecycle from start to finish\n - Multiple developer workflow simulation\n - Merge conflict resolution scenarios\n - Branch protection and validation\n\n4. **Test Implementation Details**:\n - Use Jest with git repository fixtures\n - Mock simple-git for isolated unit tests\n - Create test tasks.json scenarios\n - Validate all error messages and edge cases\n - Test rollback and recovery mechanisms\n\n5. **Coverage Requirements**:\n - Minimum 90% overall coverage\n - 100% coverage for critical paths (branch creation, PR generation)\n - All error scenarios must be tested\n - Performance tests for large task hierarchies", + "priority": "medium", + "details": "Implement a basic Git branch management system with the following features:\n\n1. **Core Command Interface**:\n - `task-master git start [task-id]` - Creates a branch with standard naming pattern\n - `task-master git status` - Shows task-related branches and their statuses\n - `task-master git finish [task-id]` - Completes work on a task branch\n\n2. **Simple Configuration**:\n - Use a basic configuration file: `config/git-integration.json`\n - Support for default branch naming template (e.g., `feature/{id}`)\n - Basic team workflow settings\n\n3. **Streamlined Implementation**:\n - Create simple file structure:\n - `scripts/modules/git/index.js` - Main entry point\n - `scripts/modules/git/commands/` - Basic command implementations\n - Use synchronous Git operations for simplicity\n - Focus on supporting the main Git client only\n\n4. **Basic Error Handling**:\n - Standard error messages for common issues\n - Simple input validation\n - Handle basic edge cases:\n - Existing branches\n - Uncommitted changes detection\n\n5. **Core Integration**:\n - Basic task status updates based on branch activity\n - Support for primary remote repository only\n\n6. **User Experience**:\n - Simple terminal output\n - Basic help documentation for commands", + "testStrategy": "Implement a focused testing strategy:\n\n1. **Unit Tests**:\n - Test core command functions\n - Test basic configuration parsing\n - Coverage target: >70% for core functionality\n\n2. **Integration Tests**:\n - Set up simple test repositories\n - Test basic workflows (start, status, finish)\n - Verify correct branch creation and naming\n\n3. **Basic Edge Case Testing**:\n - Test behavior with uncommitted changes\n - Test with simple repository states\n\n4. **Manual Testing**:\n - Create a simple test plan with basic workflows\n - Document expected outcomes\n - Perform manual verification\n\n5. **Documentation Check**:\n - Verify help text for accuracy", "subtasks": [ { "id": 1, - "title": "Design and implement core git operations wrapper", - "description": "Create a robust git operations layer that handles all git commands with proper error handling and state management", + "title": "Implement Core Git Branch Commands", + "description": "Create the essential Git branch command implementations for starting, checking status, and finishing task branches with minimal functionality.", + "dependencies": [], + "details": "Implement the three core commands in their simplest form:\n1. `task-master git start [task-id]` - Create a branch using a basic naming pattern like `feature/{id}`\n2. `task-master git status` - Show only the current task branches without detailed status information\n3. `task-master git finish [task-id]` - Basic completion of a task branch\n\nUse synchronous Git operations and focus only on the happy path. Skip advanced error handling and edge cases. Place all command implementations in `scripts/modules/git/commands/` with minimal code.", "status": "pending", - "details": "Create `scripts/modules/git-operations.js` with methods for:\n- Branch creation/deletion (local and remote)\n- Commit operations with message formatting\n- Status checking and conflict detection\n- Remote operations (fetch, push, pull)\n- Repository validation and setup\n\nUse simple-git library or child_process for git commands. Implement comprehensive error handling with specific error types for different git failures. Include retry logic for network operations.", - "testStrategy": "Unit test all git operations with mocked git commands. Test error scenarios including conflicts, network failures, and invalid states. Achieve 100% coverage." + "testStrategy": "Manual testing only - verify each command works in a simple test repository with the basic workflow: start a branch, check status, finish the branch." }, { "id": 2, - "title": "Implement git start command", - "description": "Create the entry point for task-based git workflows with automated branch creation and task status updates", + "title": "Create Minimal Configuration Setup", + "description": "Set up the simplest possible configuration file structure to support basic branch naming and minimal settings.", + "dependencies": [], + "details": "Create a basic `config/git-integration.json` file with only two settings:\n1. Default branch naming template (e.g., `feature/{id}`)\n2. Default base branch name (e.g., `main`)\n\nImplement a simple function to read this configuration file. Do not implement validation, fallback options, or advanced configuration capabilities. Focus only on the minimal setup needed for the core commands to function.", "status": "pending", - "details": "Implement `scripts/modules/task-manager/git-start.js` with functionality to:\n- Validate task exists and is ready to start\n- Check for clean working directory\n- Create branch with `task-{id}` naming\n- Update task status to 'in-progress'\n- Store workflow state in `.taskmaster/git-state.json`\n- Handle existing branch scenarios\n- Support --force flag for branch recreation\n\nIntegrate with existing task-master commands and ensure MCP compatibility.", - "testStrategy": "Test all scenarios including clean start, existing branches, dirty working directory, and force recreation. Mock git operations and task updates." + "testStrategy": "Verify the configuration file can be read and the values are correctly used by the branch commands." }, { "id": 3, - "title": "Build intelligent commit analyzer and generator", - "description": "Create a system that analyzes file changes to auto-detect commit types and generate standardized commit messages", + "title": "Integrate Git Module with Task System", + "description": "Connect the Git branch commands to the task tracking system with minimal integration to update task statuses.", + "dependencies": [ + "1", + "2" + ], + "details": "Create the main entry point at `scripts/modules/git/index.js` that exposes the three core commands. Implement the simplest possible integration with the task system:\n1. When a branch is started, update the task status to 'in-progress'\n2. When a branch is finished, update the task status to 'completed'\n\nSkip all advanced integrations, error handling, and edge cases. Do not implement remote repository support beyond the absolute basics. Focus only on making the commands accessible through the main CLI interface.", "status": "pending", - "details": "Develop `scripts/modules/commit-analyzer.js` with:\n- File change detection and categorization\n- Commit type inference rules:\n - feat: new files in scripts/, new functions\n - fix: changes to existing logic\n - test: changes in tests/ directory\n - docs: markdown and comment changes\n - refactor: file moves, renames, cleanup\n- Smart message generation with task context\n- Support for custom commit templates\n- Subtask reference inclusion\n\nCreate `scripts/modules/task-manager/git-commit.js` that uses the analyzer to generate commits with proper formatting.", - "testStrategy": "Test commit type detection with various file change combinations. Validate message generation for all scenarios. Test edge cases and custom templates." - }, - { - "id": 4, - "title": "Create PR description generator and command", - "description": "Build a comprehensive PR description generator that creates detailed, formatted descriptions from task data", - "status": "pending", - "details": "Implement `scripts/modules/pr-description-generator.js` to generate:\n- Task overview with full context\n- Subtask completion checklist\n- Implementation details summary\n- Test coverage metrics integration\n- Breaking changes section\n- Related tasks and dependencies\n\nCreate `scripts/modules/task-manager/git-pr.js` to:\n- Validate all subtasks are complete\n- Generate PR title and description\n- Use GitHub CLI for PR creation\n- Handle draft PR scenarios\n- Support custom PR templates\n- Include labels based on task metadata", - "testStrategy": "Test PR generation with various task structures. Validate markdown formatting and GitHub compatibility. Test with incomplete subtasks and edge cases." - }, - { - "id": 5, - "title": "Implement git finish command with cleanup", - "description": "Create the workflow completion command that handles post-merge cleanup and task status updates", - "status": "pending", - "details": "Build `scripts/modules/task-manager/git-finish.js` with:\n- PR merge verification via GitHub API\n- Local branch cleanup\n- Remote branch deletion (with confirmation)\n- Task status update to 'done'\n- Workflow state cleanup\n- Switch back to main branch\n- Pull latest changes\n\nHandle scenarios where PR isn't merged yet or merge failed. Include --skip-cleanup flag for manual branch management.", - "testStrategy": "Test successful completion flow, unmerged PR handling, and cleanup failures. Mock GitHub API and git operations. Validate state cleanup." - }, - { - "id": 6, - "title": "Add git status command for workflow visibility", - "description": "Create a status command that shows current git workflow state with task context", - "status": "pending", - "details": "Implement `scripts/modules/task-manager/git-status.js` to display:\n- Current task and branch information\n- Subtask completion status\n- Uncommitted changes summary\n- PR status if exists\n- Coverage metrics comparison\n- Suggested next actions\n\nIntegrate with existing task status displays and provide actionable guidance based on workflow state.", - "testStrategy": "Test status display in various workflow states. Validate suggestion logic and formatting. Test with missing or corrupted state." - }, - { - "id": 7, - "title": "Integrate with Commander.js and add command routing", - "description": "Add the git command suite to TaskMaster's CLI with proper help text and option handling", - "status": "pending", - "details": "Update `scripts/modules/commands.js` to:\n- Add 'git' command with subcommands\n- Implement option parsing for all git commands\n- Add comprehensive help text\n- Ensure proper error handling and display\n- Validate command prerequisites\n\nCreate proper command structure:\n- `task-master git start [taskId] [options]`\n- `task-master git commit [options]`\n- `task-master git pr [options]`\n- `task-master git finish [options]`\n- `task-master git status [options]`", - "testStrategy": "Test command registration and routing. Validate help text and option parsing. Test error handling for invalid commands." - }, - { - "id": 8, - "title": "Add MCP server integration for git commands", - "description": "Implement MCP tools and direct functions for git workflow commands to enable IDE integration", - "status": "pending", - "details": "Create MCP integration in:\n- `mcp-server/src/core/direct-functions/git-start.js`\n- `mcp-server/src/core/direct-functions/git-commit.js`\n- `mcp-server/src/core/direct-functions/git-pr.js`\n- `mcp-server/src/core/direct-functions/git-finish.js`\n- `mcp-server/src/core/direct-functions/git-status.js`\n- `mcp-server/src/tools/git-start.js`\n- `mcp-server/src/tools/git-commit.js`\n- `mcp-server/src/tools/git-pr.js`\n- `mcp-server/src/tools/git-finish.js`\n- `mcp-server/src/tools/git-status.js`\n\nImplement tools for:\n- git_start_task\n- git_commit_task\n- git_create_pr\n- git_finish_task\n- git_workflow_status\n\nEnsure proper error handling, logging, and response formatting. Include telemetry data for git operations.", - "testStrategy": "Test MCP tool registration and execution. Validate response formats and error handling. Test with various parameter combinations." - }, - { - "id": 9, - "title": "Create comprehensive test suite", - "description": "Implement full test coverage following Task 4's high standards with unit, integration, and E2E tests", - "status": "pending", - "details": "Create test files:\n- `tests/unit/git/` - Unit tests for all git components\n- `tests/integration/git-workflow.test.js` - Full workflow tests\n- `tests/e2e/git-automation.test.js` - End-to-end scenarios\n\nImplement:\n- Git repository fixtures and mocks\n- Coverage tracking and reporting\n- Performance benchmarks\n- Error scenario coverage\n- Multi-developer workflow simulations\n\nTarget 95%+ coverage with focus on critical paths.", - "testStrategy": "Follow TDD approach. Write tests before implementation. Use Jest with proper mocking. Validate all edge cases and error scenarios." - }, - { - "id": 10, - "title": "Add configuration and documentation", - "description": "Create configuration options and comprehensive documentation for the git workflow feature", - "status": "pending", - "details": "Configuration tasks:\n- Add git workflow settings to `.taskmasterconfig`\n- Support environment variables for GitHub tokens\n- Create default PR and commit templates\n- Add branch naming customization\n\nDocumentation tasks:\n- Update README with git workflow section\n- Create `docs/git-workflow.md` guide\n- Add examples for common scenarios\n- Document configuration options\n- Create troubleshooting guide\n\nUpdate rule files:\n- Create `.cursor/rules/git_workflow.mdc`\n- Update existing workflow rules", - "testStrategy": "Test configuration loading and validation. Verify documentation accuracy with real usage scenarios. Test template rendering." + "testStrategy": "Test the complete workflow manually: create a task, start a branch for it, verify the task status changes, finish the branch, and verify the task status updates accordingly." } ] }, @@ -6330,7 +6280,7 @@ "id": 103, "title": "Implement Tagged Task Lists System for Multi-Context Task Management", "description": "Develop a comprehensive tagged task lists system enabling users to organize, filter, and manage tasks across multiple contexts (e.g., personal, branch, version) with full backward compatibility.", - "status": "in-progress", + "status": "done", "dependencies": [ 3, 11, @@ -6402,7 +6352,7 @@ 4 ], "details": "Enable seamless context switching between code branches and task tags. Use add-tag internally when creating tags from branch names.\n\n**Code Context Analysis Complete**\n\n**Current State:**\n- `state.json` has `branchTagMapping: {}` ready for storing git branch to tag mappings\n- `config.json` has `tags.enabledGitworkflow: false` and `tags.autoSwitchTagWithBranch: false` controls\n- Existing tag management functions in `scripts/modules/task-manager/tag-management.js` provide `createTag`, `useTag`, `switchCurrentTag` utilities\n- No existing git integration - need to add git CLI dependencies\n\n**Implementation Plan:**\n\n1. **Add Git Dependencies**: Add `simple-git` package for git operations (better than calling CLI directly)\n2. **Create Git Utilities Module**: `scripts/modules/utils/git-utils.js` with functions:\n - `getCurrentBranch()` - Get current git branch name\n - `isGitRepository()` - Check if we're in a git repo\n - `getBranchList()` - Get list of all branches\n - `onBranchChange()` - Hook for branch change detection\n\n3. **Enhance Tag Management**: Add git integration functions:\n - `createTagFromBranch(branchName)` - Create tag from git branch name\n - `autoSwitchTagForBranch()` - Auto-switch tag when branch changes\n - `updateBranchTagMapping()` - Update state.json mapping\n\n4. **Add CLI Commands**:\n - `--from-branch` flag for `add-tag` command\n - `task-master sync-git` command for manual git-tag synchronization\n\n5. **Configuration Integration**: \n - Check `config.tags.enabledGitworkflow` before git operations\n - Use `config.tags.autoSwitchTagWithBranch` for automatic switching\n\n**Next Steps**: Start with adding simple-git dependency and creating git utilities module.\n\n\n**Updated Implementation Strategy - Automatic Git Integration**\n\n**Revised Approach:**\n- Eliminate manual `sync-git` command for seamless user experience\n- Implement automatic git-tag synchronization following the established migration pattern\n- Integration occurs transparently during normal task operations without user intervention\n- Behavior controlled entirely through existing configuration flags\n\n**Updated Implementation Plan:**\n\n1. **Simplified Git Dependencies**: Keep `simple-git` package for git operations\n\n2. **Enhanced Git Utilities Module**: `scripts/modules/utils/git-utils.js` with streamlined functions:\n - `getCurrentBranch()` - Get current git branch name\n - `isGitRepository()` - Check if we're in a git repo\n - `shouldAutoSync()` - Check if git workflow is enabled and conditions are met\n\n3. **Automatic Integration Hook**: \n - Add `checkAndSyncGitTags()` function to utils.js\n - Integrate into `readJSON()` similar to migration system\n - Automatically create tags from branch names when conditions are met\n - Update branch-tag mappings in state.json transparently\n\n4. **Streamlined Tag Management**: Remove complex CLI additions:\n - No `--from-branch` flag needed for `add-tag`\n - No manual `sync-git` command\n - Automatic tag creation and switching based on git context\n\n5. **Configuration-Driven Behavior**:\n - `config.tags.enabledGitworkflow` enables/disables entire system\n - `config.tags.autoSwitchTagWithBranch` controls automatic tag switching\n - Silent operation when disabled, seamless when enabled\n\n**Benefits**: Zero-friction git integration that \"just works\" when enabled, following established project patterns for automatic system enhancements.\n\n\n**βœ… IMPLEMENTATION COMPLETED**\n\n**Final Implementation Summary:**\n\n1. **Proper Module Organization**: \n - Moved `checkAndAutoSwitchGitTag` function to correct location in `scripts/modules/utils/git-utils.js`\n - Updated imports in `utils.js` to use the git-utils version\n - Maintains clean separation of concerns with git operations in dedicated module\n\n2. **Seamless Integration Architecture**:\n - Function automatically executes during `readJSON()` operations\n - Integrates with both migration system and normal tagged format processing\n - Zero user intervention required - works transparently in background\n\n3. **Smart Git-Tag Synchronization**:\n - Automatically switches to existing tags matching current branch names\n - Creates new tags for branches without corresponding tags\n - Updates `state.json` branch-tag mappings for persistent tracking\n - Validates branch names (excludes main/master/develop/dev/HEAD)\n\n4. **Configuration-Driven Operation**:\n - Controlled by `config.tags.enabledGitworkflow` and `config.tags.autoSwitchTagWithBranch` flags\n - Silent operation when disabled, seamless when enabled\n - Uses `console.debug` for error handling to avoid disrupting normal operations\n\n5. **MCP-Compatible Design**:\n - All functions require `projectRoot` parameter for MCP compatibility\n - Leverages existing git utility functions (`isGitRepository`, `getCurrentBranch`, `isValidBranchForTag`, `sanitizeBranchNameForTag`)\n - Follows established project patterns for automatic system enhancements\n\n**Status**: Implementation complete and ready for production use. Users can enable automatic git integration by configuring the appropriate flags in `.taskmaster/config.json`.\n\n\n**SCOPE SIMPLIFIED: Basic CLI Git Integration Only**\n\n**Implementation Status Changed:**\n- **CANCELLED**: All automatic git-tag synchronization features\n- **CANCELLED**: Configuration-driven git workflow automation \n- **CANCELLED**: Silent background git integration\n- **CANCELLED**: Branch-tag mapping persistence and auto-switching\n\n**COMPLETED: Core Git Utilities**\n- Git utilities module with MCP-compatible functions ready\n- Branch name sanitization and validation implemented\n- Git repository detection working\n\n**REMAINING WORK: CLI Integration**\n- Add `--from-branch` flag to `add-tag` command in `scripts/modules/commands.js`\n- Integrate existing git utilities with tag creation workflow\n- Enable `task-master add-tag --from-branch` command functionality\n\n**Final Simplified Scope:**\nSingle explicit command: `task-master add-tag --from-branch`\n- Detects current git branch name\n- Sanitizes branch name to valid tag format\n- Creates new tag with sanitized name\n- No automation, no background processes, no persistent mappings\n\n**Benefits**: Explicit user control, predictable behavior, simple implementation, easy debugging, clear separation of concerns between git and task management.\n\n**Next Step**: Implement CLI flag integration to complete the simplified git integration feature.\n", - "status": "deferred", + "status": "done", "testStrategy": "Test tag creation and switching in repositories with multiple branches." }, { @@ -6530,7 +6480,7 @@ "title": "Implement Task Template Importing from External .json Files", "description": "Implement a mechanism to import tasks from external .json files, treating them as task templates. This allows users to add new .json files to the .taskmaster/tasks folder. The system should read these files, extract tasks under a specific tag, and merge them into the main tasks.json. The 'master' tag from template files must be ignored to prevent conflicts, and the primary tasks.json file will always take precedence over imported tags.", "details": "Key implementation steps: 1. Develop a file watcher or a manual import command to detect and process new .json files in the tasks directory. 2. Implement logic to read an external json file, identify the tag key, and extract the array of tasks. 3. Handle potential conflicts: if an imported tag already exists in the main tasks.json, the existing tasks should be preserved and new ones appended, or the import should be skipped based on a defined precedence rule. 4. Ignore any 'master' key in template files to protect the integrity of the main task list. 5. Update task ID sequencing to ensure imported tasks are assigned unique IDs that don't conflict with existing tasks.\n\n**UPDATED IMPLEMENTATION PLAN - Silent Task Template Discovery**\n\n**Core Architecture Changes**:\n- Replace manual import workflow with automatic file discovery during tag operations\n- Implement file pattern matching for `tasks_*.json` files in tasks directory\n- Create seamless tag resolution system that checks external files when tags not found in main tasks.json\n\n**Silent Discovery Mechanism**:\n- Scan for `tasks_*.json` files during any tag-related operation (list-tags, use-tag, etc.)\n- Extract tag names from filenames and validate against internal tag keys\n- Build dynamic tag registry combining main tasks.json tags with discovered external tags\n- Apply precedence rule: main tasks.json tags override external files with same tag name\n\n**File Naming and Structure Convention**:\n- External files follow pattern: `tasks_[tagname].json` where tagname must match internal tag key\n- Files contain same structure as main tasks.json but only the specific tag section is used\n- Master key in external files is ignored to prevent conflicts with main task list\n\n**Key Implementation Updates**:\n- Enhance `getAvailableTags()` to include filesystem scan and merge results\n- Modify tag resolution logic to check external files as fallback when tag missing from main file\n- Update `listTags()` to display external tags with visual indicator (e.g., \"[ext]\" suffix)\n- Implement read-only access for external tags - all task modifications route to main tasks.json\n- Add error handling for malformed external files without breaking core functionality\n\n**User Experience Flow**:\n- Users drop `tasks_projectname.json` files into tasks directory\n- Tags become immediately available via `task-master use-tag projectname`\n- No manual import commands or configuration required\n- External tags appear in tag listings alongside main tags\n\n**Benefits Over Manual Import**:\n- Zero-friction workflow for adding new task contexts\n- Supports team collaboration through shared task template files\n- Enables multi-project task management without cluttering main tasks.json\n- Maintains clean separation between permanent tasks and temporary project contexts\n\n\n**Tag Preservation Bug Fix Testing**\n\nConducted testing to verify the fix for the tag preservation bug where tag structures were being lost during operations. The fix ensures that:\n\n- Tag hierarchies and relationships are maintained during file discovery operations\n- External tag files preserve their internal structure when accessed through the silent discovery mechanism\n- Main tasks.json tag integrity is protected during external file scanning\n- Tag metadata and associations remain intact across read operations\n- No data corruption occurs when switching between main and external tag contexts\n\nTesting confirmed that tag structures now persist correctly without loss of organizational data or task relationships within tagged contexts.\n\n\n**MCP Server Update-Subtask Tool Testing**\n\nPerformed testing of the MCP server's update-subtask tool to verify it maintains tag structure integrity during subtask modifications. The test confirms that:\n\n- Tag hierarchies remain intact when subtasks are updated through the MCP interface\n- External tag file references are preserved during update operations\n- Silent discovery mechanism continues to function correctly after subtask modifications\n- No tag disappearance occurs when using the MCP server tools for task management\n- Tag preservation fixes remain effective across different update pathways including MCP server operations\n\nThis validates that the tag structure preservation improvements work consistently across both direct CLI operations and MCP server-mediated task updates.\n\n\n**IMPLEMENTATION STARTED - External File Discovery System**\n\n**Current Progress:**\n- βœ… Analyzed existing tag management architecture\n- βœ… Identified integration points in `readJSON`, `tags()`, and tag resolution logic\n- βœ… Confirmed file naming convention: `tasks_[tagname].json` pattern\n- πŸ”„ **STARTING**: Implementation of core external file discovery functions\n\n**Implementation Plan:**\n1. **Create External File Discovery Functions** in `utils.js`:\n - `scanForExternalTaskFiles(projectRoot)` - Scan tasks directory for `tasks_*.json` files\n - `getExternalTagsFromFiles(projectRoot)` - Extract tag names from external files\n - `readExternalTagData(projectRoot, tagName)` - Read specific external tag data\n - `getAvailableTags(projectRoot)` - Enhanced to include both main + external tags\n\n2. **Enhance Tag Resolution Logic** in `readJSON`:\n - Add fallback to external files when tag not found in main tasks.json\n - Maintain precedence: main tasks.json tags override external files\n - Preserve read-only access for external tags\n\n3. **Update `tags()` Function** in `tag-management.js`:\n - Display external tags with `[ext]` indicator\n - Show external tag metadata and task counts\n - Maintain current tag highlighting and sorting\n\n4. **Integration Points**:\n - `readJSON()` - Add external file fallback in tag resolution\n - `tags()` - Include external tags in listing\n - `useTag()` - Support switching to external tags\n - All tag operations maintain read-only access for external tags\n\n**Next Step:** Implementing external file discovery functions in utils.js\n\n\n**IMPLEMENTATION PROGRESS UPDATE - External File Discovery System**\n\n**Current Status:**\n- βœ… Analyzed existing tag management architecture\n- βœ… Identified integration points in `readJSON`, `tags()`, and tag resolution logic\n- βœ… Confirmed file naming convention: `tasks_[tagname].json` pattern\n- πŸ”„ **IN PROGRESS**: Implementation of core external file discovery functions\n\n**Updated Implementation Plan:**\n1. **Create External File Discovery Functions** in `utils.js`:\n - `scanForExternalTaskFiles(projectRoot)` - Scan tasks directory for `tasks_*.json` files\n - `getExternalTagsFromFiles(projectRoot)` - Extract tag names from external files\n - `readExternalTagData(projectRoot, tagName)` - Read specific external tag data\n - `getAvailableTags(projectRoot)` - Enhanced to include both main + external tags\n\n2. **Enhance Tag Resolution Logic** in `readJSON`:\n - Add fallback to external files when tag not found in main tasks.json\n - Maintain precedence: main tasks.json tags override external files\n - Preserve read-only access for external tags\n\n3. **Update `tags()` Function** in `tag-management.js`:\n - Display external tags with `(imported)` indicator *(updated from [ext])*\n - Show external tag metadata and task counts\n - Maintain current tag highlighting and sorting\n\n4. **Integration Points**:\n - `readJSON()` - Add external file fallback in tag resolution\n - `tags()` - Include external tags in listing with `(imported)` suffix\n - `useTag()` - Support switching to external tags\n - All tag operations maintain read-only access for external tags\n\n**Visual Indicator Change:**\n- **Previous**: External tags shown with `[ext]` suffix\n- **Updated**: External tags shown with `(imported)` suffix for better UX\n\n**Next Step:** Continuing implementation of external file discovery functions in utils.js\n\n\n**IMPLEMENTATION SIZE ASSESSMENT - External File Discovery System**\n\n**Scope: Moderate Implementation (~150-200 lines total)**\n\n**Core Functions to Add (4-5 functions in utils.js):**\n1. `scanForExternalTaskFiles(projectRoot)` - ~20-30 lines\n - Use fs.readdirSync to scan tasks directory\n - Filter for `tasks_*.json` pattern using regex\n - Return array of discovered external files\n\n2. `getExternalTagsFromFiles(projectRoot)` - ~15-20 lines \n - Call scanForExternalTaskFiles()\n - Extract tag names from filenames using regex\n - Return array of external tag names\n\n3. `readExternalTagData(projectRoot, tagName)` - ~25-35 lines\n - Construct external file path: `tasks/tasks_${tagName}.json`\n - Read and parse JSON with error handling\n - Return tag data or null if not found/invalid\n\n4. `getAvailableTags(projectRoot)` - ~20-30 lines\n - Get main tags from existing readJSON logic\n - Get external tags from getExternalTagsFromFiles()\n - Merge and deduplicate, prioritizing main tags\n - Return combined tag list with metadata\n\n**Integration Points (3 main areas):**\n1. **Enhance `readJSON()` function** - Add ~15-20 lines\n - Add external file fallback when tag not found in main tasks.json\n - Maintain precedence: main tasks.json > external files\n - Preserve existing error handling patterns\n\n2. **Update `tags()` function** in tag-management.js - Modify ~10-15 lines\n - Use enhanced getAvailableTags() instead of current logic\n - Display external tags with `(imported)` indicator\n - Show external tag metadata and task counts\n - Maintain current tag highlighting and sorting\n\n3. **Update `useTag()` function** in tag-management.js - Modify ~5-10 lines\n - Allow switching to external tags (read-only mode)\n - Update state.json with external tag context\n - Display appropriate warnings for read-only external tags\n\n**Testing Requirements:**\n- Create test external files: `tasks_feature-branch.json`, `tasks_v2.json`\n- Test tag listing with mixed main/external tags\n- Test tag switching to external tags\n- Test read-only behavior for external tags\n- Test precedence when same tag exists in both main and external\n\n**Total Estimated Lines: ~150-200 lines**\n**Estimated Time: 45-60 minutes**\n**Complexity: Moderate - mostly file I/O and data merging logic**\n", - "status": "deferred", + "status": "done", "dependencies": [], "parentTaskId": 103 }, @@ -6557,10 +6507,8 @@ { "id": 104, "title": "Implement 'scope-up' and 'scope-down' CLI Commands for Dynamic Task Complexity Adjustment", - "description": "Add new CLI commands 'scope-up' and 'scope-down' to enable users to dynamically increase or decrease the complexity of tasks or subtasks, with support for multiple IDs, strength levels, and milestone-aware adjustments.", - "details": "1. Extend the CLI (commands.js) to introduce 'scope-up' and 'scope-down' commands, following established subcommand patterns for consistency and discoverability. \n2. Accept comma-separated task/subtask IDs and an optional '--strength' flag (light|regular|heavy, defaulting to regular). Validate all inputs, ensuring referenced tasks/subtasks exist and strength is valid.\n3. Fetch current task details and associated milestone context to inform the adjustment logic.\n4. Implement core logic functions that:\n - Construct context-aware AI prompts for scaling complexity up or down, leveraging the current state, project phase, and strength parameter.\n - Call the unified AI service (ai-services-unified.js) to generate new task/subtask content at the desired complexity level.\n - Replace existing task details and subtasks with the AI-generated output, preserving historical versions for rollback/comparison.\n - Ensure task dependency integrity and update tasks.json and related files accordingly.\n5. Integrate robust error handling for invalid IDs, parameters, or AI failures, and provide clear CLI output showing before/after differences.\n6. Add corresponding MCP tool equivalents for integrated environments and update documentation/help text to reflect new commands and usage patterns.\n7. Ensure compatibility with batch operations, milestone-based guidelines, and existing task management workflows.", - "testStrategy": "- Write unit and integration tests for both 'scope-up' and 'scope-down' commands, covering single and multiple ID scenarios, all strength levels, and edge cases (e.g., non-existent IDs, invalid strength values).\n- Simulate CLI usage to verify correct parsing, validation, and error handling.\n- Test AI prompt construction and output integration, ensuring that task complexity is adjusted as expected for each strength level and milestone context.\n- Verify that historical data is preserved and that before/after summaries are accurate and clear.\n- Confirm that task dependencies remain intact and that batch operations work as intended.\n- Validate MCP tool integration and documentation updates.", - "status": "pending", + "description": "Add new CLI commands 'scope-up' and 'scope-down' to enable users to dynamically increase or decrease the complexity of tasks or subtasks, with support for multiple IDs, strength levels, milestone-aware adjustments, and custom prompts for targeted modifications.", + "status": "done", "dependencies": [ 3, 11, @@ -6568,22 +6516,68 @@ 94 ], "priority": "high", + "details": "1. Extend the CLI (commands.js) to introduce 'scope-up' and 'scope-down' commands, following established subcommand patterns for consistency and discoverability. \n2. Accept comma-separated task/subtask IDs and an optional '--strength' flag (light|regular|heavy, defaulting to regular). Validate all inputs, ensuring referenced tasks/subtasks exist and strength is valid.\n3. Implement a '--prompt' flag that allows users to specify custom instructions for how to scope up/down tasks, including targeting specific parts of tasks/subtasks (e.g., removing unnecessary test sections, focusing on particular implementation aspects).\n4. Fetch current task details and associated milestone context to inform the adjustment logic.\n5. Implement core logic functions that:\n - Construct context-aware AI prompts for scaling complexity up or down, leveraging the current state, project phase, strength parameter, and any user-provided custom prompt.\n - Call the unified AI service (ai-services-unified.js) to generate new task/subtask content at the desired complexity level.\n - Replace existing task details and subtasks with the AI-generated output, preserving historical versions for rollback/comparison.\n - Ensure task dependency integrity and update tasks.json and related files accordingly.\n6. Integrate robust error handling for invalid IDs, parameters, or AI failures, and provide clear CLI output showing before/after differences.\n7. Add corresponding MCP tool equivalents for integrated environments and update documentation/help text to reflect new commands and usage patterns.\n8. Ensure compatibility with batch operations, milestone-based guidelines, and existing task management workflows.", + "testStrategy": "- Write unit and integration tests for both 'scope-up' and 'scope-down' commands, covering single and multiple ID scenarios, all strength levels, custom prompts, and edge cases (e.g., non-existent IDs, invalid strength values).\n- Test various custom prompt scenarios, including prompts that target specific sections of tasks/subtasks for modification.\n- Simulate CLI usage to verify correct parsing, validation, and error handling.\n- Test AI prompt construction and output integration, ensuring that task complexity is adjusted as expected for each strength level, milestone context, and custom prompt.\n- Verify that historical data is preserved and that before/after summaries are accurate and clear.\n- Confirm that task dependencies remain intact and that batch operations work as intended.\n- Validate MCP tool integration and documentation updates.", "subtasks": [ { - "id": 2, - "title": "Set up Authentication System and User Management Backend", - "description": "Implement the complete authentication infrastructure including user registration, login, password reset, and session management with database schema and API endpoints.", + "id": 1, + "title": "Extend CLI with scope-up and scope-down commands", + "description": "Implement the basic command structure for scope-up and scope-down in commands.js, following established patterns and adding appropriate help text. [Updated: 2025-08-01]", "dependencies": [], - "details": "Create user database schema with fields for id, email, password_hash, name, bio, avatar_url, created_at, updated_at. Implement JWT-based authentication with refresh tokens. Set up API endpoints for /auth/register, /auth/login, /auth/logout, /auth/refresh, /auth/forgot-password, /auth/reset-password, /auth/verify-email. Include password hashing with bcrypt, email verification system, and role-based access control with user roles (admin, user). Implement middleware for route protection and session validation.", - "status": "pending", - "testStrategy": "Unit tests for authentication functions, integration tests for auth API endpoints, test password reset flow, verify JWT token generation and validation" + "details": "1. Add new command definitions in commands.js for 'scope-up' and 'scope-down'\n2. Implement command argument parsing for comma-separated task/subtask IDs\n3. Add the '--strength' flag with validation for 'light', 'regular', and 'heavy' options (default to 'regular')\n4. Add the '--prompt' flag for custom scoping instructions\n5. Create help text and usage examples for both commands\n6. Ensure commands follow the established pattern of other Task Master commands\n7. Implement basic input validation (checking if IDs exist, strength values are valid)\n\nTDD Progress Update:\n\n1. Completed test setup:\n - Fixed test file to use ES module imports instead of CommonJS require\n - Jest watch mode is running and showing failing tests as expected\n\n2. Implemented comprehensive test coverage for scope adjustment functionality:\n - Tests for scopeUpTask and scopeDownTask core functions\n - Strength level validation (light/regular/heavy)\n - Custom prompt handling\n - Multiple task ID processing\n - AI service integration testing\n\n3. Current test status:\n - All 5 tests are failing as expected (function modules don't exist yet)\n - Ready to implement core logic to make tests pass\n - Following TDD red-green-refactor cycle\n\n4. Next implementation step:\n - Creating scripts/modules/task-manager/scope-adjustment.js with core functions to make tests pass\n\n\nTesting the subtask note feature from the kanban board. This is a simple test to verify that notes can be added directly from the kanban view. The feature appears to be working as expected.\n", + "status": "done", + "testStrategy": "Write unit tests for command registration, argument parsing, and input validation. Test with various combinations of valid and invalid inputs including non-existent task IDs, invalid strength values, and empty inputs." + }, + { + "id": 2, + "title": "Implement task/subtask retrieval and context gathering", + "description": "Create functions to retrieve task/subtask details and gather relevant context information needed for complexity adjustment.", + "dependencies": [ + "104.1" + ], + "details": "1. Implement a function to fetch task and subtask details by ID from tasks.json\n2. Create a function to gather milestone context for the specified tasks\n3. Implement validation to ensure all specified IDs exist and are valid\n4. Add error handling for missing or invalid tasks/subtasks\n5. Create a data structure to hold the original task state for later comparison\n6. Implement functions to determine if an ID refers to a task or subtask\n7. Add support for handling multiple IDs in a single command execution", + "status": "done", + "testStrategy": "Test task and subtask retrieval with various ID formats. Verify correct handling of both task and subtask IDs. Test error cases like non-existent IDs and malformed ID strings." + }, + { + "id": 3, + "title": "Develop core complexity adjustment logic", + "description": "Implement the core functions that construct AI prompts and process responses to adjust task complexity up or down.", + "dependencies": [ + "104.2" + ], + "details": "1. Create separate handler functions for scope-up and scope-down operations\n2. Implement prompt construction logic that incorporates:\n - Current task/subtask details\n - Milestone context\n - Strength parameter (light/regular/heavy)\n - User-provided custom prompt\n3. Add integration with ai-services-unified.js to generate new content\n4. Implement response parsing to extract updated task details\n5. Create utility functions to determine how much to increase/decrease complexity based on strength\n6. Add special handling for different task components (description, implementation details, test strategy)", + "status": "done", + "testStrategy": "Test prompt construction with various inputs and strength levels. Mock AI service responses to test parsing logic. Verify that different strength levels produce appropriately scaled adjustments." + }, + { + "id": 4, + "title": "Implement task update and persistence logic", + "description": "Create functions to update tasks/subtasks with new content while preserving integrity and handling dependencies.", + "dependencies": [ + "104.3" + ], + "details": "1. Implement functions to update task and subtask objects with new content\n2. Create logic to preserve task dependency integrity during updates\n3. Add version history tracking to store previous versions of tasks\n4. Implement file writing functions to persist changes to tasks.json\n5. Add validation to ensure updated tasks maintain required fields and format\n6. Implement rollback capability in case of errors\n7. Create utility functions to display before/after differences in the CLI\n8. Add support for batch updates when multiple IDs are provided", + "status": "done", + "testStrategy": "Test task updates with various scenarios including single tasks, subtasks, and multiple items. Verify that dependencies remain intact after updates. Test rollback functionality by simulating errors during the update process." + }, + { + "id": 5, + "title": "Integrate with MCP tool and add comprehensive error handling", + "description": "Add MCP tool equivalents for the new commands and implement robust error handling throughout the implementation.", + "dependencies": [ + "104.4" + ], + "details": "1. Create MCP tool equivalents for scope-up and scope-down commands\n2. Implement comprehensive error handling for all potential failure points:\n - Network errors during AI service calls\n - Invalid task/subtask IDs\n - Malformed AI responses\n - File system errors\n3. Add clear user feedback with colorized output showing differences\n4. Implement progress indicators for longer operations\n5. Update documentation to include the new commands\n6. Add examples of common usage patterns to help text\n7. Ensure compatibility with existing task management workflows\n8. Add logging integration using the existing logging system\n\nMCP Integration Complete:\n\nβœ… **Direct Functions Created:**\n- Created `mcp-server/src/core/direct-functions/scope-up.js` - Direct function wrapper for scope-up functionality\n- Created `mcp-server/src/core/direct-functions/scope-down.js` - Direct function wrapper for scope-down functionality\n- Both follow the exact same pattern as add-task direct function with proper error handling and silent mode\n\nβœ… **MCP Tools Created:**\n- Created `mcp-server/src/tools/scope-up.js` - MCP tool for scope_up_task \n- Created `mcp-server/src/tools/scope-down.js` - MCP tool for scope_down_task\n- Both follow the exact same pattern as add-task tool with proper Zod schema validation\n\nβœ… **Integration Updates:**\n- Added imports and exports to `mcp-server/src/core/task-master-core.js` for both direct functions\n- Added imports and registrations to `mcp-server/src/tools/index.js` in Group 5: Task Creation & Modification\n- Tools will be available as `mcp_task-master-ai_scope_up_task` and `mcp_task-master-ai_scope_down_task` after MCP server restart\n\nβœ… **Tool Parameters:**\n- `id`: Comma-separated list of task IDs (required)\n- `strength`: light/regular/heavy (optional, defaults to regular) \n- `prompt`: Custom scoping instructions (optional)\n- `file`: Path to tasks.json (optional, auto-detected)\n- `projectRoot`: Absolute project path (required)\n- `tag`: Tag context (optional, uses current tag)\n- `research`: Enable research mode (optional, defaults to false)\n\nβœ… **Error Handling:**\n- Comprehensive error handling for missing parameters, invalid task IDs, AI failures\n- Structured error responses with appropriate error codes\n- Silent mode handling to prevent CLI output interference\n\n**Status**: MCP integration complete. Requires MCP server restart for new tools to become available.\n", + "status": "done", + "testStrategy": "Test error handling by simulating various failure conditions. Verify that appropriate error messages are displayed. Test MCP tool integration and ensure consistent behavior between CLI and MCP interfaces. Perform end-to-end testing with real tasks to verify the complete workflow." } ] } ], "metadata": { "created": "2025-06-13T23:52:56.848Z", - "updated": "2025-06-14T15:19:05.130Z", + "updated": "2025-08-02T14:13:14.826Z", "description": "Main tag for the taskmaster project" } }, diff --git a/CHANGELOG.md b/CHANGELOG.md index 36d6c632..d32390f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,95 @@ # task-master-ai +## 0.23.0-rc.2 + +### Minor Changes + +- [#1064](https://github.com/eyaltoledano/claude-task-master/pull/1064) [`53903f1`](https://github.com/eyaltoledano/claude-task-master/commit/53903f1e8eee23ac512eb13a6d81d8cbcfe658cb) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Add new `scope-up` and `scope-down` commands for dynamic task complexity adjustment + + This release introduces two powerful new commands that allow you to dynamically adjust the complexity of your tasks and subtasks without recreating them from scratch. + + **New CLI Commands:** + - `task-master scope-up` - Increase task complexity (add more detail, requirements, or implementation steps) + - `task-master scope-down` - Decrease task complexity (simplify, remove unnecessary details, or streamline) + + **Key Features:** + - **Multiple tasks**: Support comma-separated IDs to adjust multiple tasks at once (`--id=5,7,12`) + - **Strength levels**: Choose adjustment intensity with `--strength=light|regular|heavy` (defaults to regular) + - **Custom prompts**: Use `--prompt` flag to specify exactly how you want tasks adjusted + - **MCP integration**: Available as `scope_up_task` and `scope_down_task` tools in Cursor and other MCP environments + - **Smart context**: AI considers your project context and task dependencies when making adjustments + + **Usage Examples:** + + ```bash + # Make a task more detailed + task-master scope-up --id=5 + + # Simplify multiple tasks with light touch + task-master scope-down --id=10,11,12 --strength=light + + # Custom adjustment with specific instructions + task-master scope-up --id=7 --prompt="Add more error handling and edge cases" + ``` + + **Why use this?** + - **Iterative refinement**: Adjust task complexity as your understanding evolves + - **Project phase adaptation**: Scale tasks up for implementation, down for planning + - **Team coordination**: Adjust complexity based on team member experience levels + - **Milestone alignment**: Fine-tune tasks to match project phase requirements + + Perfect for agile workflows where task requirements change as you learn more about the problem space. + +## 0.22.1-rc.1 + +### Patch Changes + +- [#1069](https://github.com/eyaltoledano/claude-task-master/pull/1069) [`72ca68e`](https://github.com/eyaltoledano/claude-task-master/commit/72ca68edeb870ff7a3b0d2d632e09dae921dc16a) Thanks [@eyaltoledano](https://github.com/eyaltoledano)! - Add new `scope-up` and `scope-down` commands for dynamic task complexity adjustment + + This release introduces two powerful new commands that allow you to dynamically adjust the complexity of your tasks and subtasks without recreating them from scratch. + + **New CLI Commands:** + - `task-master scope-up` - Increase task complexity (add more detail, requirements, or implementation steps) + - `task-master scope-down` - Decrease task complexity (simplify, remove unnecessary details, or streamline) + + **Key Features:** + - **Multiple tasks**: Support comma-separated IDs to adjust multiple tasks at once (`--id=5,7,12`) + - **Strength levels**: Choose adjustment intensity with `--strength=light|regular|heavy` (defaults to regular) + - **Custom prompts**: Use `--prompt` flag to specify exactly how you want tasks adjusted + - **MCP integration**: Available as `scope_up_task` and `scope_down_task` tools in Cursor and other MCP environments + - **Smart context**: AI considers your project context and task dependencies when making adjustments + + **Usage Examples:** + + ```bash + # Make a task more detailed + task-master scope-up --id=5 + + # Simplify multiple tasks with light touch + task-master scope-down --id=10,11,12 --strength=light + + # Custom adjustment with specific instructions + task-master scope-up --id=7 --prompt="Add more error handling and edge cases" + ``` + + **Why use this?** + - **Iterative refinement**: Adjust task complexity as your understanding evolves + - **Project phase adaptation**: Scale tasks up for implementation, down for planning + - **Team coordination**: Adjust complexity based on team member experience levels + - **Milestone alignment**: Fine-tune tasks to match project phase requirements + + Perfect for agile workflows where task requirements change as you learn more about the problem space. + +## 0.22.1-rc.0 + +### Patch Changes + +- [#1063](https://github.com/eyaltoledano/claude-task-master/pull/1063) [`2ae6e7e`](https://github.com/eyaltoledano/claude-task-master/commit/2ae6e7e6be3605c3c4d353f34666e54750dba973) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - Fix for tasks not found when using string IDs + +- [#1049](https://github.com/eyaltoledano/claude-task-master/pull/1049) [`45a14c3`](https://github.com/eyaltoledano/claude-task-master/commit/45a14c323d21071c15106335e89ad1f4a20976ab) Thanks [@ben-vargas](https://github.com/ben-vargas)! - Fix tag-specific complexity report detection in expand command + + The expand command now correctly finds and uses tag-specific complexity reports (e.g., `task-complexity-report_feature-xyz.json`) when operating in a tag context. Previously, it would always look for the generic `task-complexity-report.json` file due to a default value in the CLI option definition. + ## 0.22.0 ### Minor Changes diff --git a/apps/extension/.vscodeignore b/apps/extension/.vscodeignore new file mode 100644 index 00000000..0f5259ef --- /dev/null +++ b/apps/extension/.vscodeignore @@ -0,0 +1,25 @@ +# Ignore everything by default +* + +# Only include specific essential files +!package.json +!README.md +!CHANGELOG.md +!LICENSE +!icon.png +!assets/** + +# Include only the built files we need (not source maps) +!dist/extension.js +!dist/index.js +!dist/index.css + +# Exclude development documentation +docs/extension-CI-setup.md +docs/extension-DEV-guide.md + +# Exclude +assets/.DS_Store +assets/banner.png + + diff --git a/apps/extension/CHANGELOG.md b/apps/extension/CHANGELOG.md new file mode 100644 index 00000000..363c6786 --- /dev/null +++ b/apps/extension/CHANGELOG.md @@ -0,0 +1,87 @@ +# Change Log + +## 0.23.0-rc.1 + +### Minor Changes + +- [#1064](https://github.com/eyaltoledano/claude-task-master/pull/1064) [`b82d858`](https://github.com/eyaltoledano/claude-task-master/commit/b82d858f81a1e702ad59d84d5ae8a2ca84359a83) Thanks [@Crunchyman-ralph](https://github.com/Crunchyman-ralph)! - πŸŽ‰ **Introducing TaskMaster Extension!** + + We're thrilled to launch the first version of our Code extension, bringing the power of TaskMaster directly into your favorite code editor. While this is our initial release and we've kept things focused, it already packs powerful features to supercharge your development workflow. + + ## ✨ Key Features + + ### πŸ“‹ Visual Task Management + - **Kanban Board View**: Visualize all your tasks in an intuitive board layout directly in VS Code + - **Drag & Drop**: Easily change task status by dragging cards between columns + - **Real-time Updates**: See changes instantly as you work through your project + + ### 🏷️ Multi-Context Support + - **Tag Switching**: Seamlessly switch between different project contexts/tags + - **Isolated Workflows**: Keep different features or experiments organized separately + + ### πŸ€– AI-Powered Task Updates + - **Smart Updates**: Use TaskMaster's AI capabilities to update tasks and subtasks + - **Context-Aware**: Leverages your existing TaskMaster configuration and models + + ### πŸ“Š Rich Task Information + - **Complexity Scores**: See task complexity ratings at a glance + - **Subtask Visualization**: Expand tasks to view and manage subtasks + - **Dependency Graphs**: Understand task relationships and dependencies visually + + ### βš™οΈ Configuration Management + - **Visual Config Editor**: View and understand your `.taskmaster/config.json` settings + - **Easy Access**: No more manual JSON editing for common configuration tasks + + ### πŸš€ Quick Actions + - **Status Updates**: Change task status with a single click + - **Task Details**: Access full task information without leaving VS Code + - **Integrated Commands**: All TaskMaster commands available through the command palette + + ## 🎯 What's Next? + + This is just the beginning! We wanted to get a solid foundation into your hands quickly. The extension will evolve rapidly with your feedback, adding more advanced features, better visualizations, and deeper integration with your development workflow. + + Thank you for being part of the TaskMaster journey. Your workflow has never looked better! πŸš€ + +## 0.23.0-rc.0 + +### Minor Changes + +- [#997](https://github.com/eyaltoledano/claude-task-master/pull/997) [`64302dc`](https://github.com/eyaltoledano/claude-task-master/commit/64302dc1918f673fcdac05b29411bf76ffe93505) Thanks [@DavidMaliglowka](https://github.com/DavidMaliglowka)! - πŸŽ‰ **Introducing TaskMaster Extension!** + + We're thrilled to launch the first version of our Code extension, bringing the power of TaskMaster directly into your favorite code editor. While this is our initial release and we've kept things focused, it already packs powerful features to supercharge your development workflow. + + ## ✨ Key Features + + ### πŸ“‹ Visual Task Management + - **Kanban Board View**: Visualize all your tasks in an intuitive board layout directly in VS Code + - **Drag & Drop**: Easily change task status by dragging cards between columns + - **Real-time Updates**: See changes instantly as you work through your project + + ### 🏷️ Multi-Context Support + - **Tag Switching**: Seamlessly switch between different project contexts/tags + - **Isolated Workflows**: Keep different features or experiments organized separately + + ### πŸ€– AI-Powered Task Updates + - **Smart Updates**: Use TaskMaster's AI capabilities to update tasks and subtasks + - **Context-Aware**: Leverages your existing TaskMaster configuration and models + + ### πŸ“Š Rich Task Information + - **Complexity Scores**: See task complexity ratings at a glance + - **Subtask Visualization**: Expand tasks to view and manage subtasks + - **Dependency Graphs**: Understand task relationships and dependencies visually + + ### βš™οΈ Configuration Management + - **Visual Config Editor**: View and understand your `.taskmaster/config.json` settings + - **Easy Access**: No more manual JSON editing for common configuration tasks + + ### πŸš€ Quick Actions + - **Status Updates**: Change task status with a single click + - **Task Details**: Access full task information without leaving VS Code + - **Integrated Commands**: All TaskMaster commands available through the command palette + + ## 🎯 What's Next? + + This is just the beginning! We wanted to get a solid foundation into your hands quickly. The extension will evolve rapidly with your feedback, adding more advanced features, better visualizations, and deeper integration with your development workflow. + + Thank you for being part of the TaskMaster journey. Your workflow has never looked better! πŸš€ diff --git a/apps/extension/LICENSE b/apps/extension/LICENSE new file mode 100644 index 00000000..08eb5897 --- /dev/null +++ b/apps/extension/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 David Maliglowka + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/apps/extension/README.md b/apps/extension/README.md new file mode 100644 index 00000000..faed730c --- /dev/null +++ b/apps/extension/README.md @@ -0,0 +1,204 @@ +# Official Taskmaster AI Extension + +Transform your AI-driven development workflow with a beautiful, interactive Kanban board directly in VS Code. Seamlessly manage tasks from [Taskmaster AI](https://github.com/eyaltoledano/claude-task-master) projects with real-time synchronization and intelligent task management. + +![Taskmaster AI Extension](https://img.shields.io/badge/VS%20Code-Extension-blue) +![License](https://img.shields.io/badge/License-MIT-green) +![Version](https://img.shields.io/visual-studio-marketplace/v/Hamster.task-master-hamster) +![Installs](https://img.shields.io/visual-studio-marketplace/i/Hamster.task-master-hamster) + +## 🎯 What is Taskmaster AI? + +Taskmaster AI is an intelligent task management system designed for AI-assisted development. It helps you break down complex projects into manageable tasks, track progress, and leverage AI to enhance your development workflow. + +## ✨ Key Features + +### πŸ“Š **Interactive Kanban Board** +- **Drag & Drop Interface** - Effortlessly move tasks between status columns +- **Real-time Sync** - Changes instantly reflect in your Taskmaster project files +- **Multiple Views** - Board view and detailed task sidebar +- **Smart Columns** - Pending, In Progress, Review, Done, Deferred, and Cancelled + +![Kanban Board](assets/screenshots/kanban-board.png) + +### πŸ€– **AI-Powered Features** +- **Task Content Generation** - Regenerate task descriptions using AI +- **Smart Task Updates** - Append findings and progress notes automatically +- **MCP Integration** - Seamless connection to Taskmaster AI via Model Context Protocol +- **Intelligent Caching** - Smart performance optimization with background refresh + +![Task Details](assets/screenshots/task-details.png) + +### πŸš€ **Performance & Usability** +- **Offline Support** - Continue working even when disconnected +- **Auto-refresh** - Automatic polling for task changes with smart frequency +- **VS Code Native** - Perfectly integrated with VS Code themes and UI +- **Modern Interface** - Built with ShadCN UI components and Tailwind CSS + +## πŸ› οΈ Installation + +### Prerequisites + +1. **VS Code** 1.90.0 or higher +2. **Node.js** 18.0 or higher (for Taskmaster MCP server) + +### Install the Extension + +1. **From VS Code Marketplace:** + - Click the **Install** button above + - The extension will be automatically added to your VS Code instance + +## πŸš€ Quick Start + +### 1. **Initialize Taskmaster Project** +If you don't have a Taskmaster project yet: +```bash +cd your-project +npm i -g task-master-ai + task-master init + ``` + +### 2. **Open Kanban Board** +- **Command Palette** (Ctrl+Shift+P): `Taskmaster Kanban: Show Board` +- **Or** the extension automatically activates when you have a `.taskmaster` folder in your workspace + +### 3. **MCP Server Setup** +The extension automatically handles the Taskmaster MCP server connection: +- **No manual installation required** - The extension spawns the MCP server automatically +- **Uses npx by default** - Automatically downloads Taskmaster AI when needed +- **Configurable** - You can customize the MCP server command in settings if needed + +### 4. **Start Managing Tasks** +- **Drag tasks** between columns to change status +- **Click tasks** to view detailed information +- **Use AI features** to enhance task content +- **Add subtasks** with the + button on parent tasks + +## πŸ“‹ Usage Guide + +### Task Management + +| Action | How to Do It | +|--------|--------------| +| **View Kanban Board** | `Ctrl/Cmd + Shift + P` β†’ "Taskmaster: Show Board" | +| **Change Task Status** | Drag task card to different column | +| **View Task Details** | Click on any task card | +| **Edit Task Content** | Click task β†’ Use edit buttons in details panel | +| **Add Subtasks** | Click the + button on parent task cards | +| **Use AI Features** | Open task details β†’ Click AI action buttons | + +### Understanding Task Statuses + +- πŸ“‹ **Pending** - Tasks ready to be started +- πŸš€ **In Progress** - Currently being worked on +- πŸ‘€ **Review** - Awaiting review or feedback +- βœ… **Done** - Completed tasks +- ⏸️ **Deferred** - Postponed for later + +### **AI-Powered Task Management** + +The extension integrates seamlessly with Taskmaster AI via MCP to provide: +- **Smart Task Generation** - AI creates detailed implementation plans +- **Progress Tracking** - Append timestamped notes and findings +- **Content Enhancement** - Regenerate task descriptions for clarity +- **Research Integration** - Get up-to-date information for your tasks + +## βš™οΈ Configuration + +Access settings via **File β†’ Preferences β†’ Settings** and search for "Taskmaster": + +### **MCP Connection Settings** +- **MCP Server Command** - Path to task-master-ai executable (default: `npx`) +- **MCP Server Args** - Arguments for the server command (default: `-y`, `--package=task-master-ai`, `task-master-ai`) +- **Connection Timeout** - Server response timeout (default: 30s) +- **Auto Refresh** - Enable automatic task updates (default: enabled) + +### **UI Preferences** +- **Theme** - Auto, Light, or Dark mode +- **Show Completed Tasks** - Display done tasks in board (default: enabled) +- **Task Display Limit** - Maximum tasks to show (default: 100) + +### **Performance Options** +- **Cache Duration** - How long to cache task data (default: 5s) +- **Concurrent Requests** - Max simultaneous API calls (default: 5) + +## πŸ”§ Troubleshooting + +### **Extension Not Loading** +1. Ensure Node.js 18+ is installed +2. Check workspace contains `.taskmaster` folder +3. Restart VS Code +4. Check Output panel (View β†’ Output β†’ Taskmaster Kanban) + +### **MCP Connection Issues** +1. **Command not found**: Ensure Node.js and npx are in your PATH +2. **Timeout errors**: Increase timeout in settings +3. **Permission errors**: Check Node.js permissions +4. **Network issues**: Verify internet connection for npx downloads + +### **Tasks Not Updating** +1. Check MCP connection status in status bar +2. Verify `.taskmaster/tasks/tasks.json` exists +3. Try manual refresh: `Taskmaster Kanban: Check Connection` +4. Review error logs in Output panel + +### **Performance Issues** +1. Reduce task display limit in settings +2. Increase cache duration +3. Disable auto-refresh if needed +4. Close other VS Code extensions temporarily + +## πŸ†˜ Support & Resources + +### **Getting Help** +- πŸ“– **Documentation**: [Taskmaster AI Docs](https://github.com/eyaltoledano/claude-task-master) +- πŸ› **Report Issues**: [GitHub Issues](https://github.com/eyaltoledano/claude-task-master/issues) +- πŸ’¬ **Discussions**: [GitHub Discussions](https://github.com/eyaltoledano/claude-task-master/discussions) +- πŸ› **Report Issues**: [GitHub Issues](https://github.com/eyaltoledano/claude-task-master/issues) + +## 🎯 Tips for Best Results + +### **Project Organization** +- Use descriptive task titles +- Add detailed implementation notes +- Set appropriate task dependencies +- Leverage AI features for complex tasks + +### **Workflow Optimization** +- Review task details before starting work +- Use subtasks for complex features +- Update task status as you progress +- Add findings and learnings to task notes + +### **Collaboration** +- Keep task descriptions updated +- Use consistent status conventions +- Document decisions in task details +- Share knowledge through task notes + +--- + +## πŸ† Why Taskmaster Kanban? + +βœ… **Visual workflow management** for your Taskmaster projects +βœ… **AI-powered task enhancement** built right in +βœ… **Real-time synchronization** keeps everything in sync +βœ… **Native VS Code integration** feels like part of the editor +βœ… **Free and open source** with active development + +**Transform your development workflow today!** πŸš€ + +--- + +*Originally Made with ❀️ by [David Maliglowka](https://x.com/DavidMaliglowka)* + +## Support + +This is an open-source project maintained in my spare time. While I strive to fix bugs and improve the extension, support is provided on a best-effort basis. Feel free to: +- Report issues on [GitHub](https://github.com/eyaltoledano/claude-task-master/issues) +- Submit pull requests with improvements +- Fork the project if you need specific modifications + +## Disclaimer + +This extension is provided "as is" without any warranties. Use at your own risk. The author is not responsible for any issues, data loss, or damages that may occur from using this extension. Please backup your work regularly and test thoroughly before using in important projects. \ No newline at end of file diff --git a/apps/extension/assets/banner.png b/apps/extension/assets/banner.png new file mode 100644 index 00000000..8d215f7d Binary files /dev/null and b/apps/extension/assets/banner.png differ diff --git a/apps/extension/assets/icon-dark.svg b/apps/extension/assets/icon-dark.svg new file mode 100644 index 00000000..f0e17ef4 --- /dev/null +++ b/apps/extension/assets/icon-dark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/apps/extension/assets/icon-light.svg b/apps/extension/assets/icon-light.svg new file mode 100644 index 00000000..07b60c34 --- /dev/null +++ b/apps/extension/assets/icon-light.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/apps/extension/assets/icon.png b/apps/extension/assets/icon.png new file mode 100644 index 00000000..df26f616 Binary files /dev/null and b/apps/extension/assets/icon.png differ diff --git a/apps/extension/assets/screenshots/kanban-board.png b/apps/extension/assets/screenshots/kanban-board.png new file mode 100644 index 00000000..71813e06 Binary files /dev/null and b/apps/extension/assets/screenshots/kanban-board.png differ diff --git a/apps/extension/assets/screenshots/task-details.png b/apps/extension/assets/screenshots/task-details.png new file mode 100644 index 00000000..fe1f9c76 Binary files /dev/null and b/apps/extension/assets/screenshots/task-details.png differ diff --git a/apps/extension/assets/sidebar-icon.svg b/apps/extension/assets/sidebar-icon.svg new file mode 100644 index 00000000..ae5c8395 --- /dev/null +++ b/apps/extension/assets/sidebar-icon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/apps/extension/components.json b/apps/extension/components.json new file mode 100644 index 00000000..b77ea20d --- /dev/null +++ b/apps/extension/components.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "default", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "tailwind.config.js", + "css": "src/webview/index.css", + "baseColor": "slate", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib" + }, + "iconLibrary": "lucide-react" +} diff --git a/apps/extension/docs/extension-CI-setup.md b/apps/extension/docs/extension-CI-setup.md new file mode 100644 index 00000000..8616bd0b --- /dev/null +++ b/apps/extension/docs/extension-CI-setup.md @@ -0,0 +1,222 @@ +# VS Code Extension CI/CD Setup + +This document explains the CI/CD setup for the Task Master VS Code extension using automated changesets. + +## πŸ”„ Workflows Overview + +### 1. Extension CI (`extension-ci.yml`) + +#### Triggers + +- Push to `main` or `next` branches (only when extension files change) +- Pull requests to `main` or `next` (only when extension files change) + +#### What it does + +- βœ… Lints and type-checks the extension code +- πŸ”¨ Builds the extension (`npm run build`) +- πŸ“¦ Creates a clean package (`npm run package`) +- πŸ§ͺ Runs tests with VS Code test framework +- πŸ“‹ Creates a test VSIX package to verify packaging works +- πŸ’Ύ Uploads build artifacts for inspection + +### 2. Version & Publish (`version.yml`) + +**Triggers:** +- Push to `main` branch + +**What it does:** +- πŸ” Detects changeset files for pending releases +- πŸ“ Creates "Version Packages" PR with updated versions and CHANGELOG +- πŸ€– When Version PR is merged, automatically: + - πŸ”¨ Builds and packages the extension + - 🏷️ Creates git tags with changeset automation + - πŸ“€ Publishes to VS Code Marketplace + - 🌍 Publishes to Open VSX Registry + - πŸ“Š Updates package versions and CHANGELOG + +## πŸš€ Changeset Workflow + +### Creating Changes +When making changes to the extension: + +1. **Make your code changes** +2. **Create a changeset**: + ```bash + # From project root + npx changeset add + ``` +3. **Select the extension package**: Choose `taskr-kanban` when prompted +4. **Select version bump type**: + - `patch`: Bug fixes, minor updates + - `minor`: New features, backwards compatible + - `major`: Breaking changes +5. **Write a summary**: Describe what changed for users +6. **Commit changeset file** along with your code changes +7. **Push to feature branch** and create PR + +### Automated Publishing Process +1. **PR with changeset** gets merged to `main` +2. **Version workflow** detects changesets and creates "Version Packages" PR +3. **Review and merge** the Version PR +4. **Automated publishing** happens immediately: + - Extension is built using 3-file packaging system + - VSIX package is created and tested + - Published to VS Code Marketplace (if `VSCE_PAT` is set) + - Published to Open VSX Registry (if `OVSX_PAT` is set) + - Git tags are created: `taskr-kanban@1.0.1` + - CHANGELOG is updated automatically + +## πŸ”‘ Required Secrets + +To use the automated publishing, you need to set up these GitHub repository secrets: + +### `VSCE_PAT` (VS Code Marketplace Personal Access Token) +1. Go to [Azure DevOps](https://dev.azure.com/) +2. Sign in with your Microsoft account +3. Create a Personal Access Token: + - **Name**: VS Code Extension Publishing + - **Organization**: All accessible organizations + - **Expiration**: Custom (recommend 1 year) + - **Scopes**: Custom defined β†’ **Marketplace** β†’ **Manage** +4. Copy the token and add it to GitHub Secrets as `VSCE_PAT` + +### `OVSX_PAT` (Open VSX Registry Personal Access Token) +1. Go to [Open VSX Registry](https://open-vsx.org/) +2. Sign in with your GitHub account +3. Go to your [User Settings](https://open-vsx.org/user-settings/tokens) +4. Create a new Access Token: + - **Description**: VS Code Extension Publishing + - **Scopes**: Leave default (full access) +5. Copy the token and add it to GitHub Secrets as `OVSX_PAT` + +### `GITHUB_TOKEN` (automatically provided) +This is automatically available in GitHub Actions - no setup required. + +## πŸ“‹ Version Management + +### Changeset-Based Versioning +Versions are automatically managed by changesets: + +- **No manual version updates needed** - changesets handle this automatically +- **Semantic versioning** is enforced based on changeset types +- **Changelog generation** happens automatically +- **Git tagging** is handled by the automation + +### Critical Fields Sync +The automation ensures these fields stay in sync between `package.json` and `package.publish.json`: + +```json +{ + "version": "1.0.2", // βœ… AUTO-SYNCED + "publisher": "Hamster", // ⚠️ MUST MATCH MANUALLY + "displayName": "taskr: Task Master Kanban", // ⚠️ MUST MATCH MANUALLY + "description": "...", // ⚠️ MUST MATCH MANUALLY + "engines": { "vscode": "^1.93.0" }, // ⚠️ MUST MATCH MANUALLY + "categories": [...], // ⚠️ MUST MATCH MANUALLY + "contributes": { ... } // ⚠️ MUST MATCH MANUALLY +} +``` + +**Note**: Only `version` is automatically synced. Other fields must be manually kept in sync. + +## πŸ” Monitoring Builds + +### CI Status + +- **Green βœ…**: Extension builds and tests successfully +- **Red ❌**: Build/test failures - check logs for details +- **Yellow 🟑**: Partial success - some jobs may have warnings + +### Version PR Status + +- **Version PR Created**: Changesets detected, review and merge to publish +- **No Version PR**: No changesets found, no releases pending +- **Version PR Merged**: Automated publishing triggered + +### Release Status + +- **Published πŸŽ‰**: Extension live on VS Code Marketplace and Open VSX +- **Skipped ℹ️**: No changesets found, no release needed +- **Failed ❌**: Check logs - often missing secrets or build issues + +### Artifacts + +Workflows upload artifacts that you can download: + +- **CI**: Test results, built files, and VSIX package +- **Version**: Final VSIX package and published extension + +## πŸ› οΈ Troubleshooting + +### Common Issues + +#### No Version PR Created + +- **Check**: Changeset files exist in `.changeset/` directory +- **Check**: Changeset refers to `taskr-kanban` package name +- **Check**: Changes were pushed to `main` branch +- **Solution**: Create changeset with `npx changeset add` + +#### Version PR Not Publishing + +- **Check**: Version PR was actually merged (not just closed) +- **Check**: Required secrets (`VSCE_PAT`, `OVSX_PAT`) are set +- **Check**: No build failures in workflow logs +- **Solution**: Re-run workflow or check secret configuration + +#### `VSCE_PAT` is not set Error + +- Ensure `VSCE_PAT` secret is added to repository +- Check token hasn't expired +- Verify token has Marketplace β†’ Manage permissions + +#### `OVSX_PAT` is not set Error + +- Ensure `OVSX_PAT` secret is added to repository +- Check token hasn't expired +- Verify you're signed in to Open VSX Registry with GitHub + +#### Build Failures + +- Check extension code compiles locally: `cd apps/extension && npm run build` +- Verify tests pass locally: `npm run test` +- Check for TypeScript errors: `npm run check-types` + +#### Packaging Failures + +- Ensure clean package builds: `npm run package` +- Check vsix-build structure is correct +- Verify `package.publish.json` has correct `repository` field + +#### Changeset Issues + +- **Wrong package name**: Ensure changeset refers to `taskr-kanban` +- **Invalid format**: Check changeset markdown format is correct +- **Merge conflicts**: Resolve any conflicts in changeset files + +## πŸ“ File Structure Impact + +The CI workflows respect the 3-file packaging system: +- **Development**: Uses `package.json` for dependencies and scripts +- **Release**: Uses `package.publish.json` for clean marketplace package +- **Build**: Uses `package.mjs` to create `vsix-build/` for final packaging +- **Changesets**: Automatically manage versions across the system + +## 🌍 Dual Registry Publishing + +Your extension will be automatically published to both: +- **VS Code Marketplace** - For official VS Code users +- **Open VSX Registry** - For Cursor, Windsurf, VSCodium, Gitpod, Eclipse Theia, and other compatible editors + +## 🎯 Benefits of Changeset Automation + +- βœ… **Automated versioning**: No manual version bumps needed +- βœ… **Generated changelogs**: Automatic, accurate release notes +- βœ… **Semantic versioning**: Enforced through changeset types +- βœ… **Git tagging**: Proper tags for extension releases +- βœ… **Conflict prevention**: Clear separation of extension vs. main package versions +- βœ… **Review process**: Version changes are reviewable via PR +- βœ… **Rollback capability**: Easy to revert if issues arise + +This ensures clean, predictable, and fully automated publishing to both registries! πŸš€ diff --git a/apps/extension/docs/extension-development-guide.md b/apps/extension/docs/extension-development-guide.md new file mode 100644 index 00000000..df09b5a2 --- /dev/null +++ b/apps/extension/docs/extension-development-guide.md @@ -0,0 +1,256 @@ +# VS Code Extension Development Guide + +## πŸ“ File Structure Overview + +This VS Code extension uses a **3-file packaging system** to avoid dependency conflicts during publishing: + +``` +apps/extension/ +β”œβ”€β”€ package.json # Development configuration +β”œβ”€β”€ package.publish.json # Clean publishing configuration +β”œβ”€β”€ package.mjs # Build script for packaging +β”œβ”€β”€ .vscodeignore # Files to exclude from extension package +└── vsix-build/ # Generated clean package directory +``` + +## πŸ“‹ File Purposes + +### `package.json` (Development) +- **Purpose**: Development environment with all build tools +- **Contains**: + - All `devDependencies` needed for building + - Development scripts (`build`, `watch`, `lint`, etc.) + - Development package name: `"taskr"` +- **Used for**: Local development, building, testing + +### `package.publish.json` (Publishing) +- **Purpose**: Clean distribution version for VS Code Marketplace +- **Contains**: + - **No devDependencies** (avoids dependency conflicts) + - Publishing metadata (`keywords`, `repository`, `categories`) + - Marketplace package name: `"taskr-kanban"` + - VS Code extension configuration +- **Used for**: Final extension packaging + +### `package.mjs` (Build Script) +- **Purpose**: Creates clean package for distribution +- **Process**: + 1. Builds the extension (`build:js` + `build:css`) + 2. Creates clean `vsix-build/` directory + 3. Copies only essential files (no source code) + 4. Renames `package.publish.json` β†’ `package.json` + 5. Ready for `vsce package` + +## πŸš€ Development Workflow + +### Local Development +```bash +# Install dependencies +npm install + +# Start development with hot reload +npm run watch + +# Run just JavaScript build +npm run build:js + +# Run just CSS build +npm run build:css + +# Full production build +npm run build + +# Type checking +npm run check-types + +# Linting +npm run lint +``` + +### Testing in VS Code +1. Press `F5` in VS Code to launch Extension Development Host +2. Test your extension functionality in the new window +3. Use `Developer: Reload Window` to reload after changes + +## πŸ“¦ Production Packaging + +### Step 1: Build Clean Package +```bash +npm run package +``` +This creates `vsix-build/` with clean distribution files. + +### Step 2: Create VSIX +```bash +cd vsix-build +npx vsce package --no-dependencies +``` +Creates: `taskr-kanban-1.0.1.vsix` + +### Alternative: One Command +```bash +npm run package && cd vsix-build && npx vsce package --no-dependencies +``` + +## πŸ”„ Keeping Files in Sync + +### Critical Fields to Sync Between Files + +When updating extension metadata, ensure these fields match between `package.json` and `package.publish.json`: + +#### Version & Identity +```json +{ + "version": "1.0.1", // ⚠️ MUST MATCH + "publisher": "Hamster", // ⚠️ MUST MATCH + "displayName": "taskr: Task Master Kanban", // ⚠️ MUST MATCH + "description": "A visual Kanban board...", // ⚠️ MUST MATCH +} +``` + +#### VS Code Configuration +```json +{ + "engines": { "vscode": "^1.101.0" }, // ⚠️ MUST MATCH + "categories": [...], // ⚠️ MUST MATCH + "activationEvents": [...], // ⚠️ MUST MATCH + "main": "./dist/extension.js", // ⚠️ MUST MATCH + "contributes": { ... } // ⚠️ MUST MATCH EXACTLY +} +``` + +### Key Differences (Should NOT Match) +```json +// package.json (dev) +{ + "name": "taskr", // βœ… Short dev name + "devDependencies": { ... }, // βœ… Only in dev file + "scripts": { ... } // βœ… Build scripts +} + +// package.publish.json (publishing) +{ + "name": "taskr-kanban", // βœ… Marketplace name + "keywords": [...], // βœ… Only in publish file + "repository": "https://github.com/...", // βœ… Only in publish file + // NO devDependencies // βœ… Clean for publishing + // NO build scripts // βœ… Not needed in package +} +``` + +## πŸ€– Automated Release Process + +### Changesets Workflow +This extension uses [Changesets](https://github.com/changesets/changesets) for automated version management and publishing. + +#### Adding Changes +When making changes to the extension: + +1. **Make your code changes** +2. **Create a changeset**: + ```bash + # From project root + npx changeset add + ``` +3. **Select the extension package**: Choose `taskr-kanban` when prompted +4. **Select version bump type**: + - `patch`: Bug fixes, minor updates + - `minor`: New features, backwards compatible + - `major`: Breaking changes +5. **Write a summary**: Describe what changed for users + +#### Automated Publishing +The automation workflow runs on pushes to `main`: + +1. **Version Workflow** (`.github/workflows/version.yml`): + - Detects when changesets exist + - Creates a "Version Packages" PR with updated versions and CHANGELOG + - When the PR is merged, automatically publishes the extension + +2. **Release Process** (`scripts/release.sh`): + - Builds the extension using the 3-file packaging system + - Creates VSIX package + - Publishes to VS Code Marketplace (if `VSCE_PAT` is set) + - Publishes to Open VSX Registry (if `OVSX_PAT` is set) + - Creates git tags for the extension version + +#### Required Secrets +For automated publishing, these secrets must be set in the repository: + +- `VSCE_PAT`: Personal Access Token for VS Code Marketplace +- `OVSX_PAT`: Personal Access Token for Open VSX Registry +- `GITHUB_TOKEN`: Automatically provided by GitHub Actions + +#### Manual Release +If needed, you can manually trigger a release: + +```bash +# From project root +./scripts/release.sh +``` + +### Extension Tagging +The extension uses a separate tagging strategy from the main package: + +- **Extension tags**: `taskr-kanban@1.0.1` +- **Main package tags**: `task-master-ai@2.1.0` + +This allows independent versioning and prevents conflicts in the monorepo. + +## πŸ” Troubleshooting + +### Dependency Conflicts +**Problem**: `vsce package` fails with missing dependencies +**Solution**: Use the 3-file system - never run `vsce package` from root + +### Build Failures +**Problem**: Extension not working after build +**Check**: +1. All files copied to `vsix-build/dist/` +2. `package.publish.json` has correct `main` field +3. VS Code engine version compatibility + +### Sync Issues +**Problem**: Extension works locally but fails when packaged +**Check**: Ensure critical fields are synced between package files + +### Changeset Issues +**Problem**: Version workflow not triggering +**Check**: +1. Changeset files exist in `.changeset/` +2. Package name in changeset matches `package.publish.json` +3. Changes are pushed to `main` branch + +**Problem**: Publishing fails +**Check**: +1. Required secrets are set in repository settings +2. `package.publish.json` has correct repository URL +3. Build process completes successfully + +## πŸ“ Version Release Checklist + +### Manual Releases +1. **Create changeset**: `npx changeset add` +2. **Update critical fields** in both `package.json` and `package.publish.json` +3. **Test locally** with `F5` in VS Code +4. **Commit and push** to trigger automated workflow + +### Automated Releases (Recommended) +1. **Create changeset**: `npx changeset add` +2. **Push to feature branch** and create PR +3. **Merge PR** - this triggers version PR creation +4. **Review and merge version PR** - this triggers automated publishing + +## 🎯 Why This System? + +- **Avoids dependency conflicts**: VS Code doesn't see dev dependencies +- **Clean distribution**: Only essential files in final package +- **Faster packaging**: No dependency resolution during `vsce package` +- **Maintainable**: Clear separation of dev vs. production configs +- **Reliable**: Consistent, conflict-free packaging process +- **Automated**: Changesets handle versioning and publishing automatically +- **Traceable**: Clear changelog and git tags for every release + +--- + +**Remember**: Always use `npx changeset add` for changes, then push to trigger automated releases! πŸš€ diff --git a/apps/extension/esbuild.js b/apps/extension/esbuild.js new file mode 100644 index 00000000..f7d3a880 --- /dev/null +++ b/apps/extension/esbuild.js @@ -0,0 +1,173 @@ +const esbuild = require('esbuild'); +const path = require('path'); + +const production = process.argv.includes('--production'); +const watch = process.argv.includes('--watch'); + +/** + * @type {import('esbuild').Plugin} + */ +const esbuildProblemMatcherPlugin = { + name: 'esbuild-problem-matcher', + + setup(build) { + build.onStart(() => { + console.log('[watch] build started'); + }); + build.onEnd((result) => { + result.errors.forEach(({ text, location }) => { + console.error(`✘ [ERROR] ${text}`); + console.error( + ` ${location.file}:${location.line}:${location.column}:` + ); + }); + console.log('[watch] build finished'); + }); + } +}; + +/** + * @type {import('esbuild').Plugin} + */ +const aliasPlugin = { + name: 'alias', + setup(build) { + // Handle @/ aliases for shadcn/ui + build.onResolve({ filter: /^@\// }, (args) => { + const resolvedPath = path.resolve(__dirname, 'src', args.path.slice(2)); + + // Try to resolve with common TypeScript extensions + const fs = require('fs'); + const extensions = ['.tsx', '.ts', '.jsx', '.js']; + + // Check if it's a file first + for (const ext of extensions) { + const fullPath = resolvedPath + ext; + if (fs.existsSync(fullPath)) { + return { path: fullPath }; + } + } + + // Check if it's a directory with index file + for (const ext of extensions) { + const indexPath = path.join(resolvedPath, 'index' + ext); + if (fs.existsSync(indexPath)) { + return { path: indexPath }; + } + } + + // Fallback to original behavior + return { path: resolvedPath }; + }); + } +}; + +async function main() { + // Build configuration for the VS Code extension + const extensionCtx = await esbuild.context({ + entryPoints: ['src/extension.ts'], + bundle: true, + format: 'cjs', + minify: production, + sourcemap: !production ? 'inline' : false, + sourcesContent: !production, + platform: 'node', + outdir: 'dist', + external: ['vscode'], + logLevel: 'silent', + // Add production optimizations + ...(production && { + drop: ['debugger'], + pure: ['console.log', 'console.debug', 'console.trace'] + }), + plugins: [esbuildProblemMatcherPlugin, aliasPlugin] + }); + + // Build configuration for the React webview + const webviewCtx = await esbuild.context({ + entryPoints: ['src/webview/index.tsx'], + bundle: true, + format: 'iife', + globalName: 'App', + minify: production, + sourcemap: !production ? 'inline' : false, + sourcesContent: !production, + platform: 'browser', + outdir: 'dist', + logLevel: 'silent', + target: ['es2020'], + jsx: 'automatic', + jsxImportSource: 'react', + external: ['*.css'], + // Bundle React with webview since it's not available in the runtime + // This prevents the multiple React instances issue + // Ensure React is resolved from the workspace root to avoid duplicates + alias: { + react: path.resolve(__dirname, 'node_modules/react'), + 'react-dom': path.resolve(__dirname, 'node_modules/react-dom') + }, + define: { + 'process.env.NODE_ENV': production ? '"production"' : '"development"', + global: 'globalThis' + }, + // Add production optimizations for webview too + ...(production && { + drop: ['debugger'], + pure: ['console.log', 'console.debug', 'console.trace'] + }), + plugins: [esbuildProblemMatcherPlugin, aliasPlugin] + }); + + // Build configuration for the React sidebar + const sidebarCtx = await esbuild.context({ + entryPoints: ['src/webview/sidebar.tsx'], + bundle: true, + format: 'iife', + globalName: 'SidebarApp', + minify: production, + sourcemap: !production ? 'inline' : false, + sourcesContent: !production, + platform: 'browser', + outdir: 'dist', + logLevel: 'silent', + target: ['es2020'], + jsx: 'automatic', + jsxImportSource: 'react', + external: ['*.css'], + alias: { + react: path.resolve(__dirname, 'node_modules/react'), + 'react-dom': path.resolve(__dirname, 'node_modules/react-dom') + }, + define: { + 'process.env.NODE_ENV': production ? '"production"' : '"development"', + global: 'globalThis' + }, + ...(production && { + drop: ['debugger'], + pure: ['console.log', 'console.debug', 'console.trace'] + }), + plugins: [esbuildProblemMatcherPlugin, aliasPlugin] + }); + + if (watch) { + await Promise.all([ + extensionCtx.watch(), + webviewCtx.watch(), + sidebarCtx.watch() + ]); + } else { + await Promise.all([ + extensionCtx.rebuild(), + webviewCtx.rebuild(), + sidebarCtx.rebuild() + ]); + await extensionCtx.dispose(); + await webviewCtx.dispose(); + await sidebarCtx.dispose(); + } +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/apps/extension/package.json b/apps/extension/package.json index ff483de1..3c28737a 100644 --- a/apps/extension/package.json +++ b/apps/extension/package.json @@ -1,16 +1,300 @@ { "name": "extension", "private": true, - "version": "0.20.0", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "displayName": "TaskMaster", + "description": "A visual Kanban board interface for TaskMaster projects in VS Code", + "version": "0.23.0-rc.1", + "publisher": "Hamster", + "icon": "assets/icon.png", + "engines": { + "vscode": "^1.93.0" + }, + "categories": [ + "AI", + "Visualization", + "Education", + "Other" + ], + "main": "./dist/extension.js", + "activationEvents": [ + "onStartupFinished", + "workspaceContains:.taskmaster/**" + ], + "contributes": { + "viewsContainers": { + "activitybar": [ + { + "id": "taskmaster", + "title": "TaskMaster", + "icon": "assets/sidebar-icon.svg" + } + ] + }, + "views": { + "taskmaster": [ + { + "id": "taskmaster.welcome", + "name": "TaskMaster", + "type": "webview" + } + ] + }, + "commands": [ + { + "command": "tm.showKanbanBoard", + "title": "TaskMaster: Show Board", + "icon": "$(checklist)" + }, + { + "command": "tm.checkConnection", + "title": "TaskMaster: Check Connection" + }, + { + "command": "tm.reconnect", + "title": "TaskMaster: Reconnect" + }, + { + "command": "tm.openSettings", + "title": "TaskMaster: Open Settings" + } + ], + "menus": { + "view/title": [ + { + "command": "tm.showKanbanBoard", + "when": "view == taskmaster.welcome", + "group": "navigation" + } + ] + }, + "configuration": { + "title": "TaskMaster Kanban", + "properties": { + "taskmaster.mcp.command": { + "type": "string", + "default": "npx", + "description": "The command or absolute path to execute for the MCP server (e.g., 'npx' or '/usr/local/bin/task-master-ai')." + }, + "taskmaster.mcp.args": { + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "task-master-ai" + ], + "description": "An array of arguments to pass to the MCP server command." + }, + "taskmaster.mcp.cwd": { + "type": "string", + "description": "Working directory for the TaskMaster MCP server (defaults to workspace root)" + }, + "taskmaster.mcp.env": { + "type": "object", + "description": "Environment variables for the TaskMaster MCP server" + }, + "taskmaster.mcp.timeout": { + "type": "number", + "default": 30000, + "minimum": 1000, + "maximum": 300000, + "description": "Connection timeout in milliseconds" + }, + "taskmaster.mcp.maxReconnectAttempts": { + "type": "number", + "default": 5, + "minimum": 1, + "maximum": 20, + "description": "Maximum number of reconnection attempts" + }, + "taskmaster.mcp.reconnectBackoffMs": { + "type": "number", + "default": 1000, + "minimum": 100, + "maximum": 10000, + "description": "Initial reconnection backoff delay in milliseconds" + }, + "taskmaster.mcp.maxBackoffMs": { + "type": "number", + "default": 30000, + "minimum": 1000, + "maximum": 300000, + "description": "Maximum reconnection backoff delay in milliseconds" + }, + "taskmaster.mcp.healthCheckIntervalMs": { + "type": "number", + "default": 15000, + "minimum": 5000, + "maximum": 60000, + "description": "Health check interval in milliseconds" + }, + "taskmaster.mcp.requestTimeoutMs": { + "type": "number", + "default": 300000, + "minimum": 30000, + "maximum": 600000, + "description": "MCP request timeout in milliseconds (default: 5 minutes)" + }, + "taskmaster.ui.autoRefresh": { + "type": "boolean", + "default": true, + "description": "Automatically refresh tasks from the server" + }, + "taskmaster.ui.refreshIntervalMs": { + "type": "number", + "default": 10000, + "minimum": 1000, + "maximum": 300000, + "description": "Auto-refresh interval in milliseconds" + }, + "taskmaster.ui.theme": { + "type": "string", + "enum": [ + "auto", + "light", + "dark" + ], + "default": "auto", + "description": "UI theme preference" + }, + "taskmaster.ui.showCompletedTasks": { + "type": "boolean", + "default": true, + "description": "Show completed tasks in the Kanban board" + }, + "taskmaster.ui.taskDisplayLimit": { + "type": "number", + "default": 100, + "minimum": 1, + "maximum": 1000, + "description": "Maximum number of tasks to display" + }, + "taskmaster.ui.showPriority": { + "type": "boolean", + "default": true, + "description": "Show task priority indicators" + }, + "taskmaster.ui.showTaskIds": { + "type": "boolean", + "default": true, + "description": "Show task IDs in the interface" + }, + "taskmaster.performance.maxConcurrentRequests": { + "type": "number", + "default": 5, + "minimum": 1, + "maximum": 20, + "description": "Maximum number of concurrent MCP requests" + }, + "taskmaster.performance.requestTimeoutMs": { + "type": "number", + "default": 30000, + "minimum": 1000, + "maximum": 300000, + "description": "Request timeout in milliseconds" + }, + "taskmaster.performance.cacheTasksMs": { + "type": "number", + "default": 5000, + "minimum": 0, + "maximum": 60000, + "description": "Task cache duration in milliseconds" + }, + "taskmaster.performance.lazyLoadThreshold": { + "type": "number", + "default": 50, + "minimum": 10, + "maximum": 500, + "description": "Number of tasks before enabling lazy loading" + }, + "taskmaster.debug.enableLogging": { + "type": "boolean", + "default": true, + "description": "Enable debug logging" + }, + "taskmaster.debug.logLevel": { + "type": "string", + "enum": [ + "error", + "warn", + "info", + "debug" + ], + "default": "info", + "description": "Logging level" + }, + "taskmaster.debug.enableConnectionMetrics": { + "type": "boolean", + "default": true, + "description": "Enable connection performance metrics" + }, + "taskmaster.debug.saveEventLogs": { + "type": "boolean", + "default": false, + "description": "Save event logs to files" + }, + "taskmaster.debug.maxEventLogSize": { + "type": "number", + "default": 1000, + "minimum": 10, + "maximum": 10000, + "description": "Maximum number of events to keep in memory" + } + } + } + }, + "scripts": { + "vscode:prepublish": "npm run build", + "build": "npm run build:js && npm run build:css", + "build:js": "node ./esbuild.js --production", + "build:css": "npx @tailwindcss/cli -i ./src/webview/index.css -o ./dist/index.css --minify", + "package": "npm exec node ./package.mjs", + "package:direct": "node ./package.mjs", + "debug:env": "node ./debug-env.mjs", + "compile": "node ./esbuild.js", + "watch": "npm run watch:js & npm run watch:css", + "watch:js": "node ./esbuild.js --watch", + "watch:css": "npx @tailwindcss/cli -i ./src/webview/index.css -o ./dist/index.css --watch", + "check-types": "tsc --noEmit" }, - "keywords": [], - "author": "", - "license": "ISC", - "description": "", "devDependencies": { - "typescript": "^5.8.3" + "@dnd-kit/core": "^6.3.1", + "@dnd-kit/modifiers": "^9.0.0", + "@modelcontextprotocol/sdk": "1.13.3", + "@radix-ui/react-collapsible": "^1.1.11", + "@radix-ui/react-dropdown-menu": "^2.1.15", + "@radix-ui/react-label": "^2.1.7", + "@radix-ui/react-portal": "^1.1.9", + "@radix-ui/react-scroll-area": "^1.2.9", + "@radix-ui/react-separator": "^1.1.7", + "@radix-ui/react-slot": "^1.2.3", + "@tailwindcss/postcss": "^4.1.11", + "@types/mocha": "^10.0.10", + "@types/node": "20.x", + "@types/react": "19.1.8", + "@types/react-dom": "19.1.6", + "@types/vscode": "^1.101.0", + "@vscode/test-cli": "^0.0.11", + "@vscode/test-electron": "^2.5.2", + "@vscode/vsce": "^2.32.0", + "autoprefixer": "10.4.21", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "esbuild": "^0.25.3", + "esbuild-postcss": "^0.0.4", + "fs-extra": "^11.3.0", + "lucide-react": "^0.525.0", + "npm-run-all": "^4.1.5", + "postcss": "8.5.6", + "tailwind-merge": "^3.3.1", + "tailwindcss": "4.1.11", + "typescript": "^5.8.3", + "@tanstack/react-query": "^5.83.0", + "react": "^19.0.0", + "react-dom": "^19.0.0" + }, + "overrides": { + "glob@<8": "^10.4.5", + "inflight": "npm:@tootallnate/once@2" } } diff --git a/apps/extension/package.mjs b/apps/extension/package.mjs new file mode 100644 index 00000000..211f4416 --- /dev/null +++ b/apps/extension/package.mjs @@ -0,0 +1,136 @@ +import { execSync } from 'child_process'; +import path from 'path'; +import { fileURLToPath } from 'url'; +import fs from 'fs-extra'; + +// --- Configuration --- +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const packageDir = path.resolve(__dirname, 'vsix-build'); +// --- End Configuration --- + +try { + console.log('πŸš€ Starting packaging process...'); + + // 1. Build Project + console.log('\nBuilding JavaScript...'); + execSync('npm run build:js', { stdio: 'inherit' }); + console.log('\nBuilding CSS...'); + execSync('npm run build:css', { stdio: 'inherit' }); + + // 2. Prepare Clean Directory + console.log(`\nPreparing clean directory at: ${packageDir}`); + fs.emptyDirSync(packageDir); + + // 3. Copy Build Artifacts (excluding source maps) + console.log('Copying build artifacts...'); + const distDir = path.resolve(__dirname, 'dist'); + const targetDistDir = path.resolve(packageDir, 'dist'); + fs.ensureDirSync(targetDistDir); + + // Only copy the files we need (exclude .map files) + const filesToCopy = ['extension.js', 'index.js', 'index.css', 'sidebar.js']; + for (const file of filesToCopy) { + const srcFile = path.resolve(distDir, file); + const destFile = path.resolve(targetDistDir, file); + if (fs.existsSync(srcFile)) { + fs.copySync(srcFile, destFile); + console.log(` - Copied dist/${file}`); + } + } + + // 4. Copy additional files + const additionalFiles = ['README.md', 'CHANGELOG.md', 'AGENTS.md']; + for (const file of additionalFiles) { + if (fs.existsSync(path.resolve(__dirname, file))) { + fs.copySync( + path.resolve(__dirname, file), + path.resolve(packageDir, file) + ); + console.log(` - Copied ${file}`); + } + } + + // 5. Sync versions and prepare the final package.json + console.log('Syncing versions and preparing the final package.json...'); + + // Read current versions + const devPackagePath = path.resolve(__dirname, 'package.json'); + const publishPackagePath = path.resolve(__dirname, 'package.publish.json'); + + const devPackage = JSON.parse(fs.readFileSync(devPackagePath, 'utf8')); + const publishPackage = JSON.parse( + fs.readFileSync(publishPackagePath, 'utf8') + ); + + // Check if versions are in sync + if (devPackage.version !== publishPackage.version) { + console.log( + ` - Version sync needed: ${publishPackage.version} β†’ ${devPackage.version}` + ); + publishPackage.version = devPackage.version; + + // Update the source package.publish.json file + fs.writeFileSync( + publishPackagePath, + JSON.stringify(publishPackage, null, '\t') + '\n' + ); + console.log( + ` - Updated package.publish.json version to ${devPackage.version}` + ); + } else { + console.log(` - Versions already in sync: ${devPackage.version}`); + } + + // Copy the (now synced) package.publish.json as package.json + fs.copySync(publishPackagePath, path.resolve(packageDir, 'package.json')); + console.log(' - Copied package.publish.json as package.json'); + + // 6. Copy .vscodeignore if it exists + if (fs.existsSync(path.resolve(__dirname, '.vscodeignore'))) { + fs.copySync( + path.resolve(__dirname, '.vscodeignore'), + path.resolve(packageDir, '.vscodeignore') + ); + console.log(' - Copied .vscodeignore'); + } + + // 7. Copy LICENSE if it exists + if (fs.existsSync(path.resolve(__dirname, 'LICENSE'))) { + fs.copySync( + path.resolve(__dirname, 'LICENSE'), + path.resolve(packageDir, 'LICENSE') + ); + console.log(' - Copied LICENSE'); + } + + // 7a. Copy assets directory if it exists + const assetsDir = path.resolve(__dirname, 'assets'); + if (fs.existsSync(assetsDir)) { + const targetAssetsDir = path.resolve(packageDir, 'assets'); + fs.copySync(assetsDir, targetAssetsDir); + console.log(' - Copied assets directory'); + } + + // Small delay to ensure file system operations complete + await new Promise((resolve) => setTimeout(resolve, 100)); + + // 8. Final step - manual packaging + console.log('\nβœ… Build preparation complete!'); + console.log('\nTo create the VSIX package, run:'); + console.log( + '\x1b[36m%s\x1b[0m', + `cd vsix-build && npx vsce package --no-dependencies` + ); + + // Use the synced version for output + const finalVersion = devPackage.version; + console.log( + `\nYour extension will be packaged to: vsix-build/task-master-${finalVersion}.vsix` + ); +} catch (error) { + console.error('\n❌ Packaging failed!'); + console.error(error.message); + process.exit(1); +} diff --git a/apps/extension/package.publish.json b/apps/extension/package.publish.json new file mode 100644 index 00000000..d9949c4e --- /dev/null +++ b/apps/extension/package.publish.json @@ -0,0 +1,250 @@ +{ + "name": "task-master-hamster", + "displayName": "Taskmaster AI", + "description": "A visual Kanban board interface for Taskmaster projects in VS Code", + "version": "0.22.3", + "publisher": "Hamster", + "icon": "assets/icon.png", + "engines": { + "vscode": "^1.93.0" + }, + "categories": ["AI", "Visualization", "Education", "Other"], + "keywords": [ + "kanban", + "kanban board", + "productivity", + "todo", + "task tracking", + "project management", + "task-master", + "task management", + "agile", + "scrum", + "ai", + "mcp", + "model context protocol", + "dashboard", + "chatgpt", + "claude", + "openai", + "anthropic", + "task", + "npm", + "intellicode", + "react", + "typescript", + "php", + "python", + "node", + "planner", + "organizer", + "workflow", + "boards", + "cards" + ], + "repository": "https://github.com/eyaltoledano/claude-task-master", + "activationEvents": ["onStartupFinished", "workspaceContains:.taskmaster/**"], + "main": "./dist/extension.js", + "contributes": { + "viewsContainers": { + "activitybar": [ + { + "id": "taskmaster", + "title": "Taskmaster", + "icon": "assets/sidebar-icon.svg" + } + ] + }, + "views": { + "taskmaster": [ + { + "id": "taskmaster.welcome", + "name": "Taskmaster", + "type": "webview" + } + ] + }, + "commands": [ + { + "command": "tm.showKanbanBoard", + "title": "Taskmaster: Show Board" + }, + { + "command": "tm.checkConnection", + "title": "Taskmaster: Check Connection" + }, + { + "command": "tm.reconnect", + "title": "Taskmaster: Reconnect" + }, + { + "command": "tm.openSettings", + "title": "Taskmaster: Open Settings" + } + ], + "configuration": { + "title": "Taskmaster Kanban", + "properties": { + "taskmaster.mcp.command": { + "type": "string", + "default": "npx", + "description": "The command or absolute path to execute for the MCP server (e.g., 'npx' or '/usr/local/bin/task-master-ai')." + }, + "taskmaster.mcp.args": { + "type": "array", + "items": { + "type": "string" + }, + "default": ["-y", "--package=task-master-ai", "task-master-ai"], + "description": "An array of arguments to pass to the MCP server command." + }, + "taskmaster.mcp.cwd": { + "type": "string", + "description": "Working directory for the Task Master MCP server (defaults to workspace root)" + }, + "taskmaster.mcp.env": { + "type": "object", + "description": "Environment variables for the Task Master MCP server" + }, + "taskmaster.mcp.timeout": { + "type": "number", + "default": 30000, + "minimum": 1000, + "maximum": 300000, + "description": "Connection timeout in milliseconds" + }, + "taskmaster.mcp.maxReconnectAttempts": { + "type": "number", + "default": 5, + "minimum": 1, + "maximum": 20, + "description": "Maximum number of reconnection attempts" + }, + "taskmaster.mcp.reconnectBackoffMs": { + "type": "number", + "default": 1000, + "minimum": 100, + "maximum": 10000, + "description": "Initial reconnection backoff delay in milliseconds" + }, + "taskmaster.mcp.maxBackoffMs": { + "type": "number", + "default": 30000, + "minimum": 1000, + "maximum": 300000, + "description": "Maximum reconnection backoff delay in milliseconds" + }, + "taskmaster.mcp.healthCheckIntervalMs": { + "type": "number", + "default": 15000, + "minimum": 5000, + "maximum": 60000, + "description": "Health check interval in milliseconds" + }, + "taskmaster.mcp.requestTimeoutMs": { + "type": "number", + "default": 300000, + "minimum": 30000, + "maximum": 600000, + "description": "MCP request timeout in milliseconds (default: 5 minutes)" + }, + "taskmaster.ui.autoRefresh": { + "type": "boolean", + "default": true, + "description": "Automatically refresh tasks from the server" + }, + "taskmaster.ui.refreshIntervalMs": { + "type": "number", + "default": 10000, + "minimum": 1000, + "maximum": 300000, + "description": "Auto-refresh interval in milliseconds" + }, + "taskmaster.ui.theme": { + "type": "string", + "enum": ["auto", "light", "dark"], + "default": "auto", + "description": "UI theme preference" + }, + "taskmaster.ui.showCompletedTasks": { + "type": "boolean", + "default": true, + "description": "Show completed tasks in the Kanban board" + }, + "taskmaster.ui.taskDisplayLimit": { + "type": "number", + "default": 100, + "minimum": 1, + "maximum": 1000, + "description": "Maximum number of tasks to display" + }, + "taskmaster.ui.showPriority": { + "type": "boolean", + "default": true, + "description": "Show task priority indicators" + }, + "taskmaster.ui.showTaskIds": { + "type": "boolean", + "default": true, + "description": "Show task IDs in the interface" + }, + "taskmaster.performance.maxConcurrentRequests": { + "type": "number", + "default": 5, + "minimum": 1, + "maximum": 20, + "description": "Maximum number of concurrent MCP requests" + }, + "taskmaster.performance.requestTimeoutMs": { + "type": "number", + "default": 30000, + "minimum": 1000, + "maximum": 300000, + "description": "Request timeout in milliseconds" + }, + "taskmaster.performance.cacheTasksMs": { + "type": "number", + "default": 5000, + "minimum": 0, + "maximum": 60000, + "description": "Task cache duration in milliseconds" + }, + "taskmaster.performance.lazyLoadThreshold": { + "type": "number", + "default": 50, + "minimum": 10, + "maximum": 500, + "description": "Number of tasks before enabling lazy loading" + }, + "taskmaster.debug.enableLogging": { + "type": "boolean", + "default": true, + "description": "Enable debug logging" + }, + "taskmaster.debug.logLevel": { + "type": "string", + "enum": ["error", "warn", "info", "debug"], + "default": "info", + "description": "Logging level" + }, + "taskmaster.debug.enableConnectionMetrics": { + "type": "boolean", + "default": true, + "description": "Enable connection performance metrics" + }, + "taskmaster.debug.saveEventLogs": { + "type": "boolean", + "default": false, + "description": "Save event logs to files" + }, + "taskmaster.debug.maxEventLogSize": { + "type": "number", + "default": 1000, + "minimum": 10, + "maximum": 10000, + "description": "Maximum number of events to keep in memory" + } + } + } + } +} diff --git a/apps/extension/src/components/ConfigView.tsx b/apps/extension/src/components/ConfigView.tsx new file mode 100644 index 00000000..98f11184 --- /dev/null +++ b/apps/extension/src/components/ConfigView.tsx @@ -0,0 +1,291 @@ +import { ArrowLeft, RefreshCw, Settings } from 'lucide-react'; +import type React from 'react'; +import { useEffect, useState, useCallback } from 'react'; +import { Badge } from './ui/badge'; +import { Button } from './ui/button'; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle +} from './ui/card'; +import { ScrollArea } from './ui/scroll-area'; +import { Separator } from './ui/separator'; + +interface ModelConfig { + provider: string; + modelId: string; + maxTokens: number; + temperature: number; +} + +interface ConfigData { + models?: { + main?: ModelConfig; + research?: ModelConfig; + fallback?: ModelConfig; + }; + global?: { + defaultNumTasks?: number; + defaultSubtasks?: number; + defaultPriority?: string; + projectName?: string; + responseLanguage?: string; + }; +} + +interface ConfigViewProps { + sendMessage: (message: any) => Promise; + onNavigateBack: () => void; +} + +export const ConfigView: React.FC = ({ + sendMessage, + onNavigateBack +}) => { + const [config, setConfig] = useState(null); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + + const loadConfig = useCallback(async () => { + setLoading(true); + setError(null); + try { + const response = await sendMessage({ type: 'getConfig' }); + setConfig(response); + } catch (err) { + setError('Failed to load configuration'); + console.error('Error loading config:', err); + } finally { + setLoading(false); + } + }, [sendMessage]); + + useEffect(() => { + loadConfig(); + }, [loadConfig]); + + const modelLabels = { + main: { + label: 'Main Model', + icon: 'πŸ€–', + description: 'Primary model for task generation' + }, + research: { + label: 'Research Model', + icon: 'πŸ”', + description: 'Model for research-backed operations' + }, + fallback: { + label: 'Fallback Model', + icon: 'πŸ”„', + description: 'Backup model if primary fails' + } + }; + + return ( +
+ {/* Header */} +
+
+ +
+ +

Task Master Configuration

+
+
+ +
+ + {/* Content */} + +
+ {loading ? ( +
+ +
+ ) : error ? ( +
{error}
+ ) : config ? ( +
+ {/* Models Section */} + + + AI Models + + Models configured for different Task Master operations + + + + {config.models && + Object.entries(config.models).map(([key, modelConfig]) => { + const label = + modelLabels[key as keyof typeof modelLabels]; + if (!label || !modelConfig) return null; + + return ( +
+
+ {label.icon} +
+

{label.label}

+

+ {label.description} +

+
+
+
+
+ + Provider: + + + {modelConfig.provider} + +
+
+ + Model: + + + {modelConfig.modelId} + +
+
+ + Max Tokens: + + + {modelConfig.maxTokens.toLocaleString()} + +
+
+ + Temperature: + + + {modelConfig.temperature} + +
+
+
+ ); + })} +
+
+ + {/* Task Defaults Section */} + {config.global && ( + + + Task Defaults + + Default values for new tasks and subtasks + + + +
+
+ + Default Number of Tasks + + + {config.global.defaultNumTasks || 10} + +
+ +
+ + Default Number of Subtasks + + + {config.global.defaultSubtasks || 5} + +
+ +
+ + Default Priority + + + {config.global.defaultPriority || 'medium'} + +
+ {config.global.projectName && ( + <> + +
+ + Project Name + + + {config.global.projectName} + +
+ + )} + {config.global.responseLanguage && ( + <> + +
+ + Response Language + + + {config.global.responseLanguage} + +
+ + )} +
+
+
+ )} + + {/* Info Card */} + + +

+ To modify these settings, go to{' '} + + .taskmaster/config.json + {' '} + and modify them, or use the MCP. +

+
+
+
+ ) : ( +
+ No configuration found. Please run `task-master init` in your + project. +
+ )} +
+
+
+ ); +}; diff --git a/apps/extension/src/components/TaskDetails/AIActionsSection.tsx b/apps/extension/src/components/TaskDetails/AIActionsSection.tsx new file mode 100644 index 00000000..9855335e --- /dev/null +++ b/apps/extension/src/components/TaskDetails/AIActionsSection.tsx @@ -0,0 +1,380 @@ +import type React from 'react'; +import { useState } from 'react'; +import { Button } from '@/components/ui/button'; +import { Label } from '@/components/ui/label'; +import { Textarea } from '@/components/ui/textarea'; +import { CollapsibleSection } from '@/components/ui/CollapsibleSection'; +import { + Wand2, + Loader2, + PlusCircle, + TrendingUp, + TrendingDown +} from 'lucide-react'; +import { + useUpdateTask, + useUpdateSubtask, + useScopeUpTask, + useScopeDownTask +} from '../../webview/hooks/useTaskQueries'; +import type { TaskMasterTask } from '../../webview/types'; + +interface AIActionsSectionProps { + currentTask: TaskMasterTask; + isSubtask: boolean; + parentTask?: TaskMasterTask | null; + sendMessage: (message: any) => Promise; + refreshComplexityAfterAI: () => void; + onRegeneratingChange?: (isRegenerating: boolean) => void; + onAppendingChange?: (isAppending: boolean) => void; +} + +export const AIActionsSection: React.FC = ({ + currentTask, + isSubtask, + parentTask, + sendMessage, + refreshComplexityAfterAI, + onRegeneratingChange, + onAppendingChange +}) => { + const [prompt, setPrompt] = useState(''); + const [scopePrompt, setScopePrompt] = useState(''); + const [scopeStrength, setScopeStrength] = useState< + 'light' | 'regular' | 'heavy' + >('regular'); + const [lastAction, setLastAction] = useState< + 'regenerate' | 'append' | 'scope-up' | 'scope-down' | null + >(null); + const updateTask = useUpdateTask(); + const updateSubtask = useUpdateSubtask(); + const scopeUpTask = useScopeUpTask(); + const scopeDownTask = useScopeDownTask(); + + const handleRegenerate = async () => { + if (!currentTask || !prompt.trim()) { + return; + } + + setLastAction('regenerate'); + onRegeneratingChange?.(true); + + try { + if (isSubtask && parentTask) { + await updateSubtask.mutateAsync({ + taskId: `${parentTask.id}.${currentTask.id}`, + prompt: prompt, + options: { research: false } + }); + } else { + await updateTask.mutateAsync({ + taskId: currentTask.id, + updates: { description: prompt }, + options: { append: false, research: false } + }); + } + + setPrompt(''); + refreshComplexityAfterAI(); + } catch (error) { + console.error('❌ TaskDetailsView: Failed to regenerate task:', error); + } finally { + setLastAction(null); + onRegeneratingChange?.(false); + } + }; + + const handleAppend = async () => { + if (!currentTask || !prompt.trim()) { + return; + } + + setLastAction('append'); + onAppendingChange?.(true); + + try { + if (isSubtask && parentTask) { + await updateSubtask.mutateAsync({ + taskId: `${parentTask.id}.${currentTask.id}`, + prompt: prompt, + options: { research: false } + }); + } else { + await updateTask.mutateAsync({ + taskId: currentTask.id, + updates: { description: prompt }, + options: { append: true, research: false } + }); + } + + setPrompt(''); + refreshComplexityAfterAI(); + } catch (error) { + console.error('❌ TaskDetailsView: Failed to append to task:', error); + } finally { + setLastAction(null); + onAppendingChange?.(false); + } + }; + + const handleScopeUp = async () => { + if (!currentTask) { + return; + } + + setLastAction('scope-up'); + + try { + const taskId = + isSubtask && parentTask + ? `${parentTask.id}.${currentTask.id}` + : currentTask.id; + + await scopeUpTask.mutateAsync({ + taskId, + strength: scopeStrength, + prompt: scopePrompt.trim() || undefined, + options: { research: false } + }); + + setScopePrompt(''); + refreshComplexityAfterAI(); + } catch (error) { + console.error('❌ AIActionsSection: Failed to scope up task:', error); + } finally { + setLastAction(null); + } + }; + + const handleScopeDown = async () => { + if (!currentTask) { + return; + } + + setLastAction('scope-down'); + + try { + const taskId = + isSubtask && parentTask + ? `${parentTask.id}.${currentTask.id}` + : currentTask.id; + + await scopeDownTask.mutateAsync({ + taskId, + strength: scopeStrength, + prompt: scopePrompt.trim() || undefined, + options: { research: false } + }); + + setScopePrompt(''); + refreshComplexityAfterAI(); + } catch (error) { + console.error('❌ AIActionsSection: Failed to scope down task:', error); + } finally { + setLastAction(null); + } + }; + + // Track loading states based on the last action + const isLoading = + updateTask.isPending || + updateSubtask.isPending || + scopeUpTask.isPending || + scopeDownTask.isPending; + const isRegenerating = isLoading && lastAction === 'regenerate'; + const isAppending = isLoading && lastAction === 'append'; + const isScopingUp = isLoading && lastAction === 'scope-up'; + const isScopingDown = isLoading && lastAction === 'scope-down'; + + return ( + +
+ {/* Standard AI Actions Section */} +
+
+ +