Packs / personal-productivity-public
habit-streaks
Summarise a habit log into current and longest streaks and a 4-week completion rate per habit
Install
logicpacks pack use personal-productivity-public/habit-streaksget_pack personal-productivity-public/habit-streaksThe second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.
Keys it needs (names only)
None.
Playbooks included
- Spec:
spec/SPEC.md(goal, steps, edge cases, don’ts) - Routes:
local-python - Checks: 1 in
outcome/checks.yaml - Code:
habits.py - Tools: python3
Usage, last 8 weeks
New: no recorded use yet.
Purpose (from spec/SPEC.md)
Goal
Per habit: current streak, longest streak, completion % over the last 28 days (respecting each habit's target days), from a simple date,habit log.
Verified by: Synthetic log: daily 'read' current 3 / longest 5; Mon-Wed-Fri 'gym' current 5 (off days and not-yet-logged today don't break it).
Steps
- Keep a plain log (one line per done habit per day; a Shortcut or note works).
- Run
python3 code/habits.py log.csv habits.csv --today 2026-12-04. - Look at the 28-day rate, not just the streak.
Edge cases
- Today counts only if already logged (otherwise the streak is counted up to yesterday).
Don'ts
- Don't track more than 3-5 habits at once (practice advice, not a tool limit).