bmad-method 4.27.1 → 4.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,500 @@
1
+ # TermTodo Product Requirements Document (PRD)
2
+
3
+ ## Goals and Background Context
4
+
5
+ ### Goals
6
+
7
+ - Deliver a terminal todo app that executes all commands in under 100ms
8
+ - Eliminate context switching for developers who live in the command line
9
+ - Provide intuitive task management through simple, memorable commands
10
+ - Enable seamless integration with existing terminal workflows (git, editors, scripts)
11
+ - Achieve zero data loss with robust local SQLite storage
12
+ - Build a tool that feels native to terminal power users
13
+ - Create a maintainable single-binary distribution for easy installation
14
+
15
+ ### Background Context
16
+
17
+ TermTodo addresses a critical gap in developer productivity tools. While numerous todo applications exist, they force developers to break their flow by switching between terminal and GUI applications. Current solutions are either bloated web applications with unnecessary features or simplistic command-line tools that lack essential task management capabilities. TermTodo strikes the balance by providing a fast, local-first solution that integrates naturally into terminal-based workflows.
18
+
19
+ The application targets developers and system administrators who value speed and efficiency over visual polish. By focusing on sub-100ms execution times and keyboard-driven interactions, TermTodo eliminates the friction that prevents consistent task tracking in fast-paced development environments. The choice of Rust ensures performance goals are met while providing a single binary that's easy to distribute and install across Linux, macOS, and Windows (WSL) platforms.
20
+
21
+ ### Change Log
22
+
23
+ | Date | Version | Description | Author |
24
+ | ---------- | ------- | ------------------------------------------- | -------- |
25
+ | 2025-07-07 | 1.0 | Initial PRD creation based on Project Brief | PM Agent |
26
+
27
+ ## Requirements
28
+
29
+ ### Functional
30
+
31
+ - FR1: The application must support adding tasks with a single command (e.g., `todo add "Complete code review"`)
32
+ - FR2: Users must be able to mark tasks as complete/incomplete with toggle functionality
33
+ - FR3: The application must support editing existing task descriptions
34
+ - FR4: Users must be able to delete individual tasks or bulk delete completed tasks
35
+ - FR5: The application must list tasks with configurable filtering by status, priority, project, and tags
36
+ - FR6: Task organization must support project-based grouping with easy project switching
37
+ - FR7: Each task must support priority levels (high, medium, low) with visual indicators in listings
38
+ - FR8: Tasks must support optional due dates with human-readable input (e.g., "tomorrow", "next friday")
39
+ - FR9: The application must provide full-text search across all task fields
40
+ - FR10: Users must be able to add and remove tags from tasks for flexible categorization
41
+ - FR11: The application must support task templates for recurring task patterns
42
+ - FR12: Shell completion must be available for all commands and common parameters
43
+ - FR13: The application must provide export functionality to common formats (JSON, CSV, Markdown)
44
+ - FR14: Configuration must be manageable through TOML files with sensible defaults
45
+
46
+ ### Non Functional
47
+
48
+ - NFR1: All commands must execute in under 100ms from invocation to completion
49
+ - NFR2: Cold start time must be under 50ms on standard developer hardware
50
+ - NFR3: Memory usage must not exceed 10MB during normal operation
51
+ - NFR4: The application must be distributed as a single static binary with no runtime dependencies
52
+ - NFR5: Data storage must use SQLite with ACID compliance for zero data loss
53
+ - NFR6: The CLI must follow Unix conventions (stdin/stdout, exit codes, composability)
54
+ - NFR7: All user-facing messages must be clear, concise, and actionable
55
+ - NFR8: The application must support Linux and macOS as primary platforms, Windows via WSL
56
+ - NFR9: Installation must be possible through major package managers (brew, apt, cargo)
57
+ - NFR10: The codebase must maintain 80%+ test coverage for reliability
58
+ - NFR11: All commands must be documented with man pages and --help output
59
+ - NFR12: The application must handle 10,000+ tasks without performance degradation
60
+ - NFR13: Error messages must provide clear guidance for resolution
61
+ - NFR14: The application must support UTF-8 for international task descriptions
62
+
63
+ ## Technical Assumptions
64
+
65
+ ### Repository Structure: Monorepo
66
+
67
+ Single repository containing all TermTodo code, tests, documentation, and build configurations. This simplifies development, testing, and distribution for a focused CLI tool.
68
+
69
+ ### Service Architecture
70
+
71
+ **Monolith** - TermTodo will be built as a single, self-contained binary with all functionality compiled in. This architecture aligns with our performance goals (sub-50ms startup) and distribution requirements (single binary). The SQLite database will be embedded, and all operations will run in-process without network dependencies.
72
+
73
+ ### Testing Requirements
74
+
75
+ **Full Testing Pyramid** - Given the critical nature of data integrity and performance requirements:
76
+
77
+ - **Unit Tests**: Core business logic, data models, command parsing
78
+ - **Integration Tests**: SQLite operations, file I/O, command execution flows
79
+ - **E2E Tests**: Full command-line scenarios using the actual binary
80
+ - **Performance Tests**: Automated benchmarks ensuring sub-100ms execution
81
+ - **Manual Testing Helpers**: Debug commands and verbose modes for troubleshooting
82
+
83
+ ### Additional Technical Assumptions and Requests
84
+
85
+ - **Language**: Rust (as specified in Project Brief) for performance and memory safety
86
+ - **CLI Framework**: Clap v4+ for robust argument parsing and automatic help generation
87
+ - **Database**: SQLite with schema migrations support (using sqlx or diesel)
88
+ - **Error Handling**: Comprehensive error types with user-friendly messages using anyhow/thiserror
89
+ - **Configuration**: TOML for human-readable config files, with XDG base directory compliance
90
+ - **Build System**: Cargo with cross-compilation support for Linux/macOS/Windows targets
91
+ - **Serialization**: Serde for JSON/CSV export functionality
92
+ - **Date Parsing**: Chrono with chrono-english for human-readable date input
93
+ - **Terminal Output**: Colored output using termcolor, respecting NO_COLOR environment variable
94
+ - **Shell Completion**: Built-in completion generation for bash, zsh, fish, and PowerShell
95
+ - **Packaging**: Release binaries via GitHub releases, plus cargo, brew tap, and AUR support
96
+ - **Documentation**: Embedded man pages generated from clap, README with examples
97
+ - **Logging**: Optional debug logging to file (not stdout) for troubleshooting
98
+ - **Benchmarking**: Criterion.rs for performance regression testing in CI
99
+
100
+ ## Epic List
101
+
102
+ - **Epic 1: Foundation & Core Task Management**: Establish project infrastructure, CI/CD, and implement basic CRUD operations for tasks with SQLite storage
103
+ - **Epic 2: Organization & Filtering**: Implement project-based task grouping, priority levels, tags, and comprehensive filtering capabilities
104
+ - **Epic 3: Advanced Features & Integration**: Add due dates, search functionality, shell completion, templates, and import/export capabilities
105
+
106
+ ## Epic 1: Foundation & Core Task Management
107
+
108
+ Establish the foundational infrastructure for TermTodo including project setup, continuous integration, and core task CRUD operations. This epic delivers a functional but minimal todo application that can add, list, complete, and delete tasks with persistent SQLite storage, while meeting our aggressive performance requirements.
109
+
110
+ ### Story 1.1: Project Setup and Infrastructure
111
+
112
+ As a developer,
113
+ I want a properly structured Rust project with CI/CD pipelines,
114
+ so that I can ensure code quality and automated releases from the start.
115
+
116
+ #### Acceptance Criteria
117
+
118
+ 1: Repository initialized with Rust project structure and .gitignore
119
+ 2: Cargo.toml configured with project metadata and initial dependencies (clap, sqlx, tokio)
120
+ 3: GitHub Actions workflow for CI (test, lint, build) on all platforms
121
+ 4: GitHub Actions workflow for CD (release binaries) on tag push
122
+ 5: Basic README with project description and development setup instructions
123
+ 6: Pre-commit hooks configured for formatting (rustfmt) and linting (clippy)
124
+ 7: MIT License file added
125
+ 8: Makefile with common development commands (test, build, release)
126
+
127
+ ### Story 1.2: CLI Framework and Command Structure
128
+
129
+ As a user,
130
+ I want a well-structured command-line interface with help documentation,
131
+ so that I can easily discover and use all available commands.
132
+
133
+ #### Acceptance Criteria
134
+
135
+ 1: Main CLI entry point implemented with clap v4
136
+ 2: Subcommand structure established (add, list, complete, delete, etc.)
137
+ 3: Global flags implemented (--version, --help, --config)
138
+ 4: Auto-generated help text for all commands and subcommands
139
+ 5: Version information properly displayed from Cargo.toml
140
+ 6: Exit codes follow Unix conventions (0 for success, non-zero for errors)
141
+ 7: Basic error handling structure with user-friendly messages
142
+
143
+ ### Story 1.3: SQLite Database Layer
144
+
145
+ As a developer,
146
+ I want a robust database layer with schema management,
147
+ so that I can reliably store and retrieve tasks with ACID compliance.
148
+
149
+ #### Acceptance Criteria
150
+
151
+ 1: SQLite connection pool initialized with proper settings
152
+ 2: Initial schema migration creating tasks table (id, description, status, created_at, updated_at)
153
+ 3: Migration system implemented for future schema changes
154
+ 4: Database file created in XDG-compliant data directory
155
+ 5: Connection timeout and busy handling configured for concurrent access
156
+ 6: Basic database error handling with rollback support
157
+ 7: Database layer abstraction with trait for testability
158
+
159
+ ### Story 1.4: Add Task Functionality
160
+
161
+ As a user,
162
+ I want to quickly add new tasks from the command line,
163
+ so that I can capture todo items without breaking my workflow.
164
+
165
+ #### Acceptance Criteria
166
+
167
+ 1: "todo add <description>" command creates new task in database
168
+ 2: Task description supports UTF-8 and quotes/special characters
169
+ 3: Newly created task ID displayed on successful addition
170
+ 4: Task creation timestamp automatically recorded
171
+ 5: Performance requirement met: command completes in <100ms
172
+ 6: Error shown if description is empty or too long (>1000 chars)
173
+ 7: Success message confirms task was added
174
+
175
+ ### Story 1.5: List Tasks Functionality
176
+
177
+ As a user,
178
+ I want to see my current tasks in a clear format,
179
+ so that I can review what needs to be done.
180
+
181
+ #### Acceptance Criteria
182
+
183
+ 1: "todo list" command displays all incomplete tasks
184
+ 2: Output shows task ID, description, and age (e.g., "2 days ago")
185
+ 3: Tasks sorted by creation date (oldest first) by default
186
+ 4: Completed tasks hidden by default
187
+ 5: "--all" flag shows both complete and incomplete tasks
188
+ 6: Empty state message when no tasks exist
189
+ 7: Output formatted for terminal width with proper truncation
190
+
191
+ ### Story 1.6: Complete Task Functionality
192
+
193
+ As a user,
194
+ I want to mark tasks as complete,
195
+ so that I can track my progress.
196
+
197
+ #### Acceptance Criteria
198
+
199
+ 1: "todo complete <id>" marks specified task as complete
200
+ 2: Multiple IDs can be provided to complete multiple tasks
201
+ 3: Completion timestamp recorded in database
202
+ 4: Success message confirms which task(s) were completed
203
+ 5: Error shown for non-existent task IDs
204
+ 6: Already-completed tasks can be marked complete again (idempotent)
205
+ 7: Performance requirement met: command completes in <100ms
206
+
207
+ ### Story 1.7: Delete Task Functionality
208
+
209
+ As a user,
210
+ I want to delete tasks I no longer need,
211
+ so that I can keep my task list clean and relevant.
212
+
213
+ #### Acceptance Criteria
214
+
215
+ 1: "todo delete <id>" removes specified task from database
216
+ 2: Multiple IDs can be provided to delete multiple tasks
217
+ 3: Confirmation required by default (bypass with --force flag)
218
+ 4: Success message confirms which task(s) were deleted
219
+ 5: Error shown for non-existent task IDs
220
+ 6: "todo delete --completed" removes all completed tasks
221
+ 7: Deleted tasks cannot be recovered (documented in help)
222
+
223
+ ## Epic 2: Organization & Filtering
224
+
225
+ Implement comprehensive task organization features including projects, priorities, tags, and filtering capabilities. This epic transforms the basic todo app into a powerful task management system that can handle complex workflows while maintaining simplicity and performance.
226
+
227
+ ### Story 2.1: Project-Based Task Grouping
228
+
229
+ As a developer working on multiple projects,
230
+ I want to organize tasks by project,
231
+ so that I can focus on relevant tasks for my current context.
232
+
233
+ #### Acceptance Criteria
234
+
235
+ 1: Tasks table schema updated to include optional project field
236
+ 2: "todo add -p <project> <description>" assigns task to project
237
+ 3: "todo list -p <project>" filters tasks by project
238
+ 4: "todo projects" lists all unique projects with task counts
239
+ 5: Default project configurable in TOML config file
240
+ 6: Project names validated (alphanumeric + dash/underscore)
241
+ 7: Tasks without project show under "default" in listings
242
+
243
+ ### Story 2.2: Priority Levels
244
+
245
+ As a user,
246
+ I want to assign priority levels to tasks,
247
+ so that I can focus on what's most important.
248
+
249
+ #### Acceptance Criteria
250
+
251
+ 1: Tasks table schema updated to include priority field (high/medium/low)
252
+ 2: "todo add -P high <description>" sets task priority
253
+ 3: Default priority is "medium" if not specified
254
+ 4: Priority shown in task listings with visual indicators (!, !!, !!!)
255
+ 5: "todo list --priority high" filters by priority level
256
+ 6: Tasks sorted by priority within date sorting
257
+ 7: Priority can be updated with "todo priority <id> <level>"
258
+
259
+ ### Story 2.3: Tag System
260
+
261
+ As a user,
262
+ I want to add tags to tasks for flexible categorization,
263
+ so that I can create custom organizational schemes.
264
+
265
+ #### Acceptance Criteria
266
+
267
+ 1: Tags table created with many-to-many relationship to tasks
268
+ 2: "todo add <description> +tag1 +tag2" adds tags during creation
269
+ 3: Tags parsed from description (+ prefix) and stored separately
270
+ 4: "todo tag <id> +tag" adds tags to existing tasks
271
+ 5: "todo tag <id> -tag" removes tags from tasks
272
+ 6: "todo list +tag" filters tasks by tag
273
+ 7: "todo tags" lists all tags with usage counts
274
+
275
+ ### Story 2.4: Advanced Filtering
276
+
277
+ As a power user,
278
+ I want to combine multiple filters when listing tasks,
279
+ so that I can create precise views of my work.
280
+
281
+ #### Acceptance Criteria
282
+
283
+ 1: Multiple filters can be combined (project AND priority AND tags)
284
+ 2: "todo list -p work -P high +urgent" shows filtered results
285
+ 3: Date range filtering with --since and --until flags
286
+ 4: Status filtering with --status (incomplete/complete/all)
287
+ 5: Inverse filters supported with --not-project, --not-tag
288
+ 6: Filter combinations can be saved as named views in config
289
+ 7: Performance maintained under 100ms even with complex filters
290
+
291
+ ### Story 2.5: Configuration Management
292
+
293
+ As a user,
294
+ I want to customize default behaviors and preferences,
295
+ so that the tool works the way I prefer.
296
+
297
+ #### Acceptance Criteria
298
+
299
+ 1: TOML config file created at XDG config location on first run
300
+ 2: Config supports: default project, default priority, date format
301
+ 3: Config supports: color preferences, list sort order
302
+ 4: "todo config" opens config file in $EDITOR
303
+ 5: "todo config --list" shows current configuration
304
+ 6: Invalid config shows clear error without crashing
305
+ 7: Config changes take effect immediately (no restart needed)
306
+
307
+ ## Epic 3: Advanced Features & Integration
308
+
309
+ Add power-user features including due dates, full-text search, shell completion, templates, and data portability. This epic completes the feature set needed for TermTodo to become an indispensable part of a developer's workflow.
310
+
311
+ ### Story 3.1: Due Date Support
312
+
313
+ As a user,
314
+ I want to set due dates on tasks,
315
+ so that I can manage time-sensitive work effectively.
316
+
317
+ #### Acceptance Criteria
318
+
319
+ 1: Tasks table schema updated to include optional due_date field
320
+ 2: "todo add <description> due:tomorrow" sets due date with natural language
321
+ 3: Supported formats: "due:2024-12-31", "due:friday", "due:3d" (3 days)
322
+ 4: Due dates shown in task listings with urgency indicators
323
+ 5: "todo list --due" shows only tasks with due dates
324
+ 6: "todo list --overdue" shows past-due tasks highlighted
325
+ 7: Due date can be updated with "todo due <id> <date>"
326
+
327
+ ### Story 3.2: Full-Text Search
328
+
329
+ As a user with many tasks,
330
+ I want to search across all task fields,
331
+ so that I can quickly find specific items.
332
+
333
+ #### Acceptance Criteria
334
+
335
+ 1: "todo search <query>" searches description, project, and tags
336
+ 2: Search uses SQLite FTS5 for performance and features
337
+ 3: Results show matched tasks with search terms highlighted
338
+ 4: Search supports quoted phrases for exact matching
339
+ 5: Boolean operators AND/OR supported in queries
340
+ 6: Search results include context around matches
341
+ 7: Performance requirement met: search completes in <100ms
342
+
343
+ ### Story 3.3: Shell Completion
344
+
345
+ As a command-line power user,
346
+ I want shell completion for all commands and parameters,
347
+ so that I can work more efficiently.
348
+
349
+ #### Acceptance Criteria
350
+
351
+ 1: Completion scripts generated for bash, zsh, fish, PowerShell
352
+ 2: Command completion includes all subcommands and flags
353
+ 3: Project names completed for -p flag from existing projects
354
+ 4: Tag names completed after + prefix from existing tags
355
+ 5: Task IDs completed for complete/delete/update commands
356
+ 6: Installation instructions included in README
357
+ 7: Completion scripts included in distribution packages
358
+
359
+ ### Story 3.4: Task Templates
360
+
361
+ As a user with recurring task patterns,
362
+ I want to create templates for common tasks,
363
+ so that I can quickly add similar tasks.
364
+
365
+ #### Acceptance Criteria
366
+
367
+ 1: Templates stored in TOML config file with name and pattern
368
+ 2: "todo template create <name>" interactively creates template
369
+ 3: "todo template list" shows available templates
370
+ 4: "todo add --template <name>" creates task from template
371
+ 5: Templates support placeholders like {date}, {project}
372
+ 6: Templates can include default project, priority, tags
373
+ 7: "todo template delete <name>" removes unused templates
374
+
375
+ ### Story 3.5: Import/Export Functionality
376
+
377
+ As a user,
378
+ I want to export and import my tasks in common formats,
379
+ so that I can backup data or integrate with other tools.
380
+
381
+ #### Acceptance Criteria
382
+
383
+ 1: "todo export --format json" exports all tasks to JSON
384
+ 2: "todo export --format csv" exports tasks to CSV format
385
+ 3: "todo export --format markdown" creates Markdown task list
386
+ 4: Export supports filtering (only export filtered tasks)
387
+ 5: "todo import <file>" imports tasks from JSON format
388
+ 6: Import validates data and reports errors without corruption
389
+ 7: Export includes all fields: description, project, priority, tags, dates
390
+
391
+ ### Story 3.6: Performance Optimization
392
+
393
+ As a developer using the tool hundreds of times per day,
394
+ I want consistent sub-100ms performance,
395
+ so that the tool never slows down my workflow.
396
+
397
+ #### Acceptance Criteria
398
+
399
+ 1: Benchmark suite implemented using criterion.rs
400
+ 2: All commands benchmarked in CI to prevent regression
401
+ 3: Database indexes optimized for common query patterns
402
+ 4: Prepared statements cached for repeated queries
403
+ 5: Binary size optimized with release flags and LTO
404
+ 6: Cold start optimized to meet <50ms requirement
405
+ 7: Performance guide documented with optimization tips
406
+
407
+ ## Checklist Results Report
408
+
409
+ ### Executive Summary
410
+
411
+ - **Overall PRD Completeness**: 95%
412
+ - **MVP Scope Appropriateness**: Just Right
413
+ - **Readiness for Architecture Phase**: Ready
414
+ - **Most Critical Gaps**: None - PRD is comprehensive and well-structured
415
+
416
+ ### Category Analysis Table
417
+
418
+ | Category | Status | Critical Issues |
419
+ | -------------------------------- | ------ | ------------------------ |
420
+ | 1. Problem Definition & Context | PASS | None |
421
+ | 2. MVP Scope Definition | PASS | None |
422
+ | 3. User Experience Requirements | PASS | CLI-focused, appropriate |
423
+ | 4. Functional Requirements | PASS | None |
424
+ | 5. Non-Functional Requirements | PASS | None |
425
+ | 6. Epic & Story Structure | PASS | None |
426
+ | 7. Technical Guidance | PASS | None |
427
+ | 8. Cross-Functional Requirements | PASS | None |
428
+ | 9. Clarity & Communication | PASS | None |
429
+
430
+ ### Top Issues by Priority
431
+
432
+ **BLOCKERS**: None identified
433
+
434
+ **HIGH**: None identified
435
+
436
+ **MEDIUM**:
437
+
438
+ - Consider adding explicit data migration strategy for future schema changes
439
+ - May want to specify exact Rust version requirements
440
+
441
+ **LOW**:
442
+
443
+ - Could add more specific examples of shell script integration possibilities
444
+ - Might benefit from explicit CI/CD tool preferences (GitHub Actions assumed)
445
+
446
+ ### MVP Scope Assessment
447
+
448
+ **Scope Analysis**:
449
+
450
+ - The MVP scope is appropriately minimal while delivering core value
451
+ - Epic 1 provides a working todo app with essential CRUD operations
452
+ - Epic 2 and 3 can be delivered incrementally based on user feedback
453
+ - No features appear superfluous for the target audience
454
+
455
+ **Timeline Realism**:
456
+
457
+ - 9-week timeline is aggressive but achievable for a solo developer
458
+ - Story sizing is appropriate for AI-assisted development
459
+ - Performance requirements may require iteration but are well-defined
460
+
461
+ ### Technical Readiness
462
+
463
+ **Clarity of Technical Constraints**:
464
+
465
+ - Technology stack clearly defined (Rust, SQLite, Clap)
466
+ - Performance requirements explicit and measurable
467
+ - Distribution strategy well-planned
468
+
469
+ **Identified Technical Risks**:
470
+
471
+ - SQLite cold-start performance for <50ms requirement
472
+ - Cross-platform shell completion complexity
473
+ - Natural language date parsing edge cases
474
+
475
+ **Areas Needing Architect Investigation**:
476
+
477
+ - Optimal SQLite configuration for performance
478
+ - Schema design for efficient filtering and search
479
+ - Binary size optimization strategies
480
+
481
+ ### Recommendations
482
+
483
+ 1. **Proceed to Architecture Phase**: The PRD is comprehensive and ready
484
+ 2. **Early Performance Validation**: Create a spike to validate SQLite startup times
485
+ 3. **Schema Evolution Strategy**: Document migration approach early in development
486
+ 4. **User Testing Plan**: Consider early beta program for developer feedback
487
+
488
+ ### Final Decision
489
+
490
+ **READY FOR ARCHITECT**: The PRD and epics are comprehensive, properly structured, and ready for architectural design. The document provides clear requirements, appropriate technical constraints, and a well-sequenced implementation plan suitable for the target developer audience.
491
+
492
+ ## Next Steps
493
+
494
+ ### Design Architect Prompt
495
+
496
+ Review the TermTodo PRD and create a comprehensive UI/UX design specification for this CLI application, focusing on terminal-based interaction patterns, command syntax design, output formatting, and the overall developer experience.
497
+
498
+ ### Architect Prompt
499
+
500
+ Analyze the TermTodo PRD and create a detailed technical architecture document including: database schema design, Rust module structure, performance optimization strategies, error handling patterns, and a concrete implementation plan for achieving sub-100ms execution times.