Help users build and track daily habits, record consecutive check-in days, and generate progress reports. Data is stored locally.
Use Cases
- The user says "Help me track drinking water every day" or "I want to develop the habit of waking up early"
- The user says "Check in today's habit" or "How many days have I kept it up"
- The user says "Show me how my habits went this week"
- The user says "Add a new habit: exercise for 30 minutes every day"
Execution Method
Data Storage
Maintain a JSON file in the user data directory ~/Documents/xiaodazi/habits.json:
{
"habits": [
{
"id": "drink_water",
"name": "每天喝 8 杯水",
"created_at": "2026-02-01",
"frequency": "daily",
"records": {
"2026-02-25": true,
"2026-02-26": true
},
"current_streak": 2,
"best_streak": 15
}
]
}
Core Operations
Add Habit:
用户:帮我追踪每天阅读 30 分钟
→ 创建新习惯条目,设置频率为 daily
Check In:
用户:今天的阅读完成了
→ 记录今日完成,更新连续天数
→ 回复:阅读 ✅ 已连续 5 天!
View Progress:
用户:我的习惯完成得怎么样
→ 生成本周/本月进度报告
Progress Report Template
## 习惯周报(2/19 - 2/25)
| 习惯 | 一 | 二 | 三 | 四 | 五 | 六 | 日 | 完成率 |
|---|---|---|---|---|---|---|---|---|
| 阅读 30 分钟 | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | 86% |
| 喝 8 杯水 | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | 86% |
| 运动 | ❌ | ✅ | ❌ | ✅ | ❌ | ✅ | ❌ | 43% |
### 连续打卡
- 🔥 阅读:当前连续 6 天(最佳 15 天)
- 💧 喝水:当前连续 1 天(最佳 22 天)
- 💪 运动:当前连续 0 天(最佳 7 天)
Output Specifications
- Give positive feedback and the consecutive day count when a check-in succeeds
- Do not criticize when a streak is broken; encourage starting over
- Use tables + icons for weekly reports to visually display completion status
- Data is always stored locally and is not uploaded