agentleFS
MicrosoftKnown publishermicrosoft/ox-tools/AGENTS.md

ox-tools

AGENTS.md19 starsChanged 3 months agoMITView on GitHub

Code in this repository should follow the guidelines specified in the Microsoft Rust Guidelines. The spell checker dictionary is in the .spelling file, one word per line in arbitrary order. Do not manually edit CHANGELOG.md files. Changelogs are automatically updated on release. Each crate's design is captured under crates/<crate>/docs/, kept in lockstep with the code (as pioneered by cargo-anvil and cargo-coverage-gate). Design is the contract; code is the realization. This is prospective, not a retroactive invariant: new crates land with…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not manually edit CHANGELOG.md files.

    line 11
  2. Distinctive:

    When you implement a change in a crate:

    line 50

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AI Agents Guidelines

Code in this repository should follow the guidelines specified in the Microsoft Rust Guidelines.

Spelling

The spell checker dictionary is in the .spelling file, one word per line in arbitrary order.

Changelogs

Do not manually edit CHANGELOG.md files. Changelogs are automatically updated on release.

Design Docs Are Part of the Source

Each crate's design is captured under crates/<crate>/docs/, kept in lockstep with the code (as pioneered by cargo-anvil and cargo-coverage-gate). Design is the contract; code is the realization.

This is prospective, not a retroactive invariant: new crates land with a design doc (see New features and new crates), and pre-existing crates without one (e.g. automation, cargo-heather, cargo_ensure_no_cyclic_deps) are brought into compliance opportunistically when substantially changed — not in a single sweep.

Layout

  • docs/design/README.md — the top-level conceptual design: the problem, guiding principles, and the user-visible shape (UX, inputs/outputs, exit-code semantics, configuration, CI integration, cross-cutting concerns, out-of-scope). Named README.md so it renders as the docs/design/ landing page on GitHub and ADO. For larger crates, split detail into companion docs (e.g. docs/design/<topic>.md) linked from it.

Optionally, a crate may keep implementation plans under docs/implementation-plans/NNNN.md (rolling, zero-padded) to sequence large multi-commit efforts. They are never required — skip them for small crates or self-contained changes.

Why they exist

  1. Review aid — a human or AI reviewer can validate the solution end-to-end without reading every file.
  2. AI-friendly evolution — future agentic changes start from a current, accurate spec instead of reverse-engineering intent, which lowers the cost of every later review/refactor pass.

Rules for changes

When you implement a change in a crate:

  • If an externally observable contract changes (behavior, UX, exit codes, config shape, output format, public API), update that crate's design doc in the same change.
  • If the change is purely internal (refactor with no contract delta, dependency bump, test-only), no doc update is required — but fix any design drift you notice opportunistically.

Don't reference design docs from code

Design docs are a review and evolution aid, not a stable API. Do not cite design sections from rustdoc, code comments, or other source (e.g. "see design §6.5"): it couples the code to the doc's structure and blocks reorganizing the design without churning source. References flow one way — design docs may point at code, not the reverse. Link between design docs freely.

The codebase is mid-migration to this rule: some existing rustdoc (notably under crates/cargo-anvil/src/) still carries section-anchored references (§N). Remove those anchors opportunistically when you touch nearby code — there is no need for a dedicated sweep.

New features and new crates

  • A new user-facing feature starts with a design-doc update (or a new companion doc) before or alongside the implementation.
  • A new crate lands with at least docs/design/README.md. Add a crate-level AGENTS.md only if the crate has rules beyond this root file (e.g. extra CI gates); it need not restate the shared policy.

Don't delete the design docs

The design docs — and any implementation plans — are intentional, persistent artifacts. Don't remove docs/ to "clean up" — keeping them in sync is far cheaper than regenerating that context on every review or extension.

Maintainability

While it is fine to use .expect(), the precondition is that it is either a programming error (the caller did something wrong) or a situation that can never happen (in the absence of bugs). The expect-message must document either what the caller did wrong in their code or why we believe the situation could never happen.

This is bad code: self_span.get(self_offset..).expect("self_offset out of bounds") - it does not explain what the caller did wrong and it does not explain why we believe this access can never be out of bounds.

This is good code: self_span.get(self_offset..).expect("guarded by min() above to never exceed span length") - this explains why we believe the operation can never cause an out of bounds access.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.