swarm repositories / source
aboutsummaryrefslogtreecommitdiff
path: root/skills/rust-bootstrap/SKILL.md
blob: e29e1c6b4d80b8754a893441d753bfe4d3333fd3 (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
---
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.

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, names, and version/toolchain values
- replace the placeholder Cargo target-dir slug in `.cargo/config.toml`
- 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
- 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.
- 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.