# Sdk

> OpenCode SDK - how to extend and customize OpenCode using the software development kit

- Skill: `timsonner/sdk` (Agent Skill)
- Install (CLI): `npx skillmds@latest add timsonner/sdk`
- Raw SKILL.md: https://api.skillmd.com/api/skills/timsonner/sdk/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: timsonner (https://skillmd.com/u/timsonner)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/timsonner/sdk

---


# OpenCode SDK

The OpenCode SDK allows developers to extend and customize OpenCode's functionality, create custom tools, and build integrations.

## What is the OpenCode SDK?

The OpenCode SDK (Software Development Kit) provides:
- APIs for creating custom tools and agents
- Frameworks for extending OpenCode's capabilities
- Documentation for building plugins and integrations
- Examples and templates for common extensions

## SDK Capabilities

### 1. Custom Tools
- Create new tools that OpenCode agents can use
- Define tool interfaces and capabilities
- Implement tool logic in various languages
- Register tools with OpenCode for agent access

### 2. Custom Agents
- Build specialized agents with specific expertise
- Define agent behaviors and workflows
- Create agent teams for collaborative tasks
- Customize agent interactions and communication

### 3. Plugins and Extensions
- Extend OpenCode's core functionality
- Add new commands, modes, or features
- Integrate with external services and APIs
- Modify OpenCode's behavior and appearance

### 4. Integrations
- Connect OpenCode to external systems
- Integrate with version control systems
- Connect to issue trackers and project management tools
- Link with CI/CD pipelines and development tools

## Getting Started with the SDK

To begin using the OpenCode SDK:

1.  Review the [SDK documentation](/docs/sdk/) for detailed guides and references
2.  Set up your development environment for SDK development
3.  Explore the SDK examples and templates
4.  Create your first custom tool or agent
5.  Test and debug your extension
6.  Share your extension with the OpenCode community

## SDK Development Workflow

Typical SDK development involves:

1. **Planning**: Define what you want to build and how it will integrate with OpenCode
2. **Setup**: Configure your development environment with the SDK dependencies
3. **Implementation**: Write the code for your tool, agent, or plugin
4. **Testing**: Verify your extension works correctly in isolation and with OpenCode
5. **Documentation**: Document how to use your extension
6. **Distribution**: Share your extension via the OpenCode marketplace or directly

## Example SDK Projects

- Custom code analysis tools for specific languages
- Agents specialized for particular frameworks or domains
- Integrations with project management tools like Jira or Trello
- Plugins that add new visualization or debugging capabilities
- Tools for automating repetitive development tasks

## Best Practices for SDK Development

1. **Follow Conventions**: Adhere to SDK APIs and patterns
2. **Keep It Focused**: Build tools that solve specific problems well
3. **Ensure Stability**: Write robust code that handles errors gracefully
4. **Document Thoroughly**: Make it easy for others to use and extend your work
5. **Consider Performance**: Optimize for speed and resource usage
6. **Security First**: Follow security best practices, especially for tools that access external systems
7. **Test Compatibility**: Ensure your extension works with different OpenCode versions

## Resources

- [SDK Documentation](/docs/sdk/)
- [SDK Examples](https://github.com/anomalyco/opencode-sdk-examples)
- [OpenCode Plugins Marketplace](https://opencode.ai/marketplace)
- [Developer Community](https://opencode.ai/discord)

## Getting Help

If you need assistance with SDK development:
- Check the SDK documentation
- Ask questions in the OpenCode Discord community
- Look for similar extensions in the marketplace for inspiration
- Report issues or request features through official channels

