---
name: track-progress
description: Add progress.txt logging for agent context restoration
status: done
parts:
- src/servers/task.rs
- src/types/task.rs
- src/storage.rs
- CLAUDE.md
estimate:
  optimistic: 2 hours
  normal: 4 hours
  pessimistic: 6 hours
---

# Implementation Plan

## Task Summary

| ID | Task | Files |
|----|------|-------|
| T1 | Add progress log functions to storage | `src/storage.rs` |
| T2 | Add automatic logging on status/feature changes | `src/servers/task.rs` |
| T3 | Add explicit log_progress MCP tool | `src/servers/task.rs` |
| T4 | Add get_progress MCP tool for context restoration | `src/servers/task.rs` |
| T5 | Update CLAUDE.md with progress tracking workflow | `CLAUDE.md` |

## Tasks

- [ ] **T1**: Add storage functions for progress.txt
  - `append_progress(task_name, agent_name, message)` - appends timestamped entry
  - `read_progress(task_name)` - returns full progress log
  - File format: `[timestamp] [agent_name] message`
  - Create file if doesn't exist

- [ ] **T2**: Add automatic progress logging
  - Log when task status changes (e.g., "Status changed from draft to implementing")
  - Log when features are marked complete
  - Log when review sessions are created/approved
  - Agent name defaults to "k4000" for automatic entries

- [ ] **T3**: Add `log_progress` MCP tool
  - Parameters: task_name, agent_name, message
  - Allows agents to explicitly log their actions
  - Useful for significant decisions or milestones

- [ ] **T4**: Add `get_progress` MCP tool
  - Parameters: task_name
  - Returns full progress.txt content
  - Designed for context restoration when agent starts fresh

- [ ] **T5**: Update CLAUDE.md documentation
  - Document progress.txt format and location
  - Explain automatic vs explicit logging
  - Add workflow for context restoration

## Progress File Format

```
[2026-01-08T10:30:00Z] [k4000] Status changed: draft -> analyzing
[2026-01-08T10:31:00Z] [k4000] 5 features saved to feature-list.json
[2026-01-08T10:32:00Z] [k4000] 6 questions generated, awaiting answers
[2026-01-08T10:45:00Z] [k4000] All questions answered, status: ready
[2026-01-08T11:00:00Z] [claude] Starting implementation of F1
[2026-01-08T11:30:00Z] [claude] F1 complete - progress logging functions added
[2026-01-08T12:00:00Z] [k4000] Feature F1 marked as complete
```

## Testing Considerations

- Test progress file creation on first append
- Test timestamp format is correct
- Test multi-line messages are handled properly
- Test reading empty/non-existent progress file
- Verify automatic logging triggers on all expected events

---

## Estimate

**Senior Developer Profile:** 5+ years experience, familiar with the project's tech stack.

| Scenario | Time |
|----------|------|
| Optimistic | 2 hours |
| Normal | 4 hours |
| Pessimistic | 6 hours |

### Assumptions
- Rust MCP server patterns are already established in codebase
- No complex async/concurrency issues with file appends
- Git integration deferred to future task (per Q5 answer)
