rust-axum-service

rust-axum-service is a skill for Claude Code, Codex from makifbaysal/tasktrooper. It costs 57 tokens per session (1,457 once invoked), scanned A, original, Apache-2.0.

A set of guidelines for building or changing Rust web services with Axum on Tokio, a Rust web framework and asynchronous runtime. It covers request handlers, typed errors, input conversion, database access, logging, and avoiding blocking work.

In plain words
What is it for?
Use it to build or extend Rust services with Axum or the repository's existing web framework, including HTTP endpoints, SQLx queries, outbound requests, and background work.
Why use it?
It keeps handlers small and business rules independent of the web framework. It also addresses common service problems such as crashes on request paths and blocking an asynchronous runtime.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build or extend Rust services with Axum or the repository's existing web framework, including HTTP endpoints, SQLx queries, outbound requests, and background work.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/makifbaysal/tasktrooper/rust-axum-service
Install

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.

Any agent
npx skills add makifbaysal/tasktrooper --skill rust-axum-service
Clone the repo
git clone --depth 1 https://github.com/makifbaysal/tasktrooper

Made for: Claude Code, Codex.

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-axum-service

README.md
[![agentmods](https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/rust-axum-service/github.svg)](https://agentmods.dev/skills/makifbaysal/tasktrooper/rust-axum-service)
Your own site
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/rust-axum-service"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/rust-axum-service/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rust-axum-service

Your own site · 80×15
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/rust-axum-service"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/rust-axum-service.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,457 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.00057 $0.01457
Opus 5.5 $0.00023 $0.00583
Sonnet 5.5 $0.00011 $0.00291
Haiku 4.5 $0.00006 $0.00146

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

Security

Grade A, and why

rust-axum-service 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 3d 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.

catalog/agents/backend-developer/skills/rust-axum-service/SKILL.md · 79 lines

How it starts

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

Rust Service (axum on tokio)

Overview

Rust moves a class of bugs to compile time, and leaves two to you: panics on a request path and blocking the async runtime. Most of the rules below are about those two.

Core principle: the repository's framework, error crates, database crate and workspace layout win. Handlers stay thin; the domain is plain Rust that compiles without the web framework.

Layers

Layer Responsibility axum surface
Router / handler Extract and validate input, call one service, map the result Router::new().route(...), extractors (State, Path, Json), impl IntoResponse
Service Use-case orchestration and business rules a struct holding its ports, async fn methods
Domain Types and invariants: newtypes whose constructors validate plain structs and enums, thiserror error enum
Adapter Database, outbound HTTP, queues a type implementing the port trait (sqlx, reqwest)

In a workspace the domain is often its own crate; a crate that does not depend on axum cannot leak it.

Patterns

  • Toolchain: rust-toolchain.toml when present; edition from Cargo.toml (2024 for a new crate). Commit Cargo.lock for a binary. Add crates with cargo add, the version from crates.io, not memory.
  • No panics on a request path: no unwrap(), expect(), indexing that can go out of bounds, or as casts that truncate on input-derived values. Use ? with a typed error. expect is for startup invariants with a message that says why it cannot fail.
  • Errors: a domain error enum with thiserror; an application error that implements IntoResponse and maps each variant to 400/404/409 in the repository's problem shape, logging the source of a 500 and never returning it. anyhow belongs in main and scripts, not in a library or a handler's signature.
  • Parse, don't validate: request DTOs #[derive(Deserialize)] (with #[serde(deny_unknown_fields)] where the contract is strict), converted into domain newtypes (TaskTitle::try_from(String)) whose constructors enforce the invariant. A malformed JSON body is already a 4xx through Json's rejection — keep that rejection in the same error shape.
  • State: one AppState (Clone, cheap: Arcs and pools inside) passed with .with_state(state) and taken by State<AppState>; no global mutable statics.
  • Never block the runtime: blocking I/O or CPU-heavy work goes to tokio::task::spawn_blocking; no std::thread::sleep in async code (tokio::time::sleep); never hold a std::sync::Mutex guard across .await — restructure, or use tokio::sync::Mutex when the lock must span an await.
  • Timeouts and limits: tower_http layers — TimeoutLayer, RequestBodyLimitLayer, TraceLayer, CorsLayer configured, not permissive() in production. Outbound reqwest clients built once with a timeout and shared.
  • Database: sqlx with bound parameters (query! / query_as! checked at compile time; keep the offline .sqlx data committed with cargo sqlx prepare when the repository uses offline mode) or the repository's diesel / sea-orm. Never format! a SQL string with input. Migrations with sqlx migrate add <name> (reversible when the repository's are) applied by sqlx::migrate!() or the deploy step; postgres-migrations covers safe DDL.
  • Logging: tracing with structured fields and #[tracing::instrument(skip(state, body))] on handlers and service methods — skip anything secret or large; JSON output from tracing-subscriber where the repository logs JSON.
  • Graceful shutdown: axum::serve(listener, app).with_graceful_shutdown(signal) on SIGTERM / Ctrl-C.
  • unsafe: none in a feature task. If a dependency forces it, say so in a task comment; the security agent reviews every unsafe block.

Read the full file on GitHub · 79 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. 3d ago First seen · 79 lines · 57 tokens per session scan A b7b5f2c1100d

Subscribe to this mod's changes

rust-axum-service is a skill published in the GitHub repository makifbaysal/tasktrooper (117 stars, last pushed yesterday), licensed Apache-2.0. It adds 57 tokens to every session and 1,457 once invoked, about $0.0002 per session on Opus 5.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-10-17.