How dvc2/task_tracker works
Project type and purpose
• TaskTracker is a terminal-based CLI application (Node.js) for task management.
• It has a modular architecture, with command handlers, core/domain services, integration adapters, and file-based persistence.
• Key use cases: create/list/update tasks, track file&git context, generate AI context, produce reports/statistics.
File structure
Top-level directories:
• bin/ → CLI entrypoints (shell wrappers, “tt”, “tasktracker”)
• lib/commands/ → One JS file per CLI command (“add.js”, “list.js”, etc.)
• lib/core/ → Domain logic / services (TaskManager, ConfigManager, ArchiveManager…)
• lib/integration/→ Adapters for AI, auto-tracking, external tools
• lib/reporting/ → Charting, stats, journal generators
• lib/utils/ → Shared utilities (CLI parsing, security, output formatting)
• .tasktracker/ → Local JSON data store (config, archives, stats, reports)
• tests/ → Unit/integration/performance/security tests
• docs/ → Documentation, including architecture notes
Config/build/deployment files:
• package.json / install.js → NPM package config & installer
• .github/workflows → CI for tests
• .gitignore, VERSION, LICENSE, CHANGELOG
README for additional insights
• Confirms modular design, AI integration, git integration, plugin support, statistics & reporting.
a. Components:
1. Presentation Layer
– CLI entrypoints (bin/tt, bin/tasktracker, shell-completion scripts)
– Command-line parser
2. Application Layer
– Command Registry & Dispatch (lib/commands/index.js)
– Individual Command Handlers (add, list, update, ai-context, stats…)
3. Domain/Core Layer
– TaskManager, ConfigManager, ArchiveManager, DependencyTracker, FileCache, PerfMonitor, ListManager, QuickTask, TaskContext, TaskCommit
4. Integration Layer
– AI Integration Adapter (ai-context-cache, auto-tracker.sh)
– Git Integration (via core file-cache & dependency tracker)
5. Reporting Layer
– BurndownChart, StatsTracker, TaskJournal
6. Persistence Layer
– Local File Store (.tasktracker/*.json)
7. External Services
– AI API (OpenAI/Claude), Git CLI, Possibly plugins (custom modules)
b. Relationships & interactions:
• User types “tt <command>” → shell script → Node process
• CLI Parser reads args → dispatches to correct Command Handler
• Command Handler invokes Core services (e.g., TaskManager)
• Core services read/write JSON files via ConfigManager/FileCache
• Integration adapters called when needed (AI context uses AI API, Git integration uses exec/git commands)
• Reporting modules consume core data to generate charts or reports
• Output streamed back to terminal
c. Architectural patterns & design principles:
• Layered architecture (Presentation → Application → Domain → Persistence)
• Command pattern for CLI commands
• Adapter pattern for AI/Git integrations
• Single-responsibility modules (each core class handles one concern)
• File-based persistence (lightweight, no external DB)
• Modular/plugin extensibility
d. Key technologies & frameworks:
• Node.js (lib/)
• NPM CLI packaging
• Shell scripts for wrappers and completion
• JSON file store under .tasktracker/
• External AI APIs (via integration modules)
• Git CLI
Detail
• .tasktracker folder as a bundle of JSON files
• Call out AI-integration and auto-tracker as separate adapter modules
• Shell-completion scripts as optional entrypoints