Cursor rule
.cursor/rules/tasks.mdcGuidelines for implementing task management operations
Cursor rules
Quality
70/100
Scores the file, not the repository.Length
1,349 words
8 headings · 13 code blocksRepository
192
— · pushed 309 days agoLast changed
3 days ago
First indexed 3 days ago.1234567# Task Management Guidelines89## Task Structure Standards1011- **Core Task Properties**:12 - ✅ DO: Include all required properties in each task object13 - ✅ DO: Provide default values for optional properties14 - ❌ DON'T: Add extra properties that aren't in the standard schema1516```javascript17 // ✅ DO: Follow this structure for task objects18 const task = {19 id: nextId,20 title: "Task title",21 description: "Brief task description",22 status: "pending", // "pending", "in-progress", "done", etc.23 dependencies: [], // Array of task IDs24 priority: "medium", // "high", "medium", "low"25 details: "Detailed implementation instructions",26 testStrategy: "Verification approach",27 subtasks: [] // Array of subtask objects28 };29```3031- **Subtask Structure**:32 - ✅ DO: Use consistent properties across subtasks33 - ✅ DO: Maintain simple numeric IDs within parent tasks34 - ❌ DON'T: Duplicate parent task properties in subtasks3536```javascript37 // ✅ DO: Structure subtasks consistently38 const subtask = {39 id: nextSubtaskId, // Simple numeric ID, unique within the parent task40 title: "Subtask title",41 description: "Brief subtask description",42 status: "pending",43 dependencies: [], // Can include numeric IDs (other subtasks) or full task IDs44 details: "Detailed implementation instructions"45 };46```4748## Task Creation and Parsing4950- **ID Management**:51 - ✅ DO: Assign unique sequential IDs to tasks52 - ✅ DO: Calculate the next ID based on existing tasks53 - ❌ DON'T: Hardcode or reuse IDs5455```javascript56 // ✅ DO: Calculate the next available ID57 const highestId = Math.max(...data.tasks.map(t => t.id));58 const nextTaskId = highestId + 1;59```6061- **PRD Parsing**:62 - ✅ DO: Extract tasks from PRD documents using AI63 - ✅ DO: Provide clear prompts to guide AI task generation64 - ✅ DO: Validate and clean up AI-generated tasks6566```javascript67 // ✅ DO: Validate AI responses68 try {69 // Parse the JSON response70 taskData = JSON.parse(jsonContent);7172 // Check that we have the required fields73 if (!taskData.title || !taskData.description) {74 throw new Error("Missing required fields in the generated task");75 }76 } catch (error) {77 log('error', "Failed to parse AI's response as valid task JSON:", error);78 process.exit(1);79 }80```8182## Task Updates and Modifications8384- **Status Management**:85 - ✅ DO: Provide functions for updating task status86 - ✅ DO: Handle both individual tasks and subtasks87 - ✅ DO: Consider subtask status when updating parent tasks8889```javascript90 // ✅ DO: Handle status updates for both tasks and subtasks91 async function setTaskStatus(tasksPath, taskIdInput, newStatus) {92 // Check if it's a subtask (e.g., "1.2")93 if (taskIdInput.includes('.')) {94 const [parentId, subtaskId] = taskIdInput.split('.').map(id => parseInt(id, 10));9596 // Find the parent task and subtask97 const parentTask = data.tasks.find(t => t.id === parentId);98 const subtask = parentTask.subtasks.find(st => st.id === subtaskId);99100 // Update subtask status101 subtask.status = newStatus;102103 // Check if all subtasks are done104 if (newStatus === 'done') {105 const allSubtasksDone = parentTask.subtasks.every(st => st.status === 'done');106 if (allSubtasksDone) {107 // Suggest updating parent task108 }109 }110 } else {111 // Handle regular task112 const task = data.tasks.find(t => t.id === parseInt(taskIdInput, 10));113 task.status = newStatus;114115 // If marking as done, also mark subtasks116 if (newStatus === 'done' && task.subtasks && task.subtasks.length > 0) {117 task.subtasks.forEach(subtask => {118 subtask.status = newStatus;119 });120 }121 }122 }123```124125- **Task Expansion**:126 - ✅ DO: Use AI to generate detailed subtasks127 - ✅ DO: Consider complexity analysis for subtask counts128 - ✅ DO: Ensure proper IDs for newly created subtasks129130```javascript131 // ✅ DO: Generate appropriate subtasks based on complexity132 if (taskAnalysis) {133 log('info', `Found complexity analysis for task ${taskId}: Score ${taskAnalysis.complexityScore}/10`);134135 // Use recommended number of subtasks if available136 if (taskAnalysis.recommendedSubtasks && numSubtasks === CONFIG.defaultSubtasks) {137 numSubtasks = taskAnalysis.recommendedSubtasks;138 log('info', `Using recommended number of subtasks: ${numSubtasks}`);139 }140 }141```142143## Task File Generation144145- **File Formatting**:146 - ✅ DO: Use consistent formatting for task files147 - ✅ DO: Include all task properties in text files148 - ✅ DO: Format dependencies with status indicators149150```javascript151 // ✅ DO: Use consistent file formatting152 let content = `# Task ID: ${task.id}\n`;153 content += `# Title: ${task.title}\n`;154 content += `# Status: ${task.status || 'pending'}\n`;155156 // Format dependencies with their status157 if (task.dependencies && task.dependencies.length > 0) {158 content += `# Dependencies: ${formatDependenciesWithStatus(task.dependencies, data.tasks)}\n`;159 } else {160 content += '# Dependencies: None\n';161 }162```163164- **Subtask Inclusion**:165 - ✅ DO: Include subtasks in parent task files166 - ✅ DO: Use consistent indentation for subtask sections167 - ✅ DO: Display subtask dependencies with proper formatting168169```javascript170 // ✅ DO: Format subtasks correctly in task files171 if (task.subtasks && task.subtasks.length > 0) {172 content += '\n# Subtasks:\n';173174 task.subtasks.forEach(subtask => {175 content += `## ${subtask.id}. ${subtask.title} [${subtask.status || 'pending'}]\n`;176177 // Format subtask dependencies178 if (subtask.dependencies && subtask.dependencies.length > 0) {179 // Format the dependencies180 content += `### Dependencies: ${formattedDeps}\n`;181 } else {182 content += '### Dependencies: None\n';183 }184185 content += `### Description: ${subtask.description || ''}\n`;186 content += '### Details:\n';187 content += (subtask.details || '').split('\n').map(line => line).join('\n');188 content += '\n\n';189 });190 }191```192193## Task Listing and Display194195- **Filtering and Organization**:196 - ✅ DO: Allow filtering tasks by status197 - ✅ DO: Handle subtask display in lists198 - ✅ DO: Use consistent table formats199200```javascript201 // ✅ DO: Implement clear filtering and organization202 // Filter tasks by status if specified203 const filteredTasks = statusFilter204 ? data.tasks.filter(task =>205 task.status && task.status.toLowerCase() === statusFilter.toLowerCase())206 : data.tasks;207```208209- **Progress Tracking**:210 - ✅ DO: Calculate and display completion statistics211 - ✅ DO: Track both task and subtask completion212 - ✅ DO: Use visual progress indicators213214```javascript215 // ✅ DO: Track and display progress216 // Calculate completion statistics217 const totalTasks = data.tasks.length;218 const completedTasks = data.tasks.filter(task =>219 task.status === 'done' || task.status === 'completed').length;220 const completionPercentage = totalTasks > 0 ? (completedTasks / totalTasks) * 100 : 0;221222 // Count subtasks223 let totalSubtasks = 0;224 let completedSubtasks = 0;225226 data.tasks.forEach(task => {227 if (task.subtasks && task.subtasks.length > 0) {228 totalSubtasks += task.subtasks.length;229 completedSubtasks += task.subtasks.filter(st =>230 st.status === 'done' || st.status === 'completed').length;231 }232 });233```234235## Complexity Analysis236237- **Scoring System**:238 - ✅ DO: Use AI to analyze task complexity239 - ✅ DO: Include complexity scores (1-10)240 - ✅ DO: Generate specific expansion recommendations241242```javascript243 // ✅ DO: Handle complexity analysis properly244 const report = {245 meta: {246 generatedAt: new Date().toISOString(),247 tasksAnalyzed: tasksData.tasks.length,248 thresholdScore: thresholdScore,249 projectName: tasksData.meta?.projectName || 'Your Project Name',250 usedResearch: useResearch251 },252 complexityAnalysis: complexityAnalysis253 };254```255256- **Analysis-Based Workflow**:257 - ✅ DO: Use complexity reports to guide task expansion258 - ✅ DO: Prioritize complex tasks for more detailed breakdown259 - ✅ DO: Use expansion prompts from complexity analysis260261```javascript262 // ✅ DO: Apply complexity analysis to workflow263 // Sort tasks by complexity if report exists, otherwise by ID264 if (complexityReport && complexityReport.complexityAnalysis) {265 log('info', 'Sorting tasks by complexity...');266267 // Create a map of task IDs to complexity scores268 const complexityMap = new Map();269 complexityReport.complexityAnalysis.forEach(analysis => {270 complexityMap.set(analysis.taskId, analysis.complexityScore);271 });272273 // Sort tasks by complexity score (high to low)274 tasksToExpand.sort((a, b) => {275 const scoreA = complexityMap.get(a.id) || 0;276 const scoreB = complexityMap.get(b.id) || 0;277 return scoreB - scoreA;278 });279 }280```281282## Next Task Selection283284- **Eligibility Criteria**:285 - ✅ DO: Consider dependencies when finding next tasks286 - ✅ DO: Prioritize by task priority and dependency count287 - ✅ DO: Skip completed tasks288289```javascript290 // ✅ DO: Use proper task prioritization logic291 function findNextTask(tasks) {292 // Get all completed task IDs293 const completedTaskIds = new Set(294 tasks295 .filter(t => t.status === 'done' || t.status === 'completed')296 .map(t => t.id)297 );298299 // Filter for pending tasks whose dependencies are all satisfied300 const eligibleTasks = tasks.filter(task =>301 (task.status === 'pending' || task.status === 'in-progress') &&302 task.dependencies &&303 task.dependencies.every(depId => completedTaskIds.has(depId))304 );305306 // Sort by priority, dependency count, and ID307 const priorityValues = { 'high': 3, 'medium': 2, 'low': 1 };308309 const nextTask = eligibleTasks.sort((a, b) => {310 // Priority first311 const priorityA = priorityValues[a.priority || 'medium'] || 2;312 const priorityB = priorityValues[b.priority || 'medium'] || 2;313314 if (priorityB !== priorityA) {315 return priorityB - priorityA; // Higher priority first316 }317318 // Dependency count next319 if (a.dependencies.length !== b.dependencies.length) {320 return a.dependencies.length - b.dependencies.length; // Fewer dependencies first321 }322323 // ID last324 return a.id - b.id; // Lower ID first325 })[0];326327 return nextTask;328 }329```330331Refer to [`task-manager.js`](mdc:scripts/modules/task-manager.js) for implementation examples and [`new_features.mdc`](mdc:.cursor/rules/new_features.mdc) for integration guidelines.
Also in skindhu/AI-TASK-MANAGER
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| skindhu/AI-TASK-MANAGER.cursor/rules/ui.mdc · 192 | Cursor rules | ui | 62/100 | 3 days ago | |
| skindhu/AI-TASK-MANAGER.cursor/rules/architecture.mdc · 192 | Cursor rules | testarchtesting-strategy | 42/100 | 3 days ago | |
| skindhu/AI-TASK-MANAGER.cursor/rules/commands.mdc · 192 | Cursor rules | stylearch | 62/100 | 3 days ago | |
| skindhu/AI-TASK-MANAGER.cursor/rules/cursor_rules.mdc · 192 | Cursor rules | no sections | 36/100 | 3 days ago | |
| skindhu/AI-TASK-MANAGER.cursor/rules/dependencies.mdc · 192 | Cursor rules | arch | 66/100 | 3 days ago | |
| skindhu/AI-TASK-MANAGER.cursor/rules/dev_workflow.mdc · 192 | Cursor rules | setup | 52/100 | 3 days ago | |
| skindhu/AI-TASK-MANAGER.cursor/rules/new_features.mdc · 192 | Cursor rules | testtesting-strategydocs | 65/100 | 3 days ago | |
| skindhu/AI-TASK-MANAGER.cursor/rules/self_improve.mdc · 192 | Cursor rules | no sections | 36/100 | 3 days ago | |
| skindhu/AI-TASK-MANAGER.cursor/rules/tests.mdc · 192 | Cursor rules | teststylearchtesting-strategy+1 | 74/100 | 3 days ago | |
| skindhu/AI-TASK-MANAGER.cursor/rules/utilities.mdc · 192 | Cursor rules | securitydocs | 54/100 | 3 days ago | |
| skindhu/AI-TASK-MANAGERassets/.windsurfrules · 192 | Windsurf rules | setup | 40/100 | 3 days ago |
Diff against .cursor/rules/ui.mdc Diff against .cursor/rules/architecture.mdc Diff against .cursor/rules/commands.mdc Diff against .cursor/rules/cursor_rules.mdc Diff against .cursor/rules/dependencies.mdc Diff against .cursor/rules/dev_workflow.mdc Diff against .cursor/rules/new_features.mdc Diff against .cursor/rules/self_improve.mdc Diff against .cursor/rules/tests.mdc Diff against .cursor/rules/utilities.mdc Diff against assets/.windsurfrules
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 3 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago |
