$ opencode agent list
→ refactor ──────────── safe, review-first refactoring
→ ask ──────────── read-only technical advisor
→ exec ──────────── direct executor with web interface guidelines
┌─────────────┬──────────────────────┬─────────────────────┬────────────────────────┐
│ AGENT │ PURPOSE │ EDITING BEHAVIOR │ BEST FOR │
├─────────────┼──────────────────────┼─────────────────────┼────────────────────────┤
│ refactor │ Improve code quality │ After review │ Safe refactoring │
│ ask │ Technical advisor │ Read-only (never) │ Understanding code │
│ exec │ Direct executor │ Adaptive by risk │ End-to-end delivery │
└─────────────┴──────────────────────┴─────────────────────┴────────────────────────┘
# Using npm
$ npm install opencode-huge-agents
$ npx opencode-huge-agents install
# Using Bun
$ bun add opencode-huge-agents
$ bunx opencode-huge-agents installVerify installation:
$ opencode agent list
✓ refactor (primary)
✓ ask (primary)
✓ exec (primary)# Tab completion to select agent
$ opencode [TAB]
→ refactor
→ ask
→ exec
# Direct invocation via slash commands
$ /refactor <target>
$ /ask <question>
$ /exec <task>╔══════════════════════════════════════════════════════════╗
║ REFACTOR AGENT ║
║ Safe, review-first refactoring ║
╚══════════════════════════════════════════════════════════╝
$ /refactor <target> # Review-first refactoring workflow[1] Analyze code
↓
[2] Propose improvements
↓
[3] Interactive menu:
→ Apply all safe refactors now
→ Apply only high-impact low-risk refactors
→ Select refactor variant
→ Show step-by-step plan
→ Ask questions before changes
→ Cancel
↓
[4] Execute (after confirmation)
↓
[5] Validate with tests
$ /refactor src/services/user-service.ts
$ /refactor the data processing pipeline
$ /refactor components/Dashboard.tsxUse refactor when: You want to improve existing code quality safely without adding features.
╔══════════════════════════════════════════════════════════╗
║ ASK AGENT ║
║ Read-only technical advisor ║
╚══════════════════════════════════════════════════════════╝
$ /ask <question> # Objective technical answer with evidence (never edits)✓ Explores and analyzes code
✓ Prioritizes objective, concise answers by default
✓ Returns direct answer + code evidence (file:line)
✓ Expands only when user explicitly asks for deeper detail
✓ Explains architecture, flows, and dependencies when needed
✓ Answers "how" and "why" questions with verified references
✗ NEVER edits files
✗ NEVER proposes implementation plans or task breakdowns
→ If action is requested, recommends switching to planning/execution mode
$ /ask How does authentication work in this app?
$ /ask Where is the user validation logic?
$ /ask Explain the data flow in the checkout process
$ /ask What patterns are used in the API layer?
$ /ask What are the dependencies of the UserService?Use ask when: You need to understand code without making changes.
╔══════════════════════════════════════════════════════════╗
║ EXEC AGENT ║
║ Direct executor focused on delivery ║
╚══════════════════════════════════════════════════════════╝
$ /exec <task> # Adaptive executor (auto-selects mode based on risk)┌──────────────────────────┐
│ Choose mode by risk │
└────────────┬─────────────┘
│
┌───────┼────────┐
│ │ │
┌──▼──┐ ┌─▼───┐ ┌──▼──┐
│FAST │ │BALAN│ │SAFE │
│ │ │ CED │ │ │
└──┬──┘ └──┬──┘ └──┬──┘
│ │ │
│ TodoWrite │
│ + confirm │
│ │ │
└───────┴───────┘
│
┌──────────▼──────────┐
│ Execute + validate │
└──────────┬──────────┘
│
┌──────────▼──────────┐
│ → Execute │
│ → Done ✓ │
│ → Risks (if any) │
└─────────────────────┘
Fast mode (executes immediately):
- 1-2 files, isolated changes, easily reversible
- Example:
"fix typo in config"
Balanced mode (creates plan first):
- Multiple files, interconnected changes, medium risk
- Example:
"add API caching + invalidation"
Safe mode (risk-first execution):
- High risk, critical paths, low reversibility
- Example:
"migrate authentication flow"
When working with React/Next.js/HTML/CSS/UI, exec automatically applies:
Accessibility:
- Icon buttons need
aria-label - Form controls need
<label>oraria-label - Use
<button>for actions,<a>/<Link>for navigation - Interactive elements need visible focus states
- Never
outline-nonewithout replacement
Forms:
- Inputs need
autocomplete+ meaningfulname+ correcttype - Never block paste
- Submit button enabled until request starts
- Errors inline next to fields
Performance:
- Large lists (>50 items): virtualize
<img>needs explicitwidth/height- No layout reads in render (
getBoundingClientRect, etc.)
Anti-patterns flagged:
transition: all<div onClick>instead of<button>- Images without dimensions
- Form inputs without labels
autoFocuswithout justification
$ /exec Add error handling to the login function
$ /exec Fix typos in config and update button text
$ /exec Implement API caching with cache invalidation
$ /exec Refactor authentication flow with rollback planUse exec when: You need direct execution with clear strategy and validation.
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-huge-agents@latest"],
"agent": {
"refactor": {
"color": "#55f76dff",
"permission": {
"question": "allow"
}
},
"ask": {
"color": "#ff8c42",
"permission": {
"question": "allow"
}
},
"exec": {
"color": "#ff3b3b",
"permission": {
"question": "allow"
}
}
}
}┌─────────────┬──────────┬──────────┬─────────────────────────┐
│ AGENT │ EDITING │ PLANNING │ USE CASE │
├─────────────┼──────────┼──────────┼─────────────────────────┤
│ build │ Immediate│ Manual │ Quick features │
│ plan │ Ask first│ Always │ Understanding & planning│
│ refactor │ After rev│ Safety │ Code quality │
│ ask │ Never │ N/A │ Technical Q&A │
│ exec │ Adaptive │ By risk │ End-to-end execution │
└─────────────┴──────────┴──────────┴─────────────────────────┘
$ npx opencode-huge-agents uninstall
# or
$ bunx opencode-huge-agents uninstall$ git clone <repository>
$ cd opencode-huge-agents
$ npm install
$ npm run buildStarting from version 0.4.0, the project uses a persona-based architecture:
src/
├── agents/
│ ├── shared/ # Shared infrastructure
│ │ ├── types.ts # Common interfaces (AgentConfig, Persona, etc.)
│ │ └── configMerger.ts # Shared utilities (merge, apply)
│ ├── huge/
│ │ └── personas/ # Persona definitions
│ │ ├── askPersona.ts
│ │ ├── execPersona.ts
│ │ └── refactorPersona.ts
│ ├── ask/
│ │ └── askConfig.ts # Imports askPersona
│ ├── exec/
│ │ └── execConfig.ts # Imports execPersona
│ └── refactor/
│ └── refactorConfig.ts # Imports refactorPersona
└── index.ts # Plugin entry point
Benefits:
- DRY: No duplicated helper functions
- Centralized prompt management in
personas/ - Easy to add new personas
- Better testability
Zero Breaking Changes: All commands (/ask, /exec, /refactor) work exactly as before. You can still switch between agents using Tab.
MIT
Contributions welcome! Please submit issues or pull requests.
- GitHub Issues: [Create an issue]
- OpenCode Docs: https://opencode.ai/docs
