OpenCARL

Context Augmentation & Reinforcement Layer — Dynamic rules for OpenCode

npm version License GitHub stars

What is OpenCARL?

OpenCARL is a dynamic rule injection plugin for OpenCode. Define your preferences once, and they load automatically when relevant to your current task.

🎯 Keyword-Based Loading

Rules load automatically when your prompt matches domain keywords. No manual activation needed.

⭐ Star-Commands

Explicit triggers like *brief or *deep for on-demand behavior changes.

📊 Context-Aware

Rules adapt based on context window usage — thorough when fresh, concise when depleted.

🔄 Global & Project Rules

Universal preferences in global config, project-specific rules in each repo.

Quick Start

Installation

# Install OpenCARL
npm install opencarl

# Add to opencode.json
echo '{"plugin": ["opencarl"]}' > opencode.json

# Run setup
npx opencarl --local

Basic Usage

# Interactive help
*opencarl

# View documentation
*opencarl docs

# Create a domain
/opencarl create DEVELOPMENT --recall 'write code, implement, test'

Rules load automatically when your prompt matches domain keywords (e.g., "fix bug" loads development rules).

Documentation

Explore guides, tutorials, and API reference:

CLI Commands

Setup

  • npx opencarl --local — Install for project
  • npx opencarl --global — Install globally
  • npx opencarl --integrate — Add to AGENTS.md

Management

  • /opencarl create DOMAIN — Create domain
  • /opencarl add rule — Add rule
  • /opencarl list — List domains
  • /opencarl view DOMAIN — View rules

File Structure

.opencarl/
├── manifest        # Domain registry (states + keywords)
├── global          # Always-loaded rules
├── commands        # Star-command definitions
├── context         # Context bracket rules
└── {domain}        # Custom domains (lowercase, no extension)