mirror of
https://github.com/LerianStudio/ring
synced 2026-04-21 21:47:49 +00:00
Move OpenCode runtime plugin and installer into Ring monorepo under platforms/opencode/. The installer reads skills, agents, and commands directly from the Ring monorepo's canonical directories (default/, dev-team/, pm-team/, etc.) — zero asset duplication. What's included: - installer.sh: reads from Ring dirs, applies frontmatter/tool transforms, installs to ~/.config/opencode/ - plugin/: TypeScript runtime (RingUnifiedPlugin) with hooks, lifecycle, loaders - src/: CLI (doctor, config-manager) - prompts/: session-start and context-injection templates - standards/: coding standards (from dev-team/docs/) - ring.jsonc: default config with full 86-skill/35-agent/33-command inventory What's NOT included (intentionally): - assets/ directory: eliminated, content comes from Ring monorepo - scripts/codereview/: eliminated, replaced by mithril - using-ring-opencode skill: uses canonical using-ring instead Transforms applied by installer: - Agent: type→mode, strip version/changelog/output_schema/input_schema - Skill: keep name+description frontmatter, body unchanged - Command: strip argument-hint (unsupported by OpenCode) - All: normalize tool names (Bash→bash, Read→read, etc.) - All: strip Model Requirement sections from agents Replaces: LerianStudio/ring-for-opencode repository Generated-by: Gandalf AI-Model: claude-opus-4
74 lines
3.4 KiB
Markdown
74 lines
3.4 KiB
Markdown
# Ring for OpenCode
|
|
|
|
OpenCode platform integration for the Ring skills library. This directory contains the runtime plugin and installer that brings Ring's skills, agents, and commands to [OpenCode](https://github.com/ohmyopencode/opencode).
|
|
|
|
## Architecture
|
|
|
|
```
|
|
platforms/opencode/
|
|
├── installer.sh # Installer script (reads from Ring monorepo)
|
|
├── plugin/ # TypeScript runtime plugin (RingUnifiedPlugin)
|
|
│ ├── config/ # Configuration handler and schema
|
|
│ ├── hooks/ # Session-start, context-injection hooks
|
|
│ ├── lifecycle/ # Event routing
|
|
│ ├── loaders/ # Agent, skill, command loaders
|
|
│ ├── tools/ # Custom Ring tools
|
|
│ └── utils/ # State management
|
|
├── prompts/ # Prompt templates (session-start, context-injection)
|
|
├── standards/ # Coding standards (from dev-team/docs/standards/)
|
|
├── templates/ # Project templates
|
|
├── src/ # CLI (doctor, config-manager)
|
|
├── ring.jsonc # Default Ring configuration
|
|
└── ring-config.schema.json # JSON schema for ring.jsonc
|
|
```
|
|
|
|
## How It Works
|
|
|
|
The installer reads skills, agents, and commands directly from the Ring monorepo's canonical directories (`default/`, `dev-team/`, `pm-team/`, etc.) and applies transformations for OpenCode compatibility:
|
|
|
|
1. **Agent transform**: `type` → `mode`, strip unsupported frontmatter (version, changelog, output_schema), normalize tool names, remove Claude-specific model requirement sections
|
|
2. **Skill transform**: Keep `name` and `description` in frontmatter, normalize tool references in body
|
|
3. **Command transform**: Strip `argument-hint` (unsupported), normalize tool references
|
|
4. **Hooks**: Not installed (OpenCode uses plugin-based hooks incompatible with Ring's file-based hooks)
|
|
|
|
After transformation, files are installed to `~/.config/opencode/`:
|
|
- `agent/*.md` — Agents (35 from 6 Ring plugins)
|
|
- `skill/*/SKILL.md` — Skills (86 from 6 Ring plugins)
|
|
- `command/*.md` — Commands (33 from 6 Ring plugins)
|
|
- `skill/shared-patterns/*.md` — Shared patterns (merged from all plugins)
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
# From the Ring monorepo root:
|
|
./platforms/opencode/installer.sh
|
|
|
|
# Or with custom config dir:
|
|
OPENCODE_CONFIG_DIR=~/.config/opencode ./platforms/opencode/installer.sh
|
|
```
|
|
|
|
## Configuration
|
|
|
|
User config lives at `~/.config/opencode/ring/config.jsonc`. Use it to disable specific agents, skills, commands, or hooks:
|
|
|
|
```jsonc
|
|
{
|
|
"disabled_agents": ["finops-analyzer"],
|
|
"disabled_skills": ["regulatory-templates"],
|
|
"disabled_commands": []
|
|
}
|
|
```
|
|
|
|
## Key Differences from Claude Code
|
|
|
|
| Feature | Claude Code | OpenCode |
|
|
|---------|------------|----------|
|
|
| Directory names | Plural (`agents/`, `skills/`) | Singular (`agent/`, `skill/`) |
|
|
| Tool names | Capitalized (`Bash`, `Read`) | Lowercase (`bash`, `read`) |
|
|
| Hooks | File-based (JSON + scripts) | Plugin-based (TypeScript) |
|
|
| Agent type field | `type: reviewer` | `mode: subagent` |
|
|
| Argument hints | `argument-hint: "[files]"` | Not supported |
|
|
|
|
## Previously: ring-for-opencode
|
|
|
|
This was previously a separate repository (`LerianStudio/ring-for-opencode`). It was consolidated into the Ring monorepo to eliminate content drift and sync overhead. The runtime plugin and installer are maintained here; skills, agents, and commands come from the Ring monorepo's canonical sources.
|