---
name: contacts
description: Use this skill when the user wants to add, find, list, update, or delete contacts in their Radicale CardDAV server. Trigger on mentions of "contact", "contacts", "address book", "phone number" (in the context of contacts), or when the user asks to look up someone's info, add someone to their contacts, or update contact details.
---

# Contact Management

Manage contacts via the Radicale CardDAV server using the self-contained CLI script at `$HOME/notes/skills/contacts/scripts/contacts`.

## Commands

### Create a contact

Requires `--name` plus at least one of `--phone`, `--email`, or `--note`.

The script checks for duplicates before creating:
- If `--phone` is provided, it checks for an existing contact with that phone number
- If `--email` is provided, it checks for an existing contact with that email
- If only `--name` and `--note` are provided, it checks for an existing contact with that exact name

If a duplicate is found, the script prints the existing contact and exits with an error.

```
$HOME/notes/skills/contacts/scripts/contacts create --name "Jane Smith" --phone "+15551234567"
$HOME/notes/skills/contacts/scripts/contacts create --name "John Doe" --email "john@example.com" --note "Met at conference"
$HOME/notes/skills/contacts/scripts/contacts create --name "Alice" --phone "+15559876543" --email "alice@example.com" --note "Work colleague"
```

### Read contacts

List all contacts:
```
$HOME/notes/skills/contacts/scripts/contacts read
```

Filter by name (case-insensitive substring match):
```
$HOME/notes/skills/contacts/scripts/contacts read --name "Sonny"
```

Filter by phone number (substring match):
```
$HOME/notes/skills/contacts/scripts/contacts read --phone "+1915"
```

Filter by email (case-insensitive substring match):
```
$HOME/notes/skills/contacts/scripts/contacts read --email "example.com"
```

Multiple filters act as OR (any match is returned).

### Update a contact

Requires `--find` (search term to identify the contact) plus at least one field to update.

`--find` searches across name, phone, and email (case-insensitive substring). If multiple contacts match, the script prints them and asks the user to be more specific.

```
$HOME/notes/skills/contacts/scripts/contacts update --find "Jane" --phone "+15551112222"
$HOME/notes/skills/contacts/scripts/contacts update --find "+19155257466" --note "Childhood friend"
$HOME/notes/skills/contacts/scripts/contacts update --find "Jane Smith" --name "Jane Doe" --email "jane.doe@example.com"
```

### Delete a contact

Requires `--find` (same search behavior as update). Prompts for confirmation unless `-y` is passed.

```
$HOME/notes/skills/contacts/scripts/contacts delete --find "Jane Smith"
$HOME/notes/skills/contacts/scripts/contacts delete --find "+15551234567" -y
```

## Notes

- The script is fully self-contained. Credentials are embedded — no external config files or environment variables needed.
- The script auto-discovers the addressbook collection via CardDAV PROPFIND.
- Always use the script instead of direct HTTP requests to Radicale. It handles duplicate checking, vCard formatting, and CardDAV protocol.
- When the user asks to "look up" someone, use `read` with a filter. For "add" or "save", use `create`. To change existing info, use `update`.
