---
name: review-voice-notes
description: |
  Find, list, and act on voice notes by date. Queries the dictations collection in MongoDB for documents matching a given date, reads each one, and presents them as a numbered table for the user to pick which ones to act on.

  Triggers when user mentions:
  - "review voice notes"
  - "what voice notes do I have"
  - "show me today's voice notes"
  - "review my dictations"
---

# Review Voice Notes

Review voice notes from a given date (defaults to today). Present them as a numbered summary table, then act on whichever ones the user selects by number.

## How It Works

Voice notes are stored in the `notes.dictations` collection on MongoDB at `docdb.connorrhodes.com:35563`. Each document has a `created_at` field in `YYMMDD-HHMM` format, along with `title`, `summary`, `tags`, `content`, and `status` fields. Some older documents may not have a `created_at` value.

## Steps

### 1. Determine the date

If the user says "today", use today's date. If they specify a date, use that. Convert it to the `YYMMDD` prefix format used in the `created_at` field.

### 2. Query MongoDB for matching documents

Use the mongodb skill to run a query against `notes.dictations`. Use a regex on `created_at` to match the date prefix:

```python
collection.find({"created_at": {"$regex": "^260421"}}).sort("created_at", 1)
```

Sort by `created_at` ascending so notes appear in chronological order. If the user wants all notes (no date filter), omit the regex and just sort by `created_at`.

### 3. Read every document

Process all matching documents. Each document already has a `title` and `summary` field generated by the inference pipeline, so you have a head start. If there are many documents, process them all in parallel.

### 4. Present a numbered table

Create a markdown table with these columns:

| # | Time | Tags | Title | Summary |

- **#**: Sequential number (1, 2, 3...)
- **Time**: The `YYMMDD-HHMM` value from `created_at` (or "undated" if missing)
- **Tags**: The document's `tags` list (comma-separated)
- **Title**: The `title` field
- **Summary**: A concise one-line summary (use the existing `summary` field, shortened if needed)

### 5. Wait for the user to pick

After presenting the table, ask: "Which ones do you want me to act on?"

### 6. Act on selected items

When the user gives you numbers, reduce the table to only those items and ask what they want done. Common actions:

- **Extract action items**: Pull out tasks, follow-ups, or messages from the note
- **Draft messages**: Write clean versions of dictated messages
- **Create tasks**: Turn the note into Vikunja tasks or other task items
- **Summarize**: Produce a polished summary for meeting notes or journal entries
- **Combine**: Merge multiple related notes into a single document
- **Retag**: Update the `tags` field on the document in MongoDB
- **Delete**: Remove the document from the database (ask for confirmation first)

Do not act without the user specifying what to do. If they just give numbers, show the reduced table and ask what action they want.

## Constraints

- Never skip documents. If the query returns 15 documents, the table must have 15 rows.
- Keep summaries concise; the user can ask for detail on specific items (at which point read the full `content` field).
- If the user asks to reduce the table to specific numbers (e.g., "reduce to 4, 6, 9"), show only those rows before asking what to do next.
- Do not assume the date is today unless the user says "today" or similar.
- Use the mongodb skill for all database operations (connection, querying, updates).
