strictrs is a strict subset of Rust plus a tooling layer that turns the compiler into a deterministic, machine-readable oracle for LLM code generation.
It is not a new language, parser, compiler fork, or standard library. The project keeps Rust syntax and semantics, then adds a constrained coding profile and a closed diagnostic loop for agents.
Rust already provides ownership, exhaustive matching, explicit errors, strong static typing, and machine-readable diagnostics. strictrs focuses on the missing feedback channel: compact, stable diagnostics that an agent can consume in a check → patch → re-check loop.
M0 through M4 are implemented:
- deterministic compiler and Clippy diagnostics in one JSON document;
- stable
strictrs::lint codes and focused source checks; - conservative
MachineApplicablefix iteration; - a deterministic
strictrs new <name>project generator; - a committed lockfile, Rust 1.97.1 toolchain, strict lint policy, and size-oriented MUSL release profile in every generated project;
- an exact-pinned
proptestscaffold for agent-authored invariants, shrinking, and regression persistence; - portable agent-skill installation for detected Codex and Claude Code clients.
Install the binary from a local checkout:
cargo install --path .Or install the current main branch directly from GitHub:
cargo install --git https://github.com/ilvar/strictrsThe repository and generated projects pin Rust 1.97.1. Ensure Cargo's binary directory is on PATH—normally $HOME/.cargo/bin.
After installing the binary, register the bundled portable skill with detected local agents:
strictrs install-skillsThe command detects Codex through the codex executable or the ~/.codex/~/.agents directories and installs:
~/.agents/skills/strictrs/SKILL.md
It detects Claude Code through the claude executable or ~/.claude and installs:
~/.claude/skills/strictrs/SKILL.md
The operation is idempotent. It accepts an identical existing skill but refuses to overwrite a modified file. Remove a customized copy explicitly before reinstalling the bundled version. cargo install itself does not modify agent configuration or home-directory files.
Print the complete embedded instructions for a coding agent:
strictrs --helpCheck a Cargo project:
strictrs check path/to/projectApply compiler-supplied mechanical fixes and re-check until the loop stops:
strictrs fix path/to/projectCreate a footprint-locked project in the current directory:
strictrs new hello-strictrsInstall the portable skill for detected local agents:
strictrs install-skillsFor backward compatibility, a bare path is treated as check:
strictrs path/to/projectOperational commands emit exactly one final JSON report to stdout. --help is the only plain-text stdout mode. Reports exit with status 0 only on success, status 1 when diagnostics remain, and status 2 for invocation or operational failures. Human-oriented failures and skill-installation notices are written to stderr.
strictrs new <name> creates these deterministic files:
.cargo/config.toml.dockerignore.github/workflows/ci.yml.gitignore.pre-commit-config.yamlAGENTS.mdCLAUDE.mdCargo.lockCargo.tomlDockerfileMakefileREADME.mdrust-toolchain.tomlscripts/bump_version.pyscripts/commit.shsrc/main.rstests/properties.rs
The generated project pins Rust 1.97.1 and the x86_64-unknown-linux-musl target. Its manifest contains the footprint profile:
[profile.release]
opt-level = "z"
lto = true
codegen-units = 1
panic = "abort"
strip = trueGenerated projects have no runtime dependencies. The property-test scaffold uses an exact-pinned proptest dev dependency with default features disabled and only std enabled. The committed lockfile pins its transitive test dependencies without changing the release binary.
Alongside the crate, new scaffolds a development workflow that mirrors the strict gate: a .pre-commit-config.yaml, a Makefile, a reusable GitHub Actions workflow (.github/workflows/ci.yml: fmt, clippy, test, strictrs check, shellcheck, and a Docker image build + smoke test), a multi-stage Dockerfile, AGENTS.md/CLAUDE.md, and scripts/ (commit.sh, bump_version.py). Image publishing is intentionally omitted — add a workflow for your own registry.
The generated small-release command uses stable Rust and the prebuilt MUSL standard library:
cargo release-smallMeasured stable release size: 377,400 bytes for the generated hello-world binary targeting x86_64-unknown-linux-musl in GitHub Actions. CI enforces a 400,000-byte ceiling and publishes the exact byte count as the template-size artifact.
tests/properties.rs is the handoff point between the coding agent and the runtime:
- the agent states invariants over generated inputs;
proptestexercises those invariants across many cases;- failures are shrunk to a minimal reproducer;
- persisted regressions remain ordinary test inputs.
Run the complete generated-project test suite:
cargo test --lockedRun only the property suite:
cargo test --locked --test propertiesThe generated property is deliberately small and domain-neutral. Replace it with invariants about the actual program rather than duplicating the implementation inside the test.
| Stable code | Banned construct | Preferred alternative |
|---|---|---|
strictrs::no_unsafe |
unsafe |
safe Rust APIs |
strictrs::no_panic_api |
unwrap, expect, indexing outside tests |
Result, Option, checked access |
strictrs::no_catchall_arm |
_ => when matching a locally defined enum |
explicit variants |
strictrs::no_as_cast |
numeric as casts |
TryFrom with handled errors |
strictrs::no_glob_import |
glob imports | explicit imports |
strictrs::no_mutable_global |
static mut |
explicitly owned state |
strictrs::explicit_return_type |
omitted return type on public functions | explicit -> () or value type |
strictrs::must_handle |
unused must_use values |
handle or explicitly discard |
strictrs::capability_boundary |
filesystem/network/process calls outside boundaries | isolated capability module |
Because strictrs::explicit_return_type requires a public unit-returning
function to spell out -> (), clippy::unused_unit — which argues against
that -> () — is never reported, and generated projects set it to allow so
the same code passes cargo clippy -- -D warnings. Without that, one of the
two rules would fire whichever way the function is written.
The repository pins Rust 1.97.1 in rust-toolchain.toml. Required checks:
cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets --all-featuresFixtures live under fixtures/. Changes to the diagnostic schema, ordering, generated project contents, embedded agent help, or bundled skill are public-contract changes and must update their focused tests intentionally.
See AGENTS.md for repository-specific implementation rules.
- M0: deterministic compiler diagnostic oracle — complete
- M1: strict-subset lint pass — complete
- M2: mechanical fix loop with no-progress detection — complete
- M3: footprint-locked project template — complete
- M4: property-testing integration — complete
New syntax, a custom parser, a rustc fork, and macro-based language extensions are explicit non-goals.