Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/thiagoguislotti/copilot-instructions/rust-code-organizationgit clone --depth 1 https://github.com/ThiagoGuislotti/copilot-instructionsWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.03050 | $0.03050 |
| Opus 5 | $0.01525 | $0.01525 |
| Sonnet 5 | $0.00610 | $0.00610 |
| Haiku 4.5 | $0.00305 | $0.00305 |
Grade A, and why
copilot-instructions rust-code-organization.instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 471 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Rust Code Organization
Core Principles
Mirror src/ structure in tests/ exactly; production code in src/, tests in tests/; no #[cfg(test)] blocks in production; follow Rust module conventions; group related types by functionality - multiple structs/traits per file is idiomatic Rust.
Rule: Test file structure MUST mirror source file structure. Rule: Files are organized by module/functionality, NOT by type. A file named
config.rscan containLinearConfig,BsgsConfig, and related types. Rule: Only split into separate files when a file exceeds ~300-500 lines or when types have distinct responsibilities. Rule:target/is disposable build output and must be kept lean; retain only artifacts needed for the active workspace, target triple, and profile.
Build Artifact Hygiene
- Never treat
target/as durable project state; do not rely on stale artifacts across task changes, branch switches, toolchain updates, or release/debug profile changes. - Clean stale Rust outputs proactively when
target/grows abnormally, when switching workspace context, or before handing work off for validation/release. - Prefer scoped cleanup first when possible:
cargo clean -p <crate>,cargo clean --profile <profile>, or pruning obsoletetarget/<triple>/<profile>folders that are no longer part of the active build. - Use full
cargo cleanwhen the directory is bloated, inconsistent, or shared across incompatible builds/features. - When multiple Rust repositories are active on the same machine, prefer a repository-specific
CARGO_TARGET_DIRto avoid cross-project accumulation and accidental reuse. - Never commit
target/; keep only the outputs required by the current build/test session.
Documentation Standards
Doc comments must be complete and self-explanatory; describe purpose, inputs, outputs, errors, side effects, and invariants; avoid restating identifiers.
- Provide a clear summary sentence for every public item; describe behavior and side effects.
- Document arguments, return values, and error conditions for public functions; include explicit Panics, Errors, and Safety sections when relevant.
- Enable the missing_docs lint with crate-level attribute #![warn(missing_docs)] in the crate root; fix warnings instead of suppressing.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 471 lines · 3,050 tokens per session scan A 79ce169a9548
copilot-instructions rust-code-organization.instructions.md is an instructions file published in the GitHub repository ThiagoGuislotti/copilot-instructions (2 stars, last pushed 2mo ago), licensed MIT. It adds 3,050 tokens to every session, about $0.0153 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
next.js AGENTS.md
Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.