Creating Custom Skills
This guide shows how to write a custom Agent Skill for StudioBrain. A skill is a YAML (or Markdown with YAML frontmatter) file that gives the AI a role, prompts and a declared set of capabilities for a kind of content. For the user-facing schema see Agent Skills.
Skill Structure
File location
Skills live in the _Skills/ directory at the project root. The skill loader (crates/ai/crates/sb-skills) reads these subdirectories, highest priority first:
| Directory | Trust tier | Notes |
|---|---|---|
_Skills/Standard/ | built-in | Ships with the product |
_Skills/Core/ | built-in | Ships with the product |
_Skills/Custom/ | untrusted | Put your own skills here |
_Skills/User/ | untrusted | Per-user skills |
_Skills/ (root) | untrusted | Legacy, lowest priority |
If two files share a skill_id, the higher-priority directory wins. _Skills/Downloaded/ is deliberately never loaded: catalog downloads are staged there until consent exists, and they do not execute.
YourProject/
_Skills/
Custom/
my_custom_skill.ymlThe loader accepts .yml and .yaml files, and .md files with YAML frontmatter. Files that fail to parse are skipped with a warning.
Basic structure
skill_id: unique_identifier # required
name: Display Name # falls back to skill_id if omitted
description: What this skill does
version: "1.0"
applies_to: Character # entity or document type
category: entity
capabilities:
- capability_one
prompts:
system: |
System prompt for AI behavior
tags:
- tag1
min_tier: freeField reference
| Field | Type | Default | Description |
|---|---|---|---|
skill_id | string | none (required) | Unique identifier (lowercase, underscores). A file without it is rejected. |
name | string | skill_id | Display name |
description | string | "" | What the skill does |
version | string | “1.0” | Skill version |
capabilities | array | [] | Free-form capability identifiers |
prompts | map of string to string | Named prompts. system is the one used to guide behavior. | |
applies_to | string | "" | Entity or document type the skill targets (for example Character) |
category | string | "" | Classification (entity, document, narrative, validation, …) |
tags | array | [] | Tags for organization and search |
min_tier | string | “free” | Minimum subscription tier |
tool_scope | array | [] | Tool namespaces the skill may use (for example sb/search). Empty means no tool access. |
model | string | "" | Model alias in sb/<id> form. Do not hardcode concrete model IDs. |
output_contract | object | none | schema (JSON Schema) and optional description for structured output |
invocation_scope | object | none | creates_child_session, inherit_context, max_turns |
Unknown keys are ignored. Fields such as parameters or definition are not part of the loaded skill schema.
Creating a Skill
- Pick a
skill_idmade of lowercase letters and underscores, following{purpose}_{type}(for examplegame_mechanics_validator). - Add
name,description,applies_toandcategory. - List
capabilities. They are descriptive labels, for examplecontent_generation,rule_validation,pattern_detection,style_adjustment. - Write
prompts.system: define the role, the method and the expected output quality. - Add
tagsandmin_tier.
Complete example
skill_id: game_mechanics_validator
name: Game Mechanics Validator
description: Validates game mechanics documentation for consistency and balance
version: "1.0"
applies_to: DOC_GAME_MECHANICS
category: validation
capabilities:
- rule_validation
- consistency_check
- edge_case_detection
prompts:
system: |
You are a game mechanics validator with expertise in balancing,
edge case detection, and rule consistency. Review the documentation
and identify:
1. Inconsistent rule definitions
2. Unbalanced mechanics
3. Missing edge case handling
4. Contradictions with other systems
Give specific feedback and concrete suggestions for improvement.
tags:
- validation
- game-mechanics
min_tier: freeHow Skills Are Used
Skill matching happens where the skill files are loaded, which is the desktop/native runtime (sb-skills is used by sb-genmodes and the studio MCP server). Skills matching the entity type being generated (applies_to) have their prompts folded into the generation request.
On the SaaS, user-authored skill files are carried between a project’s desktops through the project’s definition-file sync (stored per project as project_skill_files). The agent-skills registry on api.studiobrain.ai holds catalog metadata only, not the YAML body. Delete is local: removing a skill file on one desktop does not remove it for the whole project.
Testing a Skill
- Place the file in
_Skills/Custom/and confirm it appears in the skill list. - Trigger generation on an entity whose type matches
applies_toand check that the output reflects the prompt.
Admins can manage workspace installs through the API (see Agent Skills API):
GET /api/agent-skills # catalog
GET /api/agent-skills/{skill_id} # one skill
GET /api/agent-skills/tenant/enabled # enabled for the workspace
POST /api/agent-skills/tenant/install # admin; body: {"skill_id": "..."}
POST /api/agent-skills/tenant/{skill_id}/enable # adminAll of these go to https://api.studiobrain.ai with Authorization: Bearer <token>; send X-Project-Id on writes. Install defaults source to marketplace.
Best Practices
- Specific prompts. Define the role precisely, include examples for complex tasks, and state the output format.
- Least privilege. Leave
tool_scopeempty unless the skill needs tools, and list only the namespaces required. - Model aliases. Use
sb/<id>aliases inmodel, never concrete model IDs. - Categorize. Match
categoryto purpose and add tags for discovery. - Version. Start at
"1.0"and bump it on breaking prompt changes.
Troubleshooting
Skill not loading
Check that the file is under _Skills/ (not _Skills/Downloaded/), has a .yml, .yaml or .md extension, contains skill_id, and is valid YAML. Parse failures are logged as Failed to load skill from <path>.
Skill not applying
Check that applies_to matches the entity or document type, and that the skill is enabled for the workspace (GET /api/agent-skills/tenant/enabled).
YAML errors
Use spaces, not tabs; check for missing colons and unclosed quotes; run yamllint if in doubt.
Skills in Template Packs
Packs can include skill files under _Skills/. See Template Packs.
Next Steps
- Agent Skills: schema overview
- Agent Skills API: catalog and install endpoints
- Plugin Development: extend with plugins