PRD Example 4: Pomodoro Timer CLI
Difficulty: Beginner | Project Type: CLI Tool | Time: 2-3 hours
Overview
| What | A command-line Pomodoro timer that tracks work sessions and breaks |
| Who | Students and developers who want to manage focus time |
| Why | Helps maintain productivity with timed work/break cycles without leaving the terminal |
Core Features (MVP)
- Start Timer:
pomo start→ Begins a 25-minute work session with countdown display - Take Break:
pomo break→ Starts a 5-minute break timer (or 15-min after 4 sessions) - Show Status:
pomo status→ Shows current session, time remaining, and total sessions today - View Stats:
pomo stats→ Shows daily/weekly summary of completed sessions
Non-Goals
Will NOT build:
- GUI or desktop notifications
- Sound alerts or audio cues
- Customizable timer durations (fixed 25/5/15 pattern)
- Task names or descriptions for sessions
- Cloud sync or multi-device support
- Historical data beyond 7 days
- Integration with calendar or task apps
Will NOT use:
- External APIs
- Database (SQLite, PostgreSQL, etc.)
- Rich terminal UI libraries (blessed, rich, etc.)
- Background processes or daemons
Technical Constraints
| Language | Python 3.11+ |
| Framework | None (stdlib only) |
| Dependencies | None — stdlib only |
| Data Storage | JSON file at ~/.pomo/sessions.json |
| Testing | pytest, minimum 3 tests |
| Code Style | Black formatter, type hints |
Success Criteria
- [ ]
pomo startbegins 25-minute countdown with live display - [ ]
pomo breakcorrectly alternates between 5-min and 15-min breaks - [ ]
pomo statusshows accurate time remaining - [ ]
pomo statsdisplays sessions from JSON file - [ ] All tests pass with
pytest - [ ] No external dependencies beyond stdlib
Implementation Phases
Phase 1: Core Timer Logic
Goal: Implement the basic timer functionality
Tasks:
- Create project structure with
pomo.pyandtests/ - Implement countdown timer with terminal display
- Add
startcommand for 25-minute sessions - Save completed sessions to JSON file
Verification:
bash
python pomo.py start
# Shows countdown: "25:00 remaining..."
# After completion: "Session complete! Take a break."
cat ~/.pomo/sessions.json
# Shows: {"sessions": [{"date": "2025-02-12", "completed": 1}]}Deliverables: pomo.py, ~/.pomo/sessions.json
Phase 2: Break Timer & Status
Goal: Add break functionality and status display
Tasks:
- Implement
breakcommand with 5/15-minute logic - Track session count to determine break length
- Add
statuscommand showing current state - Handle Ctrl+C gracefully (cancel without crashing)
Verification:
bash
python pomo.py break
# After 4 work sessions: "Long break: 15:00 remaining..."
# Otherwise: "Short break: 5:00 remaining..."
python pomo.py status
# Shows: "Session 3 of 4 | Next: Long break"Deliverables: Updated pomo.py with break logic
Phase 3: Stats & Testing
Goal: Add statistics display and tests
Tasks:
- Implement
statscommand with daily/weekly view - Add pytest tests for timer logic
- Test JSON file read/write
- Add error handling for missing data file
Verification:
bash
python pomo.py stats
# Shows:
# Today: 4 sessions (1h 40m focused)
# This week: 18 sessions (7h 30m focused)
pytest
# All tests passDeliverables: Complete CLI with tests
Agent Rules
| Always | Ask First | Never |
|---|---|---|
| Handle missing JSON file gracefully | Before changing JSON schema | Use external packages |
| Validate timer is not already running | Before adding new commands | Store data outside ~/.pomo/ |
| Show helpful error messages | Before changing countdown display format | Add features not in this PRD |
| Use type hints for all functions | Implement background/daemon mode |