OpenCode Configuration Validation
This skill provides comprehensive validation rules for OpenCode configurations.
Overview
Use this skill to validate agent, skill, and command configurations before finalizing them. It ensures configurations follow OpenCode standards and will work correctly.
When to Use
Load this skill when:
- •Creating new OpenCode configurations
- •Validating existing configurations
- •Checking for naming convention compliance
- •Ensuring configuration completeness
Agent Validation
Required Elements
- •
Frontmatter Fields:
- •
description: Required, 1-200 characters - •
mode: Required for agents (primary,subagent, orall)
- •
- •
Optional Fields:
- •
model: Format must beprovider/model-id- •To get a list of valid model IDs, run:
opencode models - •This command shows all available models with their providers
- •To get a list of valid model IDs, run:
- •
temperature: Must be between 0.0 and 1.0 - •
tools: Object with boolean values - •
permissions: Object withallow,ask, ordenyvalues - •
maxSteps: Positive integer for iteration limits
- •
- •
File Structure:
- •Location:
~/.config/opencode/agent/[name].mdor.opencode/agent/[name].md - •Must have frontmatter section (between
---markers) - •Should include agent instructions after frontmatter
- •Location:
Naming Rules
- •Lowercase letters only
- •Hyphens allowed (not at start/end)
- •No spaces, underscores, or special characters
- •Valid:
code-review,otto-analyzer - •Invalid:
Code_Review,otto analyzer,review-
Tool Configuration
Valid tool names:
- •
read,write,edit - •
bash,glob,grep - •
skill,task,webfetch - •
todowrite,todoread - •MCP server tools (format:
servername_toolname)
Permission Configuration
yaml
permissions:
edit: allow|ask|deny
bash:
"git *": allow
"npm *": ask
"*": deny
webfetch: allow
Skill Validation
Required Elements
- •
Directory Structure:
- •Must be in
skill/[name]/SKILL.md - •Directory name must match skill name
- •Must be in
- •
Frontmatter Fields:
- •
name: Required, must match directory - •
description: Required, 1-1024 characters
- •
- •
Optional Fields:
- •
license: SPDX identifier - •
compatibility: String value - •
metadata: Key-value pairs
- •
Naming Rules
- •Must match:
^[a-z0-9]+(-[a-z0-9]+)*$ - •No consecutive hyphens (
--) - •No leading/trailing hyphens
- •Valid:
git-workflow,code-review-process - •Invalid:
git--workflow,-review,review-
Content Structure
Should include:
- •Overview section
- •"When to Use" criteria
- •Clear instructions
- •Examples (optional but recommended)
Command Validation
Required Elements
- •
File Location:
- •Must be in
command/[name].md - •File name becomes command name
- •Must be in
- •
Frontmatter Fields:
- •At least one of:
templateordescription
- •At least one of:
- •
Optional Fields:
- •
agent: Which agent handles the command - •
model: Model override - •
subtask: Boolean for subagent invocation
- •
Template Syntax
- •
$ARGUMENTS: All arguments as string - •
$1,$2, etc.: Individual arguments - •
!command``: Shell command interpolation - •
@filename: File reference
Naming Rules
- •Short, memorable names
- •Lowercase only
- •No special characters
- •Should be easy to type
Common Validation Errors
Agent Errors
- •Missing description: Every agent needs a description
- •Invalid mode: Must be primary, subagent, or all
- •Bad tool names: Check spelling of tool names
- •Invalid temperature: Must be 0.0-1.0
Skill Errors
- •Name mismatch: Directory and name field must match
- •Invalid characters: Only lowercase and hyphens
- •Missing SKILL.md: File must be named exactly
SKILL.md - •Description too long: Keep under 1024 characters
Command Errors
- •No template: Commands need content
- •Invalid placeholders: Check $ syntax
- •Bad shell syntax: Use !
commandnot just !command
Validation Process
- •
Structure Check:
- •Verify file locations
- •Check directory structure
- •Validate file naming
- •
Frontmatter Validation:
- •Parse YAML correctly
- •Check required fields
- •Validate field values
- •
Content Validation:
- •Ensure instructions exist
- •Check for placeholder syntax
- •Verify example validity
- •
Cross-Reference Check:
- •No duplicate names
- •Valid agent references
- •Existing skill dependencies
Best Practices
- •
Descriptions:
- •Be specific about purpose
- •Use action-oriented language
- •Keep concise but informative
- •
Naming:
- •Use descriptive names
- •Follow conventions consistently
- •Avoid overly generic names
- •
Documentation:
- •Include usage examples
- •Document special behaviors
- •Explain configuration choices
- •
Testing:
- •Test configurations before deployment
- •Verify in isolation first
- •Check integration with other components