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

feat: add @screenpipe/skills package for AI agent skills

Louis Beaumonta53be045e09c
diff --git a/packages/skills/README.md b/packages/skills/README.md
new file mode 100644
index 000000000..b1b3ffeb6
--- /dev/null
+++ b/packages/skills/README.md
@@ -0,0 +1,68 @@
+# @screenpipe/skills
+
+**Screenpipe skills for AI agents.**
+
+One-liner to install Screenpipe skills to your AI agent (Clawdbot, Claude Code, etc). Your agent can then query your screen history, get daily digests, and search memories.
+
+## Quick Start
+
+```bash
+# Install to remote agent (e.g., Clawdbot)
+bunx @screenpipe/skills install --remote clawdbot
+
+# Install locally
+bunx @screenpipe/skills install
+
+# List available skills
+bunx @screenpipe/skills list
+```
+
+## Skills Included
+
+| Skill | Trigger | What it does |
+|-------|---------|--------------|
+| **recall** | "What was I doing at 3pm?" | Query screen history by time |
+| **search** | "Find when I saw error 404" | Full-text search memories |
+| **digest** | "What did I work on today?" | Daily activity summaries |
+| **context** | "Context for the auth refactor" | Get context for a topic |
+
+## Requirements
+
+- [Screenpipe](https://screenpi.pe) installed and running
+- Screen data synced to agent via `bunx @screenpipe/sync --daemon`
+- SQLite3 available on the agent
+
+## Full Setup
+
+```bash
+# 1. Sync your screen data to the agent
+bunx @screenpipe/sync --daemon --remote clawdbot:~/.screenpipe/
+
+# 2. Install skills
+bunx @screenpipe/skills install --remote clawdbot
+
+# 3. Ask your agent
+"What was I doing at 3pm yesterday?"
+"Find when I last saw the budget spreadsheet"
+"Summarize my work today"
+```
+
+## How It Works
+
+Skills are markdown files that teach your AI agent how to query the Screenpipe SQLite database:
+
+```sql
+-- Example: Get today's app usage
+SELECT app_name, COUNT(*) as frames
+FROM ocr_text o
+JOIN frames f ON o.frame_id = f.id
+WHERE date(f.timestamp) = date('now')
+GROUP BY app_name
+ORDER BY frames DESC;
+```
+
+The agent reads these skill files and uses them to answer your questions about your screen history.
+
+## License
+
+MIT - Part of [Screenpipe](https://github.com/mediar-ai/screenpipe)
diff --git a/packages/skills/bun.lock b/packages/skills/bun.lock
new file mode 100644
index 000000000..cef35dca7
--- /dev/null
+++ b/packages/skills/bun.lock
@@ -0,0 +1,24 @@
+{
+ "lockfileVersion": 1,
+ "configVersion": 1,
+ "workspaces": {
+ "": {
+ "name": "@screenpipe/skills",
+ "devDependencies": {
+ "@types/bun": "latest",
+ "typescript": "^5.0.0",
+ },
+ },
+ },
+ "packages": {
+ "@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.3.8" } }, "sha512-3LvWJ2q5GerAXYxO2mffLTqOzEu5qnhEAlh48Vnu8WQfnmSwbgagjGZV6BoHKJztENYEDn6QmVd949W4uESRJA=="],
+
+ "@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-t7frlewr6+cbx+9Ohpl0NOTKXZNV9xHRmNOvql47BFJKcEG1CxtxlPEEe+gR9uhVWM4DwhnvTF110mIL4yP9RA=="],
+
+ "bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-fL99nxdOWvV4LqjmC+8Q9kW3M4QTtTR1eePs94v5ctGqU8OeceWrSUaRw3JYb7tU3FkMIAjkueehrHPPPGKi5Q=="],
+
+ "typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
+
+ "undici-types": ["[email protected]", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="],
+ }
+}
diff --git a/packages/skills/dist/index.js b/packages/skills/dist/index.js
new file mode 100755
index 000000000..94b2a3b40
--- /dev/null
+++ b/packages/skills/dist/index.js
@@ -0,0 +1,166 @@
+#!/usr/bin/env bun
+// @bun
+
+// src/index.ts
+import { readdir, readFile, mkdir, writeFile } from "fs/promises";
+import { execSync } from "child_process";
+import { join, dirname } from "path";
+import { fileURLToPath } from "url";
+import { homedir } from "os";
+var __dirname2 = dirname(fileURLToPath(import.meta.url));
+var SKILLS_DIR = join(__dirname2, "..", "skills");
+function parseArgs() {
+ const args = process.argv.slice(2);
+ const config = {
+ command: "help",
+ remote: null,
+ outputDir: join(homedir(), "clawd", "skills", "screenpipe"),
+ verbose: false
+ };
+ for (let i = 0;i < args.length; i++) {
+ const arg = args[i];
+ switch (arg) {
+ case "install":
+ config.command = "install";
+ break;
+ case "list":
+ config.command = "list";
+ break;
+ case "--remote":
+ case "-r":
+ config.remote = args[++i];
+ break;
+ case "--output":
+ case "-o":
+ config.outputDir = args[++i];
+ break;
+ case "--verbose":
+ case "-v":
+ config.verbose = true;
+ break;
+ case "--help":
+ case "help":
+ config.command = "help";
+ break;
+ }
+ }
+ return config;
+}
+function printHelp() {
+ console.log(`
+@screenpipe/skills - Install Screenpipe skills to AI agents
+
+USAGE:
+ bunx @screenpipe/skills <command> [options]
+
+COMMANDS:
+ install Install skills to local or remote agent
+ list List available skills
+
+OPTIONS:
+ -r, --remote <host> Install to remote server via SSH (e.g., clawdbot)
+ -o, --output <dir> Local output directory (default: ~/clawd/skills/screenpipe)
+ -v, --verbose Show debug output
+
+EXAMPLES:
+ # Install to local Clawdbot
+ bunx @screenpipe/skills install
+
+ # Install to remote server
+ bunx @screenpipe/skills install --remote clawdbot
+
+ # Install to custom directory
+ bunx @screenpipe/skills install --output ~/.claude/skills/screenpipe
+
+ # List available skills
+ bunx @screenpipe/skills list
+
+SKILLS INCLUDED:
+ - recall : Query screen history by time ("What was I doing at 3pm?")
+ - search : Full-text search memories ("Find when I saw error 404")
+ - digest : Daily activity summaries ("What did I work on today?")
+ - context : Get context for a topic ("Context for the auth refactor")
+`);
+}
+async function listSkills() {
+ console.log(`
+\uD83D\uDCE6 Available Screenpipe Skills:
+`);
+ const files = await readdir(SKILLS_DIR);
+ for (const file of files) {
+ if (!file.endsWith(".md"))
+ continue;
+ const content = await readFile(join(SKILLS_DIR, file), "utf-8");
+ const nameMatch = content.match(/name:\s*(.+)/);
+ const descMatch = content.match(/description:\s*(.+)/);
+ const name = nameMatch?.[1] || file.replace(".md", "");
+ const desc = descMatch?.[1] || "No description";
+ console.log(` ${name}`);
+ console.log(` ${desc}
+`);
+ }
+}
+async function installSkills(config) {
+ const files = await readdir(SKILLS_DIR);
+ const skills = files.filter((f) => f.endsWith(".md"));
+ console.log(`
+\uD83D\uDCE6 Installing ${skills.length} Screenpipe skills...
+`);
+ if (config.remote) {
+ console.log(` Target: ${config.remote}:~/clawd/skills/screenpipe/`);
+ try {
+ execSync(`ssh ${config.remote} "mkdir -p ~/clawd/skills/screenpipe"`, {
+ stdio: config.verbose ? "inherit" : "pipe"
+ });
+ } catch (e) {
+ console.error(`[error] Failed to create remote directory`);
+ process.exit(1);
+ }
+ for (const skill of skills) {
+ const src = join(SKILLS_DIR, skill);
+ const dest = `${config.remote}:~/clawd/skills/screenpipe/${skill}`;
+ try {
+ execSync(`scp "${src}" "${dest}"`, {
+ stdio: config.verbose ? "inherit" : "pipe"
+ });
+ console.log(` \u2713 ${skill}`);
+ } catch (e) {
+ console.error(` \u2717 ${skill} - failed`);
+ }
+ }
+ console.log(`
+\u2705 Skills installed to ${config.remote}`);
+ console.log(` Your agent can now use: recall, search, digest, context`);
+ } else {
+ console.log(` Target: ${config.outputDir}/`);
+ await mkdir(config.outputDir, { recursive: true });
+ for (const skill of skills) {
+ const src = join(SKILLS_DIR, skill);
+ const dest = join(config.outputDir, skill);
+ const content = await readFile(src, "utf-8");
+ await writeFile(dest, content);
+ console.log(` \u2713 ${skill}`);
+ }
+ console.log(`
+\u2705 Skills installed locally`);
+ console.log(` Your agent can now use: recall, search, digest, context`);
+ }
+}
+async function main() {
+ const config = parseArgs();
+ switch (config.command) {
+ case "install":
+ await installSkills(config);
+ break;
+ case "list":
+ await listSkills();
+ break;
+ case "help":
+ default:
+ printHelp();
+ }
+}
+main().catch((e) => {
+ console.error(`[error] ${e.message}`);
+ process.exit(1);
+});
diff --git a/packages/skills/package.json b/packages/skills/package.json
new file mode 100644
index 000000000..fd981b586
--- /dev/null
+++ b/packages/skills/package.json
@@ -0,0 +1,37 @@
+{
+ "name": "@screenpipe/skills",
+ "version": "0.1.1",
+ "description": "Screenpipe skills for AI agents (Clawdbot, Claude Code, etc). Query your screen history, get daily digests, search memories.",
+ "type": "module",
+ "bin": {
+ "screenpipe-skills": "dist/index.js"
+ },
+ "scripts": {
+ "build": "bun build src/index.ts --outdir dist --target node",
+ "dev": "bun run src/index.ts",
+ "prepublishOnly": "bun run build"
+ },
+ "files": [
+ "dist",
+ "skills"
+ ],
+ "keywords": [
+ "screenpipe",
+ "ai-agent",
+ "clawdbot",
+ "skills",
+ "memory",
+ "screen-recording"
+ ],
+ "author": "Louis Beaumont <[email protected]>",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/mediar-ai/screenpipe",
+ "directory": "packages/skills"
+ },
+ "devDependencies": {
+ "@types/bun": "latest",
+ "typescript": "^5.0.0"
+ }
+}
diff --git a/packages/skills/skills/context.md b/packages/skills/skills/context.md
new file mode 100644
index 000000000..147ac6ce6
--- /dev/null
+++ b/packages/skills/skills/context.md
@@ -0,0 +1,113 @@
+---
+name: screenpipe-context
+description: Get context for a task or topic. "What do I know about project X?" "Context for the auth refactor"
+tools: Bash
+---
+
+# Screenpipe Context
+
+Pull relevant screen history for a specific topic, project, or task.
+
+## Database Location
+
+```
+~/.screenpipe/db.sqlite
+```
+
+## Query Patterns
+
+```bash
+# Search for topic across all time
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT
+ date(f.timestamp) as day,
+ o.app_name,
+ o.window_name,
+ substr(o.text, 1, 300) as content
+ FROM ocr_text o
+ JOIN frames f ON o.frame_id = f.id
+ WHERE o.text LIKE '%auth%' OR o.text LIKE '%authentication%'
+ ORDER BY f.timestamp DESC
+ LIMIT 50;
+"
+
+# Get window titles related to topic
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT DISTINCT
+ o.app_name,
+ o.window_name,
+ COUNT(*) as times_seen
+ FROM ocr_text o
+ WHERE o.window_name LIKE '%project-name%'
+ GROUP BY o.window_name
+ ORDER BY times_seen DESC
+ LIMIT 20;
+"
+
+# Timeline of when topic was worked on
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT
+ date(f.timestamp) as day,
+ COUNT(*) as frames,
+ GROUP_CONCAT(DISTINCT o.app_name) as apps
+ FROM ocr_text o
+ JOIN frames f ON o.frame_id = f.id
+ WHERE o.text LIKE '%screenpipe%'
+ GROUP BY day
+ ORDER BY day DESC
+ LIMIT 14;
+"
+
+# Extract code snippets related to topic
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT f.timestamp, substr(o.text, 1, 500)
+ FROM ocr_text o
+ JOIN frames f ON o.frame_id = f.id
+ WHERE o.app_name IN ('VS Code', 'Cursor', 'Zed', 'Terminal')
+ AND o.text LIKE '%function%'
+ AND o.text LIKE '%auth%'
+ ORDER BY f.timestamp DESC
+ LIMIT 10;
+"
+```
+
+## Your Task
+
+When the user needs context about something:
+
+1. Extract the topic/project/task from their question
+2. Search across all history for related content
+3. Group by:
+ - When (which days/times)
+ - Where (which apps)
+ - What (relevant content snippets)
+4. Synthesize into useful context
+
+## Output Format
+
+```markdown
+## Context: [Topic]
+
+### Timeline
+- First seen: 2026-01-15
+- Last worked on: 2026-01-29
+- Total days: 8
+
+### Apps Used
+- VS Code (45 frames) - main development
+- Chrome (23 frames) - docs, Stack Overflow
+- Slack (12 frames) - discussions
+
+### Key Files/Windows
+- `auth.ts` - main auth logic
+- `login.tsx` - login UI
+- GitHub PR #234
+
+### Relevant Content
+- [snippet 1]
+- [snippet 2]
+
+### Recent Activity
+- Yesterday: Fixed token refresh bug
+- 3 days ago: Added OAuth support
+```
diff --git a/packages/skills/skills/digest.md b/packages/skills/skills/digest.md
new file mode 100644
index 000000000..54247c466
--- /dev/null
+++ b/packages/skills/skills/digest.md
@@ -0,0 +1,102 @@
+---
+name: screenpipe-digest
+description: Get a summary of screen activity. "What did I work on today?" "Summarize yesterday"
+tools: Bash
+---
+
+# Screenpipe Daily Digest
+
+Generate summaries of screen activity from the SQLite database.
+
+## Database Location
+
+```
+~/.screenpipe/db.sqlite
+```
+
+## Query Patterns
+
+```bash
+# App usage breakdown for today
+sqlite3 -header -column ~/.screenpipe/db.sqlite "
+ SELECT
+ o.app_name,
+ COUNT(*) as frames,
+ ROUND(COUNT(*) * 5.0 / 60, 1) as approx_minutes
+ FROM ocr_text o
+ JOIN frames f ON o.frame_id = f.id
+ WHERE date(f.timestamp) = date('now')
+ GROUP BY o.app_name
+ ORDER BY frames DESC
+ LIMIT 15;
+"
+
+# Timeline of app switches
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT
+ strftime('%H:%M', f.timestamp) as time,
+ o.app_name,
+ o.window_name
+ FROM ocr_text o
+ JOIN frames f ON o.frame_id = f.id
+ WHERE date(f.timestamp) = date('now')
+ GROUP BY strftime('%H', f.timestamp), o.app_name
+ ORDER BY f.timestamp;
+"
+
+# Sample of content from each app today
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT o.app_name, substr(o.text, 1, 200) as sample
+ FROM ocr_text o
+ JOIN frames f ON o.frame_id = f.id
+ WHERE date(f.timestamp) = date('now')
+ GROUP BY o.app_name
+ LIMIT 10;
+"
+
+# First and last activity
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT
+ MIN(f.timestamp) as first_activity,
+ MAX(f.timestamp) as last_activity
+ FROM frames f
+ WHERE date(f.timestamp) = date('now');
+"
+```
+
+## Your Task
+
+When the user asks for a digest or summary:
+
+1. Query app usage breakdown (time per app)
+2. Get a timeline of major activities
+3. Sample content from each major app
+4. Summarize into a coherent narrative:
+ - What apps were used and for how long
+ - What was the user working on
+ - Any patterns (deep work, meetings, browsing)
+
+## Output Format
+
+```markdown
+## Daily Digest - [Date]
+
+### Time Breakdown
+- VS Code: ~3 hours (screenpipe repo)
+- Chrome: ~2 hours (GitHub, Docs)
+- Slack: ~45 min
+
+### Timeline
+- 9am-11am: Deep work on auth feature
+- 11am-12pm: Code review, Slack
+- 2pm-5pm: Debugging, testing
+
+### Key Activities
+- Fixed authentication bug
+- Reviewed 3 PRs
+- Slack discussion about launch
+
+### Patterns
+- Good focus block in morning
+- Fragmented afternoon (12 app switches)
+```
diff --git a/packages/skills/skills/recall.md b/packages/skills/skills/recall.md
new file mode 100644
index 000000000..47291b026
--- /dev/null
+++ b/packages/skills/skills/recall.md
@@ -0,0 +1,69 @@
+---
+name: screenpipe-recall
+description: Query your screen history by time. "What was I doing at 3pm?" "What did I see yesterday morning?"
+tools: Bash
+---
+
+# Screenpipe Recall
+
+Query the local Screenpipe SQLite database to recall what was on screen at a specific time.
+
+## Database Location
+
+```
+~/.screenpipe/db.sqlite
+```
+
+## Query Patterns
+
+```bash
+# Get screen content from a specific hour
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT f.timestamp, o.text, o.app_name, o.window_name
+ FROM ocr_text o
+ JOIN frames f ON o.frame_id = f.id
+ WHERE f.timestamp LIKE '2026-01-29 15:%'
+ ORDER BY f.timestamp DESC
+ LIMIT 20;
+"
+
+# Get content from time range
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT f.timestamp, o.app_name, substr(o.text, 1, 200) as text_preview
+ FROM ocr_text o
+ JOIN frames f ON o.frame_id = f.id
+ WHERE f.timestamp BETWEEN '2026-01-29 14:00:00' AND '2026-01-29 16:00:00'
+ ORDER BY f.timestamp
+ LIMIT 50;
+"
+
+# Get today's activity by app
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT o.app_name, COUNT(*) as frames
+ FROM ocr_text o
+ JOIN frames f ON o.frame_id = f.id
+ WHERE date(f.timestamp) = date('now')
+ GROUP BY o.app_name
+ ORDER BY frames DESC;
+"
+```
+
+## Your Task
+
+When the user asks about what they were doing at a specific time:
+
+1. Parse the time from their question (e.g., "3pm" → "15:00", "yesterday morning" → yesterday's date + "09:00-12:00")
+2. Query the database with appropriate time filters
+3. Summarize what apps were used and what content was visible
+4. If they ask about a specific topic, filter by text content
+
+## Examples
+
+User: "What was I doing at 3pm?"
+→ Query for frames around 15:00 today, summarize apps and content
+
+User: "What did I work on yesterday afternoon?"
+→ Query for yesterday's date, 12:00-18:00, group by app
+
+User: "When did I last look at the budget spreadsheet?"
+→ Search for "budget" in text, return timestamps
diff --git a/packages/skills/skills/search.md b/packages/skills/skills/search.md
new file mode 100644
index 000000000..b256f0cef
--- /dev/null
+++ b/packages/skills/skills/search.md
@@ -0,0 +1,81 @@
+---
+name: screenpipe-search
+description: Full-text search your screen history. "Find when I saw error 404" "Search for meeting notes"
+tools: Bash
+---
+
+# Screenpipe Search
+
+Full-text search across all screen recordings using SQLite FTS5.
+
+## Database Location
+
+```
+~/.screenpipe/db.sqlite
+```
+
+## Query Patterns
+
+```bash
+# Full-text search (FTS5)
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT f.timestamp, o.app_name, o.window_name, snippet(ocr_text_fts, 1, '>>>', '<<<', '...', 30) as match
+ FROM ocr_text_fts
+ JOIN ocr_text o ON ocr_text_fts.frame_id = o.frame_id
+ JOIN frames f ON o.frame_id = f.id
+ WHERE ocr_text_fts MATCH 'error'
+ ORDER BY f.timestamp DESC
+ LIMIT 20;
+"
+
+# Search with multiple terms
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT f.timestamp, o.app_name, substr(o.text, 1, 300)
+ FROM ocr_text o
+ JOIN frames f ON o.frame_id = f.id
+ WHERE o.text LIKE '%API%' AND o.text LIKE '%key%'
+ ORDER BY f.timestamp DESC
+ LIMIT 20;
+"
+
+# Search in specific app
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT f.timestamp, o.window_name, substr(o.text, 1, 200)
+ FROM ocr_text o
+ JOIN frames f ON o.frame_id = f.id
+ WHERE o.app_name = 'Slack' AND o.text LIKE '%deadline%'
+ ORDER BY f.timestamp DESC
+ LIMIT 20;
+"
+
+# Count occurrences by day
+sqlite3 ~/.screenpipe/db.sqlite "
+ SELECT date(f.timestamp) as day, COUNT(*) as mentions
+ FROM ocr_text o
+ JOIN frames f ON o.frame_id = f.id
+ WHERE o.text LIKE '%screenpipe%'
+ GROUP BY day
+ ORDER BY day DESC
+ LIMIT 10;
+"
+```
+
+## Your Task
+
+When the user wants to search their screen history:
+
+1. Extract search terms from their query
+2. Use FTS5 for fast full-text search, or LIKE for simple patterns
+3. Return relevant matches with timestamps and context
+4. Summarize findings (when, where, how often)
+
+## Examples
+
+User: "Find when I saw that error message about authentication"
+→ Search for "authentication" + "error", return timestamps and apps
+
+User: "Search for anything about the Q4 budget"
+→ Search for "Q4" + "budget", show matches with context
+
+User: "How many times did I look at Twitter today?"
+→ Count frames where app_name contains Twitter for today
diff --git a/packages/skills/src/index.ts b/packages/skills/src/index.ts
new file mode 100644
index 000000000..d0d8543f9
--- /dev/null
+++ b/packages/skills/src/index.ts
@@ -0,0 +1,198 @@
+#!/usr/bin/env bun
+/**
+ * @screenpipe/skills - Install Screenpipe skills to AI agents
+ *
+ * Usage:
+ * bunx @screenpipe/skills install # Install locally
+ * bunx @screenpipe/skills install --remote clawdbot # Install to remote
+ * bunx @screenpipe/skills list # List available skills
+ */
+
+import { readdir, readFile, mkdir, writeFile } from "fs/promises";
+import { execSync } from "child_process";
+import { join, dirname } from "path";
+import { fileURLToPath } from "url";
+import { homedir } from "os";
+
+const __dirname = dirname(fileURLToPath(import.meta.url));
+const SKILLS_DIR = join(__dirname, "..", "skills");
+
+interface Config {
+ command: "install" | "list" | "help";
+ remote: string | null;
+ outputDir: string;
+ verbose: boolean;
+}
+
+function parseArgs(): Config {
+ const args = process.argv.slice(2);
+ const config: Config = {
+ command: "help",
+ remote: null,
+ outputDir: join(homedir(), "clawd", "skills", "screenpipe"),
+ verbose: false,
+ };
+
+ for (let i = 0; i < args.length; i++) {
+ const arg = args[i];
+ switch (arg) {
+ case "install":
+ config.command = "install";
+ break;
+ case "list":
+ config.command = "list";
+ break;
+ case "--remote":
+ case "-r":
+ config.remote = args[++i];
+ break;
+ case "--output":
+ case "-o":
+ config.outputDir = args[++i];
+ break;
+ case "--verbose":
+ case "-v":
+ config.verbose = true;
+ break;
+ case "--help":
+ case "help":
+ config.command = "help";
+ break;
+ }
+ }
+
+ return config;
+}
+
+function printHelp() {
+ console.log(`
+@screenpipe/skills - Install Screenpipe skills to AI agents
+
+USAGE:
+ bunx @screenpipe/skills <command> [options]
+
+COMMANDS:
+ install Install skills to local or remote agent
+ list List available skills
+
+OPTIONS:
+ -r, --remote <host> Install to remote server via SSH (e.g., clawdbot)
+ -o, --output <dir> Local output directory (default: ~/clawd/skills/screenpipe)
+ -v, --verbose Show debug output
+
+EXAMPLES:
+ # Install to local Clawdbot
+ bunx @screenpipe/skills install
+
+ # Install to remote server
+ bunx @screenpipe/skills install --remote clawdbot
+
+ # Install to custom directory
+ bunx @screenpipe/skills install --output ~/.claude/skills/screenpipe
+
+ # List available skills
+ bunx @screenpipe/skills list
+
+SKILLS INCLUDED:
+ - recall : Query screen history by time ("What was I doing at 3pm?")
+ - search : Full-text search memories ("Find when I saw error 404")
+ - digest : Daily activity summaries ("What did I work on today?")
+ - context : Get context for a topic ("Context for the auth refactor")
+`);
+}
+
+async function listSkills() {
+ console.log("\n📦 Available Screenpipe Skills:\n");
+
+ const files = await readdir(SKILLS_DIR);
+ for (const file of files) {
+ if (!file.endsWith(".md")) continue;
+
+ const content = await readFile(join(SKILLS_DIR, file), "utf-8");
+ const nameMatch = content.match(/name:\s*(.+)/);
+ const descMatch = content.match(/description:\s*(.+)/);
+
+ const name = nameMatch?.[1] || file.replace(".md", "");
+ const desc = descMatch?.[1] || "No description";
+
+ console.log(` ${name}`);
+ console.log(` ${desc}\n`);
+ }
+}
+
+async function installSkills(config: Config) {
+ const files = await readdir(SKILLS_DIR);
+ const skills = files.filter((f) => f.endsWith(".md"));
+
+ console.log(`\n📦 Installing ${skills.length} Screenpipe skills...\n`);
+
+ if (config.remote) {
+ // Remote install via SSH
+ console.log(` Target: ${config.remote}:~/clawd/skills/screenpipe/`);
+
+ // Create remote directory
+ try {
+ execSync(`ssh ${config.remote} "mkdir -p ~/clawd/skills/screenpipe"`, {
+ stdio: config.verbose ? "inherit" : "pipe",
+ });
+ } catch (e) {
+ console.error(`[error] Failed to create remote directory`);
+ process.exit(1);
+ }
+
+ // Copy each skill
+ for (const skill of skills) {
+ const src = join(SKILLS_DIR, skill);
+ const dest = `${config.remote}:~/clawd/skills/screenpipe/${skill}`;
+
+ try {
+ execSync(`scp "${src}" "${dest}"`, {
+ stdio: config.verbose ? "inherit" : "pipe",
+ });
+ console.log(` ✓ ${skill}`);
+ } catch (e) {
+ console.error(` ✗ ${skill} - failed`);
+ }
+ }
+
+ console.log(`\n✅ Skills installed to ${config.remote}`);
+ console.log(` Your agent can now use: recall, search, digest, context`);
+ } else {
+ // Local install
+ console.log(` Target: ${config.outputDir}/`);
+
+ await mkdir(config.outputDir, { recursive: true });
+
+ for (const skill of skills) {
+ const src = join(SKILLS_DIR, skill);
+ const dest = join(config.outputDir, skill);
+ const content = await readFile(src, "utf-8");
+ await writeFile(dest, content);
+ console.log(` ✓ ${skill}`);
+ }
+
+ console.log(`\n✅ Skills installed locally`);
+ console.log(` Your agent can now use: recall, search, digest, context`);
+ }
+}
+
+async function main() {
+ const config = parseArgs();
+
+ switch (config.command) {
+ case "install":
+ await installSkills(config);
+ break;
+ case "list":
+ await listSkills();
+ break;
+ case "help":
+ default:
+ printHelp();
+ }
+}
+
+main().catch((e) => {
+ console.error(`[error] ${e.message}`);
+ process.exit(1);
+});
diff --git a/packages/skills/tsconfig.json b/packages/skills/tsconfig.json
new file mode 100644
index 000000000..021397787
--- /dev/null
+++ b/packages/skills/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "esModuleInterop": true,
+ "strict": true,
+ "skipLibCheck": true,
+ "outDir": "dist",
+ "declaration": true,
+ "types": ["bun-types"]
+ },
+ "include": ["src/**/*"]
+}