# Habits

Arete implements the habit system from James Clear's _Atomic Habits_ combined
with BJ Fogg's _Tiny Habits_ and Charles Duhigg's habit-loop research. This
guide walks through how each piece shows up in the app.

## Anatomy of a habit

Every Arete habit has four parts:

| Part         | What it is                                                | Where you set it         |
| ------------ | --------------------------------------------------------- | ------------------------ |
| **Cue**      | The trigger that starts the routine                       | Habit creation → Cue     |
| **Routine**  | The action you take                                       | Habit creation → Routine |
| **Reward**   | The reinforcement that makes the loop satisfying          | Habit creation → Reward  |
| **Identity** | The kind of person this habit votes for ("I am a runner") | Habit detail → Identity  |

Small habits work because the cue is unmissable, the routine is embarrassingly
easy, and the reward is _immediate_.

## The 4 Laws of Behavior Change

Every habit screen surfaces the four laws:

1. **Make it Obvious** — pin a cue. Time, location, or "after [habit]" anchors.
   The app suggests cues based on your existing habits.
2. **Make it Attractive** — pair the new habit with something you already enjoy
   (temptation bundling). The Coach suggests bundles.
3. **Make it Easy** — start with the _Two-Minute Rule_. The habit creation
   wizard gates the target count to "just enough to start."
4. **Make it Satisfying** — celebrate the win. After every completion, Arete
   prompts a quick celebration (fist pump / verbal / silent) that research shows
   seals the loop.

Breaking a bad habit? Invert the laws: make it invisible, unattractive,
difficult, and unsatisfying.

## Habit stacking

After [CURRENT HABIT], I will [NEW HABIT].

Open any existing habit's detail → **Stack a habit** → choose the new habit. The
stack's **anchor** (the existing habit) must already have a strong streak —
Arete blocks stacking onto a habit with <7 days of consistency, since the anchor
itself isn't reliable yet.

## Streaks

Each habit tracks two streaks:

- **Current streak** — days in a row you completed the habit.
- **Best streak** — your personal record.

### Forgiveness

The streak engine ships with a few mercy mechanics:

- **Never miss twice** — the rule. One miss is fine. Two misses ends the streak.
- **Streak freezes** — earn a freeze every 7 consecutive days. Apply one to a
  planned skip day (vacation, sick day) and the streak continues uninterrupted.
- **Grace period** — completions logged within 24 hours of the date count for
  that date.

### Milestones

Streak milestones at 7, 21, 30, 66 (the Lally average for habit formation), 100,
and 365 days unlock badges and celebration animations.

## Identity-based habits

Long-term consistency comes from changing who you believe you are. In the habit
detail screen, set an **Identity statement** like _"I am a person who reads
daily."_ Each completion is a vote for that identity.

The dashboard surfaces your identity statements alongside your top streaks so
you see who you're becoming, not just what you're doing.

## Keystone habits

Some habits trigger a cascade of other positive behaviors. Arete identifies your
_keystone_ habits using a correlation algorithm: it looks at which habits, when
completed, statistically lift the completion rate of _other_ habits the same
week. The keystone analysis shows up under Habits → Insights once you have at
least 3 habits and 21 days of data.

Common keystones research has surfaced: exercise, making the bed, journaling.

## Reminders

Settings → Notifications → Habit Reminders. Configure per-habit time + quiet
hours. Smart timing nudges land when you're statistically likely to complete the
habit, based on your past completions.

## Analytics

Habits → Analytics shows:

- **Completion rate** over the last 30 days.
- **Day-of-week distribution** — when are you most consistent?
- **Time-of-day distribution** — same for hours.
- **Habit strength score** — automaticity indicator (0–100).
- **66-day formation progress** — how close each habit is to crossing the
  typical automation threshold.
- **Habit-to-habit correlation** — which habits move together.

## Common pitfalls

- **Targeting too big** — start small enough that you literally can't fail.
  Build the cue first, then increase the dose.
- **Skipping the celebration** — the 2-second celebration is what _makes_ the
  loop satisfying. Don't skip it.
- **Stacking onto a fragile anchor** — only stack onto habits with a proven
  streak (7+ days).
- **Optimizing too early** — give a new habit at least 14 days before reading
  any analytics. The numbers are noisy until then.

## Troubleshooting

- A streak shows as broken even though you completed the habit? Check your
  device's timezone — completions are dated by your account timezone (Settings →
  Language & Locale → Timezone).
- Reminders not arriving? Settings → Notifications → confirm _Notifications_ is
  on at the OS level (iOS Settings → Arete → Notifications, or Android:
  long-press app icon → App Info → Notifications).
