Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

refactor: consolidate 8 Pi skills into 2 (screenpipe-api + screenpipe-cli)

Louis Beaumont1b159679aa51
diff --git a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-analytics/SKILL.md b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-analytics/SKILL.md
deleted file mode 100644
index 68d65246f..000000000
--- a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-analytics/SKILL.md
+++ /dev/null
@@ -1,388 +0,0 @@
----
-name: screenpipe-analytics
-description: Analyze the user's computer usage patterns using raw SQL queries on their local Screenpipe database. Use when the user asks about their most used apps, websites, screen time, productivity, meeting time, typing habits, context switching, or any aggregate statistics about their activity.
----
-
-# Screenpipe Analytics
-
-Run raw SQL queries against the user's local Screenpipe database to answer questions about their computer usage patterns, productivity, and habits.
-
-The API runs at `http://localhost:3030`.
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`, `curl`
-- **Windows** → `powershell`, `curl.exe` (not the alias)
-
-All examples below use bash. On Windows, adapt: use `powershell`, replace `curl` with `curl.exe`.
-
-## Raw SQL API
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- -d '{"query": "SELECT ... LIMIT 100"}'
-```
-
-Returns a JSON array of row objects.
-
-## CRITICAL RULES
-
-1. **Every SELECT must have a LIMIT** — the API rejects queries without one. Use `LIMIT 100` or less.
-2. **Always filter by time** — use `WHERE timestamp > datetime('now', '-24 hours')` or similar. The database can have millions of rows.
-3. **Read-only** — only SELECT queries are allowed. No INSERT, UPDATE, DELETE, DROP, etc.
-4. **Use datetime() for time math** — SQLite syntax: `datetime('now', '-1 hours')`, `datetime('now', '-7 days')`, `date('now')`.
-5. **Default to last 24 hours** unless the user asks for a different range.
-6. **"today"** = `date(timestamp) = date('now')`. **"yesterday"** = `date(timestamp) = date('now', '-1 day')`. **"this week"** = `timestamp > datetime('now', '-7 days')`.
-
-## Database Schema
-
-### frames — Screen captures (1 row per screenshot, ~0.5 fps)
-
-```sql
-CREATE TABLE frames (
- id INTEGER PRIMARY KEY,
- video_chunk_id INTEGER,
- offset_index INTEGER,
- timestamp TIMESTAMP NOT NULL,
- app_name TEXT, -- e.g. "Google Chrome", "VS Code", "Slack"
- window_name TEXT, -- window title
- focused BOOLEAN,
- browser_url TEXT, -- URL if browser window
- device_name TEXT -- monitor name
-);
-```
-
-**Key facts:**
-- Frames are event-driven (accessibility captures fire on content change), NOT fixed-interval. Frame count does NOT reliably translate to screen time.
-- For accurate time estimates, use the `/activity-summary` endpoint which uses gap-based duration (consecutive frames with gaps < 5min = active time).
-- For raw SQL, approximate with gap analysis, NOT `COUNT(*) * 2 / 60` (which assumes fixed 0.5 fps and is wildly inaccurate).
-- `app_name` is the focused application
-- `browser_url` is populated for browser windows
-- `window_name` contains document/tab titles
-
-### audio_transcriptions — Speech-to-text segments
-
-```sql
-CREATE TABLE audio_transcriptions (
- id INTEGER PRIMARY KEY,
- audio_chunk_id INTEGER,
- timestamp TIMESTAMP NOT NULL,
- transcription TEXT NOT NULL,
- device TEXT, -- device name (e.g. "MacBook Pro Microphone")
- is_input_device BOOLEAN, -- true = microphone, false = system audio
- speaker_id INTEGER,
- transcription_engine TEXT
-);
-```
-
-### audio_chunks — Audio recording files (~30s each)
-
-```sql
-CREATE TABLE audio_chunks (
- id INTEGER PRIMARY KEY,
- file_path TEXT NOT NULL,
- timestamp TIMESTAMP
-);
-```
-
-### speakers — Known speakers
-
-```sql
-CREATE TABLE speakers (
- id INTEGER PRIMARY KEY,
- name TEXT,
- metadata JSON
-);
-```
-
-### ui_events — User interactions (clicks, keystrokes, app switches)
-
-```sql
-CREATE TABLE ui_events (
- id INTEGER PRIMARY KEY,
- timestamp DATETIME NOT NULL,
- event_type TEXT NOT NULL, -- 'click', 'key', 'scroll', 'app_switch', 'window_focus', 'text'
- app_name TEXT,
- window_title TEXT,
- browser_url TEXT,
- element_role TEXT, -- accessibility role of clicked element
- element_name TEXT, -- accessibility name of clicked element
- text_content TEXT,
- text_length INTEGER
-);
-```
-
-### accessibility — Accessibility tree snapshots
-
-```sql
-CREATE TABLE accessibility (
- id INTEGER PRIMARY KEY,
- timestamp DATETIME NOT NULL,
- app_name TEXT NOT NULL,
- window_name TEXT NOT NULL,
- text_content TEXT NOT NULL,
- browser_url TEXT
-);
-```
-
-### ocr_text — OCR extracted text per frame
-
-```sql
-CREATE TABLE ocr_text (
- frame_id INTEGER NOT NULL,
- text TEXT NOT NULL,
- app_name TEXT,
- window_name TEXT,
- focused BOOLEAN
-);
-```
-
-### elements — Structured UI elements (accessibility nodes + OCR blocks)
-
-```sql
-CREATE TABLE elements (
- id INTEGER PRIMARY KEY,
- frame_id INTEGER NOT NULL, -- FK to frames.id
- source TEXT NOT NULL, -- 'accessibility' or 'ocr'
- role TEXT NOT NULL, -- e.g. 'AXButton', 'AXStaticText', 'AXLink', 'line'
- text TEXT, -- element text content
- parent_id INTEGER, -- parent element id (for hierarchy)
- depth INTEGER NOT NULL DEFAULT 0,
- bounds_left REAL,
- bounds_top REAL,
- bounds_width REAL,
- bounds_height REAL,
- confidence REAL,
- sort_order INTEGER NOT NULL DEFAULT 0
-);
--- FTS index: elements_fts (text)
-```
-
-**Key facts:**
-- Each frame can have hundreds of elements (one per UI node)
-- `source='accessibility'` has proper hierarchy (parent_id, depth) and roles
-- `source='ocr'` has flat text blocks with bounding boxes
-- FTS index enables fast full-text search via the `/elements` API endpoint
-- Join with `frames` via `frame_id` to get timestamps, app names, etc.
-
-## Ready-to-Use Queries
-
-### Most used apps (by screen time)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- -d '{"query": "SELECT app_name, COUNT(*) as frames, ROUND(COUNT(*) * 2.0 / 60, 1) as minutes FROM frames WHERE timestamp > datetime('"'"'now'"'"', '"'"'-24 hours'"'"') AND app_name IS NOT NULL AND app_name != '"'"''"'"' GROUP BY app_name ORDER BY frames DESC LIMIT 20"}'
-```
-
-Simpler with heredoc:
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT app_name, COUNT(*) as frames, ROUND(COUNT(*) * 2.0 / 60, 1) as minutes FROM frames WHERE timestamp > datetime('now', '-24 hours') AND app_name IS NOT NULL AND app_name != '' GROUP BY app_name ORDER BY frames DESC LIMIT 20"}
-PAYLOAD
-```
-
-### Most visited websites
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT CASE WHEN INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') > 0 THEN SUBSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), 1, INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') - 1) ELSE SUBSTR(browser_url, INSTR(browser_url, '://') + 3) END as domain, COUNT(*) as visits FROM frames WHERE timestamp > datetime('now', '-24 hours') AND browser_url IS NOT NULL AND browser_url != '' GROUP BY domain ORDER BY visits DESC LIMIT 20"}
-PAYLOAD
-```
-
-### Daily screen time (last 7 days)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT date(timestamp) as day, COUNT(*) as frames, ROUND(COUNT(*) * 2.0 / 3600, 1) as hours, COUNT(DISTINCT app_name) as unique_apps FROM frames WHERE timestamp > datetime('now', '-7 days') AND app_name IS NOT NULL GROUP BY day ORDER BY day DESC LIMIT 10"}
-PAYLOAD
-```
-
-### Hourly app usage breakdown
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT strftime('%H:00', timestamp) as hour, app_name, COUNT(*) as frames FROM frames WHERE timestamp > datetime('now', '-24 hours') AND app_name IS NOT NULL AND app_name != '' GROUP BY hour, app_name HAVING frames > 5 ORDER BY hour DESC, frames DESC LIMIT 50"}
-PAYLOAD
-```
-
-### Most viewed windows/documents
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT window_name, app_name, COUNT(*) as frames, ROUND(COUNT(*) * 2.0 / 60, 1) as minutes FROM frames WHERE timestamp > datetime('now', '-24 hours') AND window_name IS NOT NULL AND window_name != '' GROUP BY window_name, app_name ORDER BY frames DESC LIMIT 20"}
-PAYLOAD
-```
-
-### Speaker stats (who talked the most)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT COALESCE(NULLIF(s.name, ''), 'Unknown') as speaker, COUNT(*) as segments, SUM(LENGTH(at.transcription)) as total_chars FROM audio_transcriptions at LEFT JOIN speakers s ON at.speaker_id = s.id WHERE at.timestamp > datetime('now', '-24 hours') GROUP BY at.speaker_id ORDER BY segments DESC LIMIT 20"}
-PAYLOAD
-```
-
-### Context switching frequency (app switches per hour)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT strftime('%H:00', timestamp) as hour, COUNT(*) as switches FROM ui_events WHERE event_type = 'app_switch' AND timestamp > datetime('now', '-24 hours') GROUP BY hour ORDER BY hour LIMIT 24"}
-PAYLOAD
-```
-
-### Click interactions by app
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT app_name, COUNT(*) as clicks FROM ui_events WHERE event_type = 'click' AND timestamp > datetime('now', '-24 hours') AND app_name IS NOT NULL GROUP BY app_name ORDER BY clicks DESC LIMIT 20"}
-PAYLOAD
-```
-
-### Most seen UI elements by app
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT f.app_name, e.role, COUNT(*) as count FROM elements e JOIN frames f ON f.id = e.frame_id WHERE f.timestamp > datetime('now', '-24 hours') AND e.source = 'accessibility' AND e.text IS NOT NULL GROUP BY f.app_name, e.role ORDER BY count DESC LIMIT 30"}
-PAYLOAD
-```
-
-### Typing volume by app
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT app_name, COUNT(*) as keystrokes FROM ui_events WHERE event_type = 'key' AND timestamp > datetime('now', '-24 hours') AND app_name IS NOT NULL GROUP BY app_name ORDER BY keystrokes DESC LIMIT 15"}
-PAYLOAD
-```
-
-### Daily audio recording stats (meeting time estimate)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT date(timestamp) as day, COUNT(DISTINCT id) as chunks, ROUND(COUNT(DISTINCT id) * 30.0 / 3600, 1) as approx_hours FROM audio_chunks WHERE timestamp > datetime('now', '-7 days') GROUP BY day ORDER BY day DESC LIMIT 10"}
-PAYLOAD
-```
-
-### Browser time by domain
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT CASE WHEN INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') > 0 THEN SUBSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), 1, INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') - 1) ELSE SUBSTR(browser_url, INSTR(browser_url, '://') + 3) END as domain, ROUND(COUNT(*) * 2.0 / 60, 1) as minutes FROM frames WHERE timestamp > datetime('now', '-24 hours') AND browser_url IS NOT NULL AND browser_url != '' GROUP BY domain ORDER BY minutes DESC LIMIT 20"}
-PAYLOAD
-```
-
-### Productivity breakdown (coding vs browsing vs communication)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT CASE WHEN app_name IN ('VS Code', 'Code', 'Cursor', 'IntelliJ IDEA', 'PyCharm', 'WebStorm', 'Xcode', 'Android Studio', 'Neovim', 'Vim', 'Emacs', 'Sublime Text', 'Atom', 'WezTerm', 'iTerm2', 'Terminal', 'Alacritty', 'Warp', 'kitty', 'Ghostty', 'Hyper') THEN 'Coding & Terminal' WHEN app_name IN ('Google Chrome', 'Arc', 'Safari', 'Firefox', 'Brave Browser', 'Microsoft Edge', 'Chromium', 'Opera') THEN 'Browser' WHEN app_name IN ('Slack', 'Discord', 'Microsoft Teams', 'Telegram', 'Messages', 'WhatsApp', 'Signal', 'Zoom', 'zoom.us', 'Google Meet') THEN 'Communication' WHEN app_name IN ('Notion', 'Obsidian', 'Bear', 'Notes', 'Evernote', 'Roam Research', 'Logseq') THEN 'Notes & Docs' WHEN app_name IN ('Figma', 'Sketch', 'Adobe Photoshop', 'Adobe Illustrator', 'Canva') THEN 'Design' ELSE 'Other' END as category, COUNT(*) as frames, ROUND(COUNT(*) * 2.0 / 60, 1) as minutes FROM frames WHERE timestamp > datetime('now', '-24 hours') AND app_name IS NOT NULL AND app_name != '' GROUP BY category ORDER BY frames DESC LIMIT 10"}
-PAYLOAD
-```
-
-### Active hours heatmap (when are you at the computer)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT strftime('%w', timestamp) as weekday, strftime('%H', timestamp) as hour, COUNT(*) as frames FROM frames WHERE timestamp > datetime('now', '-7 days') AND app_name IS NOT NULL GROUP BY weekday, hour ORDER BY weekday, hour LIMIT 200"}
-PAYLOAD
-```
-
-Weekday values: 0=Sunday, 1=Monday, ..., 6=Saturday.
-
-## Building Custom Queries
-
-### Available tables and their purposes
-
-| Table | Purpose | Time column | Key columns |
-|-------|---------|-------------|-------------|
-| `frames` | Screen captures (~0.5 fps) | `timestamp` | `app_name`, `window_name`, `browser_url`, `focused` |
-| `ocr_text` | OCR text per frame | Join via `frame_id` | `text`, `app_name`, `window_name` |
-| `elements` | Structured UI elements | Join via `frame_id` → `frames.timestamp` | `source`, `role`, `text`, `bounds_*` |
-| `audio_transcriptions` | Speech segments | `timestamp` | `transcription`, `device`, `speaker_id`, `is_input_device` |
-| `audio_chunks` | Audio files (~30s) | `timestamp` | `file_path` |
-| `speakers` | Speaker identities | — | `name`, `metadata` |
-| `ui_events` | User interactions | `timestamp` | `event_type`, `app_name`, `window_title`, `browser_url` |
-| `accessibility` | Accessibility tree text | `timestamp` | `app_name`, `window_name`, `text_content`, `browser_url` |
-
-### Common patterns
-
-```sql
--- Time filtering
-WHERE timestamp > datetime('now', '-24 hours')
-WHERE timestamp > datetime('now', '-7 days')
-WHERE date(timestamp) = date('now')
-WHERE timestamp BETWEEN '2024-01-15T00:00:00Z' AND '2024-01-15T23:59:59Z'
-
--- Group by time
-GROUP BY date(timestamp) -- daily
-GROUP BY strftime('%H:00', timestamp) -- hourly
-GROUP BY strftime('%w', timestamp) -- by weekday
-
--- Frame count (NOT accurate screen time — use /activity-summary for that)
-COUNT(*) as frame_count -- number of captured frames (event-driven, not fixed rate)
-
--- Domain extraction from browser_url
-CASE WHEN INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') > 0
- THEN SUBSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), 1, INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') - 1)
- ELSE SUBSTR(browser_url, INSTR(browser_url, '://') + 3)
-END as domain
-```
-
-### Joining tables
-
-```sql
--- Audio with speaker names
-SELECT at.*, s.name as speaker_name
-FROM audio_transcriptions at
-LEFT JOIN speakers s ON at.speaker_id = s.id
-
--- OCR text with frame metadata
-SELECT f.timestamp, f.app_name, o.text
-FROM frames f
-JOIN ocr_text o ON o.frame_id = f.id
-
--- UI events with frame context
-SELECT u.event_type, u.app_name, u.element_name, f.window_name
-FROM ui_events u
-LEFT JOIN frames f ON u.frame_id = f.id
-```
-
-## Tips
-
-- **Screen time from frame counts is unreliable** — frames are event-driven, not fixed-interval. Use the `/activity-summary` endpoint for accurate time estimates.
-- **Combine multiple queries** to build a full picture — e.g., app usage + website usage + typing stats.
-- **Use HAVING** to filter out noise — `HAVING frames > 5` removes apps you glanced at briefly.
-- **Window titles reveal context** — for coding, they contain file names and project names. For browsers, they contain page titles.
-- **speaker_id can be NULL** — not all audio gets speaker detection. Use `LEFT JOIN` and `COALESCE`.
-- **ui_events event_type values**: `click`, `key`, `scroll`, `app_switch`, `window_focus`, `text`, `clipboard`.
-- When presenting results, **format numbers** (round decimals, add units like "minutes" or "hours") and **sort by most interesting** metric.
-- For productivity reports, combine screen time + typing + click data for a comprehensive view.
diff --git a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-api/SKILL.md b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-api/SKILL.md
new file mode 100644
index 000000000..9e57f6fce
--- /dev/null
+++ b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-api/SKILL.md
@@ -0,0 +1,280 @@
+---
+name: screenpipe-api
+description: Query the user's screen recordings, audio, UI elements, and usage analytics via the local Screenpipe REST API at localhost:3030. Use when the user asks about their screen activity, meetings, apps, productivity, media export, retranscription, or connected services.
+---
+
+# Screenpipe API
+
+Local REST API at `http://localhost:3030`. Full reference (60+ endpoints): https://docs.screenpi.pe/llms-full.txt
+
+## Shell
+
+- **macOS/Linux** → `bash`, `curl`
+- **Windows** → `powershell`, `curl.exe` (not the alias)
+
+All examples use bash. On Windows: `curl.exe`, PowerShell date syntax, `$env:TEMP\`, `$env:USERPROFILE`.
+
+## Context Window Protection
+
+API responses can be large. Always write curl output to a file first (`curl ... -o /tmp/sp_result.json`), check size (`wc -c /tmp/sp_result.json`), and if over 5KB read only the first 50-100 lines. Extract what you need with `jq`. NEVER dump full large responses into context.
+
+---
+
+## 1. Search — `GET /search`
+
+```bash
+curl "http://localhost:3030/search?q=QUERY&content_type=all&limit=10&start_time=1h%20ago"
+```
+
+### Parameters
+
+| Parameter | Type | Required | Description |
+|-----------|------|----------|-------------|
+| `q` | string | No | Keywords. Do NOT use for audio searches — transcriptions are noisy, q filters too aggressively. |
+| `content_type` | string | No | `all` (default), `ocr`, `audio`, `input`, `accessibility` |
+| `limit` | integer | No | Max 1-20. Default: 10 |
+| `offset` | integer | No | Pagination. Default: 0 |
+| `start_time` | ISO 8601 or relative | **Yes** | Accepts `2024-01-15T10:00:00Z` or `16h ago`, `2d ago`, `30m ago` |
+| `end_time` | ISO 8601 or relative | No | Defaults to now. Accepts `now`, `1h ago` |
+| `app_name` | string | No | e.g. "Google Chrome", "Slack", "zoom.us" |
+| `window_name` | string | No | Window title substring |
+| `speaker_name` | string | No | Filter audio by speaker (case-insensitive partial) |
+| `focused` | boolean | No | Only focused windows |
+| `max_content_length` | integer | No | Truncate each result's text (middle-truncation) |
+
+### Progressive Disclosure
+
+Don't jump to heavy `/search` calls. Escalate:
+
+| Step | Endpoint | When |
+|------|----------|------|
+| 1 | `GET /activity-summary?start_time=...&end_time=...` | Broad questions ("what was I doing?", "which apps?") |
+| 2 | `GET /search?...` | Need specific content |
+| 3 | `GET /elements?...` or `GET /frames/{id}/context` | UI structure, buttons, links |
+| 4 | `GET /frames/{frame_id}` (PNG) | Visual context needed |
+
+Decision tree:
+- "What was I doing?" → Step 1 only
+- "Summarize my meeting" → Step 2 with `content_type=audio`, NO q param
+- "How long on X?" → Step 1 (`/activity-summary` has `active_minutes`)
+- "Which apps today?" → Step 1 (do NOT use frame counts or SQL)
+- "What button did I click?" → Step 3 (`/elements` with role=AXButton)
+- "Show me what I saw" → Step 2 (find frame_id) → Step 4
+
+### Critical Rules
+
+1. **ALWAYS include `start_time`** — queries without time bounds WILL timeout
+2. **Start with 1-2 hour ranges** — expand only if no results
+3. **Use `app_name`** when user mentions a specific app
+4. **Keep `limit` low** (5-10) initially
+5. **"recent"** = 30 min. **"today"** = since midnight. **"yesterday"** = yesterday's range
+6. If timeout, narrow the time range
+
+### Response Format
+
+```json
+{
+ "data": [
+ {"type": "OCR", "content": {"frame_id": 12345, "text": "...", "timestamp": "...", "app_name": "Chrome", "window_name": "..."}},
+ {"type": "Audio", "content": {"chunk_id": 678, "transcription": "...", "timestamp": "...", "speaker": {"name": "John"}}},
+ {"type": "UI", "content": {"id": 999, "text": "Clicked 'Submit'", "timestamp": "...", "app_name": "Safari"}}
+ ],
+ "pagination": {"limit": 10, "offset": 0, "total": 42}
+}
+```
+
+---
+
+## 2. Activity Summary — `GET /activity-summary`
+
+```bash
+curl "http://localhost:3030/activity-summary?start_time=1h%20ago&end_time=now"
+```
+
+Returns app usage with accurate `active_minutes`, first/last seen, recent texts, audio summary. ~200-500 tokens. Best starting point.
+
+---
+
+## 3. Elements — `GET /elements`
+
+Lightweight FTS search across UI elements (~100-500 bytes each vs 5-20KB from `/search`).
+
+```bash
+curl "http://localhost:3030/elements?q=Submit&role=AXButton&start_time=1h%20ago&limit=10"
+```
+
+Parameters: `q`, `frame_id`, `source` (`accessibility`|`ocr`), `role`, `start_time`, `end_time`, `app_name`, `limit`, `offset`.
+
+### Frame Context — `GET /frames/{id}/context`
+
+Returns accessibility text, parsed nodes, and extracted URLs for a frame.
+
+```bash
+curl "http://localhost:3030/frames/6789/context"
+```
+
+### Common Roles
+
+`AXButton`, `AXStaticText`, `AXLink`, `AXTextField`, `AXTextArea`, `AXMenuItem`, `AXCheckBox`, `AXImage`, `AXGroup`, `AXWebArea`, `line` (OCR)
+
+---
+
+## 4. Frames (Screenshots) — `GET /frames/{frame_id}`
+
+```bash
+curl -o /tmp/frame.png "http://localhost:3030/frames/12345"
+```
+
+Returns raw PNG. **Never fetch more than 2-3 frames per query** (~1000-2000 tokens each).
+
+---
+
+## 5. Media Export — `POST /frames/export`
+
+```bash
+curl -X POST http://localhost:3030/frames/export \
+ -H "Content-Type: application/json" \
+ -d '{"start_time": "5m ago", "end_time": "now", "fps": 1.0}'
+```
+
+Fields: `start_time`, `end_time` (or `frame_ids` array), `fps` (default 1.0). Max 10,000 frames.
+
+FPS guidelines: 5min→1.0, 30min→0.5, 1h→0.2, 2h+→0.1
+
+Returns `{"file_path": "...", "frame_count": N, "duration_secs": N}`. Show path as inline code block for playback.
+
+### Audio & ffmpeg
+
+Audio files from search results (`file_path`). Common operations:
+```bash
+ffmpeg -y -i /path/to/audio.mp4 -q:a 2 ~/.screenpipe/exports/output.mp3 # convert
+ffmpeg -y -i input.mp4 -ss 00:01:00 -to 00:05:00 -q:a 2 clip.mp3 # trim
+ffmpeg -y -i input.mp4 -filter:v "setpts=0.5*PTS" -an fast.mp4 # speed 2x
+ffmpeg -y -i input.mp4 -t 10 -vf "fps=10,scale=640:-1" output.gif # GIF
+```
+
+Always use `-y`, save to `~/.screenpipe/exports/`.
+
+---
+
+## 6. Retranscribe — `POST /audio/retranscribe`
+
+```bash
+curl -X POST http://localhost:3030/audio/retranscribe \
+ -H "Content-Type: application/json" \
+ -d '{"start": "1h ago", "end": "now"}'
+```
+
+Optional: `engine` (`whisper-large-v3-turbo`|`whisper-large-v3`|`deepgram`|`qwen3-asr`), `vocabulary` (array of `{"word": "...", "replacement": "..."}` for bias/replacement), `prompt` (topic context for Whisper).
+
+Keep ranges short (1h max). Show old vs new transcription.
+
+---
+
+## 7. Raw SQL — `POST /raw_sql`
+
+```bash
+curl -X POST http://localhost:3030/raw_sql \
+ -H "Content-Type: application/json" \
+ -d '{"query": "SELECT ... LIMIT 100"}'
+```
+
+**Rules**: Every SELECT needs LIMIT. Always filter by time. Read-only. Use `datetime('now', '-24 hours')` for time math.
+
+**WARNING**: Do NOT use frame counts for time estimates — frames are event-driven, not fixed-interval. Use `/activity-summary` for screen time.
+
+### Schema
+
+| Table | Key Columns | Time Column |
+|-------|-------------|-------------|
+| `frames` | `app_name`, `window_name`, `browser_url`, `focused` | `timestamp` |
+| `ocr_text` | `text`, `app_name`, `window_name` | join via `frame_id` |
+| `elements` | `source`, `role`, `text`, `bounds_*` | join via `frame_id` |
+| `audio_transcriptions` | `transcription`, `device`, `speaker_id`, `is_input_device` | `timestamp` |
+| `audio_chunks` | `file_path` | `timestamp` |
+| `speakers` | `name`, `metadata` | — |
+| `ui_events` | `event_type`, `app_name`, `window_title`, `browser_url` | `timestamp` |
+| `accessibility` | `app_name`, `window_name`, `text_content`, `browser_url` | `timestamp` |
+
+### Example Queries
+
+```sql
+-- Most used apps (last 24h)
+SELECT app_name, COUNT(*) as frames FROM frames
+WHERE timestamp > datetime('now', '-24 hours') AND app_name IS NOT NULL
+GROUP BY app_name ORDER BY frames DESC LIMIT 20
+
+-- Most visited domains
+SELECT CASE WHEN INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') > 0
+ THEN SUBSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), 1, INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') - 1)
+ ELSE SUBSTR(browser_url, INSTR(browser_url, '://') + 3) END as domain,
+COUNT(*) as visits FROM frames
+WHERE timestamp > datetime('now', '-24 hours') AND browser_url IS NOT NULL
+GROUP BY domain ORDER BY visits DESC LIMIT 20
+
+-- Speaker stats
+SELECT COALESCE(NULLIF(s.name, ''), 'Unknown') as speaker, COUNT(*) as segments
+FROM audio_transcriptions at LEFT JOIN speakers s ON at.speaker_id = s.id
+WHERE at.timestamp > datetime('now', '-24 hours')
+GROUP BY at.speaker_id ORDER BY segments DESC LIMIT 20
+
+-- Context switches per hour
+SELECT strftime('%H:00', timestamp) as hour, COUNT(*) as switches
+FROM ui_events WHERE event_type = 'app_switch' AND timestamp > datetime('now', '-24 hours')
+GROUP BY hour ORDER BY hour LIMIT 24
+```
+
+Common patterns: `GROUP BY date(timestamp)` (daily), `GROUP BY strftime('%H:00', timestamp)` (hourly), `HAVING frames > 5` (filter noise).
+
+---
+
+## 8. Connections — `GET /connections`
+
+```bash
+# List all integrations (Telegram, Slack, Discord, Email, Todoist, Teams)
+curl http://localhost:3030/connections
+
+# Get credentials for a connected service
+curl http://localhost:3030/connections/telegram
+```
+
+Returns credentials to use with service APIs directly:
+- **Telegram**: `bot_token` + `chat_id` → `POST https://api.telegram.org/bot{token}/sendMessage`
+- **Slack**: `webhook_url` → `POST {webhook_url}` with `{"text": "..."}`
+- **Discord**: `webhook_url` → `POST {webhook_url}` with `{"content": "..."}`
+- **Todoist**: `api_token` → `POST https://api.todoist.com/rest/v2/tasks` with Bearer auth
+- **Teams**: `webhook_url` → `POST {webhook_url}` with `{"text": "..."}`
+- **Email**: `smtp_host`, `smtp_port`, `smtp_user`, `smtp_pass`, `from_address`
+
+If not connected, tell user to set up in Settings > Connections.
+
+---
+
+## 9. Other Endpoints
+
+```bash
+curl http://localhost:3030/health # Health check
+curl http://localhost:3030/audio/list # Audio devices
+curl http://localhost:3030/vision/list # Monitors
+curl "http://localhost:3030/speakers/search?name=John" # Search speakers
+```
+
+---
+
+## Deep Links
+
+Reference specific moments with clickable links:
+
+```markdown
+[10:30 AM — Chrome](screenpipe://frame/12345) # OCR results (use frame_id)
+[meeting at 3pm](screenpipe://timeline?timestamp=ISO8601) # Audio results (use timestamp)
+```
+
+Only use IDs/timestamps from actual search results. Never fabricate.
+
+## Showing Videos
+
+Show `file_path` from search results as inline code for playable video:
+```
+`/Users/name/.screenpipe/data/monitor_1_2024-01-15_10-30-00.mp4`
+```
diff --git a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-cli/SKILL.md b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-cli/SKILL.md
new file mode 100644
index 000000000..8385c8005
--- /dev/null
+++ b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-cli/SKILL.md
@@ -0,0 +1,120 @@
+---
+name: screenpipe-cli
+description: Manage screenpipe pipes (scheduled AI automations) and connections (Telegram, Slack, Discord, etc.) via the CLI. Use when the user asks to create, list, enable, disable, run, or debug pipes, or manage service connections from the command line.
+---
+
+# Screenpipe CLI
+
+Use `bunx screenpipe@latest` to run CLI commands (or `npx screenpipe@latest`). No separate install needed.
+
+## Shell
+
+- **macOS/Linux** → `bash`
+- **Windows** → `powershell`
+
+---
+
+## Pipe Management
+
+Pipes are markdown-based AI automations that run on schedule. Each pipe lives at `~/.screenpipe/pipes/<name>/pipe.md`.
+
+### Commands
+
+```bash
+bunx screenpipe@latest pipe list # List all pipes (compact table)
+bunx screenpipe@latest pipe enable <name> # Enable a pipe
+bunx screenpipe@latest pipe disable <name> # Disable a pipe
+bunx screenpipe@latest pipe run <name> # Run once immediately (for testing)
+bunx screenpipe@latest pipe logs <name> # View execution logs
+bunx screenpipe@latest pipe install <url-or-path> # Install from GitHub or local path
+bunx screenpipe@latest pipe delete <name> # Delete a pipe
+bunx screenpipe@latest pipe models list # View AI model presets
+```
+
+### Creating a Pipe
+
+Create `~/.screenpipe/pipes/<name>/pipe.md` with YAML frontmatter + prompt:
+
+```markdown
+---
+schedule: every 30m
+enabled: true
+preset: Oai
+---
+
+Your prompt instructions here. The AI agent executes this on schedule.
+
+## What to do
+
+1. Query screenpipe search API for recent activity
+2. Process results
+3. Output summary / send notification
+```
+
+**Schedule syntax**: `every 30m`, `every 1h`, `every day at 9am`, `every monday at 9am`, or cron: `*/30 * * * *`, `0 9 * * *`
+
+**Config fields**: `schedule`, `enabled` (bool), `preset` (AI preset name), `history` (bool — include previous output as context)
+
+Screenpipe prepends a context header with time range, timezone, OS, and API URL before each execution. No template variables needed.
+
+After creating:
+```bash
+bunx screenpipe@latest pipe install ~/.screenpipe/pipes/my-pipe
+bunx screenpipe@latest pipe enable my-pipe
+bunx screenpipe@latest pipe run my-pipe # test immediately
+```
+
+### Editing Config
+
+Edit frontmatter in `~/.screenpipe/pipes/<name>/pipe.md` directly, or use the API:
+
+```bash
+curl -X POST http://localhost:3030/pipes/<name>/config \
+ -H "Content-Type: application/json" \
+ -d '{"config": {"schedule": "every 1h", "enabled": true}}'
+```
+
+### Rules
+
+1. Use `pipe list` (not `--json`) — table output is compact
+2. Never dump full pipe JSON — can be 15MB+
+3. Check logs first when debugging: `pipe logs <name>`
+4. Use `pipe run <name>` to test before waiting for schedule
+
+---
+
+## Connection Management
+
+Manage integrations (Telegram, Slack, Discord, Email, Todoist, Teams) from the CLI.
+
+### Commands
+
+```bash
+bunx screenpipe@latest connection list # List all connections + status
+bunx screenpipe@latest connection list --json # JSON output
+bunx screenpipe@latest connection get <id> # Show saved credentials
+bunx screenpipe@latest connection get <id> --json # JSON output
+bunx screenpipe@latest connection set <id> key=val # Save credentials
+bunx screenpipe@latest connection test <id> # Test a connection
+bunx screenpipe@latest connection remove <id> # Remove credentials
+```
+
+### Examples
+
+```bash
+# Set up Telegram
+bunx screenpipe@latest connection set telegram bot_token=123456:ABC-DEF chat_id=5776185278
+
+# Set up Slack webhook
+bunx screenpipe@latest connection set slack webhook_url=https://hooks.slack.com/services/...
+
+# Verify it works
+bunx screenpipe@latest connection test telegram
+
+# Check what's connected
+bunx screenpipe@latest connection list
+```
+
+Connection IDs: `telegram`, `slack`, `discord`, `email`, `todoist`, `teams`, `google-calendar`, `apple-intelligence`, `openclaw`
+
+Credentials are stored locally at `~/.screenpipe/connections.json`.
diff --git a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-connections/SKILL.md b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-connections/SKILL.md
deleted file mode 100644
index 29540e120..000000000
--- a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-connections/SKILL.md
+++ /dev/null
@@ -1,101 +0,0 @@
----
-name: screenpipe-connections
-description: Manage the user's connected integrations (Telegram, Slack, Discord, Email, Todoist, Teams). Use when the user wants to send messages, create tasks, or interact with any connected service. Query the connections API to discover which services are connected and get their credentials.
----
-
-# Screenpipe Connections
-
-The user can connect external services (Telegram, Slack, Discord, Email, Todoist, Microsoft Teams) through Screenpipe's connections system. Credentials are stored locally at `~/.screenpipe/connections.json`.
-
-The API runs at `http://localhost:3030/connections`.
-
-## List all connections
-
-```bash
-curl http://localhost:3030/connections
-```
-
-Returns all available integrations and whether they are connected:
-
-```json
-{
- "data": [
- { "id": "telegram", "name": "Telegram", "connected": true, ... },
- { "id": "slack", "name": "Slack", "connected": false, ... }
- ]
-}
-```
-
-## Get saved credentials for a connection
-
-```bash
-curl http://localhost:3030/connections/telegram
-```
-
-Returns:
-
-```json
-{
- "credentials": {
- "bot_token": "123456:ABC-DEF...",
- "chat_id": "5776185278"
- }
-}
-```
-
-## How to use connected services
-
-Once you have the credentials from the API, use them directly:
-
-### Telegram
-```bash
-BOT_TOKEN="<from credentials>"
-CHAT_ID="<from credentials>"
-curl -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
- -H "Content-Type: application/json" \
- -d "{\"chat_id\": \"${CHAT_ID}\", \"text\": \"Hello from Screenpipe!\"}"
-```
-
-### Slack
-```bash
-WEBHOOK_URL="<from credentials>"
-curl -X POST "$WEBHOOK_URL" \
- -H "Content-Type: application/json" \
- -d '{"text": "Hello from Screenpipe!"}'
-```
-
-### Discord
-```bash
-WEBHOOK_URL="<from credentials>"
-curl -X POST "$WEBHOOK_URL" \
- -H "Content-Type: application/json" \
- -d '{"content": "Hello from Screenpipe!"}'
-```
-
-### Email (SMTP)
-Credentials: `smtp_host`, `smtp_port`, `smtp_user`, `smtp_pass`, `from_address`.
-Use curl or a script to send via SMTP.
-
-### Todoist
-```bash
-API_TOKEN="<from credentials>"
-curl -X POST "https://api.todoist.com/rest/v2/tasks" \
- -H "Authorization: Bearer ${API_TOKEN}" \
- -H "Content-Type: application/json" \
- -d '{"content": "Task from Screenpipe"}'
-```
-
-### Microsoft Teams
-```bash
-WEBHOOK_URL="<from credentials>"
-curl -X POST "$WEBHOOK_URL" \
- -H "Content-Type: application/json" \
- -d '{"text": "Hello from Screenpipe!"}'
-```
-
-## Workflow
-
-1. First, call `GET /connections` to see which services are connected
-2. For any connected service, call `GET /connections/:id` to get credentials
-3. Use the credentials directly to interact with the service's API
-4. If a service is not connected, tell the user to connect it in Settings > Connections
diff --git a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-elements/SKILL.md b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-elements/SKILL.md
deleted file mode 100644
index 1421417d5..000000000
--- a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-elements/SKILL.md
+++ /dev/null
@@ -1,177 +0,0 @@
----
-name: screenpipe-elements
-description: Query structured UI elements (accessibility tree nodes and OCR text blocks) captured from the user's screen. Use when the user asks about specific buttons, text fields, UI components, links, or needs precise structural information about what was on screen.
----
-
-# Screenpipe Elements
-
-Query structured UI elements captured from the user's screen. Screenpipe stores every accessibility tree node and OCR text block as an individual element with role, text, bounds, and hierarchy information.
-
-The API runs at `http://localhost:3030`.
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`, `curl`, `date -u -v-1H +%Y-%m-%dT%H:%M:%SZ`
-- **Windows** → `powershell`, `curl.exe` (not the alias), `(Get-Date).ToUniversalTime().AddHours(-1).ToString("yyyy-MM-ddTHH:mm:ssZ")`
-
-All examples below use bash. On Windows, adapt accordingly.
-
-## Endpoints
-
-### 1. Search Elements — `GET /elements`
-
-Lightweight FTS search across all elements. Returns ~100-500 bytes per element (vs 5-20KB per OCR item from `/search`).
-
-```bash
-curl "http://localhost:3030/elements?q=QUERY&start_time=ISO8601&end_time=ISO8601&limit=20"
-```
-
-#### Parameters
-
-| Parameter | Type | Required | Description |
-|-----------|------|----------|-------------|
-| `q` | string | No | Full-text search query across element text |
-| `frame_id` | integer | No | Filter to elements from a specific frame |
-| `source` | string | No | `accessibility` or `ocr` |
-| `role` | string | No | Filter by element role (e.g. `AXButton`, `AXStaticText`, `AXLink`, `line`) |
-| `start_time` | ISO 8601 or relative | **Recommended** | Start of time range. Accepts ISO 8601 or relative (`16h ago`, `2d ago`, `now`). |
-| `end_time` | ISO 8601 or relative | No | End of time range. Accepts ISO 8601 or relative (`now`, `1h ago`). |
-| `app_name` | string | No | Filter by app name |
-| `limit` | integer | No | Max results. Default: 50 |
-| `offset` | integer | No | Pagination offset. Default: 0 |
-
-#### Response
-
-```json
-{
- "data": [
- {
- "id": 12345,
- "frame_id": 6789,
- "source": "accessibility",
- "role": "AXButton",
- "text": "Submit",
- "parent_id": 12340,
- "depth": 3,
- "bounds": {"left": 0.5, "top": 0.8, "width": 0.1, "height": 0.05},
- "confidence": null,
- "sort_order": 15
- }
- ],
- "pagination": {"limit": 50, "offset": 0, "total": 142}
-}
-```
-
-### 2. Frame Elements — `GET /frames/{frame_id}/elements`
-
-Get the full element tree for a single frame. Returns all elements (accessibility nodes + OCR blocks) for that screenshot.
-
-```bash
-curl "http://localhost:3030/frames/6789/elements"
-curl "http://localhost:3030/frames/6789/elements?source=accessibility"
-```
-
-#### Parameters
-
-| Parameter | Type | Required | Description |
-|-----------|------|----------|-------------|
-| `source` | string | No | Filter: `accessibility` or `ocr` |
-
-#### Response
-
-Same shape as `/elements` but returns all elements for the frame (no pagination needed).
-
-### 3. Frame Context — `GET /frames/{frame_id}/context`
-
-Get accessibility text, parsed tree nodes, and extracted URLs for a frame. Falls back to OCR for legacy frames.
-
-```bash
-curl "http://localhost:3030/frames/6789/context"
-```
-
-#### Response
-
-```json
-{
- "frame_id": 6789,
- "text": "Full accessibility text...",
- "nodes": [
- {"role": "AXStaticText", "text": "Hello world", "depth": 2, "bounds": {"left": 0.1, "top": 0.2, "width": 0.3, "height": 0.04}}
- ],
- "urls": ["https://github.com/mediar-ai/screenpipe"],
- "text_source": "accessibility"
-}
-```
-
-## Element Sources and Roles
-
-### Sources
-
-| Source | Description |
-|--------|-------------|
-| `accessibility` | macOS accessibility tree nodes — structured, hierarchical, includes roles and bounds |
-| `ocr` | OCR text blocks — flat text with bounding boxes, used as fallback |
-
-### Common Accessibility Roles
-
-| Role | Description |
-|------|-------------|
-| `AXStaticText` | Static text label |
-| `AXButton` | Button element |
-| `AXLink` | Hyperlink |
-| `AXTextField` | Text input field |
-| `AXTextArea` | Multi-line text area |
-| `AXMenuItem` | Menu item |
-| `AXCheckBox` | Checkbox |
-| `AXImage` | Image element |
-| `AXGroup` | Container/group |
-| `AXWebArea` | Web content area |
-| `line` | OCR text line |
-| `paragraph` | OCR text paragraph |
-
-## When to Use Which Endpoint
-
-| Question | Endpoint |
-|----------|----------|
-| "What buttons were visible?" | `GET /elements?role=AXButton&start_time=...` |
-| "Find where I saw text X" | `GET /elements?q=X&start_time=...` |
-| "What was the full UI layout of that screen?" | `GET /frames/{frame_id}/elements` |
-| "What links/URLs were on that page?" | `GET /frames/{frame_id}/context` |
-| "What text was showing in app X?" | `GET /elements?source=accessibility&app_name=X&start_time=...` |
-
-## CRITICAL RULES
-
-1. **ALWAYS include `start_time`** — the elements table can have millions of rows. Queries without time bounds will be slow.
-2. **Prefer `/elements` over `/search` for targeted lookups** — elements are ~10x lighter (100-500 bytes each vs 5-20KB for OCR items).
-3. **Use `source=accessibility` for structured queries** — accessibility data has proper roles, hierarchy, and bounds. OCR is flat text.
-4. **Use `/frames/{id}/context` for URL extraction** — it parses link nodes and regex-scans for URLs automatically.
-5. **Start with short time ranges** — last 1-2 hours. Expand only if needed.
-
-## Example Workflows
-
-### Find a specific button the user clicked
-
-```bash
-# Step 1: Search for the button
-curl "http://localhost:3030/elements?q=Submit&role=AXButton&start_time=$(date -u -v-1H +%Y-%m-%dT%H:%M:%SZ)&limit=5"
-
-# Step 2: Get full context for that frame
-curl "http://localhost:3030/frames/6789/context"
-```
-
-### Find all URLs the user visited
-
-```bash
-# Step 1: Get frames from Chrome
-curl "http://localhost:3030/elements?role=AXLink&app_name=Google%20Chrome&start_time=$(date -u -v-2H +%Y-%m-%dT%H:%M:%SZ)&limit=20"
-
-# Step 2: For a specific frame, get all URLs
-curl "http://localhost:3030/frames/6789/context"
-```
-
-### Get text content from a specific app
-
-```bash
-# Accessibility text from VS Code in the last hour
-curl "http://localhost:3030/elements?source=accessibility&app_name=Code&role=AXStaticText&start_time=$(date -u -v-1H +%Y-%m-%dT%H:%M:%SZ)&limit=20"
-```
diff --git a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-media/SKILL.md b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-media/SKILL.md
deleted file mode 100644
index f5cd6cabb..000000000
--- a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-media/SKILL.md
+++ /dev/null
@@ -1,181 +0,0 @@
----
-name: screenpipe-media
-description: Export videos, extract audio, and edit media clips from the user's Screenpipe recordings. Use when the user asks to export, download, clip, or create videos/audio from their screen recordings.
----
-
-# Screenpipe Media Export & Editing
-
-Export screen recordings as videos, extract audio, and perform media editing using the local Screenpipe API and ffmpeg.
-
-The API runs at `http://localhost:3030`.
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`, `curl`, `date -u -v-5M +%Y-%m-%dT%H:%M:%SZ`
-- **Windows** → `powershell`, `curl.exe` (not the alias), `(Get-Date).ToUniversalTime().AddMinutes(-5).ToString("yyyy-MM-ddTHH:mm:ssZ")`
-
-All examples below use bash. On Windows, adapt: use `powershell`, replace `curl` with `curl.exe`, replace `$(date …)` with the PowerShell equivalent, replace `~` with `$env:USERPROFILE`, replace `mkdir -p` with `New-Item -ItemType Directory -Force -Path`.
-
-## Video Export API
-
-### POST /frames/export
-
-Export a video from a time range or specific frame IDs.
-
-```bash
-curl -X POST http://localhost:3030/frames/export \
- -H "Content-Type: application/json" \
- -d '{
- "start_time": "2024-01-15T10:00:00Z",
- "end_time": "2024-01-15T10:30:00Z",
- "fps": 1.0
- }'
-```
-
-### Request Body
-
-| Field | Type | Required | Description |
-|-------|------|----------|-------------|
-| `start_time` | ISO 8601 or relative | No* | Start of time range. Accepts ISO 8601 or relative (`16h ago`, `30m ago`, `now`). |
-| `end_time` | ISO 8601 or relative | No* | End of time range. Accepts ISO 8601 or relative (`now`, `1h ago`). |
-| `frame_ids` | array of integers | No* | Specific frame IDs to export |
-| `fps` | float | No | Frames per second (default: 1.0) |
-
-*Provide either `start_time` + `end_time` OR `frame_ids`.
-
-### Response
-
-```json
-{
- "file_path": "/Users/name/.screenpipe/exports/screenpipe_export_20240115_103000.mp4",
- "frame_count": 120,
- "duration_secs": 120.0,
- "file_size_bytes": 5242880
-}
-```
-
-### CRITICAL RULES
-
-1. **Start with short time ranges** (5-15 minutes). Long exports take time and may hit the 10,000 frame limit.
-2. **Use low fps** for long recordings: 0.5 fps for 30+ minutes, 0.2 fps for hours.
-3. **Maximum 10,000 frames** per export. If exceeded, narrow the time range or lower fps.
-4. All exports are saved to `~/.screenpipe/exports/`.
-
-### FPS Guidelines
-
-| Time Range | Recommended FPS | Approx Frames |
-|-----------|----------------|---------------|
-| 5 minutes | 1.0 | ~300 |
-| 15 minutes | 1.0 | ~900 |
-| 30 minutes | 0.5 | ~900 |
-| 1 hour | 0.2 | ~720 |
-| 2+ hours | 0.1 | ~720 |
-
-### Example Exports
-
-```bash
-# Last 5 minutes
-curl -X POST http://localhost:3030/frames/export \
- -H "Content-Type: application/json" \
- -d "{\"start_time\": \"$(date -u -v-5M +%Y-%m-%dT%H:%M:%SZ)\", \"end_time\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\", \"fps\": 1.0}"
-
-# Last 30 minutes at lower fps
-curl -X POST http://localhost:3030/frames/export \
- -H "Content-Type: application/json" \
- -d "{\"start_time\": \"$(date -u -v-30M +%Y-%m-%dT%H:%M:%SZ)\", \"end_time\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\", \"fps\": 0.5}"
-
-# Specific frame IDs from search results
-curl -X POST http://localhost:3030/frames/export \
- -H "Content-Type: application/json" \
- -d '{"frame_ids": [12345, 12346, 12347, 12348], "fps": 1.0}'
-```
-
-## Showing Exported Videos
-
-After exporting, show the file path in an inline code block so it renders as a playable video in the chat:
-
-```
-`/Users/name/.screenpipe/exports/screenpipe_export_20240115_103000.mp4`
-```
-
-Do NOT use markdown links or multi-line code blocks for videos.
-
-## Audio Export
-
-Screenpipe stores audio as MP4 files. To extract audio from recordings:
-
-### Step 1: Find audio files via search
-
-```bash
-curl "http://localhost:3030/search?content_type=audio&limit=10&start_time=$(date -u -v-1H +%Y-%m-%dT%H:%M:%SZ)"
-```
-
-Each audio result has a `file_path` pointing to the audio MP4 file.
-
-### Step 2: Convert or extract audio with ffmpeg
-
-```bash
-# Convert audio MP4 to MP3
-ffmpeg -y -i /path/to/audio.mp4 -q:a 2 ~/.screenpipe/exports/output.mp3
-
-# Extract audio from a time range within a file
-ffmpeg -y -i /path/to/audio.mp4 -ss 00:01:00 -to 00:05:00 -q:a 2 ~/.screenpipe/exports/clip.mp3
-
-# Concatenate multiple audio files
-printf "file '%s'\n" /path/to/audio1.mp4 /path/to/audio2.mp4 > /tmp/audiolist.txt
-ffmpeg -y -f concat -safe 0 -i /tmp/audiolist.txt -c copy ~/.screenpipe/exports/combined.mp4
-```
-
-## Video Editing with ffmpeg
-
-After exporting a video, use ffmpeg for editing:
-
-```bash
-# Trim a video (start at 10s, duration 30s)
-ffmpeg -y -i ~/.screenpipe/exports/input.mp4 -ss 00:00:10 -t 00:00:30 -c copy ~/.screenpipe/exports/trimmed.mp4
-
-# Speed up 2x
-ffmpeg -y -i ~/.screenpipe/exports/input.mp4 -filter:v "setpts=0.5*PTS" -an ~/.screenpipe/exports/fast.mp4
-
-# Create a GIF (first 10 seconds, 10fps, 640px wide)
-ffmpeg -y -i ~/.screenpipe/exports/input.mp4 -t 10 -vf "fps=10,scale=640:-1" ~/.screenpipe/exports/output.gif
-
-# Extract audio from video
-ffmpeg -y -i ~/.screenpipe/exports/input.mp4 -vn -q:a 2 ~/.screenpipe/exports/audio.mp3
-
-# Merge video and audio
-ffmpeg -y -i ~/.screenpipe/exports/video.mp4 -i ~/.screenpipe/exports/audio.mp3 -c:v copy -c:a aac ~/.screenpipe/exports/merged.mp4
-
-# Add subtitles (SRT file)
-ffmpeg -y -i ~/.screenpipe/exports/input.mp4 -vf subtitles=subs.srt ~/.screenpipe/exports/subtitled.mp4
-```
-
-## Rules
-
-1. **Always use `-y` flag** with ffmpeg to overwrite without prompting.
-2. **Always save to `~/.screenpipe/exports/`** — create the directory first with `mkdir -p ~/.screenpipe/exports/`.
-3. **Start with short time ranges** when the user says "recent" or "last few minutes".
-4. **Show the output file path** in an inline code block after every export so the user can view/play it.
-5. **Combine search + export** for targeted clips: search to find the right time range, then export that range.
-
-## Workflow Examples
-
-### "Export a video of the last 5 minutes"
-1. Call POST /frames/export with start_time = 5 min ago, end_time = now, fps = 1.0
-2. Show the returned file_path as inline code
-
-### "Extract audio from my last meeting"
-1. Search for audio content: `curl "http://localhost:3030/search?content_type=audio&limit=20&start_time=..."`
-2. Identify the meeting's audio files from results
-3. Use ffmpeg to concat/convert the audio files
-4. Show the output path as inline code
-
-### "Make a timelapse of my work today"
-1. Call POST /frames/export with start_time = midnight, end_time = now, fps = 0.1
-2. Optionally speed up with ffmpeg: `ffmpeg -y -i input.mp4 -filter:v "setpts=0.25*PTS" -an output.mp4`
-3. Show the final file path
-
-### "Create a GIF of what I was just doing"
-1. Export last 30 seconds at 2 fps
-2. Convert to GIF: `ffmpeg -y -i input.mp4 -vf "fps=10,scale=640:-1" output.gif`
-3. Show the GIF path
diff --git a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-pipe-creator/SKILL.md b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-pipe-creator/SKILL.md
deleted file mode 100644
index cc4369a56..000000000
--- a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-pipe-creator/SKILL.md
+++ /dev/null
@@ -1,130 +0,0 @@
----
-name: screenpipe-pipe-creator
-description: Create, install, and manage screenpipe pipes — scheduled AI agents that run automatically on a cron schedule. Use when the user asks to create a pipe, schedule a prompt, automate a task, set up recurring summaries, or turn a chat into a pipe.
----
-
-# Screenpipe Pipe Creator
-
-Create scheduled AI agents ("pipes") that run automatically on your local machine.
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`, `curl`, paths use `~/`
-- **Windows** → `powershell`, `curl.exe`, paths use `$env:USERPROFILE\`
-
-All examples below use bash. On Windows, adapt: use `powershell`, replace `curl` with `curl.exe`, replace `$(date …)` with PowerShell equivalent, replace `~` with `$env:USERPROFILE`. `bunx` works the same in PowerShell.
-
-## What is a pipe?
-
-A pipe is a scheduled AI agent defined as a single markdown file: `~/.screenpipe/pipes/{name}/pipe.md`
-
-Every N minutes, screenpipe runs a coding agent (like pi or claude-code) with the pipe's prompt. The agent can query your screen data, write files, call external APIs, send notifications, etc.
-
-## pipe.md format
-
-The file starts with YAML frontmatter, then the prompt body:
-
-```
----
-schedule: every 30m
-enabled: true
----
-
-Your prompt instructions here...
-```
-
-### Schedule syntax
-
-Use natural language in the `schedule` field:
-- `every 30m` — every 30 minutes
-- `every 1h` — every hour
-- `every day at 9am` — daily at 9 AM
-- `every day at 6pm` — daily at 6 PM
-- `every monday at 9am` — weekly on Monday at 9 AM
-
-Or use cron syntax:
-- `0 9 * * *` — every day at 9 AM
-- `0 */2 * * *` — every 2 hours
-- `*/30 * * * *` — every 30 minutes
-
-## Context header
-
-Before execution, screenpipe prepends a context header to the prompt with:
-- Time range (start/end timestamps based on the schedule interval)
-- Current date
-- User's timezone
-- OS (windows, macos, linux)
-- Screenpipe API base URL (`http://localhost:3030`)
-- Output directory
-
-The AI agent uses this context to query the right time range. No template variables needed in the prompt.
-
-## Screenpipe search API
-
-The agent queries screen data via the local REST API:
-
-```bash
-curl "http://localhost:3030/search?limit=20&content_type=all&start_time=<ISO8601>&end_time=<ISO8601>"
-```
-
-### Query parameters
-- `q`: text search query (optional)
-- `content_type`: `"all"` | `"ocr"` | `"audio"` | `"input"` | `"accessibility"`
-- `limit`: max results (default 20)
-- `offset`: pagination offset
-- `start_time` / `end_time`: ISO 8601 timestamps (ALWAYS include start_time)
-- `app_name`: filter by app (e.g. "chrome", "cursor")
-- `window_name`: filter by window title
-- `browser_url`: filter by URL (e.g. "github.com")
-- `min_length` / `max_length`: filter by text length
-- `speaker_ids`: filter audio by speaker IDs
-
-### Raw SQL for aggregation
-```bash
-curl -X POST http://localhost:3030/raw_sql -H "Content-Type: application/json" \
- -d '{"query": "SELECT app_name, COUNT(*) as count FROM frames WHERE timestamp > datetime(\"now\", \"-24 hours\") GROUP BY app_name ORDER BY count DESC"}'
-```
-
-## After creating the file
-
-IMPORTANT: Always use `bunx screenpipe@latest` (not `bunx screenpipe` or `screenpipe`) to ensure the latest CLI version:
-
-```bash
-# Install the pipe
-bunx screenpipe@latest pipe install ~/.screenpipe/pipes/my-pipe
-
-# Enable it
-bunx screenpipe@latest pipe enable my-pipe
-
-# Test it immediately (run once without waiting for schedule)
-bunx screenpipe@latest pipe run my-pipe
-```
-
-## Important formatting rules
-
-- The pipe.md file MUST start with `---` on the very first line (YAML front-matter). No blank lines or comments before it.
-- Keep prompts clear and specific about what data to query and what to do with results.
-- For daily summaries, query the last 24h. For hourly tasks, query the last 1h.
-- Common output actions: desktop notifications, writing to files, calling webhooks.
-
-## Example pipes
-
-### Daily standup summary
-```
----
-schedule: every day at 9am
-enabled: true
----
-
-Search my screen and audio recordings from the last 24 hours. Summarize what I worked on, group by project/app, and highlight any meetings or important conversations. Send the summary as a desktop notification.
-```
-
-### Hourly focus tracker
-```
----
-schedule: every 1h
-enabled: true
----
-
-Search my screen recordings from the last hour. Calculate how much time I spent in each app. If I spent more than 20 minutes on social media or news sites, send a desktop notification reminding me to stay focused.
-```
diff --git a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-pipes/SKILL.md b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-pipes/SKILL.md
deleted file mode 100644
index 551d87af0..000000000
--- a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-pipes/SKILL.md
+++ /dev/null
@@ -1,164 +0,0 @@
----
-name: screenpipe-pipes
-description: Manage screenpipe pipes — list, enable, disable, run, install, delete, view logs, and edit config. Use when the user asks about their pipes, automations, scheduled tasks, or wants to create/modify pipes.
----
-
-# Screenpipe Pipe Management
-
-Pipes are markdown-based automations that run on schedule or on-demand. Each pipe lives at `~/.screenpipe/pipes/<name>/pipe.md`.
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`
-- **Windows** → `powershell`
-
-## CLI Commands
-
-Use `bunx screenpipe@latest` to run CLI commands. Users don't install the CLI separately — `bunx` fetches it on-the-fly.
-
-### List all pipes
-
-```bash
-bunx screenpipe@latest pipe list
-```
-
-Output:
-```
-NAME ENABLED SCHEDULE LAST RUN
---------------------------------------------------------------
-obsidian-sync running */30 * * * 2026-03-06 15:40
-meeting-sync yes */10 * * * 2026-03-06 15:50
-daily-logs no never
-```
-
-For full JSON (large output — avoid unless you need specific fields):
-```bash
-bunx screenpipe@latest pipe list --json
-```
-
-### Enable / Disable a pipe
-
-```bash
-bunx screenpipe@latest pipe enable <name>
-bunx screenpipe@latest pipe disable <name>
-```
-
-### Run a pipe once immediately
-
-```bash
-bunx screenpipe@latest pipe run <name>
-```
-
-Returns stdout/stderr and success status.
-
-### View pipe logs
-
-```bash
-bunx screenpipe@latest pipe logs <name>
-```
-
-Output:
-```
-2026-03-06 15:40:00 ✓ (12s)
-2026-03-06 15:10:00 ✓ (8s)
-2026-03-06 14:40:00 ✗ (3s) — connection refused
-```
-
-### Install a pipe
-
-```bash
-# From URL (GitHub raw or pipe store)
-bunx screenpipe@latest pipe install https://github.com/user/repo/blob/main/pipe.md
-
-# From local path
-bunx screenpipe@latest pipe install /path/to/pipe.md
-bunx screenpipe@latest pipe install ./my-pipe/
-```
-
-### Delete a pipe
-
-```bash
-bunx screenpipe@latest pipe delete <name>
-```
-
-### View AI model presets
-
-```bash
-bunx screenpipe@latest pipe models list
-```
-
-## Editing Pipe Config
-
-Each pipe's config is in the YAML frontmatter of `~/.screenpipe/pipes/<name>/pipe.md`:
-
-```yaml
----
-schedule: every 30m
-enabled: true
-preset: Oai
-history: true
----
-```
-
-### Config fields
-
-| Field | Type | Description |
-|-------|------|-------------|
-| `schedule` | cron or shorthand | When to run: `*/10 * * * *`, `every 30m`, `every 2h`, `daily 9:00` |
-| `enabled` | bool | Whether the pipe runs on schedule |
-| `preset` | string | AI preset name (e.g., `Oai`, `Screenpipe`) — matches presets from Settings |
-| `history` | bool | Whether to include previous execution output as context |
-
-To update config, edit the frontmatter directly:
-
-```bash
-# Read current config
-head -20 ~/.screenpipe/pipes/<name>/pipe.md
-
-# Edit with sed (example: change schedule)
-sed -i '' 's/^schedule:.*/schedule: every 1h/' ~/.screenpipe/pipes/<name>/pipe.md
-```
-
-Or use the API for programmatic config updates:
-
-```bash
-curl -X POST http://localhost:3030/pipes/<name>/config \
- -H "Content-Type: application/json" \
- -d '{"config": {"schedule": "every 1h", "enabled": true}}'
-```
-
-## Creating a New Pipe
-
-Create a directory with a `pipe.md` file:
-
-```bash
-mkdir -p ~/.screenpipe/pipes/my-pipe
-cat > ~/.screenpipe/pipes/my-pipe/pipe.md << 'PIPE'
----
-schedule: every 1h
-enabled: true
-preset: Oai
----
-
-Your task description here. The AI will execute this as instructions.
-
-## What to do
-
-1. Query screenpipe search API for recent activity
-2. Process the results
-3. Output a summary
-PIPE
-```
-
-Then enable it:
-```bash
-bunx screenpipe@latest pipe enable my-pipe
-```
-
-## Rules
-
-1. **Always use `bunx screenpipe@latest pipe list` (not `--json`)** to check pipe status — the table output is compact and sufficient.
-2. **Never dump full pipe JSON** to the conversation — it can be 15MB+ and will exceed model limits.
-3. **Edit pipe.md frontmatter** for config changes rather than using the API when possible — it's simpler and the file is the source of truth.
-4. **Check logs first** when debugging a pipe: `bunx screenpipe@latest pipe logs <name>`.
-5. **Use `bunx screenpipe@latest pipe run <name>`** to test changes immediately instead of waiting for the schedule.
diff --git a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-retranscribe/SKILL.md b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-retranscribe/SKILL.md
deleted file mode 100644
index 4e5aa4a4d..000000000
--- a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-retranscribe/SKILL.md
+++ /dev/null
@@ -1,168 +0,0 @@
----
-name: screenpipe-retranscribe
-description: Re-transcribe audio recordings with a different engine, custom vocabulary, or prompt. Use when the user wants to improve transcription quality, fix bad transcriptions, or re-process audio from a specific time range.
----
-
-# Screenpipe Retranscribe
-
-Re-transcribe existing audio recordings stored in Screenpipe. Useful when transcriptions are poor quality, the wrong language was used, or the user wants to try a different STT engine.
-
-The API runs at `http://localhost:3030`.
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`, `curl`, `date -u -v-1H +%Y-%m-%dT%H:%M:%SZ`
-- **Windows** → `powershell`, `curl.exe` (not the alias), `(Get-Date).ToUniversalTime().AddHours(-1).ToString("yyyy-MM-ddTHH:mm:ssZ")`
-
-All examples below use bash. On Windows, adapt accordingly.
-
-## Retranscribe API
-
-```bash
-curl -X POST http://localhost:3030/audio/retranscribe \
- -H "Content-Type: application/json" \
- -d '{
- "start": "2024-01-15T10:00:00Z",
- "end": "2024-01-15T11:00:00Z"
- }'
-```
-
-### Parameters
-
-| Parameter | Type | Required | Description |
-|-----------|------|----------|-------------|
-| `start` | ISO 8601 or relative | **Yes** | Start of time range to retranscribe. Accepts ISO 8601 or relative (`1h ago`, `2d ago`). |
-| `end` | ISO 8601 or relative | **Yes** | End of time range to retranscribe. Accepts ISO 8601 or relative (`now`, `30m ago`). |
-| `engine` | string | No | STT engine override (see engines below) |
-| `vocabulary` | array | No | Custom vocabulary entries for word bias |
-| `prompt` | string | No | Custom prompt to guide Whisper transcription (becomes initial_prompt) |
-
-### Supported Engines
-
-| Engine | Value | Notes |
-|--------|-------|-------|
-| Whisper Large V3 Turbo | `whisper-large-v3-turbo` | Default, runs locally |
-| Whisper Large V3 | `whisper-large-v3` | Higher quality, slower |
-| Deepgram | `deepgram` | Cloud API, requires API key |
-| Qwen3 ASR | `qwen3-asr` | Alternative local engine |
-
-If `engine` is omitted, the currently configured engine is used.
-
-### Vocabulary Format
-
-Custom vocabulary biases transcription toward specific words or replaces misheard words:
-
-```json
-{
- "vocabulary": [
- {"word": "Screenpipe"},
- {"word": "Kubernetes", "replacement": null},
- {"word": "K8s", "replacement": "Kubernetes"}
- ]
-}
-```
-
-### Response Format
-
-```json
-{
- "chunks_processed": 3,
- "transcriptions": [
- {
- "audio_chunk_id": 456,
- "old_text": "previous bad transcription",
- "new_text": "corrected transcription text"
- }
- ]
-}
-```
-
-## CRITICAL RULES
-
-1. **Always ask the user for a time range** — both `start` and `end` are required.
-2. **Keep time ranges short** — retranscription processes every audio chunk in the range. Start with 1 hour max. Large ranges (e.g. a full day) will take a long time.
-3. **"last meeting"** = search audio first to find the meeting time range, then retranscribe that range.
-4. **Show before/after** — always show the user the old vs new transcription so they can verify improvement.
-5. **Suggest vocabulary** — if the user mentions specific names, terms, or jargon that were transcribed wrong, add them as vocabulary entries.
-
-## Example Workflows
-
-### Fix bad transcription from last hour
-
-```bash
-curl -X POST http://localhost:3030/audio/retranscribe \
- -H "Content-Type: application/json" \
- -d "{
- \"start\": \"$(date -u -v-1H +%Y-%m-%dT%H:%M:%SZ)\",
- \"end\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"
- }"
-```
-
-### Retranscribe with custom vocabulary
-
-```bash
-curl -X POST http://localhost:3030/audio/retranscribe \
- -H "Content-Type: application/json" \
- -d "{
- \"start\": \"2024-01-15T14:00:00Z\",
- \"end\": \"2024-01-15T15:00:00Z\",
- \"vocabulary\": [
- {\"word\": \"Screenpipe\"},
- {\"word\": \"PostHog\"},
- {\"word\": \"Supabase\"}
- ]
- }"
-```
-
-### Retranscribe with a different engine
-
-```bash
-curl -X POST http://localhost:3030/audio/retranscribe \
- -H "Content-Type: application/json" \
- -d "{
- \"start\": \"2024-01-15T09:00:00Z\",
- \"end\": \"2024-01-15T10:00:00Z\",
- \"engine\": \"whisper-large-v3\"
- }"
-```
-
-### Retranscribe with a guiding prompt
-
-Use a prompt to tell Whisper what the audio is about — this improves accuracy for domain-specific content:
-
-```bash
-curl -X POST http://localhost:3030/audio/retranscribe \
- -H "Content-Type: application/json" \
- -d "{
- \"start\": \"2024-01-15T14:00:00Z\",
- \"end\": \"2024-01-15T15:00:00Z\",
- \"prompt\": \"Discussion about Kubernetes deployment, CI/CD pipelines, and Docker containers\"
- }"
-```
-
-### Find a meeting, then retranscribe it
-
-Combine with the search skill to find the right time range first:
-
-```bash
-# 1. Search for audio from the meeting
-curl "http://localhost:3030/search?content_type=audio&limit=5&start_time=$(date -u -v-8H +%Y-%m-%dT%H:%M:%SZ)"
-
-# 2. Note the timestamps of the first and last audio chunks
-# 3. Retranscribe that exact range
-curl -X POST http://localhost:3030/audio/retranscribe \
- -H "Content-Type: application/json" \
- -d '{
- "start": "2024-01-15T14:00:00Z",
- "end": "2024-01-15T14:45:00Z",
- "vocabulary": [{"word": "ProjectName"}]
- }'
-```
-
-## Tips
-
-- Retranscription replaces the existing transcription in the database. The old text is returned in `old_text` for comparison.
-- Each audio chunk is ~30 seconds. A 1-hour range processes ~120 chunks.
-- If the user says transcription quality is bad, suggest adding vocabulary entries for names and technical terms.
-- Whisper's `prompt` parameter works best with short context about the topic, not full instructions.
-- If no chunks are found in the range, `chunks_processed` will be 0 — the user may need to adjust the time range.
diff --git a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-search/SKILL.md b/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-search/SKILL.md
deleted file mode 100644
index bd5b04110..000000000
--- a/apps/screenpipe-app-tauri/src-tauri/assets/skills/screenpipe-search/SKILL.md
+++ /dev/null
@@ -1,305 +0,0 @@
----
-name: screenpipe-search
-description: Search the user's screen recordings, audio transcriptions, and UI interactions via the local Screenpipe API at localhost:3030. Use when the user asks about their screen activity, meetings, apps they used, what they saw/heard, or anything about their computer usage history.
----
-
-# Screenpipe Search
-
-Search the user's locally-recorded screen and audio data. Screenpipe continuously captures screen text (OCR), audio transcriptions, and UI events (clicks, keystrokes, app switches).
-
-The API runs at `http://localhost:3030`.
-
-Full API reference (60+ endpoints): https://docs.screenpi.pe/llms-full.txt
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`, `curl`, `date -u -v-1H +%Y-%m-%dT%H:%M:%SZ`
-- **Windows** → `powershell`, `curl.exe` (not the alias), `(Get-Date).ToUniversalTime().AddHours(-1).ToString("yyyy-MM-ddTHH:mm:ssZ")`
-
-All examples below use bash. On Windows, adapt: use `powershell`, replace `curl` with `curl.exe`, replace `$(date …)` with the PowerShell equivalent, replace `/tmp/` with `$env:TEMP\`, replace `~` with `$env:USERPROFILE`.
-
-## Search API
-
-```bash
-curl "http://localhost:3030/search?q=QUERY&content_type=all&limit=10&start_time=ISO8601&end_time=ISO8601"
-```
-
-### Parameters
-
-| Parameter | Type | Required | Description |
-|-----------|------|----------|-------------|
-| `q` | string | No | Search keywords. Be specific. |
-| `content_type` | string | No | `all` (default), `ocr`, `audio`, `input`, `accessibility` |
-| `limit` | integer | No | Max results 1-20. Default: 10 |
-| `offset` | integer | No | Pagination offset. Default: 0 |
-| `start_time` | ISO 8601 or relative | **Yes** | Start of time range. ALWAYS include this. Accepts ISO 8601 (`2024-01-15T10:00:00Z`) or relative (`16h ago`, `2d ago`, `30m ago`). |
-| `end_time` | ISO 8601 or relative | No | End of time range. Defaults to now. Accepts ISO 8601 or relative (`now`, `1h ago`). |
-| `app_name` | string | No | Filter by app (e.g. "Google Chrome", "Slack", "zoom.us", "Code") |
-| `window_name` | string | No | Filter by window title substring |
-| `speaker_name` | string | No | Filter audio by speaker name (case-insensitive partial match) |
-| `focused` | boolean | No | Only return results from focused windows |
-| `max_content_length` | integer | No | Truncate each result's text/transcription to this many characters (middle-truncation). Useful for limiting token usage. |
-| `device_name` | string | No | Filter results by device name (e.g., "MacBook Pro"). Partial match. |
-| `machine_id` | string | No | Filter results by machine identifier (UUID). Exact match. Useful for multi-device setups with cloud sync. |
-
-### Content Types
-
-- `ocr` — Screen text captured via OCR
-- `audio` — Audio transcriptions (meetings, voice)
-- `input` — UI events: clicks, keystrokes, clipboard, app switches
-- `accessibility` — Accessibility tree text
-- `all` — OCR + Audio + Accessibility (default)
-
-### Progressive Disclosure Strategy
-
-Don't jump straight to heavy `/search` calls. Escalate through these steps, stopping as soon as you have enough info:
-
-| Step | Endpoint | Tokens | When to use |
-|------|----------|--------|-------------|
-| 1. **Activity Summary** | `GET /activity-summary?start_time=...&end_time=...` | ~200 | Start here for broad questions ("what was I doing?", "summarize my day") |
-| 2. **Narrow with /search** | `GET /search?...` | ~500-1000 | When you need specific content from step 1's context |
-| 3. **Drill into elements** | `GET /elements?...` or `GET /frames/{id}/context` | ~200 each | For structural detail (buttons, links, UI layout) |
-| 4. **Screenshots** | `GET /frames/{frame_id}` | ~1500 each | Only when text isn't enough (charts, images, visual layout) |
-
-#### Decision tree
-
-- "What was I doing?" → Step 1 only
-- "What did I work on in Chrome?" → Step 1 (identify Chrome usage) → Step 2 (search Chrome content)
-- "What button did I click?" → Step 1 (context) → Step 3 (elements with role=AXButton)
-- "Show me what I was looking at" → Step 1 → Step 2 (find frame_id) → Step 4 (fetch screenshot)
-- "What URLs did I visit?" → Step 1 (identify browser) → Step 3 (`/frames/{id}/context` for URLs)
-
-### CRITICAL RULES
-
-1. **ALWAYS include `start_time`** — the database has hundreds of thousands of entries. Queries without time bounds WILL timeout.
-2. **Start with short time ranges** — default to last 1-2 hours. Only expand if no results found.
-3. **First search: ONLY use time params** (start_time, end_time). No `q`, no `app_name`, no `content_type`. This gives ground truth of what's actually recorded. Then scan results to identify correct `app_name` values and content patterns. Only THEN narrow with filters using the exact values you observed. App names are case-sensitive and may differ from what users say (e.g. "Discord" might be stored as "Discord.exe" or "discord"). The `q` param searches captured text content (accessibility/OCR), NOT app names — an app can be visible without its name appearing in the captured text.
-4. **NEVER report "no data found" after only one filtered search.** Always verify with an unfiltered time-only search first.
-5. **Keep `limit` low** (5-10) initially. Only increase if the user needs more.
-6. **"recent"** = last 30 minutes. **"today"** = since midnight. **"yesterday"** = yesterday's date range.
-7. If a search times out, retry with a narrower time range (e.g. 30 mins instead of 2 hours).
-8. **Prefer lightweight endpoints first** — use `/activity-summary` before `/search`, and `/elements` before fetching full frames.
-
-### Example Searches
-
-```bash
-# What happened in the last hour (relative time)
-curl "http://localhost:3030/search?content_type=all&limit=10&start_time=1h%20ago&end_time=now"
-
-# Slack messages today
-curl "http://localhost:3030/search?app_name=Slack&content_type=ocr&limit=10&start_time=$(date -u +%Y-%m-%dT00:00:00Z)"
-
-# Audio transcriptions from meetings (relative time)
-curl "http://localhost:3030/search?content_type=audio&limit=5&start_time=4h%20ago"
-
-# What a specific person said
-curl "http://localhost:3030/search?content_type=audio&speaker_name=John&limit=10&start_time=24h%20ago"
-
-# Browser activity
-curl "http://localhost:3030/search?app_name=Google%20Chrome&content_type=ocr&limit=10&start_time=2h%20ago"
-```
-
-> **Tip:** The API supports relative time strings like `16h ago`, `2d ago`, `30m ago`, `1w ago`, and `now` for `start_time` and `end_time`. No need to compute ISO timestamps with shell commands.
-
-### Response Format
-
-```json
-{
- "data": [
- {
- "type": "OCR",
- "content": {
- "frame_id": 12345,
- "text": "screen text captured...",
- "timestamp": "2024-01-15T10:30:00Z",
- "file_path": "/path/to/video.mp4",
- "offset_index": 42,
- "app_name": "Google Chrome",
- "window_name": "GitHub - screenpipe",
- "tags": [],
- "frame": null
- }
- },
- {
- "type": "Audio",
- "content": {
- "chunk_id": 678,
- "transcription": "what they said...",
- "timestamp": "2024-01-15T10:31:00Z",
- "file_path": "/path/to/audio.mp4",
- "offset_index": 5,
- "tags": [],
- "speaker": {
- "id": 1,
- "name": "John",
- "metadata": ""
- }
- }
- },
- {
- "type": "UI",
- "content": {
- "id": 999,
- "text": "Clicked button 'Submit'",
- "timestamp": "2024-01-15T10:32:00Z",
- "app_name": "Safari",
- "window_name": "Forms",
- "initial_traversal_at": null
- }
- }
- ],
- "pagination": {
- "limit": 10,
- "offset": 0,
- "total": 42
- }
-}
-```
-
-## Fetching Frames (Screenshots)
-
-You can fetch actual screenshot frames from search results. Each OCR result has a `frame_id`.
-
-```bash
-curl -o /tmp/frame.png "http://localhost:3030/frames/{frame_id}"
-```
-
-This returns the raw PNG image. Use the `read` tool to view it (pi supports images).
-
-### When to fetch frames
-- When the user asks "show me what I was looking at" or "what was on screen"
-- When you need visual context to answer a question (e.g. UI layout, charts, design)
-- When OCR text is ambiguous and you need to see the actual screen
-
-### CRITICAL: Token budget for frames
-- Each frame is ~1000-2000 tokens when sent to the LLM
-- **NEVER fetch more than 2-3 frames per query** — it's expensive and slow
-- Prefer using OCR text from search results first. Only fetch frames when text isn't enough.
-- If the user asks about many moments, summarize from OCR text and only fetch 1-2 key frames.
-
-### Example workflow
-```bash
-# 1. Search for relevant content
-curl "http://localhost:3030/search?q=dashboard&app_name=Chrome&content_type=ocr&limit=5&start_time=2024-01-15T10:00:00Z"
-
-# 2. Pick the most relevant frame_id from results
-# 3. Fetch that specific frame
-curl -o /tmp/frame_12345.png "http://localhost:3030/frames/12345"
-
-# 4. Read/view the image
-```
-
-## Other Useful Endpoints
-
-### Activity Summary (lightweight overview)
-```bash
-curl "http://localhost:3030/activity-summary?start_time=1h%20ago&end_time=now"
-```
-Returns app usage (with active session minutes, first/last seen times), recent texts, and audio summary in ~200-500 tokens. Great starting point before deeper searches.
-
-### Elements Search (structured UI data)
-```bash
-curl "http://localhost:3030/elements?q=Submit&role=AXButton&start_time=1h%20ago&limit=10"
-```
-Returns individual UI elements (~100-500 bytes each) — much lighter than `/search` for targeted lookups.
-
-### Frame Context (accessibility text + URLs)
-```bash
-curl "http://localhost:3030/frames/12345/context"
-```
-Returns parsed accessibility tree, full text, and extracted URLs for a specific frame.
-
-### Health Check
-```bash
-curl http://localhost:3030/health
-```
-
-### List Audio Devices
-```bash
-curl http://localhost:3030/audio/list
-```
-
-### List Monitors
-```bash
-curl http://localhost:3030/vision/list
-```
-
-### Raw SQL (advanced)
-```bash
-curl -X POST http://localhost:3030/raw_sql -H "Content-Type: application/json" -d '{"query": "SELECT COUNT(*) FROM ocr_text"}'
-```
-
-### Speakers
-```bash
-# Search speakers
-curl "http://localhost:3030/speakers/search?name=John"
-
-# List unnamed speakers
-curl http://localhost:3030/speakers/unnamed
-```
-
-## Showing Videos
-
-When referencing video files from search results, show the `file_path` to the user in an inline code block so it renders as a playable video:
-
-```
-`/Users/name/.screenpipe/data/monitor_1_2024-01-15_10-30-00.mp4`
-```
-
-Do NOT use markdown links or multi-line code blocks for videos.
-
-## Deep Links (Clickable References)
-
-When referencing specific moments from search results, create clickable deep links so the user can jump to that exact moment on their timeline.
-
-**ALWAYS prefer frame-based links** — frame IDs are exact database keys from search results and never break:
-
-```markdown
-[10:30 AM — VS Code](screenpipe://frame/12345)
-```
-
-For audio results (which have no frame_id), fall back to timestamp links:
-
-```markdown
-[meeting at 3pm](screenpipe://timeline?timestamp=2024-01-15T15:00:00Z)
-```
-
-### Rules
-
-1. **Use `screenpipe://frame/{frame_id}`** for OCR results — copy the `frame_id` integer directly from the search result's `content.frame_id` field. Do NOT invent frame IDs.
-2. **Use `screenpipe://timeline?timestamp=ISO8601`** for audio results — copy the exact `timestamp` string from the search result.
-3. **NEVER fabricate IDs or timestamps** — only use values that appear in actual search results.
-4. **Make the link text human-readable** — include the time and app name, e.g. `[2:15 PM — Slack](screenpipe://frame/56789)`.
-5. Include deep links in your responses whenever you reference specific moments. This lets the user verify your claims by clicking through to the actual recording.
-
-### Example
-
-After searching and getting results with `frame_id: 12345` at `timestamp: "2024-01-15T10:30:00Z"` in Chrome:
-
-```markdown
-You were browsing GitHub at [10:30 AM — Chrome](screenpipe://frame/12345) when you reviewed PR #234.
-```
-
-## Tips
-
-- The user's data is 100% local. You are querying their local machine.
-- Timestamps in results are UTC. Convert to the user's local timezone when displaying.
-- If asked "what did I work on today?", search with broad terms and short time ranges, then summarize by app/activity.
-- If asked about meetings, use `content_type=audio`.
-- If asked about a specific app, first search with only time filters to discover the exact `app_name` value stored in the database, then filter by that value.
-- Combine multiple searches to build a complete picture (e.g., screen + audio for a meeting).
-- **For aggregation over large datasets**, use raw SQL instead of paginating through search results. The `/search` endpoint returns paginated results (default limit 20), so summarizing thousands of events requires raw SQL. Examples:
-
-```bash
-# Count accessibility events by app (last 24h)
-curl -X POST http://localhost:3030/raw_sql -H "Content-Type: application/json" \
- -d '{"query": "SELECT app_name, COUNT(*) as count FROM accessibility WHERE timestamp > datetime(\"now\", \"-24 hours\") GROUP BY app_name ORDER BY count DESC"}'
-
-# Count input events by type and app (last 24h)
-curl -X POST http://localhost:3030/raw_sql -H "Content-Type: application/json" \
- -d '{"query": "SELECT app_name, event_type, COUNT(*) as count FROM ui_events WHERE timestamp > datetime(\"now\", \"-24 hours\") GROUP BY app_name, event_type ORDER BY count DESC"}'
-
-# App usage summary from OCR frames (last 24h)
-curl -X POST http://localhost:3030/raw_sql -H "Content-Type: application/json" \
- -d '{"query": "SELECT app_name, COUNT(*) as frames FROM frames WHERE timestamp > datetime(\"now\", \"-24 hours\") GROUP BY app_name ORDER BY frames DESC"}'
-```
diff --git a/apps/screenpipe-app-tauri/src-tauri/src/pi.rs b/apps/screenpipe-app-tauri/src-tauri/src/pi.rs
index 39beee6fa..39073618f 100644
--- a/apps/screenpipe-app-tauri/src-tauri/src/pi.rs
+++ b/apps/screenpipe-app-tauri/src-tauri/src/pi.rs
@@ -476,36 +476,12 @@ fn find_pi_executable() -> Option<String> {
fn ensure_screenpipe_skill(project_dir: &str) -> Result<(), String> {
let skills: &[(&str, &str)] = &[
(
- "screenpipe-search",
- include_str!("../assets/skills/screenpipe-search/SKILL.md"),
+ "screenpipe-api",
+ include_str!("../assets/skills/screenpipe-api/SKILL.md"),
),
(
- "screenpipe-pipe-creator",
- include_str!("../assets/skills/screenpipe-pipe-creator/SKILL.md"),
- ),
- (
- "screenpipe-media",
- include_str!("../assets/skills/screenpipe-media/SKILL.md"),
- ),
- (
- "screenpipe-retranscribe",
- include_str!("../assets/skills/screenpipe-retranscribe/SKILL.md"),
- ),
- (
- "screenpipe-analytics",
- include_str!("../assets/skills/screenpipe-analytics/SKILL.md"),
- ),
- (
- "screenpipe-elements",
- include_str!("../assets/skills/screenpipe-elements/SKILL.md"),
- ),
- (
- "screenpipe-pipes",
- include_str!("../assets/skills/screenpipe-pipes/SKILL.md"),
- ),
- (
- "screenpipe-connections",
- include_str!("../assets/skills/screenpipe-connections/SKILL.md"),
+ "screenpipe-cli",
+ include_str!("../assets/skills/screenpipe-cli/SKILL.md"),
),
];
@@ -912,7 +888,7 @@ pub async fn pi_start_inner(
std::fs::create_dir_all(&project_dir)
.map_err(|e| format!("Failed to create project directory: {}", e))?;
- // Ensure screenpipe-search skill exists in project
+ // Ensure screenpipe skills exist in project
ensure_screenpipe_skill(&project_dir)?;
// Install web-search extension only for screenpipe-cloud presets
diff --git a/crates/screenpipe-core/assets/skills/screenpipe-analytics/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-analytics/SKILL.md
deleted file mode 100644
index 26fc81ba8..000000000
--- a/crates/screenpipe-core/assets/skills/screenpipe-analytics/SKILL.md
+++ /dev/null
@@ -1,389 +0,0 @@
----
-name: screenpipe-analytics
-description: Analyze the user's computer usage patterns using raw SQL queries on their local Screenpipe database. Use when the user asks about their most used apps, websites, screen time, productivity, meeting time, typing habits, context switching, or any aggregate statistics about their activity.
----
-
-# Screenpipe Analytics
-
-Run raw SQL queries against the user's local Screenpipe database to answer questions about their computer usage patterns, productivity, and habits.
-
-The API runs at `http://localhost:3030`.
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`, `curl`
-- **Windows** → `powershell`, `curl.exe` (not the alias)
-
-All examples below use bash. On Windows, adapt: use `powershell`, replace `curl` with `curl.exe`.
-
-## Raw SQL API
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- -d '{"query": "SELECT ... LIMIT 100"}'
-```
-
-Returns a JSON array of row objects.
-
-## CRITICAL RULES
-
-1. **Every SELECT must have a LIMIT** — the API rejects queries without one. Use `LIMIT 100` or less.
-2. **Always filter by time** — use `WHERE timestamp > datetime('now', '-24 hours')` or similar. The database can have millions of rows.
-3. **Read-only** — only SELECT queries are allowed. No INSERT, UPDATE, DELETE, DROP, etc.
-4. **Use datetime() for time math** — SQLite syntax: `datetime('now', '-1 hours')`, `datetime('now', '-7 days')`, `date('now')`.
-5. **Default to last 24 hours** unless the user asks for a different range.
-6. **"today"** = `date(timestamp) = date('now')`. **"yesterday"** = `date(timestamp) = date('now', '-1 day')`. **"this week"** = `timestamp > datetime('now', '-7 days')`.
-7. **Protect your context window.** SQL results can be large. Always write curl output to a file first (`curl ... -o /tmp/sp_result.json`), then check its size (`wc -c /tmp/sp_result.json`). If over 5KB, read only the first 50-100 lines to understand the structure, then extract what you need with `jq` or targeted reads. NEVER dump a full large API response into your context.
-
-## Database Schema
-
-### frames — Screen captures (1 row per screenshot, ~0.5 fps)
-
-```sql
-CREATE TABLE frames (
- id INTEGER PRIMARY KEY,
- video_chunk_id INTEGER,
- offset_index INTEGER,
- timestamp TIMESTAMP NOT NULL,
- app_name TEXT, -- e.g. "Google Chrome", "VS Code", "Slack"
- window_name TEXT, -- window title
- focused BOOLEAN,
- browser_url TEXT, -- URL if browser window
- device_name TEXT -- monitor name
-);
-```
-
-**Key facts:**
-- Frames are event-driven (accessibility captures fire on content change), NOT fixed-interval. Frame count does NOT reliably translate to screen time.
-- **WARNING: Do NOT use SQL to answer "how long" / "time spent" / "which apps did I use most" questions.** Use the `/activity-summary` REST endpoint instead — it calculates accurate active session time. SQL frame counts can be off by 10x.
-- If you must use SQL for time estimation, use gap analysis (measure time between consecutive frames), NOT `COUNT(*) * 2 / 60`.
-- `app_name` is the focused application
-- `browser_url` is populated for browser windows
-- `window_name` contains document/tab titles
-
-### audio_transcriptions — Speech-to-text segments
-
-```sql
-CREATE TABLE audio_transcriptions (
- id INTEGER PRIMARY KEY,
- audio_chunk_id INTEGER,
- timestamp TIMESTAMP NOT NULL,
- transcription TEXT NOT NULL,
- device TEXT, -- device name (e.g. "MacBook Pro Microphone")
- is_input_device BOOLEAN, -- true = microphone, false = system audio
- speaker_id INTEGER,
- transcription_engine TEXT
-);
-```
-
-### audio_chunks — Audio recording files (~30s each)
-
-```sql
-CREATE TABLE audio_chunks (
- id INTEGER PRIMARY KEY,
- file_path TEXT NOT NULL,
- timestamp TIMESTAMP
-);
-```
-
-### speakers — Known speakers
-
-```sql
-CREATE TABLE speakers (
- id INTEGER PRIMARY KEY,
- name TEXT,
- metadata JSON
-);
-```
-
-### ui_events — User interactions (clicks, keystrokes, app switches)
-
-```sql
-CREATE TABLE ui_events (
- id INTEGER PRIMARY KEY,
- timestamp DATETIME NOT NULL,
- event_type TEXT NOT NULL, -- 'click', 'key', 'scroll', 'app_switch', 'window_focus', 'text'
- app_name TEXT,
- window_title TEXT,
- browser_url TEXT,
- element_role TEXT, -- accessibility role of clicked element
- element_name TEXT, -- accessibility name of clicked element
- text_content TEXT,
- text_length INTEGER
-);
-```
-
-### accessibility — Accessibility tree snapshots
-
-```sql
-CREATE TABLE accessibility (
- id INTEGER PRIMARY KEY,
- timestamp DATETIME NOT NULL,
- app_name TEXT NOT NULL,
- window_name TEXT NOT NULL,
- text_content TEXT NOT NULL,
- browser_url TEXT
-);
-```
-
-### ocr_text — OCR extracted text per frame
-
-```sql
-CREATE TABLE ocr_text (
- frame_id INTEGER NOT NULL,
- text TEXT NOT NULL,
- app_name TEXT,
- window_name TEXT,
- focused BOOLEAN
-);
-```
-
-### elements — Structured UI elements (accessibility nodes + OCR blocks)
-
-```sql
-CREATE TABLE elements (
- id INTEGER PRIMARY KEY,
- frame_id INTEGER NOT NULL, -- FK to frames.id
- source TEXT NOT NULL, -- 'accessibility' or 'ocr'
- role TEXT NOT NULL, -- e.g. 'AXButton', 'AXStaticText', 'AXLink', 'line'
- text TEXT, -- element text content
- parent_id INTEGER, -- parent element id (for hierarchy)
- depth INTEGER NOT NULL DEFAULT 0,
- bounds_left REAL,
- bounds_top REAL,
- bounds_width REAL,
- bounds_height REAL,
- confidence REAL,
- sort_order INTEGER NOT NULL DEFAULT 0
-);
--- FTS index: elements_fts (text)
-```
-
-**Key facts:**
-- Each frame can have hundreds of elements (one per UI node)
-- `source='accessibility'` has proper hierarchy (parent_id, depth) and roles
-- `source='ocr'` has flat text blocks with bounding boxes
-- FTS index enables fast full-text search via the `/elements` API endpoint
-- Join with `frames` via `frame_id` to get timestamps, app names, etc.
-
-## Ready-to-Use Queries
-
-### Most used apps (by screen time)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- -d '{"query": "SELECT app_name, COUNT(*) as frames, ROUND(COUNT(*) * 2.0 / 60, 1) as minutes FROM frames WHERE timestamp > datetime('"'"'now'"'"', '"'"'-24 hours'"'"') AND app_name IS NOT NULL AND app_name != '"'"''"'"' GROUP BY app_name ORDER BY frames DESC LIMIT 20"}'
-```
-
-Simpler with heredoc:
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT app_name, COUNT(*) as frames, ROUND(COUNT(*) * 2.0 / 60, 1) as minutes FROM frames WHERE timestamp > datetime('now', '-24 hours') AND app_name IS NOT NULL AND app_name != '' GROUP BY app_name ORDER BY frames DESC LIMIT 20"}
-PAYLOAD
-```
-
-### Most visited websites
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT CASE WHEN INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') > 0 THEN SUBSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), 1, INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') - 1) ELSE SUBSTR(browser_url, INSTR(browser_url, '://') + 3) END as domain, COUNT(*) as visits FROM frames WHERE timestamp > datetime('now', '-24 hours') AND browser_url IS NOT NULL AND browser_url != '' GROUP BY domain ORDER BY visits DESC LIMIT 20"}
-PAYLOAD
-```
-
-### Daily screen time (last 7 days)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT date(timestamp) as day, COUNT(*) as frames, ROUND(COUNT(*) * 2.0 / 3600, 1) as hours, COUNT(DISTINCT app_name) as unique_apps FROM frames WHERE timestamp > datetime('now', '-7 days') AND app_name IS NOT NULL GROUP BY day ORDER BY day DESC LIMIT 10"}
-PAYLOAD
-```
-
-### Hourly app usage breakdown
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT strftime('%H:00', timestamp) as hour, app_name, COUNT(*) as frames FROM frames WHERE timestamp > datetime('now', '-24 hours') AND app_name IS NOT NULL AND app_name != '' GROUP BY hour, app_name HAVING frames > 5 ORDER BY hour DESC, frames DESC LIMIT 50"}
-PAYLOAD
-```
-
-### Most viewed windows/documents
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT window_name, app_name, COUNT(*) as frames, ROUND(COUNT(*) * 2.0 / 60, 1) as minutes FROM frames WHERE timestamp > datetime('now', '-24 hours') AND window_name IS NOT NULL AND window_name != '' GROUP BY window_name, app_name ORDER BY frames DESC LIMIT 20"}
-PAYLOAD
-```
-
-### Speaker stats (who talked the most)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT COALESCE(NULLIF(s.name, ''), 'Unknown') as speaker, COUNT(*) as segments, SUM(LENGTH(at.transcription)) as total_chars FROM audio_transcriptions at LEFT JOIN speakers s ON at.speaker_id = s.id WHERE at.timestamp > datetime('now', '-24 hours') GROUP BY at.speaker_id ORDER BY segments DESC LIMIT 20"}
-PAYLOAD
-```
-
-### Context switching frequency (app switches per hour)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT strftime('%H:00', timestamp) as hour, COUNT(*) as switches FROM ui_events WHERE event_type = 'app_switch' AND timestamp > datetime('now', '-24 hours') GROUP BY hour ORDER BY hour LIMIT 24"}
-PAYLOAD
-```
-
-### Click interactions by app
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT app_name, COUNT(*) as clicks FROM ui_events WHERE event_type = 'click' AND timestamp > datetime('now', '-24 hours') AND app_name IS NOT NULL GROUP BY app_name ORDER BY clicks DESC LIMIT 20"}
-PAYLOAD
-```
-
-### Most seen UI elements by app
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT f.app_name, e.role, COUNT(*) as count FROM elements e JOIN frames f ON f.id = e.frame_id WHERE f.timestamp > datetime('now', '-24 hours') AND e.source = 'accessibility' AND e.text IS NOT NULL GROUP BY f.app_name, e.role ORDER BY count DESC LIMIT 30"}
-PAYLOAD
-```
-
-### Typing volume by app
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT app_name, COUNT(*) as keystrokes FROM ui_events WHERE event_type = 'key' AND timestamp > datetime('now', '-24 hours') AND app_name IS NOT NULL GROUP BY app_name ORDER BY keystrokes DESC LIMIT 15"}
-PAYLOAD
-```
-
-### Daily audio recording stats (meeting time estimate)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT date(timestamp) as day, COUNT(DISTINCT id) as chunks, ROUND(COUNT(DISTINCT id) * 30.0 / 3600, 1) as approx_hours FROM audio_chunks WHERE timestamp > datetime('now', '-7 days') GROUP BY day ORDER BY day DESC LIMIT 10"}
-PAYLOAD
-```
-
-### Browser time by domain
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT CASE WHEN INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') > 0 THEN SUBSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), 1, INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') - 1) ELSE SUBSTR(browser_url, INSTR(browser_url, '://') + 3) END as domain, ROUND(COUNT(*) * 2.0 / 60, 1) as minutes FROM frames WHERE timestamp > datetime('now', '-24 hours') AND browser_url IS NOT NULL AND browser_url != '' GROUP BY domain ORDER BY minutes DESC LIMIT 20"}
-PAYLOAD
-```
-
-### Productivity breakdown (coding vs browsing vs communication)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT CASE WHEN app_name IN ('VS Code', 'Code', 'Cursor', 'IntelliJ IDEA', 'PyCharm', 'WebStorm', 'Xcode', 'Android Studio', 'Neovim', 'Vim', 'Emacs', 'Sublime Text', 'Atom', 'WezTerm', 'iTerm2', 'Terminal', 'Alacritty', 'Warp', 'kitty', 'Ghostty', 'Hyper') THEN 'Coding & Terminal' WHEN app_name IN ('Google Chrome', 'Arc', 'Safari', 'Firefox', 'Brave Browser', 'Microsoft Edge', 'Chromium', 'Opera') THEN 'Browser' WHEN app_name IN ('Slack', 'Discord', 'Microsoft Teams', 'Telegram', 'Messages', 'WhatsApp', 'Signal', 'Zoom', 'zoom.us', 'Google Meet') THEN 'Communication' WHEN app_name IN ('Notion', 'Obsidian', 'Bear', 'Notes', 'Evernote', 'Roam Research', 'Logseq') THEN 'Notes & Docs' WHEN app_name IN ('Figma', 'Sketch', 'Adobe Photoshop', 'Adobe Illustrator', 'Canva') THEN 'Design' ELSE 'Other' END as category, COUNT(*) as frames, ROUND(COUNT(*) * 2.0 / 60, 1) as minutes FROM frames WHERE timestamp > datetime('now', '-24 hours') AND app_name IS NOT NULL AND app_name != '' GROUP BY category ORDER BY frames DESC LIMIT 10"}
-PAYLOAD
-```
-
-### Active hours heatmap (when are you at the computer)
-
-```bash
-curl -X POST http://localhost:3030/raw_sql \
- -H "Content-Type: application/json" \
- --data-binary @- <<'PAYLOAD'
-{"query": "SELECT strftime('%w', timestamp) as weekday, strftime('%H', timestamp) as hour, COUNT(*) as frames FROM frames WHERE timestamp > datetime('now', '-7 days') AND app_name IS NOT NULL GROUP BY weekday, hour ORDER BY weekday, hour LIMIT 200"}
-PAYLOAD
-```
-
-Weekday values: 0=Sunday, 1=Monday, ..., 6=Saturday.
-
-## Building Custom Queries
-
-### Available tables and their purposes
-
-| Table | Purpose | Time column | Key columns |
-|-------|---------|-------------|-------------|
-| `frames` | Screen captures (~0.5 fps) | `timestamp` | `app_name`, `window_name`, `browser_url`, `focused` |
-| `ocr_text` | OCR text per frame | Join via `frame_id` | `text`, `app_name`, `window_name` |
-| `elements` | Structured UI elements | Join via `frame_id` → `frames.timestamp` | `source`, `role`, `text`, `bounds_*` |
-| `audio_transcriptions` | Speech segments | `timestamp` | `transcription`, `device`, `speaker_id`, `is_input_device` |
-| `audio_chunks` | Audio files (~30s) | `timestamp` | `file_path` |
-| `speakers` | Speaker identities | — | `name`, `metadata` |
-| `ui_events` | User interactions | `timestamp` | `event_type`, `app_name`, `window_title`, `browser_url` |
-| `accessibility` | Accessibility tree text | `timestamp` | `app_name`, `window_name`, `text_content`, `browser_url` |
-
-### Common patterns
-
-```sql
--- Time filtering
-WHERE timestamp > datetime('now', '-24 hours')
-WHERE timestamp > datetime('now', '-7 days')
-WHERE date(timestamp) = date('now')
-WHERE timestamp BETWEEN '2024-01-15T00:00:00Z' AND '2024-01-15T23:59:59Z'
-
--- Group by time
-GROUP BY date(timestamp) -- daily
-GROUP BY strftime('%H:00', timestamp) -- hourly
-GROUP BY strftime('%w', timestamp) -- by weekday
-
--- Frame count (NOT accurate screen time — use /activity-summary for that)
-COUNT(*) as frame_count -- number of captured frames (event-driven, not fixed rate)
-
--- Domain extraction from browser_url
-CASE WHEN INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') > 0
- THEN SUBSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), 1, INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') - 1)
- ELSE SUBSTR(browser_url, INSTR(browser_url, '://') + 3)
-END as domain
-```
-
-### Joining tables
-
-```sql
--- Audio with speaker names
-SELECT at.*, s.name as speaker_name
-FROM audio_transcriptions at
-LEFT JOIN speakers s ON at.speaker_id = s.id
-
--- OCR text with frame metadata
-SELECT f.timestamp, f.app_name, o.text
-FROM frames f
-JOIN ocr_text o ON o.frame_id = f.id
-
--- UI events with frame context
-SELECT u.event_type, u.app_name, u.element_name, f.window_name
-FROM ui_events u
-LEFT JOIN frames f ON u.frame_id = f.id
-```
-
-## Tips
-
-- **Screen time from frame counts is unreliable** — frames are event-driven, not fixed-interval. Use the `/activity-summary` endpoint for accurate time estimates.
-- **Combine multiple queries** to build a full picture — e.g., app usage + website usage + typing stats.
-- **Use HAVING** to filter out noise — `HAVING frames > 5` removes apps you glanced at briefly.
-- **Window titles reveal context** — for coding, they contain file names and project names. For browsers, they contain page titles.
-- **speaker_id can be NULL** — not all audio gets speaker detection. Use `LEFT JOIN` and `COALESCE`.
-- **ui_events event_type values**: `click`, `key`, `scroll`, `app_switch`, `window_focus`, `text`, `clipboard`.
-- When presenting results, **format numbers** (round decimals, add units like "minutes" or "hours") and **sort by most interesting** metric.
-- For productivity reports, combine screen time + typing + click data for a comprehensive view.
diff --git a/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md
new file mode 100644
index 000000000..9e57f6fce
--- /dev/null
+++ b/crates/screenpipe-core/assets/skills/screenpipe-api/SKILL.md
@@ -0,0 +1,280 @@
+---
+name: screenpipe-api
+description: Query the user's screen recordings, audio, UI elements, and usage analytics via the local Screenpipe REST API at localhost:3030. Use when the user asks about their screen activity, meetings, apps, productivity, media export, retranscription, or connected services.
+---
+
+# Screenpipe API
+
+Local REST API at `http://localhost:3030`. Full reference (60+ endpoints): https://docs.screenpi.pe/llms-full.txt
+
+## Shell
+
+- **macOS/Linux** → `bash`, `curl`
+- **Windows** → `powershell`, `curl.exe` (not the alias)
+
+All examples use bash. On Windows: `curl.exe`, PowerShell date syntax, `$env:TEMP\`, `$env:USERPROFILE`.
+
+## Context Window Protection
+
+API responses can be large. Always write curl output to a file first (`curl ... -o /tmp/sp_result.json`), check size (`wc -c /tmp/sp_result.json`), and if over 5KB read only the first 50-100 lines. Extract what you need with `jq`. NEVER dump full large responses into context.
+
+---
+
+## 1. Search — `GET /search`
+
+```bash
+curl "http://localhost:3030/search?q=QUERY&content_type=all&limit=10&start_time=1h%20ago"
+```
+
+### Parameters
+
+| Parameter | Type | Required | Description |
+|-----------|------|----------|-------------|
+| `q` | string | No | Keywords. Do NOT use for audio searches — transcriptions are noisy, q filters too aggressively. |
+| `content_type` | string | No | `all` (default), `ocr`, `audio`, `input`, `accessibility` |
+| `limit` | integer | No | Max 1-20. Default: 10 |
+| `offset` | integer | No | Pagination. Default: 0 |
+| `start_time` | ISO 8601 or relative | **Yes** | Accepts `2024-01-15T10:00:00Z` or `16h ago`, `2d ago`, `30m ago` |
+| `end_time` | ISO 8601 or relative | No | Defaults to now. Accepts `now`, `1h ago` |
+| `app_name` | string | No | e.g. "Google Chrome", "Slack", "zoom.us" |
+| `window_name` | string | No | Window title substring |
+| `speaker_name` | string | No | Filter audio by speaker (case-insensitive partial) |
+| `focused` | boolean | No | Only focused windows |
+| `max_content_length` | integer | No | Truncate each result's text (middle-truncation) |
+
+### Progressive Disclosure
+
+Don't jump to heavy `/search` calls. Escalate:
+
+| Step | Endpoint | When |
+|------|----------|------|
+| 1 | `GET /activity-summary?start_time=...&end_time=...` | Broad questions ("what was I doing?", "which apps?") |
+| 2 | `GET /search?...` | Need specific content |
+| 3 | `GET /elements?...` or `GET /frames/{id}/context` | UI structure, buttons, links |
+| 4 | `GET /frames/{frame_id}` (PNG) | Visual context needed |
+
+Decision tree:
+- "What was I doing?" → Step 1 only
+- "Summarize my meeting" → Step 2 with `content_type=audio`, NO q param
+- "How long on X?" → Step 1 (`/activity-summary` has `active_minutes`)
+- "Which apps today?" → Step 1 (do NOT use frame counts or SQL)
+- "What button did I click?" → Step 3 (`/elements` with role=AXButton)
+- "Show me what I saw" → Step 2 (find frame_id) → Step 4
+
+### Critical Rules
+
+1. **ALWAYS include `start_time`** — queries without time bounds WILL timeout
+2. **Start with 1-2 hour ranges** — expand only if no results
+3. **Use `app_name`** when user mentions a specific app
+4. **Keep `limit` low** (5-10) initially
+5. **"recent"** = 30 min. **"today"** = since midnight. **"yesterday"** = yesterday's range
+6. If timeout, narrow the time range
+
+### Response Format
+
+```json
+{
+ "data": [
+ {"type": "OCR", "content": {"frame_id": 12345, "text": "...", "timestamp": "...", "app_name": "Chrome", "window_name": "..."}},
+ {"type": "Audio", "content": {"chunk_id": 678, "transcription": "...", "timestamp": "...", "speaker": {"name": "John"}}},
+ {"type": "UI", "content": {"id": 999, "text": "Clicked 'Submit'", "timestamp": "...", "app_name": "Safari"}}
+ ],
+ "pagination": {"limit": 10, "offset": 0, "total": 42}
+}
+```
+
+---
+
+## 2. Activity Summary — `GET /activity-summary`
+
+```bash
+curl "http://localhost:3030/activity-summary?start_time=1h%20ago&end_time=now"
+```
+
+Returns app usage with accurate `active_minutes`, first/last seen, recent texts, audio summary. ~200-500 tokens. Best starting point.
+
+---
+
+## 3. Elements — `GET /elements`
+
+Lightweight FTS search across UI elements (~100-500 bytes each vs 5-20KB from `/search`).
+
+```bash
+curl "http://localhost:3030/elements?q=Submit&role=AXButton&start_time=1h%20ago&limit=10"
+```
+
+Parameters: `q`, `frame_id`, `source` (`accessibility`|`ocr`), `role`, `start_time`, `end_time`, `app_name`, `limit`, `offset`.
+
+### Frame Context — `GET /frames/{id}/context`
+
+Returns accessibility text, parsed nodes, and extracted URLs for a frame.
+
+```bash
+curl "http://localhost:3030/frames/6789/context"
+```
+
+### Common Roles
+
+`AXButton`, `AXStaticText`, `AXLink`, `AXTextField`, `AXTextArea`, `AXMenuItem`, `AXCheckBox`, `AXImage`, `AXGroup`, `AXWebArea`, `line` (OCR)
+
+---
+
+## 4. Frames (Screenshots) — `GET /frames/{frame_id}`
+
+```bash
+curl -o /tmp/frame.png "http://localhost:3030/frames/12345"
+```
+
+Returns raw PNG. **Never fetch more than 2-3 frames per query** (~1000-2000 tokens each).
+
+---
+
+## 5. Media Export — `POST /frames/export`
+
+```bash
+curl -X POST http://localhost:3030/frames/export \
+ -H "Content-Type: application/json" \
+ -d '{"start_time": "5m ago", "end_time": "now", "fps": 1.0}'
+```
+
+Fields: `start_time`, `end_time` (or `frame_ids` array), `fps` (default 1.0). Max 10,000 frames.
+
+FPS guidelines: 5min→1.0, 30min→0.5, 1h→0.2, 2h+→0.1
+
+Returns `{"file_path": "...", "frame_count": N, "duration_secs": N}`. Show path as inline code block for playback.
+
+### Audio & ffmpeg
+
+Audio files from search results (`file_path`). Common operations:
+```bash
+ffmpeg -y -i /path/to/audio.mp4 -q:a 2 ~/.screenpipe/exports/output.mp3 # convert
+ffmpeg -y -i input.mp4 -ss 00:01:00 -to 00:05:00 -q:a 2 clip.mp3 # trim
+ffmpeg -y -i input.mp4 -filter:v "setpts=0.5*PTS" -an fast.mp4 # speed 2x
+ffmpeg -y -i input.mp4 -t 10 -vf "fps=10,scale=640:-1" output.gif # GIF
+```
+
+Always use `-y`, save to `~/.screenpipe/exports/`.
+
+---
+
+## 6. Retranscribe — `POST /audio/retranscribe`
+
+```bash
+curl -X POST http://localhost:3030/audio/retranscribe \
+ -H "Content-Type: application/json" \
+ -d '{"start": "1h ago", "end": "now"}'
+```
+
+Optional: `engine` (`whisper-large-v3-turbo`|`whisper-large-v3`|`deepgram`|`qwen3-asr`), `vocabulary` (array of `{"word": "...", "replacement": "..."}` for bias/replacement), `prompt` (topic context for Whisper).
+
+Keep ranges short (1h max). Show old vs new transcription.
+
+---
+
+## 7. Raw SQL — `POST /raw_sql`
+
+```bash
+curl -X POST http://localhost:3030/raw_sql \
+ -H "Content-Type: application/json" \
+ -d '{"query": "SELECT ... LIMIT 100"}'
+```
+
+**Rules**: Every SELECT needs LIMIT. Always filter by time. Read-only. Use `datetime('now', '-24 hours')` for time math.
+
+**WARNING**: Do NOT use frame counts for time estimates — frames are event-driven, not fixed-interval. Use `/activity-summary` for screen time.
+
+### Schema
+
+| Table | Key Columns | Time Column |
+|-------|-------------|-------------|
+| `frames` | `app_name`, `window_name`, `browser_url`, `focused` | `timestamp` |
+| `ocr_text` | `text`, `app_name`, `window_name` | join via `frame_id` |
+| `elements` | `source`, `role`, `text`, `bounds_*` | join via `frame_id` |
+| `audio_transcriptions` | `transcription`, `device`, `speaker_id`, `is_input_device` | `timestamp` |
+| `audio_chunks` | `file_path` | `timestamp` |
+| `speakers` | `name`, `metadata` | — |
+| `ui_events` | `event_type`, `app_name`, `window_title`, `browser_url` | `timestamp` |
+| `accessibility` | `app_name`, `window_name`, `text_content`, `browser_url` | `timestamp` |
+
+### Example Queries
+
+```sql
+-- Most used apps (last 24h)
+SELECT app_name, COUNT(*) as frames FROM frames
+WHERE timestamp > datetime('now', '-24 hours') AND app_name IS NOT NULL
+GROUP BY app_name ORDER BY frames DESC LIMIT 20
+
+-- Most visited domains
+SELECT CASE WHEN INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') > 0
+ THEN SUBSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), 1, INSTR(SUBSTR(browser_url, INSTR(browser_url, '://') + 3), '/') - 1)
+ ELSE SUBSTR(browser_url, INSTR(browser_url, '://') + 3) END as domain,
+COUNT(*) as visits FROM frames
+WHERE timestamp > datetime('now', '-24 hours') AND browser_url IS NOT NULL
+GROUP BY domain ORDER BY visits DESC LIMIT 20
+
+-- Speaker stats
+SELECT COALESCE(NULLIF(s.name, ''), 'Unknown') as speaker, COUNT(*) as segments
+FROM audio_transcriptions at LEFT JOIN speakers s ON at.speaker_id = s.id
+WHERE at.timestamp > datetime('now', '-24 hours')
+GROUP BY at.speaker_id ORDER BY segments DESC LIMIT 20
+
+-- Context switches per hour
+SELECT strftime('%H:00', timestamp) as hour, COUNT(*) as switches
+FROM ui_events WHERE event_type = 'app_switch' AND timestamp > datetime('now', '-24 hours')
+GROUP BY hour ORDER BY hour LIMIT 24
+```
+
+Common patterns: `GROUP BY date(timestamp)` (daily), `GROUP BY strftime('%H:00', timestamp)` (hourly), `HAVING frames > 5` (filter noise).
+
+---
+
+## 8. Connections — `GET /connections`
+
+```bash
+# List all integrations (Telegram, Slack, Discord, Email, Todoist, Teams)
+curl http://localhost:3030/connections
+
+# Get credentials for a connected service
+curl http://localhost:3030/connections/telegram
+```
+
+Returns credentials to use with service APIs directly:
+- **Telegram**: `bot_token` + `chat_id` → `POST https://api.telegram.org/bot{token}/sendMessage`
+- **Slack**: `webhook_url` → `POST {webhook_url}` with `{"text": "..."}`
+- **Discord**: `webhook_url` → `POST {webhook_url}` with `{"content": "..."}`
+- **Todoist**: `api_token` → `POST https://api.todoist.com/rest/v2/tasks` with Bearer auth
+- **Teams**: `webhook_url` → `POST {webhook_url}` with `{"text": "..."}`
+- **Email**: `smtp_host`, `smtp_port`, `smtp_user`, `smtp_pass`, `from_address`
+
+If not connected, tell user to set up in Settings > Connections.
+
+---
+
+## 9. Other Endpoints
+
+```bash
+curl http://localhost:3030/health # Health check
+curl http://localhost:3030/audio/list # Audio devices
+curl http://localhost:3030/vision/list # Monitors
+curl "http://localhost:3030/speakers/search?name=John" # Search speakers
+```
+
+---
+
+## Deep Links
+
+Reference specific moments with clickable links:
+
+```markdown
+[10:30 AM — Chrome](screenpipe://frame/12345) # OCR results (use frame_id)
+[meeting at 3pm](screenpipe://timeline?timestamp=ISO8601) # Audio results (use timestamp)
+```
+
+Only use IDs/timestamps from actual search results. Never fabricate.
+
+## Showing Videos
+
+Show `file_path` from search results as inline code for playable video:
+```
+`/Users/name/.screenpipe/data/monitor_1_2024-01-15_10-30-00.mp4`
+```
diff --git a/crates/screenpipe-core/assets/skills/screenpipe-cli/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-cli/SKILL.md
new file mode 100644
index 000000000..8385c8005
--- /dev/null
+++ b/crates/screenpipe-core/assets/skills/screenpipe-cli/SKILL.md
@@ -0,0 +1,120 @@
+---
+name: screenpipe-cli
+description: Manage screenpipe pipes (scheduled AI automations) and connections (Telegram, Slack, Discord, etc.) via the CLI. Use when the user asks to create, list, enable, disable, run, or debug pipes, or manage service connections from the command line.
+---
+
+# Screenpipe CLI
+
+Use `bunx screenpipe@latest` to run CLI commands (or `npx screenpipe@latest`). No separate install needed.
+
+## Shell
+
+- **macOS/Linux** → `bash`
+- **Windows** → `powershell`
+
+---
+
+## Pipe Management
+
+Pipes are markdown-based AI automations that run on schedule. Each pipe lives at `~/.screenpipe/pipes/<name>/pipe.md`.
+
+### Commands
+
+```bash
+bunx screenpipe@latest pipe list # List all pipes (compact table)
+bunx screenpipe@latest pipe enable <name> # Enable a pipe
+bunx screenpipe@latest pipe disable <name> # Disable a pipe
+bunx screenpipe@latest pipe run <name> # Run once immediately (for testing)
+bunx screenpipe@latest pipe logs <name> # View execution logs
+bunx screenpipe@latest pipe install <url-or-path> # Install from GitHub or local path
+bunx screenpipe@latest pipe delete <name> # Delete a pipe
+bunx screenpipe@latest pipe models list # View AI model presets
+```
+
+### Creating a Pipe
+
+Create `~/.screenpipe/pipes/<name>/pipe.md` with YAML frontmatter + prompt:
+
+```markdown
+---
+schedule: every 30m
+enabled: true
+preset: Oai
+---
+
+Your prompt instructions here. The AI agent executes this on schedule.
+
+## What to do
+
+1. Query screenpipe search API for recent activity
+2. Process results
+3. Output summary / send notification
+```
+
+**Schedule syntax**: `every 30m`, `every 1h`, `every day at 9am`, `every monday at 9am`, or cron: `*/30 * * * *`, `0 9 * * *`
+
+**Config fields**: `schedule`, `enabled` (bool), `preset` (AI preset name), `history` (bool — include previous output as context)
+
+Screenpipe prepends a context header with time range, timezone, OS, and API URL before each execution. No template variables needed.
+
+After creating:
+```bash
+bunx screenpipe@latest pipe install ~/.screenpipe/pipes/my-pipe
+bunx screenpipe@latest pipe enable my-pipe
+bunx screenpipe@latest pipe run my-pipe # test immediately
+```
+
+### Editing Config
+
+Edit frontmatter in `~/.screenpipe/pipes/<name>/pipe.md` directly, or use the API:
+
+```bash
+curl -X POST http://localhost:3030/pipes/<name>/config \
+ -H "Content-Type: application/json" \
+ -d '{"config": {"schedule": "every 1h", "enabled": true}}'
+```
+
+### Rules
+
+1. Use `pipe list` (not `--json`) — table output is compact
+2. Never dump full pipe JSON — can be 15MB+
+3. Check logs first when debugging: `pipe logs <name>`
+4. Use `pipe run <name>` to test before waiting for schedule
+
+---
+
+## Connection Management
+
+Manage integrations (Telegram, Slack, Discord, Email, Todoist, Teams) from the CLI.
+
+### Commands
+
+```bash
+bunx screenpipe@latest connection list # List all connections + status
+bunx screenpipe@latest connection list --json # JSON output
+bunx screenpipe@latest connection get <id> # Show saved credentials
+bunx screenpipe@latest connection get <id> --json # JSON output
+bunx screenpipe@latest connection set <id> key=val # Save credentials
+bunx screenpipe@latest connection test <id> # Test a connection
+bunx screenpipe@latest connection remove <id> # Remove credentials
+```
+
+### Examples
+
+```bash
+# Set up Telegram
+bunx screenpipe@latest connection set telegram bot_token=123456:ABC-DEF chat_id=5776185278
+
+# Set up Slack webhook
+bunx screenpipe@latest connection set slack webhook_url=https://hooks.slack.com/services/...
+
+# Verify it works
+bunx screenpipe@latest connection test telegram
+
+# Check what's connected
+bunx screenpipe@latest connection list
+```
+
+Connection IDs: `telegram`, `slack`, `discord`, `email`, `todoist`, `teams`, `google-calendar`, `apple-intelligence`, `openclaw`
+
+Credentials are stored locally at `~/.screenpipe/connections.json`.
diff --git a/crates/screenpipe-core/assets/skills/screenpipe-connections/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-connections/SKILL.md
deleted file mode 100644
index 29540e120..000000000
--- a/crates/screenpipe-core/assets/skills/screenpipe-connections/SKILL.md
+++ /dev/null
@@ -1,101 +0,0 @@
----
-name: screenpipe-connections
-description: Manage the user's connected integrations (Telegram, Slack, Discord, Email, Todoist, Teams). Use when the user wants to send messages, create tasks, or interact with any connected service. Query the connections API to discover which services are connected and get their credentials.
----
-
-# Screenpipe Connections
-
-The user can connect external services (Telegram, Slack, Discord, Email, Todoist, Microsoft Teams) through Screenpipe's connections system. Credentials are stored locally at `~/.screenpipe/connections.json`.
-
-The API runs at `http://localhost:3030/connections`.
-
-## List all connections
-
-```bash
-curl http://localhost:3030/connections
-```
-
-Returns all available integrations and whether they are connected:
-
-```json
-{
- "data": [
- { "id": "telegram", "name": "Telegram", "connected": true, ... },
- { "id": "slack", "name": "Slack", "connected": false, ... }
- ]
-}
-```
-
-## Get saved credentials for a connection
-
-```bash
-curl http://localhost:3030/connections/telegram
-```
-
-Returns:
-
-```json
-{
- "credentials": {
- "bot_token": "123456:ABC-DEF...",
- "chat_id": "5776185278"
- }
-}
-```
-
-## How to use connected services
-
-Once you have the credentials from the API, use them directly:
-
-### Telegram
-```bash
-BOT_TOKEN="<from credentials>"
-CHAT_ID="<from credentials>"
-curl -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
- -H "Content-Type: application/json" \
- -d "{\"chat_id\": \"${CHAT_ID}\", \"text\": \"Hello from Screenpipe!\"}"
-```
-
-### Slack
-```bash
-WEBHOOK_URL="<from credentials>"
-curl -X POST "$WEBHOOK_URL" \
- -H "Content-Type: application/json" \
- -d '{"text": "Hello from Screenpipe!"}'
-```
-
-### Discord
-```bash
-WEBHOOK_URL="<from credentials>"
-curl -X POST "$WEBHOOK_URL" \
- -H "Content-Type: application/json" \
- -d '{"content": "Hello from Screenpipe!"}'
-```
-
-### Email (SMTP)
-Credentials: `smtp_host`, `smtp_port`, `smtp_user`, `smtp_pass`, `from_address`.
-Use curl or a script to send via SMTP.
-
-### Todoist
-```bash
-API_TOKEN="<from credentials>"
-curl -X POST "https://api.todoist.com/rest/v2/tasks" \
- -H "Authorization: Bearer ${API_TOKEN}" \
- -H "Content-Type: application/json" \
- -d '{"content": "Task from Screenpipe"}'
-```
-
-### Microsoft Teams
-```bash
-WEBHOOK_URL="<from credentials>"
-curl -X POST "$WEBHOOK_URL" \
- -H "Content-Type: application/json" \
- -d '{"text": "Hello from Screenpipe!"}'
-```
-
-## Workflow
-
-1. First, call `GET /connections` to see which services are connected
-2. For any connected service, call `GET /connections/:id` to get credentials
-3. Use the credentials directly to interact with the service's API
-4. If a service is not connected, tell the user to connect it in Settings > Connections
diff --git a/crates/screenpipe-core/assets/skills/screenpipe-elements/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-elements/SKILL.md
deleted file mode 100644
index 90a72a939..000000000
--- a/crates/screenpipe-core/assets/skills/screenpipe-elements/SKILL.md
+++ /dev/null
@@ -1,178 +0,0 @@
----
-name: screenpipe-elements
-description: Query structured UI elements (accessibility tree nodes and OCR text blocks) captured from the user's screen. Use when the user asks about specific buttons, text fields, UI components, links, or needs precise structural information about what was on screen.
----
-
-# Screenpipe Elements
-
-Query structured UI elements captured from the user's screen. Screenpipe stores every accessibility tree node and OCR text block as an individual element with role, text, bounds, and hierarchy information.
-
-The API runs at `http://localhost:3030`.
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`, `curl`, `date -u -v-1H +%Y-%m-%dT%H:%M:%SZ`
-- **Windows** → `powershell`, `curl.exe` (not the alias), `(Get-Date).ToUniversalTime().AddHours(-1).ToString("yyyy-MM-ddTHH:mm:ssZ")`
-
-All examples below use bash. On Windows, adapt accordingly.
-
-## Endpoints
-
-### 1. Search Elements — `GET /elements`
-
-Lightweight FTS search across all elements. Returns ~100-500 bytes per element (vs 5-20KB per OCR item from `/search`).
-
-```bash
-curl "http://localhost:3030/elements?q=QUERY&start_time=ISO8601&end_time=ISO8601&limit=20"
-```
-
-#### Parameters
-
-| Parameter | Type | Required | Description |
-|-----------|------|----------|-------------|
-| `q` | string | No | Full-text search query across element text |
-| `frame_id` | integer | No | Filter to elements from a specific frame |
-| `source` | string | No | `accessibility` or `ocr` |
-| `role` | string | No | Filter by element role (e.g. `AXButton`, `AXStaticText`, `AXLink`, `line`) |
-| `start_time` | ISO 8601 or relative | **Recommended** | Start of time range. Accepts ISO 8601 or relative (`16h ago`, `2d ago`, `now`). |
-| `end_time` | ISO 8601 or relative | No | End of time range. Accepts ISO 8601 or relative (`now`, `1h ago`). |
-| `app_name` | string | No | Filter by app name |
-| `limit` | integer | No | Max results. Default: 50 |
-| `offset` | integer | No | Pagination offset. Default: 0 |
-
-#### Response
-
-```json
-{
- "data": [
- {
- "id": 12345,
- "frame_id": 6789,
- "source": "accessibility",
- "role": "AXButton",
- "text": "Submit",
- "parent_id": 12340,
- "depth": 3,
- "bounds": {"left": 0.5, "top": 0.8, "width": 0.1, "height": 0.05},
- "confidence": null,
- "sort_order": 15
- }
- ],
- "pagination": {"limit": 50, "offset": 0, "total": 142}
-}
-```
-
-### 2. Frame Elements — `GET /frames/{frame_id}/elements`
-
-Get the full element tree for a single frame. Returns all elements (accessibility nodes + OCR blocks) for that screenshot.
-
-```bash
-curl "http://localhost:3030/frames/6789/elements"
-curl "http://localhost:3030/frames/6789/elements?source=accessibility"
-```
-
-#### Parameters
-
-| Parameter | Type | Required | Description |
-|-----------|------|----------|-------------|
-| `source` | string | No | Filter: `accessibility` or `ocr` |
-
-#### Response
-
-Same shape as `/elements` but returns all elements for the frame (no pagination needed).
-
-### 3. Frame Context — `GET /frames/{frame_id}/context`
-
-Get accessibility text, parsed tree nodes, and extracted URLs for a frame. Falls back to OCR for legacy frames.
-
-```bash
-curl "http://localhost:3030/frames/6789/context"
-```
-
-#### Response
-
-```json
-{
- "frame_id": 6789,
- "text": "Full accessibility text...",
- "nodes": [
- {"role": "AXStaticText", "text": "Hello world", "depth": 2, "bounds": {"left": 0.1, "top": 0.2, "width": 0.3, "height": 0.04}}
- ],
- "urls": ["https://github.com/mediar-ai/screenpipe"],
- "text_source": "accessibility"
-}
-```
-
-## Element Sources and Roles
-
-### Sources
-
-| Source | Description |
-|--------|-------------|
-| `accessibility` | macOS accessibility tree nodes — structured, hierarchical, includes roles and bounds |
-| `ocr` | OCR text blocks — flat text with bounding boxes, used as fallback |
-
-### Common Accessibility Roles
-
-| Role | Description |
-|------|-------------|
-| `AXStaticText` | Static text label |
-| `AXButton` | Button element |
-| `AXLink` | Hyperlink |
-| `AXTextField` | Text input field |
-| `AXTextArea` | Multi-line text area |
-| `AXMenuItem` | Menu item |
-| `AXCheckBox` | Checkbox |
-| `AXImage` | Image element |
-| `AXGroup` | Container/group |
-| `AXWebArea` | Web content area |
-| `line` | OCR text line |
-| `paragraph` | OCR text paragraph |
-
-## When to Use Which Endpoint
-
-| Question | Endpoint |
-|----------|----------|
-| "What buttons were visible?" | `GET /elements?role=AXButton&start_time=...` |
-| "Find where I saw text X" | `GET /elements?q=X&start_time=...` |
-| "What was the full UI layout of that screen?" | `GET /frames/{frame_id}/elements` |
-| "What links/URLs were on that page?" | `GET /frames/{frame_id}/context` |
-| "What text was showing in app X?" | `GET /elements?source=accessibility&app_name=X&start_time=...` |
-
-## CRITICAL RULES
-
-1. **ALWAYS include `start_time`** — the elements table can have millions of rows. Queries without time bounds will be slow.
-2. **Prefer `/elements` over `/search` for targeted lookups** — elements are ~10x lighter (100-500 bytes each vs 5-20KB for OCR items).
-3. **Use `source=accessibility` for structured queries** — accessibility data has proper roles, hierarchy, and bounds. OCR is flat text.
-4. **Use `/frames/{id}/context` for URL extraction** — it parses link nodes and regex-scans for URLs automatically.
-5. **Start with short time ranges** — last 1-2 hours. Expand only if needed.
-6. **Protect your context window.** Element queries can return hundreds of results. Always write curl output to a file first (`curl ... -o /tmp/sp_result.json`), then check its size (`wc -c /tmp/sp_result.json`). If over 5KB, read only the first 50-100 lines to understand the structure, then extract what you need with `jq` or targeted reads. NEVER dump a full large API response into your context.
-
-## Example Workflows
-
-### Find a specific button the user clicked
-
-```bash
-# Step 1: Search for the button
-curl "http://localhost:3030/elements?q=Submit&role=AXButton&start_time=$(date -u -v-1H +%Y-%m-%dT%H:%M:%SZ)&limit=5"
-
-# Step 2: Get full context for that frame
-curl "http://localhost:3030/frames/6789/context"
-```
-
-### Find all URLs the user visited
-
-```bash
-# Step 1: Get frames from Chrome
-curl "http://localhost:3030/elements?role=AXLink&app_name=Google%20Chrome&start_time=$(date -u -v-2H +%Y-%m-%dT%H:%M:%SZ)&limit=20"
-
-# Step 2: For a specific frame, get all URLs
-curl "http://localhost:3030/frames/6789/context"
-```
-
-### Get text content from a specific app
-
-```bash
-# Accessibility text from VS Code in the last hour
-curl "http://localhost:3030/elements?source=accessibility&app_name=Code&role=AXStaticText&start_time=$(date -u -v-1H +%Y-%m-%dT%H:%M:%SZ)&limit=20"
-```
diff --git a/crates/screenpipe-core/assets/skills/screenpipe-media/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-media/SKILL.md
deleted file mode 100644
index f5cd6cabb..000000000
--- a/crates/screenpipe-core/assets/skills/screenpipe-media/SKILL.md
+++ /dev/null
@@ -1,181 +0,0 @@
----
-name: screenpipe-media
-description: Export videos, extract audio, and edit media clips from the user's Screenpipe recordings. Use when the user asks to export, download, clip, or create videos/audio from their screen recordings.
----
-
-# Screenpipe Media Export & Editing
-
-Export screen recordings as videos, extract audio, and perform media editing using the local Screenpipe API and ffmpeg.
-
-The API runs at `http://localhost:3030`.
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`, `curl`, `date -u -v-5M +%Y-%m-%dT%H:%M:%SZ`
-- **Windows** → `powershell`, `curl.exe` (not the alias), `(Get-Date).ToUniversalTime().AddMinutes(-5).ToString("yyyy-MM-ddTHH:mm:ssZ")`
-
-All examples below use bash. On Windows, adapt: use `powershell`, replace `curl` with `curl.exe`, replace `$(date …)` with the PowerShell equivalent, replace `~` with `$env:USERPROFILE`, replace `mkdir -p` with `New-Item -ItemType Directory -Force -Path`.
-
-## Video Export API
-
-### POST /frames/export
-
-Export a video from a time range or specific frame IDs.
-
-```bash
-curl -X POST http://localhost:3030/frames/export \
- -H "Content-Type: application/json" \
- -d '{
- "start_time": "2024-01-15T10:00:00Z",
- "end_time": "2024-01-15T10:30:00Z",
- "fps": 1.0
- }'
-```
-
-### Request Body
-
-| Field | Type | Required | Description |
-|-------|------|----------|-------------|
-| `start_time` | ISO 8601 or relative | No* | Start of time range. Accepts ISO 8601 or relative (`16h ago`, `30m ago`, `now`). |
-| `end_time` | ISO 8601 or relative | No* | End of time range. Accepts ISO 8601 or relative (`now`, `1h ago`). |
-| `frame_ids` | array of integers | No* | Specific frame IDs to export |
-| `fps` | float | No | Frames per second (default: 1.0) |
-
-*Provide either `start_time` + `end_time` OR `frame_ids`.
-
-### Response
-
-```json
-{
- "file_path": "/Users/name/.screenpipe/exports/screenpipe_export_20240115_103000.mp4",
- "frame_count": 120,
- "duration_secs": 120.0,
- "file_size_bytes": 5242880
-}
-```
-
-### CRITICAL RULES
-
-1. **Start with short time ranges** (5-15 minutes). Long exports take time and may hit the 10,000 frame limit.
-2. **Use low fps** for long recordings: 0.5 fps for 30+ minutes, 0.2 fps for hours.
-3. **Maximum 10,000 frames** per export. If exceeded, narrow the time range or lower fps.
-4. All exports are saved to `~/.screenpipe/exports/`.
-
-### FPS Guidelines
-
-| Time Range | Recommended FPS | Approx Frames |
-|-----------|----------------|---------------|
-| 5 minutes | 1.0 | ~300 |
-| 15 minutes | 1.0 | ~900 |
-| 30 minutes | 0.5 | ~900 |
-| 1 hour | 0.2 | ~720 |
-| 2+ hours | 0.1 | ~720 |
-
-### Example Exports
-
-```bash
-# Last 5 minutes
-curl -X POST http://localhost:3030/frames/export \
- -H "Content-Type: application/json" \
- -d "{\"start_time\": \"$(date -u -v-5M +%Y-%m-%dT%H:%M:%SZ)\", \"end_time\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\", \"fps\": 1.0}"
-
-# Last 30 minutes at lower fps
-curl -X POST http://localhost:3030/frames/export \
- -H "Content-Type: application/json" \
- -d "{\"start_time\": \"$(date -u -v-30M +%Y-%m-%dT%H:%M:%SZ)\", \"end_time\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\", \"fps\": 0.5}"
-
-# Specific frame IDs from search results
-curl -X POST http://localhost:3030/frames/export \
- -H "Content-Type: application/json" \
- -d '{"frame_ids": [12345, 12346, 12347, 12348], "fps": 1.0}'
-```
-
-## Showing Exported Videos
-
-After exporting, show the file path in an inline code block so it renders as a playable video in the chat:
-
-```
-`/Users/name/.screenpipe/exports/screenpipe_export_20240115_103000.mp4`
-```
-
-Do NOT use markdown links or multi-line code blocks for videos.
-
-## Audio Export
-
-Screenpipe stores audio as MP4 files. To extract audio from recordings:
-
-### Step 1: Find audio files via search
-
-```bash
-curl "http://localhost:3030/search?content_type=audio&limit=10&start_time=$(date -u -v-1H +%Y-%m-%dT%H:%M:%SZ)"
-```
-
-Each audio result has a `file_path` pointing to the audio MP4 file.
-
-### Step 2: Convert or extract audio with ffmpeg
-
-```bash
-# Convert audio MP4 to MP3
-ffmpeg -y -i /path/to/audio.mp4 -q:a 2 ~/.screenpipe/exports/output.mp3
-
-# Extract audio from a time range within a file
-ffmpeg -y -i /path/to/audio.mp4 -ss 00:01:00 -to 00:05:00 -q:a 2 ~/.screenpipe/exports/clip.mp3
-
-# Concatenate multiple audio files
-printf "file '%s'\n" /path/to/audio1.mp4 /path/to/audio2.mp4 > /tmp/audiolist.txt
-ffmpeg -y -f concat -safe 0 -i /tmp/audiolist.txt -c copy ~/.screenpipe/exports/combined.mp4
-```
-
-## Video Editing with ffmpeg
-
-After exporting a video, use ffmpeg for editing:
-
-```bash
-# Trim a video (start at 10s, duration 30s)
-ffmpeg -y -i ~/.screenpipe/exports/input.mp4 -ss 00:00:10 -t 00:00:30 -c copy ~/.screenpipe/exports/trimmed.mp4
-
-# Speed up 2x
-ffmpeg -y -i ~/.screenpipe/exports/input.mp4 -filter:v "setpts=0.5*PTS" -an ~/.screenpipe/exports/fast.mp4
-
-# Create a GIF (first 10 seconds, 10fps, 640px wide)
-ffmpeg -y -i ~/.screenpipe/exports/input.mp4 -t 10 -vf "fps=10,scale=640:-1" ~/.screenpipe/exports/output.gif
-
-# Extract audio from video
-ffmpeg -y -i ~/.screenpipe/exports/input.mp4 -vn -q:a 2 ~/.screenpipe/exports/audio.mp3
-
-# Merge video and audio
-ffmpeg -y -i ~/.screenpipe/exports/video.mp4 -i ~/.screenpipe/exports/audio.mp3 -c:v copy -c:a aac ~/.screenpipe/exports/merged.mp4
-
-# Add subtitles (SRT file)
-ffmpeg -y -i ~/.screenpipe/exports/input.mp4 -vf subtitles=subs.srt ~/.screenpipe/exports/subtitled.mp4
-```
-
-## Rules
-
-1. **Always use `-y` flag** with ffmpeg to overwrite without prompting.
-2. **Always save to `~/.screenpipe/exports/`** — create the directory first with `mkdir -p ~/.screenpipe/exports/`.
-3. **Start with short time ranges** when the user says "recent" or "last few minutes".
-4. **Show the output file path** in an inline code block after every export so the user can view/play it.
-5. **Combine search + export** for targeted clips: search to find the right time range, then export that range.
-
-## Workflow Examples
-
-### "Export a video of the last 5 minutes"
-1. Call POST /frames/export with start_time = 5 min ago, end_time = now, fps = 1.0
-2. Show the returned file_path as inline code
-
-### "Extract audio from my last meeting"
-1. Search for audio content: `curl "http://localhost:3030/search?content_type=audio&limit=20&start_time=..."`
-2. Identify the meeting's audio files from results
-3. Use ffmpeg to concat/convert the audio files
-4. Show the output path as inline code
-
-### "Make a timelapse of my work today"
-1. Call POST /frames/export with start_time = midnight, end_time = now, fps = 0.1
-2. Optionally speed up with ffmpeg: `ffmpeg -y -i input.mp4 -filter:v "setpts=0.25*PTS" -an output.mp4`
-3. Show the final file path
-
-### "Create a GIF of what I was just doing"
-1. Export last 30 seconds at 2 fps
-2. Convert to GIF: `ffmpeg -y -i input.mp4 -vf "fps=10,scale=640:-1" output.gif`
-3. Show the GIF path
diff --git a/crates/screenpipe-core/assets/skills/screenpipe-pipe-creator/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-pipe-creator/SKILL.md
deleted file mode 100644
index cc4369a56..000000000
--- a/crates/screenpipe-core/assets/skills/screenpipe-pipe-creator/SKILL.md
+++ /dev/null
@@ -1,130 +0,0 @@
----
-name: screenpipe-pipe-creator
-description: Create, install, and manage screenpipe pipes — scheduled AI agents that run automatically on a cron schedule. Use when the user asks to create a pipe, schedule a prompt, automate a task, set up recurring summaries, or turn a chat into a pipe.
----
-
-# Screenpipe Pipe Creator
-
-Create scheduled AI agents ("pipes") that run automatically on your local machine.
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`, `curl`, paths use `~/`
-- **Windows** → `powershell`, `curl.exe`, paths use `$env:USERPROFILE\`
-
-All examples below use bash. On Windows, adapt: use `powershell`, replace `curl` with `curl.exe`, replace `$(date …)` with PowerShell equivalent, replace `~` with `$env:USERPROFILE`. `bunx` works the same in PowerShell.
-
-## What is a pipe?
-
-A pipe is a scheduled AI agent defined as a single markdown file: `~/.screenpipe/pipes/{name}/pipe.md`
-
-Every N minutes, screenpipe runs a coding agent (like pi or claude-code) with the pipe's prompt. The agent can query your screen data, write files, call external APIs, send notifications, etc.
-
-## pipe.md format
-
-The file starts with YAML frontmatter, then the prompt body:
-
-```
----
-schedule: every 30m
-enabled: true
----
-
-Your prompt instructions here...
-```
-
-### Schedule syntax
-
-Use natural language in the `schedule` field:
-- `every 30m` — every 30 minutes
-- `every 1h` — every hour
-- `every day at 9am` — daily at 9 AM
-- `every day at 6pm` — daily at 6 PM
-- `every monday at 9am` — weekly on Monday at 9 AM
-
-Or use cron syntax:
-- `0 9 * * *` — every day at 9 AM
-- `0 */2 * * *` — every 2 hours
-- `*/30 * * * *` — every 30 minutes
-
-## Context header
-
-Before execution, screenpipe prepends a context header to the prompt with:
-- Time range (start/end timestamps based on the schedule interval)
-- Current date
-- User's timezone
-- OS (windows, macos, linux)
-- Screenpipe API base URL (`http://localhost:3030`)
-- Output directory
-
-The AI agent uses this context to query the right time range. No template variables needed in the prompt.
-
-## Screenpipe search API
-
-The agent queries screen data via the local REST API:
-
-```bash
-curl "http://localhost:3030/search?limit=20&content_type=all&start_time=<ISO8601>&end_time=<ISO8601>"
-```
-
-### Query parameters
-- `q`: text search query (optional)
-- `content_type`: `"all"` | `"ocr"` | `"audio"` | `"input"` | `"accessibility"`
-- `limit`: max results (default 20)
-- `offset`: pagination offset
-- `start_time` / `end_time`: ISO 8601 timestamps (ALWAYS include start_time)
-- `app_name`: filter by app (e.g. "chrome", "cursor")
-- `window_name`: filter by window title
-- `browser_url`: filter by URL (e.g. "github.com")
-- `min_length` / `max_length`: filter by text length
-- `speaker_ids`: filter audio by speaker IDs
-
-### Raw SQL for aggregation
-```bash
-curl -X POST http://localhost:3030/raw_sql -H "Content-Type: application/json" \
- -d '{"query": "SELECT app_name, COUNT(*) as count FROM frames WHERE timestamp > datetime(\"now\", \"-24 hours\") GROUP BY app_name ORDER BY count DESC"}'
-```
-
-## After creating the file
-
-IMPORTANT: Always use `bunx screenpipe@latest` (not `bunx screenpipe` or `screenpipe`) to ensure the latest CLI version:
-
-```bash
-# Install the pipe
-bunx screenpipe@latest pipe install ~/.screenpipe/pipes/my-pipe
-
-# Enable it
-bunx screenpipe@latest pipe enable my-pipe
-
-# Test it immediately (run once without waiting for schedule)
-bunx screenpipe@latest pipe run my-pipe
-```
-
-## Important formatting rules
-
-- The pipe.md file MUST start with `---` on the very first line (YAML front-matter). No blank lines or comments before it.
-- Keep prompts clear and specific about what data to query and what to do with results.
-- For daily summaries, query the last 24h. For hourly tasks, query the last 1h.
-- Common output actions: desktop notifications, writing to files, calling webhooks.
-
-## Example pipes
-
-### Daily standup summary
-```
----
-schedule: every day at 9am
-enabled: true
----
-
-Search my screen and audio recordings from the last 24 hours. Summarize what I worked on, group by project/app, and highlight any meetings or important conversations. Send the summary as a desktop notification.
-```
-
-### Hourly focus tracker
-```
----
-schedule: every 1h
-enabled: true
----
-
-Search my screen recordings from the last hour. Calculate how much time I spent in each app. If I spent more than 20 minutes on social media or news sites, send a desktop notification reminding me to stay focused.
-```
diff --git a/crates/screenpipe-core/assets/skills/screenpipe-pipes/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-pipes/SKILL.md
deleted file mode 100644
index 551d87af0..000000000
--- a/crates/screenpipe-core/assets/skills/screenpipe-pipes/SKILL.md
+++ /dev/null
@@ -1,164 +0,0 @@
----
-name: screenpipe-pipes
-description: Manage screenpipe pipes — list, enable, disable, run, install, delete, view logs, and edit config. Use when the user asks about their pipes, automations, scheduled tasks, or wants to create/modify pipes.
----
-
-# Screenpipe Pipe Management
-
-Pipes are markdown-based automations that run on schedule or on-demand. Each pipe lives at `~/.screenpipe/pipes/<name>/pipe.md`.
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`
-- **Windows** → `powershell`
-
-## CLI Commands
-
-Use `bunx screenpipe@latest` to run CLI commands. Users don't install the CLI separately — `bunx` fetches it on-the-fly.
-
-### List all pipes
-
-```bash
-bunx screenpipe@latest pipe list
-```
-
-Output:
-```
-NAME ENABLED SCHEDULE LAST RUN
---------------------------------------------------------------
-obsidian-sync running */30 * * * 2026-03-06 15:40
-meeting-sync yes */10 * * * 2026-03-06 15:50
-daily-logs no never
-```
-
-For full JSON (large output — avoid unless you need specific fields):
-```bash
-bunx screenpipe@latest pipe list --json
-```
-
-### Enable / Disable a pipe
-
-```bash
-bunx screenpipe@latest pipe enable <name>
-bunx screenpipe@latest pipe disable <name>
-```
-
-### Run a pipe once immediately
-
-```bash
-bunx screenpipe@latest pipe run <name>
-```
-
-Returns stdout/stderr and success status.
-
-### View pipe logs
-
-```bash
-bunx screenpipe@latest pipe logs <name>
-```
-
-Output:
-```
-2026-03-06 15:40:00 ✓ (12s)
-2026-03-06 15:10:00 ✓ (8s)
-2026-03-06 14:40:00 ✗ (3s) — connection refused
-```
-
-### Install a pipe
-
-```bash
-# From URL (GitHub raw or pipe store)
-bunx screenpipe@latest pipe install https://github.com/user/repo/blob/main/pipe.md
-
-# From local path
-bunx screenpipe@latest pipe install /path/to/pipe.md
-bunx screenpipe@latest pipe install ./my-pipe/
-```
-
-### Delete a pipe
-
-```bash
-bunx screenpipe@latest pipe delete <name>
-```
-
-### View AI model presets
-
-```bash
-bunx screenpipe@latest pipe models list
-```
-
-## Editing Pipe Config
-
-Each pipe's config is in the YAML frontmatter of `~/.screenpipe/pipes/<name>/pipe.md`:
-
-```yaml
----
-schedule: every 30m
-enabled: true
-preset: Oai
-history: true
----
-```
-
-### Config fields
-
-| Field | Type | Description |
-|-------|------|-------------|
-| `schedule` | cron or shorthand | When to run: `*/10 * * * *`, `every 30m`, `every 2h`, `daily 9:00` |
-| `enabled` | bool | Whether the pipe runs on schedule |
-| `preset` | string | AI preset name (e.g., `Oai`, `Screenpipe`) — matches presets from Settings |
-| `history` | bool | Whether to include previous execution output as context |
-
-To update config, edit the frontmatter directly:
-
-```bash
-# Read current config
-head -20 ~/.screenpipe/pipes/<name>/pipe.md
-
-# Edit with sed (example: change schedule)
-sed -i '' 's/^schedule:.*/schedule: every 1h/' ~/.screenpipe/pipes/<name>/pipe.md
-```
-
-Or use the API for programmatic config updates:
-
-```bash
-curl -X POST http://localhost:3030/pipes/<name>/config \
- -H "Content-Type: application/json" \
- -d '{"config": {"schedule": "every 1h", "enabled": true}}'
-```
-
-## Creating a New Pipe
-
-Create a directory with a `pipe.md` file:
-
-```bash
-mkdir -p ~/.screenpipe/pipes/my-pipe
-cat > ~/.screenpipe/pipes/my-pipe/pipe.md << 'PIPE'
----
-schedule: every 1h
-enabled: true
-preset: Oai
----
-
-Your task description here. The AI will execute this as instructions.
-
-## What to do
-
-1. Query screenpipe search API for recent activity
-2. Process the results
-3. Output a summary
-PIPE
-```
-
-Then enable it:
-```bash
-bunx screenpipe@latest pipe enable my-pipe
-```
-
-## Rules
-
-1. **Always use `bunx screenpipe@latest pipe list` (not `--json`)** to check pipe status — the table output is compact and sufficient.
-2. **Never dump full pipe JSON** to the conversation — it can be 15MB+ and will exceed model limits.
-3. **Edit pipe.md frontmatter** for config changes rather than using the API when possible — it's simpler and the file is the source of truth.
-4. **Check logs first** when debugging a pipe: `bunx screenpipe@latest pipe logs <name>`.
-5. **Use `bunx screenpipe@latest pipe run <name>`** to test changes immediately instead of waiting for the schedule.
diff --git a/crates/screenpipe-core/assets/skills/screenpipe-retranscribe/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-retranscribe/SKILL.md
deleted file mode 100644
index 4e5aa4a4d..000000000
--- a/crates/screenpipe-core/assets/skills/screenpipe-retranscribe/SKILL.md
+++ /dev/null
@@ -1,168 +0,0 @@
----
-name: screenpipe-retranscribe
-description: Re-transcribe audio recordings with a different engine, custom vocabulary, or prompt. Use when the user wants to improve transcription quality, fix bad transcriptions, or re-process audio from a specific time range.
----
-
-# Screenpipe Retranscribe
-
-Re-transcribe existing audio recordings stored in Screenpipe. Useful when transcriptions are poor quality, the wrong language was used, or the user wants to try a different STT engine.
-
-The API runs at `http://localhost:3030`.
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`, `curl`, `date -u -v-1H +%Y-%m-%dT%H:%M:%SZ`
-- **Windows** → `powershell`, `curl.exe` (not the alias), `(Get-Date).ToUniversalTime().AddHours(-1).ToString("yyyy-MM-ddTHH:mm:ssZ")`
-
-All examples below use bash. On Windows, adapt accordingly.
-
-## Retranscribe API
-
-```bash
-curl -X POST http://localhost:3030/audio/retranscribe \
- -H "Content-Type: application/json" \
- -d '{
- "start": "2024-01-15T10:00:00Z",
- "end": "2024-01-15T11:00:00Z"
- }'
-```
-
-### Parameters
-
-| Parameter | Type | Required | Description |
-|-----------|------|----------|-------------|
-| `start` | ISO 8601 or relative | **Yes** | Start of time range to retranscribe. Accepts ISO 8601 or relative (`1h ago`, `2d ago`). |
-| `end` | ISO 8601 or relative | **Yes** | End of time range to retranscribe. Accepts ISO 8601 or relative (`now`, `30m ago`). |
-| `engine` | string | No | STT engine override (see engines below) |
-| `vocabulary` | array | No | Custom vocabulary entries for word bias |
-| `prompt` | string | No | Custom prompt to guide Whisper transcription (becomes initial_prompt) |
-
-### Supported Engines
-
-| Engine | Value | Notes |
-|--------|-------|-------|
-| Whisper Large V3 Turbo | `whisper-large-v3-turbo` | Default, runs locally |
-| Whisper Large V3 | `whisper-large-v3` | Higher quality, slower |
-| Deepgram | `deepgram` | Cloud API, requires API key |
-| Qwen3 ASR | `qwen3-asr` | Alternative local engine |
-
-If `engine` is omitted, the currently configured engine is used.
-
-### Vocabulary Format
-
-Custom vocabulary biases transcription toward specific words or replaces misheard words:
-
-```json
-{
- "vocabulary": [
- {"word": "Screenpipe"},
- {"word": "Kubernetes", "replacement": null},
- {"word": "K8s", "replacement": "Kubernetes"}
- ]
-}
-```
-
-### Response Format
-
-```json
-{
- "chunks_processed": 3,
- "transcriptions": [
- {
- "audio_chunk_id": 456,
- "old_text": "previous bad transcription",
- "new_text": "corrected transcription text"
- }
- ]
-}
-```
-
-## CRITICAL RULES
-
-1. **Always ask the user for a time range** — both `start` and `end` are required.
-2. **Keep time ranges short** — retranscription processes every audio chunk in the range. Start with 1 hour max. Large ranges (e.g. a full day) will take a long time.
-3. **"last meeting"** = search audio first to find the meeting time range, then retranscribe that range.
-4. **Show before/after** — always show the user the old vs new transcription so they can verify improvement.
-5. **Suggest vocabulary** — if the user mentions specific names, terms, or jargon that were transcribed wrong, add them as vocabulary entries.
-
-## Example Workflows
-
-### Fix bad transcription from last hour
-
-```bash
-curl -X POST http://localhost:3030/audio/retranscribe \
- -H "Content-Type: application/json" \
- -d "{
- \"start\": \"$(date -u -v-1H +%Y-%m-%dT%H:%M:%SZ)\",
- \"end\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"
- }"
-```
-
-### Retranscribe with custom vocabulary
-
-```bash
-curl -X POST http://localhost:3030/audio/retranscribe \
- -H "Content-Type: application/json" \
- -d "{
- \"start\": \"2024-01-15T14:00:00Z\",
- \"end\": \"2024-01-15T15:00:00Z\",
- \"vocabulary\": [
- {\"word\": \"Screenpipe\"},
- {\"word\": \"PostHog\"},
- {\"word\": \"Supabase\"}
- ]
- }"
-```
-
-### Retranscribe with a different engine
-
-```bash
-curl -X POST http://localhost:3030/audio/retranscribe \
- -H "Content-Type: application/json" \
- -d "{
- \"start\": \"2024-01-15T09:00:00Z\",
- \"end\": \"2024-01-15T10:00:00Z\",
- \"engine\": \"whisper-large-v3\"
- }"
-```
-
-### Retranscribe with a guiding prompt
-
-Use a prompt to tell Whisper what the audio is about — this improves accuracy for domain-specific content:
-
-```bash
-curl -X POST http://localhost:3030/audio/retranscribe \
- -H "Content-Type: application/json" \
- -d "{
- \"start\": \"2024-01-15T14:00:00Z\",
- \"end\": \"2024-01-15T15:00:00Z\",
- \"prompt\": \"Discussion about Kubernetes deployment, CI/CD pipelines, and Docker containers\"
- }"
-```
-
-### Find a meeting, then retranscribe it
-
-Combine with the search skill to find the right time range first:
-
-```bash
-# 1. Search for audio from the meeting
-curl "http://localhost:3030/search?content_type=audio&limit=5&start_time=$(date -u -v-8H +%Y-%m-%dT%H:%M:%SZ)"
-
-# 2. Note the timestamps of the first and last audio chunks
-# 3. Retranscribe that exact range
-curl -X POST http://localhost:3030/audio/retranscribe \
- -H "Content-Type: application/json" \
- -d '{
- "start": "2024-01-15T14:00:00Z",
- "end": "2024-01-15T14:45:00Z",
- "vocabulary": [{"word": "ProjectName"}]
- }'
-```
-
-## Tips
-
-- Retranscription replaces the existing transcription in the database. The old text is returned in `old_text` for comparison.
-- Each audio chunk is ~30 seconds. A 1-hour range processes ~120 chunks.
-- If the user says transcription quality is bad, suggest adding vocabulary entries for names and technical terms.
-- Whisper's `prompt` parameter works best with short context about the topic, not full instructions.
-- If no chunks are found in the range, `chunks_processed` will be 0 — the user may need to adjust the time range.
diff --git a/crates/screenpipe-core/assets/skills/screenpipe-search/SKILL.md b/crates/screenpipe-core/assets/skills/screenpipe-search/SKILL.md
deleted file mode 100644
index e0bdd3a4c..000000000
--- a/crates/screenpipe-core/assets/skills/screenpipe-search/SKILL.md
+++ /dev/null
@@ -1,311 +0,0 @@
----
-name: screenpipe-search
-description: Search the user's screen recordings, audio transcriptions, and UI interactions via the local Screenpipe API at localhost:3030. Use when the user asks about their screen activity, meetings, apps they used, what they saw/heard, or anything about their computer usage history.
----
-
-# Screenpipe Search
-
-Search the user's locally-recorded screen and audio data. Screenpipe continuously captures screen text (OCR), audio transcriptions, and UI events (clicks, keystrokes, app switches).
-
-The API runs at `http://localhost:3030`.
-
-Full API reference (60+ endpoints): https://docs.screenpi.pe/llms-full.txt
-
-## Shell: pick the right one for the OS
-
-- **macOS/Linux** → `bash`, `curl`, `date -u -v-1H +%Y-%m-%dT%H:%M:%SZ`
-- **Windows** → `powershell`, `curl.exe` (not the alias), `(Get-Date).ToUniversalTime().AddHours(-1).ToString("yyyy-MM-ddTHH:mm:ssZ")`
-
-All examples below use bash. On Windows, adapt: use `powershell`, replace `curl` with `curl.exe`, replace `$(date …)` with the PowerShell equivalent, replace `/tmp/` with `$env:TEMP\`, replace `~` with `$env:USERPROFILE`.
-
-## Search API
-
-```bash
-curl "http://localhost:3030/search?q=QUERY&content_type=all&limit=10&start_time=ISO8601&end_time=ISO8601"
-```
-
-### Parameters
-
-| Parameter | Type | Required | Description |
-|-----------|------|----------|-------------|
-| `q` | string | No | Search keywords. Be specific. Do NOT use for audio/meeting searches — transcriptions are noisy, q filters too aggressively. |
-| `content_type` | string | No | `all` (default), `ocr`, `audio` (use for meetings/calls), `input`, `accessibility` |
-| `limit` | integer | No | Max results 1-20. Default: 10 |
-| `offset` | integer | No | Pagination offset. Default: 0 |
-| `start_time` | ISO 8601 or relative | **Yes** | Start of time range. ALWAYS include this. Accepts ISO 8601 (`2024-01-15T10:00:00Z`) or relative (`16h ago`, `2d ago`, `30m ago`). |
-| `end_time` | ISO 8601 or relative | No | End of time range. Defaults to now. Accepts ISO 8601 or relative (`now`, `1h ago`). |
-| `app_name` | string | No | Filter by app (e.g. "Google Chrome", "Slack", "zoom.us", "Code") |
-| `window_name` | string | No | Filter by window title substring |
-| `speaker_name` | string | No | Filter audio by speaker name (case-insensitive partial match) |
-| `focused` | boolean | No | Only return results from focused windows |
-| `max_content_length` | integer | No | Truncate each result's text/transcription to this many characters (middle-truncation). Useful for limiting token usage. |
-
-### Content Types
-
-- `ocr` — Screen text captured via OCR
-- `audio` — Audio transcriptions (meetings, voice)
-- `input` — UI events: clicks, keystrokes, clipboard, app switches
-- `accessibility` — Accessibility tree text
-- `all` — OCR + Audio + Accessibility (default)
-
-### Progressive Disclosure Strategy
-
-Don't jump straight to heavy `/search` calls. Escalate through these steps, stopping as soon as you have enough info:
-
-| Step | Endpoint | Tokens | When to use |
-|------|----------|--------|-------------|
-| 1. **Activity Summary** | `GET /activity-summary?start_time=...&end_time=...` | ~200 | Start here for broad questions ("what was I doing?", "summarize my day") |
-| 2. **Narrow with /search** | `GET /search?...` | ~500-1000 | When you need specific content from step 1's context |
-| 3. **Drill into elements** | `GET /elements?...` or `GET /frames/{id}/context` | ~200 each | For structural detail (buttons, links, UI layout) |
-| 4. **Screenshots** | `GET /frames/{frame_id}` | ~1500 each | Only when text isn't enough (charts, images, visual layout) |
-
-#### Decision tree
-
-- "What was I doing?" → Step 1 only
-- "What did I work on in Chrome?" → Step 1 (identify Chrome usage) → Step 2 (search Chrome content)
-- "Summarize my meeting/call" → Step 2 directly with `content_type=audio`, NO q param
-- "How long did I spend on X?" → Step 1 (`/activity-summary` has accurate `active_minutes`)
-- "Which apps did I use today?" → Step 1 (`/activity-summary` — do NOT use frame counts or SQL)
-- "What button did I click?" → Step 1 (context) → Step 3 (elements with role=AXButton)
-- "Show me what I was looking at" → Step 1 → Step 2 (find frame_id) → Step 4 (fetch screenshot)
-- "What URLs did I visit?" → Step 1 (identify browser) → Step 3 (`/frames/{id}/context` for URLs)
-
-#### Common mistakes to avoid
-- Do NOT use raw frame counts or SQL `COUNT(*)` on frames table to estimate time spent — it's wildly inaccurate. Use `/activity-summary` which calculates actual active session time.
-- Do NOT use the `q` param when searching audio/meetings — transcriptions have noise/typos that cause q to miss relevant content. Search by time range and content_type=audio, then scan results.
-- Do NOT ask the user for clarification when their intent is clear. "Summarize my meeting" → search audio immediately. "What apps today?" → call activity-summary immediately.
-
-### CRITICAL RULES
-
-1. **ALWAYS include `start_time`** — the database has hundreds of thousands of entries. Queries without time bounds WILL timeout.
-2. **Start with short time ranges** — default to last 1-2 hours. Only expand if no results found.
-3. **Use `app_name` filter** whenever the user mentions a specific app.
-4. **Keep `limit` low** (5-10) initially. Only increase if the user needs more.
-5. **"recent"** = last 30 minutes. **"today"** = since midnight. **"yesterday"** = yesterday's date range.
-6. If a search times out, retry with a narrower time range (e.g. 30 mins instead of 2 hours).
-7. **Prefer lightweight endpoints first** — use `/activity-summary` before `/search`, and `/elements` before fetching full frames.
-8. **Protect your context window.** API responses can be large. Always write curl output to a file first (`curl ... -o /tmp/sp_result.json`), then check its size (`wc -c /tmp/sp_result.json`). If over 5KB, read only the first 50-100 lines to understand the structure, then extract what you need with `jq` or targeted reads. NEVER dump a full large API response into your context.
-
-### Example Searches
-
-```bash
-# What happened in the last hour (relative time)
-curl "http://localhost:3030/search?content_type=all&limit=10&start_time=1h%20ago&end_time=now"
-
-# Slack messages today
-curl "http://localhost:3030/search?app_name=Slack&content_type=ocr&limit=10&start_time=$(date -u +%Y-%m-%dT00:00:00Z)"
-
-# Audio transcriptions from meetings (relative time)
-curl "http://localhost:3030/search?content_type=audio&limit=5&start_time=4h%20ago"
-
-# What a specific person said
-curl "http://localhost:3030/search?content_type=audio&speaker_name=John&limit=10&start_time=24h%20ago"
-
-# Browser activity
-curl "http://localhost:3030/search?app_name=Google%20Chrome&content_type=ocr&limit=10&start_time=2h%20ago"
-```
-
-> **Tip:** The API supports relative time strings like `16h ago`, `2d ago`, `30m ago`, `1w ago`, and `now` for `start_time` and `end_time`. No need to compute ISO timestamps with shell commands.
-
-### Response Format
-
-```json
-{
- "data": [
- {
- "type": "OCR",
- "content": {
- "frame_id": 12345,
- "text": "screen text captured...",
- "timestamp": "2024-01-15T10:30:00Z",
- "file_path": "/path/to/video.mp4",
- "offset_index": 42,
- "app_name": "Google Chrome",
- "window_name": "GitHub - screenpipe",
- "tags": [],
- "frame": null
- }
- },
- {
- "type": "Audio",
- "content": {
- "chunk_id": 678,
- "transcription": "what they said...",
- "timestamp": "2024-01-15T10:31:00Z",
- "file_path": "/path/to/audio.mp4",
- "offset_index": 5,
- "tags": [],
- "speaker": {
- "id": 1,
- "name": "John",
- "metadata": ""
- }
- }
- },
- {
- "type": "UI",
- "content": {
- "id": 999,
- "text": "Clicked button 'Submit'",
- "timestamp": "2024-01-15T10:32:00Z",
- "app_name": "Safari",
- "window_name": "Forms",
- "initial_traversal_at": null
- }
- }
- ],
- "pagination": {
- "limit": 10,
- "offset": 0,
- "total": 42
- }
-}
-```
-
-## Fetching Frames (Screenshots)
-
-You can fetch actual screenshot frames from search results. Each OCR result has a `frame_id`.
-
-```bash
-curl -o /tmp/frame.png "http://localhost:3030/frames/{frame_id}"
-```
-
-This returns the raw PNG image. Use the `read` tool to view it (pi supports images).
-
-### When to fetch frames
-- When the user asks "show me what I was looking at" or "what was on screen"
-- When you need visual context to answer a question (e.g. UI layout, charts, design)
-- When OCR text is ambiguous and you need to see the actual screen
-
-### CRITICAL: Token budget for frames
-- Each frame is ~1000-2000 tokens when sent to the LLM
-- **NEVER fetch more than 2-3 frames per query** — it's expensive and slow
-- Prefer using OCR text from search results first. Only fetch frames when text isn't enough.
-- If the user asks about many moments, summarize from OCR text and only fetch 1-2 key frames.
-
-### Example workflow
-```bash
-# 1. Search for relevant content
-curl "http://localhost:3030/search?q=dashboard&app_name=Chrome&content_type=ocr&limit=5&start_time=2024-01-15T10:00:00Z"
-
-# 2. Pick the most relevant frame_id from results
-# 3. Fetch that specific frame
-curl -o /tmp/frame_12345.png "http://localhost:3030/frames/12345"
-
-# 4. Read/view the image
-```
-
-## Other Useful Endpoints
-
-### Activity Summary (lightweight overview)
-```bash
-curl "http://localhost:3030/activity-summary?start_time=1h%20ago&end_time=now"
-```
-Returns app usage (with active session minutes, first/last seen times), recent texts, and audio summary in ~200-500 tokens. Great starting point before deeper searches.
-
-### Elements Search (structured UI data)
-```bash
-curl "http://localhost:3030/elements?q=Submit&role=AXButton&start_time=1h%20ago&limit=10"
-```
-Returns individual UI elements (~100-500 bytes each) — much lighter than `/search` for targeted lookups.
-
-### Frame Context (accessibility text + URLs)
-```bash
-curl "http://localhost:3030/frames/12345/context"
-```
-Returns parsed accessibility tree, full text, and extracted URLs for a specific frame.
-
-### Health Check
-```bash
-curl http://localhost:3030/health
-```
-
-### List Audio Devices
-```bash
-curl http://localhost:3030/audio/list
-```
-
-### List Monitors
-```bash
-curl http://localhost:3030/vision/list
-```
-
-### Raw SQL (advanced)
-```bash
-curl -X POST http://localhost:3030/raw_sql -H "Content-Type: application/json" -d '{"query": "SELECT COUNT(*) FROM ocr_text"}'
-```
-
-### Speakers
-```bash
-# Search speakers
-curl "http://localhost:3030/speakers/search?name=John"
-
-# List unnamed speakers
-curl http://localhost:3030/speakers/unnamed
-```
-
-## Showing Videos
-
-When referencing video files from search results, show the `file_path` to the user in an inline code block so it renders as a playable video:
-
-```
-`/Users/name/.screenpipe/data/monitor_1_2024-01-15_10-30-00.mp4`
-```
-
-Do NOT use markdown links or multi-line code blocks for videos.
-
-## Deep Links (Clickable References)
-
-When referencing specific moments from search results, create clickable deep links so the user can jump to that exact moment on their timeline.
-
-**ALWAYS prefer frame-based links** — frame IDs are exact database keys from search results and never break:
-
-```markdown
-[10:30 AM — VS Code](screenpipe://frame/12345)
-```
-
-For audio results (which have no frame_id), fall back to timestamp links:
-
-```markdown
-[meeting at 3pm](screenpipe://timeline?timestamp=2024-01-15T15:00:00Z)
-```
-
-### Rules
-
-1. **Use `screenpipe://frame/{frame_id}`** for OCR results — copy the `frame_id` integer directly from the search result's `content.frame_id` field. Do NOT invent frame IDs.
-2. **Use `screenpipe://timeline?timestamp=ISO8601`** for audio results — copy the exact `timestamp` string from the search result.
-3. **NEVER fabricate IDs or timestamps** — only use values that appear in actual search results.
-4. **Make the link text human-readable** — include the time and app name, e.g. `[2:15 PM — Slack](screenpipe://frame/56789)`.
-5. Include deep links in your responses whenever you reference specific moments. This lets the user verify your claims by clicking through to the actual recording.
-
-### Example
-
-After searching and getting results with `frame_id: 12345` at `timestamp: "2024-01-15T10:30:00Z"` in Chrome:
-
-```markdown
-You were browsing GitHub at [10:30 AM — Chrome](screenpipe://frame/12345) when you reviewed PR #234.
-```
-
-## Tips
-
-- The user's data is 100% local. You are querying their local machine.
-- Timestamps in results are UTC. Convert to the user's local timezone when displaying.
-- If asked "what did I work on today?", search with broad terms and short time ranges, then summarize by app/activity.
-- If asked about meetings, use `content_type=audio`.
-- If asked about a specific app, always use the `app_name` filter.
-- Combine multiple searches to build a complete picture (e.g., screen + audio for a meeting).
-- **For aggregation over large datasets**, use raw SQL instead of paginating through search results. The `/search` endpoint returns paginated results (default limit 20), so summarizing thousands of events requires raw SQL. Examples:
-
-```bash
-# Count accessibility events by app (last 24h)
-curl -X POST http://localhost:3030/raw_sql -H "Content-Type: application/json" \
- -d '{"query": "SELECT app_name, COUNT(*) as count FROM accessibility WHERE timestamp > datetime(\"now\", \"-24 hours\") GROUP BY app_name ORDER BY count DESC"}'
-
-# Count input events by type and app (last 24h)
-curl -X POST http://localhost:3030/raw_sql -H "Content-Type: application/json" \
- -d '{"query": "SELECT app_name, event_type, COUNT(*) as count FROM ui_events WHERE timestamp > datetime(\"now\", \"-24 hours\") GROUP BY app_name, event_type ORDER BY count DESC"}'
-
-# App usage summary from OCR frames (last 24h)
-curl -X POST http://localhost:3030/raw_sql -H "Content-Type: application/json" \
- -d '{"query": "SELECT app_name, COUNT(*) as frames FROM frames WHERE timestamp > datetime(\"now\", \"-24 hours\") GROUP BY app_name ORDER BY frames DESC"}'
-```
diff --git a/crates/screenpipe-core/src/agents/pi.rs b/crates/screenpipe-core/src/agents/pi.rs
index 1f227c5d4..9433e3bae 100644
--- a/crates/screenpipe-core/src/agents/pi.rs
+++ b/crates/screenpipe-core/src/agents/pi.rs
@@ -98,32 +98,12 @@ impl PiExecutor {
pub fn ensure_screenpipe_skill(project_dir: &Path) -> Result<()> {
let skills: &[(&str, &str)] = &[
(
- "screenpipe-search",
- include_str!("../../assets/skills/screenpipe-search/SKILL.md"),
+ "screenpipe-api",
+ include_str!("../../assets/skills/screenpipe-api/SKILL.md"),
),
(
- "screenpipe-media",
- include_str!("../../assets/skills/screenpipe-media/SKILL.md"),
- ),
- (
- "screenpipe-retranscribe",
- include_str!("../../assets/skills/screenpipe-retranscribe/SKILL.md"),
- ),
- (
- "screenpipe-analytics",
- include_str!("../../assets/skills/screenpipe-analytics/SKILL.md"),
- ),
- (
- "screenpipe-elements",
- include_str!("../../assets/skills/screenpipe-elements/SKILL.md"),
- ),
- (
- "screenpipe-pipes",
- include_str!("../../assets/skills/screenpipe-pipes/SKILL.md"),
- ),
- (
- "screenpipe-connections",
- include_str!("../../assets/skills/screenpipe-connections/SKILL.md"),
+ "screenpipe-cli",
+ include_str!("../../assets/skills/screenpipe-cli/SKILL.md"),
),
];
@@ -177,39 +157,14 @@ impl PiExecutor {
let all_skills: &[(&str, &str, Box<dyn Fn(&PipePermissions) -> bool>)] = &[
(
- "screenpipe-search",
- include_str!("../../assets/skills/screenpipe-search/SKILL.md"),
- Box::new(|_| true), // always installed
- ),
- (
- "screenpipe-media",
- include_str!("../../assets/skills/screenpipe-media/SKILL.md"),
- Box::new(|p: &PipePermissions| p.allow_frames),
- ),
- (
- "screenpipe-retranscribe",
- include_str!("../../assets/skills/screenpipe-retranscribe/SKILL.md"),
- Box::new(|p: &PipePermissions| p.is_content_type_allowed("audio")),
- ),
- (
- "screenpipe-analytics",
- include_str!("../../assets/skills/screenpipe-analytics/SKILL.md"),
- Box::new(|p: &PipePermissions| p.allow_raw_sql),
- ),
- (
- "screenpipe-elements",
- include_str!("../../assets/skills/screenpipe-elements/SKILL.md"),
- Box::new(|p: &PipePermissions| p.is_content_type_allowed("accessibility")),
- ),
- (
- "screenpipe-pipes",
- include_str!("../../assets/skills/screenpipe-pipes/SKILL.md"),
- Box::new(|_| true), // always installed — pipe management is always available
+ "screenpipe-api",
+ include_str!("../../assets/skills/screenpipe-api/SKILL.md"),
+ Box::new(|_| true), // always installed — unified API skill
),
(
- "screenpipe-connections",
- include_str!("../../assets/skills/screenpipe-connections/SKILL.md"),
- Box::new(|_| true), // always installed — connections discovery is always available
+ "screenpipe-cli",
+ include_str!("../../assets/skills/screenpipe-cli/SKILL.md"),
+ Box::new(|_| true), // always installed — pipe & connection management
),
];