AI Habit Coach — Agent Skill
AI Habit Coach — Agent Skill
Generate personalized, science-backed habit plans via the AI Pass API.
Quick Start
import requests, os
AIPASS_API_KEY = os.environ["AIPASS_API_KEY"]
def create_habit_plan(
habit_goal: str,
current_routine: str = "",
past_attempts: str = "",
constraints: str = ""
) -> str:
"""Generate a personalized habit-building plan."""
context = f"HABIT GOAL: {habit_goal}"
if current_routine: context += f"\nCURRENT ROUTINE: {current_routine}"
if past_attempts: context += f"\nPAST ATTEMPTS: {past_attempts}"
if constraints: context += f"\nCONSTRAINTS: {constraints}"
r = requests.post(
"https://aipass.one/apikey/v1/chat/completions",
headers={"Authorization": f"Bearer {AIPASS_API_KEY}", "Content-Type": "application/json"},
json={
"model": "gpt-5-mini", "temperature": 1, "max_tokens": 2000,
"messages": [
{"role": "system", "content": "Expert habit coach. Use Tiny Habits + Atomic Habits principles. Be specific and actionable."},
{"role": "user", "content": f"Create personalized habit plan:\n{context}\n\nInclude: 1) Habit stack (trigger+routine+reward), 2) Starting point (tiny), 3) 4-week ramp-up, 4) Obstacle anticipation"}
]
},
timeout=60
)
return r.json()["choices"][0]["message"]["content"]
# Example
plan = create_habit_plan(
habit_goal="Exercise daily",
current_routine="Wake up 7am, coffee, work 9-6, dinner, TV, sleep 11pm",
past_attempts="Gym membership — stopped after 3 weeks because commute was too long",
constraints="Work from home, no gym access, have a dog"
)
print(plan)
Setup
- Sign up at aipass.one (valid email required)
- Developer Dashboard → API Keys
export AIPASS_API_KEY=your_key_here
API Reference
| Field | Value |
|---|---|
| Endpoint | POST https://aipass.one/apikey/v1/chat/completions |
| Model | gpt-5-mini |
| Auth | Authorization: Bearer $AIPASS_API_KEY |
Web App
Related: AI Therapy Journal, AI Workout Generator
Skill File
name: ai-habit-coach
description: Generate personalized habit-building plans using AI Pass API (science-backed behavior change)
version: 1.0.0
auth:
type: api_key
env: AIPASS_API_KEY
instructions: "Get API key from https://aipass.one/panel/developer.html under API Keys"
import requests, os
def create_habit_plan(habit_goal, current_routine="", past_attempts="", constraints=""):
AIPASS_API_KEY = os.environ["AIPASS_API_KEY"]
context_parts = [f"HABIT GOAL: {habit_goal}"]
if current_routine: context_parts.append(f"CURRENT ROUTINE: {current_routine}")
if past_attempts: context_parts.append(f"PAST ATTEMPTS: {past_attempts}")
if constraints: context_parts.append(f"CONSTRAINTS: {constraints}")
context = "\n".join(context_parts)
r = requests.post(
"https://aipass.one/apikey/v1/chat/completions",
headers={"Authorization": f"Bearer {AIPASS_API_KEY}", "Content-Type": "application/json"},
json={"model": "gpt-5-mini", "temperature": 1, "max_tokens": 2000,
"messages": [
{"role": "system", "content": "You are an expert habit coach. Use Tiny Habits and Atomic Habits principles. Be specific and actionable."},
{"role": "user", "content": f"Create a personalized habit plan:\n{context}\n\nProvide: 1) Specific habit stack (trigger+routine+reward), 2) Week 1 starting point (absurdly small), 3) Ramp-up schedule, 4) Top 3 obstacles + solutions"}
]},
timeout=60
)
return r.json()["choices"][0]["message"]["content"]
Download Skill File