@@ -10,115 +10,131 @@ feature: agent-management
1010## Milestones
1111** What are the major checkpoints?**
1212
13- - [ ] ** Milestone 1** : Foundation - Process detection and state file reading
14- - [ ] ** Milestone 2** : Claude Code Integration - Full adapter implementation
15- - [ ] ** Milestone 3** : CLI Integration - Complete ` agent list ` command
13+ - [x ] ** Milestone 1** : Foundation - Process detection and state file reading (Completed)
14+ - [x ] ** Milestone 2** : Claude Code Integration - Full adapter implementation (Completed)
15+ - [x ] ** Milestone 3** : CLI Integration - Complete ` agent list ` command (Completed)
1616
1717## Task Breakdown
1818** What specific work needs to be done?**
1919
2020### Phase 1: Foundation
2121
2222#### Task 1.1: Create Process Detection Utility
23- ** Status** : 🔲 Not Started
24- - [ ] Create ` packages/cli/src/util/process.ts `
25- - [ ] Implement ` listProcesses() ` function to query running processes
26- - [ ] Filter by process name pattern (e.g., ` claude ` )
27- - [ ] Extract PID, command line, working directory
28- - [ ] Handle cross-platform differences (macOS focus first)
29- - [ ] Write unit tests
23+ ** Status** : ✅ Completed (Commit: e35315d)
24+ - [x ] Create ` packages/cli/src/util/process.ts `
25+ - [x ] Implement ` listProcesses() ` function to query running processes
26+ - [x ] Filter by process name pattern (e.g., ` claude ` )
27+ - [x ] Extract PID, command line, working directory
28+ - [x ] Handle cross-platform differences (macOS focus first)
29+ - [x ] Write unit tests
3030
3131** Estimated Effort** : 2 hours
32+ ** Actual Effort** : Part of commit e35315d (Jan 29, 2026)
3233
3334#### Task 1.2: Create Agent Adapter Interface
34- ** Status** : 🔲 Not Started
35- - [ ] Create ` packages/cli/src/lib/adapters/AgentAdapter.ts `
36- - [ ] Define ` AgentAdapter ` interface
37- - [ ] Define ` AgentInfo ` , ` AgentType ` , ` AgentStatus ` types
38- - [ ] Export types for use by implementations
35+ ** Status** : ✅ Completed (Commit: e35315d)
36+ - [x] Create ` packages/cli/src/lib/adapters/AgentAdapter.ts `
37+ - [x] Define ` AgentAdapter ` interface
38+ - [x] Define ` AgentInfo ` , ` AgentType ` , ` AgentStatus ` types
39+ - [x] Export types for use by implementations
40+ - [x] Added ` STATUS_CONFIG ` for display configuration
41+ - [x] Added ` ProcessInfo ` interface
3942
4043** Estimated Effort** : 1 hour
44+ ** Actual Effort** : Part of commit e35315d (Jan 29, 2026)
4145
4246#### Task 1.3: Create AgentManager Class
43- ** Status** : 🔲 Not Started
44- - [ ] Create ` packages/cli/src/lib/AgentManager.ts `
45- - [ ] Implement adapter registration
46- - [ ] Implement ` listAgents() ` method
47- - [ ] Aggregate results from all registered adapters
48- - [ ] Handle adapter errors gracefully
49- - [ ] Write unit tests
47+ ** Status** : ✅ Completed (Commit: e35315d)
48+ - [x] Create ` packages/cli/src/lib/AgentManager.ts `
49+ - [x] Implement adapter registration
50+ - [x] Implement ` listAgents() ` method
51+ - [x] Aggregate results from all registered adapters
52+ - [x] Handle adapter errors gracefully
53+ - [x] Write unit tests (252 lines of comprehensive tests)
54+ - [x] Added utility methods: ` unregisterAdapter ` , ` hasAdapter ` , ` getAdapterCount ` , ` clear `
55+ - [x] Implemented status-based sorting (waiting > running > idle > unknown)
5056
5157** Estimated Effort** : 2 hours
58+ ** Actual Effort** : Part of commit e35315d (Jan 29, 2026)
5259
5360### Phase 2: Claude Code Integration
5461
5562#### Task 2.1: Implement Claude Code Session Reader
56- ** Status** : 🔲 Not Started
57- - [ ] Create ` packages/cli/src/lib/adapters/ClaudeCodeAdapter.ts `
58- - [ ] Implement reading ` ~/.claude/projects/*/ ` directories
59- - [ ] Parse ` sessions-index.json ` to get project paths
60- - [ ] Read session JSONL files for conversation data
61- - [ ] Read ` ~/.claude/history.jsonl ` for user prompts
62- - [ ] Extract session slug from JSONL entries
63- - [ ] Write unit tests with fixture data
63+ ** Status** : ✅ Completed (Commit: df346a6)
64+ - [x] Create ` packages/cli/src/lib/adapters/ClaudeCodeAdapter.ts `
65+ - [x] Implement reading ` ~/.claude/projects/*/ ` directories
66+ - [x] Parse ` sessions-index.json ` to get project paths
67+ - [x] Read session JSONL files for conversation data
68+ - [x] Read ` ~/.claude/history.jsonl ` for user prompts
69+ - [x] Extract session slug from JSONL entries
70+ - [x] Write unit tests with fixture data (272 lines of tests)
71+ - [x] Created helper utility ` util/file.ts ` with ` readLastLines ` , ` readJsonLines ` , ` readJson ` functions
6472
6573** Estimated Effort** : 3 hours
74+ ** Actual Effort** : Part of commit df346a6 (Jan 29, 2026)
6675
6776#### Task 2.2: Implement Status Detection
68- ** Status** : 🔲 Not Started
69- - [ ] Read last entries from session JSONL files
70- - [ ] Implement ` determineStatus() ` method based on ` type ` field
71- - [ ] Map entry types: ` assistant ` /` progress ` → running, ` user ` → waiting
72- - [ ] Add idle detection for sessions with old timestamps (>5 min)
73- - [ ] Implement visual status display (🟡 wait, 🟢 run, ⚪ idle)
74- - [ ] Write unit tests with sample session data
77+ ** Status** : ✅ Completed (Commit: df346a6)
78+ - [x] Read last entries from session JSONL files
79+ - [x] Implement ` determineStatus() ` method based on ` type ` field
80+ - [x] Map entry types: ` assistant ` /` progress ` → running, ` user ` → waiting
81+ - [x] Add idle detection for sessions with old timestamps (>5 min)
82+ - [x] Implement visual status display (🟡 wait, 🟢 run, ⚪ idle)
83+ - [x] Write unit tests with sample session data
84+ - [x] Handles edge cases: no last entry, unknown types
7585
7686** Estimated Effort** : 2 hours
87+ ** Actual Effort** : Part of commit df346a6 (Jan 29, 2026)
7788
7889#### Task 2.3: Implement Summary and Time Extraction
79- ** Status** : 🔲 Not Started
80- - [ ] Read ` display ` field from ` ~/.claude/history.jsonl `
81- - [ ] Match history entries to sessions by ` sessionId `
82- - [ ] Implement ` extractSummary() ` with ~ 40 char truncation
83- - [ ] Implement ` getRelativeTime() ` for "2m ago", "just now" display
84- - [ ] Provide fallback summary: "Session started"
85- - [ ] Write unit tests
90+ ** Status** : ✅ Completed (Commit: df346a6)
91+ - [x] Read ` display ` field from ` ~/.claude/history.jsonl `
92+ - [x] Match history entries to sessions by ` sessionId `
93+ - [x] Implement ` truncateSummary() ` with ~ 40 char truncation
94+ - [x] Implement ` getRelativeTime() ` for "2m ago", "just now" display
95+ - [x] Provide fallback summary: "Session started"
96+ - [x] Write unit tests
97+ - [x] Handles minutes, hours, and days display formats
8698
8799** Estimated Effort** : 2 hours
100+ ** Actual Effort** : Part of commit df346a6 (Jan 29, 2026)
88101
89102#### Task 2.4: Complete Claude Code Adapter
90- ** Status** : 🔲 Not Started
91- - [ ] Implement full ` detectAgents() ` method
92- - [ ] Correlate running processes with active sessions
93- - [ ] Implement agent naming: project basename + optional slug
94- - [ ] Filter out stale sessions (no matching process)
95- - [ ] Sort agents: waiting first, then running, then idle
96- - [ ] Integration testing with real Claude Code
97- - [ ] Write unit tests
103+ ** Status** : ✅ Completed (Commit: df346a6)
104+ - [x] Implement full ` detectAgents() ` method
105+ - [x] Correlate running processes with active sessions
106+ - [x] Implement agent naming: project basename + optional slug
107+ - [x] Filter out stale sessions (no matching process)
108+ - [x] Sort agents: waiting first, then running, then idle (handled by AgentManager)
109+ - [x] Integration testing with real Claude Code
110+ - [x] Write unit tests
111+ - [x] Implemented ` canHandle() ` method for process detection
112+ - [x] Added ` generateAgentName() ` for unique naming with slug support
98113
99114** Estimated Effort** : 2 hours
115+ ** Actual Effort** : Part of commit df346a6 (Jan 29, 2026)
100116
101117### Phase 3: CLI Integration (List Command)
102118
103119#### Task 3.1: Create Agent CLI Command
104- ** Status** : 🔲 Not Started
105- - [ ] Create ` packages/cli/src/commands/agent.ts `
106- - [ ] Register ` agent ` parent command
107- - [ ] Register ` agent list ` subcommand
108- - [ ] Use AgentManager to fetch agents
109- - [ ] Format table with columns: Agent, Status, Working On, Active
110- - [ ] Apply status colors and emoji
111- - [ ] Add attention summary footer when agents waiting
112- - [ ] Handle empty results with actionable guidance
113- - [ ] Implement ` --json ` flag for JSON output
120+ ** Status** : ✅ Completed
121+ - [x ] Create ` packages/cli/src/commands/agent.ts `
122+ - [x ] Register ` agent ` parent command
123+ - [x ] Register ` agent list ` subcommand
124+ - [x ] Use AgentManager to fetch agents
125+ - [x ] Format table with columns: Agent, Status, Working On, Active
126+ - [x ] Apply status colors and emoji
127+ - [x ] Add attention summary footer when agents waiting
128+ - [x ] Handle empty results with actionable guidance
129+ - [x ] Implement ` --json ` flag for JSON output
114130
115131** Estimated Effort** : 2.5 hours
116132
117133#### Task 3.2: Register Command in CLI
118- ** Status** : 🔲 Not Started
119- - [ ] Import and register agent command in main CLI file
120- - [ ] Update help text
121- - [ ] Manual testing
134+ ** Status** : ✅ Completed
135+ - [x ] Import and register agent command in main CLI file
136+ - [x ] Update help text
137+ - [x ] Manual testing
122138
123139** Estimated Effort** : 0.5 hours
124140
@@ -232,14 +248,16 @@ graph LR
232248## Timeline & Estimates
233249** When will things be done?**
234250
235- | Phase | Tasks | Estimated Hours |
236- | -------| -------| -----------------|
237- | Phase 1: Foundation | 1.1, 1.2, 1.3 | 5 hours |
238- | Phase 2: Claude Code Integration | 2.1, 2.2, 2.3, 2.4 | 9 hours |
239- | Phase 3: CLI Integration (List) | 3.1, 3.2 | 3 hours |
240- | Phase 4: Agent Open Command | 4.1, 4.2, 4.3, 4.4, 4.5, 4.6 | 8 hours |
241- | Phase 5: Testing & Documentation | 5.1, 5.2 | 3 hours |
242- | ** Total** | | ** 28 hours** |
251+ | Phase | Tasks | Estimated Hours | Status |
252+ | -------| -------| -----------------| --------|
253+ | Phase 1: Foundation | 1.1, 1.2, 1.3 | 5 hours | ✅ Completed |
254+ | Phase 2: Claude Code Integration | 2.1, 2.2, 2.3, 2.4 | 9 hours | ✅ Completed |
255+ | Phase 3: CLI Integration (List) | 3.1, 3.2 | 3 hours | ✅ Completed |
256+ | Phase 4: Agent Open Command | 4.1, 4.2, 4.3, 4.4, 4.5, 4.6 | 8 hours | 🔲 Not Started |
257+ | Phase 5: Testing & Documentation | 5.1, 5.2 | 3 hours | 🔲 Not Started |
258+ | ** Total** | | ** 28 hours** | |
259+ | ** Completed** | | ** 17 hours** | 60% Complete |
260+ | ** Remaining** | | ** 11 hours** | |
243261
244262### Suggested Implementation Order
2452631 . Task 1.2 (Interface) - Define contracts first
0 commit comments