This directory contains OpenCode AI agents and custom commands for specialized development workflows. The structure supports both agent configurations and slash commands that can be used within the OpenCode TUI.
AGENTS.md # This file - development guidelines
├── agents/ # AI Agent configurations
│ ├── _shared/ # Shared components and utilities
│ ├── augment/ # Augment-specific agents
│ ├── claude/ # Claude-specific agents
│ ├── copilot/ # Copilot-specific agents
│ ├── opencode/ # OpenCode-specific agents
│ └── windsurf/ # Windsurf-specific agents
├── opencode/ # OpenCode configurations
│ ├── agent/ # Agent definition files (.md)
│ └── command/ # Custom slash commands (.md)
└── windsurf/ # Windsurf workflows and skills
AI agents are defined as Markdown files with YAML frontmatter in the agents/ subdirectories. Each agent can have specialized tools, permissions, and models.
Custom slash commands are defined in opencode/command/ directory. These allow you to create reusable prompts that can be executed with /command-name in the OpenCode TUI.
Custom commands are reusable prompts that can be executed as slash commands in the OpenCode TUI. They are defined as Markdown files in the agents/opencode/command/ directory.
Each command file follows this format:
---
description: Brief description of what the command does
agent: build # Optional: which agent should execute
model: anthropic/claude-sonnet-4-20250514 # Optional: model override
subtask: false # Optional: force subagent invocation
---
Your prompt template here. Use $ARGUMENTS for command arguments.- Arguments: Use
$ARGUMENTSor positional parameters ($1,$2, etc.) - Shell output: Include command output with
!command syntax - File references: Include files with
@filename - Agent targeting: Specify which agent should execute the command
The agents/opencode/command/ directory contains a comprehensive set of predefined commands:
/commit- Generate commit messages/create-pr- Create pull requests/implement-task- Implement development tasks/check- Run code quality checks/ruff-check- Run ruff linting and formatting
/init-project- Initialize new projects/create-plan- Create development plans/create-prd- Create product requirement documents/package-skill- Package development skills
/build-skill- Build agent skills/create-command- Create custom commands
/check-commands- Validate command syntax/check-agents- Validate agent configurations
# In OpenCode TUI
/commit # Generate commit message
/create-pr # Create pull request
/implement-task "Add user authentication" # Implement specific task
/check # Run comprehensive checksFor detailed documentation, see: https://opencode.ai/docs/commands/
# Full installation test
./test-install.sh
# Skill validation
./agents/_shared/references/scripts/validate-skill.sh <skill-path>
# Skill trigger testing
./agents/_shared/references/scripts/test-skill-trigger.sh <skill-path>
# Custom command validation
./opencode/command/check-commands.sh # Validate command syntax and structureFor Python-based skills: python -m pytest tests/test_specific.py::test_function
For Bash scripts: bash -n script.sh for syntax checking
- Use
#!/usr/bin/env bashshebang - Use
set -efor error handling - Follow existing function naming:
install_*,validate_*,log_* - Use color variables from common.sh:
$RED,$GREEN,$YELLOW,$BLUE,$MAGENTA,$CYAN,$NC
- Use ruff for linting, black for formatting
- Type hints required for function signatures
- Error handling with try/except blocks, not bare excepts
- Use f-strings for string formatting
- Scripts in
scripts/directories - Documentation in same directory as implementation
- Use relative imports within modules
- Follow existing directory naming patterns
- Functions:
snake_casewith descriptive names - Files:
kebab-case.shorsnake_case.py - Variables:
UPPER_SNAKE_CASEfor constants,snake_casefor variables - Error messages: Use log functions from common.sh
- YAML frontmatter in all .md files with required fields
- Usage examples in all executable scripts
- Comment complex logic and non-obvious workarounds