This repository contains personal OpenCode CLI configuration including custom agents, skills, and workflows.
This repository uses a structured approach to organize OpenCode resources:
agent/- Agent definition files (markdown)skill/- Skill packages and definitionsthoughts/- Personal notes and planning documentsopencode.jsonc- OpenCode configuration
To explore current contents, use standard file navigation tools (ls, glob, read, etc.).
Agents are markdown files with YAML frontmatter that define their mode:
Primary agents (mode: "primary"):
- Top-level agents invoked directly by users or the main OpenCode instance
- Handle complete workflows and complex tasks
- Examples: research, create-plan, implement_plan, build
Sub-agents (mode: "subagent"):
- Specialized agents invoked by other agents to handle focused subtasks
- Provide specific capabilities that primary agents leverage
- Examples: codebase-locator, codebase-analyzer, thoughts-locator
When creating or updating agent files:
- Place markdown files in
agent/directory - Add YAML frontmatter with required fields:
description: When and how to use the agentmode: Either"primary"or"subagent"permission: Optional permissions (e.g.,bash: ask,edit: deny)
- Follow the established structure from existing agents
- Include clear instructions for the agent's purpose and workflow
- Reference any required tools or dependencies
- Document expected inputs and outputs
Agents can specify granular permissions in their frontmatter:
Edit permissions:
edit: allow- Can edit files directlyedit: ask- Must ask before editingedit: deny- Cannot edit files
Write permissions:
write: allow- Can write files directlywrite: ask- Must ask before writingwrite: deny- Cannot write files
Bash permissions:
Bash permissions support pattern-based rules with specific command allowances:
bash:
"exact command": allow # Exact command allowed
"command*": allow # Command with any arguments allowed
"another command*": deny # Command explicitly denied
"*": ask # All other commands require permissionThe pattern matching works as follows:
- Exact strings match specific commands:
"git status": allow - Wildcards (
*) match arguments:"git diff*": allowmatchesgit diff,git diff --staged, etc. - The catch-all
"*"specifies the default behavior for unmatched commands - Rules are evaluated in order, first match wins
- Each rule can have
allow,ask, ordenyas the permission level
WebFetch permissions:
webfetch: allow- Can fetch web contentwebfetch: ask- Must ask before fetchingwebfetch: deny- Cannot fetch web content
Skills extend OpenCode's capabilities by providing specialized knowledge, workflows, and tools. Current skills:
Skills are stored in the skill/ directory. Each skill contains its own documentation and workflow instructions.
To work with skills, read the skill's SKILL.md file or explore the skill_creator skill for creation workflows.
This repo uses minimal npm dependencies for OpenCode plugins.
Install dependencies:
npm installCheck package.json for current dependencies.
Python scripts in skill directories require Python 3.x. Most scripts have no external dependencies - check individual script files for requirements.
When creating commits:
- Use clear, descriptive commit messages
- Start with a verb in present tense (e.g., "Add", "Update", "Fix")
- Keep first line under 72 characters
- Follow the repository's existing commit style
Check status before committing:
git status
git diffStandard commit workflow:
git add <files>
git commit -m "Brief description of changes"This is a personal repository - work directly on main or create feature branches as needed.
The opencode.jsonc file configures OpenCode behavior:
When updating opencode.jsonc:
- Maintain valid JSON format (with comments)
- Follow the OpenCode schema
- Test changes by running OpenCode CLI
Organization:
- Agent files in
agent/ - Skills in
skill/ - Thoughts in
thoughts/ - Configuration in root
Documentation:
- Document agent workflows clearly
- Include examples in skill files
- Keep README.md updated
Testing:
- Test agent definitions with OpenCode CLI
- Validate skills before packaging
- Verify Python scripts run without errors
Version Control:
- Commit logical units of work
- Check
.gitignorefor exclusion patterns
- Create a new
.mdfile inagent/ - Follow the structure of existing agents
- Test with OpenCode CLI
- Commit the changes
Use the skill_creator skill - it contains the full workflow for creating, validating, and packaging skills.
- Install the provider SDK:
npm install @ai-sdk/<provider> - Update
opencode.jsoncwith provider configuration - Add to
enabled_providersarray - Test the provider with OpenCode CLI
OpenCode doesn't recognize agents/skills:
- Verify files are in correct directories
- Check file naming conventions
- Restart OpenCode CLI if needed
{ "$schema": "https://opencode.ai/config.json", "enabled_providers": ["anthropic", "mistral"], "provider": { "mistral": { "npm": "@ai-sdk/mistral", "name": "mistral" } } }