agentleFS
facebookfacebook/pyre-check/AGENTS.md

pyre-check

AGENTS.md7.2k starsChanged 5 years agoMITArchived repositoryView on GitHub

Pyre is Meta's performant type checker for Python (PEP 484 compliant). It includes Pysa, a security-focused static analysis tool for taint analysis. The core engine is written in OCaml (source/), with a Python CLI client (client/). Note: Pyrefly is the next-generation replacement. Assume the user is a Meta internal user by default. If the facebook/ directory is missing from the root of the project, the user is an open source user. All buck and arc commands are only available to…

  • 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 31,439 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.

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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:

    If the file source/dune is missing, this must be a fresh repository clone.

    line 20
  2. Very specific:

    Prefer snake_case for variables/functions, CamelCase for modules/classes

    line 101

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

Guidance for Project Agents

Project Overview

Pyre is Meta's performant type checker for Python (PEP 484 compliant).

It includes Pysa, a security-focused static analysis tool for taint analysis.

The core engine is written in OCaml (source/), with a Python CLI client (client/). Note: Pyrefly is the next-generation replacement.

Build and Test Commands

Detecting Meta Internal vs Open Source

Assume the user is a Meta internal user by default. If the facebook/ directory is missing from the root of the project, the user is an open source user. All buck and arc commands are only available to Meta internal users.

Configure

If the file source/dune is missing, this must be a fresh repository clone. In that case, run the following command:

# For Meta internal users (facebook/ directory exists)
./facebook/scripts/setup.sh --local
# For open source users
./scripts/setup.sh --local

Building the OCaml binary

cd source && make

The built binary is at source/_build/default/main.exe.

Running OCaml tests

# All OCaml tests
cd source && make test

# Specific OCaml test - e.g. analysis/test/integration/methodTest.ml:
cd source && dune exec analysis/test/integration/methodTest.exe

Running Python tests

# For Meta internal users
buck test fbcode//tools/pyre/client/...

Building the Python CLI (Buck)

# For Meta internal users
buck build fbcode//tools/pyre/client:pyre

Linting and Formatting

IMPORTANT: Always run linting and formatting after editing files.

For Meta internal users:

# Formatting
arc f
# Linting
arc lint

Testing against real code

Set PYRE_BINARY to your built binary to override the default:

export PYRE_BINARY=/path/to/source/_build/default/main.exe
pyre -n check  # Use one-off check mode, not the server, when recompiling frequently

Pyrefly Integration

Pyrefly is the default type provider for Pysa tests. The setup script (./facebook/scripts/setup.sh --local) automatically builds the Pyrefly binary and symlinks it to source/pyrefly.exe. After setup, make test uses Pyrefly automatically — no manual steps needed.

To manually rebuild the Pyrefly binary (Meta internal only):

cd source && make pyrefly

To override the Pyrefly binary path (e.g., for a custom build):

cd source && PYREFLY_BINARY=<path-to-binary> make test

Coding Style

  • Avoid abbreviations
  • Prefer snake_case for variables/functions, CamelCase for modules/classes

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.