UNPKG

task-master-neo-sdlc

Version:

Enhanced task management system with Neo SDLC agents and MCP tools for comprehensive, AI-driven software development lifecycle management.

209 lines (181 loc) 6.99 kB
/** * SDLC Stage definitions and utilities */ // SDLC Stage definitions export const SDLC_STAGES = { PLANNING: 'planning', DEVELOPMENT: 'development', DEPLOYMENT: 'deployment' }; // Action types for each SDLC stage export const STAGE_ACTION_TYPES = { [SDLC_STAGES.PLANNING]: [ 'createDocument', 'createArchitecture', 'createWireframes', 'defineUserStories', 'createDataModel' ], [SDLC_STAGES.DEVELOPMENT]: [ 'createComponent', 'implementApiLogic', 'createTest', 'setupDatabase', 'configureAuthentication', 'implementBusinessLogic', 'createUtility' ], [SDLC_STAGES.DEPLOYMENT]: [ 'setupCICD', 'provisionInfrastructure', 'configureMonitoring', 'implementSecurity', 'createDeploymentScript' ] }; /** * Determine the SDLC stage based on the task * @param {Object} task - Task object * @returns {string} SDLC stage */ export function determineTaskStage(task) { const title = task.title.toLowerCase(); const description = (task.description || '').toLowerCase(); const details = (task.details || '').toLowerCase(); // Check for planning stage indicators if (title.includes('plan') || title.includes('design') || title.includes('specification') || description.includes('requirements') || description.includes('wireframe') || details.includes('prd') || details.includes('brd') || details.includes('user stories')) { return SDLC_STAGES.PLANNING; } // Check for deployment stage indicators else if (title.includes('deploy') || title.includes('ci/cd') || title.includes('infrastructure') || description.includes('pipeline') || description.includes('cloud') || details.includes('deployment') || details.includes('infrastructure')) { return SDLC_STAGES.DEPLOYMENT; } // Default to development stage else { return SDLC_STAGES.DEVELOPMENT; } } /** * Get system prompt for a specific SDLC stage * @param {string} stage - SDLC stage * @param {number} numSubtasks - Number of subtasks to generate * @returns {string} System prompt */ export function getSystemPromptForStage(stage, numSubtasks) { const basePrompt = `You are an AI assistant helping with task breakdown for software development. You need to break down a high-level task into ${numSubtasks} specific subtasks that can be implemented one by one.`; switch (stage) { case SDLC_STAGES.PLANNING: return `${basePrompt} You are focusing on the Planning & Specifications stage of the SDLC. Subtasks should cover requirements gathering, design, architecture planning, and documentation. Examples of appropriate subtasks include: - Creating PRDs, BRDs, or technical specifications - Designing wireframes or mockups - Defining user stories and acceptance criteria - Creating architecture diagrams - Conducting feasibility studies - Defining data models For each subtask, provide: - A clear, specific title - Detailed implementation steps - Dependencies on previous subtasks - An action field specifying which Neo agent method to call and its parameters Available action types for this stage: - createDocument: Create documentation like PRDs, BRDs, or specifications - createArchitecture: Design system architecture and diagrams - createWireframes: Create UI/UX wireframes and mockups - defineUserStories: Define user stories and acceptance criteria - createDataModel: Define data models and entity relationships`; case SDLC_STAGES.DEVELOPMENT: return `${basePrompt} You are focusing on the Development stage of the SDLC. Subtasks should cover implementation of all system components. Examples of appropriate subtasks include: - Setting up database schemas and migrations - Implementing API endpoints and controllers - Creating frontend components and pages - Implementing authentication and authorization - Developing business logic and services - Creating unit and integration tests For each subtask, provide: - A clear, specific title - Detailed implementation steps - Dependencies on previous subtasks - An action field specifying which Neo agent method to call and its parameters Available action types for this stage: - createComponent: Create a UI component - implementApiLogic: Implement API endpoint logic - createTest: Create test cases - setupDatabase: Set up database schema or migrations - configureAuthentication: Configure authentication system - implementBusinessLogic: Implement core business logic - createUtility: Create utility functions or helpers`; case SDLC_STAGES.DEPLOYMENT: return `${basePrompt} You are focusing on the Deployment stage of the SDLC. Subtasks should cover CI/CD, infrastructure, and deployment. Examples of appropriate subtasks include: - Configuring CI/CD pipelines - Setting up cloud infrastructure - Implementing monitoring and logging - Configuring security measures - Creating deployment scripts - Setting up staging and production environments For each subtask, provide: - A clear, specific title - Detailed implementation steps - Dependencies on previous subtasks - An action field specifying which Neo agent method to call and its parameters Available action types for this stage: - setupCICD: Configure CI/CD pipeline - provisionInfrastructure: Set up cloud infrastructure - configureMonitoring: Implement monitoring and logging - implementSecurity: Configure security measures - createDeploymentScript: Create deployment scripts`; default: return basePrompt; } } /** * Get user prompt for a specific SDLC stage * @param {string} stage - SDLC stage * @param {Object} task - Task object * @param {number} numSubtasks - Number of subtasks to generate * @param {number} nextSubtaskId - Next subtask ID * @param {string} contextPrompt - Additional context * @returns {string} User prompt */ export function getUserPromptForStage(stage, task, numSubtasks, nextSubtaskId, contextPrompt) { const actionTypes = STAGE_ACTION_TYPES[stage]; return `Please break down this task into ${numSubtasks} specific, actionable subtasks for the ${stage.toUpperCase()} stage of the SDLC: Task ID: ${task.id} Title: ${task.title} Description: ${task.description || 'No description provided'} Current details: ${task.details || 'None provided'} ${contextPrompt} Return exactly ${numSubtasks} subtasks with the following JSON structure: [ { "id": ${nextSubtaskId}, "title": "First subtask title", "description": "Detailed description", "dependencies": [], "details": "Implementation details", "action": { "type": "actionType", // One of the action types listed below "parameters": { // Parameters specific to the action type } } }, ...more subtasks... ] Available action types for the ${stage.toUpperCase()} stage: ${actionTypes.map(type => `- ${type}`).join('\n')} Note on dependencies: Subtasks can depend on other subtasks with lower IDs. Use an empty array if there are no dependencies.`; }