Skip to content

sjzsdu/OpencodePlugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

95 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Emperor โ€” OpenCode Multi-Agent Plugins

A collection of OpenCode plugins that enable multiple AI agents to collaborate on software development tasks.

Plugins

Plugin Agents Approach Best For Docs
Commander 4 Single orchestrator, fast iteration, Coderโ†”Tester fix loops Most development tasks README
Emperor 11 Three Departments & Six Ministries (ไธ‰็œๅ…ญ้ƒจ), governance with checks & balances Tasks requiring rigorous multi-stage review README
Hive Dynamic Domain auto-discovery, EventBus coordination, autonomous execution Large multi-domain projects README
Superpower Dynamic Loads agents, skills, and commands from superpowers repo Extensible agent capabilities README
Stock 5 Multi-dimensional A-share analysis (fundamental, technical, sentiment, flow, sector) Chinese A-share stock analysis README
Triage 6 Jira ticket triage (Bug/Feature), code investigation, solution design Bug triage and feature specification -

Commander โ€” Adaptive 4-Agent Team

User Task โ†’ Lead (analyze & plan) โ†’ Coder (implement) โ†” Tester (verify) โ†’ [Reviewer] โ†’ Report
  • Lead explores the codebase and creates plans with adaptive complexity classification (trivial / simple / standard / complex)
  • Coderโ†”Tester fix loop: Tester fails โ†’ Coder fixes in the same session (context accumulates) โ†’ Tester re-verifies โ†’ up to N rounds
  • Reviewer only engages on complex tasks
  • Parallel wave dispatch for independent subtasks

Emperor โ€” 11-Agent Governance System (ไธ‰็œๅ…ญ้ƒจ)

Edict โ†’ Crown Prince โ†’ Jinyiwei Recon โ†’ Zhongshu (plan) โ†’ Menxia (review/veto) โ†’ Shangshu โ†’ Six Ministries (parallel) โ†’ Memorial
  • Full governance model: planning, review/veto, parallel execution, post-verification
  • Jinyiwei reconnaissance with git-hash caching
  • Mandatory department participation (Hubu testing enforced)
  • Sensitive operation detection with manual confirmation

Hive โ€” Dynamic Domain-Agent Coordination

Startup โ†’ Scan project โ†’ Discover domains โ†’ Create per-domain Agents + Queen โ†’ EventBus coordination โ†’ Autonomous execution
  • Domain Discovery: Static project scanning + LLM enrichment + user config merge
  • EventBus: Pub/sub event system for agent-to-agent communication
  • Queen Coordinator: Broadcasts requirements, negotiates interfaces, dispatches parallel tasks
  • Autonomous Execution: Domain agents can self-adapt to breaking changes from dependencies

Stock โ€” Multi-Dimensional A-Share Analysis

Query โ†’ Fundamentalist (ๅŸบๆœฌ้ข) + Technician (ๆŠ€ๆœฏ้ข) + Sentiment (ๆƒ…็ปช) + Flow (่ต„้‡‘ๆต) + Industry (่กŒไธš) โ†’ HTML Report
  • 5 ๅนถๅ‘ Agent: ๅŸบๆœฌ้ขใ€ๆŠ€ๆœฏ้ขใ€ๆƒ…็ปช้ขใ€่ต„้‡‘ๆตใ€่กŒไธšๅˆ†ๆž
  • ๆ™บ่ƒฝ่ฏ„ๅˆ†: ้ข„่ฎพๆƒ้‡๏ผˆไฟๅฎˆ/ๅนณ่กก/ๆฟ€่ฟ›๏ผ‰๏ผŒ่‡ชๅฎšไน‰ๆƒ้‡
  • HTML ๆŠฅๅ‘Š็”Ÿๆˆ: ๅฏ่ง†ๅŒ–ๅˆ†ๆž็ป“ๆžœ

Triage โ€” Jira Ticket Analysis & Implementation

Jira Ticket โ†’ Triage (ๅˆ†็ฑป) โ†’ Scout (ๆŽข็ดข) โ†’ [Detective (Bug่ฐƒๆŸฅ) | Architect (Featureๆ–นๆกˆ)] โ†’ [Auto-fix | Awaiting Confirm]
  • Bug ่ทฏๅพ„: Scout ๆŽข็ดข โ†’ Detective ๆ นๅ› ่ฐƒๆŸฅ โ†’ ่‡ชๅŠจไฟฎๅค
  • Feature ่ทฏๅพ„: Scout ๆŽข็ดข โ†’ Architect ๆ–นๆกˆ่ฎพ่ฎก โ†’ ็ญ‰ๅพ…็กฎ่ฎคๅŽๅฎž็Žฐ
  • 6 Agent ๅไฝœ: triage, scout, detective, architect, coder, tester

Superpower โ€” Extensible Agent Capabilities

Load agents, skills, and commands from external superpowers repository
  • Dynamic Agent Loading: Loads agent definitions from ~/.superpowers/agents/
  • Skill Registry: Registers skills from ~/.superpowers/skills/
  • Command Templates: Registers command templates from ~/.superpowers/commands/
  • Extends OpenCode with custom agents and capabilities from the superpowers repo

Quick Start

1. Register plugins

In .opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "./plugins/commander/index.ts",
    "./plugins/emperor/index.ts",
    "./plugins/hive/index.ts",
    "./plugins/superpower/index.ts",
    "./plugins/stock/index.ts",
    "./plugins/triage/index.ts"
  ]
}

Pick one or more.

2. Use

Commander:

@lead Implement user authentication with JWT and role-based access control

Emperor:

@taizi Implement user authentication with JWT and role-based access control

Hive:

@queen Implement user authentication with JWT and role-based access control

Superpower:

@<agent-name> Your task description here

The Superpower plugin loads agents from the superpowers repository. Use any agent defined there.

3. Configure (optional)

  • Commander: .opencode/commander.json โ€” config docs
  • Emperor: .opencode/emperor.json โ€” config docs
  • Hive: .opencode/hive.json โ€” design docs
  • Superpower: No config needed (loads from ~/.superpowers/)
  • Stock: .opencode/stock.json โ€” config docs
  • Triage: .opencode/triage.json โ€” config docs

Project Structure

.
โ”œโ”€โ”€ plugins/                              # Plugin directory
โ”‚   โ”œโ”€โ”€ commander/                       # Commander plugin
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts                     # Entry point
โ”‚   โ”‚   โ”œโ”€โ”€ agents/                      # 4 agent definitions
โ”‚   โ”‚   โ”œโ”€โ”€ engine/                      # Pipeline, classifier, dispatcher
โ”‚   โ”‚   โ””โ”€โ”€ tools/                       # cmd_task, cmd_status, cmd_halt
โ”‚   โ”œโ”€โ”€ emperor/                         # Emperor plugin
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts                     # Entry point
โ”‚   โ”‚   โ”œโ”€โ”€ agents/                      # 11 agent definitions
โ”‚   โ”‚   โ”œโ”€โ”€ engine/                      # Pipeline, recon, reviewer, dispatcher
โ”‚   โ”‚   โ”œโ”€โ”€ tools/                       # edict, memorial, halt
โ”‚   โ”‚   โ””โ”€โ”€ skills/                      # Built-in skills
โ”‚   โ”œโ”€โ”€ hive/                            # Hive plugin
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts                     # Entry point
โ”‚   โ”‚   โ”œโ”€โ”€ discovery/                   # Domain auto-discovery
โ”‚   โ”‚   โ”œโ”€โ”€ agents/                      # Dynamic agent generator
โ”‚   โ”‚   โ”œโ”€โ”€ eventbus/                    # Event pub/sub system
โ”‚   โ”‚   โ”œโ”€โ”€ tools/                       # hive_emit, hive_status, hive_broadcast, etc.
โ”‚   โ”‚   โ””โ”€โ”€ hooks/                       # config, system-transform, file-watcher, autonomy
โ”‚   โ”œโ”€โ”€ superpower/                      # Superpower plugin
โ”‚   โ”‚   โ””โ”€โ”€ index.ts                     # Entry point (loads agents/skills/commands from ~/.superpowers/)
โ”‚   โ”œโ”€โ”€ stock/                            # Stock plugin
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts                     # Entry point
โ”‚   โ”‚   โ”œโ”€โ”€ agents/                      # 5 agent definitions
โ”‚   โ”‚   โ””โ”€โ”€ skills/                      # Built-in skills
โ”‚   โ””โ”€โ”€ triage/                          # Triage plugin
โ”‚       โ”œโ”€โ”€ index.ts                     # Entry point
โ”‚       โ”œโ”€โ”€ agents/                      # 6 agent definitions
โ”‚       โ”œโ”€โ”€ engine/                      # Pipeline, classifier, dispatcher
โ”‚       โ””โ”€โ”€ tools/                       # jira_analyze, jira_implement, jira_status
โ”œโ”€โ”€ package.json                         # Build tooling (private)
โ”œโ”€โ”€ tsconfig.json                        # TypeScript config
โ”œโ”€โ”€ .hive/                               # Hive runtime data (events.json, domains.json)
โ””โ”€โ”€ .github/workflows/
    โ”œโ”€โ”€ ci.yml                           # Type check + tests
    โ””โ”€โ”€ npm-publish.yml                  # Tag-based selective publish

Development

# Install dependencies
bun install

# Type check
bun run build

# Run tests
bun test

Publishing

Each plugin is published independently to npm via git tags:

# Commander
git tag commander-v0.1.0 && git push --tags

# Emperor
git tag emperor-v0.5.1 && git push --tags

# Hive
git tag hive-v0.1.0 && git push --tags

# Superpower
git tag superpower-v0.1.0 && git push --tags

# Stock
git tag stock-v0.1.0 && git push --tags

# Triage
git tag triage-v0.1.0 && git push --tags
Package npm
opencode-plugin-commander Commander plugin
opencode-plugin-emperor Emperor plugin
opencode-plugin-hive Hive plugin
opencode-plugin-superpower Superpower plugin
opencode-plugin-stock Stock plugin
opencode-plugin-triage Triage plugin

Tech Stack

  • Runtime: Bun
  • Language: TypeScript (strict mode)
  • Plugin SDK: @opencode-ai/plugin
  • Storage: JSON file persistence

License

MIT


ไธญๆ–‡็‰ˆ

About

๐Ÿค– OpenCode ๆ’ไปถ - ไธ‰็œๅ…ญ้ƒจๅคšๆ™บ่ƒฝไฝ“ๅไฝœ็ณป็ปŸ๏ผšๅฐ†ไธญๅ›ฝๅคไปฃๆฒป็†ๆ™บๆ…ง่žๅ…ฅ AI ็ผ–็จ‹ๅŠฉๆ‰‹๏ผŒ่‡ชๅŠจๅฎŒๆˆๅคๆ‚็ผ–็จ‹ไปปๅŠก็š„่ง„ๅˆ’ใ€ๅฎกๆ ธไธŽๆ‰ง่กŒ

Resources

Stars

Watchers

Forks

Packages