agentleFS
UnknownPlatypusUnknownPlatypus/djangofmt/AGENTS.md

djangofmt

AGENTS.md105 starsChanged 26 days agoMITView on GitHub

djangofmt_syntax sits at the bottom and depends on neither the formatter nor the linter. djangofmt_formatter and djangofmt_lint build on it independently. The djangofmt CLI, wasm and benchmark crates combine them; the CLI holds no formatting or lint logic of its own. Formatter fixes get a fixture in crates/djangofmt/tests/fmt/: the harness formats every fixture twice, so it also catches unstable output. The HTML/Jinja2 parser and formatter that provides the AST, pinned to a git rev of the UnknownPlatypus/markup_fmt fork in the…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,315 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

4 rules. About 0 are common, 1 is distinctive, and 3 are 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.

  • 3

    Very specific

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

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

    Use comments sparingly — only when they explain hidden behavior — and keep them to 1-2 lines.

    line 3
  2. Very specific:

    Every new CLI flag must also be readable from pyproject.toml: add it to PyprojectSettings/LintSettings in pyproject.rs and resolve it with …

    line 5
  3. Distinctive:

    Keep tests lean: one case per behaviour, and a case another case already exercises is deleted.

    line 6
  4. Very specific:

    Keep commit descriptions minimal or empty — write a body only when explicitly asked, or when a skill documents otherwise (e.g.

    line 10

≈ “Common” is an estimate: at least 1 in 5 of the 42,283 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

Conventions

  • Use comments sparingly — only when they explain hidden behavior — and keep them to 1-2 lines. Rule doc comments (## What it does …) are the generated docs and exempt.
  • Core lint and format infrastructure mirrors ruff's design upfront, even before a rule needs it. Peripheral features (editorconfig, ecosystem-check tooling) stay minimal and match a reference tool's scope, not the full spec.
  • Every new CLI flag must also be readable from pyproject.toml: add it to PyprojectSettings/LintSettings in pyproject.rs and resolve it with CLI args taking precedence.
  • Keep tests lean: one case per behaviour, and a case another case already exercises is deleted.
  • Adding or porting a lint rule: follow .agents/skills/add-lint-rule/SKILL.md end to end.
  • Babysitting a PR to green (conflicts, failing CI jobs, review threads, CodSpeed, ecosystem check): follow .agents/skills/babysit-pr/SKILL.md.
  • Branches are squash-merged under the PR title, which becomes the changelog entry, so the PR title carries a conventional-commit type(scope): prefix, e.g. feat(lint):, fix(format):, chore(deps):. Commits get plain descriptive titles, except on a single-commit branch: GitHub reuses that commit's title as the PR title, so it carries the prefix.
  • Keep commit descriptions minimal or empty — write a body only when explicitly asked, or when a skill documents otherwise (e.g. add-lint-rule).

Commands

just                                  # List every recipe (coverage, benchmarks, ecosystem checks, fuzzing, docs)
just pre-mr-check                     # Full pre-merge check: pre-commit, clippy, all tests, docs build
uv run --only-dev cargo insta review  # Accept/reject snapshot mismatches

Architecture

djangofmt_syntax sits at the bottom and depends on neither the formatter nor the linter. djangofmt_formatter and djangofmt_lint build on it independently. The djangofmt CLI, wasm and benchmark crates combine them; the CLI holds no formatting or lint logic of its own.

Formatter fixes get a fixture in crates/djangofmt/tests/fmt/: the harness formats every fixture twice, so it also catches unstable output.

markup_fmt

The HTML/Jinja2 parser and formatter that provides the AST, pinned to a git rev of the UnknownPlatypus/markup_fmt fork in the root Cargo.toml. Fixes to it go in a local checkout of the fork as two branches: one on top of django/baseline, which djangofmt then pins, and a cherry-pick of the same commits on top of g-plane/main for the upstream PR.

To test an unpushed fork commit, point the workspace dependency at { path = "../markup_fmt/markup_fmt" }: [patch] cannot resolve an unpushed rev. Restore the { git, rev } line and Cargo.lock before committing.

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.