Rust config
Greenfield Rust configuration workflow for typed settings, environment variables, config files, CLI overrides, defaults, validation, precedence rules, secret redaction, and test isolation.From its SKILL.md
npx -y skills add nyquistwilder/personal-pi --skill rust-configAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.8 KB, 328 tokens by cl100k_base, as published. Nobody here has run it
Rust Config
Rule
Configuration must be explicit, typed, validated, and testable. Keep loading separate from business logic and pass typed config into services.
Hard Stops
Ask before:
- Changing precedence, variable names, defaults, file locations, or compatibility contracts.
- Reading global machine files, user home config, real secrets, or production env by default.
- Adding config libraries for simple env/CLI needs.
- Logging config that may contain secrets.
Defaults
- Prefer Clap/env/std parsing for simple apps.
- Use typed structs with
serdewhen files are needed. - Use
figmentorconfigonly for layered config from files/env/CLI and only when approved or already present. - Define precedence explicitly, commonly: defaults < config file < environment < CLI.
- Validate once at startup and fail fast with actionable errors.
- Use
secrecy/redaction wrappers for secret values when they may be logged or debugged.
Workflow
- Define settings, defaults, required values, validation, and precedence.
- Implement loaders that accept explicit sources for tests.
- Avoid reading env/files inside domain logic.
- Add tests for defaults, overrides, precedence, validation errors, and redaction.
- Run tests and
just check.
Antipatterns
- Global mutable config.
- Hidden environment reads deep in libraries.
.envloading in production paths without policy.- Printing full config structs with secrets.
Completion
Report config contract, precedence, secret handling, dependencies, tests, and validation results.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.