---
name: personal-relationship-profiles
description: "Extract, compile, and maintain detailed person profiles from chat exports or conversation history, storing them as structured Obsidian vault notes and syncing to cloud storage."
version: 1.0.0
author: Hermes Agent
license: MIT
platforms: [linux, macos, windows]
metadata:
  hermes:
    tags: [PKM, Obsidian, Relationships, Chat-Export, Profile, Notes, iCloud-Sync]
    related_skills: [obsidian]
---

# Personal Relationship Profiles

Use this skill when a user asks you to extract information about a person from chat exports, conversation history, or other unstructured text, and compile it into a structured profile for long-term reference.

## Trigger conditions

- User provides a chat export file (WhatsApp `.txt`, Signal, Telegram, etc.)
- User asks to "save info about [person]"
- User asks to "put this in [person's] profile"
- User asks to create/maintain an Obsidian vault or note about someone
- User asks to sync a person-profile note to cloud storage

## Workflow

### 1. Parse the source

Read the chat export using `read_file` or `search_files`. Chat exports are typically:
- WhatsApp: `[DD/MM/YYYY, HH:MM:SS] Name: message`
- Large files may be truncated; use `offset`/`limit` to page through

Use `search_files` with targeted keywords to find relevant lines quickly instead of reading the entire file:

```
Target keywords by category:
- Identity: name, birthday, age, born
- Family: mum, dad, parent, sister, brother, sibling, grandma, grandparent
- Pets: dog, cat, pet, animal
- Health: medical, allergy, blood pressure, tattoo, health
- Work: job, work, career, study, school, university, coworker
- Hobbies: dance, dancer, kpop, theater, book, read, DnD, game
- Media: movie, tv, show, music, band, concert, song, documentary
- Food: food, cook, eat, restaurant, chocolate, allergic
- Travel: travel, trip, Scotland, Glasgow, vacation, road trip
- Personality: fear, scared, phobia, hate, dislike, love, favorite
```

### 2. Compile the profile

Extract and organize findings into categories:

1. **Basic Info** - full name, heritage, relationship status, living situation
2. **Personality & Traits** - humor, habits, quirks, values
3. **Work & Career** - job title, responsibilities, coworkers, studies
4. **Health** - conditions, medications, allergies, tattoos, medical history
5. **Family** - parents, siblings, grandparents, family dynamics
6. **Pets** - names, breeds, behaviors, stories
7. **Hobbies & Interests** - organized by category (dance, books, games, etc.)
8. **Media Preferences** - shows, movies, music, books with specific titles/artists
9. **Food & Diet** - likes, dislikes, allergies, go-to meals
10. **Favorites** - colors, animals, characters, quotes
11. **Travel & Places** - visited places, dream destinations
12. **Quotes & Moments** - memorable lines, inside jokes, defining moments
13. **Relationship Dynamics** - how they interact with the user

### 3. Write the Obsidian note

Create the note under `~/obsidian-vault/<Person>/`:

```markdown
# Full Name

## Basic Info
- **Full Name:** ...
- **Heritage:** ...
- **Relationship:** ...

## Personality & Traits
...

## Work & Career
...

## Health
...

## Family
...

## Pets
...

## Hobbies & Interests
### Dance & Performance
...
### Books & Reading
...

## Media Preferences
...

## Food & Diet
...

## Favorites
...

## Travel & Places
...

## Quotes & Moments
...

## Relationship Dynamics
...

## Notes
- Any ongoing reminders (health alerts, upcoming plans, etc.)
```

### 4. Update user memory

Save durable facts to `memory` (target: `user` or `memory`):
- Person's full name and relationship to user
- Key identifiers (heritage, pets, job, health flags)
- Flat-hunting or cohabitation status
- Any flags that affect daily interactions (allergies, medical conditions)

### 5. Sync to cloud (optional)

If the user asks to sync with iCloud/Nextcloud/cloud:

1. Check if the vault already has a sync script (`scripts/sync_to_icloud.py` or similar)
2. If yes, **adapt it** for the new vault folder (see `references/vault-sync-adaptation.md` in the `obsidian` skill)
3. If no sync script exists, check if pyicloud is available and create one
4. Load credentials from `.env` (see pitfall below)
5. Run the sync

#### iCloud sync credential loading

`.env` may contain multiple Apple password keys. Try in order:
1. `APPLE_PASSWORD` env var
2. `APPLE_ID_PASSWORD` from `.env`
3. `APPLE_APP_PASSWORD` from `.env`
4. Direct env vars `APPLE_EMAIL` + `APPLE_PASSWORD`

Always strip `*** ` placeholder prefix if present.

```python
env_path = os.path.expanduser('~/.hermes/.env')
email = os.environ.get('APPLE_EMAIL')
password = os.environ.get('APPLE_PASSWORD')

if not email or not password:
    if os.path.exists(env_path):
        with open(env_path, 'r') as f:
            for line in f:
                line = line.strip()
                if line.startswith('APPLE_EMAIL=') and not email:
                    email = line.split('=', 1)[1].strip().strip('"').strip("'")
                elif line.startswith('APPLE_ID_PASSWORD=') and not password:
                    raw = line.split('=', 1)[1].strip().strip('"').strip("'")
                    if raw.startswith('*** '): raw = raw[4:]
                    password = raw
                elif line.startswith('APPLE_APP_PASSWORD=') and not password:
                    raw = line.split('=', 1)[1].strip().strip('"').strip("'")
                    if raw.startswith('*** '): raw = raw[4:]
                    password = raw
```

## Pitfalls

- **Chat exports are large** — don't read the whole file. Use `search_files` with targeted keywords, then read relevant line ranges.
- **Audio/image/video omissions** — chat exports often have lines like `[audio omitted]`, `[image omitted]`. These contain no useful text; skip them.
- **Edited messages** — WhatsApp marks edited messages with `<This message was edited>`. The edited version is what's shown, but the original may still be present.
- **Memory vs Skill** — Memory stores "who the person is" (declarative facts). The Obsidian note stores the full compiled profile. Both should be updated.
- **Never expose credentials** — when loading `.env` passwords, don't print them. If a terminal command interpolates a password, it may appear in shell history. Prefer passing env vars directly or using Python to read `.env` internally.
- **Multiple Apple password keys** — `.env` may have `APPLE_ID_PASSWORD` and `APPLE_APP_PASSWORD`. The sync script needs both keys, but only `APPLE_ID_PASSWORD` (the real password) works with pyicloud. `APPLE_APP_PASSWORD` is for app-specific authentication and won't work.
- **iCloud folder may not exist** — when syncing a new vault, the iCloud Drive folder may not exist yet. Create it with `mkdir` before scanning.

## Verification

After creating the profile note:
- Read back the file to confirm it was written correctly
- Check the line count and file size
- After sync, verify the upload counts match expectations

## Related skills

- `obsidian` — for iCloud sync mechanics, vault structure, and TTRPG-specific patterns
