opencode-baseline

内容来源:README.md(说明文档) · 原始地址 · 查看安装指南

原始内容

OpenCode Baseline

A production-ready template for OpenCode AI assistant with pre-configured agents, skills, commands, hooks, and context.

Version npm License OpenCode


Table of Contents


Installation

Prerequisites

  • Git - Required for cloning and updates
  • Node.js 18+ - Required for hooks (TypeScript-based)
  • OpenCode - The AI assistant (opencode.ai)

Quick Install (One-Line)

curl -fsSL https://raw.githubusercontent.com/48Nauts-Operator/opencode-baseline/main/install.sh | bash

Install Options

Option Description
--global Install to ~/.config/opencode/ (global for all projects)
--init Create project-specific files only (OPENCODE.md, AGENTS.md)
--project Install .opencode/ to current project (legacy default)
--no-env Skip copying .env.example
--no-opencode-md Skip copying OPENCODE.md template
--force, -f Overwrite existing .opencode directory
--branch, -b Use specific branch (default: main)
# Examples
curl -fsSL <url>/install.sh | bash -s -- --global    # Global install
curl -fsSL <url>/install.sh | bash -s -- --init      # Project init only
curl -fsSL <url>/install.sh | bash -s -- --force     # Force overwrite
curl -fsSL <url>/install.sh | bash -s -- --branch develop --no-env

Global vs Project Install

Mode Location Use Case
--global ~/.config/opencode/ Skills available in ALL projects
--project ./.opencode/ Project-specific customization
--init ./OPENCODE.md, ./AGENTS.md Add context files to existing project

Manual Install

# Clone the repository
git clone https://github.com/48Nauts-Operator/opencode-baseline.git

# Copy to your project
cp -r opencode-baseline/.opencode /path/to/your/project/
cp opencode-baseline/OPENCODE.md /path/to/your/project/
cp opencode-baseline/.env.example /path/to/your/project/.env

Post-Install Setup

  1. Configure Project Context

    # Edit the project context file with your project details
    nano .opencode/context/project/project-context.md
    
  2. Set Up Environment Variables

    cp .env.example .env
    nano .env
    
  3. Customize OPENCODE.md

    # Edit project description for AI context
    nano OPENCODE.md
    

Environment Variables

Create a .env file with your API keys:

# AI Provider Keys (at least one required)
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GEMINI_API_KEY=AIza...

# Optional: GitHub integration
GITHUB_TOKEN=ghp_...

Updating

Update to the latest version while preserving your customizations:

./update.sh
Option Description
--branch, -b Use specific branch
--preserve, -p Additional path to preserve (repeatable)
--full Full update, don't preserve anything

Default preserved paths:

  • context/project/ - Your project-specific context
  • opencode.json - Your configuration
  • OPENCODE.md - Your project description

Uninstalling

./uninstall.sh
Option Description
--force, -f Skip confirmation prompt
--keep-context, -k Keep .opencode/context/project/

Verifying Installation

# Check directory structure
ls -la .opencode/

# Verify version
cat .opencode/VERSION

# Check configuration
cat .opencode/opencode.json | head -20

What's Included

Component Count Description
Skills 55 Reusable workflows + domain knowledge (K8s, Security, LLM, MLOps, Research, etc.)
Agents 35 Specialized AI personas (language experts, DevOps, architecture, etc.)
Commands 18 Slash commands for operations + incident response + orchestration
Hooks 6 Lifecycle hooks (pre/post tool, session, context monitor, pre-compact, prompt)
Plugins 3 Extensions (agent validator, notifications)
Tools 4 Custom tools (Gemini image editing, env management)
Context Files 20+ Domain knowledge and standards

v0.6.0 Update: Added 7 amp-skills from snarktank/amp-skills, Ralph autonomous loop system, global install support, and 12 Claude Code commands

v0.5.0 Update: Consolidated all hooks to TypeScript/npm package with 6 CLI commands: context monitoring, pre-compact backup, user prompt logging. No more Python dependency!

v0.4.0 Update: Added 10 research skills from GhostScientist/skills - paper implementation, research workflows, and academic tools

v0.3.0 Update: Added 27 new skills and 7 new agents from wshobson/agents (23k ⭐)


Skills

Reusable workflows that teach AI how to perform specific tasks. Located in .opencode/skill/.

Amp Skills (NEW - from snarktank/amp-skills)

Skill Description Trigger Phrases
prd Generate Product Requirements Documents "create a prd", "plan this feature", "requirements for"
ralph Convert PRDs to JSON for autonomous execution "convert this prd", "ralph json", "turn this into ralph format"
dev-browser Browser automation with persistent page state "go to [url]", "click on", "screenshot", "scrape"
compound-engineering Plan -> Work -> Review -> Compound development loop "plan this feature", "systematic development"
docx Word document creation, editing, tracked changes Work with .docx files
pdf PDF manipulation: extract, merge, split, create Work with PDF files
frontend-design Create distinctive UI/UX interfaces (anti-AI-slop) "build web component", "create page"

Core Skills

Skill Description Workflow
tdd Test-Driven Development with RED-GREEN-REFACTOR cycle Development
code-review Systematic code review checklist for quality and security Review
git-release Create consistent releases with changelogs and version bumping GitHub
systematic-debugging 4-phase debugging methodology for finding root causes Debugging
skill-creator Meta-skill for creating new OpenCode skills Meta
changelog-generator Generate user-friendly changelogs from git commits Release
mcp-builder Build MCP servers for AI agent integrations Development
file-organizer Intelligently organize files with duplicate detection Productivity
pr-create Create well-structured pull requests with proper descriptions Git

Kubernetes Skills (skill/kubernetes/)

Skill Description
k8s-manifest-generator Production-ready K8s manifests (Deployments, Services, ConfigMaps)
helm-chart-scaffolding Helm chart creation, templating, multi-environment deployment
gitops-workflow ArgoCD/Flux GitOps automation, declarative deployments
k8s-security-policies Network policies, RBAC patterns, security hardening

Security Skills (skill/security/)

Skill Description
sast-configuration SAST tool setup (Semgrep, SonarQube, CodeQL), custom rules
attack-tree-construction Threat modeling, attack path visualization
stride-analysis-patterns STRIDE threat modeling methodology
security-requirement-extraction Security requirements from specifications
threat-mitigation-mapping Mapping threats to mitigations

LLM Development Skills (skill/llm-dev/)

Skill Description
langchain-architecture LangChain agents, chains, memory, tool integration
rag-implementation Retrieval-Augmented Generation patterns
prompt-engineering-patterns Prompt optimization, few-shot learning, chain-of-thought
embedding-strategies Vector embeddings for semantic search
vector-index-tuning Vector database optimization
similarity-search-patterns Semantic similarity algorithms
hybrid-search-implementation Combining keyword + semantic search
llm-evaluation LLM output quality assessment

Developer Essentials (skill/developer-essentials/)

Skill Description
git-advanced-workflows Rebase, cherry-pick, bisect, worktrees, reflog
auth-implementation-patterns JWT, OAuth2, session management, security
error-handling-patterns Error handling across languages
e2e-testing-patterns End-to-end testing strategies
sql-optimization-patterns Query optimization, indexing
monorepo-management Monorepo tooling and workflows
bazel-build-optimization Bazel build system patterns
turborepo-caching Turborepo caching strategies
nx-workspace-patterns Nx monorepo patterns

MLOps Skills (skill/mlops/)

Skill Description
ml-pipeline-workflow End-to-end MLOps: data prep → training → deployment → monitoring

Research Skills (NEW - from GhostScientist/skills)

Skill Description
implement-paper-from-scratch Step-by-step guide to implementing research papers from scratch
paper-to-intuition Transform academic papers into deep, multi-layered understanding
research-question-refiner Refine vague research interests into concrete, tractable questions
research-taste-developer Develop intuition for what makes research "good" vs "incremental"
reviewer-2-simulator Critique paper drafts as a skeptical reviewer would
experiment-design-checklist Generate rigorous experiment designs with controls and metrics
turn-this-feature-into-a-blog-post Generate technical blog posts from code implementations
ios-app-icon-generator Generate complete iOS app icon sets with all required sizes
create-watchos-version Plan watchOS companion apps from existing iOS/macOS projects
hugging-face-space-deployer Deploy Hugging Face Spaces for ML models (Gradio, Streamlit)

Using Skills

Skills are invoked automatically based on context or explicitly:

# Invoke TDD workflow
"Let's implement this feature using TDD"

# Create a skill
"Use skill-creator to build a deployment skill"

# Create a PRD
/prd Create a user authentication system

# Convert PRD to Ralph JSON
/ralph Convert my PRD to JSON format

Ralph Autonomous Loop

Ralph is an autonomous AI agent loop that executes user stories from a PRD one at a time. Located in ralph/.

How It Works

  1. Create a PRD using the /prd skill
  2. Convert to JSON using the /ralph skill (creates prd.json)
  3. Run ralph.sh to autonomously execute each user story

Usage

# Navigate to your project
cd your-project

# Run Ralph (auto-detects amp/opencode/claude CLI)
~/.config/opencode/ralph/ralph.sh

# With max iterations limit
~/.config/opencode/ralph/ralph.sh 20

Ralph Files

File Description
ralph.sh Universal adapter script (works with amp, opencode, claude)
prompt.md Agent instructions for each iteration
prd.json.example Example PRD format

PRD Format

{
  "project": "MyApp",
  "branchName": "ralph/feature-name",
  "description": "Feature description",
  "userStories": [
    {
      "id": "US-001",
      "title": "Story title",
      "description": "As a user, I want...",
      "acceptanceCriteria": ["Criterion 1", "Criterion 2"],
      "priority": 1,
      "passes": false,
      "notes": ""
    }
  ]
}

Key Principles

  • One story per iteration: Ralph spawns fresh context each time
  • Stories must be small: Completable in one context window
  • Dependency order: Schema -> Backend -> UI
  • Browser verification: UI stories require dev-browser verification

Agents

Specialized AI personas for different domains. Located in .opencode/agent/.

Core Agents

Agent File Description
OpenAgent core/openagent.md Main orchestrator - routes requests to specialists
OpenCoder core/opencoder.md General-purpose coding agent

Development Agents

Agent File Description
Backend Specialist development/backend-specialist.md APIs, databases, server logic
Frontend Specialist development/frontend-specialist.md UI, UX, components, styling
DevOps Specialist development/devops-specialist.md CI/CD, deployment, containerization
Codebase Agent development/codebase-agent.md Codebase understanding and navigation
Event Sourcing Architect development/event-sourcing-architect.md Event sourcing, CQRS, saga orchestration
GraphQL Architect development/graphql-architect.md GraphQL schema design, resolvers
TDD Orchestrator development/tdd-orchestrator.md Test-driven development coordination

Architecture Agents (NEW)

Agent File Description
C4 Context architecture/c4-context.md System context diagrams
C4 Container architecture/c4-container.md Container-level architecture
C4 Component architecture/c4-component.md Component diagrams
C4 Code architecture/c4-code.md Code-level documentation

Language Specialists

Agent File Triggers
Python Pro languages/python-pro.md .py files
JavaScript Pro languages/javascript-pro.md .js, .mjs files
TypeScript Pro languages/typescript-pro.md .ts, .tsx files
Rust Pro languages/rust-pro.md .rs files
Go Pro languages/golang-pro.md .go files
SQL Pro languages/sql-pro.md .sql files

Infrastructure Agents

Agent File Triggers
Terraform Specialist infrastructure/terraform-specialist.md "terraform", "infrastructure", "IaC"
Performance Engineer infrastructure/performance-engineer.md "optimize", "performance", "slow"
DevOps Troubleshooter infrastructure/devops-troubleshooter.md "debug", "error", "not working"
Security Specialist infrastructure/security-specialist.md "security", "vulnerability", "CVE"

Content Agents

Agent File Description
Copywriter content/copywriter.md Marketing copy, messaging
Technical Writer content/technical-writer.md Documentation, guides

Data Agents

Agent File Description
Data Analyst data/data-analyst.md Data analysis and visualization

Subagents (Delegated Tasks)

Agent File Description
Build Agent subagents/code/build-agent.md Build verification and validation
Coder Agent subagents/code/coder-agent.md Code execution tasks
Reviewer subagents/code/reviewer.md Code review and quality checks
Tester subagents/code/tester.md Test authoring and TDD
Codebase Pattern Analyst subagents/code/codebase-pattern-analyst.md Pattern discovery in codebases
Task Manager subagents/core/task-manager.md Task breakdown and tracking
Documentation subagents/core/documentation.md Documentation generation
Context Retriever subagents/core/context-retriever.md Context file search and retrieval

System Builder Subagents

Agent File Description
Agent Generator subagents/system-builder/agent-generator.md Generate new agent definitions
Command Creator subagents/system-builder/command-creator.md Create custom slash commands
Context Organizer subagents/system-builder/context-organizer.md Organize context files
Domain Analyzer subagents/system-builder/domain-analyzer.md Analyze project domains
Workflow Designer subagents/system-builder/workflow-designer.md Design workflow definitions

Utility Subagents

Agent File Description
Image Specialist subagents/utils/image-specialist.md Image editing and analysis

Meta Agents

Agent File Description
System Builder meta/system-builder.md Build complete context systems

Commands

Slash commands for common operations. Located in .opencode/command/.

Core Commands

Command Description
/clean Format, lint, and clean up code (Prettier, ESLint, import sorting)
/commit Create conventional commits with emoji
/git-flow Start new development context (branch/worktree)
/git-safety Run safety checks before merging (secrets, debug, conflicts)
/git-commit Smart conventional commit generation with auto-detection
/optimize Analyze and optimize code for performance and security
/test Run the complete testing pipeline
/worktrees Manage git worktrees for parallel development
/context Analyze and understand project context and structure
/build-context-system Create complete AI context architecture

Incident Response Commands (NEW)

Command Description
/smart-fix 4-phase AI-powered debugging: analysis → root cause → fix → verification
/incident-response Production incident triage and resolution workflow

Agent Orchestration Commands (NEW)

Command Description
/multi-agent-optimize Multi-agent performance optimization across system layers
/improve-agent Agent improvement and optimization workflow

Architecture Commands (NEW)

Command Description
/c4-architecture Generate C4 model documentation from code
/full-stack-feature End-to-end feature: backend → frontend → tests → security → deploy

Prompt Engineering Commands

Command Description
/prompt-enhancer Enhance prompts for better AI responses
/prompt-optimizer Optimize prompts for specific models

Usage Examples

# Start a feature branch
/git-flow --medium "Add user authentication"

# Check before merging
/git-safety --strict

# Smart commit
/git-commit

# Clean and format
/clean

Claude Code Commands (NEW)

Additional commands for Claude Code users. Located in global/claude-code/commands/.

Command Description
/five-whys Root cause analysis using Five Whys methodology
/design-review Comprehensive design review of git changes
/lyra AI prompt optimization specialist
/utrathink Multi-agent orchestration (4 sub-agents)
/analyze-issue GitHub issue to implementation spec
/refactor Code refactoring with best practices
/commit-fast Conventional commits with smart staging
/tdd Test-Driven Development enforcement
/prompt_sec Security audit for APIs
/reload Reload project memory from CLAUDE.md
/analyse_codebase Full codebase analysis and documentation
/clean Code cleanup, formatting, linting

Installation for Claude Code

# Copy commands to Claude Code config
cp -r global/claude-code/commands/* ~/.claude/commands/

Hooks

Lifecycle hooks that run at specific points during AI sessions. All hooks are TypeScript-based and bundled in the npm package.

Hook When Can Block Purpose
opencode-pre-tool Before each tool call Yes (exit 2) Security validation, command blocking
opencode-post-tool After each tool call No Logging, metrics, error tracking
opencode-session-start Session begins No Load context, git status, initialization
opencode-context-monitor On notifications No Track token usage, backup at thresholds
opencode-pre-compact Before compaction No Backup transcript and todos
opencode-user-prompt On user prompt Yes (exit 2) Log prompts, optional validation

Hook Features

Security (opencode-pre-tool):

  • Blocks dangerous commands (rm -rf /, sudo, etc.)
  • Prevents access to sensitive files (.env, credentials)
  • Detects secrets in write operations (API keys, tokens)
  • Blocks dangerous git operations (force push to main)

Logging (opencode-post-tool):

  • Logs all tool usage to JSON files
  • Tracks errors and daily statistics
  • Monitors session activity

Context Management (opencode-context-monitor):

  • Tracks cumulative token usage
  • Creates backups at 70% (warning) and 85% (critical)
  • Saves pending todos and recent prompts for recovery

Pre-Compact Backup (opencode-pre-compact):

  • Backs up transcript before context compaction
  • Saves todos state for session recovery

Installation & Configuration

IMPORTANT: OpenCode and Claude Code use DIFFERENT hook systems!

For OpenCode (Recommended)

OpenCode uses a plugin system. The hooks are bundled as a TypeScript plugin in .opencode/plugin/hooks.ts.

Option 1: Use the bundled plugin (default)

The plugin is pre-configured in .opencode/opencode.json:

{
  "plugin": [
    "hooks"
  ]
}

This automatically loads .opencode/plugin/hooks.ts which provides all security, logging, and notification features.

Option 2: Install globally and add to user config

npm install -g opencode-baseline-hooks

Then add to ~/.config/opencode/opencode.json:

{
  "plugin": [
    "opencode-baseline-hooks"
  ]
}

For Claude Code

Claude Code uses a hooks config with shell commands. Install the npm package and configure in ~/.claude/settings.json:

npm install -g opencode-baseline-hooks
{
  "hooks": {
    "PreToolUse": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "opencode-pre-tool"
      }]
    }],
    "PostToolUse": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "opencode-post-tool"
      }]
    }],
    "SessionStart": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "opencode-session-start"
      }]
    }]
  }
}

Environment Variables

KOKORO_URL=http://localhost:8880    # Kokoro TTS endpoint
KOKORO_VOICE=bf_emma                # Voice selection
OPENCODE_VOICE=off                  # Disable voice entirely
PROJECT_DIR=/path/to/project        # Project root (auto-detected)

Platform Comparison

Feature OpenCode Claude Code
Config file opencode.json ~/.claude/settings.json
Hook system "plugin": ["hooks"] "hooks": { "PreToolUse": [...] }
Hook format TypeScript modules Shell commands
Installation Bundled or npm plugin npm + config

Package: npmjs.com/package/opencode-baseline-hooks


Plugins

Extensions that add functionality to OpenCode. Located in .opencode/plugin/.

Agent Validator

Real-time validation of agent behavior against defined rules.

Tool Description
validate_session Validate current session against rules
check_approval_gates Check approval gate enforcement
export_validation_report Export validation report to markdown
analyze_delegation Analyze delegation decisions (4+ file rule)
analyze_context_reads Show context files read during session
check_context_compliance Verify context read before execution
analyze_agent_usage Show agent activity and tool usage
debug_validator Debug validator tracking state

Additional Plugin Features

  • Telegram Notify (telegram-notify.ts) - Send notifications via Telegram
  • Notify (notify.ts) - Generic notification system

Tools

Custom tools that extend OpenCode capabilities. Located in .opencode/tool/.

Gemini Image Tools

AI-powered image editing and analysis using Google Gemini.

Tool Description
/gemini Edit images with natural language prompts
/gemini_multiple_edit Advanced image editing
/gemini_multiple_analyze Analyze images without editing
/gemini_edit Auto-detection of pasted images

Setup

# Add to .env
GEMINI_API_KEY=your_api_key_here

Usage

# Edit an image
/gemini "photo.png" "Add a vintage filter" "output.png"

# Analyze code screenshot
/gemini_multiple_analyze "code.png" "What bugs can you spot?"

Environment Tools

Located in .opencode/tool/env/ - Environment variable management utilities.


Prompts System

Multi-model prompt variants with evaluation framework. Located in .opencode/prompts/.

Available Variants

Variant Model Family Status Best For
default Claude Stable Production, Claude models
gpt GPT Stable GPT-4, GPT-4o
gemini Gemini Stable Gemini 2.0, Gemini Pro
grok Grok Stable Grok models (free tier)
llama Llama/OSS Stable Llama, Qwen, DeepSeek

Testing Variants

# Test with evaluation framework
cd evals/framework
npm run eval:sdk -- --agent=openagent --prompt-variant=llama --suite=smoke-test

# Switch variant permanently
./scripts/prompts/use-prompt.sh --agent=openagent --variant=llama

Creating Custom Variants

  1. Copy template: cp .opencode/prompts/openagent/TEMPLATE.md .opencode/prompts/openagent/custom.md
  2. Edit metadata (YAML frontmatter)
  3. Customize prompt content
  4. Test with eval framework

Context System

Domain knowledge and standards. Located in .opencode/context/.

Core Context

File Description
core/essential-patterns.md Essential coding patterns
core/standards/code.md Code standards
core/standards/docs.md Documentation standards
core/standards/tests.md Testing standards
core/standards/patterns.md Design patterns
core/standards/analysis.md Analysis standards
core/workflows/delegation.md Delegation workflow
core/workflows/review.md Review workflow
core/workflows/sessions.md Session management
core/workflows/task-breakdown.md Task breakdown methodology
core/workflows/design-iteration.md Design iteration process
core/system/context-guide.md Context system guide

Development Context

File Description
development/react-patterns.md React best practices
development/api-design.md API design patterns
development/clean-code.md Clean code principles
development/animation-patterns.md Animation patterns
development/design-systems.md Design system guidelines
development/design-assets.md Design asset management
development/ui-styling-standards.md UI styling standards

Content Context

File Description
content/copywriting-frameworks.md Copywriting frameworks
content/tone-voice.md Tone and voice guidelines

Project Context

File Description
project/project-context.md Project-specific context (customize this!)

System Builder Templates

File Description
system-builder-templates/SYSTEM-BUILDER-GUIDE.md Guide for building systems
system-builder-templates/orchestrator-template.md Orchestrator agent template
system-builder-templates/subagent-template.md Subagent template

Configuration

Main configuration in .opencode/opencode.json.

Instructions

Files automatically loaded as context:

{
  "instructions": [
    "OPENCODE.md",
    "CONTRIBUTING.md",
    "CLAUDE.md",
    ".cursorrules",
    "README.md"
  ]
}

Permissions

Three permission levels:

Level Behavior Examples
allow Execute without confirmation git, npm, python, ls
deny Block completely rm -rf /, sudo, kill -9
ask Require user confirmation rm, git push --force

Pre-configured Safety

Allowed (safe operations):

  • Git operations, package managers (npm, yarn, pip, cargo)
  • Build tools, linters, formatters
  • Docker, file read/write, search tools

Denied (dangerous operations):

  • rm -rf /, sudo, kill -9
  • Force pushes to main/master
  • Disk formatting commands
  • Docker system prune

Ask (require confirmation):

  • File deletion (rm)
  • Force push to branches
  • Package uninstallation

Directory Structure

.
├── global/                    # For global installs
│   ├── opencode/              # -> ~/.config/opencode/
│   │   └── skill/             # Global skills (amp-skills)
│   └── claude-code/           # -> ~/.claude/
│       └── commands/          # Claude Code commands
│
├── ralph/                     # Autonomous AI agent loop
│   ├── ralph.sh               # Universal adapter script
│   ├── prompt.md              # Agent instructions
│   └── prd.json.example       # Example PRD format
│
├── project-template/          # For --init flag
│   ├── OPENCODE.md            # Project description template
│   ├── AGENTS.md              # Learnings template
│   └── .opencode/context/project/
│
├── .opencode/
│   ├── opencode.json          # Main configuration
│   ├── VERSION                # Version number
│   ├── README.md              # Internal documentation
│   │
│   ├── agent/                 # AI agent definitions
│   │   ├── core/              # Main agents (openagent, opencoder)
│   │   ├── development/       # Dev specialists
│   │   ├── languages/         # Language specialists
│   │   ├── infrastructure/    # DevOps/infra specialists
│   │   ├── content/           # Content creators
│   │   ├── data/              # Data specialists
│   │   ├── meta/              # System builder
│   │   └── subagents/         # Delegated task agents
│   │       ├── code/          # Code-related subagents
│   │       ├── core/          # Core subagents
│   │       ├── system-builder/ # System building subagents
│   │       └── utils/         # Utility subagents
│   │
│   ├── command/               # Slash commands
│   │   ├── git-flow.md
│   │   ├── git-safety.md
│   │   ├── git-commit.md
│   │   ├── clean.md
│   │   ├── commit.md
│   │   ├── optimize.md
│   │   ├── test.md
│   │   ├── worktrees.md
│   │   ├── context.md
│   │   ├── build-context-system.md
│   │   └── prompt-engineering/
│   │
│   ├── context/               # Domain knowledge
│   │   ├── core/              # Essential patterns & standards
│   │   ├── development/       # Dev standards
│   │   ├── content/           # Content standards
│   │   ├── project/           # Project-specific (customize!)
│   │   └── system-builder-templates/
│   │
│   ├── hooks/                 # Lifecycle hooks
│   │   ├── pre_tool_use.py
│   │   ├── post_tool_use.py
│   │   └── session_start.py
│   │
│   ├── skill/                 # Reusable workflows
│   │   ├── tdd/
│   │   ├── code-review/
│   │   ├── git-release/
│   │   ├── systematic-debugging/
│   │   ├── skill-creator/
│   │   ├── changelog-generator/
│   │   ├── mcp-builder/
│   │   ├── file-organizer/
│   │   └── pr-create/
│   │
│   ├── plugin/                # Extensions
│   │   ├── agent-validator.ts
│   │   ├── telegram-notify.ts
│   │   └── notify.ts
│   │
│   ├── tool/                  # Custom tools
│   │   ├── gemini/
│   │   ├── env/
│   │   └── template/
│   │
│   ├── prompts/               # Model-specific variants
│   │   ├── core/
│   │   ├── content/
│   │   ├── data/
│   │   └── development/
│   │
│   ├── ai-docs/               # AI documentation
│   │   ├── anthropic_*.md
│   │   ├── openai_*.md
│   │   └── cc_hooks_docs.md
│   │
│   └── node_modules/          # Dependencies
│
├── OPENCODE.md                # Project context template
├── .env.example               # Environment template
├── .gitignore
├── install.sh                 # One-line installer
├── update.sh                  # Update script
└── uninstall.sh               # Uninstall script

Ecosystem: Plugins, Tools & Extensions

A curated collection of OpenCode ecosystem tools discovered via parallel librarian agents.

Core Plugins (Must-Have)

Plugin Stars Description Install
oh-my-opencode 4,135 Async subagents, LSP/AST tools, curated agents (Sisyphus, Oracle, Librarian) npm i -g oh-my-opencode
opencode-roadmap 16 Persistent todo lists across sessions, multi-agent coordination npm i -g opencode-roadmap
opencode-tokenscope 31 Token usage analysis & cost tracking per model npm i -g opencode-tokenscope
opencode-dynamic-context-pruning 233 Intelligently prunes context to save tokens npm i -g opencode-dynamic-context-pruning
opencode-sessions 71 Multi-agent session management & collaboration npm i -g opencode-sessions

Multi-Agent Orchestration

Plugin Stars Description
claude-squad 5,454 Manage multiple AI terminal agents in parallel
superset 334 Run dozens of agents in parallel using git worktrees
swarm-tools 250 Multi-agent swarm coordination with learning
opencode-background 19 Manage and communicate with background tasks
kimaki 118 Control OpenCode agents via Discord (voice channels too!)

Context & Memory

Plugin Stars Description
Opencode-Context-Analysis-Plugin 29 Detailed token usage analysis for AI sessions
opencode-context.nvim 25 Neovim plugin for opencode in tmux pane
Opencode-Context-Jar 1 Preserves edited files and consolidates context
occtx 19 Switch between multiple opencode.json configs
opencode-plugin-simple-memory 9 Persistent memory across sessions

Development Tools

Plugin Stars Description
opencode-pty 43 Interactive PTY - run background processes, send input, regex filtering
opencode-type-inject 25 Auto-injects TypeScript types into file reads
opencode-morph-fast-apply 8 10x faster code editing with lazy edit markers
opencode-beads 35 Plugin for beads issue tracker
opencode-lmstudio 9 Enhanced LM Studio with auto-detection

Authentication Providers

Plugin Stars Description
opencode-openai-codex-auth 946 OAuth for ChatGPT Plus/Pro subscriptions
opencode-antigravity-auth 590 Auth for Antigravity models
opencode-gemini-auth 331 Gemini auth plugin

Skills & Workflows

Plugin Stars Description
opencode-skills 434 Curated skills collection
opencode-skillful 7 Lazy load prompts on demand
opencode-agent-skills 10 Tools for using agent skills
Opencode-Workflows 13 Evolving workflow examples
opencode-workflows 11 Workflow automation via Mastra engine

Monitoring & Analytics

Plugin Stars Description
ocmonitor-share 53 CLI for monitoring OpenCode usage
opencode-wrapped 64 Year-in-review stats & visualizations
opencode-subagent-logging 3 Subagent logging and monitoring
opencode-otel 0 OpenTelemetry integration

Code Quality & Review

Plugin Stars Description
opencode-review-helper 1 Review AI-generated changes, suggest order, analyze impact
opencode-debug-helper 0 Cursor-style debug mode with auto instrumentation
opencode-reflection-plugin 3 Reflection/judge layer to verify task completion
Pickle-Thinker 29 Makes GLM & Big Pickle ultrathink

UI & Notifications

Plugin Stars Description
portal 126 Mobile-first web UI with git + in-browser terminal
opencode-vibe 97 Next.js 16 web UI with streaming SSE
openchamber 77 Desktop + web interface
opencode-manager 66 Mobile-first multi-agent manager
opencode.nvim 1,289 Neovim integration
opencode-notificator 1 Desktop notifications
opencode-voice-plugin 1 Text-to-speech with EdgeTTS
voicemode 529 Natural voice conversations + sound feedback
cc-notifier 65 macOS push notifications

Environment & Config

Plugin Stars Description
opencode-direnv 7 Auto-load direnv environment at session start
opencode-ignore 9 Restrict AI access via .ignore patterns
opencode-rules 3 Handle rules files like Cursor
opencode-eslint-formatter 1 ESLint as formatter when config detected

Agent Collections

Repo Stars Description
OpenAgents 513 Plan-first development with approval-based execution
opencode-agents 31 Well-tested agent collection
personal-agent-systems 30 Agents to manage your life
Opencode-Agent-Creator-Plugin 2 Create agents within TUI

Hooks & Automation

Repo Stars Description
claude-code-hooks-mastery 2,002 Comprehensive hook patterns guide
claude-code-skill-factory 267 Hook generator, validator, template engine

Templates & Starters

Repo Stars Description
opencode-plugin-template 20 Template for OpenCode plugins
opencode-template 22 OpenCode template
opencode-ultimate-starter 5 Ultimate starter with Oh My OpenCode + fixes

Utilities

Repo Stars Description
Opencode-Extensions-TUI 5 TUI-based extensions manager
OmO-Agent-Config 3 CLI for Oh My OpenCode agent model assignments
opencode-flake 26 Nix flake for OpenCode
slipstream 1 Oh-my-zsh plugin for warp-like AI via OpenCode

MCP Servers (Swiss Army Knives)

All-in-One Powerhouses

Server Stars Description
PAL MCP Server 10,685 Multi-model: Claude/Gemini/OpenAI/Grok/Ollama
Activepieces 20,134 ~400 MCP servers for AI agents
MindsDB 38,138 "The only MCP Server you'll ever need"
FastMCP 21,568 Fast, Pythonic MCP server builder
Context7 40,504 Up-to-date code documentation for LLMs

Database Access

Server Stars Description
DBHub 1,809 Zero-dep, multi-DB (Postgres, MySQL, SQLite, etc.)
MongoDB MCP 868 MongoDB Atlas integration
Qdrant MCP 1,150 Vector database
Neo4j MCP 859 Graph database

Browser Automation

Server Stars Description
Playwright MCP 24,934 Official Microsoft browser automation
Browserbase MCP 2,996 Browser control with Stagehand
Stealth Browser MCP - Bypasses Cloudflare and antibots

API Integrations

Server Stars Description
GitHub MCP 25,530 Official GitHub API integration
Slack MCP 1,042 Slack integration
Notion MCP 3,636 Notion API
WhatsApp MCP 5,177 WhatsApp integration
AWS MCP 7,749 AWS services
Cloudflare MCP 3,232 Cloudflare services
Kubernetes MCP 1,237 K8s management

Search & Data

Server Stars Description
Exa MCP 3,474 Web search and crawling
Firecrawl MCP 5,152 Web scraping and search
Arxiv MCP 1,985 Search and analyze research papers

Productivity

Server Stars Description
Excel MCP 3,037 Excel file manipulation
Word MCP 1,284 Word document editing
PowerPoint MCP 1,357 PowerPoint manipulation
ElevenLabs MCP 1,121 Text-to-speech

Curated Lists

List Stars Description
awesome-mcp-servers 77,862 The definitive MCP collection
MCP Registry 6,188 Official community registry

Resources


Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests if applicable
  5. Submit a pull request

License

MIT