How skeletorflet/opencode-kit works
1. What this repository is
- This is not an application runtime; it is a configuration and orchestration kit for OpenCode.
- Its purpose is to shape how the OpenCode TUI behaves: which agents it can invoke, what skills they load, what commands/workflows are available, and how validation/tooling is enforced.
2. Top-level control plane
- The main entry points are opencode.json, AGENTS.md, .env.example, and the .opencode/ directory.
- opencode.json is the central OpenCode configuration surface, including MCP server setup and related runtime integration.
- AGENTS.md provides global routing rules that influence how requests are classified and delegated.
3. Agent orchestration layer
- .opencode/agents/ contains 34 specialist agents, each focused on a domain such as backend, frontend, security, review, planning, or language-specific development.
- The architecture is intentionally role-based: a request is first routed to the right agent(s), then those agents operate within their own permissions and scope.
- The repository also includes a separate oh-my-opencode orchestration model (.opencode/oh-my-opencode.jsonc) with personas like orchestrator, planner, executor, and architecture advisor.
4. Knowledge and policy layer
- .opencode/skills/ is the reusable instruction library: 71 domain skills loaded on demand by agents.
- .opencode/rules/RULES.md is the highest-priority behavior layer and governs automatic agent selection, precedence, and execution norms.
- The architecture uses a clear precedence chain: global rules → agent instructions → skill instructions.
5. Command and workflow layer
- .opencode/commands/ defines 9 slash commands for common high-level actions such as planning, testing, auditing security, reviewing PRs, and fixing types.
- .opencode/workflows/ defines multi-step operating sequences like project kickoff, TDD loops, pre-flight audits, and the omo main flow.
- These are the user-facing orchestration primitives that connect intent to agent execution.
6. Plugin and tool execution boundary
- .opencode/plugins/ contains TypeScript plugins that run on Bun and modify runtime behavior:
- environment variable injection into shell executions,
- protection against direct .env reads,
- idle notifications.
- .opencode/tools/ contains callable TypeScript tools used by agents, such as safe environment introspection and script execution.
- This creates a boundary between agent reasoning and controlled host interactions.
7. Validation and quality gate subsystem
- .opencode/scripts/ contains Python validation utilities: linting, test orchestration, security scanning, UX auditing, preview management, and full verification.
- These scripts act as an enforcement layer for quality and readiness, separate from the agent prompts themselves.
- The repo’s architecture makes verification an explicit subsystem rather than an ad hoc developer activity.
8. MCP and external service integration
- The configured MCPs in opencode.json connect the kit to external capabilities such as documentation lookup, UI components, deployment management, and sandbox environments.
- From the repository’s perspective, these are context and execution extensions: they augment the agent environment without being part of the kit’s own codebase.
- DAYTONA_API_KEY and similar environment variables show that some capabilities are service-backed and require runtime credentials.
9. Documentation and reference layer
- DOC/ contains a large mirrored documentation set for OpenCode and related ecosystem topics.
- This appears to serve as a local, structured knowledge base for usage, configuration, and platform references.
- The architecture therefore includes a documentation corpus alongside executable config, which supports agent research and user guidance.
10. Environment and secret-handling boundary
- .env.example defines the expected secret and integration variables, while the actual .env is intentionally excluded.
- The env-protection plugin prevents agents from directly reading secrets, while read-env only exposes variable names, not values.
- This is a deliberate security boundary: configuration is injectable, but secrets are not freely inspectable by agents.
11. CI and repo maintenance
- .github/workflows/ contains CI pipelines across multiple ecosystems: .NET, Go, Java, Kotlin, Node.js, PHP, Python, Ruby, Rust, and Swift.
- Even though the repo itself is primarily config, the workflow matrix suggests it is validated against multiple language/tooling contexts that the OpenCode kit targets.
- This reinforces the repo’s role as a cross-stack orchestration and standards package rather than a single-language application.
12. How a request flows through the system
- A user request enters OpenCode, is classified by the global rules, and routed to the appropriate agent.
- That agent may load one or more skills, invoke a slash command or workflow, call a tool, and use MCP-backed context if needed.
- Plugins intervene around the edges to shape environment access and runtime behavior, while validation scripts and CI provide the quality gates.
13. Architectural summary
- The repository is best diagrammed as a layered agent-operating system for OpenCode:
- policy/routing at the top,
- agents and skills in the middle,
- commands/workflows as orchestration entry points,
- plugins/tools as controlled execution hooks,
- scripts/CI as verification,
- docs/MCPs as external knowledge and capability extensions.
- The core design principle is separation of reasoning, orchestration, execution, and validation.
Main entry points: agents Specialist agents · scripts Validation scripts · workflows Workflows · opencode.json opencode.json
Components 15
Control plane
Repository entrypoints and global routing for OpenCode behavior.
- opencode.json · Central OpenCode configuration surface, including MCP integration and runtime wiring.
opencode.json - AGENTS.md · Global agent routing and delegation rules for request classification.
AGENTS.md - .env.example · Declared integration and secret variables expected by the kit.
.env.example
Orchestration
Agents, skills, commands, and workflows that drive task execution.
- RULES.md · Highest-priority behavior layer governing selection, precedence, and execution norms.
.opencode/rules/RULES.md - Specialist agents · Role-based specialist agents for backend, frontend, security, review, planning, and languages.
.opencode/agents - omo model · Alternative orchestration model with orchestrator, planner, executor, and architecture advisor personas.
.opencode/oh-my-opencode.jsonc - Skills library · Reusable instruction library loaded on demand by agents.
.opencode/skills - Slash commands · User-facing entrypoints for planning, testing, security audit, review, and type fixing.
.opencode/commands - Workflows · Multi-step operating flows such as kickoff, TDD, pre-flight audit, and omo main flow.
.opencode/workflows - Prompts · Shared prompt text used by commands and workflows.
.opencode/prompts
Runtime boundary
Plugins and tools that control host interaction and environment access.
Validation
Scripts and workflows that enforce quality, verification, and safety.
- Validation scripts · Python utilities for linting, test orchestration, scanning, auditing, and verification.
.opencode/scripts - CI workflows · GitHub Actions matrix covering .NET, Go, Java, Kotlin, Node.js, PHP, Python, Ruby, Rust, and Swift.
.github/workflows
Knowledge base
Documentation and prompt assets used for reference and guidance.
- DOC corpus · Mirrored OpenCode documentation and reference materials for local guidance.
DOC
Connections 21
- AGENTS.md → RULES.md: sets precedence · Global routing feeds into the higher-priority rules layer.
- RULES.md → Specialist agents: routes to · Rules direct requests to specialist agents.
- Specialist agents → Skills library: loads skills · Agents pull reusable skills as needed.
- Specialist agents → Slash commands: invokes · Agents use slash commands for common operations.
- Specialist agents → Workflows: executes · Agents coordinate through multi-step workflows.
- Workflows → Prompts: uses prompts · Workflows rely on shared prompt assets.
- opencode.json → Plugins: enables · Central config wires runtime plugins.
- opencode.json → Tools: exposes · Central config makes tools available to the agent environment.
- Plugins → Tools: guards · Plugins shape or restrict tool execution and host access.
- Plugins → .env.example: protects · Environment-handling plugins enforce secret boundaries declared by the env contract.
- .env.example → Tools: feeds env · Tools rely on injectable environment variables for runtime integration.
- Validation scripts → Skills library: validates · Skill-specific validators enforce quality within the instruction library.
- Validation scripts → Slash commands: supports · Validation scripts back high-level commands like test and audit.
- Validation scripts → Workflows: supports · Scripts are used inside orchestration workflows.
- CI workflows → Validation scripts: mirrors checks · CI workflows run or mirror the repo's verification routines.
- DOC corpus → Specialist agents: informs · Documentation provides reference context for agent execution.
- DOC corpus → Skills library: references · Docs complement the reusable skill library.
- omo model → Specialist agents: alternative routing · The omo model provides a parallel persona-based orchestration path.
- omo model → Workflows: drives · The omo configuration defines a distinct operating flow.
- opencode.json → DOC corpus: integrates context · Repository config is supported by the local documentation corpus.
- AGENTS.md → Slash commands: guides usage · Routing rules shape how commands are interpreted and delegated.