blob: a77c7ced9aef796c657d891b9051aee517224e5b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
---
name: rust-bootstrap
description: Bootstrap or retrofit industrial-grade Rust linting and Rust style inheritance by using the `rust_starter` repo as the source of truth. Use when Codex needs to set up strict Rust lint/check posture from scratch in a new repo, ratchet an existing Rust repo toward manifest-owned lint policy, or install the canonical Rust style doctrine link into a target AGENTS.md.
---
# Rust Bootstrap
Read [AGENTS.md](/home/main/programming/projects/rust_starter/AGENTS.md) first.
Read [docs/rust-style-doctrine.md](/home/main/programming/projects/rust_starter/docs/rust-style-doctrine.md)
before making Rust style decisions or writing target `AGENTS.md` guidance.
Then choose exactly one surface.
## Fresh Bootstrap
Use this when the target repo is blank or when you are setting up Rust linting from scratch.
If the target directory is empty and is not already inside a Git worktree, run
`git init` before applying the template.
Read:
- [docs/bootstrap-fresh.md](/home/main/programming/projects/rust_starter/docs/bootstrap-fresh.md)
- [docs/rust-style-doctrine.md](/home/main/programming/projects/rust_starter/docs/rust-style-doctrine.md)
- [template/fresh](/home/main/programming/projects/rust_starter/template/fresh)
Apply the template deliberately:
- replace placeholder members and names
- replace the placeholder Cargo target-dir slug in `.cargo/config.toml`
- use the latest system Rust toolchain; never choose or copy a hardcoded Rust version from the starter
- if the target records `rust-version`, derive it from the active system `rustc --version`
- keep repo-wide policy in root `Cargo.toml`
- keep Cargo target-dir policy in project-local `.cargo/config.toml`, not runner flags
- keep `clippy.toml` tiny or delete it
- keep runners thin and orchestration-only
- create or adapt target `AGENTS.md` so it links to the canonical Rust style doctrine
## Retrofit
Use this when the target repo already has Rust linting or check scripts and needs tightening.
Read:
- [docs/bootstrap-retrofit.md](/home/main/programming/projects/rust_starter/docs/bootstrap-retrofit.md)
- [template/fresh](/home/main/programming/projects/rust_starter/template/fresh)
- [docs/rust-linting-proposal.md](/home/main/programming/projects/rust_starter/docs/rust-linting-proposal.md)
- [docs/rust-style-doctrine.md](/home/main/programming/projects/rust_starter/docs/rust-style-doctrine.md)
Retrofit is diff-aware ratchet work:
- do not paste the fresh template wholesale
- preserve stricter local policy
- preserve justified local exceptions
- use the latest system Rust toolchain unless the target repo has an explicit external MSRV constraint
- move duplicated script or CI flags into manifest-owned policy
- delete duplicate policy copies only after the manifest is authoritative
- add or preserve a target `AGENTS.md` link to the canonical Rust style doctrine
- add or preserve project-local `.cargo/config.toml` for `/data/main/cargo-target/<project-slug>` without touching user-global Cargo config
## Guardrails
- Re-open the repo docs when details matter; do not rely on memory.
- Never infer a Rust version from these docs or templates; inspect the active system toolchain.
- Install style inheritance through target `AGENTS.md`; do not assume future agents will remember this skill.
- Install Cargo target-dir posture through target `.cargo/config.toml`; do not rely on wrappers or mutate global Cargo config.
- Use [docs/rust-linting-proposal.md](/home/main/programming/projects/rust_starter/docs/rust-linting-proposal.md) for rationale, not as a paste target.
- If a target repo already exceeds the template in some area, keep the stricter local posture.
- If a target repo intentionally diverges, adapt the pattern instead of forcing uniformity.
This skill is intentionally thin. The repo docs are the real payload.
|