agentleFS
Hugging FaceKnown publisherhuggingface/transformers-mlinter/.ai/AGENTS.md

transformers-mlinter

AGENTS.md7 starsChanged 2 months agoApache-2.0View on GitHub

Run make format or make lint and make test before wrapping up a change. - Rule modules live in mlinter/trf*.py. - Rule metadata lives in mlinter/rules.toml. - Rule-specific tests live in tests/test_trfXXX.py, one file per rule. - Shared rule-test helpers live in tests/rule_test_utils.py; rule test classes should inherit from RuleTestCase when they use the standard _run(rule, source, file_name=...) helper. - General CLI, registry, cache, discovery, and public-API tests live in tests/test_mlinter.py. - Skills live under .ai/skills/. - The docs site…

  • 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

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

  • 2

    Very specific

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

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

    Run make format or make lint and make test before wrapping up a change.

    line 9
  2. Distinctive:

    Never hand-edit it, and never commit it.

    line 26
  3. Very specific:

    Only the hand-written pages (index.md, usage.md, suppressing.md, contributing.md, release.md) are committed under docs/.

    line 31

≈ “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

Useful commands

  • make format: auto-fixes style issues with Ruff.
  • make lint: runs Ruff checks and format verification.
  • make test: runs the test suite under tests/.
  • make typecheck: runs ty on mlinter/.
  • make docs: regenerates the rule pages, builds the docs site, and checks internal links.
  • make docs-serve: live preview of the docs site.

Run make format or make lint and make test before wrapping up a change.

Repo structure

  • Rule modules live in mlinter/trf*.py.
  • Rule metadata lives in mlinter/rules.toml.
  • Rule-specific tests live in tests/test_trfXXX.py, one file per rule.
  • Shared rule-test helpers live in tests/rule_test_utils.py; rule test classes should inherit from RuleTestCase when they use the standard _run(rule, source, file_name=...) helper.
  • General CLI, registry, cache, discovery, and public-API tests live in tests/test_mlinter.py.
  • Skills live under .ai/skills/.
  • The docs site source lives in docs/ (Jekyll + just-the-docs), published to https://huggingface.github.io/transformers-mlinter/ by .github/workflows/pages.yml.

Docs site

  • docs/rules/ is generated by scripts/build_docs.py from rules.toml and is git-ignored. Never hand-edit it, and never commit it.
  • Adding a rule to rules.toml therefore documents it: there is no page to write. The description and explanation fields are the published prose, so write them for a contributor reading a failing CI job. The same holds for a deprecated = true tombstone: its description is the whole of the retired rule's page, which the site keeps publishing so an old rule id never 404s.
  • Only the hand-written pages (index.md, usage.md, suppressing.md, contributing.md, release.md) are committed under docs/. docs/rules/, docs/changelog.md (copied from the root CHANGELOG.md) and docs/_data/mlinter.yml (version from pyproject.toml) are all generated.
  • Rule prose may contain code spans; the generator escapes Markdown metacharacters around them, so <Model>Config and modeling_*.py render literally. Don't pre-escape them in the TOML.
  • The Ruby toolchain needs cd docs && bundle install once before make docs works.

Mlinter rules

  • Rules must use static analysis only with Python's ast module.
  • Rule modules must expose check(tree, file_path, source_lines) -> list[Violation].
  • Rule specs use what_it_does, why_bad, and diff; keep examples in a single diff block.
  • Cross-file rules may need to read companion configuration_*.py files from disk.
  • Modular files often inherit from classes imported from another model. If a rule depends on inherited methods or base-class structure, treat an unresolved imported base as inconclusive (usually skip or inspect the generated modeling_*.py) instead of reporting that inherited behavior is absent.

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.