/prometheus-skill-pack:librefang-wasm-skillfrom prometheus-skill-pack
Generate a LibreFang WASM-ABI-compliant skill in Rust. Produces a cdylib crate that exports the required Guest ABI (alloc, execute, memory) and a host_call bridge wrapping LibreFang's capability-checked host functions (fs_*, net_fetch, kv_*, agent_*, time_now, env_read, shell_exec). Includes a skill.toml manifest matching librefang-skills' SkillManifest schema. Use when building a portable, sandboxed skill that runs inside a librefang/bossfang Agent OS instance via WasmSkillSandbox, or when packaging a Prometheus native-agent for upload to a bossfang URL.
Ships in prometheus-skill-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Generates a Rust skill that compiles to wasm32-unknown-unknown and conforms to LibreFang's
WASM Guest ABI as documented in
crates/librefang-runtime-wasm/src/sandbox.rs of the LibreFang fork.
/create-native-agent) for upload to a bossfang URL via
forge package-librefang + /upload-to-bossfang.net_fetch, kv_get, agent_send,
etc.) from a WASM guest.When forge enrich resolves this skill against a task, it renders four Tera
templates plus a working "echo" example into the target project:
<target>/
├── Cargo.toml ← cdylib crate, wasm32-unknown-unknown target
├── skill.toml ← LibreFang manifest (runtime.type = "wasm")
├── README.md ← capability + invocation docs
└── src/
├── lib.rs ← #[no_mangle] alloc, execute, plus host bridge
└── host.rs ← safe Rust wrappers around host_call/host_log
Per librefang-runtime-wasm/src/sandbox.rs:8-26, every WASM skill MUST export
exactly these symbols:
| Export | Signature | Purpose |
|---|---|---|
memory | (memory 1) (linear memory) | Linear memory shared with host |
alloc | (func (param i32) (result i32)) | Allocate size bytes; return ptr |
execute | (func (param i32 i32) (result i64)) | Main entry: receives (input_ptr, input_len), returns packed result. See lib.rs.tera for the bit layout. |
The host imports under module "librefang":
| Import | Signature | Purpose |
|---|---|---|
host_call | (func (param i32 i32) (result i64)) | RPC dispatch: send {"method","params"} JSON, receive {"ok":...} or {"error":"..."} |
host_log | (func (param i32 i32 i32)) | Log a message (level, msg_ptr, msg_len). Max 4096 bytes; longer is truncated. |
The lib.rs.tera template generates all five correctly. Do not hand-edit
unless you are sure the resulting module still loads in WasmSandbox::new().
librefang-runtime-wasm/src/host_functions.rs:21-47 enumerates every
allowed method value. The skill's skill.toml MUST declare a matching
requirements.capabilities entry for each method it calls (except
time_now, which requires no capability).
| Method | Required Capability | Purpose |
|---|---|---|
time_now | (none) | Unix timestamp seconds |
fs_read | FileRead("<glob>") | Read a file (canonicalized; no ..) |
fs_write | FileWrite("<glob>") | Write a file (parent canonicalized) |
fs_list | FileRead("<glob>") | List a directory |
net_fetch | NetConnect("<host:port>") | HTTP fetch with SSRF protection |
shell_exec | ShellExec("<cmd>") | Spawn a subprocess |
env_read | EnvRead("<var>") | Read an env var |
kv_get | MemoryRead("<key>") | Get from kernel KV store |
kv_set | MemoryWrite("<key>") | Set in kernel KV store |
agent_send | AgentMessage("<id>") | Send a message to another agent |
agent_spawn | AgentSpawn | Spawn a child agent |
Full documentation: references/librefang-host-abi.md.
librefang-skills/src/lib.rs defines the SkillManifest struct that
skill.toml deserializes into. The minimum WASM manifest is:
[skill]
name = "{{ skill_name }}"
version = "{{ skill_version | default(value="0.1.0") }}"
description = "{{ skill_description }}"
author = "{{ skill_author | default(value="your-name") }}"
tags = ["{{ skill_tag | default(value="example") }}"]
[runtime]
type = "wasm"
entry = "{{ skill_name | replace(from="-", to="_") }}.wasm"
[[tools]]
# Each tool the skill exposes to the LLM. Names must be unique within the skill.
name = "echo"
description = "Echo a JSON payload back to the caller."
input_schema = { type = "object", properties = { message = { type = "string" } }, required = ["message"] }
[requirements]
# String form of librefang_types::Capability variants. See references/capability-model.md.
tools = []
capabilities = []
Full manifest reference with all optional sections: references/skill-toml-reference.md.
The included scripts/validate-wasm-abi.sh uses wasm-tools to check the
four required exports and absence of forbidden imports. CI should run it
after every cargo build --target wasm32-unknown-unknown --release.
cargo build --target wasm32-unknown-unknown --release
bash scripts/validate-wasm-abi.sh target/wasm32-unknown-unknown/release/{{ skill_name | replace(from="-", to="_") }}.wasm
Cargo converts hyphens in package names to underscores in the emitted library
artifact. A skill named weather-check therefore builds and packages
weather_check.wasm; keep the manifest entry aligned with that filename.
If wasm-tools is not installed: cargo install wasm-tools (or brew install wasm-tools).
A complete, runnable echo skill is bundled at
references/example-echo/. It demonstrates the
full ABI, manifest, and host-call usage in ~80 lines of Rust. Use it as the
canonical reference when reviewing generated skills.
cd references/example-echo
cargo build --target wasm32-unknown-unknown --release
# Then load into LibreFang:
# curl -X POST http://localhost:4545/skills/install \
# -H "Content-Type: application/zip" \
# --data-binary @echo-skill.zip
| Template | Renders To | Variables |
|---|---|---|
templates/Cargo.toml.tera | Cargo.toml | skill_name, skill_version, skill_description, crate_authors |
templates/lib.rs.tera | src/lib.rs | skill_name, tools_json (array of tool definitions) |
templates/host.rs.tera | src/host.rs | (none — boilerplate, identical for every skill) |
templates/skill.toml.tera | skill.toml | skill_name, skill_version, skill_description, skill_author, skill_tags, tools, capabilities |
host_call method, params, and capabilityCapability variant, glob semanticswasm32-unknown-unknown is required. LibreFang's
WasmSandbox uses wasmtime::Module + Linker (core wasmtime), not the
Component Model — so wasm32-wasip1 and wasm32-wasip2 produce modules
with WASI-imports the host doesn't satisfy. The host imports are bound by
module name librefang, not by component-model interfaces.panic! across FFI: panics in execute abort the WASM instance
without returning JSON, surfacing as SandboxError::Execution on the host.
Always Result-pipe errors back as {"error": "..."} JSON.std::net, std::fs, std::process: all I/O must go through
host_call. The host enforces SSRF, path traversal, and capability checks
that are bypassed by direct WASI calls.alloc MUST Box::leak the allocation; otherwise
the host reads freed memory.references/capability-model.md (opens in a new tab)references/example-echo/Cargo.toml (opens in a new tab)references/example-echo/README.md (opens in a new tab)references/example-echo/skill.toml (opens in a new tab)references/example-echo/src/host.rs (opens in a new tab)references/example-echo/src/lib.rs (opens in a new tab)references/example-walkthrough.md (opens in a new tab)references/librefang-host-abi.md (opens in a new tab)references/skill-toml-reference.md (opens in a new tab)scripts/validate-wasm-abi.sh (opens in a new tab)skill.toml (opens in a new tab)templates/Cargo.toml.tera (opens in a new tab)templates/skill.toml.tera (opens in a new tab)templates/src/host.rs.tera (opens in a new tab)templates/src/lib.rs.tera (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub prometheus-ags/prometheus-skill-system --plugin prometheus-skill-pack218 skills in this plugin
/actor-modelTokio-native actor model pattern for Prometheus AGS projects. Implements actors as tokio tasks communicating via mpsc channels with a typed message enum, enabling safe concurrent state management without shared locks. Used in UAR session management, pk-librarian event broadcasting, and parking-lot scheduler design. Use when a component needs to own state exclusively while serving concurrent callers.
/adversarial-reviewIsolated, cross-model adversarial review of KBD artifacts and change diffs. Dispatches a fresh-context LLM judge over an OpenAI-compatible REST gateway (openai-proxy or `liter-llm api`) with an explicit mandate to find problems — the model that produced an artifact or change is never the model that reviews it. Runs as a pipeline stage inside kbd-assess/analyze/plan (artifact mode) and kbd-execute's single phase-boundary QA step (diff mode, once over the whole phase diff). Findings are severity-bucketed (CRITICAL/WARNING/SUGGESTION) and the judge's own report is screened by sycophancy-correction before it is surfaced.
/agent-team-creatorCreate, revise, package, and deploy agent-team definitions with staged questions and native exports for UAR, Codex, Claude Code, Copilot, Kimi Code, MiniMax CLI, OpenCode and DeepSeek. Use for team definition and catalog lifecycle; use agent-team-manage for active runtime task state.Other plugins' skills for the same job
2 plugins in one repository ship this exact skill · first indexed Nov 27, 2026