update review-voice-notes to query MongoDB instead of filesystem

This commit is contained in:
Connor Rhodes 2026-04-21 17:07:18 -05:00
parent 579d408ede
commit fa21932081
2 changed files with 25 additions and 16 deletions

View file

@ -124,10 +124,10 @@ description: Master index of all skills in your robot assistant system. Your ass
**Dependencies:** None
### Review Voice Notes
**Purpose:** Find all voice notes matching a given date, present them as a numbered summary table, and act on whichever ones the user selects by number.
**Purpose:** Query MongoDB for voice notes matching a given date, present them as a numbered summary table, and act on whichever ones the user selects by number.
**Triggers:** "review voice notes," "what voice notes do I have," "show me today's voice notes," "review my dictations"
**File:** `skills/review-voice-notes/SKILL.md`
**Dependencies:** `fd` CLI, voice notes at `~/notes/Inbox/voice_notes/`
**Dependencies:** mongodb skill (for database operations)
### Proof Social Communications
**Purpose:** Proofread dictated text for social messages (Slack, text, DM, etc.) to coworkers, friendly customers, and social connections. This is the default proofread skill for messages, slacks, and texts.

View file

@ -1,7 +1,7 @@
---
name: review-voice-notes
description: |
Find, list, and act on voice notes by date. Searches the voice_notes directory for files matching a given date, reads each one, and presents them as a numbered table for the user to pick which ones to act on.
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"
@ -16,32 +16,39 @@ Review voice notes from a given date (defaults to today). Present them as a numb
## How It Works
Voice notes live in `Inbox/voice_notes/` with subdirectories like `unprocessed/`, `journal_box/`, `project_ideas/`, `zk/`, `inbox/`, `drafts/`, and `misc_dictations/`. Files are named with a date prefix in the format `YYMMDD-HHMM`.
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 filenames.
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. Find all matching files
### 2. Query MongoDB for matching documents
Use `fd <YYMMDD> Inbox/voice_notes` to find every voice note file matching that date. This searches all subdirectories at once and returns the full picture.
Use the mongodb skill to run a query against `notes.dictations`. Use a regex on `created_at` to match the date prefix:
### 3. Read every file
```python
collection.find({"created_at": {"$regex": "^260421"}}).sort("created_at", 1)
```
Read the contents of every file found. Do not skip any. If there are many files, read them all in parallel.
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:
| # | File | Folder | One-line Summary |
| # | Time | Tags | Title | Summary |
- **#**: Sequential number (1, 2, 3...)
- **File**: The `YYMMDD-HHMM` prefix plus the descriptive part of the filename (not the full path)
- **Folder**: The subdirectory it was found in (e.g., `unprocessed`, `journal_box`, `zk`)
- **One-line Summary**: A concise summary of what the voice note contains
- **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
@ -51,18 +58,20 @@ After presenting the table, ask: "Which ones do you want me to act on?"
When the user gives you numbers, reduce the table to only those items and ask what they want done. Common actions:
- **Move/categorize**: Move a note from `unprocessed/` to the appropriate folder (`project_ideas/`, `zk/`, `journal_box/`, etc.)
- **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 files. If `fd` returns 15 files, the table must have 15 rows.
- Keep one-line summaries concise; the user can ask for detail on specific items.
- 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).