diff --git a/apps/x/apps/main/src/ipc.ts b/apps/x/apps/main/src/ipc.ts index 1f8616bf..64bd34a7 100644 --- a/apps/x/apps/main/src/ipc.ts +++ b/apps/x/apps/main/src/ipc.ts @@ -736,7 +736,7 @@ export function setupIpcHandlers() { }, 'skills:getOfficial': async (_event, args) => { const resolver = container.resolve('skillResolver'); - return resolver.getOfficial(args.id); + return await resolver.getOfficial(args.id); }, 'skills:saveOverride': async (_event, args) => { const repo = container.resolve('skillsRepo'); diff --git a/apps/x/apps/main/src/main.ts b/apps/x/apps/main/src/main.ts index 9b89f033..43f11da3 100644 --- a/apps/x/apps/main/src/main.ts +++ b/apps/x/apps/main/src/main.ts @@ -21,6 +21,7 @@ import { init as initEmailLabeling } from "@x/core/dist/knowledge/label_emails.j import { init as initNoteTagging } from "@x/core/dist/knowledge/tag_notes.js"; import { init as initInlineTasks } from "@x/core/dist/knowledge/inline_tasks.js"; import { init as initAgentRunner } from "@x/core/dist/agent-schedule/runner.js"; +import { init as initSkillSync } from "@x/core/dist/skills/sync.js"; import { initConfigs } from "@x/core/dist/config/initConfigs.js"; import started from "electron-squirrel-startup"; import { execSync } from "node:child_process"; @@ -230,6 +231,9 @@ app.whenReady().then(async () => { // start background agent runner (scheduled agents) initAgentRunner(); + // start skill sync service (pulls from GitHub repo hourly) + initSkillSync(); + app.on("activate", () => { if (BrowserWindow.getAllWindows().length === 0) { createWindow(); diff --git a/apps/x/packages/core/src/application/assistant/skills/app-navigation/skill.ts b/apps/x/packages/core/src/application/assistant/skills/app-navigation/skill.ts deleted file mode 100644 index 9dbbce84..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/app-navigation/skill.ts +++ /dev/null @@ -1,82 +0,0 @@ -export const skill = String.raw` -# App Navigation Skill - -You have access to the **app-navigation** tool which lets you control the Rowboat UI directly — opening notes, switching views, filtering the knowledge base, and creating saved views. - -## Actions - -### open-note -Open a specific knowledge file in the editor pane. - -**When to use:** When the user asks to see, open, or view a specific note (e.g., "open John's note", "show me the Acme project page"). - -**Parameters:** -- ` + "`path`" + `: Full workspace-relative path (e.g., ` + "`knowledge/People/John Smith.md`" + `) - -**Tips:** -- Use ` + "`workspace-grep`" + ` first to find the exact path if you're unsure of the filename. -- Always pass the full ` + "`knowledge/...`" + ` path, not just the filename. - -### open-view -Switch the UI to the graph or bases view. - -**When to use:** When the user asks to see the knowledge graph, view all notes, or open the bases/table view. - -**Parameters:** -- ` + "`view`" + `: ` + "`\"graph\"`" + ` or ` + "`\"bases\"`" + ` - -### update-base-view -Change filters, columns, sort order, or search in the bases (table) view. - -**When to use:** When the user asks to find, filter, sort, or search notes. Examples: "show me all active customers", "filter by topic=hiring", "sort by name", "search for pricing". - -**Parameters:** -- ` + "`filters`" + `: Object with ` + "`set`" + `, ` + "`add`" + `, ` + "`remove`" + `, or ` + "`clear`" + ` — each takes an array of ` + "`{ category, value }`" + ` pairs. - - ` + "`set`" + `: Replace ALL current filters with these. - - ` + "`add`" + `: Append filters without removing existing ones. - - ` + "`remove`" + `: Remove specific filters. - - ` + "`clear: true`" + `: Remove all filters. -- ` + "`columns`" + `: Object with ` + "`set`" + `, ` + "`add`" + `, or ` + "`remove`" + ` — each takes an array of column names (frontmatter keys). -- ` + "`sort`" + `: ` + "`{ field, dir }`" + ` where dir is ` + "`\"asc\"`" + ` or ` + "`\"desc\"`" + `. -- ` + "`search`" + `: Free-text search string. - -**Tips:** -- If unsure what categories/values are available, call ` + "`get-base-state`" + ` first. -- For "show me X", prefer ` + "`filters.set`" + ` to start fresh rather than ` + "`filters.add`" + `. -- Categories come from frontmatter keys (e.g., relationship, status, topic, type). -- **CRITICAL: Do NOT pass ` + "`columns`" + ` unless the user explicitly asks to show/hide specific columns.** Omit the ` + "`columns`" + ` parameter entirely when only filtering, sorting, or searching. Passing ` + "`columns`" + ` will override the user's current column layout and can make the view appear empty. - -### get-base-state -Retrieve information about what's in the knowledge base — available filter categories, values, and note count. - -**When to use:** When you need to know what properties exist before filtering, or when the user asks "what can I filter by?", "how many notes are there?", etc. - -**Parameters:** -- ` + "`base_name`" + ` (optional): Name of a saved base to inspect. - -### create-base -Save the current view configuration as a named base. - -**When to use:** When the user asks to save a filtered view, create a saved search, or says "save this as [name]". - -**Parameters:** -- ` + "`name`" + `: Human-readable name for the base. - -## Workflow Example - -1. User: "Show me all people who are customers" -2. First, check what properties are available: - ` + "`app-navigation({ action: \"get-base-state\" })`" + ` -3. Apply filters based on the available properties: - ` + "`app-navigation({ action: \"update-base-view\", filters: { set: [{ category: \"relationship\", value: \"customer\" }] } })`" + ` -4. If the user wants to save it: - ` + "`app-navigation({ action: \"create-base\", name: \"Customers\" })`" + ` - -## Important Notes -- The ` + "`update-base-view`" + ` action will automatically navigate to the bases view if the user isn't already there. -- ` + "`open-note`" + ` validates that the file exists before navigating. -- Filter categories and values come from frontmatter in knowledge files. -- **Never send ` + "`columns`" + ` or ` + "`sort`" + ` with ` + "`update-base-view`" + ` unless the user specifically asks to change them.** Only pass the parameters you intend to change — omitted parameters are left untouched. -`; - -export default skill; diff --git a/apps/x/packages/core/src/application/assistant/skills/background-agents/skill.ts b/apps/x/packages/core/src/application/assistant/skills/background-agents/skill.ts deleted file mode 100644 index 7ac1b89e..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/background-agents/skill.ts +++ /dev/null @@ -1,555 +0,0 @@ -export const skill = String.raw` -# Background Agents - -Load this skill whenever a user wants to inspect, create, edit, or schedule background agents inside the Rowboat workspace. - -## Core Concepts - -**IMPORTANT**: In the CLI, there are NO separate "workflow" files. Everything is an agent. - -- **All definitions live in ` + "`agents/*.md`" + `** - Markdown files with YAML frontmatter -- Agents configure a model, tools (in frontmatter), and instructions (in the body) -- Tools can be: builtin (like ` + "`executeCommand`" + `), MCP integrations, or **other agents** -- **"Workflows" are just agents that orchestrate other agents** by having them as tools -- **Background agents run on schedules** defined in ` + "`~/.rowboat/config/agent-schedule.json`" + ` - -## How multi-agent workflows work - -1. **Create an orchestrator agent** that has other agents in its ` + "`tools`" + ` -2. **Schedule the orchestrator** in agent-schedule.json (see Scheduling section below) -3. The orchestrator calls other agents as tools when needed -4. Data flows through tool call parameters and responses - -## Scheduling Background Agents - -Background agents run automatically based on schedules defined in ` + "`~/.rowboat/config/agent-schedule.json`" + `. - -### Schedule Configuration File - -` + "```json" + ` -{ - "agents": { - "agent_name": { - "schedule": { ... }, - "enabled": true - } - } -} -` + "```" + ` - -### Schedule Types - -**IMPORTANT: All times are in local time** (the timezone of the machine running Rowboat). - -**1. Cron Schedule** - Runs at exact times defined by cron expression -` + "```json" + ` -{ - "schedule": { - "type": "cron", - "expression": "0 8 * * *" - }, - "enabled": true -} -` + "```" + ` - -Common cron expressions: -- ` + "`*/5 * * * *`" + ` - Every 5 minutes -- ` + "`0 8 * * *`" + ` - Every day at 8am -- ` + "`0 9 * * 1`" + ` - Every Monday at 9am -- ` + "`0 0 1 * *`" + ` - First day of every month at midnight - -**2. Window Schedule** - Runs once during a time window -` + "```json" + ` -{ - "schedule": { - "type": "window", - "cron": "0 0 * * *", - "startTime": "08:00", - "endTime": "10:00" - }, - "enabled": true -} -` + "```" + ` - -The agent will run once at a random time within the window. Use this when you want flexibility (e.g., "sometime in the morning" rather than "exactly at 8am"). - -**3. Once Schedule** - Runs exactly once at a specific time -` + "```json" + ` -{ - "schedule": { - "type": "once", - "runAt": "2024-02-05T10:30:00" - }, - "enabled": true -} -` + "```" + ` - -Use this for one-time tasks like migrations or setup scripts. The ` + "`runAt`" + ` is in local time (no Z suffix). - -### Starting Message - -You can specify a ` + "`startingMessage`" + ` that gets sent to the agent when it starts. If not provided, defaults to ` + "`\"go\"`" + `. - -` + "```json" + ` -{ - "schedule": { "type": "cron", "expression": "0 8 * * *" }, - "enabled": true, - "startingMessage": "Please summarize my emails from the last 24 hours" -} -` + "```" + ` - -### Description - -You can add a ` + "`description`" + ` field to describe what the agent does. This is displayed in the UI. - -` + "```json" + ` -{ - "schedule": { "type": "cron", "expression": "0 8 * * *" }, - "enabled": true, - "description": "Summarizes emails and calendar events every morning" -} -` + "```" + ` - -### Complete Schedule Example - -` + "```json" + ` -{ - "agents": { - "daily_digest": { - "schedule": { - "type": "cron", - "expression": "0 8 * * *" - }, - "enabled": true, - "description": "Daily email and calendar summary", - "startingMessage": "Summarize my emails and calendar for today" - }, - "morning_briefing": { - "schedule": { - "type": "window", - "cron": "0 0 * * *", - "startTime": "07:00", - "endTime": "09:00" - }, - "enabled": true, - "description": "Morning news and updates briefing" - }, - "one_time_setup": { - "schedule": { - "type": "once", - "runAt": "2024-12-01T12:00:00" - }, - "enabled": true, - "description": "One-time data migration task" - } - } -} -` + "```" + ` - -### Schedule State (Read-Only) - -**IMPORTANT: Do NOT modify ` + "`agent-schedule-state.json`" + `** - it is managed automatically by the background runner. - -The runner automatically tracks execution state in ` + "`~/.rowboat/config/agent-schedule-state.json`" + `: -- ` + "`status`" + `: scheduled, running, finished, failed, triggered (for once-schedules) -- ` + "`lastRunAt`" + `: When the agent last ran -- ` + "`nextRunAt`" + `: When the agent will run next -- ` + "`lastError`" + `: Error message if the last run failed -- ` + "`runCount`" + `: Total number of runs - -When you add an agent to ` + "`agent-schedule.json`" + `, the runner will automatically create and manage its state entry. You only need to edit ` + "`agent-schedule.json`" + `. - -## Agent File Format - -Agent files are **Markdown files with YAML frontmatter**. The frontmatter contains configuration (model, tools), and the body contains the instructions. - -### Basic Structure -` + "```markdown" + ` ---- -model: gpt-5.1 -tools: - tool_key: - type: builtin - name: tool_name ---- -# Instructions - -Your detailed instructions go here in Markdown format. -` + "```" + ` - -### Frontmatter Fields -- ` + "`model`" + `: (OPTIONAL) Model to use (e.g., 'gpt-5.1', 'claude-sonnet-4-5') -- ` + "`provider`" + `: (OPTIONAL) Provider alias from models.json -- ` + "`tools`" + `: (OPTIONAL) Object containing tool definitions - -### Instructions (Body) -The Markdown body after the frontmatter contains the agent's instructions. Use standard Markdown formatting. - -### Naming Rules -- Agent filename determines the agent name (without .md extension) -- Example: ` + "`summariser_agent.md`" + ` creates an agent named "summariser_agent" -- Use lowercase with underscores for multi-word names -- No spaces or special characters in names -- **The agent name in agent-schedule.json must match the filename** (without .md) - -### Agent Format Example -` + "```markdown" + ` ---- -model: gpt-5.1 -tools: - search: - type: mcp - name: firecrawl_search - description: Search the web - mcpServerName: firecrawl - inputSchema: - type: object - properties: - query: - type: string - description: Search query - required: - - query ---- -# Web Search Agent - -You are a web search agent. When asked a question: - -1. Use the search tool to find relevant information -2. Summarize the results clearly -3. Cite your sources - -Be concise and accurate. -` + "```" + ` - -## Tool Types & Schemas - -Tools in agents must follow one of three types. Each has specific required fields. - -### 1. Builtin Tools -Internal Rowboat tools (executeCommand, file operations, MCP queries, etc.) - -**YAML Schema:** -` + "```yaml" + ` -tool_key: - type: builtin - name: tool_name -` + "```" + ` - -**Required fields:** -- ` + "`type`" + `: Must be "builtin" -- ` + "`name`" + `: Builtin tool name (e.g., "executeCommand", "workspace-readFile") - -**Example:** -` + "```yaml" + ` -bash: - type: builtin - name: executeCommand -` + "```" + ` - -**Available builtin tools:** -- ` + "`executeCommand`" + ` - Execute shell commands -- ` + "`workspace-readFile`" + `, ` + "`workspace-writeFile`" + `, ` + "`workspace-remove`" + ` - File operations -- ` + "`workspace-readdir`" + `, ` + "`workspace-exists`" + `, ` + "`workspace-stat`" + ` - Directory operations -- ` + "`workspace-mkdir`" + `, ` + "`workspace-rename`" + `, ` + "`workspace-copy`" + ` - File/directory management -- ` + "`analyzeAgent`" + ` - Analyze agent structure -- ` + "`addMcpServer`" + `, ` + "`listMcpServers`" + `, ` + "`listMcpTools`" + ` - MCP management -- ` + "`loadSkill`" + ` - Load skill guidance - -### 2. MCP Tools -Tools from external MCP servers (APIs, databases, web scraping, etc.) - -**YAML Schema:** -` + "```yaml" + ` -tool_key: - type: mcp - name: tool_name_from_server - description: What the tool does - mcpServerName: server_name_from_config - inputSchema: - type: object - properties: - param: - type: string - description: Parameter description - required: - - param -` + "```" + ` - -**Required fields:** -- ` + "`type`" + `: Must be "mcp" -- ` + "`name`" + `: Exact tool name from MCP server -- ` + "`description`" + `: What the tool does (helps agent understand when to use it) -- ` + "`mcpServerName`" + `: Server name from config/mcp.json -- ` + "`inputSchema`" + `: Full JSON Schema object for tool parameters - -**Example:** -` + "```yaml" + ` -search: - type: mcp - name: firecrawl_search - description: Search the web - mcpServerName: firecrawl - inputSchema: - type: object - properties: - query: - type: string - description: Search query - required: - - query -` + "```" + ` - -**Important:** -- Use ` + "`listMcpTools`" + ` to get the exact inputSchema from the server -- Copy the schema exactly—don't modify property types or structure -- Only include ` + "`required`" + ` array if parameters are mandatory - -### 3. Agent Tools (for chaining agents) -Reference other agents as tools to build multi-agent workflows - -**YAML Schema:** -` + "```yaml" + ` -tool_key: - type: agent - name: target_agent_name -` + "```" + ` - -**Required fields:** -- ` + "`type`" + `: Must be "agent" -- ` + "`name`" + `: Name of the target agent (must exist in agents/ directory) - -**Example:** -` + "```yaml" + ` -summariser: - type: agent - name: summariser_agent -` + "```" + ` - -**How it works:** -- Use ` + "`type: agent`" + ` to call other agents as tools -- The target agent will be invoked with the parameters you pass -- Results are returned as tool output -- This is how you build multi-agent workflows -- The referenced agent file must exist (e.g., ` + "`agents/summariser_agent.md`" + `) - -## Complete Multi-Agent Workflow Example - -**Email digest workflow** - This is all done through agents calling other agents: - -**1. Task-specific agent** (` + "`agents/email_reader.md`" + `): -` + "```markdown" + ` ---- -model: gpt-5.1 -tools: - read_file: - type: builtin - name: workspace-readFile - list_dir: - type: builtin - name: workspace-readdir ---- -# Email Reader Agent - -Read emails from the gmail_sync folder and extract key information. -Look for unread or recent emails and summarize the sender, subject, and key points. -Don't ask for human input. -` + "```" + ` - -**2. Agent that delegates to other agents** (` + "`agents/daily_summary.md`" + `): -` + "```markdown" + ` ---- -model: gpt-5.1 -tools: - email_reader: - type: agent - name: email_reader - write_file: - type: builtin - name: workspace-writeFile ---- -# Daily Summary Agent - -1. Use the email_reader tool to get email summaries -2. Create a consolidated daily digest -3. Save the digest to ~/Desktop/daily_digest.md - -Don't ask for human input. -` + "```" + ` - -Note: The output path (` + "`~/Desktop/daily_digest.md`" + `) is hardcoded in the instructions. When creating agents that output files, always ask the user where they want files saved and include the full path in the agent instructions. - -**3. Orchestrator agent** (` + "`agents/morning_briefing.md`" + `): -` + "```markdown" + ` ---- -model: gpt-5.1 -tools: - daily_summary: - type: agent - name: daily_summary - search: - type: mcp - name: search - mcpServerName: exa - description: Search the web for news - inputSchema: - type: object - properties: - query: - type: string - description: Search query ---- -# Morning Briefing Workflow - -Create a morning briefing: - -1. Get email digest using daily_summary -2. Search for relevant news using the search tool -3. Compile a comprehensive morning briefing - -Execute these steps in sequence. Don't ask for human input. -` + "```" + ` - -**4. Schedule the workflow** in ` + "`~/.rowboat/config/agent-schedule.json`" + `: -` + "```json" + ` -{ - "agents": { - "morning_briefing": { - "schedule": { - "type": "cron", - "expression": "0 7 * * *" - }, - "enabled": true, - "startingMessage": "Create my morning briefing for today" - } - } -} -` + "```" + ` - -This schedules the morning briefing workflow to run every day at 7am local time. - -## Naming and organization rules -- **All agents live in ` + "`agents/*.md`" + `** - Markdown files with YAML frontmatter -- Agent filename (without .md) becomes the agent name -- When referencing an agent as a tool, use its filename without extension -- When scheduling an agent, use its filename without extension in agent-schedule.json -- Use relative paths (no \${BASE_DIR} prefixes) when giving examples to users - -## Best practices for background agents -1. **Single responsibility**: Each agent should do one specific thing well -2. **Clear delegation**: Agent instructions should explicitly say when to call other agents -3. **Autonomous operation**: Add "Don't ask for human input" for background agents -4. **Data passing**: Make it clear what data to extract and pass between agents -5. **Tool naming**: Use descriptive tool keys (e.g., "summariser", "fetch_data", "analyze") -6. **Orchestration**: Create a top-level agent that coordinates the workflow -7. **Scheduling**: Use appropriate schedule types - cron for recurring, window for flexible timing, once for one-time tasks -8. **Error handling**: Background agents should handle errors gracefully since there's no human to intervene -9. **Avoid executeCommand**: Do NOT attach ` + "`executeCommand`" + ` to background agents as it poses security risks when running unattended. Instead, use the specific builtin tools needed (` + "`workspace-readFile`" + `, ` + "`workspace-writeFile`" + `, etc.) or MCP tools for external integrations -10. **File output paths**: When creating an agent that outputs files, ASK the user where the file should be stored (default to Desktop: ` + "`~/Desktop`" + `). Then hardcode the full output path in the agent's instructions so it knows exactly where to write files. Example instruction: "Save the output to /Users/username/Desktop/daily_report.md" - -## Validation & Best Practices - -### CRITICAL: Schema Compliance -- Agent files MUST be valid Markdown with YAML frontmatter -- Agent filename (without .md) becomes the agent name -- Tools in frontmatter MUST have valid ` + "`type`" + ` ("builtin", "mcp", or "agent") -- MCP tools MUST have all required fields: name, description, mcpServerName, inputSchema -- Agent tools MUST reference existing agent files -- Invalid agents will fail to load and prevent workflow execution - -### File Creation/Update Process -1. When creating an agent, use ` + "`workspace-writeFile`" + ` with valid Markdown + YAML frontmatter -2. When updating an agent, read it first with ` + "`workspace-readFile`" + `, modify, then use ` + "`workspace-writeFile`" + ` -3. Validate YAML syntax in frontmatter before writing—malformed YAML breaks the agent -4. **Quote strings containing colons** (e.g., ` + "`description: \"Default: 8\"`" + ` not ` + "`description: Default: 8`" + `) -5. Test agent loading after creation/update by using ` + "`analyzeAgent`" + ` - -### Common Validation Errors to Avoid - -❌ **WRONG - Missing frontmatter delimiters:** -` + "```markdown" + ` -model: gpt-5.1 -# My Agent -Instructions here -` + "```" + ` - -❌ **WRONG - Invalid YAML indentation:** -` + "```markdown" + ` ---- -tools: -bash: - type: builtin ---- -` + "```" + ` -(bash should be indented under tools) - -❌ **WRONG - Invalid tool type:** -` + "```yaml" + ` -tools: - tool1: - type: custom - name: something -` + "```" + ` -(type must be builtin, mcp, or agent) - -❌ **WRONG - Unquoted strings containing colons:** -` + "```yaml" + ` -tools: - search: - description: Number of results (default: 8) -` + "```" + ` -(Strings with colons must be quoted: ` + "`description: \"Number of results (default: 8)\"`" + `) - -❌ **WRONG - MCP tool missing required fields:** -` + "```yaml" + ` -tools: - search: - type: mcp - name: firecrawl_search -` + "```" + ` -(Missing: description, mcpServerName, inputSchema) - -✅ **CORRECT - Minimal valid agent** (` + "`agents/simple_agent.md`" + `): -` + "```markdown" + ` ---- -model: gpt-5.1 ---- -# Simple Agent - -Do simple tasks as instructed. -` + "```" + ` - -✅ **CORRECT - Agent with MCP tool** (` + "`agents/search_agent.md`" + `): -` + "```markdown" + ` ---- -model: gpt-5.1 -tools: - search: - type: mcp - name: firecrawl_search - description: Search the web - mcpServerName: firecrawl - inputSchema: - type: object - properties: - query: - type: string ---- -# Search Agent - -Use the search tool to find information on the web. -` + "```" + ` - -## Capabilities checklist -1. Explore ` + "`agents/`" + ` directory to understand existing agents before editing -2. Read existing agents with ` + "`workspace-readFile`" + ` before making changes -3. Validate YAML frontmatter syntax before creating/updating agents -4. Use ` + "`analyzeAgent`" + ` to verify agent structure after creation/update -5. When creating multi-agent workflows, create an orchestrator agent -6. Add other agents as tools with ` + "`type: agent`" + ` for chaining -7. Use ` + "`listMcpServers`" + ` and ` + "`listMcpTools`" + ` when adding MCP integrations -8. Configure schedules in ` + "`~/.rowboat/config/agent-schedule.json`" + ` (ONLY edit this file, NOT the state file) -9. Confirm work done and outline next steps once changes are complete -`; - -export default skill; diff --git a/apps/x/packages/core/src/application/assistant/skills/builtin-tools/skill.ts b/apps/x/packages/core/src/application/assistant/skills/builtin-tools/skill.ts deleted file mode 100644 index 0113a726..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/builtin-tools/skill.ts +++ /dev/null @@ -1,228 +0,0 @@ -export const skill = String.raw` -# Builtin Tools Reference - -Load this skill when creating or modifying agents that need access to Rowboat's builtin tools (shell execution, file operations, etc.). - -## Available Builtin Tools - -Agents can use builtin tools by declaring them in the YAML frontmatter \`tools\` section with \`type: builtin\` and the appropriate \`name\`. - -### executeCommand -**The most powerful and versatile builtin tool** - Execute any bash/shell command and get the output. - -**Security note:** Commands are filtered through \`.rowboat/config/security.json\`. Populate this file with allowed command names (array or dictionary entries). Any command not present is blocked and returns exit code 126 so the agent knows it violated the policy. - -**Agent tool declaration (YAML frontmatter):** -\`\`\`yaml -tools: - bash: - type: builtin - name: executeCommand -\`\`\` - -**What it can do:** -- Run package managers (npm, pip, apt, brew, cargo, go get, etc.) -- Git operations (clone, commit, push, pull, status, diff, log, etc.) -- System operations (ps, top, df, du, find, grep, kill, etc.) -- Build and compilation (make, cargo build, go build, npm run build, etc.) -- Network operations (curl, wget, ping, ssh, netstat, etc.) -- Text processing (awk, sed, grep, jq, yq, cut, sort, uniq, etc.) -- Database operations (psql, mysql, mongo, redis-cli, etc.) -- Container operations (docker, kubectl, podman, etc.) -- Testing and debugging (pytest, jest, cargo test, etc.) -- File operations (cat, head, tail, wc, diff, patch, etc.) -- Any CLI tool or script execution - -**Agent instruction examples:** -- "Use the bash tool to run git commands for version control operations" -- "Execute curl commands using the bash tool to fetch data from APIs" -- "Use bash to run 'npm install' and 'npm test' commands" -- "Run Python scripts using the bash tool with 'python script.py'" -- "Use bash to execute 'docker ps' and inspect container status" -- "Run database queries using 'psql' or 'mysql' commands via bash" -- "Use bash to execute system monitoring commands like 'top' or 'ps aux'" - -**Pro tips for agent instructions:** -- Commands can be chained with && for sequential execution -- Use pipes (|) to combine Unix tools (e.g., "cat file.txt | grep pattern | wc -l") -- Redirect output with > or >> when needed -- Full bash shell features are available (variables, loops, conditionals, etc.) -- Tools like jq, yq, awk, sed can parse and transform data - -**Example agent with executeCommand** (\`agents/arxiv-feed-reader.md\`): -\`\`\`markdown ---- -model: gpt-5.1 -tools: - bash: - type: builtin - name: executeCommand ---- -# arXiv Feed Reader - -Extract latest papers from the arXiv feed and summarize them. - -Use curl to fetch the RSS feed, then parse it with yq and jq: - -\\\`\\\`\\\`bash -curl -s https://rss.arxiv.org/rss/cs.AI | yq -p=xml -o=json | jq -r '.rss.channel.item[] | select(.title | test("agent"; "i")) | "\\(.title)\\n\\(.link)\\n\\(.description)\\n"' -\\\`\\\`\\\` - -This will give you papers containing 'agent' in the title. -\`\`\` - -**Another example - System monitoring agent** (\`agents/system-monitor.md\`): -\`\`\`markdown ---- -model: gpt-5.1 -tools: - bash: - type: builtin - name: executeCommand ---- -# System Monitor - -Monitor system resources using bash commands: -- Use 'df -h' for disk usage -- Use 'free -h' for memory -- Use 'top -bn1' for processes -- Use 'ps aux' for process list - -Parse the output and report any issues. -\`\`\` - -**Another example - Git automation agent** (\`agents/git-helper.md\`): -\`\`\`markdown ---- -model: gpt-5.1 -tools: - bash: - type: builtin - name: executeCommand ---- -# Git Helper - -Help with git operations. Use commands like: -- 'git status' - Check working tree status -- 'git log --oneline -10' - View recent commits -- 'git diff' - See changes -- 'git branch -a' - List branches - -Can also run 'git add', 'git commit', 'git push' when instructed. -\`\`\` - -## Agent-to-Agent Calling - -Agents can call other agents as tools to create complex multi-step workflows. This is the core mechanism for building multi-agent systems in the CLI. - -**Tool declaration (YAML frontmatter):** -\`\`\`yaml -tools: - summariser: - type: agent - name: summariser_agent -\`\`\` - -**When to use:** -- Breaking complex tasks into specialized sub-agents -- Creating reusable agent components -- Orchestrating multi-step workflows -- Delegating specialized tasks (e.g., summarization, data processing, audio generation) - -**How it works:** -- The agent calls the tool like any other tool -- The target agent receives the input and processes it -- Results are returned as tool output -- The calling agent can then continue processing or delegate further - -**Example - Agent that delegates to a summarizer** (\`agents/paper_analyzer.md\`): -\`\`\`markdown ---- -model: gpt-5.1 -tools: - summariser: - type: agent - name: summariser_agent ---- -# Paper Analyzer - -Pick 2 interesting papers and summarise each using the summariser tool. -Pass the paper URL to the summariser. Don't ask for human input. -\`\`\` - -**Tips for agent chaining:** -- Make instructions explicit about when to call other agents -- Pass clear, structured data between agents -- Add "Don't ask for human input" for autonomous workflows -- Keep each agent focused on a single responsibility - -## Additional Builtin Tools - -While \`executeCommand\` is the most versatile, other builtin tools exist for specific Rowboat operations (file management, agent inspection, etc.). These are primarily used by the Rowboat copilot itself and are not typically needed in user agents. If you need file operations, consider using bash commands like \`cat\`, \`echo\`, \`tee\`, etc. through \`executeCommand\`. - -### Copilot-Specific Builtin Tools - -The Rowboat copilot has access to special builtin tools that regular agents don't typically use. These tools help the copilot assist users with workspace management and MCP integration: - -#### File & Directory Operations -- \`workspace-readdir\` - List directory contents (supports recursive exploration) -- \`workspace-readFile\` - Read file contents -- \`workspace-writeFile\` - Create or update file contents -- \`workspace-edit\` - Make precise edits by replacing specific text (safer than full rewrites) -- \`workspace-remove\` - Remove files or directories -- \`workspace-exists\` - Check if a file or directory exists -- \`workspace-stat\` - Get file/directory statistics -- \`workspace-mkdir\` - Create directories -- \`workspace-rename\` - Rename or move files/directories -- \`workspace-copy\` - Copy files -- \`workspace-getRoot\` - Get workspace root directory path -- \`workspace-glob\` - Find files matching a glob pattern (e.g., "**/*.ts", "agents/*.md") -- \`workspace-grep\` - Search file contents using regex, returns matching files and lines - -#### Agent Operations -- \`analyzeAgent\` - Read and analyze an agent file structure -- \`loadSkill\` - Load a Rowboat skill definition into context - -#### MCP Operations -- \`addMcpServer\` - Add or update an MCP server configuration (with validation) -- \`listMcpServers\` - List all available MCP servers -- \`listMcpTools\` - List all available tools from a specific MCP server -- \`executeMcpTool\` - **Execute a specific MCP tool on behalf of the user** - -#### Using executeMcpTool as Copilot - -The \`executeMcpTool\` builtin allows the copilot to directly execute MCP tools without creating an agent. Load the "mcp-integration" skill for complete guidance on discovering and executing MCP tools, including workflows, schema matching, and examples. - -**When to use executeMcpTool vs creating an agent:** -- Use \`executeMcpTool\` for immediate, one-time tasks -- Create an agent when the user needs repeated use or autonomous operation -- Create an agent for complex multi-step workflows involving multiple tools - -## Best Practices - -1. **Give agents clear examples** in their instructions showing exact bash commands to run -2. **Explain output parsing** - show how to use jq, yq, grep, awk to extract data -3. **Chain commands efficiently** - use && for sequences, | for pipes -4. **Handle errors** - remind agents to check exit codes and stderr -5. **Be specific** - provide example commands rather than generic descriptions -6. **Security** - remind agents to validate inputs and avoid dangerous operations - -## When to Use Builtin Tools vs MCP Tools vs Agent Tools - -- **Use builtin executeCommand** when you need: CLI tools, system operations, data processing, git operations, any shell command -- **Use MCP tools** when you need: Web scraping (firecrawl), text-to-speech (elevenlabs), specialized APIs, external service integrations -- **Use agent tools (\`type: agent\`)** when you need: Complex multi-step logic, task delegation, specialized processing that benefits from LLM reasoning - -Many tasks can be accomplished with just \`executeCommand\` and common Unix tools - it's incredibly powerful! - -## Key Insight: Multi-Agent Workflows - -In the CLI, multi-agent workflows are built by: -1. Creating specialized agents as Markdown files in the \`agents/\` directory -2. Creating an orchestrator agent that has other agents in its \`tools\` (YAML frontmatter) -3. Running the orchestrator with \`rowboatx --agent orchestrator_name\` - -There are no separate "workflow" files - everything is an agent defined in Markdown! -`; - -export default skill; diff --git a/apps/x/packages/core/src/application/assistant/skills/create-presentations/skill.ts b/apps/x/packages/core/src/application/assistant/skills/create-presentations/skill.ts deleted file mode 100644 index f3dd4d03..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/create-presentations/skill.ts +++ /dev/null @@ -1,2744 +0,0 @@ -export const skill = String.raw` -# PDF Presentation Skill - -## Theme Selection - -If the user specifies a visual theme, colors, or brand guidelines, use those. If they do NOT specify a theme, **do not ask** — pick the best fit based on the topic and audience: - -- **Dark Professional** — Deep navy/charcoal backgrounds, indigo (#6366f1) and violet (#8b5cf6) accents, white text. Best for: tech, SaaS, keynotes, engineering. -- **Light Editorial** — White/warm cream backgrounds, amber (#f59e0b) and stone accents, dark text with serif headings. Best for: reports, proposals, thought leadership, research. -- **Bold Vibrant** — Mixed dark and light slides, emerald (#10b981) and rose (#f43e5c) accents, high contrast. Best for: pitch decks, marketing, creative, fundraising. - -Note the theme used at the end of delivery so the user can request a swap if they prefer a different look. - -## Visual Consistency Rules - -Every presentation must have a unified color theme applied across ALL slides. Do not mix unrelated color palettes between slides. - -1. **Define a theme palette upfront** — Pick one primary color, one accent color, and one neutral base (dark or light). Use these consistently across every slide. -2. **Backgrounds** — Use at most 2-3 background variations (e.g. dark base, light base, and primary color). Alternate them for rhythm but keep them from the same palette. -3. **Accent color** — Use the same accent color for all highlights: overlines, bullets, icons, chart fills, timeline dots, CTA buttons, divider lines. -4. **Typography colors** — Headings, body text, and muted text should use the same tones on every slide. Don't switch between warm and cool grays mid-deck. -5. **Charts and data** — Use shades/tints of the primary and accent colors for chart fills. Never introduce one-off colors that don't appear elsewhere in the deck. -6. **Consistent fonts** — Pick one heading font and one body font. Use them on every slide. Don't mix different heading fonts across slides. - -## Critical: One Theme Per Deck - -The example layouts in this document each use different colors and styles for showcase purposes only. When building an actual presentation, pick ONE theme and apply it consistently to EVERY slide. Borrow layout structures and patterns from the examples, but replace all colors, fonts, and backgrounds with your chosen theme's palette. Never copy the example colors verbatim — adapt them to the unified theme. - -### Visual Consistency Rules - -Every presentation must have a unified color theme applied across ALL slides. This is the #1 most important design rule. A deck where every slide looks like it belongs together is always better than a deck with individually beautiful but visually inconsistent slides. - -#### Background Strategy (STRICT) -Pick ONE dominant background tone and use it for 80%+ of slides. Add subtle variation within that tone — never alternate between dark and light backgrounds. - -##### For dark themes: - -Deep base (e.g. #0f172a) — use for title, section dividers, closing (primary background) -Medium base (e.g. #1e293b or #111827) — use for content slides, charts, tables (secondary background) -Accent pop (e.g. #6366f1) — use for 1-2 key stat or quote slides only (rare emphasis) -NEVER use white or light backgrounds in a dark-themed deck. Data tables, team grids, and other content that "feels light" should still use the dark palette with adjusted contrast. - -##### For light themes: - -Light base (e.g. #fafaf9 or #ffffff) — use for most content slides (primary background) -Warm tint (e.g. #fefce8 or #f8fafc) — use for alternation and visual rhythm (secondary background) -Accent pop (e.g. the theme's primary color) — use for 1-2 key stat or quote slides only (rare emphasis) -NEVER use dark/navy backgrounds in a light-themed deck. - -Never alternate between dark and light backgrounds. This creates a jarring strobe effect and breaks visual cohesion. The audience's eyes have to constantly readjust. Instead, create rhythm through subtle shade variation within the same tone family. -Never use more than 3 background color values across the entire deck. - -#### Color & Typography Rules - -Define a theme palette upfront — Pick one primary color, one accent color, and one neutral base (dark or light). Use these consistently across every slide. Write these as CSS variables and reference them everywhere. -Accent color — Use the SAME accent color for ALL highlights across the entire deck: overlines, bullets, icons, chart fills, timeline dots, CTA buttons, divider lines. Do not use different accent colors on different slides. -Typography colors — Headings, body text, and muted text should use the same tones on every slide. Don't switch between warm and cool grays mid-deck. -Charts and data — Use shades/tints of the primary and accent colors for chart fills. Never introduce one-off colors that don't appear elsewhere in the deck. -Consistent fonts — Pick one heading font and one body font. Use them on every slide. Don't mix different heading fonts across slides. - -#### Title Slide Rules - -Title text must span the FULL slide width. Never place a decorative element beside the title that competes for horizontal space. -Title slides should use a single-column, vertically-stacked layout: overline → title → subtitle → optional tags/pills. No side-by-side elements on title slides. -If a decorative visual is needed, place it BEHIND the text (as a CSS background, gradient, or pseudo-element), never beside it. -Title font-size must not exceed 64px. For titles longer than 5 words, use 48px max. - -## Content Planning (Do This Before Building) - -Before writing any HTML, plan the narrative arc: - -1. **Hook** — What's the opening statement or question that grabs attention? -2. **Core argument** — What's the one thing the audience should remember? -3. **Supporting evidence** — What data, examples, or frameworks back it up? -4. **Call to action** — What should the audience do next? - -Map each point to a slide layout from the Available Layout Types below. For a typical presentation, generate **8-15 slides**: title + agenda (optional) + 6-10 content slides + closing. Don't pad with filler — every slide should earn its place. Use layout variety — never use the same layout for consecutive slides. - -## Workflow - -1. Use workspace-readFile to check knowledge/ for relevant context about the company, product, team, etc. -2. Ensure Playwright is installed: \`npm install playwright && npx playwright install chromium\` -3. Use workspace-getRoot to get the workspace root path. -4. Plan the narrative arc and slide outline (see Content Planning above). -5. Use workspace-writeFile to create the HTML file at tmp/presentation.html (workspace-relative) with slides (1280x720px each). -6. **Perform the Post-Generation Validation (see below). Fix any issues before proceeding.** -7. Use workspace-writeFile to create the conversion script at tmp/convert.js (workspace-relative) — see Playwright Export section. -8. Run it: \`node /tmp/convert.js\` -9. Tell the user: "Your presentation is ready at ~/Desktop/presentation.pdf" and note the theme used. - -**Critical**: Never show HTML code to the user. Never ask the user to run commands, install packages, or make technical decisions. The entire pipeline from content to PDF must be invisible to the user. - -Use workspace-writeFile and workspace-readFile for ALL file operations. Do NOT use executeCommand to write or read files. - -## Post-Generation Validation (REQUIRED) - -After generating the slide HTML, perform ALL of these checks before converting to PDF: - -1. **Title overflow check**: For every slide, verify that the title text at its set font-size fits within the slide width (1280px) minus padding (120px total). If \`title_chars × 0.6 × font_size > 1160\`, reduce font-size. Use these max sizes: - - Short titles (1-3 words): 72px max - - Medium titles (4-6 words): 56px max - - Long titles (7+ words): 44px max - Apply \`word-wrap: break-word\` and \`overflow-wrap: break-word\` to all title elements. Never use \`white-space: nowrap\` on titles. - -2. **Content bounds check**: Verify no element extends beyond the 1280x720 slide boundary. Look for: long titles, bullet lists with 6+ items, wide tables, long labels on charts, text that wraps more lines than the available height allows. - -3. **Broken visuals check**: Confirm no \`\` tags reference external URLs. All visuals must be CSS, SVG, or emoji only. Never use external images — they will fail in PDF rendering. Use CSS shapes, gradients, SVG, or emoji for all visual elements. - -4. **Font loading check**: Verify the Google Fonts \`\` tag includes ALL font families used in the CSS. Missing fonts cause fallback rendering and broken typography. - -5. **Theme consistency check**: Confirm all slides use the same palette — no rogue colors in charts, backgrounds, or text that don't belong to the chosen theme. - -6. **Fix before proceeding**: If any check fails, fix the HTML before PDF conversion. Do not proceed with known issues. - -## PDF Export Rules - -These rules prevent rendering issues in PDF. Violating them causes overlapping rectangles and broken layouts. - -1. **No layered elements** — Never create separate elements for backgrounds or shadows. Style content elements directly. -2. **No box-shadow** — Use borders instead: \`border: 1px solid #e5e7eb\` -3. **Bullets via CSS only** — Use \`li::before\` pseudo-elements, not separate DOM elements. -4. **Content must fit** — Slides are 1280x720px with 60px padding. Safe content area is 1160x600px. Use \`overflow: hidden\`. -5. **No footers or headers** — Never add fixed/absolute-positioned footer or header elements to slides. They overlap with content in PDF rendering. If you need a slide number or title, include it as part of the normal content flow. -6. **No external images** — All visuals must be CSS, SVG, or emoji. External image URLs will render as broken white boxes in PDF. - -## Required CSS - -\`\`\`css -@page { size: 1280px 720px; margin: 0; } -html { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; } -.slide { - width: 1280px; - height: 720px; - padding: 60px; - overflow: hidden; - page-break-after: always; - page-break-inside: avoid; -} -.slide:last-child { page-break-after: auto; } -\`\`\` - -## Playwright Export - -\`\`\`javascript -// save as tmp/convert.js via workspace-writeFile -const { chromium } = require('playwright'); -const path = require('path'); - -(async () => { - const browser = await chromium.launch(); - const page = await browser.newPage(); - // Replace with the actual absolute path from workspace-getRoot - await page.goto('file:///tmp/presentation.html', { waitUntil: 'networkidle' }); - await page.pdf({ - path: path.join(process.env.HOME, 'Desktop', 'presentation.pdf'), - width: '1280px', - height: '720px', - printBackground: true, - }); - await browser.close(); - console.log('Done: ~/Desktop/presentation.pdf'); -})(); -\`\`\` - -Replace \`\` with the actual absolute path returned by workspace-getRoot. - -## Available Layout Types (35 Templates) - -Use these as reference when building presentations. Pick the appropriate layout for each slide based on the content type. Mix and match for visual variety. - -### Title & Structure Slides -1. **Title Slide (Dark Gradient)** — Hero opening with gradient text and atmospheric glow -2. **Title Slide (Light Editorial)** — Clean, warm serif typography with editorial feel -3. **Section Divider** — Chapter break with oversized background number -4. **Agenda / Table of Contents** — Serif title with numbered items and descriptions -5. **Full-Bleed Cinematic** — Atmospheric background with grid texture, orbs, and bottom-aligned content - -### Content Slides -6. **Big Statement / Quote** — Full-color background with bold quote or key takeaway -7. **Big Stat Number** — Single dramatic metric with context text -8. **Bullet List (Split Panel)** — Dark sidebar title + light content area with icon bullets -9. **Numbered List** — Ordered steps in numbered cards -10. **Two Columns** — Side-by-side content cards -11. **Three Columns with Icons** — Feature cards with icon accents -12. **Image + Text** — Visual panel left, content + CTA right -13. **Image Gallery (2x2)** — Grid of captioned visual cards using CSS gradient backgrounds - -### Chart & Data Slides -14. **Bar Chart (Vertical)** — Vertical bars with gradient fills and labels -15. **Horizontal Bar Chart** — Ranked bars for lists with long labels -16. **Stacked Bar Chart** — Segmented bars showing composition/breakdown -17. **Combo Chart (Bar + Line)** — SVG bars for volume + line for growth rate -18. **Donut Chart** — CSS conic-gradient donut with legend -19. **Line Chart (SVG)** — SVG polyline with area fill and data labels -20. **KPI Dashboard** — Color-coded metric cards with change indicators -21. **Data Table** — Styled rows with colored header and status badges -22. **Feature Matrix** — Checkmark comparison table (features x tiers) - -### Diagram Slides -23. **Horizontal Timeline** — Connected milestone dots on a horizontal axis -24. **Vertical Timeline** — Left-rail progression of milestones -25. **Process Flow** — Step cards connected with arrows -26. **Funnel Diagram** — Tapered width bars showing conversion stages -27. **Pyramid Diagram** — Tiered hierarchy showing levels/priorities -28. **Cycle Diagram** — Flywheel/feedback loop with circular node arrangement -29. **Venn Diagram** — Three translucent overlapping circles -30. **2x2 Matrix** — Four color-coded quadrants with axis labels - -### Comparison Slides -31. **Comparison / Vs** — Split layout with contrasting colors for A vs B -32. **Pros & Cons** — Checkmarks vs. warnings in two columns -33. **Pricing Table** — Tiered cards with featured highlight - -### People & Closing Slides -34. **Team Grid** — Avatar circles with role descriptions -35. **Thank You / CTA** — Atmospheric closing with contact details - -### Layout Selection Heuristic - -For each slide, identify the content type and pick the matching layout: - -| Content Type | Best Layouts | -|---|---| -| Opening / hook | Title Slide, Full-Bleed Cinematic | -| Agenda / overview | Agenda/TOC | -| Key metric or stat | Big Stat Number, KPI Dashboard | -| List of points | Bullet List, Numbered List | -| Features or pillars | Three Columns, Two Columns | -| Trend over time | Line Chart, Horizontal Timeline | -| Composition / breakdown | Donut Chart, Stacked Bar, Pie | -| Ranking | Horizontal Bar Chart | -| Comparison | Vs Slide, Pros & Cons | -| Process or steps | Process Flow, Vertical Timeline | -| Hierarchy | Pyramid Diagram | -| Feedback loop | Cycle Diagram | -| Overlap / intersection | Venn Diagram | -| Prioritization | 2x2 Matrix | -| Data details | Data Table, Feature Matrix | -| Pricing | Pricing Table | -| Emotional / cinematic | Big Statement, Full-Bleed Cinematic | -| Team intro | Team Grid | -| Closing | Thank You / CTA | - -Never use the same layout for consecutive slides. Alternate between dark and light backgrounds for rhythm. - -### Design Guidelines - -- Use Google Fonts loaded via \`\` tag. Recommended pairings: - - **Primary pair**: Outfit (headings) + DM Sans (body) — works for most decks - - **Editorial pair**: Playfair Display (headings) + DM Sans (body) — for reports/proposals - - **Accent fonts**: Space Mono (overlines, labels), Crimson Pro (quotes) -- Dark slides: use subtle radial gradients for atmosphere, semi-transparent overlays for depth -- Light slides: use warm neutrals, clean borders, and ample whitespace -- Charts: use CSS (conic-gradient for donuts, inline styles for bar heights) or inline SVG for line/combo charts -- Typography hierarchy: monospace overlines for labels -> sans-serif for headings -> serif for editorial/quotes -- Cards: use \`border-radius: 12-16px\`, subtle borders (\`rgba(255,255,255,0.08)\` on dark), no box-shadow (PDF rule) -- All visuals must be CSS, SVG, or emoji — no external images - -### HTML Template Examples - - - - - - -Slide Deck Templates — The Future of AI Coworkers - - - - - - - - -
- -
Dark Gradient Title
-
Hero opening slide with gradient text and atmospheric glow
-
-
-
Keynote 2026
-

The Future of
AI Coworkers

-
How intelligent agents are transforming collaboration, creativity, and the way teams build together.
-
-
-
- - -
- -
Light Editorial Title
-
Clean, warm title slide with serif typography and an editorial feel
-
-
-
Industry Report 2026
-

Working Alongside AI

-
A comprehensive look at how AI coworkers are augmenting human potential across every industry, from startups to the Fortune 500.
-
-
-
- - -
- -
Chapter Break
-
Dramatic section separator with oversized background number
-
-
-
01
-
-
Section One
-

The Rise of Intelligent Collaboration

-
-
-
-
-
- - -
- -
Big Statement Slide
-
Full-color background with a bold quote or key takeaway
-
-
-
AI coworkers don't replace human creativity — they amplify it, handling the routine so teams can focus on the extraordinary.
-
— Annual Workplace Intelligence Report, 2026
-
-
-
- - -
- -
Split Panel with Bullets
-
Dark sidebar with title, light content area with icon-accented bullets
-
-
-
-
-

Key Benefits of AI Coworkers

-
-
-
-
-
-

10x Faster Research

-

AI agents synthesize thousands of documents in seconds, surfacing insights that would take humans weeks.

-
-
-
-
🎯
-
-

Proactive Task Management

-

Intelligent assistants anticipate next steps, draft follow-ups, and keep projects on track automatically.

-
-
-
-
🤝
-
-

Always-On Collaboration

-

AI coworkers bridge time zones, summarize meetings, and ensure no team member is ever out of the loop.

-
-
-
-
📈
-
-

Continuous Learning

-

Each interaction makes the AI smarter — building a compounding knowledge base for your entire organization.

-
-
-
-
-
-
- - -
- -
Warm Two-Column Layout
-
Side-by-side content cards on a warm yellow background
-
-
-
-

Two Modes of AI Collaboration

-
Framework
-
-
-
-

🧠 Thinking Partner

-

AI coworkers serve as brainstorming partners that challenge assumptions, offer alternative perspectives, and help teams explore ideas they wouldn't have considered alone. They bring pattern recognition across vast datasets to creative problem-solving sessions.

-
-
-

⚙️ Execution Engine

-

From drafting reports to analyzing data pipelines, AI coworkers handle the heavy lifting of execution. They turn rough outlines into polished deliverables, automate repetitive workflows, and free humans to focus on strategy and relationship building.

-
-
-
-
-
- - -
- -
Dark Three-Column Feature Cards
-
Glassmorphic cards with icon accents on a dark background
-
-
-

Core Capabilities

-
-
-
🔍
-

Deep Research

-

Analyze millions of data points across your organization's knowledge base to surface critical insights and connections.

-
-
-
✍️
-

Content Creation

-

Draft, edit, and refine documents, presentations, and communications tailored to your brand voice and standards.

-
-
-
🔗
-

Workflow Orchestration

-

Connect tools, automate handoffs, and ensure seamless execution across your entire tech stack and team.

-
-
-
-
-
- - -
- -
Vertical Bar Chart
-
Clean data visualization with gradient bars on white
-
-
-

Productivity Gains by Department

-
Average hours saved per week after AI coworker deployment
-
-
-
-
18h
-
-
Engineering
-
-
-
-
15h
-
-
Marketing
-
-
-
-
22h
-
-
Sales
-
-
-
-
13h
-
-
Design
-
-
-
-
20h
-
-
Operations
-
-
-
-
16h
-
-
Finance
-
-
-
-
14h
-
-
HR
-
-
-
-
-
- - -
- -
Donut Chart with Legend
-
Dark split layout with donut visualization and data legend
-
-
-
-

How Teams Use AI Coworkers

-
Survey of 5,000+ professionals on their primary use cases for AI collaboration in the workplace.
-
-
Research & Analysis — 42%
-
Content Drafting — 26%
-
Code & Engineering — 17%
-
Meeting Summaries — 15%
-
-
-
-
-
-
5K+
-
respondents
-
-
-
-
-
- - -
- -
Trend Line Chart
-
Light green theme with SVG line chart showing growth trajectory
-
-
-

AI Coworker Adoption Rate

-
Percentage of Fortune 500 companies with deployed AI agents, 2022–2026
- - - - - - - - - - 0% - 25% - 50% - 75% - 100% - - - - - - - - - - - - - - - - - - - 2021 - 2022 - 2023 - 2024 - 2025 - 2026 - - 10% - 19% - 35% - 60% - 84% - 99% - -
-
-
- - -
- -
Evolution Timeline
-
Dark purple with connected milestone dots and descriptions
-
-
-

The Evolution of AI Coworkers

-
-
-
2020
-
-
Basic Chatbots
-
Simple Q&A bots handling repetitive customer queries
-
-
-
2022
-
-
LLM Assistants
-
General-purpose AI for writing, analysis, and coding tasks
-
-
-
2024
-
-
AI Agents
-
Autonomous agents that plan, execute, and iterate on complex workflows
-
-
-
2026
-
-
AI Coworkers
-
Persistent, context-aware teammates with memory and deep integrations
-
-
-
-
-
- - -
- -
Light Vertical Timeline
-
Clean white layout with a vertical progression of milestones
-
-
-
Roadmap
-
-
-
Q1 2026
-

Launch AI Knowledge Graph

-

Persistent memory layer that maps relationships across all work data — emails, meetings, docs.

-
-
-
Q2 2026
-

Multi-Agent Orchestration

-

Deploy specialized agents that collaborate — research agent, writing agent, code agent — working in concert.

-
-
-
Q3 2026
-

Proactive Insights Engine

-

AI coworker surfaces insights before you ask — flagging risks, opportunities, and action items automatically.

-
-
-
Q4 2026
-

Full Workflow Autonomy

-

End-to-end autonomous task completion with human-in-the-loop oversight for critical decisions.

-
-
-
-
-
- - -
- -
Step-by-Step Process
-
Ocean blue gradient with connected process steps and arrows
-
-
-

How AI Coworkers Learn Your Workflow

-
-
-
01
-

Connect

-

Integrate with your tools — email, calendar, Slack, docs

-
-
-
-
02
-

Observe

-

AI maps your workflows, relationships, and patterns

-
-
-
-
03
-

Assist

-

Proactively suggests actions and drafts deliverables

-
-
-
-
04
-

Evolve

-

Gets smarter with every interaction, compounding value

-
-
-
-
-
- - -
- -
Metrics Dashboard
-
Dark zinc theme with color-coded metric cards
-
-
-

Impact Metrics — Q4 2026

-
-
-
Tasks Automated
-
12.4K
-
34% vs Q3
-
-
-
Hours Saved / Week
-
847
-
22% vs Q3
-
-
-
Team Satisfaction
-
94%
-
8pts vs Q3
-
-
-
ROI Multiple
-
11.2x
-
2.1x vs Q3
-
-
-
-
-
- - -
- -
Side-by-Side Comparison
-
Split layout with contrasting colors for before/after or A vs B
-
-
-
-

Traditional Workflow

-
    -
  • Manual research across scattered sources
  • -
  • Hours spent formatting reports and decks
  • -
  • Context lost between meetings and tools
  • -
  • Repetitive tasks drain creative energy
  • -
  • Knowledge silos across the org
  • -
-
-
VS
-
-

With AI Coworkers

-
    -
  • Instant synthesis from all data sources
  • -
  • Auto-generated first drafts in seconds
  • -
  • Persistent memory across every interaction
  • -
  • Automation frees focus for high-impact work
  • -
  • Shared intelligence for the entire team
  • -
-
-
-
-
- - -
- -
Tiered Pricing
-
Dark theme with featured tier highlight
-
-
-

Choose Your AI Coworker Plan

-
-
-
Starter
-
$29/mo
-
For individuals getting started
-
    -
  • 1 AI coworker agent
  • -
  • 5 tool integrations
  • -
  • 10K messages / month
  • -
  • 7-day memory window
  • -
-
- -
-
Enterprise
-
Custom
-
For large organizations
-
    -
  • Unlimited agents
  • -
  • Custom model training
  • -
  • SSO & compliance
  • -
  • Dedicated support
  • -
  • On-premise option
  • -
-
-
-
-
-
- - -
- -
Team Members
-
Light layout with avatar circles and role descriptions
-
-
-

Meet Your AI Team

-
-
-
🔬
-

Research Agent

-
Deep Analysis
-
Scans thousands of sources to deliver synthesized insights in seconds
-
-
-
✏️
-

Writing Agent

-
Content Creation
-
Drafts, edits, and polishes documents in your brand voice
-
-
-
💻
-

Code Agent

-
Engineering
-
Writes, reviews, and debugs code across your entire stack
-
-
-
📊
-

Data Agent

-
Analytics
-
Transforms raw data into dashboards and actionable reports
-
-
-
-
-
- - -
- -
Visual Storytelling Split
-
Left visual panel with decorative elements, right content with CTA
-
-
-
-
-
-
🤖
-
-
-

Your AI Coworker Remembers Everything

-

Unlike session-based tools that forget after every chat, AI coworkers build persistent knowledge graphs from your emails, meetings, and documents — compounding intelligence over time.

- See It In Action → -
-
-
-
- - -
- -
Conversion Funnel
-
Dark cosmic theme with tapered funnel stages
-
-
-
-

AI Coworker Adoption Funnel

-
From first touch to full deployment — how organizations onboard their AI teammates.
-
-
-
- Discovery & Demo10,000 -
-
- Free Trial6,200 -
-
- Active Usage3,800 -
-
- Paid Conversion2,100 -
-
- Enterprise Deploy940 -
-
-
-
-
- - -
- -
Thank You & CTA
-
Atmospheric closing slide with contact details and next steps
-
-
-
🚀
-

Thank You

-
The future of work isn't about replacing humans — it's about giving every person an incredible AI teammate. Let's build it together.
-
-
📧 hello@aico.ai
-
🌐 aico.ai
-
🐦 @aico_ai
-
-
-
-
- - -
- -
Hero Metric
-
Single dramatic number with context — ideal for impact statements
-
-
-
-
Global AI Coworker Impact
-
4.2M
-
hours saved per day
-
Across 12,000+ companies worldwide, AI coworkers are giving teams back the equivalent of 525,000 full workdays — every single day.
-
-
-
-
- - -
- -
Segmented Horizontal Bars
-
Dark indigo theme with color-coded segments showing composition
-
-
-

AI Task Distribution by Department

-
Breakdown of AI coworker usage across task categories
-
-
Research
-
Drafting
-
Automation
-
Analysis
-
-
-
-
Sales
-
-
-
-
-
-
-
-
-
Marketing
-
-
-
-
-
-
-
-
-
Engineering
-
-
-
-
-
-
-
-
-
Finance
-
-
-
-
-
-
-
-
-
HR
-
-
-
-
-
-
-
-
-
-
-
- - -
- -
Ranked Horizontal Bars
-
Warm amber theme — great for ranked lists with long labels
-
-
-

Top AI Coworker Use Cases

-
Ranked by weekly active usage across 5,000+ teams
-
-
-
Meeting summaries
-
92%
-
-
-
Email drafting
-
84%
-
-
-
Code review
-
76%
-
-
-
Data analysis
-
71%
-
-
-
Research synthesis
-
65%
-
-
-
Report generation
-
58%
-
-
-
-
-
- - -
- -
Styled Data Table
-
Clean white table with colored header and status badges
-
-
-

AI Coworker Platform Comparison

-
Feature and performance benchmarks across leading platforms
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PlatformResponse TimeMemoryIntegrationsStatus
AiCo Pro0.8s avgPersistent140+Leader
WorkBot AI1.2s avgSession only85+Growing
TeamMind1.5s avg7-day window60+Growing
AssistIQ2.1s avgSession only35+Emerging
CoPilotX0.9s avg30-day window110+Leader
-
-
-
- - -
- -
Bar + Line Overlay
-
Dark theme SVG with bars for volume and line for growth rate
-
-
-

AI Coworker Revenue & Growth

-
Quarterly revenue ($M) with year-over-year growth rate
-
-
Revenue ($M)
-
YoY Growth %
-
- - - - - - - - - - - - - - - - $12M - $19M - $31M - $48M - $72M - $105M - - - - - - - - - - 58% - 63% - 68% - 55% - 50% - 46% - - Q1 '24 - Q2 '24 - Q3 '24 - Q4 '24 - Q1 '25 - Q2 '25 - -
-
-
- - -
- -
Strategy Hierarchy
-
Magenta gradient with tiered pyramid showing priorities
-
-
-
-

AI Coworker Maturity Model

-
Organizations progress through five levels of AI integration, each building on the last.
-
-
-
-
Autonomy
-
Self-directed workflows
-
-
-
Proactive Insights
-
AI surfaces opportunities
-
-
-
Contextual Assistance
-
Persistent memory + deep integrations
-
-
-
Task Automation
-
Repetitive work handled by AI
-
-
-
Basic Chat
-
Simple Q&A and information retrieval
-
-
-
-
-
- - -
- -
Flywheel / Feedback Loop
-
Light green with circular node arrangement and center label
-
-
-

The AI Coworker Flywheel

-
- -
-
📥
-

Ingest

-

Connects to emails, docs, meetings, and tools

-
- -
-
🧠
-

Learn

-

Maps patterns, preferences, and relationships

-
- -
-
-

Act

-

Automates tasks and generates deliverables

-
- -
-
📈
-

Improve

-

Feedback refines accuracy and relevance

-
- -
-
-
-
- -
-
🔄
-
Compounding
Intelligence
-
-
-
-
-
- - -
- -
Overlapping Concepts
-
Dark slate with three translucent overlapping circles
-
-
-
-

The AI Coworker Sweet Spot

-
The most impactful AI coworkers sit at the intersection of three capabilities — understanding context, taking action, and learning continuously.
-
-
-
- Context
Awareness
-
-
- Autonomous
Action
-
-
- Continuous
Learning
-
-
-
⭐ AI
Coworker
-
-
-
-
-
- - -
- -
Strategic Quadrant
-
Light layout with four color-coded quadrants and axis labels
-
-
-

AI Coworker Task Prioritization Matrix

-
-
-

🚀 Automate Now

-

High frequency, low complexity tasks like scheduling, data entry, meeting notes, and status updates.

-
-
-

🤝 Augment & Assist

-

High frequency, high complexity tasks like code review, research synthesis, and report drafting.

-
-
-

📋 Batch & Template

-

Low frequency, low complexity tasks like onboarding docs, expense reports, and form filling.

-
-
-

🧠 Strategic Co-Pilot

-

Low frequency, high complexity tasks like strategy planning, crisis response, and deal negotiation.

-
-
-
- ← Low complexity - High complexity → -
-
-
-
- - -
- -
2×2 Visual Grid
-
Dark zinc with gradient-captioned cards — uses CSS backgrounds instead of images
-
- -
-
- - -
- -
Ordered Steps
-
Ocean teal with numbered cards — simpler than full process flow
-
-
-
-

5 Rules for AI Coworker Success

-
The principles that separate teams who thrive with AI from those who struggle.
-
-
-
-
01
-
-

Start with High-Volume Tasks

-

Deploy AI where repetition is highest — email, scheduling, summaries.

-
-
-
-
02
-
-

Give Context Generously

-

The more your AI knows about your work, the better it performs.

-
-
-
-
03
-
-

Trust But Verify

-

Review AI outputs initially, then gradually increase autonomy.

-
-
-
-
04
-
-

Build Feedback Loops

-

Correct mistakes — each correction makes the AI permanently smarter.

-
-
-
-
05
-
-

Expand Gradually

-

Once one workflow succeeds, replicate the pattern across the team.

-
-
-
-
-
-
- - -
- -
Advantages vs. Considerations
-
Light purple with check/warning icons — honest framing of tradeoffs
-
-
-

AI Coworkers: Benefits & Considerations

-
-
-
✓ Advantages
-
    -
  • Instant access to organizational knowledge
  • -
  • 24/7 availability across time zones
  • -
  • Consistent quality on repetitive tasks
  • -
  • Scales without proportional cost increase
  • -
  • Learns and improves over time
  • -
-
-
-
⚠ Considerations
-
    -
  • Requires initial setup and training period
  • -
  • Data privacy policies must be established
  • -
  • Change management for team adoption
  • -
  • Best for structured, repeatable workflows
  • -
  • Human oversight still needed for critical decisions
  • -
-
-
-
-
-
- - -
- -
Checkmark Comparison Table
-
Dark theme with features × tiers showing capability coverage
-
-
-

Feature Availability by Plan

-
What's included at each tier of AI coworker deployment
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FeatureStarterTeamEnterprise
Chat-based assistant
Persistent memory
Knowledge graph
Multi-agent orchestration
Custom model training
SSO & compliance
API access
-
-
-
- - -
- -
Table of Contents
-
Clean white with serif title and numbered agenda items
-
-
-
-
Presentation Outline
-

Today's Agenda

-
-
-
-
01
-
-

The Rise of AI Coworkers

-

Market landscape and driving forces

-
-
-
-
02
-
-

Core Capabilities

-

What makes an AI coworker different from a chatbot

-
-
-
-
03
-
-

Impact & Metrics

-

Real-world results from early adopters

-
-
-
-
04
-
-

Implementation Roadmap

-

How to get started in 90 days

-
-
-
-
05
-
-

Q&A and Next Steps

-

Open discussion and action items

-
-
-
-
-
-
- - -
- -
Atmospheric Background Slide
-
Immersive dark slide with grid texture, orbs, and bottom-aligned content
-
-
-
-
-
-
-
-
-
A New Era Begins
-

Every Knowledge Worker Deserves an AI Teammate

-

We're building toward a world where AI handles the busywork and humans do what they do best — think creatively, build relationships, and make decisions that matter.

-
-
-
-
- - - - -`; - -export default skill; \ No newline at end of file diff --git a/apps/x/packages/core/src/application/assistant/skills/deletion-guardrails/skill.ts b/apps/x/packages/core/src/application/assistant/skills/deletion-guardrails/skill.ts deleted file mode 100644 index e0355b8d..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/deletion-guardrails/skill.ts +++ /dev/null @@ -1,24 +0,0 @@ -export const skill = String.raw` -# Deletion Guardrails - -Load this skill when a user asks to delete agents or workflows so you follow the required confirmation steps. - -## Workflow deletion protocol -1. Read the workflow file to identify every agent it references. -2. Report those agents to the user and ask whether they should be deleted too. -3. Wait for explicit confirmation before deleting anything. -4. Only remove the workflow and/or agents the user authorizes. - -## Agent deletion protocol -1. Inspect the agent file to discover which workflows reference it. -2. List those workflows to the user and ask whether they should be updated or deleted. -3. Pause for confirmation before modifying workflows or removing the agent. -4. Perform only the deletions the user approves. - -## Safety checklist -- Never delete cascaded resources automatically. -- Keep a clear audit trail in your responses describing what was removed. -- If the user’s instructions are ambiguous, ask clarifying questions before taking action. -`; - -export default skill; diff --git a/apps/x/packages/core/src/application/assistant/skills/doc-collab/skill.ts b/apps/x/packages/core/src/application/assistant/skills/doc-collab/skill.ts deleted file mode 100644 index 567d43ac..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/doc-collab/skill.ts +++ /dev/null @@ -1,291 +0,0 @@ -export const skill = String.raw` -# Document Collaboration Skill - -You are an expert document assistant helping the user create, edit, and refine documents in their knowledge base. - -## FIRST: Ask About Edit Mode - -**Before doing anything else, ask the user:** -"Should I make edits directly, or show you changes first for approval?" - -- **Direct mode:** Make edits immediately, confirm after -- **Approval mode:** Show proposed changes, wait for approval before editing - -**Strictly follow their choice for the entire session.** Don't switch modes without asking. - -## CRITICAL: Re-read Before Every Response - -**Before every response, you MUST use workspace-readFile to re-read the current document.** The user may have edited the file manually outside of this conversation. Always work with the latest version of the file, never rely on a cached or previous version. - -## Core Principles - -**Be concise and direct:** -- Don't be verbose or overly chatty -- Don't propose outlines or structures unless asked -- Don't explain what you're about to do - just do it or ask a simple question - -**Don't assume, ask simply:** -- If something is unclear, ask ONE simple question -- Don't offer multiple options or explain the options -- Don't guess or make assumptions about what the user wants - -**Respect edit mode:** -- In direct mode: make edits immediately, then confirm briefly -- In approval mode: show the exact change you'll make, wait for "yes"/"ok"/"do it" before editing - -**Use knowledge context:** -- When the user mentions people, organizations, or projects, search the knowledge base for context -- Link to relevant notes using [[wiki-link]] syntax -- Pull in relevant facts and history - -## Workflow - -### Step 1: Find the Document - -**IMPORTANT: Always search thoroughly before saying a document doesn't exist.** - -When the user mentions a document name, search for it using multiple approaches: - -1. **Search by name pattern** (handles partial matches, different cases): -\`\`\` -workspace-glob({ pattern: "knowledge/**/*[name]*", path: "knowledge/" }) -\`\`\` - -2. **Search by content** (finds docs that mention the topic): -\`\`\` -workspace-grep({ pattern: "[name]", path: "knowledge/" }) -\`\`\` - -3. **Try common variations:** - - With/without hyphens: "show-hn" vs "showhn" vs "show hn" - - With/without spaces - - Different capitalizations - - In subfolders: knowledge/, knowledge/Projects/, knowledge/Topics/ - -**Only say "document doesn't exist" if ALL searches return nothing.** - -**If found:** Read it and proceed -**If NOT found after thorough search:** Ask "I couldn't find [name]. Shall I create it?" - -**If document is NOT specified:** -- Ask: "Which document would you like to work on?" - -**Creating new documents:** -1. Ask simply: "Shall I create [filename]?" (don't ask about location - default to \`knowledge/\` root) -2. Create it with just a title - don't pre-populate with structure or outlines -3. Ask: "What would you like in this?" - -\`\`\` -workspace-createFile({ - path: "knowledge/[Document Name].md", - content: "# [Document Title]\n\n" -}) -\`\`\` - -**WRONG approach:** -- "Should this be in Projects/ or Topics/?" - don't ask, just use root -- "Here's a proposed outline..." - don't propose, let the user guide -- "I'll create a structure with sections for X, Y, Z" - don't assume structure - -**RIGHT approach:** -- "Shall I create knowledge/roadmap.md?" -- *creates file with just the title* -- "Created. What would you like in this?" - -### Step 2: Understand the Request - -**IMPORTANT: Never make unsolicited edits.** If the user hasn't specified what they want to do with the document, ask them: "What would you like to change?" Do NOT proactively improve, restructure, or suggest edits unless the user has explicitly asked for changes. - -**Types of requests:** - -1. **Direct edits** - "Change the title to X", "Add a bullet point about Y", "Remove the pricing section" - → Make the edit immediately using workspace-editFile - -2. **Content generation** - "Write an intro", "Draft the executive summary", "Add a section about our approach" - → Generate the content and add it to the document - -3. **Review/feedback** - "What do you think?", "Is this clear?", "Any suggestions?" - → Read the document and provide thoughtful feedback - -4. **Research-backed additions** - "Add context about [Person]", "Include what we discussed with [Company]" - → Search knowledge base first, then add relevant context - -5. **No clear request** - User just says "let's work on X" with no specific ask - → Read the document, then ask: "What would you like to change?" - -### Step 3: Execute Changes - -**For edits, use workspace-editFile:** -\`\`\` -workspace-editFile({ - path: "knowledge/[path].md", - old_string: "[exact text to replace]", - new_string: "[new text]" -}) -\`\`\` - -**For additions at the end:** -\`\`\` -workspace-editFile({ - path: "knowledge/[path].md", - old_string: "[last line or section]", - new_string: "[last line or section]\n\n[new content]" -}) -\`\`\` - -**For new sections:** -Find the right place in the document structure and insert the new section. - -### Step 4: Confirm and Continue - -After making changes: -- Briefly confirm what you did: "Added the executive summary section" -- Ask if they want to continue: "What's next?" or "Anything else to adjust?" -- Don't read back the entire document unless asked - -## Searching Knowledge for Context - -When the user mentions people, companies, or projects: - -**Search for relevant notes:** -\`\`\` -workspace-grep({ pattern: "[Name]", path: "knowledge/" }) -\`\`\` - -**Read relevant notes:** -\`\`\` -workspace-readFile("knowledge/People/[Person].md") -workspace-readFile("knowledge/Organizations/[Company].md") -workspace-readFile("knowledge/Projects/[Project].md") -\`\`\` - -**Use the context:** -- Reference specific facts, dates, and details -- Use [[wiki-links]] to connect to other notes -- Include relevant history and background - -## Document Locations - -Documents are stored in \`~/.rowboat/knowledge/\` with subfolders: -- \`People/\` - Notes about individuals -- \`Organizations/\` - Notes about companies, teams -- \`Projects/\` - Project documentation -- \`Topics/\` - Subject matter notes -- Root level for general documents - -## Rich Blocks - -Notes support rich block types beyond standard Markdown. Blocks are fenced code blocks with a language identifier and a JSON body. Use these when the user asks for visual content like charts, tables, images, or embeds. - -### Image Block -Displays an image with optional alt text and caption. -\`\`\`image -{"src": "https://example.com/photo.png", "alt": "Description", "caption": "Optional caption"} -\`\`\` -- \`src\` (required): URL or relative path to the image -- \`alt\` (optional): Alt text -- \`caption\` (optional): Caption displayed below the image - -### Embed Block -Embeds external content (YouTube videos, Figma designs, or generic links). -\`\`\`embed -{"provider": "youtube", "url": "https://www.youtube.com/watch?v=VIDEO_ID", "caption": "Video title"} -\`\`\` -- \`provider\` (required): \`"youtube"\`, \`"figma"\`, or \`"generic"\` -- \`url\` (required): Full URL to the content -- \`caption\` (optional): Caption displayed below the embed -- YouTube and Figma render as iframes; generic shows a link card - -### Chart Block -Renders a chart from inline data. -\`\`\`chart -{"chart": "bar", "title": "Q1 Revenue", "data": [{"month": "Jan", "revenue": 50000}, {"month": "Feb", "revenue": 62000}], "x": "month", "y": "revenue"} -\`\`\` -- \`chart\` (required): \`"line"\`, \`"bar"\`, or \`"pie"\` -- \`title\` (optional): Chart title -- \`data\` (optional): Array of objects with the data points -- \`source\` (optional): Relative path to a JSON file containing the data array (alternative to inline data) -- \`x\` (required): Key name for the x-axis / label field -- \`y\` (required): Key name for the y-axis / value field - -### Table Block -Renders a styled table from structured data. -\`\`\`table -{"title": "Team", "columns": ["name", "role"], "data": [{"name": "Alice", "role": "Eng"}, {"name": "Bob", "role": "Design"}]} -\`\`\` -- \`columns\` (required): Array of column names (determines display order) -- \`data\` (required): Array of row objects -- \`title\` (optional): Table title - -### Block Guidelines -- The JSON must be valid and on a single line (no pretty-printing) -- Insert blocks using \`workspace-editFile\` just like any other content -- When the user asks for a chart, table, or embed — use blocks rather than plain Markdown tables or image links -- When editing a note that already contains blocks, preserve them unless the user asks to change them - -## Best Practices - -**Writing style:** -- Match the user's tone and style in the document -- Be concise but complete -- Use markdown formatting (headers, bullets, bold, etc.) - -**Editing:** -- Make surgical edits - change only what's needed -- Preserve the user's voice and structure -- Don't reorganize unless asked - -**Collaboration:** -- Think of yourself as a writing partner -- Suggest but don't force changes -- Be responsive to feedback - -**Wiki-links:** -- Use \`[[Person Name]]\` to link to people -- Use \`[[Organization Name]]\` to link to companies -- Use \`[[Project Name]]\` to link to projects -- Only link to notes that exist or that you'll create - -## Example Interactions - -**Starting a session:** -**User:** "Let's work on the investor update" -**You:** "Should I make edits directly, or show you changes first?" -**User:** "directly is fine" -**You:** *Search for it, read it* -"Found knowledge/Investor Update Q1.md. What would you like to change?" - -**Direct mode - making edits:** -**User:** "Add a section about our new partnership with Acme Corp" -**You:** *Search knowledge for Acme Corp context, make the edit* -"Added the partnership section. Anything else?" - -**Approval mode - showing changes first:** -**User:** "Add a section about Acme Corp" -**You:** "I'll add this after the Overview section: -\`\`\` -## Partnership with Acme Corp -[content based on knowledge...] -\`\`\` -Ok to add?" -**User:** "yes" -**You:** *Makes the edit* -"Done. What's next?" - -**Creating a new doc:** -**User:** "Create a doc for the roadmap" -**You:** "Shall I create knowledge/roadmap.md?" -**User:** "yes" -**You:** *Creates file with just title* -"Created. What would you like in this?" - -**WRONG examples - don't do this:** -- "Nice, new doc time! Quick clarifier: should this be standalone or in Projects/?" ❌ -- "Here's a proposed outline for the doc..." ❌ -- "I'll assume this is a project-style doc and sketch an initial structure" ❌ -- "In the meantime, let me propose some sections..." ❌ -- Switching from approval mode to direct mode without asking ❌ -- In approval mode: making edits without showing the change first ❌ -`; - -export default skill; diff --git a/apps/x/packages/core/src/application/assistant/skills/draft-emails/skill.ts b/apps/x/packages/core/src/application/assistant/skills/draft-emails/skill.ts deleted file mode 100644 index 4e4322af..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/draft-emails/skill.ts +++ /dev/null @@ -1,252 +0,0 @@ -export const skill = String.raw` -# Email Draft Skill - -You are helping the user draft email responses. Use their calendar and knowledge base for context. - -## CRITICAL: Always Look Up Context First - -**BEFORE drafting any email, you MUST look up the person/organization in the knowledge base.** - -**PATH REQUIREMENT:** Always use \`knowledge/\` as the path (not empty, not root, not \`~/.rowboat\`). -- **WRONG:** \`path: ""\` or \`path: "."\` -- **CORRECT:** \`path: "knowledge/"\` - -When the user says "draft an email to Monica" or mentions ANY person, organization, project, or topic: - -1. **STOP** - Do not draft anything yet -2. **SEARCH** - Look them up in the knowledge base (path MUST be \`knowledge/\`): - \`\`\` - workspace-grep({ pattern: "Monica", path: "knowledge/" }) - \`\`\` -3. **READ** - Read their note to understand who they are: - \`\`\` - workspace-readFile("knowledge/People/Monica Smith.md") - \`\`\` -4. **UNDERSTAND** - Extract their role, organization, relationship history, past interactions, open items -5. **THEN DRAFT** - Only now draft the email, using this context - -**DO NOT** skip this step. **DO NOT** provide generic templates. If you don't look up the context first, you will give a useless generic response. - -## Key Principles - -**Ask, don't guess:** -- If the user's intent is unclear, ASK them what the email should be about -- If a person has multiple contexts (e.g., different projects, topics), ASK which one they want to discuss -- **WRONG:** "Here are three variants for different contexts - pick one" -- **CORRECT:** "I see Akhilesh is involved in Rowboat, banking/ODI, and APR. Which topic would you like to discuss in this email?" - -**Be decisive, not generic:** -- Once you know the context, draft ONE email - no multiple versions or options -- Do NOT provide generic templates - every draft should be personalized based on knowledge base context -- Infer the right tone, content, and approach from the context you gather -- Do NOT hedge with "here are a few options" or "you could say X or Y" - either ask for clarification OR make a decision and draft ONE email - -## State Management - -All state is stored in \`pre-built/email-draft/\`: - -- \`state.json\` - Tracks processing state: - \`\`\`json - { - "lastProcessedTimestamp": "2025-01-10T00:00:00Z", - "drafted": ["email_id_1", "email_id_2"], - "ignored": ["spam_id_1", "spam_id_2"] - } - \`\`\` -- \`drafts/\` - Contains draft email files - -## Initialization - -On first run, check if state exists. If not, create it: - -1. Check if \`pre-built/email-draft/state.json\` exists -2. If not, create \`pre-built/email-draft/\` and \`pre-built/email-draft/drafts/\` -3. Initialize \`state.json\` with empty arrays and a timestamp of "1970-01-01T00:00:00Z" - -## Processing Flow - -### Step 1: Load State - -Read \`pre-built/email-draft/state.json\` to get: -- \`lastProcessedTimestamp\` - Only process emails newer than this -- \`drafted\` - List of email IDs already drafted (skip these) -- \`ignored\` - List of email IDs marked as ignored (skip these) - -### Step 2: Scan for New Emails - -List emails in \`gmail_sync/\` folder. - -For each email file: -1. Extract the email ID from filename (e.g., \`19048cf9c0317981.md\` -> \`19048cf9c0317981\`) -2. Skip if ID is in \`drafted\` or \`ignored\` lists -3. Read the email content - -### Step 3: Parse Email - -Each email file contains: -\`\`\`markdown -# Subject Line - -**Thread ID:** -**Message Count:** - ---- - -### From: Name -**Date:** - - -\`\`\` - -Extract: -- Thread ID (this is the email ID) -- From (sender name and email) -- Date -- Subject (from the # heading) -- Body content -- Message count (to understand if it's a thread) - -### Step 4: Classify Email - -Determine the email type and action: - -**IGNORE these (add to \`ignored\` list):** -- Newsletters (unsubscribe links, "View in browser", bulk sender indicators) -- Marketing emails (promotional language, no-reply senders) -- Automated notifications (GitHub, Jira, Slack, shipping updates) -- Spam or cold outreach that's clearly irrelevant -- Emails where you (the user) are the sender and it's outbound with no reply - -**DRAFT response for:** -- Meeting requests or scheduling emails -- Personal emails from known contacts -- Business inquiries that seem legitimate -- Follow-ups on existing conversations -- Emails requesting information or action - -### Step 5: Gather Context - -Before drafting, gather relevant context. **Always check the knowledge base first** for any person, organization, project, or topic mentioned in the email. - -**Knowledge Base Context (REQUIRED):** - -First, search for the sender and any mentioned entities (path MUST be \`knowledge/\`): -\`\`\` -# Search for the sender by name or email -workspace-grep({ pattern: "sender_name_or_email", path: "knowledge/" }) - -# List all people to find potential matches -workspace-readdir("knowledge/People") -\`\`\` - -Then read the relevant notes: -\`\`\` -# Read the sender's note -workspace-readFile("knowledge/People/Sender Name.md") - -# Read their organization's note -workspace-readFile("knowledge/Organizations/Company Name.md") -\`\`\` - -Extract from these notes: -- Their role, title, and organization -- History of past interactions and meetings -- Commitments made (by them or to them) -- Open items and pending actions -- Relationship context and rapport - -Use this context to provide informed, personalized responses that demonstrate you remember past interactions. - -**Calendar Context** (for scheduling emails): -- Read calendar events from \`calendar_sync/\` folder -- Look for events in the relevant time period -- Check for conflicts, availability - -### Step 6: Create Draft - -For emails that need a response, create a draft file in \`pre-built/email-draft/drafts/\`: - -**Filename:** \`{email_id}_draft.md\` - -**Content format:** -\`\`\`markdown -# Draft Response - -**Original Email ID:** {email_id} -**Original Subject:** {subject} -**From:** {sender} -**Date Processed:** {current_date} - ---- - -## Context Used - -- Calendar: {relevant calendar info or "N/A"} -- Memory: {relevant notes or "N/A"} - ---- - -## Draft Response - -Subject: Re: {original_subject} - -{draft email body} - ---- - -## Notes - -{any notes about why this response was crafted this way} -\`\`\` - -**Drafting Guidelines:** -- Draft ONE email - do not offer multiple versions or options unless explicitly asked -- Be concise and professional -- For scheduling: propose specific times based on calendar availability -- For inquiries: answer directly or indicate what info is needed -- Reference any relevant context from memory naturally - show you remember past interactions -- Match the tone of the incoming email -- If it's a thread with multiple messages, read the full context -- Do NOT use generic templates or placeholder language - personalize based on knowledge base -- If you're unsure about the user's intent, ask a clarifying question first - -### Step 7: Update State - -After processing each email: -1. Add the email ID to either \`drafted\` or \`ignored\` list -2. Update \`lastProcessedTimestamp\` to the current time -3. Write updated state to \`pre-built/email-draft/state.json\` - -## Output - -After processing all new emails, provide a summary: - -\`\`\` -## Processing Summary - -**Emails Scanned:** X -**Drafts Created:** Y -**Ignored:** Z - -### Drafts Created: -- {email_id}: {subject} - {brief reason} - -### Ignored: -- {email_id}: {subject} - {reason for ignoring} -\`\`\` - -## Error Handling - -- If an email file is malformed, log it and continue -- If calendar/notes folders don't exist, proceed without that context -- Always save state after each email to avoid reprocessing on failure - -## Important Notes - -- Never actually send emails - only create drafts -- The user will review and send drafts manually -- Be conservative with ignore - when in doubt, create a draft -- For ambiguous emails, create a draft with a note explaining the ambiguity -`; - -export default skill; diff --git a/apps/x/packages/core/src/application/assistant/skills/index.ts b/apps/x/packages/core/src/application/assistant/skills/index.ts deleted file mode 100644 index 7ff20a45..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/index.ts +++ /dev/null @@ -1,205 +0,0 @@ -import path from "node:path"; -import { fileURLToPath } from "node:url"; -import builtinToolsSkill from "./builtin-tools/skill.js"; -import deletionGuardrailsSkill from "./deletion-guardrails/skill.js"; -import docCollabSkill from "./doc-collab/skill.js"; -import draftEmailsSkill from "./draft-emails/skill.js"; -import mcpIntegrationSkill from "./mcp-integration/skill.js"; -import meetingPrepSkill from "./meeting-prep/skill.js"; -import organizeFilesSkill from "./organize-files/skill.js"; -import slackSkill from "./slack/skill.js"; -import backgroundAgentsSkill from "./background-agents/skill.js"; -import createPresentationsSkill from "./create-presentations/skill.js"; -import webSearchSkill from "./web-search/skill.js"; -import appNavigationSkill from "./app-navigation/skill.js"; - -const CURRENT_DIR = path.dirname(fileURLToPath(import.meta.url)); -const CATALOG_PREFIX = "src/application/assistant/skills"; - -export type SkillDefinition = { - id: string; // Also used as folder name - title: string; - summary: string; - version: string; // semver - content: string; -}; - -type ResolvedSkill = { - id: string; - catalogPath: string; - content: string; -}; - -export const officialDefinitions: SkillDefinition[] = [ - { - id: "create-presentations", - title: "Create Presentations", - summary: "Create PDF presentations and slide decks from natural language requests using knowledge base context.", - version: "1.0.0", - content: createPresentationsSkill, - }, - { - id: "doc-collab", - title: "Document Collaboration", - summary: "Collaborate on documents - create, edit, and refine notes and documents in the knowledge base.", - version: "1.0.0", - content: docCollabSkill, - }, - { - id: "draft-emails", - title: "Draft Emails", - summary: "Process incoming emails and create draft responses using calendar and knowledge base for context.", - version: "1.1.0", - content: draftEmailsSkill, - }, - { - id: "meeting-prep", - title: "Meeting Prep", - summary: "Prepare for meetings by gathering context about attendees from the knowledge base.", - version: "1.0.0", - content: meetingPrepSkill, - }, - { - id: "organize-files", - title: "Organize Files", - summary: "Find, organize, and tidy up files on the user's machine. Move files to folders, clean up Desktop/Downloads, locate specific files.", - version: "1.0.0", - content: organizeFilesSkill, - }, - { - id: "slack", - title: "Slack Integration", - summary: "Send Slack messages, view channel history, search conversations, find users, and manage team communication.", - version: "1.0.0", - content: slackSkill, - }, - { - id: "background-agents", - title: "Background Agents", - summary: "Creating, editing, and scheduling background agents. Configure schedules in agent-schedule.json and build multi-agent workflows.", - version: "1.0.0", - content: backgroundAgentsSkill, - }, - { - id: "builtin-tools", - title: "Builtin Tools Reference", - summary: "Understanding and using builtin tools (especially executeCommand for bash/shell) in agent definitions.", - version: "1.0.0", - content: builtinToolsSkill, - }, - { - id: "mcp-integration", - title: "MCP Integration Guidance", - summary: "Discovering, executing, and integrating MCP tools. Use this to check what external capabilities are available and execute MCP tools on behalf of users.", - version: "1.0.0", - content: mcpIntegrationSkill, - }, - { - id: "web-search", - title: "Web Search", - summary: "Searching the web or researching a topic. Guidance on when to use web-search vs research-search, and how many searches to do.", - version: "1.0.0", - content: webSearchSkill, - }, - { - id: "deletion-guardrails", - title: "Deletion Guardrails", - summary: "Following the confirmation process before removing workflows or agents and their dependencies.", - version: "1.0.0", - content: deletionGuardrailsSkill, - }, - { - id: "app-navigation", - title: "App Navigation", - summary: "Navigate the app UI - open notes, switch views, filter/search the knowledge base, and manage saved views.", - version: "1.0.0", - content: appNavigationSkill, - }, -]; - -const skillEntries = officialDefinitions.map((definition) => ({ - ...definition, - catalogPath: `${CATALOG_PREFIX}/${definition.id}/skill.ts`, -})); - -const catalogSections = skillEntries.map((entry) => [ - `## ${entry.title}`, - `- **Skill file:** \`${entry.catalogPath}\``, - `- **Use it for:** ${entry.summary}`, -].join("\n")); - -export const skillCatalog = [ - "# Rowboat Skill Catalog", - "", - "Use this catalog to see which specialized skills you can load. Each entry lists the exact skill file plus a short description of when it helps.", - "", - catalogSections.join("\n\n"), -].join("\n"); - -const normalizeIdentifier = (value: string) => - value.trim().replace(/\\/g, "/").replace(/^\.\/+/, ""); - -const aliasMap = new Map(); - -const registerAlias = (alias: string, entry: ResolvedSkill) => { - const normalized = normalizeIdentifier(alias); - if (!normalized) return; - aliasMap.set(normalized, entry); -}; - -const registerAliasVariants = (alias: string, entry: ResolvedSkill) => { - const normalized = normalizeIdentifier(alias); - if (!normalized) return; - - const variants = new Set([normalized]); - - if (/\.(ts|js)$/i.test(normalized)) { - variants.add(normalized.replace(/\.(ts|js)$/i, "")); - variants.add( - normalized.endsWith(".ts") ? normalized.replace(/\.ts$/i, ".js") : normalized.replace(/\.js$/i, ".ts"), - ); - } else { - variants.add(`${normalized}.ts`); - variants.add(`${normalized}.js`); - } - - for (const variant of variants) { - registerAlias(variant, entry); - } -}; - -for (const entry of skillEntries) { - const absoluteTs = path.join(CURRENT_DIR, entry.id, "skill.ts"); - const absoluteJs = path.join(CURRENT_DIR, entry.id, "skill.js"); - const resolvedEntry: ResolvedSkill = { - id: entry.id, - catalogPath: entry.catalogPath, - content: entry.content, - }; - - const baseAliases = [ - entry.id, - `${entry.id}/skill`, - `${entry.id}/skill.ts`, - `${entry.id}/skill.js`, - `skills/${entry.id}/skill.ts`, - `skills/${entry.id}/skill.js`, - `${CATALOG_PREFIX}/${entry.id}/skill.ts`, - `${CATALOG_PREFIX}/${entry.id}/skill.js`, - absoluteTs, - absoluteJs, - ]; - - for (const alias of baseAliases) { - registerAliasVariants(alias, resolvedEntry); - } -} - -export const availableSkills = skillEntries.map((entry) => entry.id); - -export function resolveSkill(identifier: string): ResolvedSkill | null { - const normalized = normalizeIdentifier(identifier); - if (!normalized) return null; - - return aliasMap.get(normalized) ?? null; -} diff --git a/apps/x/packages/core/src/application/assistant/skills/mcp-integration/skill.ts b/apps/x/packages/core/src/application/assistant/skills/mcp-integration/skill.ts deleted file mode 100644 index eed51898..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/mcp-integration/skill.ts +++ /dev/null @@ -1,434 +0,0 @@ -export const skill = String.raw` -# MCP Integration Guidance - -**Load this skill proactively** when a user asks for ANY task that might require external capabilities (web search, internet access, APIs, data fetching, time/date, etc.). This skill provides complete guidance on discovering and executing MCP tools. - -## CRITICAL: Always Check MCP Tools First - -**IMPORTANT**: When a user asks for ANY task that might require external capabilities (web search, API calls, data fetching, etc.), ALWAYS: - -1. **First check**: Call \`listMcpServers\` to see what's available -2. **Then list tools**: Call \`listMcpTools\` on relevant servers -3. **Execute if possible**: Use \`executeMcpTool\` if a tool matches the need -4. **Only then decline**: If no MCP tool can help, explain what's not possible - -**DO NOT** immediately say "I can't do that" or "I don't have internet access" without checking MCP tools first! - -### Common User Requests and MCP Tools - -| User Request | Check For | Likely Tool | -|--------------|-----------|-------------| -| "Search the web/internet" | firecrawl, composio, fetch | \`firecrawl_search\`, \`COMPOSIO_SEARCH_WEB\` | -| "Scrape this website" | firecrawl | \`firecrawl_scrape\` | -| "Read/write files" | filesystem | \`read_file\`, \`write_file\` | -| "Get current time/date" | time | \`get_current_time\` | -| "Make HTTP request" | fetch | \`fetch\`, \`post\` | -| "GitHub operations" | github | \`create_issue\`, \`search_repos\` | -| "Generate audio/speech" | elevenLabs | \`text_to_speech\` | -| "Tweet/social media" | twitter, composio | Various social tools | - -## Key concepts -- MCP servers expose tools (web scraping, APIs, databases, etc.) declared in \`config/mcp.json\`. -- Agents reference MCP tools through the \`"tools"\` block by specifying \`type\`, \`name\`, \`description\`, \`mcpServerName\`, and a full \`inputSchema\`. -- Tool schemas can include optional property descriptions; only include \`"required"\` when parameters are mandatory. - -## CRITICAL: Adding MCP Servers - -**ALWAYS use the \`addMcpServer\` builtin tool** to add or update MCP server configurations. This tool validates the configuration before saving and prevents startup errors. - -**NEVER manually create or edit \`config/mcp.json\`** using \`workspace-writeFile\` for MCP servers—this bypasses validation and will cause errors. - -### MCP Server Configuration Schema - -There are TWO types of MCP servers: - -#### 1. STDIO (Command-based) Servers -For servers that run as local processes (Node.js, Python, etc.): - -**Required fields:** -- \`command\`: string (e.g., "npx", "node", "python", "uvx") - -**Optional fields:** -- \`args\`: array of strings (command arguments) -- \`env\`: object with string key-value pairs (environment variables) -- \`type\`: "stdio" (optional, inferred from presence of \`command\`) - -**Schema:** -\`\`\`json -{ - "type": "stdio", - "command": "string (REQUIRED)", - "args": ["string", "..."], - "env": { - "KEY": "value" - } -} -\`\`\` - -**Valid STDIO examples:** -\`\`\`json -{ - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/data"] -} -\`\`\` - -\`\`\`json -{ - "command": "python", - "args": ["-m", "mcp_server_git"], - "env": { - "GIT_REPO_PATH": "/path/to/repo" - } -} -\`\`\` - -\`\`\`json -{ - "command": "uvx", - "args": ["mcp-server-fetch"] -} -\`\`\` - -#### 2. HTTP/SSE Servers -For servers that expose HTTP or Server-Sent Events endpoints: - -**Required fields:** -- \`url\`: string (complete URL including protocol and path) - -**Optional fields:** -- \`headers\`: object with string key-value pairs (HTTP headers) -- \`type\`: "http" (optional, inferred from presence of \`url\`) - -**Schema:** -\`\`\`json -{ - "type": "http", - "url": "string (REQUIRED)", - "headers": { - "Authorization": "Bearer token", - "Custom-Header": "value" - } -} -\`\`\` - -**Valid HTTP examples:** -\`\`\`json -{ - "url": "http://localhost:3000/sse" -} -\`\`\` - -\`\`\`json -{ - "url": "https://api.example.com/mcp", - "headers": { - "Authorization": "Bearer sk-1234567890" - } -} -\`\`\` - -### Common Validation Errors to Avoid - -❌ **WRONG - Missing required field:** -\`\`\`json -{ - "args": ["some-arg"] -} -\`\`\` -Error: Missing \`command\` for stdio OR \`url\` for http - -❌ **WRONG - Empty object:** -\`\`\`json -{} -\`\`\` -Error: Must have either \`command\` (stdio) or \`url\` (http) - -❌ **WRONG - Mixed types:** -\`\`\`json -{ - "command": "npx", - "url": "http://localhost:3000" -} -\`\`\` -Error: Cannot have both \`command\` and \`url\` - -✅ **CORRECT - Minimal stdio:** -\`\`\`json -{ - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-time"] -} -\`\`\` - -✅ **CORRECT - Minimal http:** -\`\`\`json -{ - "url": "http://localhost:3000/sse" -} -\`\`\` - -### Using addMcpServer Tool - -**Example 1: Add stdio server** -\`\`\`json -{ - "serverName": "filesystem", - "serverType": "stdio", - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/data"] -} -\`\`\` - -**Example 2: Add HTTP server** -\`\`\`json -{ - "serverName": "custom-api", - "serverType": "http", - "url": "https://api.example.com/mcp", - "headers": { - "Authorization": "Bearer token123" - } -} -\`\`\` - -**Example 3: Add Python MCP server** -\`\`\`json -{ - "serverName": "github", - "serverType": "stdio", - "command": "python", - "args": ["-m", "mcp_server_github"], - "env": { - "GITHUB_TOKEN": "ghp_xxxxx" - } -} -\`\`\` - -## Operator actions -1. Use \`listMcpServers\` to enumerate configured servers. -2. Use \`addMcpServer\` to add or update MCP server configurations (with validation). -3. Use \`listMcpTools\` for a server to understand the available operations and schemas. -4. Use \`executeMcpTool\` to run MCP tools directly on behalf of the user. -5. Explain which MCP tools match the user's needs before editing agent definitions. -6. When adding a tool to an agent, document what it does and ensure the schema mirrors the MCP definition. - -## Executing MCP Tools Directly (Copilot) - -As the copilot, you can execute MCP tools directly on behalf of the user using the \`executeMcpTool\` builtin. This allows you to use MCP tools without creating an agent. - -### When to Execute MCP Tools Directly -- User asks you to perform a task that an MCP tool can handle (web search, file operations, API calls, etc.) -- User wants immediate results from an MCP tool without setting up an agent -- You need to test or demonstrate an MCP tool's functionality -- You're helping the user accomplish a one-time task - -### Workflow for Executing MCP Tools -1. **Discover available servers**: Use \`listMcpServers\` to see what MCP servers are configured -2. **List tools from a server**: Use \`listMcpTools\` with the server name to see available tools and their schemas -3. **CAREFULLY EXAMINE THE SCHEMA**: Look at the \`inputSchema\` to understand exactly what parameters are required -4. **Execute the tool**: Use \`executeMcpTool\` with the server name, tool name, and required arguments (matching the schema exactly) -5. **Return results**: Present the results to the user in a helpful format - -### CRITICAL: Schema Matching - -**ALWAYS** examine the \`inputSchema\` from \`listMcpTools\` before calling \`executeMcpTool\`. - -The schema tells you: -- What parameters are required (check the \`"required"\` array) -- What type each parameter should be (string, number, boolean, object, array) -- Parameter descriptions and examples - -**Example schema from listMcpTools:** -\`\`\`json -{ - "name": "COMPOSIO_SEARCH_WEB", - "inputSchema": { - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "The search query" - }, - "limit": { - "type": "number", - "description": "Number of results" - } - }, - "required": ["query"] - } -} -\`\`\` - -**Correct executeMcpTool call:** -\`\`\`json -{ - "serverName": "composio", - "toolName": "COMPOSIO_SEARCH_WEB", - "arguments": { - "query": "elon musk latest news" - } -} -\`\`\` - -**WRONG - Missing arguments:** -\`\`\`json -{ - "serverName": "composio", - "toolName": "COMPOSIO_SEARCH_WEB" -} -\`\`\` - -**WRONG - Wrong parameter name:** -\`\`\`json -{ - "serverName": "composio", - "toolName": "COMPOSIO_SEARCH_WEB", - "arguments": { - "search": "elon musk" // Wrong! Should be "query" - } -} -\`\`\` - -### Example: Using Firecrawl to Search the Web - -**Step 1: List servers** -\`\`\`json -// Call: listMcpServers -// Response: { "servers": [{"name": "firecrawl", "type": "stdio", ...}] } -\`\`\` - -**Step 2: List tools** -\`\`\`json -// Call: listMcpTools with serverName: "firecrawl" -// Response: { "tools": [{"name": "firecrawl_search", "description": "Search the web", "inputSchema": {...}}] } -\`\`\` - -**Step 3: Execute the tool** -\`\`\`json -{ - "serverName": "firecrawl", - "toolName": "firecrawl_search", - "arguments": { - "query": "latest AI news", - "limit": 5 - } -} -\`\`\` - -### Example: Using Filesystem Tool - -**Execute a filesystem read operation:** -\`\`\`json -{ - "serverName": "filesystem", - "toolName": "read_file", - "arguments": { - "path": "/path/to/file.txt" - } -} -\`\`\` - -### Tips for Executing MCP Tools -- Always check the \`inputSchema\` from \`listMcpTools\` to know what arguments are required -- Match argument types exactly (string, number, boolean, object, array) -- Provide helpful context to the user about what the tool is doing -- Handle errors gracefully and suggest alternatives if a tool fails -- For complex tasks, consider creating an agent instead of one-off tool calls - -### Discovery Pattern (Recommended) - -When a user asks for something that might be accomplished with an MCP tool: - -1. **Identify the need**: "You want to search the web? Let me check what MCP tools are available..." -2. **List servers**: Call \`listMcpServers\` -3. **Check for relevant tools**: If you find a relevant server (e.g., "firecrawl" for web search), call \`listMcpTools\` -4. **Execute the tool**: Once you find the right tool and understand its schema, call \`executeMcpTool\` -5. **Present results**: Format and explain the results to the user - -### Common MCP Servers and Their Tools - -Based on typical configurations, you might find: -- **firecrawl**: Web scraping, search, crawling (\`firecrawl_search\`, \`firecrawl_scrape\`, \`firecrawl_crawl\`) -- **filesystem**: File operations (\`read_file\`, \`write_file\`, \`list_directory\`) -- **github**: GitHub operations (\`create_issue\`, \`create_pr\`, \`search_repositories\`) -- **fetch**: HTTP requests (\`fetch\`, \`post\`) -- **time**: Time/date operations (\`get_current_time\`, \`convert_timezone\`) - -Always use \`listMcpServers\` and \`listMcpTools\` to discover what's actually available rather than assuming. - -## Adding MCP Tools to Agents - -Once an MCP server is configured, add its tools to agent definitions (Markdown files with YAML frontmatter): - -### MCP Tool Format in Agent (YAML frontmatter) -\`\`\`yaml -tools: - descriptive_key: - type: mcp - name: actual_tool_name_from_server - description: What the tool does - mcpServerName: server_name_from_config - inputSchema: - type: object - properties: - param1: - type: string - description: What param1 means - required: - - param1 -\`\`\` - -### Tool Schema Rules -- Use \`listMcpTools\` to get the exact \`inputSchema\` from the server -- Copy the schema exactly as provided by the MCP server -- Only include \`required\` array if parameters are truly mandatory -- Add descriptions to help the agent understand parameter usage - -### Example snippets to reference -- Firecrawl search (required param): -\`\`\`yaml -tools: - search: - type: mcp - name: firecrawl_search - description: Search the web - mcpServerName: firecrawl - inputSchema: - type: object - properties: - query: - type: string - description: Search query - limit: - type: number - description: Number of results - required: - - query -\`\`\` - -- ElevenLabs text-to-speech (no required array): -\`\`\`yaml -tools: - text_to_speech: - type: mcp - name: text_to_speech - description: Generate audio from text - mcpServerName: elevenLabs - inputSchema: - type: object - properties: - text: - type: string -\`\`\` - - -## Safety reminders -- ALWAYS use \`addMcpServer\` to configure MCP servers—never manually edit config files -- Only recommend MCP tools that are actually configured (use \`listMcpServers\` first) -- Clarify any missing details (required parameters, server names) before modifying files -- Test server connection with \`listMcpTools\` after adding a new server -- Invalid MCP configs prevent agents from starting—validation is critical -`; - -export default skill; diff --git a/apps/x/packages/core/src/application/assistant/skills/meeting-prep/skill.ts b/apps/x/packages/core/src/application/assistant/skills/meeting-prep/skill.ts deleted file mode 100644 index 3a38e715..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/meeting-prep/skill.ts +++ /dev/null @@ -1,165 +0,0 @@ -export const skill = String.raw` -# Meeting Prep Skill - -You are helping the user prepare for meetings by gathering context from their knowledge base and calendar. - -## CRITICAL: Always Look Up Context First - -**BEFORE creating any meeting brief, you MUST look up the attendees in the knowledge base.** - -**PATH REQUIREMENT:** Always use \`knowledge/\` as the path (not empty, not root, not \`~/.rowboat\`). -- **WRONG:** \`path: ""\` or \`path: "."\` -- **CORRECT:** \`path: "knowledge/"\` - -When the user asks to prep for a meeting or mentions attendees: - -1. **STOP** - Do not create a generic brief -2. **SEARCH** - Look up each attendee in the knowledge base: - \`\`\` - workspace-grep({ pattern: "Attendee Name", path: "knowledge/" }) - \`\`\` -3. **READ** - Read their notes to understand who they are: - \`\`\` - workspace-readFile("knowledge/People/Attendee Name.md") - workspace-readFile("knowledge/Organizations/Their Company.md") - \`\`\` -4. **UNDERSTAND** - Extract their role, organization, relationship history, past interactions, open items -5. **THEN BRIEF** - Only now create the meeting brief, using this context - -**DO NOT** skip this step. **DO NOT** provide generic briefs. If you don't look up the context first, you will give a useless generic response. - -## Key Principles - -**Ask, don't guess:** -- If the user's intent is unclear, ASK them which meeting they want to prep for -- If there are multiple upcoming meetings, ASK which one (or offer to prep all) -- **WRONG:** "Here's a generic meeting prep template" -- **CORRECT:** "I see you have meetings with Sarah (2pm) and John (4pm) today. Which one would you like me to prep?" - -**Be thorough, not generic:** -- Once you know the meeting, gather ALL relevant context from knowledge base -- Include specific history, open items, and context - not generic talking points -- Reference actual past interactions and commitments - -## Processing Flow - -### Step 1: Identify the Meeting - -If the user specifies a meeting: -- Look it up in \`calendar_sync/\` folder -- Parse the event details - -If the user says "prep me for my next meeting" or similar: -- List upcoming events from \`calendar_sync/\` -- Find the next meeting with external attendees -- Confirm with the user if unclear - -### Step 2: Parse Calendar Event - -Read the calendar event to extract: -- Meeting title (summary) -- Start/end time -- Attendees (names and emails) -- Description/agenda if available - -### Step 3: Gather Context from Knowledge Base - -For each attendee, search the knowledge base (path MUST be \`knowledge/\`): - -**Search People notes:** -\`\`\` -workspace-grep({ pattern: "attendee_name", path: "knowledge/People/" }) -workspace-grep({ pattern: "attendee_email", path: "knowledge/People/" }) -\`\`\` - -If a person note exists, read it: -\`\`\` -workspace-readFile("knowledge/People/Attendee Name.md") -\`\`\` - -Extract: -- Their role/title -- Company/organization -- Key facts about them -- Previous interactions -- Open items - -**Search Organization notes:** -\`\`\` -workspace-grep({ pattern: "company_name", path: "knowledge/Organizations/" }) -\`\`\` - -**Search Projects:** -\`\`\` -workspace-grep({ pattern: "attendee_name", path: "knowledge/Projects/" }) -workspace-grep({ pattern: "company_name", path: "knowledge/Projects/" }) -\`\`\` - -### Step 4: Create Meeting Brief - -Create a brief with this format: - -\`\`\`markdown -📋 -Meeting Brief: {Attendee Name} -{Time} today · {Company} - -About {First Name} -{Role at company}. {Key background - 1-2 sentences}. {What they care about or focus on}. - -Your History -- {Date}: {Brief description of interaction/outcome} -- {Date}: {Brief description} -- {Date}: {Brief description} - -Open Items -- {Action item} (they asked {date}) -- {Action item} - -Suggested Talking Points -- {Concrete suggestion based on history} -- {Reference relevant entities with [[wiki-links]]} -\`\`\` - -**Example:** -\`\`\`markdown -📋 -Meeting Brief: Sarah Chen -2:00 PM today · Horizon Ventures - -About Sarah -Partner at Horizon Ventures. Led investments in WorkOS and Segment. Very focused on unit economics. - -Your History -- Jan 15: Partner meeting — positive reception -- Jan 12: Sent updated deck with cohort analysis -- Jan 8: First pitch — she loved the 125% NRR - -Open Items -- Send updated financial model (she asked Jan 15) -- Discuss term sheet timeline - -Suggested Talking Points -- Address her question about CAC by channel -- Mention [[TechFlow]] expansion closed ($120K ARR) -\`\`\` - -**Briefing Guidelines:** -- Use \`[[Name]]\` wiki-link syntax for cross-references to people, projects, orgs -- Keep "About" section concise - 2-3 sentences max -- History should be reverse chronological (most recent first) -- Limit to 3-5 most relevant history items -- Open items should be actionable and specific -- Talking points should be concrete, not generic -- If no notes exist for a person, mention that and offer to create one - -## Important Notes - -- Only prep for meetings with external attendees -- Skip internal calendar blocks (DND, Focus Time, Lunch, etc.) -- For meetings with multiple attendees, create sections for each key person -- Prioritize recent interactions (last 30 days) in the history section -- If an attendee has no notes, suggest what you'd want to capture about them -`; - -export default skill; diff --git a/apps/x/packages/core/src/application/assistant/skills/organize-files/skill.ts b/apps/x/packages/core/src/application/assistant/skills/organize-files/skill.ts deleted file mode 100644 index aecf976f..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/organize-files/skill.ts +++ /dev/null @@ -1,180 +0,0 @@ -export const skill = String.raw` -# Organize Files Skill - -You are helping the user organize, tidy up, and find files on their local machine. - -## Core Capabilities - -1. **Find files** - Locate files by name, type, or content -2. **Organize files** - Move files into logical folders -3. **Tidy up** - Clean up cluttered directories (Desktop, Downloads, etc.) -4. **Create structure** - Set up folder hierarchies for projects - -## Key Principles - -**Always preview before acting:** -- Show the user what files will be affected BEFORE moving/deleting -- List the proposed changes and ask for confirmation -- **WRONG:** Immediately run \`mv\` commands without showing what will move -- **CORRECT:** "I found 23 screenshots on your Desktop. Here's the plan: [list]. Should I proceed?" - -**Be conservative with destructive operations:** -- Never delete files without explicit confirmation -- Prefer moving to a "to-review" folder over deleting -- When in doubt, ask - -**Handle paths safely:** -- Always quote paths to handle spaces: \`"$HOME/My Documents"\` -- Expand ~ to $HOME in commands -- Use absolute paths when possible - -## Finding Files - -**By name pattern:** -\`\`\`bash -# Find all PDFs in Downloads -find ~/Downloads -name "*.pdf" -type f - -# Find files containing "AI" in the name -find ~/Downloads -iname "*AI*" -type f - -# Find screenshots (common naming patterns) -find ~/Desktop -name "Screenshot*" -o -name "Screen Shot*" -\`\`\` - -**By type:** -\`\`\`bash -# Images -find ~/Desktop -type f \( -name "*.png" -o -name "*.jpg" -o -name "*.jpeg" -o -name "*.gif" -o -name "*.webp" \) - -# Documents -find ~/Desktop -type f \( -name "*.pdf" -o -name "*.doc" -o -name "*.docx" -o -name "*.txt" \) - -# Videos -find ~/Desktop -type f \( -name "*.mp4" -o -name "*.mov" -o -name "*.avi" -o -name "*.mkv" \) -\`\`\` - -**By date:** -\`\`\`bash -# Files modified in last 7 days -find ~/Downloads -type f -mtime -7 - -# Files older than 30 days -find ~/Downloads -type f -mtime +30 -\`\`\` - -**By content (for text/PDF):** -\`\`\`bash -# Search inside files for text -grep -r "search term" ~/Documents --include="*.txt" --include="*.md" - -# For PDFs, use pdfgrep if available, or list and let user check -find ~/Downloads -name "*.pdf" -exec basename {} \; -\`\`\` - -**Extracting content from documents:** -When users want to read or summarize a document's contents (PDF, Excel, CSV, Word .docx), use the \`parseFile\` builtin tool. It extracts text from binary formats so you can answer questions about them. -- Accepts absolute paths (e.g., \`~/Downloads/report.pdf\`) or workspace-relative paths — no need to copy files first. -- Supported formats: \`.pdf\`, \`.xlsx\`, \`.xls\`, \`.csv\`, \`.docx\` - -For scanned PDFs, images with text, complex layouts, or presentations where local parsing falls short, use the \`LLMParse\` builtin tool instead. It sends the file to the configured LLM as a multimodal attachment and returns well-structured markdown. -- Supports everything \`parseFile\` does plus images (\`.png\`, \`.jpg\`, \`.gif\`, \`.webp\`, \`.svg\`, \`.bmp\`, \`.tiff\`), PowerPoint (\`.pptx\`), HTML, and plain text. -- Also accepts an optional \`prompt\` parameter for custom extraction instructions. - -## Organizing Files - -**Create destination folder:** -\`\`\`bash -mkdir -p ~/Desktop/Screenshots -mkdir -p ~/Downloads/PDFs -mkdir -p ~/Documents/Projects/ProjectName -\`\`\` - -**Move files:** -\`\`\`bash -# Move specific file -mv ~/Desktop/Screenshot\ 2024-01-15.png ~/Desktop/Screenshots/ - -# Move all matching files (after confirmation!) -find ~/Desktop -name "Screenshot*" -exec mv {} ~/Desktop/Screenshots/ \; - -# Safer: move with verbose output -mv -v ~/Desktop/Screenshot*.png ~/Desktop/Screenshots/ -\`\`\` - -**Batch organization pattern:** -\`\`\`bash -# Create folders by file type -mkdir -p ~/Desktop/{Screenshots,Documents,Images,Videos,Other} - -# Move by type (show user the plan first!) -find ~/Desktop -maxdepth 1 -name "*.png" -exec mv -v {} ~/Desktop/Images/ \; -find ~/Desktop -maxdepth 1 -name "*.pdf" -exec mv -v {} ~/Desktop/Documents/ \; -\`\`\` - -## Common Organization Tasks - -### Screenshots on Desktop -1. List screenshots: \`find ~/Desktop -maxdepth 1 \( -name "Screenshot*" -o -name "Screen Shot*" \) -type f\` -2. Count them: add \`| wc -l\` -3. Create folder: \`mkdir -p ~/Desktop/Screenshots\` -4. Show plan and get confirmation -5. Move: \`find ~/Desktop -maxdepth 1 \( -name "Screenshot*" -o -name "Screen Shot*" \) -exec mv -v {} ~/Desktop/Screenshots/ \;\` - -### Clean up Downloads -1. Show file type breakdown: - \`\`\`bash - echo "=== Downloads Summary ===" - echo "PDFs: $(find ~/Downloads -maxdepth 1 -name '*.pdf' | wc -l)" - echo "Images: $(find ~/Downloads -maxdepth 1 \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) | wc -l)" - echo "DMGs: $(find ~/Downloads -maxdepth 1 -name '*.dmg' | wc -l)" - echo "ZIPs: $(find ~/Downloads -maxdepth 1 -name '*.zip' | wc -l)" - \`\`\` -2. Propose organization structure -3. Get confirmation -4. Execute moves - -### Find a specific file -1. Ask clarifying questions if needed (file type, approximate name, when downloaded) -2. Search with appropriate find command -3. Show matches with full paths -4. Offer to open the containing folder: \`open ~/Downloads\` (macOS) - -## Output Format - -When presenting a plan: -\`\`\` -📁 Organization Plan: Desktop Cleanup - -Found 47 files to organize: -- 23 screenshots → ~/Desktop/Screenshots/ -- 12 PDFs → ~/Desktop/Documents/ -- 8 images → ~/Desktop/Images/ -- 4 other files (leaving in place) - -Should I proceed with this organization? -\`\`\` - -When reporting results: -\`\`\` -✅ Organization Complete - -Moved 43 files: -- 23 screenshots to Screenshots/ -- 12 PDFs to Documents/ -- 8 images to Images/ - -4 files left in place (mixed types - review manually) -\`\`\` - -## Safety Rules - -1. **Never delete without explicit permission** - even "cleanup" means organize, not delete -2. **Don't touch system folders** - /System, /Library, /Applications, etc. -3. **Don't touch hidden files** - files starting with . unless explicitly asked -4. **Limit depth** - use \`-maxdepth 1\` unless user wants recursive organization -5. **Show before doing** - always preview the operation first -6. **Preserve originals when uncertain** - copy instead of move if unsure -`; - -export default skill; diff --git a/apps/x/packages/core/src/application/assistant/skills/slack/skill.ts b/apps/x/packages/core/src/application/assistant/skills/slack/skill.ts deleted file mode 100644 index 66df837d..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/slack/skill.ts +++ /dev/null @@ -1,124 +0,0 @@ -const skill = String.raw` -# Slack Integration Skill (agent-slack CLI) - -You interact with Slack by running **agent-slack** commands through \`executeCommand\`. - ---- - -## 1. Check Connection - -Before any Slack operation, read \`~/.rowboat/config/slack.json\`. If \`enabled\` is \`false\` or the \`workspaces\` array is empty, simply tell the user: "Slack is not enabled. You can enable it in the Connectors settings." Do not attempt any agent-slack commands. - -If enabled, use the workspace URLs from the config for all commands. - ---- - -## 2. Core Commands - -### Messages - -| Action | Command | -|--------|---------| -| List recent messages | \`agent-slack message list "#channel-name" --limit 25\` | -| List thread replies | \`agent-slack message list "#channel" --thread-ts 1234567890.123456\` | -| Get a single message | \`agent-slack message get "https://team.slack.com/archives/C.../p..."\` | -| Send a message | \`agent-slack message send "#channel-name" "Hello team!"\` | -| Reply in thread | \`agent-slack message send "#channel-name" "Reply text" --thread-ts 1234567890.123456\` | -| Edit a message | \`agent-slack message edit "#channel-name" --ts 1234567890.123456 "Updated text"\` | -| Delete a message | \`agent-slack message delete "#channel-name" --ts 1234567890.123456\` | - -**Targets** can be: -- A full Slack URL: \`https://team.slack.com/archives/C01234567/p1234567890123456\` -- A channel name: \`"#general"\` or \`"general"\` -- A channel ID: \`C01234567\` - -### Reactions - -\`\`\` -agent-slack message react add "" --ts -agent-slack message react remove "" --ts -\`\`\` - -### Search - -\`\`\` -agent-slack search messages "query text" --limit 20 -agent-slack search messages "query" --channel "#channel-name" --user "@username" -agent-slack search messages "query" --after 2025-01-01 --before 2025-02-01 -agent-slack search files "query" --limit 10 -\`\`\` - -### Channels - -\`\`\` -agent-slack channel new --name "project-x" --workspace https://team.slack.com -agent-slack channel new --name "secret-project" --private -agent-slack channel invite --channel "#project-x" --users "@alice,@bob" -\`\`\` - -### Users - -\`\`\` -agent-slack user list --limit 200 -agent-slack user get "@username" -agent-slack user get U01234567 -\`\`\` - -### Canvases - -\`\`\` -agent-slack canvas get "https://team.slack.com/docs/F01234567" -agent-slack canvas get F01234567 --workspace https://team.slack.com -\`\`\` - ---- - -## 3. Multi-Workspace - -**Important:** The user has chosen which workspaces to use. Before your first Slack operation, read \`~/.rowboat/config/slack.json\` to see the selected workspaces. Only interact with workspaces listed in that config — ignore any other authenticated workspaces. - -If the selected workspace list contains multiple entries, use \`--workspace \` to disambiguate: - -\`\`\` -agent-slack message list "#general" --workspace https://team.slack.com -\`\`\` - -If only one workspace is selected, always use \`--workspace\` with its URL to avoid ambiguity with other authenticated workspaces. - ---- - -## 4. Token Budget Control - -Use \`--limit\` to control how many messages/results are returned. Use \`--max-body-chars\` or \`--max-content-chars\` to truncate long message bodies: - -\`\`\` -agent-slack message list "#channel" --limit 10 -agent-slack search messages "query" --limit 5 --max-content-chars 2000 -\`\`\` - ---- - -## 5. Discovering More Commands - -For any command you're unsure about: - -\`\`\` -agent-slack --help -agent-slack message --help -agent-slack search --help -agent-slack channel --help -\`\`\` - ---- - -## Best Practices - -- **Always show drafts before sending** — Never send Slack messages without user confirmation -- **Summarize, don't dump** — When showing channel history, summarize the key points rather than pasting everything -- **Prefer Slack URLs** — When referring to messages, use Slack URLs over raw channel names when available -- **Use --limit** — Always set reasonable limits to keep output concise and token-efficient -- **Resolve user IDs** — Messages contain raw user IDs like \`U078AHJP341\`. Resolve them to real names before presenting to the user. Batch all lookups into a single \`executeCommand\` call using \`;\` separators, e.g. \`agent-slack user get U078AHJP341 --workspace ... ; agent-slack user get U090UEZCEQ0 --workspace ...\` -- **Cross-reference with knowledge base** — Check if mentioned people have notes in the knowledge base -`; - -export default skill; diff --git a/apps/x/packages/core/src/application/assistant/skills/web-search/skill.ts b/apps/x/packages/core/src/application/assistant/skills/web-search/skill.ts deleted file mode 100644 index d3d0e6e1..00000000 --- a/apps/x/packages/core/src/application/assistant/skills/web-search/skill.ts +++ /dev/null @@ -1,52 +0,0 @@ -export const skill = String.raw` -# Web Search Skill - -You have access to two search tools for finding information on the internet. Choose the right one based on the user's intent. - -## Tools - -### web-search (Brave Search) -Quick, general-purpose web search. Returns titles, URLs, and short descriptions. - -**Best for:** -- Quick lookups for things that change ("current price of Bitcoin", "weather in SF") -- Current events and breaking news -- Finding a specific website or page -- Simple questions with direct answers -- Checking a fact or date - -### research-search (Exa Search) -Deep, research-oriented search. Returns full article text, highlights, and metadata (author, published date). - -**Best for:** -- Exploring a topic in depth ("what are the latest advances in CRISPR") -- Finding articles, blog posts, papers, and quality sources -- Discovering companies, people, or organizations -- Research where you need rich context, not just links -- When the user says "research", "find articles about", "look into", "deep dive" - -**Category filter:** Use the category parameter when the user's intent clearly maps to one: company, research paper, news, tweet, personal site, financial report, people. - -## How Many Searches to Do - -**CRITICAL: Always start with exactly ONE search call.** Pick the single best tool (\`web-search\` or \`research-search\`) and make one request. Wait for the result before deciding if more searches are needed. - -**NEVER call multiple search tools simultaneously.** No parallel web-search + research-search. No firing off two web-searches at once. Always sequential: one search at a time. - -Only make a follow-up search if: -- The first search returned truly uninformative or irrelevant results -- The query has clearly distinct sub-topics that the first search couldn't cover (e.g., "compare X and Y" after getting results for X only) -- The user explicitly asks you to dig deeper - -One good search is almost always enough. Default to one and stop. - -## Choosing Between the Two - -If both tools are attached, prefer: -- \`web-search\` when the user wants a quick answer or specific link -- \`research-search\` when the user wants to learn, explore, or gather sources - -If only one is attached, use whichever is available. -`; - -export default skill; diff --git a/apps/x/packages/core/src/application/lib/builtin-tools.ts b/apps/x/packages/core/src/application/lib/builtin-tools.ts index 7fc713be..14ace2e1 100644 --- a/apps/x/packages/core/src/application/lib/builtin-tools.ts +++ b/apps/x/packages/core/src/application/lib/builtin-tools.ts @@ -4,7 +4,6 @@ import * as fs from "fs/promises"; import { execSync } from "child_process"; import { glob } from "glob"; import { executeCommand, executeCommandAbortable } from "./command-executor.js"; -import { availableSkills } from "../assistant/skills/index.js"; import { ISkillResolver } from "../../skills/resolver.js"; import { executeTool, listServers, listTools } from "../../mcp/mcp.js"; import container from "../../di/container.js"; @@ -69,9 +68,11 @@ export const BuiltinTools: z.infer = { const resolved = await resolver.resolve(skillName); if (!resolved) { + const catalog = await resolver.getCatalog(); + const available = catalog.map((s) => s.id).join(", "); return { success: false, - message: `Skill '${skillName}' not found. Available skills: ${availableSkills.join(", ")}`, + message: `Skill '${skillName}' not found. Available skills: ${available}`, }; } diff --git a/apps/x/packages/core/src/config/config.ts b/apps/x/packages/core/src/config/config.ts index cec61774..dff88b08 100644 --- a/apps/x/packages/core/src/config/config.ts +++ b/apps/x/packages/core/src/config/config.ts @@ -17,6 +17,7 @@ function ensureDirs() { ensure(path.join(WorkDir, "config")); ensure(path.join(WorkDir, "knowledge")); ensure(path.join(WorkDir, "skills", "overrides")); + ensure(path.join(WorkDir, "skills", "official")); } function ensureDefaultConfigs() { diff --git a/apps/x/packages/core/src/di/container.ts b/apps/x/packages/core/src/di/container.ts index ebe58f37..61edab83 100644 --- a/apps/x/packages/core/src/di/container.ts +++ b/apps/x/packages/core/src/di/container.ts @@ -16,6 +16,7 @@ import { FSAgentScheduleRepo, IAgentScheduleRepo } from "../agent-schedule/repo. import { FSAgentScheduleStateRepo, IAgentScheduleStateRepo } from "../agent-schedule/state-repo.js"; import { FSSlackConfigRepo, ISlackConfigRepo } from "../slack/repo.js"; import { FSSkillsRepo, ISkillsRepo } from "../skills/repo.js"; +import { FSOfficialSkillsRepo, IOfficialSkillsRepo } from "../skills/official-repo.js"; import { SkillResolver, ISkillResolver } from "../skills/resolver.js"; const container = createContainer({ @@ -42,6 +43,7 @@ container.register({ agentScheduleStateRepo: asClass(FSAgentScheduleStateRepo).singleton(), slackConfigRepo: asClass(FSSlackConfigRepo).singleton(), skillsRepo: asClass(FSSkillsRepo).singleton(), + officialSkillsRepo: asClass(FSOfficialSkillsRepo).singleton(), skillResolver: asClass(SkillResolver).singleton(), }); diff --git a/apps/x/packages/core/src/skills/official-repo.ts b/apps/x/packages/core/src/skills/official-repo.ts new file mode 100644 index 00000000..22731493 --- /dev/null +++ b/apps/x/packages/core/src/skills/official-repo.ts @@ -0,0 +1,46 @@ +import fs from "node:fs/promises"; +import path from "node:path"; +import { WorkDir } from "../config/config.js"; +import { parseSkillMd } from "./skill-md-parser.js"; +import type { SkillDefinition } from "./types.js"; + +export interface IOfficialSkillsRepo { + listOfficial(): Promise; + getOfficial(id: string): Promise; +} + +export class FSOfficialSkillsRepo implements IOfficialSkillsRepo { + private readonly officialDir = path.join(WorkDir, "skills", "official"); + + async listOfficial(): Promise { + const result: SkillDefinition[] = []; + let entries: string[]; + try { + entries = await fs.readdir(this.officialDir); + } catch { + return result; + } + + for (const entry of entries) { + const skillMdPath = path.join(this.officialDir, entry, "SKILL.md"); + try { + const raw = await fs.readFile(skillMdPath, "utf-8"); + result.push(parseSkillMd(raw, entry)); + } catch { + // Not a valid skill directory, skip + } + } + + return result; + } + + async getOfficial(id: string): Promise { + const skillMdPath = path.join(this.officialDir, id, "SKILL.md"); + try { + const raw = await fs.readFile(skillMdPath, "utf-8"); + return parseSkillMd(raw, id); + } catch { + return null; + } + } +} diff --git a/apps/x/packages/core/src/skills/resolver.ts b/apps/x/packages/core/src/skills/resolver.ts index 281c63ed..4a59eb90 100644 --- a/apps/x/packages/core/src/skills/resolver.ts +++ b/apps/x/packages/core/src/skills/resolver.ts @@ -1,32 +1,31 @@ import { ResolvedSkill } from "@x/shared/dist/skill.js"; -import { officialDefinitions, type SkillDefinition } from "../application/assistant/skills/index.js"; +import { IOfficialSkillsRepo } from "./official-repo.js"; import { ISkillsRepo } from "./repo.js"; export interface ISkillResolver { getCatalog(): Promise; resolve(id: string): Promise; - getOfficial(id: string): ResolvedSkill | null; + getOfficial(id: string): Promise; generateCatalogMarkdown(): Promise; } export class SkillResolver implements ISkillResolver { - private readonly officialMap: Map; + private readonly officialSkillsRepo: IOfficialSkillsRepo; private readonly skillsRepo: ISkillsRepo; - constructor({ skillsRepo }: { skillsRepo: ISkillsRepo }) { + constructor({ officialSkillsRepo, skillsRepo }: { officialSkillsRepo: IOfficialSkillsRepo; skillsRepo: ISkillsRepo }) { + this.officialSkillsRepo = officialSkillsRepo; this.skillsRepo = skillsRepo; - this.officialMap = new Map( - officialDefinitions.map((d) => [d.id, d]), - ); } async getCatalog(): Promise { + const officials = await this.officialSkillsRepo.listOfficial(); const overrides = await this.skillsRepo.listOverrides(); const overrideMap = new Map(overrides.map((o) => [o.skillId, o])); const results: ResolvedSkill[] = []; - for (const official of officialDefinitions) { + for (const official of officials) { const override = overrideMap.get(official.id); if (override) { results.push({ @@ -55,7 +54,7 @@ export class SkillResolver implements ISkillResolver { } async resolve(id: string): Promise { - const official = this.officialMap.get(id); + const official = await this.officialSkillsRepo.getOfficial(id); if (!official) return null; const override = await this.skillsRepo.getOverride(id); @@ -82,8 +81,8 @@ export class SkillResolver implements ISkillResolver { }; } - getOfficial(id: string): ResolvedSkill | null { - const official = this.officialMap.get(id); + async getOfficial(id: string): Promise { + const official = await this.officialSkillsRepo.getOfficial(id); if (!official) return null; return { diff --git a/apps/x/packages/core/src/skills/skill-md-parser.ts b/apps/x/packages/core/src/skills/skill-md-parser.ts new file mode 100644 index 00000000..f54ecfb9 --- /dev/null +++ b/apps/x/packages/core/src/skills/skill-md-parser.ts @@ -0,0 +1,30 @@ +import { parse } from "yaml"; +import { SkillFrontmatter } from "@x/shared/dist/skill.js"; +import type { SkillDefinition } from "./types.js"; + +/** + * Parse a SKILL.md file (YAML frontmatter + markdown body) into a SkillDefinition. + * Follows the Agent Skills spec: frontmatter between --- markers. + */ +export function parseSkillMd(raw: string, fallbackId?: string): SkillDefinition { + if (!raw.startsWith("---")) { + throw new Error("SKILL.md missing frontmatter (must start with ---)"); + } + + const end = raw.indexOf("\n---", 3); + if (end === -1) { + throw new Error("SKILL.md has malformed frontmatter (missing closing ---)"); + } + + const fm = raw.slice(3, end).trim(); + const body = raw.slice(end + 4).trim(); + const parsed = SkillFrontmatter.parse(parse(fm)); + + return { + id: parsed.name ?? fallbackId ?? "unknown", + title: parsed.metadata?.title ?? parsed.name, + summary: parsed.description, + version: parsed.metadata?.version ?? "0.0.0", + content: body, + }; +} diff --git a/apps/x/packages/core/src/skills/sync.ts b/apps/x/packages/core/src/skills/sync.ts new file mode 100644 index 00000000..dd3ba102 --- /dev/null +++ b/apps/x/packages/core/src/skills/sync.ts @@ -0,0 +1,168 @@ +import https from "node:https"; +import http from "node:http"; +import fs from "node:fs"; +import fsp from "node:fs/promises"; +import path from "node:path"; +import { execSync } from "node:child_process"; +import { pipeline } from "node:stream/promises"; +import { WorkDir } from "../config/config.js"; + +const SYNC_INTERVAL_MS = 60 * 60 * 1000; // 1 hour +const REPO_OWNER = "rowboatlabs"; +const REPO_NAME = "skills"; +const BRANCH = "main"; +const TARBALL_URL = `https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/tarball/${BRANCH}`; + +const officialDir = path.join(WorkDir, "skills", "official"); +const syncStateFile = path.join(WorkDir, "skills", "last-sync.json"); + +interface SyncState { + timestamp: string; + etag: string | null; +} + +function log(msg: string) { + console.log(`[SkillSync] ${msg}`); +} + +async function readSyncState(): Promise { + try { + const raw = await fsp.readFile(syncStateFile, "utf-8"); + return JSON.parse(raw); + } catch { + return null; + } +} + +async function writeSyncState(state: SyncState): Promise { + await fsp.writeFile(syncStateFile, JSON.stringify(state, null, 2)); +} + +/** + * Download and extract the GitHub tarball to the official skills directory. + * Returns true if new skills were downloaded, false if 304 (not modified). + */ +async function syncFromGitHub(): Promise { + const state = await readSyncState(); + + return new Promise((resolve, reject) => { + const headers: Record = { + "User-Agent": "Rowboat-SkillSync/1.0", + Accept: "application/vnd.github+json", + }; + if (state?.etag) { + headers["If-None-Match"] = state.etag; + } + + const makeRequest = (url: string) => { + const mod = url.startsWith("https") ? https : http; + mod.get(url, { headers }, (res) => { + // Handle redirects (GitHub returns 302 for tarball) + if (res.statusCode === 301 || res.statusCode === 302) { + const location = res.headers.location; + if (location) { + makeRequest(location); + return; + } + } + + if (res.statusCode === 304) { + log("Skills up to date (304 Not Modified)"); + resolve(false); + return; + } + + if (res.statusCode !== 200) { + reject(new Error(`GitHub API returned ${res.statusCode}`)); + return; + } + + const newEtag = res.headers.etag ?? null; + const tmpDir = path.join(WorkDir, "skills", ".sync-tmp"); + + // Clean tmp dir + fs.rmSync(tmpDir, { recursive: true, force: true }); + fs.mkdirSync(tmpDir, { recursive: true }); + + const tarPath = path.join(tmpDir, "download.tar.gz"); + const writeStream = fs.createWriteStream(tarPath); + + pipeline(res, writeStream) + .then(async () => { + // Extract tarball + const extractDir = path.join(tmpDir, "extracted"); + fs.mkdirSync(extractDir, { recursive: true }); + execSync(`tar -xzf "${tarPath}" -C "${extractDir}"`, { stdio: "pipe" }); + + // GitHub tarballs have a top-level directory like owner-repo-hash/ + const entries = await fsp.readdir(extractDir); + const topDir = entries[0]; + if (!topDir) { + throw new Error("Extracted tarball is empty"); + } + + const sourceDir = path.join(extractDir, topDir); + + // Atomic swap: rename old -> .old, new -> official, delete .old + const oldDir = path.join(WorkDir, "skills", ".official-old"); + fs.rmSync(oldDir, { recursive: true, force: true }); + + const officialExists = fs.existsSync(officialDir); + if (officialExists) { + await fsp.rename(officialDir, oldDir); + } + await fsp.rename(sourceDir, officialDir); + if (officialExists) { + fs.rmSync(oldDir, { recursive: true, force: true }); + } + + // Cleanup tmp + fs.rmSync(tmpDir, { recursive: true, force: true }); + + // Update sync state + await writeSyncState({ + timestamp: new Date().toISOString(), + etag: newEtag, + }); + + log("Skills synced from GitHub successfully"); + resolve(true); + }) + .catch(reject); + }).on("error", reject); + }; + + makeRequest(TARBALL_URL); + }); +} + +async function runSync(): Promise { + // Ensure official dir exists + await fsp.mkdir(officialDir, { recursive: true }); + + // Try syncing from GitHub + try { + await syncFromGitHub(); + } catch (error) { + log(`Sync failed (will use cached skills): ${error instanceof Error ? error.message : String(error)}`); + } +} + +export async function init(): Promise { + log("Starting skill sync service..."); + + // Initial sync + await runSync(); + + // Periodic sync + const loop = async () => { + while (true) { + await new Promise((resolve) => setTimeout(resolve, SYNC_INTERVAL_MS)); + log("Running periodic sync..."); + await runSync(); + } + }; + loop().catch((error) => { + log(`Sync loop error: ${error instanceof Error ? error.message : String(error)}`); + }); +} diff --git a/apps/x/packages/core/src/skills/types.ts b/apps/x/packages/core/src/skills/types.ts new file mode 100644 index 00000000..48508f7b --- /dev/null +++ b/apps/x/packages/core/src/skills/types.ts @@ -0,0 +1,11 @@ +/** + * SkillDefinition — the runtime shape of a parsed skill. + * Skill content comes from disk (synced from GitHub or user overrides). + */ +export type SkillDefinition = { + id: string; // Also used as folder name + title: string; + summary: string; + version: string; // semver + content: string; +}; diff --git a/apps/x/packages/shared/src/skill.ts b/apps/x/packages/shared/src/skill.ts index ad47f54e..4d9e5b83 100644 --- a/apps/x/packages/shared/src/skill.ts +++ b/apps/x/packages/shared/src/skill.ts @@ -1,5 +1,24 @@ import { z } from 'zod'; +// SKILL.md frontmatter schema (Agent Skills spec compliant) +// Top-level: name, description, license, compatibility, allowed-tools, metadata +// Custom Rowboat fields go under metadata +export const SkillFrontmatter = z.object({ + name: z.string().max(64), + description: z.string().max(1024), + license: z.string().optional(), + compatibility: z.string().max(500).optional(), + "allowed-tools": z.string().optional(), + metadata: z.object({ + version: z.string().optional(), + title: z.string().optional(), + author: z.string().optional(), + tags: z.string().optional(), + }).passthrough().optional(), +}); + +export type SkillFrontmatter = z.infer; + // Official skill metadata (bundled with app) export const OfficialSkillMeta = z.object({ id: z.string(),