Skip to content

Complete OpenCode configuration collection - agents, skills, hooks, commands, rules, MCPs. Battle-tested configs from an Anthropic hackathon winner.

License

Notifications You must be signed in to change notification settings

karma-works/everything-opencode

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Language: English | 简体中文 | 繁體中文

Everything OpenCode

Stars License Shell TypeScript Go Markdown


🌐 Language / 语言 / 語言

English | 简体中文 | 繁體中文


The complete collection of Claude configs from an Anthropic hackathon winner, migrated to OpenCode.

Production-ready agents, skills, commands, rules, and MCP configurations evolved over 10+ months of intensive daily use building real products.

Migration Complete: This project has been migrated from Claude Code to OpenCode! See MIGRATION_PLAN.md for details.


The Guides

This repo is the raw code only. The guides explain everything.

The Shorthand Guide to Everything Claude Code The Longform Guide to Everything Claude Code
Shorthand Guide
Setup, foundations, philosophy. Read this first.
Longform Guide
Token optimization, memory persistence, evals, parallelization.
Topic What You'll Learn
Token Optimization Model selection, system prompt slimming, background processes
Memory Persistence Hooks that save/load context across sessions automatically
Continuous Learning Auto-extract patterns from sessions into reusable skills
Verification Loops Checkpoint vs continuous evals, grader types, pass@k metrics
Parallelization Git worktrees, cascade method, when to scale instances
Subagent Orchestration The context problem, iterative retrieval pattern

🚀 Quick Start

Get up and running in under 2 minutes:

Step 1: Clone the Repository

git clone https://github.com/karma-works/everything-opencode.git
cd everything-opencode

Step 2: Install for OpenCode

Option A: Global Installation (Recommended)

# Create OpenCode config directory
mkdir -p ~/.config/opencode

# Copy configuration
cp opencode.json ~/.config/opencode/
cp -r .opencode/* ~/.config/opencode/

Option B: Project-Level Installation

# Copy to your project
cp -r .opencode /path/to/your/project/
cp opencode.json /path/to/your/project/

Step 3: Start Using

# Try a command
/plan "Add user authentication"

# Invoke an agent
@code-reviewer

# Check available commands
ls .opencode/commands/

That's it! You now have access to 13+ agents, 12+ skills, and 20+ commands.


🌐 Cross-Platform Support

This configuration supports Windows, macOS, and Linux. All scripts are written in Node.js for maximum compatibility.

Package Manager Detection

Scripts automatically detect your preferred package manager (npm, pnpm, yarn, or bun) with the following priority:

  1. Environment variable: OPENCODE_PACKAGE_MANAGER
  2. Project config: .opencode/package-manager.json
  3. package.json: packageManager field
  4. Lock file: Detection from package-lock.json, yarn.lock, pnpm-lock.yaml, or bun.lockb
  5. Global config: ~/.config/opencode/package-manager.json
  6. Fallback: First available package manager

To set your preferred package manager:

# Via environment variable
export OPENCODE_PACKAGE_MANAGER=pnpm

# Via global config
node scripts/setup-package-manager.js --global pnpm

# Via project config
node scripts/setup-package-manager.js --project bun

# Detect current setting
node scripts/setup-package-manager.js --detect

Or use the /setup-pm command.


📦 What's Inside

This repo provides OpenCode configuration files - copy them to your project or global config.

everything-opencode/
|-- .opencode/              # OpenCode configuration directory
|   |-- agents/             # Specialized subagents for delegation
|   |   |-- planner.md           # Feature implementation planning
|   |   |-- architect.md         # System design decisions
|   |   |-- tdd-guide.md         # Test-driven development
|   |   |-- code-reviewer.md     # Quality and security review
|   |   |-- security-reviewer.md # Vulnerability analysis
|   |   |-- build-error-resolver.md
|   |   |-- e2e-runner.md        # Playwright E2E testing
|   |   |-- refactor-cleaner.md  # Dead code cleanup
|   |   |-- doc-updater.md       # Documentation sync
|   |   |-- go-reviewer.md       # Go code review
|   |   |-- go-build-resolver.md # Go build error resolution
|   |
|   |-- commands/           # Slash commands for quick execution
|   |   |-- tdd.md              # /tdd - Test-driven development
|   |   |-- plan.md             # /plan - Implementation planning
|   |   |-- e2e.md              # /e2e - E2E test generation
|   |   |-- code-review.md      # /code-review - Quality review
|   |   |-- build-fix.md        # /build-fix - Fix build errors
|   |   |-- refactor-clean.md   # /refactor-clean - Dead code removal
|   |   |-- setup-pm.md         # /setup-pm - Configure package manager
|   |   |-- go-review.md        # /go-review - Go code review
|   |   |-- go-test.md          # /go-test - Go TDD workflow
|   |   |-- go-build.md         # /go-build - Fix Go build errors
|   |
|   |-- skills/             # Workflow definitions and domain knowledge
|   |   |-- coding-standards/           # Language best practices
|   |   |-- backend-patterns/           # API, database, caching patterns
|   |   |-- security-review/            # Security checklist
|   |   |-- eval-harness/               # Verification loop evaluation
|   |   |-- python-testing/             # Python testing patterns
|   |   |-- python-patterns/            # Python best practices
|   |   |-- golang-testing/             # Go testing patterns
|   |   |-- strategic-compact/          # Context compaction
|   |
|   |-- rules/              # Always-follow guidelines
|   |   |-- security.md         # Mandatory security checks
|   |   |-- coding-style.md     # Immutability, file organization
|   |   |-- testing.md          # TDD, 80% coverage requirement
|   |   |-- git-workflow.md     # Commit format, PR process
|   |   |-- agents.md           # When to delegate to subagents
|   |   |-- performance.md      # Model selection, context management
|   |   |-- hooks.md            # Hook usage guidelines
|   |   |-- patterns.md         # Design patterns
|   |
|   |-- AGENTS.md           # Project-specific instructions
|
|-- opencode.json           # OpenCode configuration file
|-- AGENTS.md               # Root-level instructions
|
|-- agents/                 # Source: Agent definitions (copied to .opencode/)
|-- commands/               # Source: Command definitions (copied to .opencode/)
|-- skills/                 # Source: Skill definitions (copied to .opencode/)
|-- rules/                  # Source: Rule definitions (copied to .opencode/)
|-- scripts/                # Cross-platform Node.js scripts
|-- mcp-configs/            # MCP server configurations

🛠️ Ecosystem Tools

Skill Creator

Two ways to generate Claude Code skills from your repository:

Option A: Local Analysis (Built-in)

Use the /skill-create command for local analysis without external services:

/skill-create                    # Analyze current repo
/skill-create --instincts        # Also generate instincts for continuous-learning

This analyzes your git history locally and generates SKILL.md files.

Option B: GitHub App (Advanced)

For advanced features (10k+ commits, auto-PRs, team sharing):

Install GitHub App | ecc.tools

# Comment on any issue:
/skill-creator analyze

# Or auto-triggers on push to default branch

Both options create:

  • SKILL.md files - Ready-to-use skills for Claude Code
  • Instinct collections - For continuous-learning-v2
  • Pattern extraction - Learns from your commit history

🧠 Continuous Learning

Note: Continuous learning features (instincts, pattern extraction) are not available in OpenCode. These features were specific to Claude Code. See MIGRATION_PLAN.md for details on potential custom implementations.


📋 Requirements

OpenCode CLI

This configuration requires OpenCode CLI.

Check your version:

opencode --version

Important Notes

  • Context Window Management: Don't enable all MCPs at once. Your context window can shrink significantly with too many tools enabled.
  • Rule of thumb: Keep under 10 MCPs enabled per project, under 80 tools active.
  • Skills: Are automatically loaded from .opencode/skills/ (backward compatible with .claude/skills/)

📥 Installation

Option 1: Global Installation (Recommended)

Install for all projects:

# Clone the repo
git clone https://github.com/karma-works/everything-opencode.git
cd everything-opencode

# Create OpenCode config directory
mkdir -p ~/.config/opencode

# Copy configuration files
cp opencode.json ~/.config/opencode/
cp -r .opencode/agents ~/.config/opencode/
cp -r .opencode/commands ~/.config/opencode/
cp -r .opencode/skills ~/.config/opencode/
cp -r .opencode/rules ~/.config/opencode/

# Optional: Copy AGENTS.md
cp AGENTS.md ~/.config/opencode/

Option 2: Project-Level Installation

Install for a specific project:

# Clone the repo
git clone https://github.com/karma-works/everything-opencode.git
cd everything-opencode

# Copy to your project
cp -r .opencode /path/to/your/project/
cp opencode.json /path/to/your/project/
cp AGENTS.md /path/to/your/project/

Or if you're already in your project directory:

# From your project root
cp -r /path/to/everything-opencode/.opencode ./
cp /path/to/everything-opencode/opencode.json ./
cp /path/to/everything-opencode/AGENTS.md ./

Option 3: Manual Component Installation

If you prefer manual control over what's installed:

# Clone the repo
git clone https://github.com/karma-works/everything-opencode.git

# Copy specific agents
cp everything-opencode/.opencode/agents/code-reviewer.md ~/.config/opencode/agents/

# Copy specific commands
cp everything-opencode/.opencode/commands/plan.md ~/.config/opencode/commands/

# Copy specific skills
cp -r everything-opencode/.opencode/skills/python-testing ~/.config/opencode/skills/

# Copy specific rules
cp everything-opencode/.opencode/rules/security.md ~/.config/opencode/rules/

Configure MCPs

Edit ~/.config/opencode/opencode.json to enable desired MCP servers:

{
  "mcp": {
    "github": {
      "type": "local",
      "command": ["npx", "-y", "@modelcontextprotocol/server-github"],
      "enabled": true
    }
  }
}

Important: Set required environment variables (e.g., GITHUB_PERSONAL_ACCESS_TOKEN) before using MCP servers.


🎯 Key Concepts

Agents

Subagents handle delegated tasks with limited scope. Invoke with @agent-name. Example:

---
description: Reviews code for quality, security, and maintainability
mode: subagent
model: anthropic/claude-sonnet-4-5
temperature: 0.1
tools:
  read: true
  grep: true
  glob: true
  bash: true
  edit: false
  write: false
permission:
  bash:
    "git *": allow
    "*": ask
---

You are a senior code reviewer...

Skills

Skills are workflow definitions invoked by commands or agents:

# TDD Workflow

1. Define interfaces first
2. Write failing tests (RED)
3. Implement minimal code (GREEN)
4. Refactor (IMPROVE)
5. Verify 80%+ coverage

Hooks

Note: OpenCode uses a different hook system than Claude Code. Hooks are implemented as JavaScript/TypeScript plugins in .opencode/plugins/.

Example plugin structure:

// .opencode/plugins/hooks.ts
import type { Plugin } from "@opencode-ai/plugin"

export const HooksPlugin: Plugin = async ({ $ }) => {
  return {
    "tool.execute.after": async (input, output) => {
      if (input.tool === "edit") {
        console.log(`Edited: ${output.args.filePath}`)
      }
    }
  }
}

See MIGRATION_PLAN.md for details on converting Claude Code hooks to OpenCode plugins.

Rules

Rules are always-follow guidelines referenced in opencode.json:

{
  "instructions": [
    "~/.config/opencode/rules/security.md",
    "~/.config/opencode/rules/coding-style.md",
    "~/.config/opencode/rules/testing.md"
  ]
}

Keep them modular in ~/.config/opencode/rules/ or .opencode/rules/.


🧪 Running Tests

The plugin includes a comprehensive test suite:

# Run all tests
node tests/run-all.js

# Run individual test files
node tests/lib/utils.test.js
node tests/lib/package-manager.test.js
node tests/hooks/hooks.test.js

🤝 Contributing

Contributions are welcome and encouraged.

This repo is meant to be a community resource. If you have:

  • Useful agents or skills
  • Clever hooks
  • Better MCP configurations
  • Improved rules

Please contribute! See CONTRIBUTING.md for guidelines.

Ideas for Contributions

  • Language-specific skills (Python, Rust patterns) - Go now included!
  • Framework-specific configs (Django, Rails, Laravel)
  • DevOps agents (Kubernetes, Terraform, AWS)
  • Testing strategies (different frameworks)
  • Domain-specific knowledge (ML, data engineering, mobile)

📖 Background

I've been using AI coding assistants since the experimental rollout. Won the Anthropic x Forum Ventures hackathon in Sep 2025 building zenith.chat with @DRodriguezFX - entirely using AI-powered development.

These configs are battle-tested across multiple production applications and have been migrated from Claude Code to OpenCode.


⚠️ Important Notes

Context Window Management

Critical: Don't enable all MCPs at once. Your context window can shrink significantly with too many tools enabled.

Rule of thumb:

  • Have 20-30 MCPs configured in opencode.json
  • Keep under 10 enabled per project
  • Under 80 tools active

Use "enabled": false in the MCP config to disable unused servers:

{
  "mcp": {
    "github": {
      "type": "local",
      "command": ["npx", "-y", "@modelcontextprotocol/server-github"],
      "enabled": false
    }
  }
}

Customization

These configs work for my workflow. You should:

  1. Start with what resonates
  2. Modify for your stack
  3. Remove what you don't use
  4. Add your own patterns

🌟 Star History

Star History Chart


🔗 Links


📄 License

MIT - Use freely, modify as needed, contribute back if you can.


Star this repo if it helps. Read both guides. Build something great.

About

Complete OpenCode configuration collection - agents, skills, hooks, commands, rules, MCPs. Battle-tested configs from an Anthropic hackathon winner.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 64.8%
  • Python 13.5%
  • TypeScript 13.3%
  • Shell 8.4%