Habit Tracker
by @newageinvestments25-byte
Track daily habits, streaks, and completions locally. Triggers on: habit, streak, track habit, log exercise, log habit, weekly review, habit status, did I ex...
clawhub install nai-habit-trackerπ About This Skill
name: habit-tracker description: "Track daily habits, streaks, and completions locally. Triggers on: habit, streak, track habit, log exercise, log habit, weekly review, habit status, did I exercise today, habit check, morning routine."
Habit Tracker Skill
Local habit tracking via JSON files. No external services or API keys.
Data lives in ~/.openclaw/workspace/habits/ (override with HABIT_DATA_DIR env var).
Scripts live in scripts/ relative to this file.
Resolve all script paths relative to this skill's scripts/ directory.
Commands
List habits
python scripts/setup_habits.py --list
Add a habit
python scripts/setup_habits.py --add "Habit Name" --frequency daily|weekday|weekly --emoji ποΈ
--frequency defaults to daily if omitted--emoji is optionalRemove (archive) a habit
python scripts/setup_habits.py --remove "Habit Name"
History is preserved. Habit is soft-deleted.Log a habit completion
python scripts/log_habit.py "Habit Name"
python scripts/log_habit.py "Habit Name" --date 2024-01-15
python scripts/log_habit.py "Habit Name" --undo
--undo removes today's log entryCheck status
python scripts/status.py
python scripts/status.py --json
python scripts/status.py --date 2024-01-15
Outputs current streak, longest streak, today's completion, and 7/30-day rates.Weekly review
python scripts/weekly_review.py
python scripts/weekly_review.py --week 2024-01-15
python scripts/weekly_review.py --output ~/Desktop/review.md
python scripts/weekly_review.py --obsidian
Generates a formatted markdown report. --obsidian saves to vault/habits/weekly-reviews/YYYY-MM-DD.md.Interpreting User Requests
| User says | Action |
|-----------|--------|
| "Did I exercise today?" | status.py --json β find habit by name |
| "Log my run / I exercised" | log_habit.py "Exercise" |
| "What's my reading streak?" | status.py --json β extract streak for reading |
| "Log yesterday's meditation" | log_habit.py "Meditation" --date YYYY-MM-DD |
| "Weekly review" | weekly_review.py |
| "Add habit: cold shower" | setup_habits.py --add "Cold Shower" |
| "Show all habits" | setup_habits.py --list |
| "Remove journaling" | setup_habits.py --remove "Journaling" |
Frequency Semantics
daily β expected every calendar dayweekday β MonβFri only; weekend skips don't break streaksweekly β once per 7-day window; streak = consecutive weeks with β₯1 completionOutput Handling
status.py (no --json): print directly to userstatus.py --json: parse and reformat as a clean bullet list for Discordweekly_review.py: offer to save to Obsidian (--obsidian) or print inlinelog_habit.py with what was logged and current streakData Location
~/.openclaw/workspace/habits/
βββ habits.json # habit definitions
βββ log.json # daily completion records
Both files are auto-created. See references/data-format.md for schema details.