BuilderOS

agents-md

Keeps the coding agent's environment working: writes or prunes AGENTS.md and CLAUDE.md, and runs retros that turn what slowed a session into pointers, checks or cuts. Use when a repo has no AGENTS.md, one is stale or long, or for a retro.

At a glance

  1. 1Read what exists
  2. 2Sort every existing line
  3. 3Draft the index
  4. 4Draft the homes
  5. 5Show the diff, then write

The skill

AGENTS.md (and CLAUDE.md, which imports it) loads into every session that opens the repository, so every line costs on every turn. Its job is to be an index: point at the material the agent cannot find in one search, give the commands it would otherwise guess, and hold the few rules that must always hold. Everything else lives where it is read on demand. Works on any repository, with or without BuilderOS. The retro mode, invoked by name (retro) or at the end of a build or an outcome review, reads a session and turns what slowed or misled the agent into changes to its environment: follow retro, with its own marker.

What goes where

MaterialHome
Where things are: entry points, the module holding the rules, where tests live, generated filesTECH.md → Map (or a docs/ file the index points at)
Build, test and lint commands an agent would guess wrongAGENTS.md, one line each; on a BuilderOS project TECH.md → Verify, pointed at
Rules that must hold every time (never edit generated files, never deploy without approval)AGENTS.md, each with the check that enforces it when one exists
A mechanical rule (a banned call, an import shape, a file location)A check: lint rule, hook, CI step. AGENTS.md names the check, not the rule
Conventions that need judgmentTECH.md → Conventions, read by the reviewer
Product, domain and decisionsPRODUCT.md, DOMAIN.md, decisions/, pointed at
Host-specific instructions (Claude Code only)CLAUDE.md below its @AGENTS.md import

A pointer is one line: what the material is, and when to read it, with the trigger word first ("Changing an export: read src/export/README.md"). The wording decides whether the agent reaches the material, so sharpen a weak pointer before inlining what it points at.

Procedure

  1. Read what exists. AGENTS.md, CLAUDE.md, README, the manifests and their scripts, the CI workflow, any pre-commit hook, docs/, and on a BuilderOS project TECH.md, DOMAIN.md and the BuilderOS block. Done when you can name the build, test and lint commands, the entry points and every rule already written down.
  2. Sort every existing line into the table above: keep, move (to which home), turn into a check, or cut. A line is cut when it states what the agent does by default, what one look at the repository answers, or what is no longer true (a path that does not exist, a command that fails). Done when every line has a verdict.
  3. Draft the index. Commands, pointers, must-hold rules, in that order, then the BuilderOS block on a BuilderOS project (references/builderos-state-schema.md, Session Start), with the end-of-turn check registered where the host reads project hooks (bos.mjs vendor --hooks). Write each rule as the behavior wanted ("write migrations with the generator in db/"); a prohibition stays only as a hard guardrail, paired with what to do instead. Aim for well under 150 lines. Make CLAUDE.md @AGENTS.md plus Claude-only lines; create it when missing. Done when every kept or new line is a command, a pointer with its trigger word first, or a must-hold rule.
  4. Draft the homes. TECH.md → Map from the repository (on a BuilderOS project; elsewhere a docs/ file or the README section the index points at), and each moved line in its new place. Done when every line marked move in step 2 has a home and every pointer in the index lands on one.
  5. Show the diff, then write. Lines they wrote are moved or cut only with their yes, one round per pressure-testing for the moves and cuts that are not obviously dead; new lines and fixes to dead paths need no question. Done when the files are written and every path they name exists (scripts/bos.mjs gate 5 checks it as 5.11 on a BuilderOS project).

On a BuilderOS project this runs at initialization, at the end of each build (phase 5, step 11) and when a retro or the briefing flags a dead pointer or a file over 150 lines.

Capabilities

CapabilityUsed forFloor if absent
repo.readManifests, CI, entry points, existing steering filesAsk for the commands and the layout; mark the map unverified
files.writeThe index and its homesReturn the full files for the person to apply
shell.execRunning the commands once to confirm they workWrite them as found and say they were not run

Output Contract

## AGENTS.MD UPDATED with the line count before and after, what was moved and where, what became a check, what was cut and why, and the commands confirmed to run.

References

Read only when a step needs them, so they cost no context until then.

Retroreferences/retro.md

A retrospective on the agent's environment, not on the product: what made a session slower or wronger than it needed to be, each turned into a change so the next session does not repeat it. Invoked by name at the end of any session; the build (phase 5, step 11) and the outcome review (phase 7, step 6b) run this same procedure. Adapted from Pocock's retro (MIT).

Procedure

  1. Read the session. The one the person names, otherwise the current one: its transcript where sessions.read resolved, the conversation otherwise, plus what it changed (the diff, the files under .builderos/). Done when you can list the moments the agent searched long, went wrong, was corrected or was blocked.
  2. Read the guardrail and the steering files before proposing anything: the repository's check commands (its build-tool scripts, its CI workflow, its pre-commit hook), AGENTS.md and CLAUDE.md at the root, TECH.md → Verify, Guardrail and Conventions. A check that exists but is unwired or broken is the finding, not a new check. Done when you can say what runs on each commit and what the steering files already ask for.
  3. Find the candidates, category by category, each tied to a moment from step 1:
    • Navigation. The agent took long to find a file or a fact, or missed a hidden dependency between files. The change: a pointer, one line in AGENTS.md or TECH.md naming the file and when to read it.
    • Automated checks. The agent made a mistake a lint rule, a type, a test or a file-layout check would have caught; or the repository has no guardrail at all (no CI job and no pre-commit hook running Verify), which is itself the finding.
    • Conventions for the reviewer. The review missed a mistake. Classify it first: a mechanical one (a fixed pattern, a banned call, an import shape, a file location) becomes a deterministic check, full stop; only a judgment call (consistency across files, matching the surrounding style) goes into TECH.md → Conventions, which the reviewer reads.
    • Steering files. AGENTS.md or CLAUDE.md carries rules a check or a convention should hold instead, or has grown large. These files load into every session: keep them to pointers and the rules that must always hold, and make the change with agents-md.
    • No-ops. An instruction that changed nothing the agent would have done anyway. Cut it.
    • Tool economy. A call that cost far more than its answer (a whole-repo dump, a verbose tool, a repeated search). The change: a narrower command, a script, a pointer to the right file.
    • Information access. A fact the agent needed and could not reach: server logs, a read-only view of a service, an export. The change: the access, or the place where the fact is written down.
    • Process. A gate overridden or failed twice, a spec rewritten after the build plan, a round asked twice, a decision taken without the person. Read scripts/bos.mjs pace where commands run. The change goes to the phase skill or the project's conventions, named. Done when every moment from step 1 has a candidate or a stated reason it needs none.
  4. Present them by severity, most costly first: the moment, the cost (time, a wrong result, a correction), the change, and where it lands. One round per pressure-testing for the changes that touch shared files or CI. Done when the person has picked which changes to make.
  5. Make the chosen changes within what the person authorized. Done when each chosen change exists in the repository (a mechanical rule with its check wired and run once) and is listed.

Capabilities

CapabilityUsed forFloor if absent
sessions.readThe transcript of the session under reviewThe current conversation; name the sessions not read
repo.readCheck commands, CI, steering filesAsk what runs on each commit
files.writeThe pointers, conventions and checksReturn the exact edits for the person to apply
shell.execbos.mjs pace, running a new check onceRead the history in state.json

Output Contract

## RETRO COMPLETE with each candidate (moment, cost, change, where it lands), which ones the person chose, and the changes made. In a lifecycle phase, the build plan or the outcome writes the same list under its **Environment:** line.

Generated from skills/agents-md/SKILL.mdView on GitHub