mcpls rust-config.instructions.md

Rust project instructions for type-safe configuration, compatibility with the minimum supported Rust version, and dependency choices.

In plain words
What is it for?
Designing configuration enums, testing JSON and TOML defaults and round trips, checking whether the standard library is sufficient, and reviewing new crates for licensing.
Why use it?
They help prevent broken configuration files, accidental format changes, unnecessary dependencies, and unsupported Rust versions.

Instructions file for GitHub Copilot

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.

agentmods
npx agentmods add instructions/bug-ops/mcpls/rust-config
Clone the repo
git clone --depth 1 https://github.com/bug-ops/mcpls

Made for: GitHub Copilot.

Per session 375 This file is loaded in full into every session.
When invoked 375 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00375 $0.00375
Opus 5 $0.00187 $0.00187
Sonnet 5 $0.00075 $0.00075
Haiku 4.5 $0.00038 $0.00038

Measured 2d ago against content hash 58a29e09fa8c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mcpls rust-config.instructions.md 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 2d 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.

.github/instructions/rust-config.instructions.md · 35 lines

What it actually says

Type safety and idiomatic config

Config option enums must derive Default with #[default] on the intended default variant rather than implementing Default manually. This keeps the default co-located with the type definition and is less error-prone.

Boolean config fields that represent a choice between more than two states should be enum, not bool. A bool cannot be extended without a breaking change; an enum can gain variants under #[non_exhaustive].

New #[serde(default)] fields must have a test that deserialises a config with the field omitted and asserts the default value. Cover both JSON and TOML — parsers can behave differently on edge cases like empty strings and absent vs. null keys.

Enum config options must have a round-trip test for every variant. A typo in #[serde(rename_all = "...")] silently changes the on-disk format and breaks existing user configs without a compile error.

MSRV and dependencies

When introducing a new dependency, check whether the functionality is already available in std for the current MSRV. Prefer std over external crates to reduce compile time and supply-chain surface.

New crates require a license check in the same PR. Add the license to deny.toml before merging — cargo deny check licenses fails fast and blocks the pipeline.

If a new stable Rust API (e.g. OnceLock at 1.70 replacing once_cell::sync::OnceCell) makes an existing dependency redundant, suggest removing the dependency and bumping rust-version instead. Document the bump in CHANGELOG.

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. 2d ago First seen · 35 lines · 375 tokens per session scan A 58a29e09fa8c

Subscribe to this mod's changes

mcpls rust-config.instructions.md is an instructions file published in the GitHub repository bug-ops/mcpls (65 stars, last pushed 4d ago), licensed Apache-2.0. It adds 375 tokens to every session, about $0.0019 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.