Package Exports
- @ikieaneh/opencode-kit
- @ikieaneh/opencode-kit/tui
Readme
opencode-kit
Plugin that auto-provisions agents, skills, rules, and configs for OpenCode. Zero-config — just add the plugin.
Explore the docs »
Report Bug
·
Request Feature
npm: @ikieaneh/opencode-kit ·
Cross-platform — macOS, Linux, Windows
Table of Contents
About
opencode-kit is an OpenCode plugin that auto-provisions a complete agent workflow framework. Install the plugin, and every session gets 15 agents, 39 skills, 7 rule files, 6 MCP configs, and 15 slash commands — automatically.
The Problem
AI coding agents are powerful but inconsistent. Without structure, they:
- Skip conventions and jump to implementation
- Ignore shared state — each session starts fresh
- Bypass quality gates — no review, no scoring, no learning
- Use different approaches every run
The Solution
opencode-kit replaces prose conventions with machine-readable enforcement. It injects a contract-based orchestration framework into every OpenCode session via a plugin hook — no manual setup required.
| Instead of ... | opencode-kit uses ... |
|---|---|
| "read the state file" | contract.json — a JSON state machine agents MUST read/write |
| "follow the rules" | rules.json — CRITICAL rules BLOCK agents, HIGH rules FLAG them |
| "check before editing" | Pre-flight gate — fails if rules aren't met |
| "review your work" | Scoring pipeline — every output scored (≥70 PASS, <50 BLOCK) |
| "remember what you learned" | Auto-persisted state, telemetry, and lessons learned |
Getting Started
Prerequisites
- Node.js ≥ 18
- Git
- OpenCode installed
- MCP servers configured:
lean-ctx,gitnexus,madar,context7,firecrawl,github
node --version # ≥ 18
git --version # any recent versionInstallation
Step 1: Install globally (one-time)
npm install -g @ikieaneh/opencode-kitStep 2: Add to your project
Create or edit opencode.json in your project root:
{
"plugin": ["@ikieaneh/opencode-kit"]
}That's it. On next session, the plugin auto-provisions everything:
.opencode/agents/— 15 agents.opencode/skills/— 39 skills.opencode/rules/— 7 rule filesconfig.agent— 15 agent configs injected at runtimeconfig.command— 15 slash commandsconfig.mcp— 6 MCP serversconfig.permission— 18 permissionstui.json— TUI plugin auto-registered
Verification
After installation, verify everything loaded:
npx opencode-kit doctorExpected output:
✅ contract.json
✅ rules.json
✅ 15 agents provisioned
✅ 39 skills provisioned
✅ 7 rule files loaded
✅ All checks passed
How It Works
Plugin Auto-Provision Flow
When OpenCode starts with @ikieaneh/opencode-kit in the plugin array, the plugin hook fires and:
- Auto-provisions files from the package:
.opencode/agents/— 15 agent templates.opencode/skills/— 39 skills.opencode/rules/— 7 rule files.opencode/orchestration/contract.json
- Auto-injects configs at runtime (no
opencode.jsonedits needed):- 15 agent configs (skills + tools)
- 15 slash command configs
- 6 MCP server configs
- 18 permission configs
- Auto-registers
@ikieaneh/opencode-kit/tuiintui.jsonfor slash commands
No manual copying. No wrapper scripts. Just install and go.
What Projects Get
my-project/
├── .opencode/
│ ├── agents/ (auto-provisioned: 15 agents)
│ ├── skills/ (auto-provisioned: 39 skills)
│ ├── rules/ (auto-provisioned: 7 rule files)
│ ├── orchestration/ (auto-provisioned: contract.json)
│ └── plugins/ (plugin entry points)Inheritance Model
opencode-kit uses class inheritance — projects extend the base, not replace it.
// Project's contract.json
{
"_meta": {
"extends": "opencode-kit",
"overrides": ["requirements.goal"],
"appends": ["scope.included"]
},
"requirements": {
"goal": "Project-specific goal (overrides base)"
}
}| Layer | Extend Via | Example |
|---|---|---|
| Contract | _meta.overrides / _meta.appends |
Override goal, append scope |
| Agents | _meta.append_skills |
Add project-specific skills |
| Rules | _meta.appends: ["rules"] |
Add custom rules |
| Skills | Add to .opencode/skills/ |
Create my-api-client/SKILL.md |
Merge Rules:
- Scalars: project overrides base
- Arrays: concatenated + deduplicated
- Objects: deep merged (project wins)
- Excludes:
_meta.excludesremoves inherited items
See docs/inheritance-model.md for full architecture.
Structure
opencode-kit/
├── opencode.json.template # Framework config (no model/provider)
├── AGENTS.md # Agent instructions
├── contract.json # Contract template
├── contract.schema.json # Contract schema
├── agents/ # 15 agent templates
├── skills/ # 39 skills
├── rules/ # 7 rule files
├── src/ # 22 scripts
├── docs/ # Architecture docs
├── .github/workflows/ # CI/CD
└── package.json
Enforcement System
1. Plugin Bootstrap
Every session auto-loads the orchestration contract before any work begins.
2. Pre-flight Gate
Validates branch, contract state, and rule compliance. BLOCKs on CRITICAL violations. Includes state machine validation (transition legality, required fields).
3. Contract Protocol
Shared state machine (contract.json) tracks phase, decisions, scores, and telemetry. Every agent reads and writes to the contract.
4. Scoring Pipeline
Every subagent output is scored on a 0-100 scale:
- ≥70 → PASS, advance to next phase
- 50-69 → RETRY (up to 3 attempts)
- <50 → BLOCKED (escalate to user)
5. Audit Trail
JSONL compliance logging records every enforcement action, score, and phase transition for later analysis.
6. ADR Logging
Every architectural decision recorded in decisions.adr_log[] with structured format.
7. Extension Model
Project-specific skills in .opencode/skills/ override plugin defaults via _meta.extends.
Agents & Skills
15 Agents
| Agent | Role |
|---|---|
orchestrator |
Coordinates multi-agent workflows, manages task delegation |
planner |
Analyzes requests, traces impact, produces implementation plans |
task-manager |
Breaks plans into tasks, implements each step |
code-reviewer |
Read-only code review — quality, security, performance |
explorer |
Fast codebase search specialist |
librarian |
Authoritative source for library docs and API references |
architect |
Strategic technical advisor for high-stakes decisions |
fixer |
Fast implementation specialist for well-defined bounded tasks |
learner |
Post-execution learning agent — extracts lessons, persists knowledge |
observer |
System state monitor and reporter — read-only |
database-specialist |
Database schema design, queries, migrations, optimization |
devops-agent |
CI/CD, deployment, infrastructure, automation |
documentation-agent |
Maintains README, API docs, inline documentation |
security-reviewer |
Vulnerability assessment and security best practices |
testing-specialist |
Unit tests, integration tests, test strategies |
39 Skills
Skills provide specialized instructions and workflows for specific tasks. Highlights include:
- orchestration-workflow — Contract protocol, state machine, persistence rules
- firecrawl-* — Web search, scraping, interaction, monitoring (15 skills)
- superpowers — brainstorming, TDD, debugging, code review, parallel agents, and more
- gitnexus-* — Code intelligence, impact analysis, debugging, refactoring
- quality-checks — Linting, formatting, static analysis
- testing-strategies — Test planning and coverage
Full list: see skills/ directory or load via the skill tool in OpenCode.
Slash Commands
All 15 commands available in the OpenCode TUI:
| Command | Description |
|---|---|
/opencode-kit:doctor |
Run project health checks |
/opencode-kit:status |
Show project status |
/opencode-kit:analytics |
Show project analytics |
/opencode-kit:preflight |
Run pre-flight gate checks |
/opencode-kit:score |
Run scoring pipeline |
/opencode-kit:contract-lint |
Validate contract structure |
/opencode-kit:checkpoint |
List saved checkpoints |
/opencode-kit:checkpoint-save |
Save a checkpoint |
/opencode-kit:diff |
Show contract changes |
/opencode-kit:audit |
Query audit trail |
/opencode-kit:verify |
Verify project setup |
/opencode-kit:lock |
Check contract lock status |
/opencode-kit:init |
Initialize opencode-kit |
/opencode-kit:update |
Update templates |
/opencode-kit:adr |
Create Architecture Decision Record |
Known Limitations
- Plugin hook API: The
experimental.chat.messages.transformhook is marked experimental in the OpenCode plugin SDK. If it breaks, the plugin falls back to per-project agent.mdfiles, which remain functional. - TUI plugin:
@ikieaneh/opencode-kit/tuirequires OpenCode with TUI support. Scripts run synchronously viaexecSync— long-running scripts may block the UI temporarily. - Contract auto-init: Requires a git repository. Non-git projects use absolute path as hash fallback.
Contributing
See CONTRIBUTING.md for full guidelines.
Fork → Feature branch → Commit → PR. Follow the enforcement architecture. All rule enforcements must be tested.
License
Distributed under the MIT License. See LICENSE for more information.
Contact
Rizki Rachman — GitHub
Project Link: https://github.com/RizkiRachman/opencode-kit