Setup Rust Gitignore
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Create or refresh the root .gitignore of a Rust repository — the command-line tool layout produced by
Setup Rust CLI or any other Cargo crate or workspace. Cargo writes almost everything under one
directory, so the work lies in not ignoring what must stay tracked. An existing .gitignore is never overwritten
without showing a diff and getting approval.
Purpose
iru-setup-rust-gitignore writes a short template: the anchored /target/ directory (which also holds xtask output
under target/dist, rustdoc, cargo-llvm-cov and nextest reports), coverage files written elsewhere (lcov.info,
.profraw, .profdata), rustfmt backups, pending snapshot files, env files (keeping .env.example), the Antora
build output, editor/OS noise and the repository-wide .integration-test.lock/. A cargo-fuzz section is added only when
fuzz/Cargo.toml exists, and a terminal-UI section (.ui-screenshots/, the UI tests' capture directory from the
catalog’s UI contract) when ratatui is a dependency or a root
.ui-quality.yml/.ui-screenshots/ exists.
Cargo.lock is committed (no ignore line) for any package with a binary target. For a library-only workspace the skill
asks (or reads cargo-lock) whether to commit it (recommended) or ignore it. It never ignores rust-toolchain.toml,
.cargo/config.toml, deny.toml, .ui-quality.yml, src/tui/ui_screenshots.rs, the committed images/ui/ copies, golden test files or the generated-but-committed cli-reference.adoc, and it checks
the draft with git check-ignore against those files before proposing it. When .gitignore exists it announces an
update, shows the merged draft as a diff, and asks Update / Keep as is / Replace.
Plugin
Shipped by the iru-rust plugin of the ai-catalog marketplace (install with /plugin install iru-rust@ai-catalog; see Plugins).
Invocation
/iru-setup-rust-gitignore
Optionally with an args block of key: value lines (see below) for scripted runs.
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
|
Asked (commit recommended) |
|
No |
|
Detected from the root |
|
No |
|
|
Any other key forwarded by Setup CLI Repository (such as language, ui or bin-name) is ignored and named in the report.
Outputs
-
A root
.gitignore— created, updated (merged, keeping hand-added lines), replaced with the template, or left untouched when kept as is. -
A report stating whether the run was from scratch or an update, the action taken (created / updated / replaced / kept as is, and whether it came from the user or
on-existing), theCargo.lockdecision with its reasoning, which conditional sections were included or skipped, the result of the safety check, and any already-tracked file under a newly ignored path with thegit rm -r --cachedit needs. -
Explicit warnings: review the file before committing; writing
.gitignorenever untracks committed files (rotate any committed secret); keepCargo.lockcommitted for binaries and regenerate the CLI reference withcargo xtask docsinstead of ignoring it.
Execution flow
Dependencies
Invokes
None — iru-setup-rust-gitignore is a leaf skill; it only reads manifests and config files, runs read-only cargo metadata and git commands, and writes .gitignore.
Invoked by
-
Setup CLI Repository — Step 6, root .gitignore for the
rustlanguage, via theiru-isolated-skill-executoragent.
Also named as a follow-up step by Setup Rust CLI when run standalone.
Source
SKILL.md on GitHub — the file this page was generated from.