agentleFS
ostrium-labsostrium-labs/loams-skills/skills/rust-workspace/SKILL.md

rust-workspace

Skill1 starsChanged 38 days agoApache-2.0View on GitHub

Create or extend the company's Rust workspace for Loams services: crate boundaries, edition and toolchain, errors, config, tracing, lints, and tests. Use when starting the Rust rewrite or adding a bounded context.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the starter/ workspace as the shape.

    line 13
  2. Very specific:

    Add workspace lints: unsafe_code = "forbid", unwrap_used = "warn", todo = "warn", dbg_macro = "warn".

    line 50
  3. Distinctive:

    Put config in one typed struct, parsed once from env.

    line 53
  4. Very specific:

    Add tests: pure domain tests, platform tests with a fake, API tests with tower::ServiceExt::oneshot, and an ignored E2E test gated by …

    line 56
  5. Very specific:

    Do not put Loams types in domain.

    line 70
  6. Very specific:

    Do not add unwrap/expect in request paths.

    line 71
  7. Distinctive:

    Do not add a dependency that duplicates one already in the workspace.

    line 72
  8. Very specific:

    Do not use unsafe.

    line 73

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Rust workspace

Use the starter/ workspace as the shape; do not invent a new one per service.

When to use

  • Stage 3, when the pilot starts.
  • A new bounded context needs a crate.
  • A service is being extracted from a monolith.

Inputs

  • company/architecture/target.md.
  • The first bounded context and its API.
  • starter/ and Rust conventions.

Shape

Cargo.toml            # workspace, resolver 3
rust-toolchain.toml   # 1.97.1
crates/domain/        # types, invariants, ports; no I/O
crates/platform/      # Loams client, config, telemetry
crates/api/           # transport + main
tests/                # cross-crate integration

Rules:

  • domain depends on nothing but serde, thiserror, and small pure crates.
  • platform owns the loams client and all I/O.
  • api owns HTTP/Connect/gRPC and maps errors to transport codes.
  • One binary per deployable; keep main.rs thin.

Procedure

  1. Copy starter/ or add a crate to its workspace. Keep one workspace per deployable group, not one per file.
  2. Set edition = "2024", rust-version = "1.97", license = "Apache-2.0".
  3. Add workspace lints: unsafe_code = "forbid", unwrap_used = "warn", todo = "warn", dbg_macro = "warn".
  4. Define errors per crate with thiserror; use anyhow only at the binary edge.
  5. Put config in one typed struct, parsed once from env; fail fast with a clear message. Never log secrets.
  6. Initialize tracing with RUST_LOG and optional OTLP.
  7. Add tests: pure domain tests, platform tests with a fake, API tests with tower::ServiceExt::oneshot, and an ignored E2E test gated by LOAMS_ENDPOINT.
  8. Run cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test.

Outputs

  • Workspace and crate skeletons.
  • docs/rust-conventions.md updates if the company adds a rule.
  • CI job that runs the three commands.

Guardrails

  • Do not put Loams types in domain; keep the domain independent.
  • Do not add unwrap/expect in request paths; map the error.
  • Do not add a dependency that duplicates one already in the workspace.
  • Do not use unsafe.

References

  • Rust conventions
  • Starter
  • Loams Rust SDK

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.