RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/skindhu/AI-TASK-MANAGER

Cursor rule

.cursor/rules/architecture.mdc

Describes the high-level architecture of the Task Master CLI application.

Cursor rules

Quality

42/100

Scores the file, not the repository.

Length

1,292 words

1 headings · 0 code blocks

Repository

192

— · pushed 309 days ago

Last changed

3 days ago

First indexed 3 days ago.
skindhu/AI-TASK-MANAGER/.cursor/rules/architecture.mdcRawGitHub
1---
2description: Describes the high-level architecture of the Task Master CLI application.
3globs: scripts/modules/*.js
4alwaysApply: false
5---
6 
7# Application Architecture Overview
8 
9- **Modular Structure**: The Task Master CLI is built using a modular architecture, with distinct modules responsible for different aspects of the application. This promotes separation of concerns, maintainability, and testability.
10 
11- **Main Modules and Responsibilities**:
12 
13 - **[`commands.js`](mdc:scripts/modules/commands.js): Command Handling**
14 - **Purpose**: Defines and registers all CLI commands using Commander.js.
15 - **Responsibilities**:
16 - Parses command-line arguments and options.
17 - Invokes appropriate functions from other modules to execute commands.
18 - Handles user input and output related to command execution.
19 - Implements input validation and error handling for CLI commands.
20 - **Key Components**:
21 - `programInstance` (Commander.js `Command` instance): Manages command definitions.
22 - `registerCommands(programInstance)`: Function to register all application commands.
23 - Command action handlers: Functions executed when a specific command is invoked.
24 
25 - **[`task-manager.js`](mdc:scripts/modules/task-manager.js): Task Data Management**
26 - **Purpose**: Manages task data, including loading, saving, creating, updating, deleting, and querying tasks.
27 - **Responsibilities**:
28 - Reads and writes task data to `tasks.json` file.
29 - Implements functions for task CRUD operations (Create, Read, Update, Delete).
30 - Handles task parsing from PRD documents using AI.
31 - Manages task expansion and subtask generation.
32 - Updates task statuses and properties.
33 - Implements task listing and display logic.
34 - Performs task complexity analysis using AI.
35 - **Key Functions**:
36 - `readTasks(tasksPath)` / `writeTasks(tasksPath, tasksData)`: Load and save task data.
37 - `parsePRD(prdFilePath, outputPath, numTasks)`: Parses PRD document to create tasks.
38 - `expandTask(taskId, numSubtasks, useResearch, prompt, force)`: Expands a task into subtasks.
39 - `setTaskStatus(tasksPath, taskIdInput, newStatus)`: Updates task status.
40 - `listTasks(tasksPath, statusFilter, withSubtasks)`: Lists tasks with filtering and subtask display options.
41 - `analyzeComplexity(tasksPath, reportPath, useResearch, thresholdScore)`: Analyzes task complexity.
42 
43 - **[`dependency-manager.js`](mdc:scripts/modules/dependency-manager.js): Dependency Management**
44 - **Purpose**: Manages task dependencies, including adding, removing, validating, and fixing dependency relationships.
45 - **Responsibilities**:
46 - Adds and removes task dependencies.
47 - Validates dependency relationships to prevent circular dependencies and invalid references.
48 - Fixes invalid dependencies by removing non-existent or self-referential dependencies.
49 - Provides functions to check for circular dependencies.
50 - **Key Functions**:
51 - `addDependency(tasksPath, taskId, dependencyId)`: Adds a dependency between tasks.
52 - `removeDependency(tasksPath, taskId, dependencyId)`: Removes a dependency.
53 - `validateDependencies(tasksPath)`: Validates task dependencies.
54 - `fixDependencies(tasksPath)`: Fixes invalid task dependencies.
55 - `isCircularDependency(tasks, taskId, dependencyChain)`: Detects circular dependencies.
56 
57 - **[`ui.js`](mdc:scripts/modules/ui.js): User Interface Components**
58 - **Purpose**: Handles all user interface elements, including displaying information, formatting output, and providing user feedback.
59 - **Responsibilities**:
60 - Displays task lists, task details, and command outputs in a formatted way.
61 - Uses `chalk` for colored output and `boxen` for boxed messages.
62 - Implements table display using `cli-table3`.
63 - Shows loading indicators using `ora`.
64 - Provides helper functions for status formatting, dependency display, and progress reporting.
65 - Suggests next actions to the user after command execution.
66 - **Key Functions**:
67 - `displayTaskList(tasks, statusFilter, withSubtasks)`: Displays a list of tasks in a table.
68 - `displayTaskDetails(task)`: Displays detailed information for a single task.
69 - `displayComplexityReport(reportPath)`: Displays the task complexity report.
70 - `startLoadingIndicator(message)` / `stopLoadingIndicator(indicator)`: Manages loading indicators.
71 - `getStatusWithColor(status)`: Returns status string with color formatting.
72 - `formatDependenciesWithStatus(dependencies, allTasks, inTable)`: Formats dependency list with status indicators.
73 
74 - **[`ai-services.js`](mdc:scripts/modules/ai-services.js) (Conceptual): AI Integration**
75 - **Purpose**: Abstracts interactions with AI models (like Anthropic Claude and Perplexity AI) for various features. *Note: This module might be implicitly implemented within `task-manager.js` and `utils.js` or could be explicitly created for better organization as the project evolves.*
76 - **Responsibilities**:
77 - Handles API calls to AI services.
78 - Manages prompts and parameters for AI requests.
79 - Parses AI responses and extracts relevant information.
80 - Implements logic for task complexity analysis, task expansion, and PRD parsing using AI.
81 - **Potential Functions**:
82 - `getAIResponse(prompt, model, maxTokens, temperature)`: Generic function to interact with AI model.
83 - `analyzeTaskComplexityWithAI(taskDescription)`: Sends task description to AI for complexity analysis.
84 - `expandTaskWithAI(taskDescription, numSubtasks, researchContext)`: Generates subtasks using AI.
85 - `parsePRDWithAI(prdContent)`: Extracts tasks from PRD content using AI.
86 
87 - **[`utils.js`](mdc:scripts/modules/utils.js): Utility Functions and Configuration**
88 - **Purpose**: Provides reusable utility functions and global configuration settings used across the application.
89 - **Responsibilities**:
90 - Manages global configuration settings loaded from environment variables and defaults.
91 - Implements logging utility with different log levels and output formatting.
92 - Provides file system operation utilities (read/write JSON files).
93 - Includes string manipulation utilities (e.g., `truncate`, `sanitizePrompt`).
94 - Offers task-specific utility functions (e.g., `formatTaskId`, `findTaskById`, `taskExists`).
95 - Implements graph algorithms like cycle detection for dependency management.
96 - **Key Components**:
97 - `CONFIG`: Global configuration object.
98 - `log(level, ...args)`: Logging function.
99 - `readJSON(filepath)` / `writeJSON(filepath, data)`: File I/O utilities for JSON files.
100 - `truncate(text, maxLength)`: String truncation utility.
101 - `formatTaskId(id)` / `findTaskById(tasks, taskId)`: Task ID and search utilities.
102 - `findCycles(subtaskId, dependencyMap)`: Cycle detection algorithm.
103 
104- **Data Flow and Module Dependencies**:
105 
106 - **Commands Initiate Actions**: User commands entered via the CLI (handled by [`commands.js`](mdc:scripts/modules/commands.js)) are the entry points for most operations.
107 - **Command Handlers Delegate to Managers**: Command handlers in [`commands.js`](mdc:scripts/modules/commands.js) call functions in [`task-manager.js`](mdc:scripts/modules/task-manager.js) and [`dependency-manager.js`](mdc:scripts/modules/dependency-manager.js) to perform core task and dependency management logic.
108 - **UI for Presentation**: [`ui.js`](mdc:scripts/modules/ui.js) is used by command handlers and task/dependency managers to display information to the user. UI functions primarily consume data and format it for output, without modifying core application state.
109 - **Utilities for Common Tasks**: [`utils.js`](mdc:scripts/modules/utils.js) provides helper functions used by all other modules for configuration, logging, file operations, and common data manipulations.
110 - **AI Services Integration**: AI functionalities (complexity analysis, task expansion, PRD parsing) are invoked from [`task-manager.js`](mdc:scripts/modules/task-manager.js) and potentially [`commands.js`](mdc:scripts/modules/commands.js), likely using functions that would reside in a dedicated `ai-services.js` module or be integrated within `utils.js` or `task-manager.js`.
111 
112- **Testing Architecture**:
113 
114 - **Test Organization Structure**:
115 - **Unit Tests**: Located in `tests/unit/`, reflect the module structure with one test file per module
116 - **Integration Tests**: Located in `tests/integration/`, test interactions between modules
117 - **End-to-End Tests**: Located in `tests/e2e/`, test complete workflows from a user perspective
118 - **Test Fixtures**: Located in `tests/fixtures/`, provide reusable test data
119 
120 - **Module Design for Testability**:
121 - **Explicit Dependencies**: Functions accept their dependencies as parameters rather than using globals
122 - **Functional Style**: Pure functions with minimal side effects make testing deterministic
123 - **Separate Logic from I/O**: Core business logic is separated from file system operations
124 - **Clear Module Interfaces**: Each module has well-defined exports that can be mocked in tests
125 - **Callback Isolation**: Callbacks are defined as separate functions for easier testing
126 - **Stateless Design**: Modules avoid maintaining internal state where possible
127 
128 - **Mock Integration Patterns**:
129 - **External Libraries**: Libraries like `fs`, `commander`, and `@anthropic-ai/sdk` are mocked at module level
130 - **Internal Modules**: Application modules are mocked with appropriate spy functions
131 - **Testing Function Callbacks**: Callbacks are extracted from mock call arguments and tested in isolation
132 - **UI Elements**: Output functions from `ui.js` are mocked to verify display calls
133 
134 - **Testing Flow**:
135 - Module dependencies are mocked (following Jest's hoisting behavior)
136 - Test modules are imported after mocks are established
137 - Spy functions are set up on module methods
138 - Tests call the functions under test and verify behavior
139 - Mocks are reset between test cases to maintain isolation
140 
141- **Benefits of this Architecture**:
142 
143 - **Maintainability**: Modules are self-contained and focused, making it easier to understand, modify, and debug specific features.
144 - **Testability**: Each module can be tested in isolation (unit testing), and interactions between modules can be tested (integration testing).
145 - **Mocking Support**: The clear dependency boundaries make mocking straightforward
146 - **Test Isolation**: Each component can be tested without affecting others
147 - **Callback Testing**: Function callbacks can be extracted and tested independently
148 - **Reusability**: Utility functions and UI components can be reused across different parts of the application.
149 - **Scalability**: New features can be added as new modules or by extending existing ones without significantly impacting other parts of the application.
150 - **Clarity**: The modular structure provides a clear separation of concerns, making the codebase easier to navigate and understand for developers.
151 
152This architectural overview should help AI models understand the structure and organization of the Task Master CLI codebase, enabling them to more effectively assist with code generation, modification, and understanding.

Commands it names

  • task-manager.js

Sections

  • Application Architecture Overview

What it covers

testarchitecturetesting-strategy

Stack — with the evidence

javascript

(1.00)

jest

(1.00)

express

(0.70)

node

(0.50)

Glob targeting

  • scripts/modules/*.js

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
skindhu
Language
—
License
—
Archived
no

All configs in this repo

Also in skindhu/AI-TASK-MANAGER

Diff this repo’s formats

One 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?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
skindhu/AI-TASK-MANAGER.cursor/rules/ui.mdc · 192Cursor rulesjavascriptjest+2ui62/1003 days ago
skindhu/AI-TASK-MANAGER.cursor/rules/commands.mdc · 192Cursor rulesjavascriptjest+2stylearch62/1003 days ago
skindhu/AI-TASK-MANAGER.cursor/rules/cursor_rules.mdc · 192Cursor rulesjavascriptjest+2no sections36/1003 days ago
skindhu/AI-TASK-MANAGER.cursor/rules/dependencies.mdc · 192Cursor rulesjavascriptjest+2arch66/1003 days ago
skindhu/AI-TASK-MANAGER.cursor/rules/dev_workflow.mdc · 192Cursor rulesjavascriptjest+2setup52/1003 days ago
skindhu/AI-TASK-MANAGER.cursor/rules/new_features.mdc · 192Cursor rulesjavascriptjest+2testtesting-strategydocs65/1003 days ago
skindhu/AI-TASK-MANAGER.cursor/rules/self_improve.mdc · 192Cursor rulesjavascriptjest+2no sections36/1003 days ago
skindhu/AI-TASK-MANAGER.cursor/rules/tasks.mdc · 192Cursor rulesjavascriptjest+2arch70/1003 days ago
skindhu/AI-TASK-MANAGER.cursor/rules/tests.mdc · 192Cursor rulesjavascriptjest+2teststylearchtesting-strategy+174/1003 days ago
skindhu/AI-TASK-MANAGER.cursor/rules/utilities.mdc · 192Cursor rulesjavascriptjest+2securitydocs54/1003 days ago
skindhu/AI-TASK-MANAGERassets/.windsurfrules · 192Windsurf rulesjavascriptjest+2setup40/1003 days ago
Diff against .cursor/rules/ui.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/tasks.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.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45Cursor rulestypescriptpytest+15testlint-formatstylearch+5100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1Cursor rulestypescriptnextjs+5setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
langflow-ai/langflow.cursor/rules/docs_development.mdc · 153kCursor rulespythonnode+16setupbuildtestlint-format+797/1003 days ago
TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45Cursor rulestypescriptpytest+15teststyletesting-strategysecurity+397/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack