Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/pedromneto97/custom-skills/rust-hexagonalnpx skills add pedromneto97/custom-skills --skill rust-hexagonalgit clone --depth 1 https://github.com/pedromneto97/custom-skillsWrote 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.
[](https://agentmods.dev/skills/pedromneto97/custom-skills/rust-hexagonal)<a href="https://agentmods.dev/skills/pedromneto97/custom-skills/rust-hexagonal"><img src="https://agentmods.dev/badge/skills/pedromneto97/custom-skills/rust-hexagonal.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00071 | $0.02447 |
| Opus 5 | $0.00036 | $0.01223 |
| Sonnet 5 | $0.00014 | $0.00489 |
| Haiku 4.5 | $0.00007 | $0.00245 |
Grade A, and why
rust-hexagonal 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 6d 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.
How it starts
The opening of the file, as written. The whole thing — 194 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Hexagonal Architecture for Rust Backends
Overview
Hexagonal Architecture (Ports & Adapters) isolates the domain from all external concerns. Nothing in domain or use cases ever imports an infrastructure crate.
Call flow (always this direction):
[ HTTP / CLI / gRPC ] → inbound → use case fns(ports...) → domain → port traits → outbound → [ DB / APIs / cache / email ]
Dependencies point inward only (enforced via Cargo.toml):
app → inbound ─┐
├→ domain (model + errors + ports + use cases)
app → outbound ─┘
Typical workspace shape is four crates + one binary:
domain— entities, value objects, errors, ports, use cases.inbound— HTTP/gRPC/CLI adapters; depend only ondomain.outbound— DB/API/cache/email adapters; depend only ondomain.migration(ormigrations) — schema migrations only.app— binary; the only crate that knows all concrete types.
Is this still hexagonal? Yes. The invariant holds: domain/use cases never depend on infrastructure.
Merge use cases into domain, or keep a separate application crate?
| Layout A — merge (recommended) | Layout B — separate application |
|
|---|---|---|
| Crate count | 4 | 5 |
domain deps |
may include tokio |
stays fully dep-free |
| Best for | most projects | shared domain across multiple services or publishing domain as a lib |
async-traitrule: With Rust ≥ 1.75 and static dispatch, nativeasync fnin traits is sufficient — noasync-traitneeded. Only add it if you explicitly needdyn Traitobject safety.
Companion Skills
Load these skills when working on the corresponding layers:
| Layer | Skill | Covers |
|---|---|---|
| Inbound (HTTP) | http-actix-axum |
REST naming, status codes, RFC 9457 Problem Details, CORS, OWASP security headers, compression, versioning |
| Outbound (DB) | sea-orm |
Migrations, entity generation, CRUD, relations, pagination, on-conflict, SeaORM v2 macros |
What ships with it
8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 6d ago First seen · 194 lines · 71 tokens per session scan A 959bfc6ece13
rust-hexagonal is a skill published in the GitHub repository pedromneto97/custom-skills (2 stars, last pushed 2mo ago), licensed MIT. It adds 71 tokens to every session and 2,447 once invoked, about $0.0004 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-31.
Other skills, from other repositories
rust-programming-expert
Expert-level skill for Rust programming (Rust 2024 / v1.85+). Covers memory safety, async, Axum/SQLx, CLI, and optimization in English and Indonesian.
rust-systems
Rust patterns for CLI tools, backend services, and general application code. Use when working with Rust, Cargo workspaces, axum/tokio services, clap CLIs, async concurrency, or configuring clippy, rustfmt, cargo-nextest, or Cargo.toml.
rust-backend
Rust coding guidelines for the Windmill backend. MUST use when writing or modifying Rust code in the backend directory.
azure-eventhub-rust
Azure Event Hubs library for Rust. Send and receive events for streaming data ingestion and batch processing. Triggers: "event hubs rust", "ProducerClient rust", "ConsumerClient rust", "send event rust", "streaming rust", "eventhub rust".
new
Create a new project to start development quickly.
aspnet-core
Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on current .NET. USE FOR: working on ASP.NET Core apps, services, or middleware; changing auth, routing, configuration, hosting, or deployment behavior; deciding…