A comprehensive skill for tracking habits, maintaining streaks, and using gamification to stay motivated. Use this skill when users want to track daily, weekly, or monthly habits, build routines, or monitor personal growth. Triggers: habit tracker, track habits, new habit, daily routine, weekly goal, build habit, streak, gamification, monitor progress, rastreador de hábitos, novo hábito, rotina diária, meta semanal, criar hábito.
This skill provides a robust system for tracking daily, weekly, or monthly habits. It is designed to help users build and maintain positive routines by incorporating streaks and gamification elements. Users can define habits, log their progress, visualize their consistency, and receive motivational feedback. The skill leverages simple file-based storage, making it transparent and easily manageable. It is ideal for anyone looking to instill discipline, track personal growth, or simply organize their daily routines in a more engaging way.
ALWAYS activate this skill when user mentions:
Example user queries that trigger this skill:
This skill is particularly useful in the following scenarios:
habits.json), allowing for easy inspection and manual editing if needed.This workflow guides you through setting up and using the habit tracker skill.
To get started, you need to create the main data file. The skill will automatically handle this if the file doesn't exist.
Action: The first time you try to add a habit, the skill will create a habits.json file in your home directory.
File Structure: The habits.json file will have the following structure:
{
"user_level": 1,
"user_points": 0,
"habits": []
}
Command: Use a clear command to express your intent.
"Create a new daily habit called 'Read for 30 minutes'""Add a weekly habit: 'Go to the gym'"Execution: The skill will add a new entry to the habits array in habits.json.
{
"name": "Read for 30 minutes",
"description": "Read a book for at least 30 minutes every day.",
"frequency": "daily",
"created_at": "2026-02-02T10:00:00Z",
"history": [],
"current_streak": 0,
"longest_streak": 0
}
Command: Log your progress daily.
"I completed my habit 'Read for 30 minutes' today.""Log 'Go to the gym' for today."Execution: The skill finds the specified habit and adds a new entry to its history.
current_streak is incremented.current_streak surpasses longest_streak, the latter is updated."history": [
{
"date": "2026-02-02T12:00:00Z",
"points_earned": 10
}
]
Command: Check your status at any time.
"Show me my current habits.""What is my streak for 'Read for 30 minutes'?""Give me a summary of my habit progress."Execution: The skill reads the habits.json file and presents the information in a clear, readable format.
Example Output for "Show me my current habits":
Here are your current habits:
1. Read for 30 minutes (Daily)
- Current Streak: 1 day
- Longest Streak: 1 day
2. Go to the gym (Weekly)
- Current Streak: 0 weeks
- Longest Streak: 0 weeks
The skill automatically detects a broken streak. If you log a habit after missing one or more days (based on its frequency), the current_streak will be reset to 1.
Here are some practical examples of how to interact with the skill.
User Goal: Create a consistent morning routine.
Create Habits:
"Create a daily habit: 'Meditate for 10 minutes'""Add a daily habit: 'Drink a glass of water after waking up'""New daily habit: 'Plan my day'"Log Completions (Next Morning):
"I drank a glass of water.""I meditated for 10 minutes.""I just finished planning my day."Check Progress (End of the Week):
"Show me a summary of my habits."Expected Output:
Habit Summary:
- Meditate for 10 minutes (Daily)
- Current Streak: 5 days
- Longest Streak: 5 days
- Completions this week: 5/7
- Drink a glass of water after waking up (Daily)
- Current Streak: 7 days
- Longest Streak: 7 days
- Completions this week: 7/7
- Plan my day (Daily)
- Current Streak: 2 days
- Longest Streak: 3 days
- Completions this week: 6/7
Your current level is 2 (+150 points).
Achievement Unlocked: 7-Day Streak (Drink a glass of water)!
User Goal: Exercise three times a week.
Create Habit:
"Add a new habit: 'Go to the gym'. Set the frequency to 3 times per week."Log Completions:
"I went to the gym today.""Logged my gym session.""Completed 'Go to the gym'."Check Progress:
"How am I doing with my gym habit?"Expected Output:
Habit: Go to the gym (3 times per week)
- Completions this week: 3/3
- Weekly Goal Met!
- Current Streak: 1 week
Below are some code templates and structures to help in the development of this skill.
habits.json TemplateThis is the main data file. It should be stored at /home/ubuntu/habits.json.
{
"user_level": 1,
"user_points": 0,
"achievements": [],
"habits": [
{
"name": "Read for 20 minutes",
"description": "Read a non-fiction book.",
"frequency": "daily",
"created_at": "2026-01-15T09:00:00Z",
"history": [
{
"date": "2026-01-15T20:00:00Z",
"points_earned": 10
},
{
"date": "2026-01-16T20:05:00Z",
"points_earned": 15
}
],
"current_streak": 2,
"longest_streak": 2
},
{
"name": "Weekly Review",
"description": "Review the past week and plan the next one.",
"frequency": "weekly",
"created_at": "2026-01-10T12:00:00Z",
"history": [],
"current_streak": 0,
"longest_streak": 0
}
]
}
This logic would be part of the "log completion" function.
import json
from datetime import datetime, timedelta
def log_habit_completion(habit_name):
with open('habits.json', 'r+') as f:
data = json.load(f)
habit = find_habit(data['habits'], habit_name)
if not habit:
print("Habit not found.")
return
today = datetime.now().date()
# Avoid duplicate logs on the same day
if habit['history'] and datetime.fromisoformat(habit['history'][-1]['date']).date() == today:
print(f"Habit '{habit_name}' already logged for today.")
return
# Check for streak
is_streak_continued = False
if habit['history']:
last_log_date = datetime.fromisoformat(habit['history'][-1]['date']).date()
if today == last_log_date + timedelta(days=1):
habit['current_streak'] += 1
is_streak_continued = True
else:
habit['current_streak'] = 1 # Streak is broken
else:
habit['current_streak'] = 1 # First log
# Update longest streak
if habit['current_streak'] > habit['longest_streak']:
habit['longest_streak'] = habit['current_streak']
# Add points
points = 10
if is_streak_continued:
points += habit['current_streak'] * 2 # Bonus for longer streaks
data['user_points'] += points
# Add to history
habit['history'].append({
"date": datetime.now().isoformat(),
"points_earned": points
})
# Check for level up
# ... (logic for leveling)
# Save data
f.seek(0)
json.dump(data, f, indent=2)
f.truncate()
print(f"Successfully logged '{habit_name}'. Current streak: {habit['current_streak']} days.")