# OiMy Loop Library — Complete Catalog
**Version:** 1.0.0  
**Status:** Authoritative Reference  
**Purpose:** Definitive catalog of all recurring AI loops and loop-of-loops patterns for OiMy. Authored once with deep reasoning so downstream models (Gemma 4) can execute without needing deep intelligence.

---

## Preface

A **prompt** is answered once and forgotten. A **loop** is a recurring obligation: it has memory, it tracks state across time, it knows what it did last cycle, and it knows when to stop. A **loop-of-loops** is when loops notice each other — a change in Loop A wakes Loop B, which passes only what changed (the delta), not its full context.

This document is the BCT matrix of OiMy's behavioral intelligence. It tells Gemma 4 exactly what to do, when, with what memory, and where to stop. The human boundary is not a suggestion — it is a hard architectural constraint. Every loop that crosses it must pause and draft for human approval.

The boring loops matter most. Spinach getting wasted. Shoes outgrown. Permission slips forgotten. These have the highest daily leverage. They are in here too.

---

## Part 1: Loop Registry

| loop_id | domain | name | trigger_type | frequency | key_persona_fit | wakes | woken_by |
|---------|--------|------|-------------|-----------|-----------------|-------|----------|
| LP-001 | parenting | Morning Chaos Coordinator | time | daily | dual-income-young-kids, single-parent | LP-002, LP-033, LP-034 | LP-002 |
| LP-002 | parenting | School Pickup Coordinator | time+event | daily | dual-income-young-kids, co-parenting | LP-001, LP-019 | LP-001, LP-060 |
| LP-003 | parenting | Bedtime Battle Coach | time | daily | toddler-parent, school-age-parent | LP-033, LP-060 | LP-001, LP-061 |
| LP-004 | parenting | Homework Tracker | time+event | daily | school-age-parent, high-achieving | LP-043, LP-044 | LP-046 |
| LP-005 | parenting | School Permission Slip | event | event-based | any-school-age | LP-038, LP-014 | LP-049 |
| LP-006 | parenting | Behavior Chart Cycle | time | weekly | adhd-parent, school-age-parent | LP-061, LP-065 | LP-064 |
| LP-007 | parenting | Teen Withdrawal Monitor | signal | continuous | teen-parent | LP-068, LP-015 | LP-065 |
| LP-008 | parenting | Screen Time Enforcer | time | daily+weekly | school-age-parent, teen-parent | LP-009, LP-003 | — |
| LP-009 | parenting | Activity Enrollment Tracker | event | seasonal | high-achieving, dual-income | LP-074, LP-037 | LP-008 |
| LP-010 | parenting | Clothes Outgrown Tracker | signal | monthly | any-parent | LP-036, LP-075 | — |
| LP-011 | parenting | Report Card Review | event | quarterly | high-achieving, school-age-parent | LP-013, LP-044 | — |
| LP-012 | parenting | Parent-Teacher Comm Coach | event | ongoing | any-school-age | LP-005, LP-011 | LP-011, LP-046 |
| LP-013 | parenting | School Absence Draft | event | event-based | any-school-age | LP-026, LP-023 | LP-027 |
| LP-014 | parenting | Lunch Prep Planner | time | daily | dual-income, single-parent | LP-033, LP-035 | LP-022 |
| LP-015 | relationships | Couple Check-In | time | weekly | dual-income, new-parent | LP-016, LP-020 | LP-007, LP-066 |
| LP-016 | relationships | Date Night Planner | time | monthly | dual-income, new-parent | LP-074, LP-015 | LP-015 |
| LP-017 | relationships | Co-Parent Sync | time | weekly | co-parenting, divorced | LP-018, LP-002 | — |
| LP-018 | relationships | Co-Parent Conflict Scripter | signal | event-based | co-parenting, divorced | LP-065, LP-015 | LP-017 |
| LP-019 | relationships | New Baby Relationship Strain | signal | continuous | new-parent | LP-015, LP-030 | LP-029 |
| LP-020 | relationships | Anniversary Tracker | time | annual | any-couple | LP-016, LP-070 | — |
| LP-021 | relationships | Family Meeting Facilitator | time | weekly | blended, high-achieving | LP-015, LP-065 | — |
| LP-022 | health | Medication Reminder | time | daily | any-family | LP-023, LP-050 | LP-027 |
| LP-023 | health | Sleep Tracker | time | daily | new-parent, teen-parent | LP-032, LP-003 | LP-022, LP-027 |
| LP-024 | health | Weekly Nutrition Review | time | weekly | any-family | LP-033, LP-035 | LP-025 |
| LP-025 | health | Wellness Daily Check-In | time | daily | any-adult | LP-032, LP-066 | LP-031, LP-019 |
| LP-026 | health | Symptom Triage | signal | event-based | any-family | LP-013, LP-022, LP-033 | LP-027 |
| LP-027 | health | Child Illness Chain | signal | event-based | any-school-age | LP-013, LP-022, LP-026, LP-033 | LP-026 |
| LP-028 | health | Postpartum Check | time | weekly | new-parent | LP-019, LP-025, LP-015 | LP-019 |
| LP-029 | health | Mental Health Pulse | time | weekly | any-adult | LP-025, LP-066 | LP-065 |
| LP-030 | health | Pediatric Appointment Tracker | time | scheduled | any-parent | LP-022, LP-031 | — |
| LP-031 | health | Immunization Scheduler | time | scheduled | any-parent | LP-030, LP-012 | LP-030 |
| LP-032 | health | Fitness Accountability | time | daily | any-adult | LP-025, LP-024 | LP-023 |
| LP-033 | logistics | Weekly Meal Planner | time | weekly | any-family | LP-034, LP-035, LP-014 | LP-024, LP-026 |
| LP-034 | logistics | Grocery Optimizer | time | weekly | any-family | LP-035, LP-010 | LP-033 |
| LP-035 | logistics | Grocery Waste Reviewer | time | weekly | any-family | LP-033, LP-034 | LP-034 |
| LP-036 | logistics | Perishable Waste Tracker | signal | continuous | any-family | LP-034, LP-035 | LP-010 |
| LP-037 | logistics | Schedule Sync | time | daily | dual-income, co-parenting | LP-002, LP-001 | LP-009 |
| LP-038 | logistics | Form Reminder | signal | event-based | any-school-age | LP-005, LP-012 | LP-005 |
| LP-039 | logistics | Subscription Audit | time | quarterly | any-adult | LP-076, LP-077 | — |
| LP-040 | logistics | Morning Prep Checklist | time | daily | any-parent | LP-001, LP-014 | LP-001 |
| LP-041 | logistics | Backpack Check | time | daily | school-age-parent | LP-005, LP-040 | LP-001 |
| LP-042 | logistics | Car Maintenance Tracker | time | monthly | any-driver | LP-037, LP-075 | — |
| LP-043 | education | Homework Help Session | signal | event-based | school-age-parent | LP-004, LP-044 | LP-004 |
| LP-044 | education | Reading Log | time | daily | school-age-parent | LP-004, LP-046 | LP-004 |
| LP-045 | education | Learning Gap Detector | time | weekly | school-age-parent, high-achieving | LP-012, LP-043 | LP-004, LP-011 |
| LP-046 | education | School Project Tracker | event | event-based | any-school-age | LP-037, LP-004 | LP-011 |
| LP-047 | education | Standardized Test Prep | time | seasonal | high-achieving | LP-043, LP-045 | — |
| LP-048 | education | College Planning | time | annual | teen-parent | LP-049, LP-047 | — |
| LP-049 | education | Summer Learning Continuity | time | seasonal | any-school-age | LP-044, LP-074 | LP-048 |
| LP-050 | elder | Elder Medication Manager | time | daily | caregiver-parent | LP-051, LP-054 | LP-053 |
| LP-051 | elder | Elder Daily Check-In | time | daily | caregiver-parent | LP-052, LP-054, LP-057 | LP-050 |
| LP-052 | elder | Elder Appointment Tracker | time | scheduled | caregiver-parent | LP-050, LP-053 | LP-051 |
| LP-053 | elder | Elder Mood Monitor | time | continuous | caregiver-parent | LP-051, LP-057, LP-058 | LP-052 |
| LP-054 | elder | Dementia Routine Guard | time | daily | caregiver-parent | LP-051, LP-050 | LP-053 |
| LP-055 | elder | Family Elder Status Update | time | weekly | caregiver-parent | LP-051, LP-053 | LP-051 |
| LP-056 | elder | Elder Isolation Check | time | weekly | caregiver-parent | LP-053, LP-058 | LP-051 |
| LP-057 | elder | Fall Risk Assessment | signal | event-based | caregiver-parent | LP-052, LP-051 | LP-053 |
| LP-058 | elder | Caregiver Burnout Monitor | time | weekly | caregiver-parent | LP-029, LP-025 | LP-053, LP-056 |
| LP-059 | special-needs | ADHD Daily Structure | time | daily | adhd-parent | LP-006, LP-060, LP-003 | LP-064 |
| LP-060 | special-needs | Sensory Regulation Check | signal | daily | adhd-parent, autism-parent | LP-003, LP-002 | LP-059, LP-064 |
| LP-061 | special-needs | Therapy Appointment Tracker | time | weekly | special-needs-parent | LP-006, LP-045 | LP-064 |
| LP-062 | special-needs | IEP Progress Tracker | time | quarterly | special-needs-parent | LP-012, LP-045, LP-061 | — |
| LP-063 | special-needs | Transition Support | signal | event-based | special-needs-parent | LP-059, LP-060 | LP-059 |
| LP-064 | special-needs | Meltdown Debrief | signal | event-based | special-needs-parent | LP-059, LP-006, LP-065 | LP-060 |
| LP-065 | emotional | Family Stress Monitor | signal | continuous | any-family | LP-025, LP-029, LP-066 | LP-007, LP-018, LP-064 |
| LP-066 | emotional | Venting Session Handler | signal | event-based | any-adult | LP-029, LP-065 | LP-065 |
| LP-067 | emotional | Crisis Awareness Detector | signal | continuous | any-family | LP-029, LP-025 | LP-065, LP-066 |
| LP-068 | emotional | Grief Support Loop | signal | event-based | any-family | LP-066, LP-029 | LP-007 |
| LP-069 | emotional | Celebration Capture | signal | event-based | any-family | LP-070, LP-071 | — |
| LP-070 | bonding | Family Activity Suggester | time | weekly | any-family | LP-074, LP-021 | LP-016, LP-049 |
| LP-071 | bonding | Family Memory Capture | signal | event-based | any-family | LP-070, LP-072 | LP-069 |
| LP-072 | bonding | Tradition Tracker | time | annual | any-family | LP-070, LP-020 | LP-071 |
| LP-073 | bonding | Bonding Moment Suggester | time | daily | any-family | LP-070, LP-003 | LP-065 |
| LP-074 | bonding | Vacation Planner | time | seasonal | any-family | LP-037, LP-033 | LP-009, LP-016 |
| LP-075 | life-admin | Bill Payment Tracker | time | monthly | any-adult | LP-076, LP-039 | LP-010, LP-042 |
| LP-076 | life-admin | Insurance Review | time | annual | any-adult | LP-077, LP-039 | LP-075 |
| LP-077 | life-admin | Document Expiry Tracker | time | ongoing | any-adult | LP-076, LP-038 | LP-076 |
| LP-078 | life-admin | Tax Prep Coordinator | time | seasonal | any-adult | LP-075, LP-039 | — |
| LP-079 | life-admin | Emergency Kit Auditor | time | biannual | any-parent | LP-022, LP-075 | — |
| LP-080 | life-admin | Estate Planning Nudge | time | annual | any-adult | LP-076, LP-077 | — |
| LP-081 | parenting | Dental Checkup Scheduler | time | biannual | any-parent | LP-030, LP-022 | LP-030 |
| LP-082 | parenting | Shoe Size Tracker | signal | monthly | any-parent | LP-010, LP-075 | — |
| LP-083 | parenting | Snack Inventory Checker | time | weekly | any-parent | LP-034, LP-014 | LP-035 |
| LP-084 | logistics | School Supply Replenisher | time | monthly+seasonal | school-age-parent | LP-034, LP-041 | — |

---

## Part 2: Full Loop Specs

### Domain: Parenting

```yaml
loop_id: LP-001
name: Morning Chaos Coordinator
domain: parenting
trigger: time — weekday, configurable start time (default 06:30 local)
frequency: daily (weekdays)
memory:
  - last_successful_departure_time
  - historical_delay_causes
  - child_profiles (ages, school start time, bus/drive)
  - partner_schedule_today
  - outstanding_tasks_from_prior_morning
sources:
  - family calendar (school schedule, holidays)
  - weather API (dress appropriately)
  - conversation history (reported chaos last session)
  - profile (school times, child ages, transportation method)
safe_actions:
  - send morning checklist to family thread
  - surface weather-based clothing suggestion
  - remind of packed-lunch status from LP-014
  - flag any school event today (from LP-005 / LP-038)
  - send a time-check nudge if no response by T+15 min
human_boundary:
  - NEVER message school on behalf of parent
  - NEVER change family calendar entries
  - NEVER send partner instructions
  - NEVER assume child is fine if not reported — surface, don't assume
loop_record:
  - timestamp of cycle
  - family's reported readiness status
  - any chaos causes flagged today
  - departure success/failure
wakes:
  - LP-002 (school_pickup): trigger="today's school schedule confirmed"
  - LP-033 (meal-planner): trigger="lunch not packed — may need adjustment"
  - LP-034 (grocery): trigger="missing morning item flagged"
woken_by:
  - LP-002: if pickup arrangement changes, morning pre-brief updates
stop_conditions:
  - school year ends (read from calendar)
  - family marks loop as paused
  - no school-age children in profile
personas:
  - dual-income-young-kids (primary)
  - single-parent (high leverage — no backup)
  - co-parenting (needs coordination signal)
skills_used: [chat, schedule-manager, activity-suggest, family-memory]
```

```yaml
loop_id: LP-002
name: School Pickup Coordinator
domain: parenting
trigger:
  - time: 2 hours before dismissal time (from profile)
  - event: parent sends "who's picking up today?"
frequency: daily (school days)
memory:
  - default pickup person
  - today's pickup arrangement
  - alternate pickup contacts
  - recent confusion events
  - school dismissal time per child
sources:
  - family calendar
  - partner schedule
  - co-parent schedule (if applicable)
  - conversation history
safe_actions:
  - surface pickup reminder to responsible parent
  - confirm arrangement with simple yes/no prompt
  - flag if no confirmation received 30 min before dismissal
  - suggest carpool if pattern shows recurring logistics stress
human_boundary:
  - NEVER contact school to change pickup instructions
  - NEVER tell child directly about pickup change
  - NEVER assume arrangement is confirmed without explicit ack
  - NEVER override custody agreement signals
loop_record:
  - who picked up today
  - any issues (late, forgot, confusion)
  - confirmation timestamp
wakes:
  - LP-001: if pickup changes, morning check updates
  - LP-019: if co-parent no-show pattern detected, relationship strain loop notified
woken_by:
  - LP-001: morning confirms today's schedule
  - LP-060: special needs child needs transition support — pickup brief adjusted
stop_conditions:
  - school year ends
  - child old enough to walk/take bus independently (from profile)
  - family pauses loop
personas:
  - dual-income-young-kids
  - co-parenting (critical — custody schedule integration)
  - single-parent (no fallback — high urgency)
skills_used: [chat, schedule-manager, transportation, family-memory]
```

```yaml
loop_id: LP-003
name: Bedtime Battle Coach
domain: parenting
trigger: time — configurable bedtime (default: 30 min before target bedtime)
frequency: daily
memory:
  - child's target bedtime by age
  - historical resistance patterns (nights of week, reasons)
  - current routine (bath, story, etc.)
  - last night's outcome
  - recent stress events that affect sleep
sources:
  - conversation history (resistance flagged in chat)
  - profile (child ages, known sleep issues)
  - LP-023 (sleep tracker) output
  - LP-059/LP-060 (special needs — sensory/ADHD context)
safe_actions:
  - send bedtime reminder with routine checklist
  - surface a de-escalation tip if resistance is predicted (pattern match)
  - suggest a story or wind-down activity
  - provide a 5-min warning nudge
human_boundary:
  - NEVER tell child directly (only routes through parent)
  - NEVER diagnose sleep disorders
  - NEVER override parent's chosen method (CIO, attachment, etc.)
  - NEVER escalate to crisis without parent confirmation
loop_record:
  - start time vs target time
  - resistance reported (yes/no)
  - what worked
  - final sleep time if reported
wakes:
  - LP-033: if bedtime routinely delayed, dinner time may need adjustment
  - LP-060: if sensory overload suspected, wakes sensory check
woken_by:
  - LP-001: very bad morning reported → evening routine prep starts earlier
  - LP-061: therapy day → expect heightened emotion at bedtime
stop_conditions:
  - child developmentally past bedtime resistance age
  - family pauses loop
  - no children in profile
personas:
  - toddler-parent (primary use case)
  - adhd-parent (highly elevated need)
  - dual-income (exhausted parents — low tolerance for battle)
skills_used: [chat, patpat, sleep-coach, behavior-chart]
```

```yaml
loop_id: LP-004
name: Homework Tracker
domain: parenting
trigger:
  - time: after-school window (default 15:30 local)
  - event: parent says "homework done?" or child mentions it
frequency: daily (school days)
memory:
  - each child's homework completion history by day
  - subjects with chronic difficulty
  - current grade level
  - upcoming tests or projects (from LP-046)
  - last completed vs outstanding
sources:
  - conversation history
  - profile (grade level, subjects)
  - LP-046 (project tracker) — due dates
  - LP-045 (learning gap) — subject flags
safe_actions:
  - send homework check-in at configured time
  - surface subject-specific encouragement based on history
  - remind of upcoming test if within 3 days
  - flag if homework consistently incomplete (for parent awareness)
human_boundary:
  - NEVER do homework for child
  - NEVER contact teacher about homework directly
  - NEVER threaten child with consequences (parent's call)
  - NEVER assume homework is done unless confirmed
loop_record:
  - completion status per subject per day
  - time taken (if reported)
  - help needed (yes/no)
  - upcoming due dates surfaced
wakes:
  - LP-043: if child struggles, wake homework help session
  - LP-044: reading portion triggers reading log
  - LP-045: pattern of struggle wakes learning gap detector
woken_by:
  - LP-046: project due soon — homework check adds project step
stop_conditions:
  - school year ends
  - child moves to independent homework management
  - family pauses loop
personas:
  - school-age-parent
  - high-achieving (intense tracking need)
  - adhd-parent (structure is essential)
skills_used: [chat, homework-help, behavior-chart, todo-add]
```

```yaml
loop_id: LP-005
name: School Permission Slip Tracker
domain: parenting
trigger:
  - event: school communication mentions "permission slip," "field trip," "form needed"
  - signal: LP-038 (form reminder) fires
  - time: weekly scan of known upcoming events
frequency: event-based (but reviewed weekly)
memory:
  - active open permission slips (name, due date, status)
  - historically late/forgotten slips
  - upcoming school events calendar
sources:
  - school email digest (if connected)
  - conversation history ("teacher sent a note today")
  - LP-012 (parent-teacher comm) outputs
  - family calendar
safe_actions:
  - flag new permission slip with due date
  - send reminder 48h and 24h before due
  - offer to draft a completion checklist
  - mark as done when parent confirms
human_boundary:
  - NEVER sign electronically on behalf of parent
  - NEVER send form to school
  - NEVER assume "handled it" without explicit confirmation
loop_record:
  - slip name, due date, signed/unsigned
  - reminder sent dates
  - outcome (completed on time, late, missed)
wakes:
  - LP-038: formal form reminder loop activated
  - LP-014: if trip requires specific lunch (e.g., no thermos), lunch loop updated
woken_by:
  - LP-049: school project or trip during summer transition
stop_conditions:
  - school year ends
  - no active slips in queue and none anticipated for 30 days
personas:
  - any-school-age-parent
  - single-parent (hardest to track alone)
  - dual-income (highest forgetting rate)
skills_used: [chat, todo-add, school-email-draft, list-manager]
```

```yaml
loop_id: LP-006
name: Behavior Chart Cycle
domain: parenting
trigger:
  - time: weekly, Sunday evening (or configured day)
  - event: behavior milestone reached or missed
frequency: weekly (with daily data collection)
memory:
  - current behavior targets (from parent setup)
  - daily sticker/point counts per child
  - reward thresholds
  - historical trends (improving/declining)
  - recent life stressors (may affect behavior)
sources:
  - conversation history (daily behavior reports)
  - profile (child ages, behavior goals)
  - LP-059 (ADHD structure) outputs
  - LP-064 (meltdown debrief) outputs
safe_actions:
  - send daily behavior check-in prompt
  - congratulate child behavior win (via parent to relay)
  - surface weekly trend summary on Sunday
  - suggest a reward based on threshold met
  - flag declining trend with possible cause hypothesis
human_boundary:
  - NEVER punish or withhold reward without parent confirmation
  - NEVER change behavior targets without parent review
  - NEVER share behavior data with third parties (school, etc.) without explicit ask
loop_record:
  - daily point totals per target
  - weekly aggregate
  - reward status
  - trend direction
wakes:
  - LP-061: behavior tied to therapy goal → therapy tracker updated
  - LP-065: sharp behavior decline → family stress monitor notified
woken_by:
  - LP-064: post-meltdown → behavior chart updated with incident note
stop_conditions:
  - parent cancels behavior plan
  - child developmentally outgrows chart
  - targets all mastered for 4+ weeks
personas:
  - adhd-parent (primary)
  - school-age-parent (general)
  - special-needs-parent
skills_used: [chat, behavior-chart, patpat, todo-add]
```

```yaml
loop_id: LP-007
name: Teen Withdrawal Monitor
domain: parenting
trigger:
  - signal: parent reports teen is "pulling away," "moody," "not talking"
  - signal: conversation gap with teen exceeds typical pattern (if tracked)
  - signal: LP-065 (stress monitor) flags teen stress
frequency: continuous monitoring; weekly active cycle
memory:
  - baseline teen communication pattern
  - known stressors (school, friend issues, relationship)
  - parent's trust level with teen
  - previous engagement attempts and outcomes
  - recent significant events (breakup, fight with friend, academic pressure)
sources:
  - parent conversation history
  - profile (teen age, known context)
  - LP-065 (family stress) outputs
  - LP-015 (couple check-in) — if parent emotional bandwidth is low
safe_actions:
  - surface a non-confrontational conversation opener for parent to use
  - suggest a low-pressure shared activity
  - provide psychoeducation on teen withdrawal (normalize vs. alert)
  - flag if withdrawal intensifies or crisis signals detected
human_boundary:
  - NEVER contact teen directly
  - NEVER advise parent to violate teen privacy (phone searches, etc.)
  - NEVER diagnose depression or anxiety
  - MUST escalate to LP-067 (crisis) if self-harm signals detected
loop_record:
  - withdrawal level (mild/moderate/significant)
  - parent's reported attempts this week
  - what worked vs didn't
  - trend direction
wakes:
  - LP-068: if grief suspected (loss of friend, relationship)
  - LP-015: if parent-teen conflict is straining couple
woken_by:
  - LP-065: family stress spike → teen withdrawal risk elevated
stop_conditions:
  - teen communicates openly again for 2+ weeks
  - teen leaves for college
  - family pauses loop
personas:
  - teen-parent (primary)
  - high-achieving (academic pressure driver)
  - divorced/co-parenting (loyalty conflicts)
skills_used: [chat, patpat, life-coach, relationship-coach]
```

```yaml
loop_id: LP-008
name: Screen Time Enforcer
domain: parenting
trigger:
  - time: daily (after school + evening) and weekly summary
  - signal: parent asks about screen time
frequency: daily tracking; weekly report
memory:
  - per-child screen time limits (from parent config)
  - historical daily usage (parent-reported)
  - device types (phone vs TV vs gaming)
  - compliance history
  - recent battles around screens
sources:
  - conversation history (parent reports)
  - profile (child ages, configured limits)
  - LP-003 (bedtime) — screens near bedtime flagged
safe_actions:
  - send daily screen time check-in
  - surface weekly trend chart (text-based)
  - suggest screen-free activity alternatives
  - flag if screens are being used as emotion regulation (concerning pattern)
human_boundary:
  - NEVER directly control or restrict devices
  - NEVER tell child screen time is over (routes via parent)
  - NEVER set limits without parent explicit configuration
loop_record:
  - daily reported usage per child
  - compliance vs limit
  - weekly total
  - any battles reported
wakes:
  - LP-009: if activity signup suggested as screen alternative
  - LP-003: if screens near bedtime — bedtime coach alerted
stop_conditions:
  - child reaches family's "self-managed" age threshold
  - parent disables loop
  - no children in profile
personas:
  - school-age-parent
  - teen-parent
  - adhd-parent (screen dysregulation is common)
skills_used: [chat, screen-time, behavior-chart, activity-suggest]
```

```yaml
loop_id: LP-009
name: Activity Enrollment Tracker
domain: parenting
trigger:
  - event: enrollment season begins (fall: Aug, spring: Jan, summer: Apr)
  - signal: parent mentions activity, sport, or class
  - time: 6 weeks before season start
frequency: seasonal (3x/year)
memory:
  - current activities per child
  - past activity history (enjoyed/quit)
  - upcoming enrollment deadlines
  - budget context (if shared)
  - scheduling constraints
sources:
  - profile (child ages, interests, past activities)
  - family calendar
  - conversation history
  - LP-037 (schedule sync) — conflict check
safe_actions:
  - surface enrollment reminder with deadline
  - suggest activity options based on child profile and interests
  - flag scheduling conflicts with existing commitments
  - offer a pros/cons summary for activities being considered
human_boundary:
  - NEVER enroll child in activity
  - NEVER pay for activity
  - NEVER contact activity provider
loop_record:
  - activities considered
  - enrollment decisions made
  - deadlines tracked
  - schedule impact noted
wakes:
  - LP-074: activity requires travel → vacation planner updated
  - LP-037: new activity added → schedule sync updated
woken_by:
  - LP-008: screen time reduction → activity suggestion triggered
stop_conditions:
  - all enrollment decisions made for season
  - family is in activity freeze (budget, health, transition)
personas:
  - high-achieving
  - dual-income (scheduling constraints)
  - any-parent
skills_used: [chat, activity-suggest, schedule-manager, list-manager]
```

```yaml
loop_id: LP-010
name: Clothes Outgrown Tracker
domain: parenting
trigger:
  - signal: parent mentions "can't fit," "outgrown," "needs new shoes"
  - time: monthly check (seasonal swap reminder)
  - time: season change (fall/spring)
frequency: monthly (passive); seasonal (active)
memory:
  - last known sizes per child per category
  - items recently outgrown
  - shopping list for replacement
  - hand-me-down availability
sources:
  - conversation history (parent mentions)
  - profile (child ages — size growth prediction)
  - LP-034 (grocery) — model for shopping list integration
  - LP-036 (perishable) — model for inventory thinking
safe_actions:
  - add outgrown item to shopping list (LP-034)
  - surface a seasonal size check reminder
  - suggest donation of outgrown items
  - note upcoming size transition (e.g., moving to kids size 8)
human_boundary:
  - NEVER purchase clothing
  - NEVER contact second-hand shops
  - NEVER assume hand-me-downs are available
loop_record:
  - current sizes logged (last updated date)
  - outgrown items list
  - replacement items on list
  - season checked
wakes:
  - LP-036: outgrown item → inventory updated
  - LP-075: clothing purchase → bill tracker may need update (back-to-school budget)
woken_by: none (self-triggered)
stop_conditions:
  - child reaches stable adult sizing
  - parent disables loop
personas:
  - any-parent (universal)
  - single-parent (highest leverage — no second set of eyes)
skills_used: [chat, list-manager, shopping-list, todo-add]
```

```yaml
loop_id: LP-011
name: Report Card Review
domain: parenting
trigger:
  - event: report card mentioned in conversation
  - time: quarterly (aligned to school calendar)
frequency: quarterly
memory:
  - last report card grades per subject
  - grade trends over time
  - teacher comments history
  - parent reaction patterns
  - interventions tried after previous cards
sources:
  - conversation history
  - profile (grade level, subjects, known strengths/gaps)
  - LP-045 (learning gap) outputs
  - LP-012 (parent-teacher comm) history
safe_actions:
  - help parent interpret grade trends
  - suggest specific questions for teacher follow-up
  - surface celebration for improvements
  - flag concerning patterns with gentle framing
  - offer to draft parent response email to teacher
human_boundary:
  - NEVER contact school about grades
  - NEVER diagnose learning disability from grades alone
  - NEVER create anxiety-inducing comparisons
loop_record:
  - grades per subject
  - trend vs last card
  - teacher comments summary
  - parent's next steps
wakes:
  - LP-013: if grade-related absence pattern detected
  - LP-044: reading grade low → reading log reactivated
woken_by: none (self-triggered on event)
stop_conditions:
  - child graduates
  - parent disables loop
personas:
  - high-achieving (intense review)
  - school-age-parent (general)
  - single-parent (needs interpretation help)
skills_used: [chat, patpat, school-email-draft, homework-help]
```

```yaml
loop_id: LP-012
name: Parent-Teacher Communication Coach
domain: parenting
trigger:
  - event: parent mentions teacher, school email, or communication need
  - event: LP-011 (report card) or LP-046 (project) fires
  - time: weekly scan for pending communications
frequency: event-based; weekly passive scan
memory:
  - recent teacher communications
  - open communication threads
  - teacher names per child
  - school communication style preferences
  - communication outcomes
sources:
  - conversation history
  - profile (children, school, teacher names)
  - LP-011, LP-046 outputs
safe_actions:
  - draft parent-teacher email on request
  - suggest talking points for upcoming conference
  - remind of unanswered teacher communications
  - help interpret teacher feedback
human_boundary:
  - NEVER send email to teacher
  - NEVER speak as parent to school
  - NEVER share sensitive child information without explicit consent
loop_record:
  - communications drafted
  - sent status (parent confirms)
  - open threads
  - last contact per teacher
wakes:
  - LP-005: if communication references a needed form
woken_by:
  - LP-011: report card → teacher follow-up needed
  - LP-046: project feedback needed
stop_conditions:
  - school year ends
  - family disables loop
personas:
  - any-school-age-parent
  - immigrant-family (language/cultural support)
  - adhd-parent (often behind on school comms)
skills_used: [chat, school-email-draft, patpat]
```

```yaml
loop_id: LP-013
name: School Absence Draft
domain: parenting
trigger:
  - signal: child is sick (from LP-026/LP-027 illness chain)
  - signal: parent says "kid's staying home today"
  - event: planned absence (appointment, trip)
frequency: event-based
memory:
  - school contact info (if provided)
  - past absence notes drafted
  - child's attendance record (for context)
  - school notification requirements
sources:
  - conversation history
  - profile (school name, child name, teacher)
  - LP-026 (symptom triage) — illness severity
  - LP-027 (child illness chain) — diagnosis context
safe_actions:
  - draft absence notification email/note on demand
  - surface standard school notification format
  - remind parent to send before school start time
  - suggest including return-to-school expectation
human_boundary:
  - NEVER send absence note
  - NEVER contact school independently
  - NEVER certify a medical reason without parent's explicit statement
loop_record:
  - date of absence
  - reason
  - draft created (yes/no)
  - parent confirmed sent (yes/no)
wakes:
  - LP-026: if sick → symptom triage may update care plan
  - LP-023: sick + sleep → sleep tracker notified
woken_by:
  - LP-027: illness chain activates absence draft as step 1
stop_conditions:
  - school year ends
personas:
  - any-school-age-parent
  - single-parent (most time-pressured)
skills_used: [chat, school-email-draft, todo-add]
```

```yaml
loop_id: LP-014
name: Lunch Prep Planner
domain: parenting
trigger:
  - time: evening before school day (default 20:00)
  - signal: morning chaos reveals unpacked lunch (LP-001)
frequency: daily (school days)
memory:
  - child food preferences and allergies
  - recent lunches made (avoid repetition)
  - what's in the fridge (from LP-034/LP-035)
  - upcoming special days (hot lunch, pizza day)
sources:
  - profile (allergies, preferences)
  - LP-033 (meal plan) — alignment check
  - LP-034 (grocery) — available ingredients
  - school calendar (hot lunch days)
safe_actions:
  - suggest a lunch combo based on available ingredients
  - flag if key ingredient is missing
  - remind parent the night before
  - track if child liked/didn't like it (for future planning)
human_boundary:
  - NEVER order lunch externally
  - NEVER assume ingredients are available without check
loop_record:
  - lunch packed (yes/no)
  - what was packed
  - child feedback (if reported)
  - missing items flagged
wakes:
  - LP-033: if lunch options are constrained, meal plan updated
  - LP-035: if waste from leftover lunches detected
woken_by:
  - LP-022: allergy medication → lunch allergen check added
stop_conditions:
  - child buys school lunch consistently
  - school year ends
personas:
  - dual-income
  - single-parent (highest leverage)
  - any-school-age-parent
skills_used: [chat, meal-planning, nutrition-coach, shopping-list]
```

---

### Domain: Relationships

```yaml
loop_id: LP-015
name: Couple Check-In
domain: relationships
trigger:
  - time: weekly (configurable day, default Sunday evening)
  - signal: LP-007 (teen withdrawal) or LP-019 (new baby strain) fires
  - signal: relationship stress pattern detected in conversation
frequency: weekly
memory:
  - last check-in date and outcome
  - ongoing relationship friction points
  - recent positive moments logged
  - partner's current stress level (inferred)
  - action items from last check-in
sources:
  - conversation history
  - profile (relationship status, children ages)
  - LP-019 (new baby strain) outputs
  - LP-007 (teen withdrawal) — parenting alignment issues
safe_actions:
  - prompt weekly check-in question (non-invasive)
  - celebrate a recent win ("you handled drop-off together — nice")
  - surface one actionable connection idea
  - gently flag a pattern of missed check-ins
human_boundary:
  - NEVER diagnose relationship problems
  - NEVER take sides between partners
  - NEVER suggest separation or divorce
  - NEVER share what one partner said about the other
loop_record:
  - check-in completed (yes/no)
  - mood rating (if shared)
  - key themes mentioned
  - next date night planned (yes/no)
wakes:
  - LP-016: check-in reveals need for date night
  - LP-020: anniversary within 30 days → reminder activated
woken_by:
  - LP-007: teen stress causing parental friction
  - LP-066: venting session reveals relationship strain
stop_conditions:
  - single user (no partner in profile)
  - user explicitly disables
personas:
  - dual-income
  - new-parent (highest need)
  - caregiver-parent (burnout risk)
skills_used: [chat, relationship-coach, life-coach]
```

```yaml
loop_id: LP-016
name: Date Night Planner
domain: relationships
trigger:
  - time: monthly (2 weeks before end of month)
  - signal: LP-015 (couple check-in) flags need
  - event: anniversary approaching (from LP-020)
frequency: monthly
memory:
  - last date night date and type
  - what was enjoyed
  - budget preference
  - childcare availability
  - local area preferences
sources:
  - profile (location, partner names, preferences)
  - LP-015 outputs (recent mood, what's needed)
  - LP-037 (schedule) — calendar gap
  - family calendar
safe_actions:
  - suggest date night options (restaurant, activity, home)
  - surface a draft "date night plan" outline
  - remind to arrange childcare if needed
  - flag if no date night in 6+ weeks
human_boundary:
  - NEVER book reservations
  - NEVER contact babysitters
  - NEVER plan elaborate surprises without explicit request
loop_record:
  - last date night date
  - type of date
  - outcome reported
  - next planned date
wakes:
  - LP-074: if date involves travel or overnight
woken_by:
  - LP-015: check-in reveals need
stop_conditions:
  - single user
  - user disables
personas:
  - dual-income
  - new-parent (critical — often neglected)
  - caregiver-parent
skills_used: [chat, relationship-coach, activity-suggest, restaurant]
```

```yaml
loop_id: LP-017
name: Co-Parent Sync
domain: relationships
trigger:
  - time: weekly (configurable, default Friday)
  - event: custody handoff imminent (48h before)
  - signal: co-parent communication breakdown detected
frequency: weekly
memory:
  - custody schedule
  - last handoff outcome
  - open items (child needs, schedule changes, medical updates)
  - communication history with co-parent
  - friction points
sources:
  - profile (custody schedule, co-parent contact)
  - family calendar
  - conversation history
  - LP-002 (pickup) — handoff context
safe_actions:
  - prep weekly handoff summary for parent to send
  - flag open items that need to be communicated before handoff
  - surface child updates worth sharing (health, school, mood)
  - help draft co-parent message in neutral, child-focused tone
human_boundary:
  - NEVER contact co-parent
  - NEVER take sides in co-parent disputes
  - NEVER make legal custody recommendations
  - NEVER share what one parent said about the other with the other
loop_record:
  - handoff date
  - items communicated
  - issues flagged
  - co-parent response (if reported)
wakes:
  - LP-018: if conflict signal detected during prep
woken_by: none (self-triggered)
stop_conditions:
  - child reaches adulthood
  - co-parenting relationship stabilizes into self-managed
  - user disables
personas:
  - co-parenting
  - divorced
skills_used: [chat, relationship-coach, schedule-manager, family-memory]
```

```yaml
loop_id: LP-018
name: Co-Parent Conflict Scripter
domain: relationships
trigger:
  - signal: parent reports conflict, unfairness, or rule inconsistency with co-parent
  - signal: LP-017 flags breakdown
  - event: custody dispute mentioned
frequency: event-based
memory:
  - recent conflict history
  - recurring friction points
  - communication patterns that escalate vs. de-escalate
  - co-parent communication style (if known)
  - child's experience of conflict
sources:
  - conversation history
  - LP-017 (co-parent sync) — context
  - profile (custody agreement summary if provided)
safe_actions:
  - draft a child-focused, neutral response script
  - surface de-escalation language suggestions
  - provide a "what to say / what not to say" brief
  - flag if conflict crosses into child welfare concern
human_boundary:
  - NEVER contact co-parent
  - NEVER advise on legal strategy
  - NEVER validate parental alienation behaviors
  - MUST flag to user if child's wellbeing appears at risk
loop_record:
  - conflict type
  - script drafted (yes/no)
  - outcome reported
  - escalation level
wakes:
  - LP-065: high conflict → family stress monitor alerted
  - LP-015: if conflict is straining primary relationship
woken_by:
  - LP-017: weekly sync reveals brewing conflict
stop_conditions:
  - conflict resolved and stable for 4+ weeks
  - mediation or legal process takes over
personas:
  - co-parenting
  - divorced
  - blended-family
skills_used: [chat, relationship-coach, life-coach]
```

```yaml
loop_id: LP-019
name: New Baby Relationship Strain Monitor
domain: relationships
trigger:
  - signal: new baby in profile (<6 months old)
  - signal: LP-028 (postpartum) flags strain
  - signal: partner mentions exhaustion, resentment, disconnection
frequency: continuous (weekly active check-in)
memory:
  - baby's age (weeks)
  - reported sleep deprivation level
  - division of labor concerns raised
  - last couple connection moment
  - postpartum mood tracking (from LP-028)
sources:
  - profile (baby DOB)
  - LP-028 (postpartum check) outputs
  - LP-015 (couple check-in) — baseline
  - conversation history
safe_actions:
  - weekly "how are you two doing?" prompt
  - offer "division of labor" conversation guide
  - surface a micro-connection idea (5-min connection, not date night)
  - normalize the strain with psychoeducation
human_boundary:
  - NEVER diagnose PPD — refer to LP-028 and suggest professional consult
  - NEVER take sides on division of labor disputes
  - NEVER suggest the relationship is failing based on strain reports
loop_record:
  - baby age
  - strain level this week (low/medium/high)
  - interventions tried
  - couple connection moment (yes/no)
wakes:
  - LP-015: strain high → couple check-in triggered
  - LP-030: new baby → pediatric check due
woken_by:
  - LP-028: postpartum check shows strain
  - LP-002: baby's needs intersecting with logistics
stop_conditions:
  - baby reaches 6 months (transition to standard loops)
  - user disables
personas:
  - new-parent (designed for this)
skills_used: [chat, relationship-coach, wellness-daily, patpat]
```

```yaml
loop_id: LP-020
name: Anniversary Tracker
domain: relationships
trigger:
  - time: annual (configurable; 30 days before, 7 days before, day-of)
frequency: annual
memory:
  - anniversary date
  - past celebrations (what was done)
  - partner preferences
  - budget history
sources:
  - profile (anniversary date, partner name)
  - LP-016 (date night) — planning context
  - family calendar
safe_actions:
  - send 30-day and 7-day advance reminders
  - suggest celebration ideas based on past years and preferences
  - offer a heartfelt message draft for the day-of
  - suggest a gift idea based on year number (traditional/modern)
human_boundary:
  - NEVER purchase gifts
  - NEVER make reservations
  - NEVER send messages on behalf of user
loop_record:
  - anniversary date
  - reminder sent dates
  - celebration planned (type)
  - outcome reported
wakes:
  - LP-016: anniversary approaching → date night planning triggered
  - LP-070: anniversary activity suggestion
woken_by: none (self-triggered on date)
stop_conditions:
  - user disables
  - relationship status changes
personas:
  - any-couple
skills_used: [chat, relationship-coach, activity-suggest]
```

```yaml
loop_id: LP-021
name: Family Meeting Facilitator
domain: relationships
trigger:
  - time: weekly (configurable day)
  - event: parent requests family meeting
frequency: weekly
memory:
  - recent family meeting topics and outcomes
  - open action items from last meeting
  - family members present
  - recurring friction topics
sources:
  - conversation history
  - LP-065 (family stress) — issues to address
  - LP-006 (behavior chart) — recognition moments
  - profile (family composition)
safe_actions:
  - generate meeting agenda based on open items and family context
  - suggest a fun agenda opener (game, memory share)
  - track action items assigned during meeting
  - send follow-up summary
human_boundary:
  - NEVER override parent decisions made in meeting
  - NEVER share meeting content with children beyond what parent intends
loop_record:
  - meeting held (yes/no)
  - attendees
  - agenda items covered
  - action items created
wakes:
  - LP-015: couple conflict in meeting → check-in triggered
  - LP-065: family stress discussed → monitor updated
woken_by: none (self-triggered)
stop_conditions:
  - family pauses for summer, travel, or preference
personas:
  - blended-family
  - high-achieving
  - any-family
skills_used: [chat, family-memory, todo-add, life-coach]
```

---

### Domain: Health & Wellness

```yaml
loop_id: LP-022
name: Medication Reminder
domain: health
trigger:
  - time: configurable (per medication schedule)
  - event: new medication added to profile
  - signal: LP-026 (illness) results in new prescription
frequency: daily (per medication schedule)
memory:
  - medication list per family member
  - dose and timing per medication
  - compliance history
  - refill dates
  - known side effects to monitor
sources:
  - profile (medication list)
  - LP-026 (illness) — new prescriptions
  - LP-050 (elder medication) — parallel elder loop
  - conversation history
safe_actions:
  - send daily medication reminder per schedule
  - flag missed dose pattern (3+ days)
  - remind 7 days before refill needed
  - surface relevant side effect to watch (from label, not diagnosis)
human_boundary:
  - NEVER advise on medication changes
  - NEVER diagnose based on symptom reports
  - NEVER skip or adjust doses — direct to prescriber
loop_record:
  - medications tracked
  - compliance per day
  - refill dates
  - side effects reported
wakes:
  - LP-023: sleep medication → sleep tracker notified
  - LP-050: if elder in household, elder medication loop parallels
woken_by:
  - LP-027: illness → new medication added
stop_conditions:
  - medication course completed
  - family member removed from profile
  - user disables
personas:
  - any-family
  - caregiver-parent (highest complexity)
  - adhd-parent (ADHD meds are common)
skills_used: [chat, medication-reminder, wellness-daily, todo-add]
```

```yaml
loop_id: LP-023
name: Sleep Tracker
domain: health
trigger:
  - time: morning (after wake time) — "how did everyone sleep?"
  - time: bedtime (linked to LP-003)
  - signal: exhaustion or sleep deprivation mentioned in conversation
frequency: daily
memory:
  - baseline sleep need by family member (age-based)
  - recent sleep quality log (7-day rolling)
  - known sleep disruptors (stress, illness, schedule change)
  - sleep debt accumulation estimate
  - LP-003 bedtime outcomes
sources:
  - conversation history
  - LP-003 (bedtime) — bedtime achieved
  - LP-028 (postpartum) — new parent sleep
  - profile (ages, known sleep issues)
safe_actions:
  - morning check-in on sleep quality
  - flag concerning patterns (< 6hr for 3+ consecutive days)
  - suggest sleep hygiene tip based on reported disruptor
  - surface sleep debt context ("you've been under 6hr for 4 days")
human_boundary:
  - NEVER diagnose sleep disorders
  - NEVER prescribe sleep aids
  - NEVER override parental sleep decisions for children
loop_record:
  - sleep hours per family member per night
  - quality rating (if reported)
  - disruptors noted
  - 7-day rolling average
wakes:
  - LP-032: sleep deprivation → fitness loop adjusted
  - LP-003: poor sleep pattern → bedtime coach updated
woken_by:
  - LP-022: sleep medication → tracking context added
  - LP-027: sick child → poor sleep expected
stop_conditions:
  - user disables
personas:
  - new-parent (primary need)
  - caregiver-parent
  - any-family
skills_used: [chat, sleep-coach, wellness-daily, wellness]
```

```yaml
loop_id: LP-024
name: Weekly Nutrition Review
domain: health
trigger:
  - time: weekly (Sunday or configured day)
frequency: weekly
memory:
  - family dietary goals
  - past week's meals (from LP-033)
  - known nutritional gaps or excesses
  - family member restrictions (allergies, preferences, medical)
  - recent nutrition wins and struggles
sources:
  - LP-033 (meal plan) outputs
  - LP-035 (waste review) outputs
  - profile (dietary goals, restrictions, ages)
  - conversation history
safe_actions:
  - generate weekly nutrition summary (not diagnosis)
  - flag pattern (e.g., 5 days without vegetables)
  - suggest one nutritional upgrade for the coming week
  - celebrate a nutrition win
human_boundary:
  - NEVER create medical nutrition plans
  - NEVER advise on therapeutic diets (keto, elimination) without clinical context
  - NEVER create food anxiety — frame positively
loop_record:
  - week's meals summary
  - nutritional patterns noted
  - goal progress
  - next week's one adjustment
wakes:
  - LP-033: nutrition finding → next meal plan adjusted
  - LP-035: waste pattern intersects with nutrition gaps
woken_by:
  - LP-025: wellness check flags nutrition concern
stop_conditions:
  - user disables
personas:
  - any-family
  - high-achieving (athletic kids → specific needs)
  - special-needs (dietary restrictions common)
skills_used: [chat, nutrition-coach, meal-planning, wellness]
```

```yaml
loop_id: LP-025
name: Wellness Daily Check-In
domain: health
trigger:
  - time: morning or evening (configurable)
  - signal: stress, exhaustion, or emotional difficulty mentioned
frequency: daily (optional; many users prefer 3x/week)
memory:
  - 7-day mood and energy log
  - known stressors this week
  - user's self-care practices
  - flagged concerns from previous days
sources:
  - conversation history
  - LP-029 (mental health pulse) — weekly context
  - LP-032 (fitness) — energy correlation
  - LP-065 (family stress) — household context
safe_actions:
  - morning energy and mood check prompt
  - surface a self-care micro-action (1-2 min)
  - flag pattern of declining wellbeing
  - celebrate consistency
human_boundary:
  - NEVER diagnose mental or physical health conditions
  - MUST escalate to LP-067 if crisis signals detected
  - NEVER reduce to "just exercise and sleep" for complex emotional pain
loop_record:
  - mood rating (1-5)
  - energy rating (1-5)
  - self-care action taken (yes/no)
  - stressor noted
wakes:
  - LP-032: low energy → fitness loop context updated
  - LP-066: emotional distress → venting loop activated
woken_by:
  - LP-031: illness recovery → wellness check updated
  - LP-019: new baby → daily check intensified
stop_conditions:
  - user disables
personas:
  - any-adult
  - caregiver-parent (burnout prevention)
  - single-parent
skills_used: [chat, wellness-daily, wellness, life-coach]
```

```yaml
loop_id: LP-026
name: Symptom Triage
domain: health
trigger:
  - signal: parent reports child or family member is sick
  - signal: symptom mentioned in conversation
frequency: event-based
memory:
  - current symptoms reported
  - symptom duration
  - household members affected
  - recent illness history
  - known conditions or risk factors
sources:
  - conversation history
  - profile (medical history, medications, ages)
  - LP-022 (medications) — drug interaction context
  - LP-027 (illness chain) — chain coordination
safe_actions:
  - ask structured symptom clarification questions
  - surface guidance on when to call doctor vs wait-and-see
  - flag red-flag symptoms (breathing difficulty, high fever thresholds)
  - suggest comfort care measures
human_boundary:
  - NEVER diagnose illness
  - NEVER prescribe treatment
  - MUST recommend urgent care/ER for red-flag symptoms
  - NEVER advise skipping prescribed medication
loop_record:
  - symptoms reported
  - duration
  - triage outcome (home care / call doctor / urgent care / ER)
  - resolution reported
wakes:
  - LP-013: sick → absence draft triggered
  - LP-022: new medication → reminders updated
  - LP-033: illness → meal plan adjusted (bland diet, fluids)
woken_by:
  - LP-027: illness chain coordinator calls triage as first step
stop_conditions:
  - illness resolved (reported)
  - family member discharged from care
personas:
  - any-parent
skills_used: [chat, symptom-triage, medication-reminder, wellness]
```

```yaml
loop_id: LP-027
name: Child Illness Chain Coordinator
domain: health
trigger:
  - signal: child reported sick (any severity)
frequency: event-based (multi-day active once triggered)
memory:
  - illness start date
  - current symptoms and severity
  - school absence status
  - medication schedule started
  - meal adjustments in effect
  - household spread risk
sources:
  - LP-026 (symptom triage) — clinical context
  - LP-013 (absence draft) — school coordination
  - LP-022 (medication) — treatment plan
  - LP-033 (meal plan) — diet adjustments
  - profile (child age, conditions, school info)
safe_actions:
  - coordinate across active loops (absence, medication, meal)
  - track day-by-day symptom progression
  - surface return-to-school criteria
  - remind of follow-up appointment if recommended
  - flag if illness spreading to other household members
human_boundary:
  - NEVER diagnose or prescribe
  - NEVER make school return decision autonomously
  - MUST escalate to professional recommendation for worsening
loop_record:
  - illness start/end date
  - school days missed
  - medications taken
  - resolution outcome
wakes:
  - LP-013: absence draft
  - LP-022: medication reminders
  - LP-026: symptom monitoring
  - LP-033: meal adjustment
woken_by:
  - LP-026: triage confirms illness → illness chain activated
stop_conditions:
  - child returns to school
  - illness resolved
personas:
  - any-school-age-parent
skills_used: [chat, symptom-triage, medication-reminder, school-email-draft, meal-planning]
```

```yaml
loop_id: LP-028
name: Postpartum Check
domain: health
trigger:
  - signal: baby is in profile (< 6 months)
  - time: weekly (first 6 months postpartum)
frequency: weekly
memory:
  - baby's age (weeks)
  - mood scores over time
  - sleep deprivation severity
  - support system noted
  - previous flags or concerns
  - birth type (C-section — longer recovery)
sources:
  - profile (baby DOB, birth type if known)
  - LP-023 (sleep tracker) — parent sleep
  - LP-019 (relationship strain) — partner support level
  - conversation history
safe_actions:
  - weekly emotional check-in (gentle, non-clinical)
  - surface postpartum support resources if needed
  - normalize common postpartum experiences
  - flag if Edinburgh scale-level concerns emerge (refer to LP-067)
human_boundary:
  - NEVER diagnose PPD, PPA, or psychosis
  - MUST recommend professional evaluation if 3+ weeks of persistent symptoms
  - NEVER minimize reports of dark thoughts — always take seriously
  - MUST activate LP-067 if any self-harm signal detected
loop_record:
  - week number postpartum
  - mood indicators this week
  - sleep hours average
  - support system status
  - any flags raised
wakes:
  - LP-019: high strain → relationship loop updated
  - LP-015: couple disconnection → check-in triggered
woken_by:
  - LP-019: relationship strain → postpartum check intensified
stop_conditions:
  - baby reaches 6 months (transition to general wellness)
  - user disables
personas:
  - new-parent (designed for this)
skills_used: [chat, wellness-daily, relationship-coach, wellness]
```

```yaml
loop_id: LP-029
name: Mental Health Pulse
domain: health
trigger:
  - time: weekly (configurable)
  - signal: LP-065 (stress monitor) flags elevated stress
frequency: weekly
memory:
  - 4-week mood trend
  - known mental health history (if shared)
  - stressors active this period
  - last time user engaged meaningful self-care
  - therapy status (in therapy / not / exploring)
sources:
  - conversation history
  - LP-025 (wellness daily) aggregated data
  - LP-065 (family stress) — household context
  - profile (any mental health notes shared)
safe_actions:
  - weekly mental health check-in question
  - surface a coping strategy relevant to reported stressors
  - note 4-week trend and gently surface if declining
  - suggest therapy if not currently engaged and symptoms persist 3+ weeks
human_boundary:
  - NEVER diagnose
  - NEVER advise to stop therapy or medication
  - MUST activate LP-067 for crisis signals
  - NEVER expose mental health notes in group contexts
loop_record:
  - mood trend (4-week)
  - stressors this week
  - coping action taken
  - therapy status
  - flags raised
wakes:
  - LP-025: mental health concern → daily wellness intensified
  - LP-066: emotional flooding → venting support
woken_by:
  - LP-065: family stress spike → mental health check triggered
stop_conditions:
  - user disables
  - user establishes professional care
personas:
  - any-adult
  - caregiver-parent (burnout)
  - single-parent
  - teen-parent
skills_used: [chat, wellness, wellness-daily, life-coach]
```

```yaml
loop_id: LP-030
name: Pediatric Appointment Tracker
domain: health
trigger:
  - time: aligned to well-child schedule (2m, 4m, 6m, 9m, 12m, 18m, 24m, then annual)
  - event: child added to profile
  - signal: LP-031 (immunization) flags upcoming vaccine
frequency: scheduled (per child's age)
memory:
  - last appointment date per child
  - next due date
  - upcoming vaccines due
  - any chronic conditions being monitored
  - growth milestones for context
sources:
  - profile (child DOB, pediatrician if provided)
  - LP-031 (immunization) — vaccine schedule
  - LP-022 (medication) — ongoing prescriptions to review
safe_actions:
  - remind 4 weeks before appointment due
  - generate questions-for-pediatrician list based on child's age/concerns
  - track completion once parent confirms
  - surface developmental milestones appropriate for appointment
human_boundary:
  - NEVER make appointments
  - NEVER advise on vaccine decisions
  - NEVER replace well-child visit with OiMy assessment
loop_record:
  - appointment date
  - vaccines received (if reported)
  - concerns addressed
  - next due date
wakes:
  - LP-031: appointment triggers vaccine review
  - LP-019: new baby → postpartum and baby appointments coordinated
woken_by: none (self-triggered)
stop_conditions:
  - child reaches 18
  - user disables
personas:
  - new-parent
  - any-parent
skills_used: [chat, wellness, todo-add, list-manager]
```

```yaml
loop_id: LP-031
name: Immunization Scheduler
domain: health
trigger:
  - time: following CDC/AAP vaccine schedule aligned to child DOB
  - event: new child added to profile
frequency: scheduled (milestone-based)
memory:
  - vaccines received with dates
  - vaccines due and when
  - catchup schedule if behind
  - any exemptions noted (not to advise — just to record)
sources:
  - profile (child DOB)
  - LP-030 (pediatric appointment) — coordinate timing
  - CDC immunization schedule (embedded reference)
safe_actions:
  - alert when a vaccine series is due (30 days ahead)
  - track completion when parent reports
  - generate immunization record summary on request
  - flag gaps in schedule
human_boundary:
  - NEVER advise FOR or AGAINST any specific vaccine
  - NEVER pressure parent on vaccine timing
  - NEVER create or modify medical records
loop_record:
  - vaccines given (date + type)
  - vaccines due (date + type)
  - compliance status
wakes:
  - LP-030: upcoming vaccine → appointment tracker reminded
woken_by:
  - LP-030: appointment completed → vaccine log updated
stop_conditions:
  - child completes childhood series (18yo)
  - user disables
personas:
  - any-parent
skills_used: [chat, wellness, todo-add, list-manager]
```

```yaml
loop_id: LP-032
name: Fitness Accountability
domain: health
trigger:
  - time: daily (morning or evening check-in)
  - signal: parent mentions workout, skipped exercise, energy
frequency: daily (or 3x/week — user configured)
memory:
  - weekly activity log
  - fitness goals (if shared)
  - streak/consistency data
  - known schedule constraints
  - energy level correlation (from LP-025)
sources:
  - conversation history
  - LP-025 (wellness daily) — energy data
  - LP-023 (sleep) — recovery context
  - profile (any fitness goals or constraints)
safe_actions:
  - send check-in prompt
  - celebrate streak milestones
  - surface a 5-minute workout option on low-energy days
  - flag if energy is consistently low (cross-reference LP-023 sleep)
human_boundary:
  - NEVER prescribe exercise program
  - NEVER push exercise during illness or injury
  - NEVER create shame around missed sessions
loop_record:
  - activity completed (yes/no)
  - type and duration (if shared)
  - energy level correlation
  - streak count
wakes:
  - LP-025: fitness positive → wellness check updated
woken_by:
  - LP-023: good sleep → flag as good day for exercise
stop_conditions:
  - user disables
  - injury noted (pause until cleared)
personas:
  - any-adult
  - dual-income (time-constrained)
skills_used: [chat, wellness, wellness-daily, activity-suggest]
```

---

### Domain: Daily Logistics

```yaml
loop_id: LP-033
name: Weekly Meal Planner
domain: logistics
trigger:
  - time: weekly (Thursday evening or configured day)
  - signal: parent asks "what should we make this week?"
  - woken_by: LP-024 (nutrition) or LP-026 (illness adjustment)
frequency: weekly
memory:
  - family food preferences and restrictions
  - last 3 weeks of meals (avoid repetition fatigue)
  - kitchen skill level and time availability
  - budget preference (if shared)
  - what's in the freezer/pantry (if tracked)
sources:
  - profile (family size, ages, restrictions)
  - LP-024 (nutrition) — gaps to address
  - LP-034 (grocery) — pantry availability
  - LP-035 (waste) — items that need using
  - LP-014 (lunch) — complement with lunches
safe_actions:
  - generate weekly 5-7 day meal plan
  - include balanced variety across cuisines and nutrients
  - suggest one new recipe per week
  - output shopping list for LP-034
  - flag school nights where quick meals are needed
human_boundary:
  - NEVER create therapeutic meal plans for medical conditions
  - NEVER order food
  - NEVER assume budget without user input
loop_record:
  - meals planned per day
  - new recipe tried
  - plan adherence (% days followed)
  - leftovers planned vs actual
wakes:
  - LP-034: meal plan → shopping list generated
  - LP-035: meal plan informs waste tracking
  - LP-014: lunch options coordinated
woken_by:
  - LP-024: nutrition gap → meal plan adjusted
  - LP-026: illness → bland/recovery meals added
  - LP-035: waste pattern → underused items prioritized
stop_conditions:
  - user disables
personas:
  - any-family
  - dual-income (efficiency critical)
  - single-parent
skills_used: [chat, meal-planning, nutrition-coach, shopping-list, list-manager]
```

```yaml
loop_id: LP-034
name: Grocery Optimizer
domain: logistics
trigger:
  - time: aligned to shopping day (user configured)
  - signal: LP-033 (meal plan) generates shopping list
  - signal: LP-036 (perishable) flags urgent items
frequency: weekly
memory:
  - shopping list current week
  - store preferences (if shared)
  - budget tracking
  - items consistently purchased
  - items that routinely go to waste (from LP-035)
sources:
  - LP-033 (meal plan) outputs
  - LP-035 (waste) — what to cut
  - LP-036 (perishable) — what to prioritize
  - LP-014 (lunch) — school lunch items
  - LP-083 (snack inventory) — snack restocking
safe_actions:
  - generate consolidated, categorized shopping list
  - flag if item consistently bought but wasted
  - suggest buy-in-bulk item based on usage pattern
  - remind of shopping trip with list summary
human_boundary:
  - NEVER place grocery orders
  - NEVER use user's payment information
  - NEVER make delivery arrangements
loop_record:
  - shopping list generated
  - estimated cost (if pricing available)
  - items flagged as potential waste risk
  - actual vs planned (if reported)
wakes:
  - LP-035: post-shopping → waste tracking reset
woken_by:
  - LP-033: meal plan ready → list generated
  - LP-036: urgent perishable → ad-hoc list item added
stop_conditions:
  - user disables
personas:
  - any-family
skills_used: [chat, shopping-list, grocery-optimizer, list-manager, meal-planning]
```

```yaml
loop_id: LP-035
name: Grocery Waste Reviewer
domain: logistics
trigger:
  - time: weekly (end of week, before LP-033 new plan)
  - signal: parent mentions throwing something away
frequency: weekly
memory:
  - items wasted per week (last 4 weeks)
  - reasons for waste (bought too much, wrong recipe, picky eater)
  - waste-to-purchase ratio estimate
  - recurring waste offenders
sources:
  - conversation history
  - LP-033 (meal plan) — what was planned
  - LP-034 (grocery) — what was bought
  - LP-036 (perishable) — urgent items flagged mid-week
safe_actions:
  - weekly waste review prompt ("what went bad this week?")
  - surface the top recurring waste item
  - suggest a one-line adjustment to next week's plan to reduce it
  - celebrate if waste was lower than prior week
human_boundary:
  - NEVER create food guilt or shame
  - NEVER assume waste is due to carelessness
loop_record:
  - items wasted this week
  - cost estimate (if trackable)
  - recurring patterns
  - adjustments recommended for next week
wakes:
  - LP-033: waste insight → meal plan adjusted next cycle
  - LP-034: waste pattern → shopping list quantity adjusted
woken_by:
  - LP-034: post-shopping data feeds in
stop_conditions:
  - user disables
personas:
  - any-family
  - single-parent (budget sensitivity)
skills_used: [chat, meal-planning, shopping-list, grocery-optimizer]
```

```yaml
loop_id: LP-036
name: Perishable Waste Tracker (The Spinach Loop)
domain: logistics
trigger:
  - signal: highly perishable item purchased (spinach, berries, fish, herbs)
  - signal: LP-034 buys known quick-spoil items
  - time: 3-day check for known perishables
frequency: continuous (3-day alert cadence per item)
memory:
  - current perishable items in fridge (user-reported or inferred from LP-034)
  - average shelf life per item type
  - usage history (do they actually use spinach?)
  - recurring waste offenders
sources:
  - LP-034 (grocery) — newly purchased perishables
  - LP-033 (meal plan) — planned uses
  - conversation history
safe_actions:
  - 3-day alert: "your spinach is at peak — use it today or tomorrow"
  - suggest a quick recipe that uses the flagged item
  - flag if item is routinely wasted — recommend buying less or not at all
human_boundary:
  - NEVER throw food away (obviously)
  - NEVER shame for waste
loop_record:
  - items tracked
  - alert sent date
  - used vs wasted outcome
  - recurring waste flag
wakes:
  - LP-034: chronic waste item → removed from default list
  - LP-035: waste confirmed → weekly waste review updated
woken_by:
  - LP-010: outgrown tracker model — same inventory-awareness principle applied to fridge
stop_conditions:
  - item consumed
  - item removed from shopping habits
personas:
  - any-family
  - single-parent (small quantities, high waste risk)
skills_used: [chat, grocery-optimizer, meal-planning, nutrition-coach]
```

```yaml
loop_id: LP-037
name: Daily Schedule Sync
domain: logistics
trigger:
  - time: morning (before LP-001 morning chaos fires)
  - event: schedule change mentioned
frequency: daily
memory:
  - today's family schedule
  - conflicts flagged yesterday
  - standing commitments per family member
  - transportation dependencies
sources:
  - family calendar
  - LP-001 (morning) — morning context
  - LP-002 (pickup) — afternoon context
  - LP-009 (activity) — extracurricular schedule
  - profile (work schedules, school hours)
safe_actions:
  - morning "here's today" brief (3-5 items max)
  - flag any schedule conflicts for today
  - surface a logistics dependency (e.g., "you need to leave by 3:10 for pickup before class")
  - note any preparation needed for tomorrow
human_boundary:
  - NEVER change calendar entries
  - NEVER contact third parties about schedule changes
  - NEVER cancel commitments
loop_record:
  - schedule summary for the day
  - conflicts identified
  - logistics dependencies flagged
  - tomorrow's preview note
wakes:
  - LP-002: pickup time confirmed from schedule
  - LP-001: morning brief includes schedule context
woken_by:
  - LP-009: new activity added → schedule updated
stop_conditions:
  - user disables
personas:
  - dual-income
  - co-parenting
  - any-family
skills_used: [chat, schedule-manager, transportation, todo-add]
```

```yaml
loop_id: LP-038
name: Form Reminder
domain: logistics
trigger:
  - event: form, document, or submission mentioned
  - signal: LP-005 (permission slip) flags form need
  - time: weekly passive scan for open form obligations
frequency: event-based (with weekly passive scan)
memory:
  - open forms (name, due date, submission status)
  - forms completed in last 60 days (for reference)
  - recurring annual forms (back-to-school, insurance open enrollment)
sources:
  - conversation history
  - LP-005 (permission slip) — school forms
  - LP-077 (document expiry) — renewal forms
  - profile (known annual obligations)
safe_actions:
  - flag open form with due date
  - send 48h and 24h reminders
  - offer to help fill out information (draft, not submit)
  - mark complete when parent confirms
human_boundary:
  - NEVER submit forms
  - NEVER use user's signature
  - NEVER fill in sensitive fields (SSN, legal identifiers) unless explicitly asked
loop_record:
  - open forms list
  - reminders sent
  - completion status
wakes:
  - LP-005: form is a permission slip → LP-005 takes over
woken_by:
  - LP-005: permission slip needs form tracking
stop_conditions:
  - all open forms completed
  - no active obligations for 30 days
personas:
  - any-family
skills_used: [chat, todo-add, list-manager, life-admin]
```

```yaml
loop_id: LP-039
name: Subscription Audit
domain: logistics
trigger:
  - time: quarterly (Jan, Apr, Jul, Oct)
  - signal: user mentions a subscription or bill
frequency: quarterly
memory:
  - known subscriptions (service, cost, last reviewed)
  - subscriptions flagged as unused
  - total monthly subscription spend
  - cancellation history
sources:
  - conversation history (subscriptions mentioned)
  - LP-075 (bills) — cost tracking
  - profile (any subscription notes)
safe_actions:
  - generate known subscription list with costs
  - flag services not mentioned in 60+ days (potential unused)
  - estimate total monthly subscription spend
  - suggest cancellation candidates
human_boundary:
  - NEVER cancel subscriptions
  - NEVER access financial accounts
loop_record:
  - subscriptions listed
  - estimated monthly total
  - unused candidates flagged
  - cancellations reported (by user)
wakes:
  - LP-076: subscription audit reveals insurance gap → insurance review prompted
  - LP-077: document expiry or renewal needed
woken_by: none (self-triggered quarterly)
stop_conditions:
  - user disables
personas:
  - any-adult
skills_used: [chat, life-admin, list-manager]
```

```yaml
loop_id: LP-040
name: Morning Prep Checklist
domain: logistics
trigger:
  - time: evening before school/work day (default 21:00)
  - signal: LP-001 (morning chaos) reports chronic chaos
frequency: daily (school/work evenings)
memory:
  - family's standard morning checklist
  - items that routinely cause morning delay
  - tomorrow's special needs (early day, field trip, different dropoff)
sources:
  - LP-001 (morning) — chaos history
  - LP-037 (schedule) — tomorrow's agenda
  - LP-005 (permission slip) — anything needed tomorrow
  - profile (family routines)
safe_actions:
  - send evening "tomorrow prep" checklist
  - flag any special items for tomorrow
  - confirm lunch is handled (link to LP-014)
  - check backpack is packed (link to LP-041)
human_boundary:
  - NEVER pack bags for family
  - NEVER set family members' alarms
loop_record:
  - checklist sent (yes/no)
  - items flagged for tomorrow
  - special items noted
  - completion confirmed (yes/no)
wakes:
  - LP-001: prep completion → morning loop context updated
  - LP-041: backpack check triggered
woken_by:
  - LP-001: chaos pattern → evening prep added
stop_conditions:
  - user disables
  - family develops autonomous routine
personas:
  - dual-income
  - single-parent
  - adhd-parent
skills_used: [chat, todo-add, list-manager, schedule-manager]
```

```yaml
loop_id: LP-041
name: Backpack Check
domain: logistics
trigger:
  - time: evening (part of LP-040 morning prep)
  - time: morning (LP-001 last check)
frequency: daily
memory:
  - standard backpack contents per child
  - items recently forgotten
  - upcoming special items needed
  - PE days, library days, instrument days
sources:
  - LP-040 (prep checklist) — context
  - LP-005 (permission slip) — items to include
  - profile (school schedule, PE days, etc.)
  - family calendar
safe_actions:
  - send backpack checklist with tomorrow-specific items
  - flag PE kit if tomorrow is PE day
  - remind of any forms or special items due
human_boundary:
  - NEVER pack bags
  - NEVER contact school about forgotten items
loop_record:
  - checklist completed (yes/no)
  - items flagged
  - items forgotten (reported next day)
wakes:
  - LP-005: form reminder if permission slip should be in bag
woken_by:
  - LP-001: morning chaos from forgotten item → backpack check reinforced
stop_conditions:
  - child takes over own backpack management
  - school year ends
personas:
  - school-age-parent
  - adhd-parent
skills_used: [chat, todo-add, list-manager]
```

```yaml
loop_id: LP-042
name: Car Maintenance Tracker
domain: logistics
trigger:
  - time: monthly check-in
  - signal: parent mentions car, service, or warning light
frequency: monthly
memory:
  - last oil change date/mileage
  - tire rotation schedule
  - registration expiry
  - upcoming service milestones
  - vehicle(s) in household
sources:
  - conversation history
  - profile (vehicle info if provided)
  - LP-037 (schedule) — transportation dependencies
safe_actions:
  - monthly reminder to check oil, tire pressure, warning lights
  - flag oil change due (by mileage estimate)
  - remind of registration renewal (from LP-077)
  - surface upcoming service checklist
human_boundary:
  - NEVER schedule service appointments
  - NEVER access vehicle systems
loop_record:
  - last check date
  - services noted
  - upcoming milestones
  - issues flagged
wakes:
  - LP-075: car payment or registration → bill tracker notified
  - LP-077: registration expiry → document tracker notified
woken_by: none (self-triggered)
stop_conditions:
  - user disables
  - no vehicle in household
personas:
  - any-driver
skills_used: [chat, life-admin, todo-add]
```

---

### Domain: Education

```yaml
loop_id: LP-043
name: Homework Help Session
domain: education
trigger:
  - signal: child asks for help, or parent says "kid is stuck on homework"
  - event: LP-004 (tracker) flags consistent struggle in a subject
frequency: event-based
memory:
  - subjects where help was needed
  - approach that worked last time
  - child's learning style (if noted)
  - grade level per subject
sources:
  - conversation history
  - LP-004 (homework tracker) — struggle pattern
  - LP-045 (learning gap) — subject context
  - profile (grade level, subjects)
safe_actions:
  - guide parent through explaining concept (Socratic method via parent)
  - surface an age-appropriate explanation of the concept
  - suggest a resource (Khan Academy, etc.)
  - help parent explain without doing it for the child
human_boundary:
  - NEVER complete homework assignments
  - NEVER provide answers directly to the child (routes via parent)
  - NEVER advise to skip assignment
loop_record:
  - subject helped
  - concept addressed
  - approach used
  - outcome (child understood / still struggling)
wakes:
  - LP-044: reading help → reading log updated
  - LP-045: persistent struggle → learning gap detector flagged
woken_by:
  - LP-004: homework struggle flagged
stop_conditions:
  - child develops proficiency in subject
  - school year ends
personas:
  - school-age-parent
  - immigrant-family (may need more scaffolding)
skills_used: [chat, homework-help, patpat]
```

```yaml
loop_id: LP-044
name: Reading Log
domain: education
trigger:
  - time: daily (after-school or bedtime)
  - signal: parent mentions reading
frequency: daily
memory:
  - current books per child
  - daily reading minutes
  - reading goals (school or family)
  - genres enjoyed
  - reading level (if shared)
sources:
  - conversation history
  - LP-004 (homework) — reading as homework
  - profile (child ages, reading levels)
  - LP-049 (summer) — summer reading program
safe_actions:
  - daily reading check-in ("did [child] read today?")
  - celebrate reading streak milestones
  - suggest next book based on genre/level
  - track against reading goal
human_boundary:
  - NEVER choose books against parent's content values
  - NEVER report to school without explicit request
loop_record:
  - daily minutes per child
  - book currently reading
  - streak count
  - books completed this month
wakes:
  - LP-049: summer reading log activated in summer months
woken_by:
  - LP-004: homework includes reading → log updated
stop_conditions:
  - child reads independently and self-tracks
  - parent disables
personas:
  - school-age-parent
  - high-achieving
  - any-parent
skills_used: [chat, homework-help, todo-add, family-memory]
```

```yaml
loop_id: LP-045
name: Learning Gap Detector
domain: education
trigger:
  - time: weekly review (Sunday)
  - event: LP-004 (homework tracker) flags pattern of struggle
  - event: LP-011 (report card) shows declining grade
frequency: weekly
memory:
  - subjects with 2+ consecutive struggle reports
  - intervention attempts and outcomes
  - grade trends per subject
  - teacher feedback summaries
sources:
  - LP-004 (homework) — weekly struggle data
  - LP-011 (report card) — grade trends
  - LP-043 (homework help) — intervention history
  - profile (grade level, known learning differences)
safe_actions:
  - weekly learning gap summary to parent
  - surface targeted intervention suggestion for flagged subject
  - suggest tutor for persistent gaps (3+ weeks)
  - prompt parent-teacher conversation if grade-confirmed
human_boundary:
  - NEVER diagnose learning disabilities
  - NEVER contact school about academic concerns
  - NEVER create test anxiety — frame growth-oriented
loop_record:
  - flagged subjects
  - weeks at struggle level
  - interventions tried
  - trend direction
wakes:
  - LP-012: gap confirmed → parent-teacher communication suggested
  - LP-043: targeted homework help sessions intensified
woken_by:
  - LP-004: homework struggle pattern
  - LP-011: report card decline
stop_conditions:
  - gap closes (3+ consecutive weeks at grade level)
  - school year ends
personas:
  - school-age-parent
  - adhd-parent
  - special-needs-parent
skills_used: [chat, homework-help, patpat, life-coach]
```

```yaml
loop_id: LP-046
name: School Project Tracker
domain: education
trigger:
  - event: project assigned (mentioned in conversation or from LP-004)
  - signal: major assignment due within 2 weeks
frequency: event-based (multi-week active duration)
memory:
  - active projects (name, due date, requirements)
  - work completed so far
  - parent support level needed
  - past project patterns (does child start early or cram?)
sources:
  - conversation history
  - LP-004 (homework) — project mentioned
  - LP-037 (schedule) — time blocks needed
  - profile (grade level, past project history)
safe_actions:
  - create project milestone breakdown
  - send daily/every-other-day progress reminders as due date approaches
  - suggest materials or resources needed
  - flag if milestone is falling behind
human_boundary:
  - NEVER do project for child
  - NEVER contact teacher about project
  - NEVER exceed child's appropriate contribution level
loop_record:
  - project name and due date
  - milestones created
  - completion status per milestone
  - final submission confirmed
wakes:
  - LP-004: project progress feeding back to homework tracker
  - LP-037: project work blocks added to schedule
woken_by:
  - LP-011: report card reveals project grade poor → tracker improved
stop_conditions:
  - project submitted
  - school year ends
personas:
  - school-age-parent
  - high-achieving
  - adhd-parent
skills_used: [chat, homework-help, todo-add, schedule-manager]
```

```yaml
loop_id: LP-047
name: Standardized Test Prep
domain: education
trigger:
  - time: seasonal (fall SAT/ACT season: Aug; spring: Feb)
  - signal: parent mentions standardized test
  - event: LP-048 (college planning) activates for junior
frequency: seasonal (2x/year)
memory:
  - upcoming test dates
  - past scores (if shared)
  - target score / school requirements
  - study timeline
  - subjects needing most focus
sources:
  - conversation history
  - profile (teen age, grade level)
  - LP-048 (college planning) — context
  - LP-045 (learning gap) — subject priorities
safe_actions:
  - surface test prep timeline based on test date
  - suggest daily/weekly study habit structure
  - recommend resources (Khan Academy SAT, CollegeBoard)
  - track study consistency
human_boundary:
  - NEVER advise on which test to take (SAT vs ACT vs neither)
  - NEVER register for test
  - NEVER create anxiety around scores — always growth-framed
loop_record:
  - test date(s)
  - study consistency this week
  - target vs current score gap
  - resources suggested
wakes:
  - LP-048: test score impacts college planning
  - LP-045: weak subject on test → learning gap intensified
woken_by: none (self-triggered seasonally)
stop_conditions:
  - test taken and scored
  - student decides not to test
personas:
  - teen-parent
  - high-achieving
skills_used: [chat, homework-help, life-coach, wellness]
```

```yaml
loop_id: LP-048
name: College Planning
domain: education
trigger:
  - time: annual (starts when teen enters 9th grade)
  - signal: teen mentions college, major, career
frequency: annual (with quarterly check-ins in junior year)
memory:
  - teen's grade level
  - interests and strengths
  - college list (if started)
  - application deadlines
  - financial aid awareness
  - campus visits taken
sources:
  - profile (teen DOB, interests if shared)
  - LP-047 (test prep) — test scores
  - LP-045 (learning gap) — academic profile
  - conversation history
safe_actions:
  - surface grade-appropriate college planning milestones
  - recommend summer activities for junior/senior years
  - help draft college essay outline (not write it)
  - remind of application deadlines (90, 60, 30 days)
human_boundary:
  - NEVER apply to colleges on behalf of student
  - NEVER advise on financial aid strategy (too legally sensitive)
  - NEVER tell teen what to study or where to go
loop_record:
  - current grade level
  - milestone completion status
  - college list items
  - upcoming deadlines
wakes:
  - LP-049: senior planning includes gap year / transition
  - LP-047: standardized test prep coordinated
woken_by: none (self-triggered annually)
stop_conditions:
  - teen enrolled in college or post-secondary path
  - user disables
personas:
  - teen-parent
  - high-achieving
  - immigrant-family (first-gen college navigation)
skills_used: [chat, life-coach, homework-help, todo-add]
```

```yaml
loop_id: LP-049
name: Summer Learning Continuity
domain: education
trigger:
  - time: seasonal (May — 6 weeks before school ends)
  - signal: school year end approaching
frequency: seasonal (active June-August)
memory:
  - child's grade level and upcoming grade
  - known summer slide risk (reading level, math)
  - summer plans (camp, travel, activities)
  - family's learning philosophy (structured vs. free)
sources:
  - profile (child ages, grade level)
  - LP-044 (reading log) — reading continuity
  - LP-009 (activity enrollment) — camps and programs
  - LP-074 (vacation) — travel weeks to plan around
safe_actions:
  - suggest summer reading list appropriate to grade/level
  - recommend 3-4 learning activities per week (light)
  - track reading log through summer
  - surface free local learning resources
human_boundary:
  - NEVER create academic pressure in summer — always family-led
  - NEVER make child feel behind
loop_record:
  - weeks of summer
  - reading completed
  - learning activities done
  - skills maintained vs declined (reported at fall start)
wakes:
  - LP-044: reading log continues through summer
  - LP-070: summer activity suggestions
woken_by:
  - LP-048: senior planning includes summer before college
stop_conditions:
  - school resumes in fall
personas:
  - school-age-parent
  - any-parent
skills_used: [chat, homework-help, activity-suggest, reading-log]
```

---

### Domain: Elder Care

```yaml
loop_id: LP-050
name: Elder Medication Manager
domain: elder
trigger:
  - time: daily per elder's medication schedule
  - event: new medication prescribed
frequency: daily
memory:
  - elder's medication list (name, dose, time, prescriber)
  - compliance history
  - refill dates
  - known drug interactions (reference only)
  - who manages medications (elder autonomy level)
sources:
  - profile (elder member, medications)
  - LP-051 (elder check-in) — reports medication adherence
  - LP-022 (family medication) — parallel household loop
  - LP-054 (dementia routine) — cognitive status affects management
safe_actions:
  - send daily medication reminder to caregiver
  - flag missed dose (based on caregiver report)
  - refill reminder 7 days ahead
  - flag concerning compliance decline
human_boundary:
  - NEVER adjust medications
  - NEVER advise on drug interactions — refer to pharmacist
  - NEVER assume elder compliance without caregiver report
  - MUST flag to LP-067 if medication refusal is part of a decline crisis
loop_record:
  - medications taken per day
  - compliance rate
  - refill dates
  - missed dose incidents
wakes:
  - LP-051: medication concern → check-in loop alerted
  - LP-054: dementia context → routine check updated
woken_by:
  - LP-053: mood decline may indicate medication side effect
stop_conditions:
  - elder passes away or transitions to facility care
  - user disables
personas:
  - caregiver-parent
skills_used: [chat, medication-reminder, elder-checkin, wellness]
```

```yaml
loop_id: LP-051
name: Elder Daily Check-In
domain: elder
trigger:
  - time: daily (morning or afternoon, user configured)
  - signal: caregiver reports concern
frequency: daily
memory:
  - baseline elder wellbeing status
  - recent health events
  - mood trend (from LP-053)
  - ADL (activities of daily living) status
  - family members involved in care
sources:
  - conversation history
  - profile (elder member, care level)
  - LP-050 (medication) — adherence context
  - LP-053 (mood) — mood context
  - LP-054 (dementia) — routine context
safe_actions:
  - daily check-in prompt to caregiver
  - surface any concerns from prior day's data
  - provide a script for checking in with elder (if caregiver is remote)
  - flag concerning changes from baseline
human_boundary:
  - NEVER make medical assessments
  - NEVER contact elder directly
  - NEVER make care decisions
loop_record:
  - check-in completed (yes/no)
  - elder's reported status
  - concerns flagged
  - baseline comparison
wakes:
  - LP-052: health concern → appointment tracker alerted
  - LP-057: mobility concern → fall risk assessment triggered
woken_by:
  - LP-050: medication missed → check-in intensified
stop_conditions:
  - elder in full-time care facility
  - user disables
personas:
  - caregiver-parent
skills_used: [chat, elder-checkin, wellness, life-coach]
```

```yaml
loop_id: LP-052
name: Elder Appointment Tracker
domain: elder
trigger:
  - time: aligned to elder's care schedule
  - event: new appointment mentioned
  - signal: LP-051 (check-in) flags health concern
frequency: scheduled (multiple per month typically)
memory:
  - upcoming appointments (specialist, GP, therapy)
  - transportation arrangements
  - appointment history and outcomes
  - questions for upcoming appointments
sources:
  - profile (elder member, doctors)
  - LP-051 (check-in) — new concerns to address
  - LP-050 (medication) — refill coordination
  - family calendar
safe_actions:
  - reminder 48h and day-of for appointments
  - help prepare question list for appointment
  - track outcomes when caregiver reports
  - coordinate transportation logistics reminder
human_boundary:
  - NEVER make appointments
  - NEVER contact medical providers
  - NEVER make medical decisions for elder
loop_record:
  - appointments upcoming
  - questions prepared
  - outcomes reported
  - next appointment scheduled
wakes:
  - LP-050: appointment resulted in new medication → reminder updated
woken_by:
  - LP-051: health concern → appointment needed
stop_conditions:
  - elder in full-time facility
  - user disables
personas:
  - caregiver-parent
skills_used: [chat, elder-checkin, todo-add, list-manager, schedule-manager]
```

```yaml
loop_id: LP-053
name: Elder Mood Monitor
domain: elder
trigger:
  - time: daily (part of LP-051 check-in)
  - signal: caregiver reports concerning mood change
frequency: continuous (daily data; weekly trend)
memory:
  - baseline mood pattern
  - 7-day mood trend
  - known mood disruptors (pain, isolation, loss of independence)
  - seasonal patterns (winter isolation, summer heat)
  - recent social interactions
sources:
  - LP-051 (check-in) — mood reported
  - LP-056 (isolation) — social context
  - conversation history
  - profile (elder member, known conditions)
safe_actions:
  - flag significant mood change from baseline
  - surface possible cause (contextual — not diagnosis)
  - suggest caregiver engagement approach
  - flag if low mood persists 7+ days (recommend MD consult)
human_boundary:
  - NEVER diagnose depression in elder
  - NEVER recommend medication changes
  - MUST flag sustained decline to caregiver for professional input
loop_record:
  - daily mood rating (caregiver reported)
  - 7-day trend
  - causes noted
  - interventions tried
wakes:
  - LP-051: mood concern → check-in updated
  - LP-057: fall risk elevated with mood decline
  - LP-058: caregiver burnout risk elevated when elder mood is persistently low
woken_by:
  - LP-052: appointment revealed new diagnosis → mood impact expected
stop_conditions:
  - elder in full-time facility
  - user disables
personas:
  - caregiver-parent
skills_used: [chat, elder-checkin, wellness, life-coach]
```

```yaml
loop_id: LP-054
name: Dementia Routine Guard
domain: elder
trigger:
  - time: daily (parallel to LP-051)
  - signal: dementia noted in profile or conversation
  - signal: LP-053 (mood) or LP-051 (check-in) flags confusion
frequency: daily (when active)
memory:
  - elder's established daily routine
  - routine deviation history
  - known confusion triggers (schedule changes, visitors, travel)
  - current stage of cognitive decline (if known)
  - caregiver strategies that work
sources:
  - profile (elder member, dementia notes)
  - LP-051 (check-in) — deviation reports
  - LP-053 (mood) — agitation context
  - conversation history
safe_actions:
  - remind caregiver of routine elements before disruption (e.g., "today is hairdresser day — she may resist")
  - surface sundowning risk in evening hours
  - provide caregiver redirection scripts for common confusion scenarios
  - flag acute confusion change — may indicate UTI, delirium
human_boundary:
  - NEVER diagnose dementia stage or progression
  - NEVER make care decisions
  - MUST flag acute confusion changes — this can be medical emergency
  - NEVER suggest reducing caregiver involvement
loop_record:
  - routine adherence today
  - confusion incidents reported
  - caregiver script used
  - acute changes flagged
wakes:
  - LP-051: routine disruption → check-in alerted
  - LP-050: medication management complexity increases
woken_by:
  - LP-053: mood/agitation → dementia context reviewed
stop_conditions:
  - elder in memory care facility
  - user disables
personas:
  - caregiver-parent (dementia caregiving is its own crisis)
skills_used: [chat, elder-checkin, occupational-therapy, wellness]
```

```yaml
loop_id: LP-055
name: Family Elder Status Update
domain: elder
trigger:
  - time: weekly (for distributed family who share caregiving)
  - signal: significant health event
frequency: weekly
memory:
  - family members involved in care
  - last update distributed
  - open concerns among family
  - care responsibility distribution
sources:
  - LP-051 (check-in) — week's data
  - LP-052 (appointment) — outcomes
  - LP-053 (mood) — trend
  - conversation history
safe_actions:
  - draft weekly elder status summary for family distribution
  - flag any action items for other family members
  - note upcoming appointments or care needs
  - celebrate positive moments (elder had a great week)
human_boundary:
  - NEVER send update to family
  - NEVER share medical details without explicit caregiver consent
  - NEVER make family dynamics decisions
loop_record:
  - update drafted (yes/no)
  - key status points
  - action items for family
  - sent (reported by user)
wakes:
  - LP-058: if caregiver burnout flagged, family update includes request for help
woken_by:
  - LP-051: weekly check-in data ready
stop_conditions:
  - elder in full-time facility
  - single caregiver (no family to update)
personas:
  - caregiver-parent with distributed family
skills_used: [chat, elder-checkin, life-admin, family-memory]
```

```yaml
loop_id: LP-056
name: Elder Isolation Check
domain: elder
trigger:
  - time: weekly
  - signal: LP-053 (mood) flags low mood sustained 5+ days
frequency: weekly
memory:
  - elder's social activity baseline
  - recent social contacts
  - transportation and mobility limitations
  - interests and former activities
  - community resources available
sources:
  - LP-053 (mood) — mood context
  - LP-051 (check-in) — social reports
  - profile (elder member, location, mobility)
safe_actions:
  - flag isolation pattern to caregiver
  - suggest a specific social engagement (phone call, visitor, community program)
  - surface local senior resources (meals on wheels, senior center, etc.)
  - help caregiver draft invitation to family member for a visit
human_boundary:
  - NEVER contact elder directly
  - NEVER arrange social engagements
  - NEVER assume elder wants social engagement (some prefer solitude)
loop_record:
  - isolation level this week
  - social contacts (yes/no)
  - intervention suggested
  - outcome reported
wakes:
  - LP-053: isolation → mood decline risk elevated
  - LP-058: isolation burden on primary caregiver
woken_by:
  - LP-051: check-in reports elder hasn't spoken to anyone in 3 days
stop_conditions:
  - elder in assisted living with built-in socialization
  - user disables
personas:
  - caregiver-parent
skills_used: [chat, elder-checkin, life-coach, activity-suggest]
```

```yaml
loop_id: LP-057
name: Fall Risk Assessment
domain: elder
trigger:
  - signal: LP-053 (mood) reports agitation or confusion
  - signal: caregiver reports near-fall or fall
  - signal: LP-054 (dementia) flags routine disruption
  - time: biannual proactive review
frequency: event-based + biannual
memory:
  - fall history
  - known risk factors (medications, floor hazards, footwear)
  - current mobility status
  - recent changes (new medication, illness, confusion)
sources:
  - LP-050 (medication) — fall-risk medications (note: reference only)
  - LP-051 (check-in) — mobility reports
  - LP-053 (mood) — cognitive/emotional state
  - profile (elder member, mobility aids)
safe_actions:
  - surface fall risk checklist for caregiver to review
  - suggest environmental modification ideas (grab bars, rugs removed)
  - flag if new medication known to increase fall risk (alert only — refer to MD)
  - recommend PT evaluation if fall risk elevated
human_boundary:
  - NEVER make home modification decisions
  - NEVER advise on medication adjustments
  - MUST escalate to LP-052 for appointment if fall occurs
loop_record:
  - risk level assessed
  - fall incident reported
  - environmental factors noted
  - interventions suggested
wakes:
  - LP-052: fall → appointment tracker → MD/PT evaluation needed
woken_by:
  - LP-053: agitation or confusion → fall risk elevated
stop_conditions:
  - elder in facility with fall protocols in place
  - user disables
personas:
  - caregiver-parent
skills_used: [chat, elder-checkin, occupational-therapy, wellness]
```

```yaml
loop_id: LP-058
name: Caregiver Burnout Monitor
domain: elder
trigger:
  - time: weekly (runs alongside elder loops)
  - signal: LP-053 or LP-056 report sustained elder difficulty
  - signal: LP-025 (wellness) flags caregiver consistently low energy
frequency: weekly
memory:
  - caregiver's own wellness trend (from LP-025)
  - weeks in active caregiving role
  - support system available
  - respite care taken in last 30 days
  - burnout indicator history
sources:
  - LP-025 (wellness) — caregiver wellbeing
  - LP-053 (elder mood) — care intensity this week
  - LP-056 (isolation) — isolation burden
  - conversation history
safe_actions:
  - weekly caregiver wellbeing check-in
  - celebrate caregiving as an act of love
  - surface one respite idea per week
  - flag burnout pattern (3+ weeks of high stress, low energy)
  - suggest local caregiver support resources
human_boundary:
  - NEVER minimize caregiver's complaints
  - NEVER advise to reduce elder care quality
  - NEVER diagnose burnout clinically
  - MUST recommend professional support if crisis signals emerge
loop_record:
  - caregiver wellbeing score this week
  - respite taken (yes/no)
  - burnout level (low/medium/high)
  - support suggested
wakes:
  - LP-029: caregiver burnout → mental health pulse intensified
  - LP-025: low energy → daily wellness check updated
woken_by:
  - LP-053: sustained elder difficulty → burnout risk elevated
  - LP-056: isolation burden increases caregiver load
stop_conditions:
  - elder transitions to facility
  - caregiver's situation stabilizes
  - user disables
personas:
  - caregiver-parent
skills_used: [chat, wellness, wellness-daily, life-coach, elder-checkin]
```

---

### Domain: Special Needs

```yaml
loop_id: LP-059
name: ADHD Daily Structure
domain: special-needs
trigger:
  - time: morning (at wake time) and after-school transition
  - signal: ADHD noted in child profile
frequency: daily
memory:
  - child's ADHD profile (inattentive, hyperactive, combined)
  - medication schedule (from LP-022)
  - routine elements that work vs don't
  - recent behavioral challenges
  - upcoming transitions (schedule changes are hard)
sources:
  - profile (child ADHD diagnosis, age)
  - LP-022 (medication) — stimulant timing
  - LP-006 (behavior chart) — current goals
  - LP-064 (meltdown debrief) — recent incidents
  - LP-060 (sensory) — sensory context
safe_actions:
  - send morning structure prompt with visual-friendly checklist format
  - after-school transition brief ("here's the next 2 hours")
  - surface a positive reframe for parent after a hard day
  - remind caregiver of medication timing (from LP-022)
human_boundary:
  - NEVER diagnose ADHD or advise on medication
  - NEVER shame child for dysregulation
  - NEVER override parent's chosen ADHD management approach
  - NEVER compare to neurotypical siblings
loop_record:
  - morning structure sent (yes/no)
  - transition managed (yes/no)
  - medication timing confirmed
  - behavior challenges noted
wakes:
  - LP-006: ADHD behavior → behavior chart updated
  - LP-060: dysregulation → sensory check triggered
woken_by:
  - LP-064: post-meltdown → next day's structure adjusted
stop_conditions:
  - child outgrows need for external structure
  - user disables
personas:
  - adhd-parent (primary)
  - single-parent with ADHD child (high leverage)
skills_used: [chat, patpat, behavior-chart, medication-reminder, schedule-manager]
```

```yaml
loop_id: LP-060
name: Sensory Regulation Check
domain: special-needs
trigger:
  - signal: sensory overload mentioned, or child noted as dysregulated
  - time: daily (brief — morning readiness and afternoon wind-down)
  - signal: LP-059 (ADHD) flags difficulty
frequency: daily
memory:
  - child's sensory profile (hypersensitive, hyposensitive, mixed)
  - known triggers (loud sounds, textures, transitions, crowds)
  - regulation strategies that work
  - environment factors today (school event, travel, visitors)
  - recent overload incidents
sources:
  - profile (sensory diagnosis, triggers)
  - LP-059 (ADHD) — co-occurring context
  - LP-064 (meltdown) — incident data
  - LP-063 (transition support) — upcoming changes
  - conversation history
safe_actions:
  - morning sensory readiness brief (any known challenges today?)
  - afternoon regulation check-in
  - surface a calming strategy if overload reported
  - flag today's environment risks preemptively
human_boundary:
  - NEVER diagnose sensory processing disorder
  - NEVER advise medical/OT treatment
  - NEVER minimize sensory experience as "just behavioral"
loop_record:
  - sensory challenge today (yes/no)
  - environment factors
  - regulation strategy used
  - outcome
wakes:
  - LP-003: bedtime difficulty → sensory calming routine suggested
  - LP-002: school pickup is transition → transition brief triggered
woken_by:
  - LP-059: ADHD dysregulation → sensory check added
  - LP-064: meltdown post-incident → sensory state reviewed
stop_conditions:
  - child develops self-regulation skills
  - user disables
personas:
  - autism-parent
  - adhd-parent
  - sensory-parent
skills_used: [chat, occupational-therapy, patpat, wellness-daily]
```

```yaml
loop_id: LP-061
name: Therapy Appointment Tracker
domain: special-needs
trigger:
  - time: weekly (aligned to therapy schedule)
  - event: new therapy added
  - signal: IEP or behavior plan references therapy goals
frequency: weekly (or per therapy cadence)
memory:
  - therapy types and providers (OT, PT, speech, behavioral, play)
  - appointment schedule
  - goals being worked on
  - recent progress notes (parent-reported)
  - homework from therapist
sources:
  - profile (therapy types, schedule)
  - LP-062 (IEP tracker) — therapy goals from IEP
  - LP-006 (behavior chart) — behavioral therapy goals
  - conversation history
safe_actions:
  - weekly appointment reminder
  - surface therapist homework for the week
  - prompt parent for outcome debrief after session
  - track goal progress from parent reports
human_boundary:
  - NEVER contact therapist
  - NEVER advise on therapy approach
  - NEVER change therapy goals
  - NEVER make recommendations about therapy type needed
loop_record:
  - appointments attended
  - homework completed (yes/no)
  - session outcomes reported
  - goal progress noted
wakes:
  - LP-006: therapy goal tied to behavior chart target
  - LP-045: therapy reveals learning gap
woken_by:
  - LP-064: meltdown → therapy context may be relevant next session
stop_conditions:
  - therapy goals met and discharged
  - user disables
personas:
  - special-needs-parent
  - adhd-parent
skills_used: [chat, occupational-therapy, patpat, schedule-manager, todo-add]
```

```yaml
loop_id: LP-062
name: IEP Progress Tracker
domain: special-needs
trigger:
  - time: quarterly (aligned to IEP review cycles)
  - event: IEP meeting scheduled or completed
  - signal: LP-045 (learning gap) flags persistent academic gap
frequency: quarterly (with monthly check-ins)
memory:
  - current IEP goals per domain
  - progress data per goal
  - accommodations in place
  - service hours per week
  - annual review date
  - communication history with school IEP team
sources:
  - profile (IEP information if provided)
  - LP-061 (therapy) — related services
  - LP-045 (learning gap) — academic context
  - LP-012 (parent-teacher comm) — school relationship
  - conversation history
safe_actions:
  - quarterly IEP goal progress summary
  - help prepare questions for IEP meeting
  - remind of annual review date 60 days ahead
  - help interpret IEP progress report language
  - offer to draft parent input letter for IEP team
human_boundary:
  - NEVER advise on IEP legal rights (refer to advocate/attorney)
  - NEVER contact school about IEP
  - NEVER fill in IEP documents
loop_record:
  - current goals
  - progress per goal (this quarter)
  - meeting held (date, outcomes)
  - next review date
wakes:
  - LP-012: IEP concern → parent-teacher communication drafted
  - LP-061: IEP update → therapy goals updated
woken_by: none (self-triggered quarterly)
stop_conditions:
  - child exits IEP (graduated or aged out)
  - user disables
personas:
  - special-needs-parent
  - adhd-parent
skills_used: [chat, occupational-therapy, homework-help, life-admin, school-email-draft]
```

```yaml
loop_id: LP-063
name: Transition Support
domain: special-needs
trigger:
  - signal: upcoming transition identified (new school, school year start, class change, move)
  - signal: LP-059 (ADHD) or LP-060 (sensory) flags transition anxiety
  - event: significant life change mentioned
frequency: event-based (pre-transition, active 2-4 weeks)
memory:
  - upcoming transition type and timeline
  - child's historical transition difficulty
  - strategies that worked before
  - current anxiety level (parent-reported)
  - support team awareness
sources:
  - profile (child diagnosis, transition history)
  - LP-059 (ADHD) — routine disruption context
  - LP-060 (sensory) — sensory impact of change
  - LP-037 (schedule) — logistical transition needs
safe_actions:
  - pre-transition preparation plan for parent
  - social story template for child (parent to adapt)
  - daily countdown/preview for child (via parent)
  - debrief after transition to capture what helped
human_boundary:
  - NEVER contact new school, teacher, or provider
  - NEVER tell child how they will feel about the transition
  - NEVER minimize transition anxiety
loop_record:
  - transition type
  - preparation steps taken
  - anxiety level at transition
  - outcome (smooth/difficult)
wakes:
  - LP-059: transition impacts daily structure → updated
  - LP-060: transition triggers sensory needs → sensory check updated
woken_by:
  - LP-059: daily structure change → transition support activated
stop_conditions:
  - transition completed and child settled (2+ weeks stable)
  - user disables
personas:
  - autism-parent
  - adhd-parent
  - any-special-needs-parent
skills_used: [chat, occupational-therapy, patpat, schedule-manager]
```

```yaml
loop_id: LP-064
name: Meltdown Debrief
domain: special-needs
trigger:
  - signal: parent reports meltdown, tantrum, or major dysregulation episode
  - signal: LP-060 (sensory) or LP-059 (ADHD) flags severe incident
frequency: event-based
memory:
  - meltdown incident log (date, trigger, intensity, duration)
  - patterns across incidents (time of day, trigger type, antecedents)
  - what de-escalated each incident
  - parent's emotional state post-incident
  - recovery time for child
sources:
  - conversation history (parent describes incident)
  - LP-059 (ADHD) — behavioral context
  - LP-060 (sensory) — sensory trigger context
  - LP-006 (behavior chart) — goal alignment
safe_actions:
  - structured debrief questions (what happened, what helped, what next)
  - extract pattern insights across last 5 incidents
  - suggest one adjustment to tomorrow's structure
  - validate parent's experience (hard, exhausting, you're doing your best)
  - flag chronic patterns for therapist discussion
human_boundary:
  - NEVER diagnose escalating behavior
  - NEVER place blame on child or parent
  - MUST flag if meltdowns involve self-injury for professional consult
  - NEVER advise restraint techniques
loop_record:
  - date and time
  - trigger identified
  - intensity (mild/moderate/severe)
  - duration
  - de-escalation strategy used
  - pattern insight noted
wakes:
  - LP-059: tomorrow's structure adjusted based on incident
  - LP-006: behavior chart updated with incident context
  - LP-065: high-intensity incident → family stress monitor updated
woken_by:
  - LP-060: sensory overload escalated to meltdown
stop_conditions:
  - no incidents for 30+ days
  - child develops self-regulation (therapy milestone)
  - user disables
personas:
  - autism-parent
  - adhd-parent
  - any-special-needs-parent
skills_used: [chat, patpat, behavior-chart, occupational-therapy, wellness]
```

---

### Domain: Emotional Support

```yaml
loop_id: LP-065
name: Family Stress Monitor
domain: emotional
trigger:
  - signal: stress language detected in conversation ("overwhelmed," "can't do this," "too much")
  - signal: multiple active high-stress loops simultaneously (LP-027 + LP-018 + LP-058)
  - time: weekly passive review of stress indicators
frequency: continuous (signal detection); weekly review
memory:
  - stress level trend (7-day rolling)
  - active stressors list
  - family members most affected
  - interventions offered this week
  - crisis history (for context)
sources:
  - all active loop outputs (stress signals bubble up)
  - conversation history
  - LP-029 (mental health) — adult mental health context
  - LP-025 (wellness) — energy and wellbeing
safe_actions:
  - acknowledge stress without minimizing
  - surface the one most actionable next step
  - suggest a quick decompression activity
  - flag if stress has been high for 10+ consecutive days
human_boundary:
  - NEVER tell user "you're fine" or "it could be worse"
  - MUST activate LP-067 (crisis) if user expresses hopelessness or self-harm
  - NEVER suggest stress is just a mindset problem
loop_record:
  - stress level this week (1-10)
  - active stressors count
  - interventions offered
  - flags raised
wakes:
  - LP-025: high stress → daily wellness intensified
  - LP-029: sustained high stress → mental health pulse
  - LP-066: user needs to vent → venting session activated
woken_by:
  - LP-007: teen withdrawal → stress elevated
  - LP-018: co-parent conflict → stress spiked
  - LP-064: meltdown → household stress elevated
stop_conditions:
  - stress level sustained below 4 for 2+ weeks
  - user disables
personas:
  - any-family
  - single-parent (no stress buffer)
  - caregiver-parent
skills_used: [chat, wellness, life-coach, patpat]
```

```yaml
loop_id: LP-066
name: Venting Session Handler
domain: emotional
trigger:
  - signal: user says they need to vent or just want to be heard
  - signal: emotional flooding detected (multiple distress phrases in same message)
  - signal: LP-065 stress monitor activates user contact
frequency: event-based
memory:
  - recent venting topics (last 14 days)
  - user's preferred support style (validation vs. solutions)
  - what was helpful last time
  - follow-up items from last vent session
sources:
  - conversation history
  - LP-065 (stress) — context
  - LP-029 (mental health) — baseline
safe_actions:
  - provide validation-first response (no advice until invited)
  - ask "do you want me to help fix it or just listen?"
  - reflect back what was heard
  - after venting, ask if they want one next step
human_boundary:
  - NEVER jump to solutions before user asks
  - NEVER minimize the emotional content
  - MUST activate LP-067 if crisis signals appear during vent
  - NEVER share vent content in any group context
loop_record:
  - vent topic
  - support style used
  - user's reported relief (yes/no)
  - follow-up items noted
wakes:
  - LP-029: vent reveals mental health concern → pulse check
  - LP-067: crisis language detected during vent
woken_by:
  - LP-065: stress monitor detects user needs outlet
stop_conditions:
  - user feels heard and closes session
  - user disables
personas:
  - any-adult
  - single-parent (no partner to vent to)
skills_used: [chat, life-coach, wellness, relationship-coach]
```

```yaml
loop_id: LP-067
name: Crisis Awareness Detector
domain: emotional
trigger:
  - signal: self-harm language detected (direct or indirect)
  - signal: hopelessness statements ("I can't go on," "what's the point")
  - signal: LP-028 (postpartum) flags severe PPD symptoms
  - signal: LP-007 (teen) flags possible self-harm signals
frequency: continuous (real-time signal detection)
memory:
  - prior crisis signals and dates
  - what was offered and outcome
  - known support resources (988, local)
  - who is at risk (adult, child, elder)
sources:
  - all active conversation streams
  - LP-029 (mental health) — deterioration context
  - LP-028 (postpartum) — PPD/PPP risk
  - LP-007 (teen) — teen self-harm risk
safe_actions:
  - surface 988 Suicide & Crisis Lifeline immediately
  - offer to stay in the conversation (presence)
  - ask directly: "Are you thinking about hurting yourself?"
  - provide local emergency resources
human_boundary:
  - NEVER diagnose suicidal ideation
  - NEVER promise confidentiality if safety is at risk
  - NEVER dismiss expressed hopelessness as just venting
  - NEVER try to resolve the crisis alone — always direct to professional
  - NEVER leave conversation abruptly during active crisis signal
loop_record:
  - signal detected (timestamp)
  - who the risk pertains to
  - resources provided
  - follow-up response from user
wakes: []  # terminal safety loop — no downstream wakes
woken_by:
  - LP-029: mental health flags crisis
  - LP-028: postpartum flags dark thoughts
  - LP-007: teen shows self-harm signals
  - LP-065: family stress reaches crisis threshold
  - LP-066: venting session surfaces crisis language
stop_conditions:
  - user confirms safety
  - professional support engaged
personas:
  - any-user (safety loop applies universally)
skills_used: [chat, wellness, emergency-family]
```

```yaml
loop_id: LP-068
name: Grief Support Loop
domain: emotional
trigger:
  - signal: loss mentioned (death, miscarriage, divorce finalized, pet loss, job loss)
  - signal: LP-007 (teen) shows withdrawal after significant family loss
frequency: event-based (active 4-12 weeks post-loss)
memory:
  - nature of the loss
  - who was affected (family member, user)
  - time since loss
  - user's grief style (expressive vs. private)
  - support system available
  - cultural/religious context if shared
sources:
  - conversation history
  - LP-066 (venting) — grief expressions
  - LP-029 (mental health) — grief-related mental health
  - profile (family composition)
safe_actions:
  - acknowledge the loss without rushing healing
  - provide space for non-linear grief
  - surface a grief resource if appropriate
  - weekly check-in during active grief period
  - flag if grief appears to block daily function after 6+ weeks
human_boundary:
  - NEVER set a timeline for grief
  - NEVER suggest they should "be over it" by any point
  - NEVER diagnose complicated grief
  - MUST activate LP-067 if grief includes self-harm signals
loop_record:
  - loss event and date
  - check-in cycle
  - grief expression level this week
  - functional impact noted
wakes:
  - LP-066: grief → venting support
  - LP-029: extended grief → mental health pulse
woken_by:
  - LP-007: teen loss → grief support for family context
stop_conditions:
  - user reports returning to baseline functioning
  - user disables
  - professional grief counselor engaged
personas:
  - any-family
skills_used: [chat, life-coach, wellness, relationship-coach]
```

```yaml
loop_id: LP-069
name: Celebration Capture
domain: emotional
trigger:
  - signal: win, milestone, or positive event detected in conversation
  - signal: child achieved something (grade, sports win, behavior milestone)
  - signal: parent achieved something (promotion, weight goal, personal win)
frequency: event-based
memory:
  - celebrations captured in the last 30 days
  - family's preferred celebration style (low-key vs. big deal)
  - what each family member responds well to
sources:
  - conversation history
  - LP-006 (behavior chart) — behavior wins
  - LP-004 (homework) — academic wins
  - LP-044 (reading) — reading milestones
safe_actions:
  - enthusiastically celebrate the win
  - suggest a small family recognition moment
  - log to family memory (LP-071)
  - ask parent how they want to acknowledge it
human_boundary:
  - NEVER over-hype to the point of creating performance pressure
  - NEVER share celebration in group/public context
loop_record:
  - win captured (type, person, date)
  - celebration suggested
  - family memory created
wakes:
  - LP-070: win → suggest celebratory family activity
  - LP-071: family memory capture triggered
woken_by: []
stop_conditions:
  - no active wins to track
personas:
  - any-family
skills_used: [chat, family-memory, patpat, activity-suggest]
```

---

### Domain: Family Bonding

```yaml
loop_id: LP-070
name: Family Activity Suggester
domain: bonding
trigger:
  - time: weekly (Friday — weekend planning)
  - signal: family boredom or disconnection mentioned
  - signal: LP-016 (date night) triggers parallel family time prompt
frequency: weekly
memory:
  - activities done in last 6 weeks (avoid repeats)
  - family member ages and interests
  - budget preference
  - local area if provided in profile
  - current season and weather context
sources:
  - profile (family composition, ages, interests)
  - LP-069 (celebration) — activity tied to win
  - LP-074 (vacation) — upcoming travel context
  - conversation history
safe_actions:
  - suggest 2-3 activity options with brief description
  - ask which fits best this weekend
  - offer to draft logistics if activity chosen
human_boundary:
  - NEVER book or purchase anything
  - NEVER assume budget unless stated
loop_record:
  - activity suggested this week
  - outcome (did they do it, how did it go)
  - family feedback
wakes:
  - LP-071: activity happens → memory capture
  - LP-074: trip idea surfaces → vacation planner
woken_by:
  - LP-016: date night frees up weekend → family activity follow-on
  - LP-049: summer break → intensified activity suggestions
stop_conditions:
  - user disables
personas:
  - any-family
skills_used: [chat, activity-suggest, family-bonding, travel-itinerary]
```

```yaml
loop_id: LP-071
name: Family Memory Capture
domain: bonding
trigger:
  - signal: notable family event mentioned (first steps, first day of school, trip completed)
  - signal: LP-069 (celebration) triggers a memory log entry
  - signal: LP-070 (activity) reports a good outcome
frequency: event-based
memory:
  - memory log (chronological, family-tagged)
  - last memory captured (avoid duplicates)
  - family milestones by person
sources:
  - conversation history
  - LP-069 (celebrations)
  - LP-070 (activities)
  - profile (family members)
safe_actions:
  - draft a short family memory entry (3-5 sentences, user's voice)
  - tag family members involved
  - ask if user wants to add it to family journal
human_boundary:
  - NEVER auto-store without user confirmation
  - NEVER share externally
loop_record:
  - memory entry (text, date, people tagged)
  - confirmation received (yes/no)
wakes:
  - LP-072: recurring event → check if tradition-worthy
woken_by:
  - LP-069: celebration → memory
  - LP-070: activity → memory
stop_conditions:
  - user disables memory capture
personas:
  - any-family
skills_used: [chat, family-memory, family-bonding]
```

```yaml
loop_id: LP-072
name: Tradition Tracker
domain: bonding
trigger:
  - time: annually (date-anchored: holidays, birthdays, anniversaries)
  - signal: recurring annual event approaching (2 weeks ahead)
frequency: annual (per tradition) + rolling advance reminder
memory:
  - tradition name and date
  - family members involved
  - what was done in previous years
  - what worked / what to change
sources:
  - LP-071 (family memory) — tradition history
  - LP-020 (anniversary) — couple traditions
  - profile (cultural/religious context)
safe_actions:
  - remind user tradition is approaching (2 weeks)
  - suggest what was done last year + ask if keeping it
  - offer to help plan logistics
human_boundary:
  - NEVER book or purchase anything
  - NEVER assume cultural/religious preferences not stated
loop_record:
  - tradition confirmed (yes/keep/update)
  - what's planned this year
  - outcome post-event
wakes:
  - LP-070: tradition event → activity planning
  - LP-071: tradition done → memory capture
woken_by:
  - LP-071: new tradition identified from memory log
stop_conditions:
  - tradition marked inactive by user
personas:
  - any-family
  - immigrant/multicultural (cultural traditions especially valuable)
skills_used: [chat, family-bonding, family-memory, activity-suggest]
```

```yaml
loop_id: LP-073
name: Bonding Moment Suggester
domain: bonding
trigger:
  - time: daily (evening — 5-7pm)
  - signal: LP-065 stress monitor detects family tension → bonding nudge
  - signal: LP-007 (teen) detects distance → low-key connection suggestion
frequency: daily (light) / event-triggered (targeted)
memory:
  - bonding moments from last 7 days
  - which suggestions were acted on
  - each family member's preferred connection style
  - how the family is feeling currently (from stress context)
sources:
  - LP-065 (stress) — family mood context
  - LP-007 (teen) — teen connection status
  - LP-003 (bedtime) — evening routine context
  - profile (ages, interests)
safe_actions:
  - suggest one tiny connection moment (5 minutes, no planning)
  - tie to what user mentioned today ("you said she loves drawing — quick 5-min sketch together?")
  - vary by family member (not always same child)
human_boundary:
  - NEVER pressure if family is exhausted (check LP-065 first)
  - NEVER suggest elaborate plans as "bonding moments"
loop_record:
  - suggestion made
  - acted on (yes/no)
  - which family member targeted
wakes:
  - LP-071: bonding moment happened → memory capture
woken_by:
  - LP-065: stress spike → bonding nudge intensified
  - LP-007: teen distance → teen-specific bonding suggestion
stop_conditions:
  - user disables daily nudges
personas:
  - any-family
  - dual-income (limited time — needs tiny wins)
skills_used: [chat, family-bonding, activity-suggest, patpat]
```

```yaml
loop_id: LP-074
name: Vacation Planner Loop
domain: bonding
trigger:
  - time: seasonal (3 months before typical vacation windows: June, December)
  - signal: user mentions upcoming trip or asks about vacation
  - signal: LP-009 (activity enrollment) surfaces available break window
frequency: seasonal
memory:
  - past trips (destinations, what worked)
  - family preferences and constraints (budget, kids' ages, mobility needs)
  - upcoming school calendar gaps
  - any booked travel in profile
sources:
  - profile (family composition, travel preferences)
  - LP-009 (activity enrollment) — schedule gaps
  - LP-037 (schedule sync) — available windows
  - LP-033 (meal plan) — food needs during travel
safe_actions:
  - suggest 2-3 destination options with rough budget estimate
  - draft a day-by-day itinerary if destination chosen
  - create packing checklist
  - surface school pickup/dropoff handoff plan (LP-002)
human_boundary:
  - NEVER book flights, hotels, or activities
  - NEVER assume passport validity or travel docs
loop_record:
  - trip dates and destination (if decided)
  - planning stage (ideation / booked / packing)
  - packing list status
wakes:
  - LP-037: trip dates → schedule adjustments
  - LP-038: travel requires school absence forms
woken_by:
  - LP-016: date night context surfaces longer trip idea
  - LP-009: extended break identified
stop_conditions:
  - trip completed
  - user cancels / disables
personas:
  - any-family
  - high-achieving (needs structured downtime)
skills_used: [chat, travel-itinerary, activity-suggest, shopping-list]
```

---

### Domain: Life Admin

```yaml
loop_id: LP-075
name: Bill Payment Tracker
domain: life-admin
trigger:
  - time: monthly (7 days before typical due dates)
  - signal: user mentions an upcoming bill or payment
frequency: monthly
memory:
  - known recurring bills (utilities, rent/mortgage, insurance, subscriptions)
  - due dates
  - auto-pay status for each
  - last payment amount (to flag anomalies)
sources:
  - profile (if bills added)
  - LP-039 (subscription audit) — subscription list
  - conversation history
safe_actions:
  - remind user of upcoming bills (7 days out)
  - flag if a payment amount looks anomalously high
  - suggest autopay for bills not yet set up
human_boundary:
  - NEVER make or initiate payments
  - NEVER access banking systems
loop_record:
  - bills reminded this cycle
  - anomalies flagged
  - autopay gaps identified
wakes:
  - LP-076: insurance bill due → prompt annual review
  - LP-039: high subscription total detected → audit triggered
woken_by:
  - LP-010: kids outgrown clothes → new expense flagged
  - LP-042: car maintenance due → bill anticipation
stop_conditions:
  - user disables
personas:
  - any-adult
  - single-parent (sole financial manager)
skills_used: [chat, life-admin, todo-add]
```

```yaml
loop_id: LP-076
name: Insurance Review
domain: life-admin
trigger:
  - time: annual (30 days before renewal month)
  - signal: LP-075 (bill) flags insurance payment approaching
  - signal: major life event (new baby, new home, new car)
frequency: annual
memory:
  - insurance types held (health, life, home, auto, umbrella)
  - renewal dates
  - last review outcome
  - coverage gaps identified previously
sources:
  - profile (family composition, major assets)
  - LP-075 (bill tracker) — renewal signals
  - LP-077 (document expiry) — policy expiry
safe_actions:
  - remind user review is due
  - suggest 3 specific questions to ask their insurer
  - prompt to compare one competitive quote
  - flag if life event since last review changes coverage needs
human_boundary:
  - NEVER recommend a specific insurer or policy
  - NEVER make any insurance changes
loop_record:
  - review completed (yes/no)
  - changes made this cycle
  - coverage gaps noted
wakes:
  - LP-077: policy expiry → document tracker updated
woken_by:
  - LP-075: insurance bill due → review prompt
  - LP-019: new baby → life insurance review triggered
stop_conditions:
  - user disables
personas:
  - any-adult
skills_used: [chat, life-admin]
```

```yaml
loop_id: LP-077
name: Document Expiry Tracker
domain: life-admin
trigger:
  - time: rolling — 60 days before any tracked document expires
  - signal: user mentions a document (passport, license, ID, visa)
frequency: ongoing (per-document)
memory:
  - document registry (type, person, expiry date)
  - renewal lead time needed per document type
  - which family members each document covers
sources:
  - profile (if documents added)
  - LP-076 (insurance) — policy expiry dates
  - LP-074 (vacation) — passport validity for upcoming travel
  - conversation history
safe_actions:
  - remind user 60 days and 30 days before expiry
  - provide renewal link or steps
  - for passport: cross-check LP-074 (travel) to flag if trip is within validity window
human_boundary:
  - NEVER store sensitive document numbers
  - NEVER fill in any government form
loop_record:
  - documents tracked
  - reminders sent (60d, 30d)
  - renewal confirmed
wakes:
  - LP-074: passport expiry check → vacation planner flagged
woken_by:
  - LP-076: insurance renewal → document list updated
stop_conditions:
  - document renewed and expiry updated
  - document removed from tracking
personas:
  - any-adult
  - immigrant/multicultural (visa tracking especially critical)
skills_used: [chat, life-admin, todo-add]
```

```yaml
loop_id: LP-078
name: Tax Prep Coordinator
domain: life-admin
trigger:
  - time: annual (January 15 — reminder begins; April 1 — final push)
  - signal: user mentions W-2, 1099, tax return, or tax prep
frequency: annual (Jan–Apr window)
memory:
  - tax prep status this year
  - documents still needed
  - key deadlines for user's situation
  - notes from last year's prep (recurring friction points)
sources:
  - profile (employment type: W-2, freelance, business owner)
  - LP-075 (bills) — relevant deductible expenses
  - LP-039 (subscriptions) — potential deductible business tools
  - conversation history
safe_actions:
  - provide a personalized document checklist based on user's situation
  - surface key deadlines (especially for extensions)
  - remind of commonly missed deductions relevant to family
  - suggest professional help for complex situations
human_boundary:
  - NEVER provide tax advice — point to CPA/tax professional
  - NEVER fill out or file any form
  - NEVER store financial data
loop_record:
  - prep status (docs gathered, filed, extension filed)
  - reminders sent
  - friction notes for next year
wakes: []
woken_by: []
stop_conditions:
  - taxes filed confirmed
  - year window closed (May 1)
personas:
  - any-adult
  - freelancer/self-employed (more complex, more leverage)
skills_used: [chat, life-admin, todo-add]
```

```yaml
loop_id: LP-079
name: Emergency Kit Auditor
domain: life-admin
trigger:
  - time: biannual (spring and fall, aligned with clocks-change)
  - signal: local emergency or weather event mentioned
frequency: biannual
memory:
  - last audit date
  - kit contents documented
  - gaps identified in prior audit
  - family-specific needs (medications, infant supplies, pets)
sources:
  - profile (family composition, medical needs)
  - LP-022 (medication) — medications to include in kit
  - LP-031 (immunization) — vaccination cards location
  - conversation history
safe_actions:
  - prompt biannual audit with family-specific checklist
  - flag expired items from last audit (food, medications, batteries)
  - suggest additions based on family composition changes
human_boundary:
  - NEVER purchase items
  - NEVER suggest specific brands
loop_record:
  - audit date
  - items checked/updated
  - gaps remaining
wakes:
  - LP-022: medications in kit → flag expiry alongside home medications
woken_by: []
stop_conditions:
  - audit completed
  - user disables
personas:
  - any-parent
skills_used: [chat, life-admin, list-manager]
```

```yaml
loop_id: LP-080
name: Estate Planning Nudge
domain: life-admin
trigger:
  - time: annual (user's birthday month)
  - signal: major life event (new child, death in family, significant asset change)
  - signal: LP-019 (new baby) → will and guardianship check
frequency: annual
memory:
  - whether basic estate docs exist (will, POA, healthcare directive)
  - family composition changes since last check
  - gaps identified in prior nudge
sources:
  - profile (family composition, major life events)
  - LP-019 (new baby) — guardianship urgency
  - LP-058 (elder care burnout) — elder estate context
  - conversation history
safe_actions:
  - ask if will and basic documents are in place
  - provide brief description of what each document does
  - suggest consultation with an estate attorney
human_boundary:
  - NEVER draft legal documents
  - NEVER provide legal advice
  - NEVER store document contents
loop_record:
  - nudge delivered
  - user's status (has docs, updating, no docs)
  - next check date
wakes:
  - LP-076: estate context → insurance coverage adequacy check
  - LP-077: document registry → estate docs tracked for expiry
woken_by:
  - LP-019: new baby → guardianship urgency
  - LP-068: death in family → estate review triggered
stop_conditions:
  - user confirms documents are in order
  - user explicitly disables
personas:
  - any-adult-parent
skills_used: [chat, life-admin]
```

```yaml
loop_id: LP-081
name: Dental Checkup Scheduler
domain: parenting
trigger:
  - time: biannual (6 months after last confirmed checkup)
  - signal: tooth pain or dental issue mentioned
frequency: biannual per person
memory:
  - last checkup date per family member
  - dentist preference (if in profile)
  - any outstanding dental issues
sources:
  - profile (family members, ages)
  - LP-030 (pediatric appointment) — consolidated health calendar
  - conversation history
safe_actions:
  - remind family is due for checkup (with who specifically)
  - surface reminder to book appointment
  - for kids: note age-appropriate dental milestones (first visit, first X-ray, etc.)
human_boundary:
  - NEVER book appointments
  - NEVER give dental health advice beyond "see your dentist"
loop_record:
  - last checkup date per member
  - reminder sent
  - booking confirmed
wakes:
  - LP-030: dental booked → add to health calendar
woken_by:
  - LP-030: health calendar review surfaces dental gap
stop_conditions:
  - checkup confirmed
personas:
  - any-parent
skills_used: [chat, todo-add, life-admin]
```

```yaml
loop_id: LP-082
name: Shoe Size Tracker
domain: parenting
trigger:
  - signal: mention of tight shoes, outgrown shoes, new shoes needed
  - time: monthly passive check (for families with documented shoe sizes)
  - signal: LP-010 (clothes outgrown) activates alongside clothes check
frequency: event-based + monthly check
memory:
  - last known shoe size per child
  - when size was last updated
  - rapid growth periods (ages 2-4 and 10-14 especially)
sources:
  - profile (child ages)
  - LP-010 (clothes outgrown) — growth signal context
  - conversation history
safe_actions:
  - flag when it's been 3+ months since last size check for under-6s
  - remind to measure before buying (to avoid waste)
  - note which kids are in rapid growth phase
human_boundary:
  - NEVER purchase shoes
  - NEVER assume size without confirmation
loop_record:
  - shoe size per child (last confirmed date)
  - reminder sent
wakes:
  - LP-034: new shoes flagged → potential grocery list / errand list item
woken_by:
  - LP-010: clothes outgrown → shoes check likely needed too
stop_conditions:
  - user disables
personas:
  - parent-of-young-children
skills_used: [chat, list-manager, life-admin]
```

```yaml
loop_id: LP-083
name: Snack Inventory Checker
domain: parenting
trigger:
  - time: weekly (aligned with LP-034 grocery run)
  - signal: user mentions kids are hungry, snacks are running low
frequency: weekly
memory:
  - preferred snack list per child
  - dietary restrictions
  - what was on last week's list vs. what got bought
  - snacks consistently forgotten
sources:
  - profile (dietary restrictions, preferences)
  - LP-034 (grocery optimizer)
  - LP-035 (waste reviewer) — snacks that are wasted
  - conversation history
safe_actions:
  - generate snack restock list based on family preferences
  - flag a snack that keeps running out before weekly shop
  - suggest healthier swap if same unhealthy snack is on list 3+ weeks running
human_boundary:
  - NEVER purchase snacks
  - NEVER override dietary restrictions
loop_record:
  - snacks suggested this week
  - confirmed additions to grocery list
  - waste patterns noted
wakes:
  - LP-034: snack list added to grocery optimizer
woken_by:
  - LP-035: snack waste identified → remove from defaults
stop_conditions:
  - user disables
personas:
  - any-parent
skills_used: [chat, shopping-list, grocery-optimizer]
```

```yaml
loop_id: LP-084
name: School Supply Replenisher
domain: logistics
trigger:
  - time: monthly check during school year (September–June)
  - time: seasonal — back-to-school (mid-August)
  - signal: mention of running out of pencils, paper, folders, etc.
frequency: monthly (during school year) + annual (back-to-school)
memory:
  - school supply list per child (by grade)
  - what was stocked at start of year
  - typical consumption rate (pencils run out fast; folders don't)
  - teacher requests from LP-012 (parent-teacher comms)
sources:
  - profile (school grade per child)
  - LP-012 (parent-teacher) — supply requests from teacher
  - LP-041 (backpack check) — inventory feedback
  - conversation history
safe_actions:
  - flag low-inventory items monthly during school year
  - generate back-to-school supply list from standard grade list
  - add to grocery/errand list
  - remind in August even if user hasn't asked
human_boundary:
  - NEVER purchase supplies
loop_record:
  - supplies flagged this cycle
  - added to list (yes/no)
  - annual restocking completed (date)
wakes:
  - LP-034: supplies → add to errand list alongside grocery run
woken_by:
  - LP-041: backpack check reveals missing supplies
stop_conditions:
  - school year ends (June)
  - user disables
personas:
  - school-age-parent
skills_used: [chat, shopping-list, list-manager, todo-add]
```

---

## Part 3: Loop-of-Loops Dependency Map

### How to Read This Section
Each chain below shows how multiple loops coordinate to produce **one unified user experience** instead of multiple siloed responses. The parent loop triggers the chain; child loops pass only their delta (what changed), not full context. The user receives one well-timed message.

---

### Chain 1: School Trip Preparation Chain
**Trigger:** School trip email arrives or user mentions upcoming trip

```
LP-005 (Permission Slip) receives school trip signal
  → LP-038 (Form Reminder): deadline tracked, 5-day reminder set
  → LP-010 (Clothes/LP-082 Shoe): growth check — "does raincoat still fit? Shoes?"
  → LP-074 (Vacation): if trip requires overnight → logistics planning
  → LP-037 (Schedule Sync): pickup/dropoff time conflicts checked
  → LP-014 (Lunch Prep): packed lunch required? special day format flagged
  → LP-002 (School Pickup): altered pickup time triggers partner notification draft

User receives ONE message: "School trip Thursday — permission slip due Monday.
I checked: Riya's raincoat from last year should still fit. Pickup is 4pm
(conflicts with your 3:30 meeting — want me to draft a note to your partner?)"
```

---

### Chain 2: Child Illness Chain
**Trigger:** User mentions child is sick / fever / staying home

```
LP-026 (Symptom Triage) activates
  → LP-022 (Medication Reminder): dosing schedule flagged
  → LP-013 (School Absence Draft): absence email drafted, stop before sending
  → LP-033 (Meal Plan): bland/recovery foods suggested for today
  → LP-037 (Schedule Sync): work meeting conflicts flagged
  → LP-023 (Sleep Tracker): rest needs noted for recovery context
  → LP-014 (Lunch Prep): no packed lunch needed today → delta passed to grocery

User receives ONE message: "Arjun has a fever — I've drafted the school
absence email (review before sending). For today: clear broth or crackers
work well. His Tylenol dose is every 4-6 hours. You have a 10am meeting — 
do you need help rescheduling?"
```

---

### Chain 3: Morning Chaos Chain
**Trigger:** Daily at 7:00am (or earlier if LP-001 detects pattern)

```
LP-001 (Morning Chaos Coordinator) activates
  → LP-040 (Morning Prep Checklist): checklist for today's specific day
  → LP-041 (Backpack Check): anything special today (PE, library book, show-and-tell)?
  → LP-014 (Lunch Prep): lunch packed? ingredients available?
  → LP-005 (Permission Slip): anything due today?
  → LP-002 (School Pickup): any pickup changes today?
  → LP-037 (Schedule Sync): partner availability for drop-off?

User receives ONE message (the morning brief): "Tuesday morning — Maya has
library book due. Arjun needs PE clothes. Lunch: you have ingredients for
pasta salad. Nothing due today. Pickup at 3pm as usual."
```

---

### Chain 4: Bedtime Battle Chain
**Trigger:** Daily at ~7:30pm; LP-003 activates based on user history

```
LP-003 (Bedtime Battle Coach) activates
  → LP-023 (Sleep Tracker): tonight's wind-down context (screen time earlier?)
  → LP-008 (Screen Time): screens off? how long before bedtime?
  → LP-060 (Sensory Regulation — special needs only): sensory regulation state
  → LP-059 (ADHD Daily Structure): today's stimulation level check
  → LP-001 (Morning Chaos): prep next morning to reduce tomorrow's chaos

User receives ONE message: "Bedtime in 30 min — screens off now. Try the
deep pressure routine if Aiden's still wired (it worked Thursday). Clothes
for tomorrow are picked out; backpack is done."
```

---

### Chain 5: Grocery Waste Correction Chain
**Trigger:** Weekly, LP-035 runs after shop + fridge check

```
LP-035 (Grocery Waste Reviewer) detects spinach wasted 3 weeks running
  → LP-033 (Meal Planner): spinach removed from default meal rotation
  → LP-034 (Grocery Optimizer): spinach removed from auto-list
  → LP-024 (Nutrition Review): green replacement needed → suggest arugula or broccoli

User receives ONE message: "Noticed the spinach keeps going bad. Removed it
from the default list. For greens, broccoli florets are more reliable for your
family's schedule — add them instead?"
```

---

### Chain 6: Teen Withdrawal Chain
**Trigger:** LP-007 detects 7+ days of minimal engagement / withdrawal signals

```
LP-007 (Teen Withdrawal Monitor) flags concern
  → LP-065 (Family Stress Monitor): household stress check (is this related?)
  → LP-015 (Couple Check-In): are parents aligned on concern level?
  → LP-029 (Mental Health Pulse): is adult stress contributing to teen dynamic?
  → LP-073 (Bonding Moment): suggest ultra-low-pressure connection moment
  → LP-067 (Crisis): if withdrawal includes hopelessness language → safety escalation

User receives ONE message: "Marcus has been quieter than usual for about 10
days — not just phone-use less, but at dinner too. This could be normal teen
rhythms, but it's worth a low-key check-in. One small thing that sometimes
works: a short car drive with music, no agenda. Want me to suggest a few
openers that aren't 'how are you feeling'?"
```

---

### Chain 7: Elder Care Coordination Chain
**Trigger:** Daily LP-051 activates; any medication/mood anomaly triggers chain

```
LP-051 (Elder Daily Check-In) runs
  → LP-050 (Medication Manager): medications taken today?
  → LP-053 (Mood Monitor): mood baseline flagged (changes matter)
  → LP-054 (Dementia Routine Guard): routine followed / any confusion today?
  → LP-058 (Caregiver Burnout Monitor): how is the caregiver holding up?
  → LP-029 (Mental Health Pulse): caregiver mental health context
  → LP-055 (Family Status Update): weekly elder status shared with family

If anomaly detected (medication missed + mood change):
  → LP-052 (Appointment Tracker): flag for next doctor appointment
  → LP-057 (Fall Risk): unusual behavior → fall risk elevated
```

---

### Chain 8: Co-Parenting Conflict Chain
**Trigger:** LP-017 (Co-Parent Sync) detects inconsistency or LP-018 signal

```
LP-017 (Co-Parent Sync) detects rule inconsistency across households
  → LP-018 (Co-Parent Conflict Scripter): script drafted for neutral conversation
  → LP-065 (Stress Monitor): conflict → parent stress elevated
  → LP-003 (Bedtime): if bedtime inconsistency, behavioral context flagged
  → LP-006 (Behavior Chart): behavior pattern noted as co-parent-context-dependent

User receives ONE message: "Looks like bedtime rules are different between
households — kids may be testing the edges. Here's a low-conflict way to
bring it up: [draft]. Want me to adjust it?"
```

---

### Chain 9: New Baby Chain
**Trigger:** LP-019 activates on new baby signal; cascades across health, relationships, logistics

```
LP-019 (New Baby Relationship Strain) activates
  → LP-028 (Postpartum Check): weekly PPD/PPP screening
  → LP-023 (Sleep Tracker): infant sleep tracking begins
  → LP-015 (Couple Check-In): relationship check-in activated (new stress)
  → LP-022 (Medication): pediatric medication reminders start (vitamins, etc.)
  → LP-030 (Pediatric Appointment): 2-week and 1-month checkups scheduled
  → LP-080 (Estate Planning): will and guardianship nudge triggered
  → LP-033 (Meal Plan): one-handed meals / minimal prep recipes foregrounded

User receives ONE message (at 2 weeks postpartum): "Checking in on how things
are going. How are you sleeping? How's [partner]? No agenda — just here if 
you need to talk, or if you want help with anything practical."
```

---

### Chain 10: ADHD/Special Needs Daily Chain
**Trigger:** Daily, aligned to school schedule; LP-059 coordinates

```
LP-059 (ADHD Daily Structure) activates at schedule anchor points
  → LP-040 (Morning Prep): visual checklist generated for the morning
  → LP-060 (Sensory Regulation): morning sensory state checked
  → LP-004 (Homework): homework window blocked in afternoon structure
  → LP-043 (Homework Help): ready to activate during homework window
  → LP-003 (Bedtime): wind-down sequence adjusted for stimulation level
  → LP-064 (Meltdown Debrief): if incident today → structure adjusted tomorrow
  → LP-061 (Therapy Appointment): therapy context surfaced if relevant
```

---

## Part 4: Loop Lifecycle Design

### 4.1 Loop Discovery — How New Loops Are Identified

**From conversation patterns:**
- Signal: same topic mentioned in ≥3 separate sessions within 14 days
- Signal: user explicitly says "I keep having to..." or "every week I..."
- Signal: a recurring skill invocation with high consistency (meal-planning on Sunday 8+ times)
- Action: OiMy surfaces the loop candidate: "Sounds like [X] comes up every week — want me to keep an eye on it automatically?"

**From profile events:**
- New baby, school enrollment, diagnosis, divorce, move — each triggers a domain-specific loop bundle
- Bundle example: new baby → activate [LP-019, LP-028, LP-022, LP-023, LP-030, LP-015, LP-033]

**From time-based signals:**
- School year start → activate [LP-001, LP-040, LP-041, LP-004, LP-014, LP-084]
- Summer start → activate [LP-049, LP-074, LP-070, LP-073]
- Annual → activate [LP-072, LP-020, LP-078, LP-079, LP-076, LP-080]

### 4.2 Loop Learning — How Loops Improve Over Time

Each loop has a `feedback_signals` field (not shown in specs for brevity):
- **Used**: user acted on the draft / confirmed the suggestion
- **Dismissed**: user said "not needed" or ignored
- **Adjusted**: user modified the draft before acting on it

After 3 dismissals → loop backs off frequency by 50%
After 3 consecutive "used" → loop escalates to proactive (no ask needed)
After adjustment pattern (e.g., always adds "please" to school emails) → loop learns the style

### 4.3 Loop State Storage Schema

```json
{
  "loop_id": "LP-027",
  "user_id": "u_abc123",
  "status": "active",
  "trigger_config": {
    "type": "signal",
    "pattern": "illness_keywords",
    "sensitivity": "medium"
  },
  "memory": {
    "last_activation": "2026-06-20T08:30:00Z",
    "current_illness_episode": {
      "child": "Arjun",
      "start_date": "2026-06-20",
      "symptoms": ["fever", "sore throat"],
      "medications_active": ["ibuprofen"],
      "school_notified": true
    },
    "activation_history": ["2026-03-14", "2026-01-08", "2025-11-22"]
  },
  "feedback": {
    "used_count": 8,
    "dismissed_count": 1,
    "last_feedback": "used",
    "style_notes": "user prefers email drafts with formal tone"
  },
  "woken_loops_active": ["LP-013", "LP-022"],
  "loop_record": {
    "this_cycle_output": "absence_email_drafted",
    "handed_to_user_at": "2026-06-20T08:32:00Z"
  }
}
```

### 4.4 Loop Versioning

When a loop's spec changes (new safe_actions, adjusted human_boundary):
- `spec_version` increments
- Active loop instances maintain their accumulated memory/feedback
- New trigger config applies from next activation
- Breaking changes (e.g., loop merges with another) documented in loop changelog

### 4.5 Loop Deactivation

Automatic deactivation conditions:
- Child ages out of applicable range (LP-003 bedtime deactivates when child is 14+)
- Life event resolves the context (LP-019 new baby → deactivates at 12 months postpartum)
- User explicitly disables
- Sustained dismissal rate > 80% for 60+ days

Graceful deactivation: OiMy says "I notice I haven't been as helpful with [X] lately — want me to stop checking in on it?"

---

## Part 5: Implementation Notes for Gemma 4

### 5.1 What Gemma 4 Needs to Execute a Loop

Gemma 4 (12B QAT q4) operates with high accuracy on **structured, pre-resolved inputs**. Deep reasoning is done upstream (this document). At execution time, Gemma 4 receives:

```json
{
  "loop_id": "LP-027",
  "loop_name": "Child Illness Chain",
  "turn_mode": "ACKNOWLEDGE_AND_HELP",
  "trigger_context": "fever + sore throat mentioned",
  "memory_snapshot": {
    "child_name": "Arjun",
    "age": "7",
    "last_illness": "3 months ago",
    "medications_available": ["ibuprofen", "acetaminophen"]
  },
  "safe_actions_permitted": [
    "draft_school_absence_email",
    "suggest_medication_schedule",
    "suggest_bland_foods",
    "flag_schedule_conflicts"
  ],
  "human_boundary": "NEVER make or send communications. NEVER diagnose. Stop and show draft before any action.",
  "active_adjacent_loops": ["LP-013", "LP-022", "LP-033"],
  "output_format": "single_unified_message",
  "draft_before_act": true
}
```

Gemma 4 does NOT need to reason about:
- Which loops to activate (pre-resolved by the framework)
- Whether to act or draft (pre-resolved by human_boundary)
- What the loop's history is (pre-loaded in memory_snapshot)
- What's connected (pre-resolved by active_adjacent_loops)

Gemma 4 DOES need to:
- Generate natural language output using the structured input
- Match the user's energy and voice
- Apply the correct turn_mode (from V2 prompt + move classifier)
- Stay within safe_actions_permitted
- Produce a draft before any real-world action

### 5.2 Trust Level Gates Per Loop Category

| Category | Trust Level Minimum | Why |
|---|---|---|
| Safety (LP-067) | 0 — always active | No trust gate for crisis |
| Emotional (LP-065, LP-066, LP-068) | 0 — activate on any session | Trust is irrelevant to emotional support need |
| Daily logistics (LP-001, LP-033, LP-034) | 1 (returning user) | Needs some family context to be useful |
| Health (LP-022, LP-026, LP-027) | 1 | Needs child/family data for accuracy |
| Relationships (LP-015, LP-017, LP-018) | 2 (engaged) | High sensitivity — wait for established trust |
| Elder care (LP-050–LP-058) | 2 | Complex, sensitive — needs established relationship |
| Life admin (LP-075–LP-080) | 2 | Financial sensitivity requires trust |
| Special needs (LP-059–LP-064) | 2 | Parent needs to trust OiMy understands their child |
| Mental health (LP-029, LP-067) | 0 for crisis; 1 for proactive | Safety override, otherwise light touch |

### 5.3 The Draft-Before-Act Guarantee

Every loop that generates an output that could affect the real world MUST follow the draft-before-act rule:

```
DRAFT → SHOW USER → EXPLICIT APPROVAL → ACT
```

No exceptions. This is enforced by:
1. The `human_boundary` field in every loop spec
2. The system prompt rule: "Any action that affects the real world must be shown as a draft. Never say 'I sent this' — only 'I'll send this when you say go.'"
3. The `draft_before_act: true` flag in the Gemma 4 execution context

**Categories that always draft:**
- School emails (LP-013, LP-012, LP-005)
- Co-parent communications (LP-018)
- Any list modification (LP-034, LP-083, LP-084)
- Any reminder or calendar item (LP-022, LP-037)
- Any purchase-adjacent suggestions (LP-075, LP-082)

**Categories where the "action" IS the message (no draft needed):**
- Emotional support responses (LP-066, LP-067, LP-068)
- Coaching advice (LP-003, LP-006, LP-007)
- Information/suggestions (LP-073, LP-070)

### 5.4 Loop Execution Flow (Gemma 4)

```
1. Framework detects trigger (signal or time)
2. Framework resolves: which loop? is trust level sufficient?
3. Framework loads: memory_snapshot, adjacent_loops, safe_actions
4. Framework injects: loop context block into system_additions
5. Gemma 4 generates response using: V2 prompt + turn_mode + loop context
6. Output check: does response stay within safe_actions? is draft presented?
7. Response delivered to user
8. User response captured → loop_record updated → feedback logged
```

### 5.5 Loop Context Block (System Additions Format)

The loop context is injected via `system_additions` (same mechanism as turn mode):

```
[ACTIVE LOOP: LP-027 — Child Illness Chain]
Child: Arjun (7yo) | Symptoms: fever, sore throat
Safe to do: draft absence email, suggest medication schedule, suggest bland foods
DO NOT: diagnose, send anything, make medical claims
Draft rule: show the email draft and wait for "send it"
Adjacent: LP-013 (absence email), LP-022 (medication), LP-033 (meal)
```

This is short, deterministic, and requires no reasoning from Gemma 4.

---

## Appendix: Loop Index by Use Case

| User Problem | Primary Loop | Chain |
|---|---|---|
| "I keep forgetting permission slips" | LP-005, LP-038 | Chain 1 |
| "Mornings are a disaster" | LP-001 | Chain 3 |
| "My kid is sick" | LP-026, LP-027 | Chain 2 |
| "I'm exhausted and overwhelmed" | LP-065, LP-066 | — |
| "My teen won't talk to me" | LP-007 | Chain 6 |
| "I keep buying food that goes bad" | LP-035, LP-036 | Chain 5 |
| "Co-parent and I keep fighting" | LP-017, LP-018 | Chain 8 |
| "My parent has dementia" | LP-054, LP-051 | Chain 7 |
| "My ADHD kid struggles every morning" | LP-059 | Chain 10 |
| "I never have date nights" | LP-016 | — |
| "My relationship is suffering since the baby" | LP-019 | Chain 9 |
| "I'm burning out as a caregiver" | LP-058 | — |
| "I need to plan a trip" | LP-074 | — |
| "I keep missing bill due dates" | LP-075 | — |
| "I feel like I'm falling apart" | LP-029, LP-067 | — |

---

## Part 6: Immediate Implementation Plan (For Coding Agent)

This section combines all outstanding implementation tasks into a single executable brief.

---

### P0 — Companion Prompt Rule (30 min)
**File:** `/opt/oimy-engine/prompts/gemma4_12b_companion_v2.txt`
**Action:** Add the following block near the end of the prompt, before the closing rules section:

```
[RULE — Draft Before Act]
Any action that affects the real world — sending a message, creating a reminder,
modifying a list, booking anything — must first be presented as a draft.
Never act without showing the draft and getting explicit confirmation.
Say: "I'll send this when you say go" — never "I sent this."
This applies to: school emails, co-parent messages, grocery list changes,
reminder creation, calendar entries, and any outbound communication.
```

**Why:** Directly addresses trust signal drop (3.27/5 in evals). Makes OiMy's action boundary explicit and consistent across all skills. Required for loop execution.

**Verification:** Smoke test — ask OiMy to draft a school absence email. It should present the draft and NOT claim to have sent it.

---

### P1 — Recurring Pattern Detection (1-2 days)
**File:** `/opt/oimy-engine/api.py`
**Function:** `_track_session_threads()`
**Action:** Add cross-session topic counting. When the same topic appears ≥3 times in 14-day window, surface a loop candidate to the user.

```python
# In _track_session_threads(), after existing thread tracking:
def _check_loop_candidates(self, user_id, topic, current_turn):
    """Surface loop candidate when topic appears 3+ times in 14 days."""
    import sqlite3, datetime
    try:
        conn = sqlite3.connect(DB_PATH)
        # Count occurrences of this topic in last 14 days
        since = (datetime.datetime.utcnow() - datetime.timedelta(days=14)).isoformat()
        conn.execute(
            "INSERT OR IGNORE INTO loop_signals (user_id, topic, seen_at) VALUES (?, ?, ?)",
            (user_id, topic, datetime.datetime.utcnow().isoformat())
        )
        count = conn.execute(
            "SELECT COUNT(*) FROM loop_signals WHERE user_id=? AND topic=? AND seen_at > ?",
            (user_id, topic, since)
        ).fetchone()[0]
        conn.commit()
        conn.close()
        if count >= 3:
            return (f"\n\n[LOOP CANDIDATE: '{topic}' has come up {count} times this week. "
                    f"Ask the user: 'Sounds like {topic} keeps coming up — want me to keep an eye "
                    f"on it for you automatically?']")
    except Exception:
        pass
    return ""
```

**Schema addition required:**
```sql
CREATE TABLE IF NOT EXISTS loop_signals (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    user_id TEXT NOT NULL,
    topic TEXT NOT NULL,
    seen_at TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_loop_signals_user_topic ON loop_signals(user_id, topic);
```

**Stop condition:** User says yes or no. No autonomous action taken.

---

### P2 — Loop Dependency Table in Signal Detector (1-2 weeks)
**File:** `/opt/oimy-engine/api.py` (or a new `archetypes/loop_coordinator.py`)
**Action:** Add the LOOP_DEPENDENCIES map and a coordinator that fires adjacent loops when a primary signal fires.

```python
# Loop dependency map — when signal A fires, also check signals B/C
LOOP_DEPENDENCIES = {
    # Parenting chains
    "weather_change":        ["packing_list", "outdoor_plan", "school_pickup_time"],
    "school_announcement":   ["calendar_conflict", "packing_list", "permission_slip"],
    "kid_sick":              ["meal_plan", "school_absence_draft", "medication_reminder", "schedule_conflict"],
    "school_trip":           ["permission_slip", "packing_list", "pickup_time_change", "lunch_prep"],
    "bedtime_resistance":    ["screen_time_check", "morning_prep", "sensory_state"],
    "morning_chaos":         ["backpack_check", "lunch_prep", "permission_slip_due", "pickup_change"],

    # Logistics chains
    "grocery_waste":         ["meal_plan_defaults", "shopping_list_cleanup"],
    "grocery_run":           ["snack_inventory", "school_supplies", "meal_plan"],
    "schedule_change":       ["pickup_coordinator", "lunch_prep", "partner_notification_draft"],
    "clothes_outgrown":      ["shoe_size_check", "errand_list"],

    # Relationships chains
    "co_parent_inconsistency": ["bedtime_coach", "behavior_chart", "stress_monitor"],
    "couple_tension":          ["stress_monitor", "date_night_planner"],

    # Health chains
    "teen_withdrawal":       ["stress_monitor", "couple_checkin", "bonding_suggestion"],
    "postpartum_flag":       ["relationship_checkin", "sleep_tracker", "estate_planning_nudge"],
    "elder_mood_change":     ["medication_check", "appointment_flag", "fall_risk", "caregiver_burnout"],
    "caregiver_burnout":     ["mental_health_pulse", "family_elder_update"],

    # Special needs chains
    "meltdown_incident":     ["structure_adjustment_tomorrow", "behavior_chart_update", "stress_monitor"],
    "adhd_morning":          ["visual_checklist", "sensory_check", "homework_window"],
}


def coordinate_loops(primary_signal: str, user_id: str, conversation_context: dict) -> list:
    """
    When primary_signal fires, return list of adjacent signals to also check.
    Each adjacent signal is checked (not necessarily fired) — the coordinator
    determines relevance before including in the unified response.
    """
    adjacent = LOOP_DEPENDENCIES.get(primary_signal, [])
    if not adjacent:
        return []
    # Filter to signals relevant for this user's profile
    profile = conversation_context.get("profile", {})
    has_kids = bool(profile.get("children"))
    has_elder = bool(profile.get("elder_care"))
    relevant = []
    for signal in adjacent:
        # Basic relevance gating — expand as needed
        if "school" in signal and not has_kids:
            continue
        if "elder" in signal and not has_elder:
            continue
        relevant.append(signal)
    return relevant
```

**Integration point:** In `chat_light` path, after `_classify_turn_mode()`, call `coordinate_loops()` with any detected signals. Append adjacent signal context to `system_additions`.

**User experience:** Instead of OiMy responding to "Maya is sick today" with only a meal suggestion (from meal-planning skill), the coordinator fires: absence draft + medication schedule + schedule conflict check → one unified, coordinated message.

---

### P3 — Honcho for Loop Memory (after API key is wired)
**Status:** `HONCHO_API_KEY` is already in systemd env (`hch-v3…8rir`). Not yet wired to loop state.

**File:** `/opt/oimy-engine/archetypes/honcho_memory.py` (already exists)

**Action:** Wire Honcho to persist active loop states and surface them at session start.

```python
# In chat_light path, at session start (before companion call):
async def load_loop_state(user_id: str, honcho_client) -> str:
    """Load active loop states from Honcho. Returns system_additions block."""
    try:
        memories = honcho_client.get_memories(user_id, types=["loop_state"])
        if not memories:
            return ""
        active_loops = [m for m in memories if m.get("status") == "active"]
        if not active_loops:
            return ""
        loop_context = "; ".join([
            f"{m['loop_id']} ({m['name']}): {m.get('last_context', 'active')}"
            for m in active_loops[:5]  # cap at 5 to avoid context bloat
        ])
        return f"\n\n[ACTIVE LOOPS: {loop_context}]"
    except Exception:
        return ""

# After loop activates / produces output:
def save_loop_record(user_id: str, loop_id: str, record: dict, honcho_client):
    """Persist loop record to Honcho for cross-session continuity."""
    honcho_client.add_memory(user_id, {
        "type": "loop_state",
        "loop_id": loop_id,
        "name": record.get("name"),
        "status": "active",
        "last_context": record.get("summary", ""),
        "last_activation": record.get("timestamp"),
    })
```

**Why this matters:** Currently every OiMy session starts from zero. A user who talked about school lunch 3 times last week — OiMy has no memory of that pattern at session start. Honcho fixes this. The "loop record" Jones describes (what it writes at end of each cycle) maps exactly to a Honcho memory entry.

---

### P4 — Loop Library Integration (reference file)
**File:** `/opt/oimy-engine/docs/oimy-loop-library.md` (already exists on Hetzner)
**CDN:** `https://cdn.oimyai.com/docs/oimy-loop-library.md`

This file is the authoritative loop spec reference. Do not modify it as part of coding — it's the upstream reasoning layer. Implementation reads from it; it does not change during implementation.

For Gemma 4 execution: convert each loop's YAML spec into the compact `system_additions` injection format (see Part 5.5 above).

---

## Part 7: Anti-Patterns — What NOT to Build

These are hard constraints. Do not implement.

**1. Loops that act without an explicit stop condition**
If you cannot define "where this loop stops and asks the user," don't build it. Every loop in this library has a `human_boundary` and `stop_conditions` field. If a proposed new loop is missing either, it's not ready.

> Jones's exact principle: "You need to start seeing the work the app era trained you not to count" — but not by automating past the point where your judgment still matters.

**2. Loops that pretend life is simpler than it is**
The Klarna pattern: a technically correct autonomous action that optimizes for the wrong objective because intent wasn't encoded.
OiMy equivalent: sending an email to a teacher without the parent reviewing the tone. Drafting and never confirming. Auto-modifying a grocery list without flagging the change.
**The test:** would this action be embarrassing or harmful if it happened without the user knowing? If yes, it requires explicit confirmation.

**3. One giant agent managing everything**
Jones explicitly rejects this. Multiple narrow loops > one general agent.
OiMy's skill-per-domain architecture is correct. Loops coordinate across skills; they don't replace them. The coordinator (Part 6, P2) is a thin wiring layer, not a new mega-agent.

**4. Loops that send, purchase, book, or commit without confirmation**
No loop in this library has "send email," "book appointment," "purchase item," or "make reservation" in `safe_actions`. These are always in `human_boundary`. This is non-negotiable.

**5. Loops that store sensitive data (financial, medical, legal) without explicit opt-in**
Medication names, insurance details, symptom history — collected only when user volunteers it, stored only with confirmation, never surfaced in group/multi-user contexts.

---

## Part 8: YouTube Transcript Skill (For Coding Agent Self-Installation)

When this agent needs to process a YouTube video:

```bash
# Install
pip install youtube-transcript-api
```

```python
# Works on home IPs; blocked on cloud/Hetzner
from youtube_transcript_api import YouTubeTranscriptApi
api = YouTubeTranscriptApi()
t = api.fetch('VIDEO_ID')
text = ' '.join([s.text for s in t])
```

**Cloud IP fallback 1 — yt-dlp with cookies:**
```bash
yt-dlp --skip-download --write-auto-subs --sub-format vtt \
  --cookies-from-browser chrome \
  --output /tmp/yt_%(id)s "https://www.youtube.com/watch?v=VIDEO_ID"
# Then parse the .vtt file
```

**Cloud IP fallback 2 — search for companion Substack:**
Most Nate Jones videos have a companion post. Search:
```
web_search("natesnewsletter.substack.com [topic keywords from video title]")
```

**OpenClaw skill path (if running on victory-bobcat):**
```
~/.openclaw/workspace/skills/media-ingest/SKILL.md
```
Trigger phrase: *"process this YouTube link [url]"*

---

## Quick Reference: CDN Links

| Document | URL |
|---|---|
| Loop Library (this file) | https://cdn.oimyai.com/docs/oimy-loop-library.md |
| Loop Engineering Video Analysis | https://cdn.oimyai.com/docs/oimy-loop-engineering-analysis.md |
| Companion Quality Plan | https://cdn.oimyai.com/docs/oimy-companion-quality-plan.md |
| Next Tasks | https://cdn.oimyai.com/docs/oimy-next-tasks.md |
