Bulk-edit habits in all_habits*.md using edit_habit.py.
Ask the user what operation they want:
- add — Add a new habit under a category
- remove — Remove a habit from all entries
- rename — Rename a habit across all entries
Gather required parameters:
- For add: category name and habit name
- For remove: habit name
- For rename: current name and new name
Run a dry-run first to preview:
bash ~/.claude/skills/edit-habit/scripts/run_edit_habit.sh --dry-run <command> <args...>Show the user the dry-run output (number of entries affected)
If the dry-run reports 0 entries affected, warn the user that no matching entries were found. Suggest checking the habit name for typos.
If the user confirms, run for real (without
--dry-run):bash ~/.claude/skills/edit-habit/scripts/run_edit_habit.sh <command> <args...>Show the summary of changes
Ask the user if they want to run
/update-habitsto regenerate habits.json and push the updated heatmap to GitHub Pages. Without this step, changes only exist in the Obsidian file and won't appear on the website.
Base directory: ~/Code/hosaypeng.github.io
Examples:
python3 scripts/edit_habit.py add Diet "No processed food"
python3 scripts/edit_habit.py remove "Intermittent fasting"
python3 scripts/edit_habit.py rename "Mobility" "Yoga / mobility"
Troubleshooting
Error: Python script fails with ModuleNotFoundError or syntax error
Cause: Wrong Python version or missing dependencies.
Fix: Verify python3 --version is 3.8+. Run from the correct base directory (hosaypeng.github.io).
Error: all_habits*.md not found
Cause: File was moved, renamed, or the working directory is wrong.
Fix: Confirm the base directory path is correct and that all_habits*.md exists at the expected location within the repo.
Error: Habit name not found (for remove/rename)
Cause: The habit name doesn't match exactly — check for typos, extra spaces, or case differences.
Fix: Open all_habits*.md and search for the habit name. Use the exact string as it appears in the file, including capitalization.