/acp:rustfrom acp
Scoped to Jacob's homelab Rust repos — the rmcp MCP-server family (rustifi, rustify, rustscale, unrust, rarcane, rustarr, apprise-mcp, cortex, synapse2, rmcp-template) and the Lab runtime/ACP work. Use when editing those repos: covers rmcp-template-derived server patterns, action-dispatched MCP tools, CLI/MCP/API parity, service-layer architecture, config/auth/scope contracts, testing strategy, release/build conventions, and ACP runtime/provider work. Not a general-purpose Rust skill.
Ships in acp. 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.
Use this skill for Rust work in the homelab agent ecosystem. The default pattern
source is the sibling workspace repo ../rmcp-template when it exists relative
to the target repo's workspace root; treat that repo as the canonical reference
for MCP server architecture unless the target repo documents a newer local rule.
Identify the repo family before editing:
rmcp-template derived MCP server: rustifi, rustify, rustscale, unrust, rarcane, rustarr, apprise-mcp, cortex, synapse2, and new servers cloned from rmcp-template.lab, including Labby gateway, dispatch, marketplace, auth, UI, and snippets.crates/lab/src/acp, codex-acp, Zed/VS Code providers, or Agent Client Protocol stdio integration.CLAUDE.md, docs/, Justfile, and existing module style first.Before changing shared behavior, read the nearest source-of-truth docs:
RMCP_TEMPLATE="${RMCP_TEMPLATE:-$(cd .. && pwd)/rmcp-template}"
sed -n '1,220p' "$RMCP_TEMPLATE/docs/PATTERNS.md"
sed -n '1,220p' "$RMCP_TEMPLATE/docs/RUST.md"
sed -n '1,220p' "$RMCP_TEMPLATE/docs/TESTING.md"
sed -n '1,220p' "$RMCP_TEMPLATE/docs/AUTH.md"
Then check the target repo's CLAUDE.md and current docs for evolved local
patterns. Several repos intentionally moved beyond the baseline template; do
not force them back to the template shape when their local contract is newer.
For ACP-specific work, also read this skill's ACP references:
references/wire-format.mdreferences/message-reference.mdreferences/tool-calls.mdreferences/unstable-features.mdreferences/codex-patterns.mdexamples/agent-impl.rsexamples/client-impl.rsThe rmcp family uses one service facade and thin surfaces. Keep business logic out of transports.
Canonical layout:
src/
<service>.rs # upstream HTTP/API transport only
app/ # business logic, validation, defaults, safety gates
actions.rs # action names, scopes, transport availability, param parsing
config.rs # Config structs, env overrides, dotenv loading
api.rs or api/ # REST handlers, thin over app/service
server.rs # AppState, AuthPolicy, auth layer construction
server/routes.rs # axum router and mounted auth/public routes
mcp.rs # MCP module entry and re-exports only
mcp/tools.rs # parse args -> call service -> return Value
mcp/schemas.rs # single-tool schema, ACTION_SPECS-backed action enum
mcp/rmcp_server.rs # ServerHandler, resources, prompts, scope enforcement
cli.rs # parse CLI -> call service -> format output
main.rs # mode dispatch only
Hard rule: if you are writing business logic in mcp/tools.rs, api.rs, cli.rs, or main.rs, move it into app/. Shims may extract typed inputs, call state.service.*, and format/return the result. They should not own defaults, retries, destructive gates, domain decisions, or custom error wording.
Several repos diverge from the baseline (Lab's dispatch/<service>/ layer, rustarr's descriptor-driven curated commands, cortex's src/mcp/actions.rs registry with Cost metadata, axon's typed direct REST product API). Full per-repo architecture deltas — plus parity, action-dispatch, auth, and testing deltas — are in references/repo-deltas.md. Check that reference (and the target repo's own docs) before assuming the template shape applies.
Business actions must have MCP + CLI parity. Application/platform servers usually also expose REST/API and web UI; upstream-client MCP servers usually do not need a local REST API unless they own state or workflows.
Allowed exceptions:
serve, mcp, doctor, watch, and setup.For a new or changed action, update all relevant surfaces in one pass:
src/actions.rs: ACTION_SPECS, scopes, transport availability, parser enum.src/app/: service method and validation/defaults/safety gate.src/mcp/tools.rs: thin dispatch branch.src/mcp/schemas.rs: one-tool schema and conditional requirements.src/cli.rs: CLI command or flags.help output.Do not assume parity means the same shape in every repo (Lab dotted <resource>.<verb> names, rustarr's split MCP/CLI grammars, axon's REST-deferred local commands, cortex's CLI-only lifecycle mutations) — see "Surface parity deltas" in references/repo-deltas.md.
The rmcp pattern is one MCP tool per server with an action string, not one MCP tool per endpoint. The schema rejects unknown top-level parameters except reserved response continuation fields.
Use ACTION_SPECS in src/actions.rs as the source of truth for:
help being publicExpected action parsing pattern:
let action = ExampleAction::from_mcp_args(&args)?;
match action {
ExampleAction::Help => Ok(json!({ "help": HELP_TEXT })),
other => execute_service_action(&state.service, &other).await,
}
Do not duplicate action strings in unrelated docs without a check. Template repos use contract checks such as cargo xtask contract-audit, schema-doc sync scripts, or just template-check to catch drift.
Patterns that are stale or too narrow (don't keep static HELP_TEXT/action enums when a registry exists, don't assume every action is an enum variant or that metadata lives in root src/actions.rs, don't hand-maintain parallel action lists) — see "Action dispatch / schema deltas" in references/repo-deltas.md.
Use the AuthPolicy model from rmcp-template:
LoopbackDev: loopback or stdio trust boundary; no auth/scope checks.TrustedGatewayUnscoped: upstream gateway enforces auth; local server does not.Mounted { auth_state: None }: static bearer token.Mounted { auth_state: Some(_) }: OAuth plus optional static bearer token.Non-loopback HTTP servers must refuse to start without authentication unless the deployment explicitly sets the trusted-gateway override. Public endpoints such as /health, /status, and /openapi.json stay unauthenticated and must redact secrets.
Scope rules belong in actions.rs and are enforced in the MCP/REST auth paths. Write scope can satisfy read scope where the repo's scopes_satisfy() says so. Unknown actions should map to a deny scope, not accidentally fall through as public.
Repo-specific auth deltas (Lab's ActionSpec.destructive confirmation model, rustarr's confirm_required/mutates, cortex's cortex:read/cortex:admin split and forced /api/* bearer, axon's full-access scope and LoopbackDev admin guard) — see "Auth / scope deltas" in references/repo-deltas.md.
Keep secrets in .env or plugin-generated private config files. Keep non-secret settings in config.toml.
Common split:
.env: API keys, bearer tokens, service URLs, OAuth client secrets, Docker runtime env, RUST_LOG.config.toml: bind host/port, server name, OAuth mode, public URL, allowed origins, retention and resource settings.main.rs should load dotenv before config and then dispatch modes only:
config::load_dotenv();
runtime::init_logging(stdio_mode, serve_mode);
match mode { serve => serve_http_mcp().await, stdio => serve_stdio_mcp().await, cli => run_cli().await }
Do not commit real credentials. Do not print tokens in test output, docs examples, or error messages.
Default verification should prove behavior below the network layer first, then exercise MCP transport when needed.
Use these tiers:
Preferred commands depend on the repo, but the common set is:
cargo check --all-targets --all-features
cargo nextest run
cargo test
cargo xtask contract-audit
just test-ci
bash tests/mcporter/test-mcp.sh
Use sidecar test files (src/foo_tests.rs) when tests need private items:
#[cfg(test)]
#[path = "foo_tests.rs"]
mod tests;
Live tests must assert semantic fields, not just is_error: false. Never include destructive, notification-sending, delete, update, or authorization-mutating actions in default live smoke tests unless the target is disposable and explicitly gated by env.
Repo-specific checks to look for (Lab architecture/catalog lints, rustarr tests/parity.rs, axon http_api_parity_inventory + OpenAPI checks, cortex scripts/smoke-test.sh + /api/* auth invariants) — see "Testing deltas" in references/repo-deltas.md.
Builds rely on host-level Cargo config (~/.cargo/config.toml) — mold/clang, sccache via sccache-wrapper, conservative global jobs = 4 for concurrent agents, LLVM (not Cranelift) dev backend. Keep per-repo .cargo/config.toml minimal; don't shadow global mold flags. For solo builds override with CARGO_BUILD_JOBS=16; use the release-fast profile for portable local/CI builds and full release for published artifacts. Full baseline config.toml, sccache-wrapper rationale, profile definitions, and warm-rebuild benchmarking are in references/build-release.md.
For ACP-specific Rust work, keep the existing ACP rules:
codex-acp.Client.builder(), ByteStreams, .compat()/.compat_write(), and attach_session() in the runtime.send_request_to(Agent, ...); protocol-level initialize uses send_request(...).config_options before attach_session() consumes the NewSessionResponse.0.13.x, provider implementations use #[async_trait::async_trait(?Send)] for the Agent trait.When ACP behavior changes, update the ACP reference docs in this skill and verify against the SDK/codex-acp source, not memory.
Before finishing Rust work, check:
app/, not transports.ACTION_SPECS, schemas, help text, docs, and tests agree.help public only by design.CHANGELOG.md (opens in a new tab)README.md (opens in a new tab)agents/openai.yaml (opens in a new tab)examples/agent-impl.rs (opens in a new tab)examples/client-impl.rs (opens in a new tab)references/build-release.md (opens in a new tab)references/codex-patterns.md (opens in a new tab)references/message-reference.md (opens in a new tab)references/repo-deltas.md (opens in a new tab)references/tool-calls.md (opens in a new tab)references/unstable-features.md (opens in a new tab)references/wire-format.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub dinglebear-ai/dendrite --plugin acp