agentsys for OpenCode
Professional-grade slash commands adapted for OpenCode.
Overview
agentsys for OpenCode
Professional-grade slash commands adapted for OpenCode.
Quick Install
git clone https://github.com/agent-sh/agentsys.git
cd agentsys
./adapters/opencode/install.sh
Prerequisites
- OpenCode - Install from opencode.ai
- Node.js 18+ - Download from nodejs.org
- Git - Download from git-scm.com
- GitHub CLI (
gh) - For PR commands (install:brew install ghor see cli.github.com)
Available Commands
/deslop - AI Slop Cleanup
Remove debugging code, old TODOs, and other AI slop.
opencode
> /deslop
> /deslop apply
> /deslop apply src/ 10
What it does:
- Scans for console.logs, print statements, old TODOs
- Generates report or auto-applies fixes
- Runs verification tests
- Preserves functionality with minimal diffs
/next-task - Intelligent Task Prioritization
Discover what to work on next with AI analysis.
opencode
> /next-task
> /next-task bug
> /next-task --include-blocked
What it does:
- Analyzes GitHub Issues (required)
- Validates tasks aren't already implemented
- Scores by impact, urgency, effort
- Provides top 5 recommendations with evidence
Requires: GitHub CLI (gh)
/audit-project - Multi-Agent Code Review
Comprehensive review with specialized AI agents.
opencode
> /audit-project
> /audit-project --recent
> /audit-project --domain security
> /audit-project --resume
What it does:
- Deploys 10 specialized agents
- Adapts to your tech stack
- Finds bugs, security issues, performance problems
- Iterates until no open issues remain
/ship - Complete PR Workflow
Ship from commit to production with validation.
opencode
> /ship
> /ship --strategy rebase
What it does:
- Commits changes with AI message
- Creates PR with description
- Waits for CI to pass
- Runs quality reviews
- Merges to main
- Deploys to dev/prod
- Validates deployments
- Auto-rollback on failure
Requires: Git, GitHub CLI (gh)
OpenCode-Specific Features
OpenCode provides additional features you can combine with agentsys commands:
File Includes with @
Include file contents in your prompt:
opencode
> /audit-project @src/main.py @tests/test_main.py
This adds the file contents to the context before running the review.
Bash Output with !
Include bash command output:
opencode
> /deslop apply !git diff --name-only
This runs git diff --name-only and includes the output in the prompt.
Combined Usage
opencode
> /next-task @PLAN.md !gh issue list
Analyzes tasks with PLAN.md content and current GitHub issues.
Installation Details
The installer:
- Creates
~/.config/opencode/commands/ - Copies command files with path adjustments
- Installs shared libraries (platform detection, patterns)
- Creates environment setup scripts
File Structure
~/.config/opencode/commands/
├── deslop.md
├── next-task.md
├── audit-project.md
├── ship.md
├── lib/
│ ├── platform/
│ │ ├── detect-platform.js
│ │ └── verify-tools.js
│ ├── patterns/
│ │ ├── review-patterns.js
│ │ └── slop-patterns.js
│ └── utils/
│ └── context-optimizer.js
├── env.sh
└── README.md
Usage Examples
Clean up with file filter
opencode
> /deslop apply @src/app.js
# Changeset 1/3: Remove console.log statements
# - src/app.js: Removed 3 console.log calls
# [OK] Tests passed
Review specific files
opencode
> /audit-project @src/auth.py @src/api.py
# Iteration 1: Found 4 issues (2 critical, 2 high)
# [OK] Fixed SQL injection in auth.py:45
# [OK] Fixed race condition in api.py:123
Next task with context
opencode
> /next-task @PLAN.md !gh issue list
# Top 5 Priority Tasks:
# (includes analysis from PLAN.md and GitHub issues)
Ship with diff review
opencode
> !git diff
> /ship --strategy rebase
# (reviews the diff you just displayed, then ships)
Platform Support
Auto-Detected CI Platforms
GitHub Actions · GitLab CI · CircleCI · Jenkins · Travis CI
Auto-Detected Deployment Platforms
Railway · Vercel · Netlify · Fly.io · Platform.sh · Render
Auto-Detected Project Types
Node.js · Python · Rust · Go · Java
Updating
To update commands:
cd /path/to/agentsys
git pull origin main
./adapters/opencode/install.sh
Troubleshooting
Commands not showing up
- Restart OpenCode TUI
- Check installation:
ls ~/.config/opencode/commands/ - Re-run installer
Commands only work in TUI
Currently, OpenCode slash commands are only available in the TUI (Terminal User Interface), not from the CLI directly. Feature request exists to add CLI support.
Path errors
Re-run installer to fix path substitutions:
./adapters/opencode/install.sh
Node.js not found
Ensure Node.js 18+ is installed:
node --version # Should be v18.0.0 or higher
GitHub CLI authentication
gh auth login
gh auth status
Differences from Claude Code
| Feature | Claude Code | OpenCode |
|---|---|---|
| Installation | Marketplace | Manual script |
| Updates | Automatic | Re-run installer |
| File Includes | Built-in | @filename syntax |
| Bash Output | Built-in | !command syntax |
| Multi-agent | Full support | May vary |
Support
- Repository: https://github.com/agent-sh/agentsys
- Issues: https://github.com/agent-sh/agentsys/issues
- OpenCode Docs: https://opencode.ai/docs
Resources
Made for the OpenCode community