UNPKG

mcp-product-manager

Version:

MCP Orchestrator for task and project management with web interface

79 lines 3.32 kB
export default { description: "Helper tool to properly format a task description with the required [PREFIX-AREA-###] format", parameters: { type: "object", properties: { description: { type: "string", description: "The plain task description without prefix" }, category: { type: "string", enum: ["feature", "bug", "refactor", "test", "docs", "task"], description: "Task category (determines prefix)" }, area: { type: "string", description: "Feature area (e.g., 'api', 'ui', 'database', 'auth', 'mcp', 'dashboard'). Leave empty for 'GENERAL'" }, project: { type: "string", description: "Project name (used to determine next number)" } }, required: ["description", "category", "project"] }, async execute(params) { const { description, category, area, project } = params; // Map category to prefix const categoryPrefixMap = { 'feature': 'FEAT', 'bug': 'BUG', 'refactor': 'REFACTOR', 'test': 'TEST', 'docs': 'DOC', 'task': 'TASK' }; const categoryPrefix = categoryPrefixMap[category] || 'TASK'; // Determine feature area let featureArea = area?.toUpperCase() || 'GENERAL'; // Auto-detect area from description if not provided if (!area) { const descLower = description.toLowerCase(); if (descLower.includes('mcp')) featureArea = 'MCP'; else if (descLower.includes('api')) featureArea = 'API'; else if (descLower.includes('dashboard')) featureArea = 'DASHBOARD'; else if (descLower.includes('ui') || descLower.includes('frontend')) featureArea = 'UI'; else if (descLower.includes('database') || descLower.includes('db')) featureArea = 'DB'; else if (descLower.includes('auth')) featureArea = 'AUTH'; else if (descLower.includes('security')) featureArea = 'SECURITY'; else if (descLower.includes('performance')) featureArea = 'PERF'; else if (descLower.includes('test')) featureArea = 'TEST'; } // For now, use a simple counter - in production this should query the database const nextNum = Math.floor(Math.random() * 900) + 100; // Random 3-digit number for demo const prefix = `[${categoryPrefix}-${featureArea}-${String(nextNum).padStart(3, '0')}]`; const formattedDescription = `${prefix} ${description}`; return { success: true, formatted_description: formattedDescription, prefix: prefix, components: { category: categoryPrefix, area: featureArea, number: String(nextNum).padStart(3, '0') }, usage: `Use this formatted description when calling create_task: "${formattedDescription}"` }; } }; //# sourceMappingURL=format_task_description.js.map