DeveloperCreating Agent Skills

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:

DirectoryTrust tierNotes
_Skills/Standard/built-inShips with the product
_Skills/Core/built-inShips with the product
_Skills/Custom/untrustedPut your own skills here
_Skills/User/untrustedPer-user skills
_Skills/ (root)untrustedLegacy, 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.yml

The 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: free

Field reference

FieldTypeDefaultDescription
skill_idstringnone (required)Unique identifier (lowercase, underscores). A file without it is rejected.
namestringskill_idDisplay name
descriptionstring""What the skill does
versionstring“1.0”Skill version
capabilitiesarray[]Free-form capability identifiers
promptsmap of string to stringNamed prompts. system is the one used to guide behavior.
applies_tostring""Entity or document type the skill targets (for example Character)
categorystring""Classification (entity, document, narrative, validation, …)
tagsarray[]Tags for organization and search
min_tierstring“free”Minimum subscription tier
tool_scopearray[]Tool namespaces the skill may use (for example sb/search). Empty means no tool access.
modelstring""Model alias in sb/<id> form. Do not hardcode concrete model IDs.
output_contractobjectnoneschema (JSON Schema) and optional description for structured output
invocation_scopeobjectnonecreates_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

  1. Pick a skill_id made of lowercase letters and underscores, following {purpose}_{type} (for example game_mechanics_validator).
  2. Add name, description, applies_to and category.
  3. List capabilities. They are descriptive labels, for example content_generation, rule_validation, pattern_detection, style_adjustment.
  4. Write prompts.system: define the role, the method and the expected output quality.
  5. Add tags and min_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: free

How 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

  1. Place the file in _Skills/Custom/ and confirm it appears in the skill list.
  2. Trigger generation on an entity whose type matches applies_to and 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 # admin

All 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_scope empty unless the skill needs tools, and list only the namespaces required.
  • Model aliases. Use sb/<id> aliases in model, never concrete model IDs.
  • Categorize. Match category to 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