orchestrator: Skill for Claude Code

.claude/skills/rust-conventions/SKILL.md

rust-conventions is a skill for Claude Code from c9r-io/orchestrator. It costs 13 tokens per session (843 once invoked), scanned A, original, MIT.

A set of recommended conventions for building Rust services, including project structure, error handling, database access, logging, and testing. Rust is a programming language focused on speed and memory safety.

In plain words
What is it for?
Use it when creating or reviewing Rust services with HTTP, gRPC, databases, asynchronous tasks, caching, and tests that do not require Docker.
Why use it?
It gives a team a shared way to organize service code and handle failures, which reduces inconsistent patterns and makes code easier to test.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is c9r-io/orchestrator's own configuration. It tells Claude Code how to work on orchestrator itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything orchestrator configures →

Reuse

Borrowing it

Nothing to install: this file belongs to c9r-io/orchestrator. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/c9r-io/orchestrator/main/.claude/skills/rust-conventions/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/c9r-io/orchestrator

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rust-conventions

README.md
[![agentmods](https://agentmods.dev/badge/skills/c9r-io/orchestrator/rust-conventions.svg)](https://agentmods.dev/skills/c9r-io/orchestrator/rust-conventions)
Your own site
<a href="https://agentmods.dev/skills/c9r-io/orchestrator/rust-conventions"><img src="https://agentmods.dev/badge/skills/c9r-io/orchestrator/rust-conventions.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 843 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.00843
Opus 5 $0.00006 $0.00421
Sonnet 5 $0.00003 $0.00169
Haiku 4.5 $0.00001 $0.00084

Measured 8d ago against content hash c7754f2bf6e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

rust-conventions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/rust-conventions/SKILL.md · 145 lines

How it starts

The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Rust Conventions

Tech Stack

These are recommended defaults; adjust to your stack.

Component Suggested Library
Web axum (+ tower middleware)
gRPC tonic
Database sqlx
Async tokio
Logging tracing
Testing mockall, wiremock

Code Organization

src/
├── domain/      # Pure models with validation
├── service/     # Business logic (depends on repo traits)
├── repository/  # Data access (mockable traits)
├── api/         # HTTP handlers (thin)
├── grpc/        # gRPC handlers (thin)
└── cache/       # Cache facade + NoOp cache for tests (optional)

Error Handling

// ❌ BAD
let result = db.query().await.ok();

// ✅ GOOD - use Result with context
let result = db.query()
    .await
    .context("Failed to query tenant")?;

// ✅ GOOD - custom error types
#[derive(thiserror::Error, Debug)]
pub enum ServiceError {
    #[error("Tenant not found: {0}")]
    TenantNotFound(Uuid),
    #[error("Database error: {0}")]
    Database(#[from] sqlx::Error),
}

Testing - NO EXTERNAL DEPENDENCIES

All tests run fast (~1-2s) with no Docker:

Component Approach
Repository Mock traits with mockall
Service Unit tests with mock repos
gRPC NoOpCacheManager + mocks
Keycloak wiremock HTTP mocking

Prohibited

  • No testcontainers
  • No real database connections
  • No real Redis connections
  • No faker library

Repository Mock Pattern

#[cfg_attr(test, mockall::automock)]
#[async_trait]
pub trait TenantRepository: Send + Sync {
    async fn create(&self, input: &CreateTenantInput) -> Result<Tenant>;
    async fn find_by_id(&self, id: StringUuid) -> Result<Option<Tenant>>;
}

Service Layer Tests

#[cfg(test)]
mod tests {
    use super::*;
    use crate::repository::tenant::MockTenantRepository;

    #[tokio::test]
    async fn test_create_tenant() {
        let mut mock = MockTenantRepository::new();
        mock.expect_find_by_slug()
            .returning(|_| Ok(None));
        mock.expect_create()
            .returning(|input| Ok(Tenant { name: input.name.clone(), ..Default::default() }));

        let service = TenantService::new(Arc::new(mock), None);
        let result = service.create(input).await;
        assert!(result.is_ok());
    }
}

Read the full file on GitHub · 145 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 145 lines · 13 tokens per session scan A c7754f2bf6e6

Subscribe to this mod's changes

rust-conventions is a skill published in the GitHub repository c9r-io/orchestrator (21 stars, last pushed 6d ago), licensed MIT. It adds 13 tokens to every session and 843 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.