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
Who's talking about Human-Agent-Society/reef
- @reponews.bsky.social“Human-Agent-Society/reef [Apache License 2.0] 継続学習で自己改善するエージェント基盤です 運用後の伸びが面白いです 言語:Python, TypeScript …”Bluesky · Sep 27, 2026 · 1 likes
- tayyabimam1/awesome-ai-agent-stack“Add Reef to Deployment, Serving & MLOps”GitHub · Oct 5, 2026
- natnew/awesome-agentops“Add Reef to Deployment and Runtime Infrastructure”GitHub · Oct 4, 2026
- PyTorchKR/landscape“[Add] Reef (Human-Agent-Society/reef)”GitHub · Oct 3, 2026
- natnew/awesome-recursive-self-improvement“Add Reef to Frameworks and Implementations”GitHub · Oct 3, 2026
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
- Oct 5, 2026Add Reef to Deployment, Serving & MLOps — tayyabimam1/awesome-ai-agent-stack0 reactions · 1 comment
- Oct 4, 2026Add Reef to Deployment and Runtime Infrastructure — natnew/awesome-agentops0 reactions
- Oct 3, 2026[Add] Reef (Human-Agent-Society/reef) — PyTorchKR/landscape0 reactions
- Oct 3, 2026Add Reef to Frameworks and Implementations — natnew/awesome-recursive-self-improvement0 reactions
- Oct 2, 2026Add Reef to Runtime Foundations & Control Layers — walkinglabs/awesome-harness-engineering0 reactions
11 more on GitHub
- Oct 1, 2026Add Reef to Agent Infrastructure — kaushikb11/awesome-llm-agents0 reactions
- Sep 29, 2026Add Reef to Observability and eval-ops — RyanAlberts/best-of-Agent-Harnesses0 reactions
- Sep 28, 2026Add Reef to Industry updates — yangchou19/Awesome-LLM-Continual-Learning0 reactions
- Sep 27, 2026Add Reef to Skills and instruction management — jimy-r/awesome-agent-workspaces0 reactions · 1 comment
- Sep 26, 2026Add Reef to Open-Source Frameworks & Tools — ballooooooon/awesome-rsi0 reactions
- Sep 25, 2026Reef — エージェントを継続学習させる基盤のビジュアル解説 — 53able/docs-site0 reactions
- Sep 24, 2026docs(non-cc): screenshot-lead research batch 07 (plan 0008 row 20) — qte77/ai-agents-research0 reactions
- Sep 23, 2026feat(client): import records with resumable batch uploads — Human-Agent-Society/reef-client0 reactions
- Sep 9, 2026Add Reef to Projects → useful supporting infrastructure — Liuziyu77/Awesome-RSI0 reactions
- Sep 7, 2026Curate CoSkill, MCE, Reef, and Meta-Harness — YuxingLu613/awesome-agentic-evolution0 reactions
- Sep 4, 2026[Feature Request] Evaluate REEF Multi-Agent Simulation & Consensus Framework (Human-Agent-Society/reef) — KoshiirRa/midgley0 reactions · 3 comments
On Bluesky · 1
- Sep 27, 2026Human-Agent-Society/reef [Apache License 2.0] 継続学習で自己改善するエージェント基盤です 運用後の伸びが面白いです 言語:Python, TypeScript 種類:AI/Other ⭐ Star: +1151 🔀 Fork:… — @reponews.bsky.social1 likes and repost
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.
- recipes/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
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
- Distinctive: line 7
Read CONTRIBUTING.md for project policy.
- Distinctive: line 14
Keep each change focused on the requested problem.
- Very specific: line 15
Before opening an issue or pull request, search existing issues and PRs for overlapping work.
- Distinctive: line 18
Before drafting or updating an issue or RFC, follow Issue and RFC writing.
- Distinctive: line 22
Avoid speculative fixes, unrelated formatting, and unnecessary abstractions.
- Distinctive: line 23
Before submitting a pull request, review every changed line against Python style and design, Code structure and readability, and Naming and …
- Distinctive: line 29
Before submitting a pull request that changes documentation, complete the Documentation review checklist and fix any issues.
- Very specific: line 32
Use .github/PULL_REQUEST_TEMPLATE.md.
- Common: line 36
Keep credentials and private transcripts out of logs, fixtures, and commits.
- Distinctive: line 37
Follow SECURITY.md for vulnerability reporting.
- Very specific: line 62
Keep shared mechanisms in reef/ and method-specific policy in recipes/.
- Very specific: line 65
Keep reef-client a separate, dependency-free protocol client.
- Distinctive: line 67
Keep the base installation usable on CPU.
- Very specific: line 75
Use uv and the repository virtual environment for Python work.
- Very specific: line 104
Follow pyproject.toml: Black and isort format at 119 columns.
- Distinctive: line 107
Prefer focused functions, data classes for values, and cohesive objects for state and lifecycle.
- Very specific: line 109
Do not use typing.Protocol, typing_extensions.Protocol, or runtime_checkable.
- Very specific: line 115
Do not use TYPE_CHECKING. Fix dependency direction or move shared contracts so annotation imports work at runtime.
- Very specific: line 117
Do not model long-lived behavior as Callable constructor arguments, callable-valued fields, or callback containers.
- Very specific: line 120
Do not use assert or del statements in reef/.
- Very specific: line 122
Use descriptive domain names and short comments that explain intent or constraints.
- Very specific: line 125
Do not bypass checks by adding broad suppressions or growing .github/python-design-baseline.txt to accommodate new violations.
- Distinctive: line 138
Use ordinary identifier names: Only functions nested inside other functions should use a leading underscore.
- Distinctive: line 148
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 …
- Very specific: line 152
Describe types explicitly: Do not use Any fields or annotations to bypass pre-commit, mypy, or other checks.
- Very specific: line 159
Make branches complete and shallow: Use explicit else branches when choosing values, assigning variables, or returning alternative results.
- Very specific: line 162
Check types and invalid data early to keep the main path clear and avoid excessive branching or deeply nested if/else blocks.
- Very specific: line 164
Use explicit attributes and interfaces: Do not use getattr, hasattr, or dynamic attribute mutation to guess object capabilities or add …
- Distinctive: line 172
Prefer simple, conventional terminology already used in this repository.
- Distinctive: line 174
Do not introduce abstract or uncommon terminology when a simpler name is sufficient.
- Distinctive: line 184
Prefer concrete alternatives such as:
- Distinctive: line 194
When adding new concepts, reuse existing repository vocabulary before inventing new terminology.
- Distinctive: line 196
Prefer concrete names over metaphors in code, UI text, logs, and documentation:
- Very specific: line 198
Use check for a condition, validation for checking validity, and evaluation for running and scoring tasks instead of gate.
- Very specific: line 200
Use result for an outcome, selection_result for a candidate selection, and review_result for a review instead of verdict.
- Distinctive: line 209
Keep standard technical names such as neural-network gates and third-party identifiers.
- Distinctive: line 225
Every pull request must assess documentation impact.
- Distinctive: line 238
Content placement: Keep each page focused. Put introductory workflows, task instructions, API reference, and developer contracts in their …
- Distinctive: line 257
Accuracy and plain language: Check claims, defaults, names, and examples against the current implementation, tests, or actual runs.
- Distinctive: line 262
Final read-through: Read the complete affected sections, and the whole page when changing its structure.
- Distinctive: line 268
Use these reviewed changes as examples of specific improvements, not as blanket endorsements of every sentence or historical API detail:
- Distinctive: line 284
Start with the smallest existing suite that exercises the changed behavior.
- Very specific: line 304
Use the testing guide and CI configuration to reproduce the needed environment.
- Distinctive: line 319
Before adding a component, read adding-components.rst.
- Very specific: line 330
Keep README.md and README.zh.md synchronized.
- Distinctive: line 334
Update affected API, configuration, and user documentation alongside code.
- Distinctive: line 335
Keep this guide concise and link detailed rules to their owning documents.
≈ “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.
Files
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.mdfor 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.
| Location | Responsibility |
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 inrecipes/. The core must not import cookbook methods;recipes/does not ship in the Reef wheel. - Keep
reef-clienta separate, dependency-free protocol client. Harnesses consumereef_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 installReef 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 runtimeThe 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 checksreef. 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, orruntime_checkable. Define anABCand 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
Callableconstructor 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
assertordelstatements inreef/; 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.txtto 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/exceptblocks 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
Anyfields 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, orweight_dtype; avoid arbitrary abbreviations and vague placeholder names. - Make branches complete and shallow. Use explicit
elsebranches when choosing values, assigning variables, or returning alternative results. Guard clauses that return, raise, or continue early do not needelse. Check types and invalid data early to keep the main path clear and avoid excessive branching or deeply nestedif/elseblocks. - 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
checkfor a condition,validationfor checking validity, andevaluationfor running and scoring tasks instead ofgate. - Use
resultfor an outcome,selection_resultfor a candidate selection, andreview_resultfor a review instead ofverdict. - 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, andnpm run buildfromdocs/site/, matching the docs CI job. - Keep
README.mdandREADME.zh.mdsynchronized. 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 updatedREADME.i18n.yamlwith the change. - Update affected API, configuration, and user documentation alongside code. Keep this guide concise and link detailed rules to their owning documents.
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
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.

