agentleFS
Human-Agent-SocietyHuman-Agent-Society/reef/AGENTS.md

reef

AGENTS.md7.5k starsChanged 3 months agoApache-2.0View on GitHub

These instructions apply to AI-assisted work in Human-Agent-Society/reef. AGENTS.md is the shared source of truth; CLAUDE.md is a relative symlink to this file. Edit this file when updating shared instructions. Read CONTRIBUTING.md for project policy. Follow any more specific AGENTS.md in the area you change. Explicit user instructions take precedence over repository guidance. - Inspect the working tree before editing and preserve existing user changes. Keep each change focused on the requested problem. - Before opening an issue or pull…

  • Installs packages

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 11 mentionsOct 2026: 6 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the Human-Agent-Society/reef repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about Human-Agent-Society/reef

The biggest 5 of 17 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 17

Talked about on GitHub and Bluesky (17 times).

On GitHub · 16

11 more on GitHub
  • 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

Show its rules and text

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

47 rules. About 1 is common, 26 are distinctive, and 20 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈26

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 20

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read CONTRIBUTING.md for project policy.

    line 7
  2. Distinctive:

    Keep each change focused on the requested problem.

    line 14
  3. Very specific:

    Before opening an issue or pull request, search existing issues and PRs for overlapping work.

    line 15
  4. Distinctive:

    Before drafting or updating an issue or RFC, follow Issue and RFC writing.

    line 18
  5. Distinctive:

    Avoid speculative fixes, unrelated formatting, and unnecessary abstractions.

    line 22
  6. Distinctive:

    Before submitting a pull request, review every changed line against Python style and design, Code structure and readability, and Naming and …

    line 23
  7. Distinctive:

    Before submitting a pull request that changes documentation, complete the Documentation review checklist and fix any issues.

    line 29
  8. Very specific:

    Use .github/PULL_REQUEST_TEMPLATE.md.

    line 32
  9. Common:

    Keep credentials and private transcripts out of logs, fixtures, and commits.

    line 36
  10. Distinctive:

    Follow SECURITY.md for vulnerability reporting.

    line 37
  11. Very specific:

    Keep shared mechanisms in reef/ and method-specific policy in recipes/.

    line 62
  12. Very specific:

    Keep reef-client a separate, dependency-free protocol client.

    line 65
  13. Distinctive:

    Keep the base installation usable on CPU.

    line 67
  14. Very specific:

    Use uv and the repository virtual environment for Python work.

    line 75
  15. Very specific:

    Follow pyproject.toml: Black and isort format at 119 columns.

    line 104
  16. Distinctive:

    Prefer focused functions, data classes for values, and cohesive objects for state and lifecycle.

    line 107
  17. Very specific:

    Do not use typing.Protocol, typing_extensions.Protocol, or runtime_checkable.

    line 109
  18. Very specific:

    Do not use TYPE_CHECKING. Fix dependency direction or move shared contracts so annotation imports work at runtime.

    line 115
  19. Very specific:

    Do not model long-lived behavior as Callable constructor arguments, callable-valued fields, or callback containers.

    line 117
  20. Very specific:

    Do not use assert or del statements in reef/.

    line 120
  21. Very specific:

    Use descriptive domain names and short comments that explain intent or constraints.

    line 122
  22. Very specific:

    Do not bypass checks by adding broad suppressions or growing .github/python-design-baseline.txt to accommodate new violations.

    line 125
  23. Distinctive:

    Use ordinary identifier names: Only functions nested inside other functions should use a leading underscore.

    line 138
  24. Distinctive:

    Keep constants with their consumer: If a constant is defined in one module solely to be imported by one other module, define it in the …

    line 148
  25. Very specific:

    Describe types explicitly: Do not use Any fields or annotations to bypass pre-commit, mypy, or other checks.

    line 152
  26. Very specific:

    Make branches complete and shallow: Use explicit else branches when choosing values, assigning variables, or returning alternative results.

    line 159
  27. Very specific:

    Check types and invalid data early to keep the main path clear and avoid excessive branching or deeply nested if/else blocks.

    line 162
  28. Very specific:

    Use explicit attributes and interfaces: Do not use getattr, hasattr, or dynamic attribute mutation to guess object capabilities or add …

    line 164
  29. Distinctive:

    Prefer simple, conventional terminology already used in this repository.

    line 172
  30. Distinctive:

    Do not introduce abstract or uncommon terminology when a simpler name is sufficient.

    line 174
  31. Distinctive:

    Prefer concrete alternatives such as:

    line 184
  32. Distinctive:

    When adding new concepts, reuse existing repository vocabulary before inventing new terminology.

    line 194
  33. Distinctive:

    Prefer concrete names over metaphors in code, UI text, logs, and documentation:

    line 196
  34. Very specific:

    Use check for a condition, validation for checking validity, and evaluation for running and scoring tasks instead of gate.

    line 198
  35. Very specific:

    Use result for an outcome, selection_result for a candidate selection, and review_result for a review instead of verdict.

    line 200
  36. Distinctive:

    Keep standard technical names such as neural-network gates and third-party identifiers.

    line 209
  37. Distinctive:

    Every pull request must assess documentation impact.

    line 225
  38. Distinctive:

    Content placement: Keep each page focused. Put introductory workflows, task instructions, API reference, and developer contracts in their …

    line 238
  39. Distinctive:

    Accuracy and plain language: Check claims, defaults, names, and examples against the current implementation, tests, or actual runs.

    line 257
  40. Distinctive:

    Final read-through: Read the complete affected sections, and the whole page when changing its structure.

    line 262
  41. Distinctive:

    Use these reviewed changes as examples of specific improvements, not as blanket endorsements of every sentence or historical API detail:

    line 268
  42. Distinctive:

    Start with the smallest existing suite that exercises the changed behavior.

    line 284
  43. Very specific:

    Use the testing guide and CI configuration to reproduce the needed environment.

    line 304
  44. Distinctive:

    Before adding a component, read adding-components.rst.

    line 319
  45. Very specific:

    Keep README.md and README.zh.md synchronized.

    line 330
  46. Distinctive:

    Update affected API, configuration, and user documentation alongside code.

    line 334
  47. Distinctive:

    Keep this guide concise and link detailed rules to their owning documents.

    line 335

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

Agent Instructions for Reef

These instructions apply to AI-assisted work in Human-Agent-Society/reef. AGENTS.md is the shared source of truth; CLAUDE.md is a relative symlink to this file. Edit this file when updating shared instructions.

Read CONTRIBUTING.md for project policy. Follow any more specific AGENTS.md in the area you change. Explicit user instructions take precedence over repository guidance.

Contribution workflow

  • Inspect the working tree before editing and preserve existing user changes. Keep each change focused on the requested problem.
  • Before opening an issue or pull request, search existing issues and PRs for overlapping work. Follow the RFC criteria in CONTRIBUTING.md for changes to architecture, public contracts, persistence, or project policy.
  • Before drafting or updating an issue or RFC, follow Issue and RFC writing. Keep the proposal concise; do not expand the design just to fill template sections.
  • Reproduce bugs and inspect the relevant implementation before changing it. Avoid speculative fixes, unrelated formatting, and unnecessary abstractions.
  • Before submitting a pull request, review every changed line against Python style and design, Code structure and readability, and Naming and terminology, and fix any violation. Passing pre-commit does not replace this review; these rules are not all checked mechanically.
  • Before submitting a pull request that changes documentation, complete the Documentation review checklist and fix any issues. Review the resulting sections in context, not only the diff.
  • Use .github/PULL_REQUEST_TEMPLATE.md. Explain the problem, resulting behavior, compatibility impact, and actual verification results. Disclose non-trivial AI assistance. The human contributor remains responsible for reviewing and understanding the change.
  • Keep credentials and private transcripts out of logs, fixtures, and commits. Follow SECURITY.md for vulnerability reporting.

Codebase and boundaries

Reef connects inference, feedback, learning, and versioned delivery for model weights and agent harnesses. The distribution is reef-infra; imports use reef. Use the codebase map and the affected package's __init__.py docstring to find the owner of a change.

LocationResponsibility
reef/core/Shared value types, wire contracts, and errors
reef/dispatcher.py, reef/scenario/Coordination, scenario state, commit ordering, and recovery
reef/service/HTTP, authentication, streaming, and deployment
reef/recipe/, reef/train/Recipe contracts, processors, training, evaluation, and backend integrations
reef/runtime/Backend-neutral runtime contracts, scheduling, and publication coordination
reef/inference/Concrete inference integrations, engine control, and weight reception
reef/surface/Delivery of published artifacts
reef/artifact/Versioned artifacts and repositories
reef/storage/Record storage contracts, persistence, and retention
reef/harness/Harness adapters, rendering, runners, and trajectories
reef/record2dataset/The generator service: a designer prompt for Harbor tasks, the authoring gate and oracle check, task player jobs
recipes/, tutorials/Method implementations, runnable examples, and tutorials
tests/, docs/, docker/Verification, documentation, and deployment environments
  • Keep shared mechanisms in reef/ and method-specific policy in recipes/. The core must not import cookbook methods; recipes/ does not ship in the Reef wheel.
  • Keep reef-client a separate, dependency-free protocol client. Harnesses consume reef_client; they should not need Reef's service or training stack.
  • Keep the base installation usable on CPU. GPU dependencies belong to the supported training environment, and concrete adapters belong under their integration. Declare or pin third-party dependencies instead of copying them.
  • Preserve provider request bodies, scenario isolation, receipt-to-feedback linkage, and artifact publication/recovery contracts.

Development environment

Use uv and the repository virtual environment for Python work. Reuse an existing environment; for a new checkout, the usual setup is:

git submodule update --init --recursive
uv venv --python 3.12
source .venv/bin/activate
uv pip install -e ".[dev]" -e ./third_party/reef-client
pre-commit install

Reef requires Python 3.12 or newer, one interpreter for the service and every child it starts; CI tests 3.12. Git LFS is required for artifact/checkpoint work.

Training-related work may also need:

uv pip install -e ".[slime]"
uv pip install --no-deps --group runtime

The slime extra supplies Python-side adapter dependencies; the runtime group pins Slime itself. Preserve --no-deps so the installation does not replace the container's CUDA-compatible stack. Follow development and docker/README.md for the environment required by the selected backend.

Python style and design

  • Follow pyproject.toml: Black and isort format at 119 columns; Ruff checks code and naming; mypy checks reef. Match nearby code and add types to new or changed interfaces.
  • Prefer focused functions, data classes for values, and cohesive objects for state and lifecycle. Use composition and explicit abstract base classes for behavior.
  • Do not use typing.Protocol, typing_extensions.Protocol, or runtime_checkable. Define an ABC and inherit it explicitly. CI checks all first-party Python files, including tutorials, Docker/docs/CI scripts, and root files, without baseline exceptions. Third-party code, local dependency/build trees, vendored benchmarks, published result programs, and golden fixtures are excluded; see the paths in .github/scripts/check_python_design.py.
  • Do not use TYPE_CHECKING. Fix dependency direction or move shared contracts so annotation imports work at runtime.
  • Do not model long-lived behavior as Callable constructor arguments, callable-valued fields, or callback containers. Use an explicit interface. Keep unavoidable third-party dynamic behavior local to its boundary adapter.
  • Do not use assert or del statements in reef/; use explicit validation, exceptions, and mutation APIs. Test assertions are allowed.
  • Use descriptive domain names and short comments that explain intent or constraints. Follow the Google-style documentation guidance in CONTRIBUTING.md.
  • Do not bypass checks by adding broad suppressions or growing .github/python-design-baseline.txt to accommodate new violations.

Code structure and readability

Apply these rules when writing or reviewing code. The Code Review Style Guide is a reference; the rules here take precedence where it differs.

  • Avoid fragmented functions. Inline tiny helpers used only once or twice when they merely split up a continuous operation. Extract functions for a meaningful responsibility or substantial reuse, not to meet an arbitrary line limit. Keep related logic readable in one place.
  • Use ordinary identifier names. Only functions nested inside other functions should use a leading underscore. Start other variables, fields, constants, module-level functions, and methods with an English letter. Preserve Python-required special names such as __init__.
  • Handle realistic failures. Validate types and data at entry points, then rely on those contracts internally. Keep try/except blocks narrow and catch specific, expected failures only when there is a meaningful recovery or error translation. Do not add speculative fallbacks, repeated checks, or tests for impossible states. Tests should be concise and cover observable behavior and the operation's main failure modes.
  • Keep constants with their consumer. If a constant is defined in one module solely to be imported by one other module, define it in the consuming module instead. Share constants when they have actual shared use; avoid unnecessary imports and separate modules for single-use values.
  • Describe types explicitly. Do not use Any fields or annotations to bypass pre-commit, mypy, or other checks. Model the actual value types and interfaces instead of weakening annotations to silence failures.
  • Name the actual quantity or concept. Variable and function names must express their domain, scientific, or physical meaning. Include units or representation where needed, such as timeout_seconds, token_count, or weight_dtype; avoid arbitrary abbreviations and vague placeholder names.
  • Make branches complete and shallow. Use explicit else branches when choosing values, assigning variables, or returning alternative results. Guard clauses that return, raise, or continue early do not need else. Check types and invalid data early to keep the main path clear and avoid excessive branching or deeply nested if/else blocks.
  • Use explicit attributes and interfaces. Do not use getattr, hasattr, or dynamic attribute mutation to guess object capabilities or add defensive defaults. Replace these patterns in code being changed with typed attributes, direct access, and explicit interfaces; fix the contract instead of probing for attributes at runtime.

Naming and terminology

Prefer simple, conventional terminology already used in this repository.

Do not introduce abstract or uncommon terminology when a simpler name is sufficient. In particular, avoid terms such as:

  • ledger
  • sidecar
  • provenance
  • evidence

unless the term is already established in the codebase or is the standard technical term for the concept.

Prefer concrete alternatives such as:

  • metadata
  • manifest
  • record
  • source information
  • checksum
  • validation result
  • training metadata

When adding new concepts, reuse existing repository vocabulary before inventing new terminology.

Prefer concrete names over metaphors in code, UI text, logs, and documentation:

  • Use check for a condition, validation for checking validity, and evaluation for running and scoring tasks instead of gate.
  • Use result for an outcome, selection_result for a candidate selection, and review_result for a review instead of verdict.
  • Name the actual operation or quantity: evaluation_score, evaluation_tasks, result_html, and "passed the checks" are clearer than metaphorical names.
  • Apply terminology changes to identifiers, serialized keys, producers, consumers, tests, and documentation. New records should use the preferred keys. Preserve older records and callers with targeted fallback reads or API aliases where compatibility is needed; keep those legacy names at the boundary rather than spreading them through new code or displayed labels.
  • Keep standard technical names such as neural-network gates and third-party identifiers.

Documentation review checklist

Apply this checklist to documentation changes in docs/, READMEs, recipes, and tutorials before submitting a pull request. Passing link, terminology, and build checks does not establish readability.

Documentation is user-facing: each page should expose only the interface its intended readers need. That interface varies by audience: workflows and configuration for users, API contracts for callers, and extension contracts or component boundaries for developers. Describe the behavior, guarantees, and constraints readers must rely on. Omit implementation details they do not need to use that interface correctly; moving those details to an advanced page does not by itself make them relevant.

Every pull request must assess documentation impact; this does not require a documentation change. Internal refactors and implementation-only fixes normally need none when existing documentation remains accurate and sufficient. Explain that in the template's Documentation impact section. When documentation changes, state the reader question, updated pages, and actual verification, including anything not verified. Refer to results in Verification rather than duplicating them.

  • Reader and purpose. Identify the question the change answers and make the page's purpose clear near the start. Keep explanations concise while preserving necessary prerequisites, examples, and failure behavior. Update affected workflows, interfaces, and defaults; do not document each PR's implementation details. Keep implementation history and PR commentary in the PR or issue.
  • Content placement. Keep each page focused. Put introductory workflows, task instructions, API reference, and developer contracts in their appropriate pages. Prefer revising existing explanations over appending sections; merge duplicates and remove obsolete text in the affected sections. Add content only for a reader need the existing text does not cover. Explain each concept in its owning page and link to it elsewhere. Update navigation and links when moving content.
  • Reading order. Explain the main workflow and define concepts before relying on them. Introduce the normal path before optional modes, exceptions, and troubleshooting. A reader should not need to understand several internal types before learning what an operation does.
  • Findable details. Organize sections around reader tasks or distinct responsibilities. Separate inputs, outputs, required behavior, and optional configuration. Use lists for parallel items and tables for comparisons; split paragraphs that mix different adapters, modes, or responsibilities.
  • Useful examples. For task instructions, include prerequisites, commands or examples, and the expected result. For interfaces, explain inputs, return values, and relevant failure behavior. Match the detail to the page's purpose rather than forcing every page into one template.
  • Accuracy and plain language. Check claims, defaults, names, and examples against the current implementation, tests, or actual runs. Preserve relevant constraints when simplifying prose. Use concrete descriptions and established terms; remove vague claims and redundant explanations. Optimize for reader understanding rather than minimum word count.
  • Final read-through. Read the complete affected sections, and the whole page when changing its structure. Check transitions, duplication, and consistency with linked pages. Inspect rendered output when changing layout and run the applicable documentation checks. Report actual verification and any unverified examples in the PR.

Use these reviewed changes as examples of specific improvements, not as blanket endorsements of every sentence or historical API detail:

  • @yanxz: #185 and #561: introduce the workflow and its concepts before expanding modes and configuration.
  • @yanxz: #324: separate the core loop from advanced state details and move reference material to the pages that own it.
  • @YihongT: #606 and #607: organize dense method and adapter descriptions by responsibility, with explicit inputs, outputs, and configuration mappings.

Tests and checks

Start with the smallest existing suite that exercises the changed behavior. Extend nearby tests and fixtures; check observable results and failure cases. Public interface changes need contract tests. For training or performance changes, include relevant evaluation or baseline comparisons.

# Focused test example; substitute the suite relevant to the change.
.venv/bin/python -m pytest tests/reef_service/test_reef_artifacts.py -q

# Python checks (activate .venv first for pre-commit's local hooks).
pre-commit run --files path/to/changed_file.py
.venv/bin/python -m mypy

# Full checks before requesting review for Python changes.
pre-commit run --all-files
.venv/bin/python -m pytest tests/

The full suite needs training dependencies even for collection. Some tests skip unavailable optional runtimes; others import Slime and torch directly. Use the testing guide and CI configuration to reproduce the needed environment. CI uses GIT_CONFIG_GLOBAL=/dev/null and GIT_CONFIG_SYSTEM=/dev/null for Git LFS test isolation. Record skipped or unavailable checks honestly.

For full-suite coverage on Python 3.12, use .venv/bin/python -m pytest tests --cov=reef --cov-report=term. The configured coverage floor applies to the whole package, not a focused run.

Pre-commit includes repository-wide Python design, statement, and README pairing checks even when invoked with --files. Review formatter edits and keep unrelated working-tree changes intact.

Area-specific guides and documentation

  • Before adding a component, read adding-components.rst.
  • For recipes and examples, read recipes/AGENTS.md and the method's README. Keep examples self-contained.
  • For harness adapters, read harness-adapters.rst. Golden harness trees under tests/reef_service/data/harness_goldens/ are test fixtures, including their instruction files; preserve exact output.
  • For documentation site changes, read docs/site/AGENTS.md. With Node.js 22, run npm ci, npm run check:docs, npm run lint, and npm run build from docs/site/, matching the docs CI job.
  • Keep README.md and README.zh.md synchronized. After reviewing both, run .venv/bin/python .github/scripts/check_readme_i18n.py --write, then .venv/bin/python .github/scripts/check_readme_i18n.py, and include the updated README.i18n.yaml with the change.
  • Update affected API, configuration, and user documentation alongside code. Keep this guide concise and link detailed rules to their owning documents.

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.