Hermetic Development Harness & Multi-Agent Swarm Environment Powered by OpenCode and Ruflo, routed natively through AWS Bedrock.
This workspace provides an isolated environment for orchestration and coding. It pairs OpenCode's terminal interface with Ruflo's multi-agent swarm architecture and 300+ MCP tools.
All source code, compiled binaries, global state, vector databases, and logs reside inside the Script / Installation Directory (SCRIPT_DIR), keeping system-level paths (~/.config, ~/.local) clean. When you launch opencode inside any Target Project Directory, only minimal, non-polluting project metadata is initialized.
flowchart TD
A["OpenCode TUI<br/><i>(Launched from /path/to/your/project/dir)</i>"] -->|Translated Commands & Agents| B["Ruflo MCP Server<br/><i>(300+ tools)</i>"]
B -->|AWS SDK| C["AWS Bedrock (Claude Sonnet 4)"]
D["ruflo-plugin-translator<br/><i>(Build-time, static)</i>"] -->|writes .opencode/| A
Navigate to your central installation directory, source the script, and run setup:
cd /path/to/installation/dir
source activate.sh
opencode_setupThis will:
- Clone OpenCode and Ruflo repositories
- Compile OpenCode into a native binary
- Build the Ruflo CLI engine
- Compile the Ruflo Plugin Translator into a standalone binary
- Run smoke tests on all three binaries
Navigate to your target project folder, source the script, and launch OpenCode:
cd /path/to/your/project/dir
source /path/to/installation/dir/activate.sh
opencodeTo gracefully terminate background daemons and OpenCode instances:
opencode_stopAssumes opencode_setup has already been run once.
Terminal (outside OpenCode):
mkdir ~/calculator && cd ~/calculator
source ~/opencode-ruflo/activate.sh
opencodeInside OpenCode TUI β type these commands in order:
Step 1. Check Ruflo is healthy:
/ruflo-status
Step 2. Initialize a swarm session:
/swarm init --topology hierarchical --max-agents 4 --strategy specialized
Step 3. Switch to the architect agent:
/agent architect
Step 4. Ask it to design the app:
Design a Python Tkinter calculator app. Single file calculator.py. GUI with buttons 0-9, +, -, *, /, =, C. Display area at top. Handle division by zero. Support keyboard input. Store the design in memory.
Step 5. Switch to the coder agent:
/agent coder
Step 6. Ask it to implement:
Implement the calculator based on the architect's design stored in memory. Write it to calculator.py. Use the hooks pre-edit and post-edit lifecycle. Store successful patterns in memory when done.
Step 7. Exit OpenCode: press Ctrl+C
Back in terminal:
python3 calculator.pyCalculator window opens.
Once inside the OpenCode interface, Ruflo commands and agents are available natively β translated ahead of time into OpenCode's .opencode/ format.
Ruflo commands are translated into native OpenCode slash commands:
/ruflo-status
/swarm-init
/witness
/arena --rounds 3 --task "build a calculator"
Select a specialized Ruflo agent from the agent picker, or switch via:
/agent coder
/agent architect
/agent reviewer
/agent researcher
Each agent has full access to Ruflo's 300+ MCP tools (memory, swarm orchestration, hooks, browser automation, neural learning, AgentDB, and more).
With a Ruflo agent selected, describe what you want built:
Build a simple Python Tkinter calculator app. It should have a clean GUI,
basic arithmetic operations (+, -, *, /), a clear display, and keyboard input support.
Write the code to the project directory.
- Plugin Translator (build-time): Scans Ruflo plugin directories and writes native OpenCode command/agent markdown files into
.opencode/. - OpenCode loads these files natively β no runtime plugin, no bridge, no dynamic registration.
- Ruflo MCP Server provides 300+ tools to all translated agents via the
tools: { ruflo: true }config. - Architect Agent reads your request, drafts structural specifications, and selects design patterns.
- Coder Agent writes production-ready code with complete logic and zero placeholders.
- Tester Agent executes synthetic syntax checks and unit tests to verify correctness.
The system operates via a static translation pipeline β no runtime bridge, no dynamic plugin loading:
flowchart TD
subgraph "Build Time (opencode_setup)"
T["ruflo-plugin-translator<br/><i>(compiled binary)</i>"] -->|scans| P["Ruflo Plugins<br/>plugins/ruflo-*/"]
T -->|writes| CMD[".opencode/command/*.md"]
T -->|writes| AGT[".opencode/agent/*.md"]
end
subgraph "Runtime (opencode)"
OC["OpenCode TUI<br/><i>(native binary)</i>"] -->|reads| CMD
OC -->|reads| AGT
AGT -->|tool calls| MCP["Ruflo MCP Server<br/><i>(ruflo mcp)</i>"]
MCP --> Tools["300+ Ruflo Tools"]
end
Tools --> Memory["Memory & Embeddings"]
Tools --> Swarm["Swarm Orchestration"]
Tools --> Hooks["Hooks & Lifecycle"]
Tools --> Browser["Browser Automation"]
Tools --> AgentDB["Agent Database"]
Tools --> Neural["Neural Learning"]
OC -->|LLM calls| Bedrock["AWS Bedrock<br/>Claude Sonnet 4"]
ββββββββββ βββββββββ βββββββββββββ βββββββββ βββββββββ
β Scan β β β Parse β β β Translate β β β Write β β β Clean β
ββββββββββ βββββββββ βββββββββββββ βββββββββ βββββββββ
- Scan: Discover plugins with valid
.claude-plugin/plugin.jsonmanifests - Parse: Extract commands (name, description, body) and agents (name, model, body)
- Translate: Map to OpenCode format β model shorthands resolved, constant fields applied
- Write: Atomic writes (temp + rename), skip if byte-identical (idempotent)
- Clean: Remove orphaned files from previous runs
/path/to/installation/dir/ (SCRIPT_DIR)
βββ activate.sh # Functions: opencode_setup, opencode, opencode_stop
β
βββ github/ # Source repositories (self-contained, no shared deps)
β βββ anomalyco/opencode/ # OpenCode source (v1.18.4)
β β βββ packages/opencode/dist/
β β βββ opencode-*/bin/opencode β compiled native binary
β βββ ruvnet/ruflo/ # Ruflo source (v3.32.9)
β βββ bin/cli.js β Ruflo CLI (shebang executable)
β βββ plugins/ # Ruflo plugin directories (translation source)
β βββ node_modules/ # Ruflo's own dependencies
β
βββ ruflo-plugin-translator/ # Static translator tool
β βββ src/ # TypeScript source
β βββ dist/ # Compiled JS
β βββ bin/
β βββ ruflo-plugin-translator β compiled standalone binary (bun)
β
βββ .local/ # Isolated Global State
βββ logs/ruflo.log # Daemon execution log
βββ ruflo-global/ # Vector DB, Memory, AgentDB storage
/path/to/your/project/dir/
βββ .env # AWS credentials (optional)
βββ .gitignore # Auto-generated
βββ opencode.json # Auto-generated runtime config (MCP, model, provider)
βββ .opencode/ # Translated commands & agents (created by translator)
β βββ command/
β β βββ ruflo-status.md
β β βββ swarm-init.md
β β βββ ...
β βββ agent/
β βββ coder.md
β βββ architect.md
β βββ ...
βββ .claude/ # Local Ruflo workspace settings
βββ .ruflo/ # Local Ruflo project state
AWS Bedrock credentials are dynamically loaded when opencode runs:
- Active Shell Environment Variables (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_REGION) - Project-Local
.envFile inside your project directory - System AWS Credentials File (
~/.aws/credentials)
π‘ Default Region: If
AWS_REGIONis omitted, the environment defaults tous-east-1.
| Action | Command | Purpose |
|---|---|---|
| Clean Start | opencode_stop && opencode |
Restarts daemon and reloads credentials |
| Inspect Logs | cat $SCRIPT_DIR/.local/logs/ruflo.log |
View daemon execution output |
| Check Processes | ps aux | grep ruflo |
Verify daemon is active |
| Re-translate | Run opencode again (translator runs each launch) |
Picks up plugin changes |
| Rebuild All | opencode_setup |
Full clean rebuild of all binaries |