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

reef / recipes

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

Every example is a self-contained Harbor task + Reef harness that run.sh wires together through reef-eval. Copy recipes/basic/ as a starting point; a method's examples live under recipes/<method>/examples/<example>/; it is the minimal valid structure. The example directory is not a Python package. There is no my_example/__init__.py. The harness/ subdirectory is the package, and pyproject.toml declares it: Only examples that do not use reef-eval (for example, a direct reef_client campaign driver) should omit the reef-eval dependency. run.sh installs it into reef-eval's…

  • Reads credentials

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

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

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

  • 7

    Very specific

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

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

    Every example is a self-contained Harbor task + Reef harness that run.sh wires together through reef-eval.

    line 3
  2. Very specific:

    Only examples that do not use reef-eval (for example, a direct reef_client campaign driver) should omit the reef-eval dependency.

    line 49
  3. Very specific:

    When the task verifier's reward is feedback consumed by the scenario's recipe, a background thread watches for Harbor's result.json and …

    line 85
  4. Distinctive:

    Only use this path when the recipe consumes the verifier reward.

    line 98
  5. Very specific:

    Keep shipped Reef configuration in the versioned public layout.

    line 125
  6. Very specific:

    Start reef serve -c <yaml> in the background.

    line 140
  7. Very specific:

    Run reef-eval with --with-editable "$PWD" (installs harness/) and --with reef-client (installs the SDK from PyPI).

    line 143
  8. Very specific:

    If two examples share a pattern (scoring, sandboxing, search), each copies its own copy.

    line 227

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

How to write a new example

Every example is a self-contained Harbor task + Reef harness that run.sh wires together through reef-eval. Copy recipes/basic/ as a starting point; a method's examples live under recipes/<method>/examples/<example>/; it is the minimal valid structure.

Directory layout

my_example/
  harbor/                task definition (consumed by reef-eval/Harbor)
    task.toml             metadata, timeouts, resource limits
    instruction.md        the prompt shown to the model
    environment/
      Dockerfile          container image the verifier runs in
    solution/             optional seed/initial solution files
    tests/
      test.sh             verifier: writes reward to /logs/verifier/reward.txt
  harness/                agent harness (imports reef_client, not reef)
    __init__.py           lazily exports HarborAgent
    agent.py              HarborAgent(BaseAgent) — the agent logic
    report.py             optional: post a trainable verifier reward to Reef
  my_example.yaml         Reef config (recipe, inference, training, HTTP settings)
  run.sh                  starts reef serve, then runs reef-eval with the harness
  pyproject.toml          makes harness/ importable by reef-eval's uvx environment
  README.md               what the example demonstrates and how to run it

No top-level __init__.py

The example directory is not a Python package. There is no my_example/__init__.py. The harness/ subdirectory is the package, and pyproject.toml declares it:

[project]
requires-python = ">=3.12"
dependencies = [
    "reef-client",
    "reef-eval[harbor]",
]

[tool.setuptools.packages.find]
where = ["."]
include = ["harness*"]

Only examples that do not use reef-eval (for example, a direct reef_client campaign driver) should omit the reef-eval dependency.

run.sh installs it into reef-eval's ephemeral environment with --with-editable "$PWD".

harness/__init__.py

Lazily export HarborAgent so importing the harness package does not require the harbor runtime — reef-eval loads it when resolving --agent harness:HarborAgent:

__all__ = ["HarborAgent"]

def __getattr__(name: str):
    if name == "HarborAgent":
        from .agent import HarborAgent
        return HarborAgent
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

harness/agent.py

Subclass harbor.agents.base.BaseAgent. The run() method is the agent logic: call the model through Reef's /v1/chat/completions, write the answer to the path the instruction names, and stash the inference receipt in context.metadata so the reporter can link the verifier reward back to it.

Connection settings come from environment variables set by run.sh:

  • REEF_SERVICE_URL (required)
  • REEF_SCENARIO (required)
  • REEF_TOKEN
  • REEF_TIMEOUT_S

When the task verifier's reward is feedback consumed by the scenario's recipe, a background thread watches for Harbor's result.json and posts it to Reef via harness.report.post_report. See basic/harness/agent.py for the complete pattern. Do not add that reporter when the harness already posts its training feedback and the final Harbor reward is evaluation-only; Harbor keeps that value in the trial result.

harness/report.py (optional)

Extract the verifier reward from Harbor's trial result and post it to Reef as a report that references the trial's inference receipts. The report id is deterministic (uuid5 of the trial id), so a duplicate post is a no-op.

Only use this path when the recipe consumes the verifier reward. A terminal evaluation that is explicitly ineligible for training belongs in Harbor's trial result, not in the training scenario's report contract.

my_example.yaml

Reef service config. The minimal record-only config (no training stack) is:

schema-version: 2
reef:
  host: 127.0.0.1
  port: ${REEF_PORT}
  token: ${REEF_TOKEN}
inference:
  upstream-url: ${REEF_UPSTREAM_URL:?}
  upstream-model: ${REEF_UPSTREAM_MODEL:?}
  upstream-api-key: ${REEF_UPSTREAM_API_KEY}
recipe:
  implementation: recipe
storage:
  agent-record-dir: ${REEF_WORK}/agent-record
  artifact-repository: ${REEF_WORK}/artifacts.git
  artifact-work-dir: ${REEF_WORK}/artifact-work
  artifact-cache-dir: ${REEF_WORK}/artifact-cache

Keep shipped Reef configuration in the versioned public layout. Training examples put native training flags in training.options, engine flags in inference.options, and inference GPU capacity/parallelism in inference.num-gpus and inference.tensor-parallel-size; Reef assembles their worker topology. Do not add service or services to version 2 YAML. HTTP settings belong in reef. Deploy method-owned services independently and pass their endpoints through recipe fields; Reef coordinates only native inference and training. See recipes/openclawrl/examples/openclawrl/docker-compose.yaml for external service startup and GPU isolation. Recipe fields and owned sections go under recipe.config. Docker Compose and third-party task files retain their own schemas. Legacy Reef layouts belong in compatibility tests.

run.sh

  1. Set environment variables (port, token, scenario, work dir); select the deployment recipe in YAML.
  2. Start reef serve -c <yaml> in the background; wait for /healthz. reef serve finds the recipes/ package beside the YAML and puts it on every service's PYTHONPATH; the script does not set it.
  3. Run reef-eval with --with-editable "$PWD" (installs harness/) and --with reef-client (installs the SDK from PyPI).
  4. reef-eval resolves --agent harness:HarborAgent and runs the Harbor task.

See basic/run.sh for the minimal version (60 lines). tttd/run.sh adds model download and GPU stack startup.

harbor/task.toml

Declares the task metadata, timeouts, and resource limits:

version = "1.0"

[metadata]
author_name = "Reef"
difficulty = "easy"
category = "integration"
tags = ["reef", "harbor"]

[verifier]
timeout_sec = 30.0

[agent]
timeout_sec = 300.0

[environment]
build_timeout_sec = 120.0
cpus = 1
memory_mb = 512
storage_mb = 1024
gpus = 0

harbor/instruction.md

The prompt shown to the model. Keep it self-contained: the harness reads it from Harbor's instruction argument and passes it to the model.

harbor/solutions/ (optional)

Seed or initial solution files the harness loads to bootstrap its search. The harness reads them at startup (e.g. to seed a PUCT archive or provide a baseline the model must improve on). Not every task needs this — basic/ has none; tttd/ seeds its archive with empty strings at runtime. The directory is a convention for when the task ships concrete starting points that are too large or too structured to inline in code.

harbor/environment/Dockerfile

The container the verifier runs in. Minimal:

FROM debian:bookworm-slim
WORKDIR /workspace

harbor/tests/test.sh

The verifier script. Harbor runs it inside the environment container after run() returns. Write a float to /logs/verifier/reward.txt:

#!/bin/sh
set -eu
if [ -f /workspace/answer.txt ] && [ "$(cat /workspace/answer.txt)" = "391" ]; then
    echo 1 > /logs/verifier/reward.txt
else
    echo 0 > /logs/verifier/reward.txt
fi

Tests

Unit tests for the harness live in tests/test_<example>_harness.py at the repo root. They import directly from recipes.<method>.examples.<example>.harness.* — the test inserts REPO_ROOT into sys.path so recipes/ is importable and each examples/ directory resolves as a namespace package (each example's harness/ has its own __init__.py, but the example directory itself does not).

Self-containment

Each example must be fully self-contained: no cross-example Python imports. If two examples share a pattern (scoring, sandboxing, search), each copies its own copy. The only shared dependencies are external: reef_client, harbor, and the reef package itself (for reef serve).

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.