diff --git a/.taskmaster/reports/task-complexity-report.json b/.taskmaster/reports/task-complexity-report.json index 06fb9040..b204cb42 100644 --- a/.taskmaster/reports/task-complexity-report.json +++ b/.taskmaster/reports/task-complexity-report.json @@ -1,6 +1,6 @@ { "meta": { - "generatedAt": "2025-08-02T09:50:02.895Z", + "generatedAt": "2025-08-02T14:28:59.851Z", "tasksAnalyzed": 1, "totalTasks": 93, "analysisCount": 1, @@ -10,12 +10,12 @@ }, "complexityAnalysis": [ { - "taskId": 104, - "taskTitle": "Implement 'scope-up' and 'scope-down' CLI Commands for Dynamic Task Complexity Adjustment", + "taskId": 24, + "taskTitle": "Implement AI-Powered Test Generation Command", "complexityScore": 8, "recommendedSubtasks": 6, - "expansionPrompt": "Break down the implementation of the 'scope-up' and 'scope-down' CLI commands into detailed subtasks, focusing on: 1) Command structure and argument parsing, 2) Task/subtask retrieval and context gathering, 3) AI prompt construction for different strength levels, 4) Response processing and task updating, 5) Error handling and user feedback, and 6) Integration with existing systems including MCP tool. For each subtask, include specific implementation details, dependencies, and test strategies.", - "reasoning": "This task has high complexity (8/10) due to several factors: 1) It requires integration with multiple existing systems (CLI, AI services, task management), 2) It involves sophisticated AI prompt engineering with context awareness, 3) It needs to handle various parameters and edge cases, 4) It must maintain data integrity across task modifications, and 5) It requires both CLI and MCP tool implementations. The task already has 5 subtasks that cover the main components, but could benefit from one additional subtask focused on testing and documentation." + "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." } ] } \ No newline at end of file diff --git a/apps/extension/src/components/TaskDetails/AIActionsSection.tsx b/apps/extension/src/components/TaskDetails/AIActionsSection.tsx index 098158f8..9ec2d54b 100644 --- a/apps/extension/src/components/TaskDetails/AIActionsSection.tsx +++ b/apps/extension/src/components/TaskDetails/AIActionsSection.tsx @@ -4,10 +4,12 @@ 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 } from 'lucide-react'; +import { Wand2, Loader2, PlusCircle, TrendingUp, TrendingDown } from 'lucide-react'; import { useUpdateTask, - useUpdateSubtask + useUpdateSubtask, + useScopeUpTask, + useScopeDownTask } from '../../webview/hooks/useTaskQueries'; import type { TaskMasterTask } from '../../webview/types'; @@ -31,11 +33,15 @@ export const AIActionsSection: React.FC = ({ onAppendingChange }) => { const [prompt, setPrompt] = useState(''); - const [lastAction, setLastAction] = useState<'regenerate' | 'append' | null>( + 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()) { @@ -103,10 +109,64 @@ export const AIActionsSection: React.FC = ({ } }; + 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; + 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 ( = ({ defaultExpanded={true} buttonClassName="text-vscode-foreground/80 hover:text-vscode-foreground" > -
-
- -