Skills Manager
Relevant source files
The following files were used as context for generating this wiki page:
The Skills Manager is a core module within OpenWork responsible for extending the capabilities of the OpenCode engine through specialized knowledge, workflows, and tool integrations. It allows users and agents to create, install, import, and manage "Skills," which are behavioral patterns defined in Markdown and hosted within specific workspace directories.
Sources: packages/app/src/app/data/skill-creator.md:1-5, ARCHITECTURE.md:113-118
System Architecture
The Skills Manager operates across the frontend (SolidJS), the backend server (Node.js/Bun), and the desktop bridge (Rust/Tauri). Skills are stored as directories containing a SKILL.md file, located under .opencode/skills/ or .claude/skills/.
Logic Flow for Skill Discovery
The system scans both project-specific and global directories to aggregate available skills.
The discovery process prioritizes project-level skills over global ones and filters out invalid skill names or descriptions.
Sources: packages/server/src/skills.ts:68-103, packages/desktop/src-tauri/src/commands/skills.rs:43-71
Skill Definition and Structure
A skill is defined by a folder structure anchored by a SKILL.md file. It utilizes YAML frontmatter for metadata and Markdown for the behavioral instructions.
Recommended Structure
.opencode/
skills/
my-skill/
SKILL.md
README.md
templates/
scripts/
Sources: packages/app/src/app/data/skill-creator.md:7-19
Trigger Phrases
Trigger phrases are critical for the agent to decide when to activate a skill. These are defined in the frontmatter description or under a specific "When to use" heading in the body.
| Feature | Requirement | Example |
|---|---|---|
| Trigger Phrase | Must contain quoted phrases | "Triggers on: 'rotate PDF'" |
| Specificity | Longer than 50 characters | "Use when user mentions 'content pipeline'..." |
| Validation | Uses "when" or "triggers" | "Always load this skill when..." |
Sources: packages/app/src/app/data/skill-creator.md:21-35, packages/app/pr/skill-creator-triggers.md:17-45
Core Components
1. Skill Creator
A specialized skill that provides a template and checklist for authoring new skills within the workspace. It enforces design goals such as portability and safe credential handling.
Sources: packages/app/src/app/data/skill-creator.md:1-40
2. Extensions Store (Frontend)
The ExtensionsStore manages the state of skills in the UI, handling refreshes, installations, and uninstalls by communicating with the OpenWork server or Tauri commands.
3. Server-Side Management
The server handles the parsing of frontmatter and the persistence of skill files. It validates skill names (must be kebab-case) and descriptions before saving.
| Parameter | Type | Description |
|---|---|---|
name | string | Unique kebab-case identifier for the skill. |
content | string | Full Markdown content including frontmatter. |
description | string (optional) | Brief summary of the skill's purpose. |
Sources: packages/server/src/skills.ts:105-141, packages/desktop/src-tauri/src/commands/skills.rs:104-122
Key API Endpoints and Commands
Skills are managed via several interfaces depending on the runtime mode (Host vs Client).
| Interface | Method/Command | Action |
|---|---|---|
| Server API | GET /workspace/:id/skills | Lists all detected skills in the workspace. |
| Server API | POST /workspace/:id/skills | Creates or updates (upserts) a skill. |
| Tauri Command | list_local_skills | Reads skills directly from the local filesystem. |
| Tauri Command | install_skill_template | Persists a new skill folder and file. |
| Tauri Command | uninstall_skill | Permanently deletes a skill folder. |
Sources: packages/server/src/server.ts:400-435, packages/desktop/src-tauri/src/commands/skills.rs:240-278, packages/app/src/app/context/extensions.ts:446-488
Implementation Details: Trigger Extraction
The system dynamically extracts trigger phrases to display in the UI (e.g., as subtitles in the Context Panel) rather than showing generic descriptions.
const extractTriggerFromBody = (body: string) => {
const lines = body.split(/\r?\n/);
let inWhenSection = false;
for (const line of lines) {
if (/^#{1,6}\s+when to use/i.test(line)) {
inWhenSection = true; continue;
}
if (inWhenSection && line.trim()) return line.trim().replace(/^[-*+]\s+/, "");
}
return "";
};
Sources: packages/server/src/skills.ts:33-62, packages/app/pr/skill-creator-triggers.md:83-93
Summary
The Skills Manager provides the extensible behavior layer of OpenWork. By standardizing skill discovery across local and global paths and providing a robust "Skill Creator" template, it ensures that agentic workflows remain portable, reconstructable, and easy for both technical and non-technical users to deploy. Significant emphasis is placed on trigger phrase specificity to ensure reliable autonomous activation by the underlying engine.
Sources: packages/app/src/app/data/skill-creator.md:12-16, packages/app/pr/skill-creator-triggers.md:9-15