Skip to content

Commit 3377f04

Browse files
committed
Refactor: Complete architectural restructuring from monolithic to modular design
1 parent 95e40e3 commit 3377f04

105 files changed

Lines changed: 10174 additions & 6358 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursorrules

Lines changed: 79 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,135 +1,80 @@
1-
# TaskTracker Cursor Integration
2-
# This file enhances TaskTracker functionality within Cursor IDE
3-
4-
# Get current tasktracker tasks
5-
task.get_tasks = tasktracker list --minimal
6-
7-
# Get task details
8-
task.view_task = tasktracker view $1
9-
10-
# Add quick task
11-
task.add_quick = tasktracker quick "$1" "${2:-feature}"
12-
13-
# Change task status
14-
task.status_todo = tasktracker update $1 status todo
15-
task.status_in_progress = tasktracker update $1 status in-progress
16-
task.status_review = tasktracker update $1 status review
17-
task.status_done = tasktracker update $1 status done
18-
19-
# Add comment to task
20-
task.comment = tasktracker update $1 comment "$2"
21-
22-
# Add current file to task
23-
task.add_file = tasktracker update $1 addfile "${cursor.file}"
24-
25-
# Track file changes and link to tasks
26-
task.track_changes = tasktracker changes
27-
28-
# Show statistics
29-
task.stats = tasktracker snapshot
30-
31-
# Generate task context for AI assistant
32-
task.context = tasktracker ai-context $1
33-
34-
# Show burndown chart
35-
task.burndown = ./lib/burndown-chart.js --format=ascii
36-
37-
# Run batch commands to save premium tool calls
38-
task.batch = ./bin/tasktracker-batch $1
39-
40-
# Show dependencies
41-
task.deps = tasktracker list --json | jq '[.tasks[] | select(.dependencies != null or .blockedBy != null)]'
42-
43-
# Create a PR description from task
44-
task.pr_desc = |
45-
function generatePrDescription() {
46-
const taskId = process.argv[2];
47-
if (!taskId) {
48-
console.log("Usage: task.pr_desc <task_id>");
49-
return;
1+
{
2+
"commands": [
3+
{"name": "task.list", "command": "tt list", "description": "List all tasks"},
4+
{"name": "task.list_todo", "command": "tt list todo", "description": "List only TO-DO tasks"},
5+
{"name": "task.list_in_progress", "command": "tt list in-progress", "description": "List tasks in progress"},
6+
{"name": "task.view", "command": "tt view %s", "description": "View details of a specific task by ID"},
7+
{"name": "task.add", "command": "tt add", "description": "Add a new task interactively"},
8+
{"name": "task.quick", "command": "tt quick \"%s\" %s", "description": "Quickly add a task with title and category"},
9+
{"name": "task.update_status", "command": "tt update %s status %s", "description": "Update task status (task_id, new_status)"},
10+
{"name": "task.add_file", "command": "tt update %s add-file %s", "description": "Link a file to a task (task_id, file_path)"},
11+
{"name": "task.comment", "command": "tt update %s comment \"%s\"", "description": "Add a comment to a task (task_id, comment)"},
12+
{"name": "task.changes", "command": "tt changes", "description": "Show recent file changes"},
13+
{"name": "task.ai_context", "command": "tt ai-context", "description": "Generate AI-friendly context from tasks"},
14+
{"name": "task.stats", "command": "tt stats", "description": "Show task statistics"}
15+
],
16+
"rules": [
17+
{
18+
"description": "Create task related to file you're editing",
19+
"match": {
20+
"trigger": "create task",
21+
"patterns": [
22+
"create task",
23+
"add task",
24+
"new task"
25+
]
26+
},
27+
"actions": [
28+
{
29+
"type": "suggest_command",
30+
"command": "task.quick",
31+
"args": [
32+
"$ASK:Task title?",
33+
"$ASK:Category? (feature|bugfix|refactor|docs|chore)"
34+
]
35+
}
36+
]
37+
},
38+
{
39+
"description": "Link current file to task",
40+
"match": {
41+
"trigger": "link task",
42+
"patterns": [
43+
"link (to|with) task",
44+
"associate (with|to) task",
45+
"connect to task"
46+
]
47+
},
48+
"actions": [
49+
{
50+
"type": "suggest_command",
51+
"command": "task.add_file",
52+
"args": [
53+
"$ASK:Task ID?",
54+
"$CURSOR_FILE"
55+
]
56+
}
57+
]
58+
},
59+
{
60+
"description": "View task details",
61+
"match": {
62+
"trigger": "view task",
63+
"patterns": [
64+
"show task",
65+
"view task",
66+
"task details"
67+
]
68+
},
69+
"actions": [
70+
{
71+
"type": "suggest_command",
72+
"command": "task.view",
73+
"args": [
74+
"$ASK:Task ID?"
75+
]
76+
}
77+
]
5078
}
51-
52-
const { execSync } = require('child_process');
53-
const result = execSync(`tasktracker view ${taskId} --json`).toString();
54-
const task = JSON.parse(result);
55-
56-
let description = `## Task #${task.id}: ${task.title}\n\n`;
57-
58-
if (task.description) {
59-
description += `${task.description}\n\n`;
60-
}
61-
62-
description += `**Category:** ${task.category}\n`;
63-
64-
if (task.priority) {
65-
description += `**Priority:** ${task.priority}\n`;
66-
}
67-
68-
if (task.relatedFiles && task.relatedFiles.length > 0) {
69-
description += `\n### Files Changed\n`;
70-
task.relatedFiles.forEach(file => {
71-
description += `- \`${file}\`\n`;
72-
});
73-
}
74-
75-
if (task.checklists && task.checklists.length > 0) {
76-
description += `\n### Checklist\n`;
77-
78-
task.checklists.forEach(checklist => {
79-
description += `\n#### ${checklist.title}\n`;
80-
81-
checklist.items.forEach(item => {
82-
const checkbox = item.completed ? 'x' : ' ';
83-
description += `- [${checkbox}] ${item.text}\n`;
84-
});
85-
});
86-
}
87-
88-
description += `\nResolves #${task.id}`;
89-
90-
console.log(description);
91-
}
92-
93-
generatePrDescription();
94-
95-
# When creating a cursor task with TaskTracker, this adds a helpful comment template
96-
create_task.template = """
97-
/**
98-
* Task #${task.id}: ${task.title}
99-
* Status: ${task.status}
100-
* Category: ${task.category}
101-
*
102-
* Description:
103-
* ${task.description}
104-
*
105-
* Related Files:
106-
* ${task.relatedFiles?.join('\n * ')}
107-
*
108-
* Dependencies:
109-
* ${task.dependencies?.map(id => `#${id}`).join(', ')}
110-
*/
111-
"""
112-
113-
# Generate documentation comment
114-
task.doc_comment = """
115-
/**
116-
* ${1:Function description}
117-
*
118-
* Related to Task #${2:taskId}: ${3:taskTitle}
119-
*
120-
* @param {${4:Type}} ${5:paramName} - ${6:Description}
121-
* @returns {${7:Type}} ${8:Description}
122-
*/
123-
"""
124-
125-
# Custom key bindings for TaskTracker
126-
key.ctrl+alt+t = task.get_tasks
127-
key.ctrl+alt+n = task.add_quick "New task from Cursor" feature
128-
key.ctrl+alt+c = task.track_changes
129-
key.ctrl+alt+v = task.view_task ${cursor.selected}
130-
key.ctrl+alt+d = task.status_done ${cursor.selected}
131-
key.ctrl+shift+b = task.burndown --format=ascii
132-
133-
# Add cursor status bar integration
134-
statusbar.left = "TaskTracker: ${task.current_task || 'No task'}"
135-
statusbar.right = "Priority: ${task.current_priority || 'None'}"
79+
]
80+
}

.github/copilot/tasktracker-commands.md

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,24 @@ This document helps GitHub Copilot understand TaskTracker commands and functiona
44

55
## Core Commands
66

7-
- Initialize a repository: `tasktracker init`
8-
- Add a task (interactive): `tasktracker add`
9-
- Add a quick task: `tasktracker quick "Task title" category`
10-
- List all tasks: `tasktracker list`
11-
- List tasks by status: `tasktracker list todo`
12-
- View task details: `tasktracker view <id>`
13-
- Update a task: `tasktracker update <id> <field> <value>`
14-
- Track changes: `tasktracker changes`
15-
- Create a release: `tasktracker release`
7+
- Initialize a repository: `tt init`
8+
- Add a task (interactive): `tt add`
9+
- Add a quick task: `tt quick "Task title" category`
10+
- List all tasks: `tt list`
11+
- List tasks by status: `tt list todo`
12+
- View task details: `tt view <id>`
13+
- Update a task: `tt update <id> <field> <value>`
14+
- Track changes: `tt changes`
15+
- Create a release: `tt release`
16+
- Generate AI context: `tt ai-context`
17+
- View task statistics: `tt stats`
1618

1719
## Task Status Commands
1820

19-
- Mark as todo: `tasktracker update <id> status todo`
20-
- Mark as in progress: `tasktracker update <id> status in-progress`
21-
- Mark as in review: `tasktracker update <id> status review`
22-
- Mark as done: `tasktracker update <id> status done`
21+
- Mark as todo: `tt update <id> status todo`
22+
- Mark as in progress: `tt update <id> status in-progress`
23+
- Mark as in review: `tt update <id> status review`
24+
- Mark as done: `tt update <id> status done`
2325

2426
## Task Fields
2527

@@ -28,38 +30,58 @@ Update these fields with the `update` command:
2830
- category: The type of task (feature, bugfix, refactor, docs, test, chore)
2931
- title: The task title
3032
- description: The task description
31-
- addfile: Add a file to the task
33+
- add-file: Add a file to the task
34+
- remove-file: Remove a file from the task
3235
- comment: Add a comment to the task
36+
- priority: Set priority (p0-critical, p1-high, p2-medium, p3-low)
37+
- effort: Set effort (1-trivial, 2-small, 3-medium, 5-large, 8-xlarge)
38+
39+
## Archive Management
40+
41+
- Archive a task: `tt archive <id> [reason]`
42+
- Restore a task: `tt restore <id>`
43+
- List archived tasks: `tt archives`
3344

3445
## Example Usage
3546

3647
```bash
3748
# Add a new feature task
38-
tasktracker quick "Implement login page" feature
49+
tt quick "Implement login page" feature
3950

4051
# Mark task #3 as in progress
41-
tasktracker update 3 status in-progress
52+
tt update 3 status in-progress
4253

4354
# Add a comment to task #3
44-
tasktracker update 3 comment "Working on this now, should be done by tomorrow"
55+
tt update 3 comment "Working on this now, should be done by tomorrow"
4556

4657
# Link a file to task #3
47-
tasktracker update 3 addfile src/components/Login.js
58+
tt update 3 add-file src/components/Login.js
4859

4960
# View details of task #3
50-
tasktracker view 3
61+
tt view 3
5162

52-
# Create a new release
53-
tasktracker release
63+
# Generate AI context for Claude
64+
tt ai-context > ai-prompt.txt
5465
```
5566

5667
## Aliases
5768

58-
- `tt` is an alias for `tasktracker` (if installed globally)
69+
- Common aliases are built into the command system
70+
- `ls` is an alias for `list`
71+
- `files` is an alias for `changes`
72+
- `status` is an alias for `list`
73+
74+
## Architecture Notes
75+
76+
- TaskTracker uses a modular command registry pattern
77+
- Each command is in its own module in the `lib/commands` directory
78+
- Core services are in the `lib/core` directory
79+
- Refactored in v2.0.0 from monolithic script to modular architecture
5980

6081
## For AI Assistants
6182

6283
When asked to perform task-related actions:
6384
1. Suggest using the appropriate TaskTracker command
64-
2. Use `tt` or `tasktracker` based on user preference
65-
3. Format task titles clearly with proper quotes
85+
2. Use `tt` for all commands (preferred over the longer `tasktracker`)
86+
3. Format task titles clearly with proper quotes
87+
4. Use `tt ai-context` to generate context for AI-assisted work

0 commit comments

Comments
 (0)