B00t rhai bridge

From elasticdotventures/_b00t_ · View interactive version

B00t rhai bridge is an AI agent skill from the GitHub repository elasticdotventures/_b00t_. Bridge b00t primitives (datum, grok, hive, task, agent) to opencode via RHAI scripts. RHAI provides the idiomatic abstraction layer connecting applications.

How to use this skill

Skill file

What This Skill Does

Expose b00t primitives to opencode through RHAI script runner:

When It Activates

b00t Primitives → RHAI Bridge

Available RHAI Scripts

# List available scripts
b00t script list

# Run a script
b00t script run <script-name>

# Run RHAI code directly
b00t script eval "<rhai code>"

Key RHAI Scripts

| Script | Purpose | Bridge |

|--------|---------|--------|

| operator-agent | Autonomous agent loop | opencode agent delegation |

| setup | System bootstrap | opencode initialization |

| github-auth-validate | GitHub auth check | MCP credential validation |

| kubernetes_detect | k8s detection | opencode k8s context |

RHAI in opencode Workflow

1. b00t script run operator-agent → Execute autonomous loop
2. b00t script eval "<code>" → Run inline RHAI
3. Delegate to b00t agent → Full agent capability

RHAI Code Examples

Check System Status

let status = b00t::hive_status();
print(status);

Query Knowledge Base

let answer = b00t::grok_ask("pattern TypeScript");
print(answer);

Delegate to Agent

let result = b00t::agent_delegate("worker", "task-id", "description");
print(result);

Integration with opencode

Via b00t-mcp

When b00t-mcp is configured:

// Direct CLI invocation
b00t_mcp_b00t_hive_status()

// Available in opencode agents

Via shell commands in opencode

# In opencode agent, execute:
b00t script run github-auth-validate
b00t grok ask "<query>"
b00t task list

Custom RHAI Scripts for opencode

Create in _b00t_/scripts/ for opencode integration:

// opencode-init.rhai
print("Initializing opencode context...");

// Load opencode standards
let standards = datum_load("opencode-standards");
print(standards);

Dependencies

Version

1.0.0 - Initial RHAI bridge skill

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.