Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

habit-trigger-detective

БесплатноЗапускает вложенные скриптыНе проверен

Use when someone keeps failing the same habit or falling into the same bad one despite motivation. Turns a trigger journal into a statistical trigger analysis…

voronindenis5от voronindenis5389 установок в других каталогах

Об этом скилле

Habit Trigger Detective

Overview

"I know what I should do. I just don't do it." The failure of habits is rarely motivation — it's unidentified triggers. The cigarette happens after coffee, the doomscroll starts when the phone is on the nightstand, the snack raids happen at 22:47, the skipped workouts cluster on days with early meetings. People try to change the behavior while leaving the cue architecture intact.

Behavioral science ( habit-loop research, implementation-intention studies) says: identify the CUE → understand the REWARD → reengineer the loop. This skill does the boring-but-decisive part: statistics over a trigger journal.

For 5-7 days the user logs each occurrence (wanted or unwanted behavior): time, location, who's around, device in hand, emotional state 1-5, what they were doing in the previous 30 minutes, and subjective urge strength. The analyzer then:

  1. Computes lift for every factor value — how much more likely the behavior is when that factor is present vs. baseline (like market-basket analysis).
  2. Finds time-of-day hotspots (binned into morning/afternoon/evening/night).
  3. Detects the preceding-action chain — the 1-2 step behavioral runway that most reliably precedes the behavior.
  4. Assembles the habit loop: cue → routine → (inferred) reward.
  5. Generates reengineered if-then plans (implementation intentions) and cue disruption moves — ranked by expected impact.

When to Use

  • "I keep failing to [exercise / meditate / write / practice language]"
  • "I can't stop [snacking / vaping / doomscrolling / online shopping / biting nails]"
  • Any behavior the user wants more of or less of, occurring 3+ times/week
  • After a streak broke: "figure out WHY it broke"
  • Pre-building a new habit into an existing routine ("habit stacking" needs to know which anchor routines exist)

Don't use for: addiction-level issues (alcohol, drugs, gambling, eating disorders — refer to professionals; this is a self-tracking tool, not therapy), or one-off behaviors with no repetition.

The method

Phase 1 — Journal (5-7 days, 30 seconds per entry)

The user logs each occurrence with a fixed schema (scripts/trigger_log.py interactive mode, or a paper template in references/journal-template.md):

timestamp | behavior (smoke/scroll/snack/skip-workout...) | wanted/unwanted
location (home/work/commute/other) | alone | with-partner | with-friends | with-colleagues
device (none/phone/laptop/tv) | emotional_state 1-5 | urge 1-5
prev_action: what you were doing in the last 30 min (free text)

Critical: also log 5+ baseline entries — random moments when the urge was NOT present. Without a baseline, "80% of events happened at home" is meaningless (maybe you're home 80% of the time). Lift is computed against this baseline.

Phase 2 — Analysis

For every factor value (e.g., location=commute):

P(behavior | factor)     count_events_with_factor / count_all_factor_rows
P(behavior | no factor)
lift = P(behavior|factor) / P(behavior|no factor)
  • lift > 1.5 with enough samples = a real cue candidate
  • The analyzer flags statistical honesty: values with < 3 samples are marked LOW-CONFIDENCE, never surfaced as top triggers.

Preceding-action chains: normalize prev_action text (lowercase, keyword map), compute P(behavior | prev_action) the same way, and find 2-step chains (A→B→behavior) when the data supports them.

Phase 3 — Intervention design

For each top trigger, two moves:

  1. Cue disruption — make the cue harder to reach (phone charger out of bedroom; no snacks at home → the 22:47 raid requires a walk to the store).
  2. If-then reengineering — keep the cue + reward, swap the routine ("IF urge after coffee > 3, THEN 10 squats + gum"). Implementation intentions with a concrete cue roughly double follow-through in the meta-analyses (Gollwitzer & Sheeran 2006: d≈.65).

Files

File Purpose
scripts/trigger_log.py Interactive 30-second journal entries → JSONL
scripts/trigger_analysis.py Lift analysis, hotspots, chains, habit loop, if-then plans
references/journal-template.md Paper template + emotion/urge anchors
references/behavior-science.md Habit loop, implementation intentions, reward inference, references

Usage

# Log an occurrence (interactive prompts, 30 seconds)
python3 scripts/trigger_log.py log

# Log a baseline (non-event) moment
python3 scripts/trigger_log.py baseline

# Analyze after 5+ days (needs >= 8 events + 5 baselines)
python3 scripts/trigger_analysis.py journal.jsonl

# Include a specific if-then replacement behavior
python3 scripts/trigger_analysis.py journal.jsonl --replacement "10 squats"

Workflow

  1. Define ONE behavior with the user. One at a time.
  2. Have them journal 5-7 days (events + baselines). Nudge daily if you're the agent; accept imperfect entries — the analyzer tolerates free text.
  3. Run the analysis. Walk throug
Полный SKILL.md на ClawHub

Установить habit-trigger-detective в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл habit-trigger-detective?

Use when someone keeps failing the same habit or falling into the same bad one despite motivation. Turns a trigger journal into a statistical trigger analysis - time-of-day, location, company, device, emotional state, preceding actions - and outputs ranked cues, the habit loop, and reengineered if-then plans.

Как установить скилл habit-trigger-detective?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл habit-trigger-detective запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить habit-trigger-detective с