Agent guide
Project operations
Load this ruleset when you dump, load, import, redact, sign or upgrade.
Dumps and moving a project
rdy_dump {out}writes the whole project, with every relay's evidence, to one new file. It is unsigned, and as private as the store.rdy_dump {out, after}writes an increment afterafter, the newest earlier dump or increment of this project. CLI:rdy dump --after <earlier> <file>.- When nothing is newer,
outis null. rdy refuses anoutthat exists even then, so pick a new path each time. rdy_loadandrdy_clonewrite only into a directory with no store.- To load a chain, pass the increments in order:
rdy_load {file, dir, then: [...]}. CLI:rdy load <file> <dir> --then <inc>, once for each increment. A wrong order fails withE_DUMP_CHAIN. - To load part of a chain, pass
stop_at(landing:<hash>,tag:<name>orpos:<segment>.<offset>). CLI:--stop-at. - A stop before a content removal still loads, with
W_STOP_BEFORE_REDACTION: the removed content is back in that store. Tell the person. Never propose the removal again yourself. - Every later rdy reads every released dump format. rdy 0.35.0 writes dump format 4. It carries a feature store.
rdy_exportwrites local files for people. It is not a publication. Relay its warnings, and read the project through the tools.
rdy_export {out, format: "md", layout: "single", profile}writes the one doc that the profile selects as one Markdown file, such as a README. When the doc has a figure, passassets: a new or empty folder below the folder ofout, such asassets. A ref outside the file is written as its label, with a warning. Relay it.
The store
Upgrades. A store has a format and a list of features. When a newer rdy needs an upgrade step, it runs the upgrade as it opens the store, and keeps a backup beside the store. rdy upgrade runs the same upgrade.
rdy_upgrade {dry_run: true}reports the upgrade without writes, and the last upgrade receipt.- On
E_STORE_FORMAT, give the person the fix from the error. It names the rdy to use, a dump and load, orrdy upgrade. Don't run them yourself. E_STORE_READ_ONLYmeans this rdy can only read the store. Tell the person which rdy build the refusal names.E_UPGRADE_MOVED: the store changed after the upgrade was planned. Run the dry run again.E_UPGRADE_BACKUPandE_UPGRADE_FAILEDare for the person. OnE_UPGRADE_FAILED, rdy never restores the backup itself: the person stops the daemon and restores it. Give them the message, which names the backup.
Compaction. rdy_compact frees the disk space of content that a redaction removed. It changes no content and no log position, so a writer session may run it. Run it with dry_run: true first, and show the person the report. CLI: rdy compact --dry-run.
Followers. A host can keep a read-only follower of a store. Every write to a follower fails with E_STORE_FOLLOWER. Write through the source store instead.
Imports
rdy_import {dir, view} reads a format-3 export tree into a view, in a writer session. It never writes into canon. CLI: rdy import <dir> --view <view>.
- Each change keeps its source author, and
imported_bynames your session. - A version that carries an imported accepted or rejected decision shows the fact
Importedand always needs a person. - Handing a view to another owner is the person's act. Relay it on their word:
rdy_view {op: "own", view, owner: {actor, run?}, evidence, question}. Leave outrunfor an owner with no run. CLI:rdy view own <view> <actor> --run <run>.
Markdown migration
rdy_import with md: true reads a folder of Markdown files into a view. It maps the structure and infers nothing: no decision, status, author or relation. Do these steps in order:
- Copy the source. Work on a private copy of the Markdown folder. rdy never changes the source, and a change while it reads refuses the import.
- Preview. Call
rdy_import {dir, view, md: true, dry_run: true}. CLI:rdy import <dir> --view <view> --md --dry-run. A preview writes nothing and creates no view. It returnssource_digest,files,blocksandunmapped. - Show the report. Tell the person how many files and blocks map, and list the
unmappedrows by kind. Ask before you go on. - Import. Call
rdy_importagain withexpected_sourceset to the preview'ssource_digest. CLI:--expected-source <digest>. If the source changed after the preview, the import refuses: preview again, and show the new report. - Review what did not map. Each
unmappedrow names a path and a line. Its source text stays in the doc as literal text. Act on each row, as the table below says. - Review provenance. Every new block names your session as its author and importer, and the import keeps no source history. Tell the person so. The original files and their history stay the record of who wrote what.
- Read the baseline. The reply holds
coverageandonboarding. They start the onboarding that "Onboarding" describes. - Propose the view, with a summary that names the source and its digest. The person approves it.
| Kind | What it is | What you do |
|---|---|---|
link | A local link that finds no single Markdown file in the source, or that leads outside it. The link stays as its source text. | Find the target in the view and write the ref, or tell the person. |
front_matter | Front matter with a key other than title and doc_type, a bad value, or YAML that does not parse. It stays as a yaml code block, and the title comes from the first heading or the file name. | Move each value that matters into the doc, then remove the code block. |
html | Raw HTML. It stays as text and never runs. | Rewrite it in Markdown, or keep it. |
image | An image. rdy imports no attachment. | Tell the person which images did not come across. |
extension | Strikethrough, a footnote, a task list, an alert, or a table row with more cells than its header. | Rewrite it in plain Markdown. |
non_markdown_file | A file that is not Markdown, with line 0. rdy never opens it. | Tell the person. The file stays only in the source. |
- A heading becomes a section. A paragraph or a list becomes prose, a fenced block becomes code, and a table becomes a table block.
- A link that starts with
/resolves from the source root, as a relative link does./a/bfindsa/b.md,a/b.markdown,a/b/index.mdora/b/index.markdown. - Front matter takes only
titleanddoc_type. An unknowndoc_typerefuses the whole import withE_DOC_TYPE. - A
.rdyignorefile in the source root leaves files out, with the working copy's limits: 65,536 bytes and 1,024 patterns. rdy always leaves out.rdyand.git. - Past a limit, the import refuses with
E_LIMITand names the limit. Split the source into smaller folders. - To import a source again, use a fresh view. A second import into the same view refuses with
E_PATH_CLASH.
When an import fails. An import is all or nothing. A refusal leaves no change in the project and creates no view.
E_IOwithimport outcome is indeterminate: rdy could not prove the rollback, and refuses more writes. Give the person the fix. After the project reopens, read the target view before you retry, because the import may be there in full.- When the connection breaks before the reply, the outcome is unknown, not failed. Read the view before you run the import again.
coverage_errorin a reply means that the import stands and only the coverage read failed. Do not import again.
Import trees
rdy_import {dir, view} without md reads a format-3 tree. Write one when the import must carry what Markdown cannot: your own ids, decisions with their statuses and dates, and the source's authors and times. No command writes an example tree, so write it from these rules. A tree import has no preview: dry_run needs md: true.
staging/
rdy-export.yaml format: 3, pack: <the project's pack>, scope: <any text>
authors.yaml optional: who wrote each block, and when
docs/
billing/ a folder
_folder.yaml the folder's entry
rulings.yaml a doc file: the doc, then the blocks inside it
blobs/ optional: asset files, each named by its hashrdy-export.yamlholds onlyformat: 3,packandscope.packis the project's pack or one that it extends.- A folder is a directory with
_folder.yaml: one entry withid,type: folderandorder. - A doc is
<name>.yaml: a list whose first entry is the doc (type: doc), then the blocks inside it. Each later entry needs aparent: the doc's id, or a block inside it in the same file. - The file or directory name is the block's name. A doc or folder entry takes no
nameand noparent. - An entry takes only
id,type,parent,order,fields,body,linksandpins. It needsid,typeandorder. Quoteorder, as inorder: 'a1'.rdy_schema {block_type}gives each type's fields. - Give every block a new id of your own, with its type's prefix: such as
D-K7Q2M. After the dash come five characters of0-9andA-Z, withoutI,L,OandU. An id that the view holds refuses the import withE_ALREADY_EXISTS. - A link targets a block id or a key, in the tree or in the view. rdy ignores
pinsand computes every pin again. - The tree's top-level folders and docs land at the project root. Move them afterwards if they belong elsewhere.
Decisions in a tree. A tree holds only new folders, new docs and the blocks inside those docs. It cannot add a block to a doc that the view holds, or hold a block outside a doc. So a decision in a tree sits in a new doc of the tree. Ask the person which doc that is before you write the tree.
- id: d-K7Q2M
type: doc
order: 'a1'
fields: {title: Billing rulings, doc_type: overview}
- id: D-K7Q2N
type: decision
parent: d-K7Q2M
order: 'a2'
fields:
statement: Refunds take 14 days.
status: accepted
authority_basis: recorded_ruling
attested_by: the founder, 2026-10-03, design/billing.md:42
decided_at: '2026-10-03'
recorded_at: '2026-10-04T09:12:00Z'- A decision entry takes the decision's fields, such as
statement,status,authority_basis,attested_by,decided_atandrecorded_at.rdy_decidecannot setdecided_at, and an import can. - Write a supersede as a
supersedeslink, and a part supersede as{target, part}with the words that retire. Write a refine as arefineslink. - A version that carries an imported
acceptedorrejectedstatus shows theImportedfact, and a person approves it. - An import adds no link to a block that the view already holds. Add those links, such as
decided_byon content, in a later write in the same view.
Source authors. authors.yaml is a list of rows {id, actor, run, role, at_ms}, one for each block. actor is in rdy's actor form, role is reader, writer, reviewer or approver, and at_ms is the time in milliseconds since 1970.
- rdy writes one change for each actor, oldest first. Every change names your session in
imported_by. A block with no row goes into your own change. - Name a source author only when the source records who wrote the block. The person who ruled a decision is its decider, not its author: name them in
attested_by. - Never invent an author, a time, a signature or an approval. An import carries no signature, and a past approval never replays: a person approves the landing.
- With no
authors.yaml, every block is yours.
Onboarding
An import ends with the project's coverage and an onboarding path. rdy_coverage shows the same path at any time, as onboarding: {target, score, done, next, phases}. Each phase aims at some coverage dimensions:
| Phase | Dimensions | Work |
|---|---|---|
structure | connected, complete | Group the docs into folders, give each doc its type and a lead, and tie content to what it is about. |
entities | grounded | Define terms and values, and accept the right mention suggestions. |
decisions | governed | Record the decisions behind normative statements, and link the content to them with decided_by. |
consistency | consistent, current | Resolve the tensions and suspects that the import showed. |
- Work the phases in order, from the phase that
nextnames.nextisnullwhen onboarding is done. - Work one phase in one view, and propose it. The person approves each phase.
- A phase is done when its score reaches
target:coverage.targetin.rdy.yaml, 80 by default. - rdy lists the issues, and you judge each connection. Link only what a block is about.
- rdy shows the coverage now. It keeps no record of progress over time.
Decisions recovered from code
When the person asks you to recover the design of existing code or a running system:
- Work one area in one view, and propose it.
- Read the code, and record what it shows as findings. Quote the code with its path in
evidence. - Record each decision that the code shows as
reconstructed, withdepends_onlinks to its findings, as "Reconstructed decisions" inrdy:writesays. Name what you are not sure of. - Write the docs that describe the area, and link them to the decisions with
decided_by. - Leave every reconstructed decision proposed. The person confirms or rejects each one. rdy runs no inference, and no authority policy accepts them.
Redaction
Before proposing content removal, call rdy_redact with dry_run true. Show its report and warnings. Record the request, then use rdy_propose and rdy_pending. Only a person can approve it.
These details apply too:
- Write the
reasonwithout the content itself: rdy keeps it as audit text. - Show every warning in the dry run report. For the class
secret, tell the person to rotate the secret. - A removal lands only with the person's answer on its own card.
all_recommendedand an agent's own approval fail withE_REDACTION_HUMAN. - On
E_REDACTION_STALE, run the dry run again and show the new report. - A redaction cannot erase dumps, exports, renders, clones or other copies outside the store. Say so.
W_REDACTION_QUOTESsays what stays: review citations, answer notes and change-plan versions that quote the content, among others. Pass it on.- On
W_STOP_BEFORE_REDACTION, tell the person. Never record a removal again on your own.
Signing
Signing goes through the SSH agent, and rdy never reads a private key. Leave the signing.* settings to the person.
- Relay a
W_SIGNING_FAILEDwarning to the person: the act landed unsigned. Underalways, rdy refuses the act instead. - After the person fixes signing,
rdy_sign {target}signs your relay. - Sign with the person's key (
kind: "approval"or"tag") only when they ask. - A signature shows that a key signed, not that the person read the act. Never claim more.
Local hooks
rdy has two optional local hooks. Each one only warns: it never refuses a commit or an edit, and it never approves, proposes or lands. Install or remove a hook only when the person asks.
- The code hook is Git's
commit-msghook in the checkout of a linked code repo. It warns when a commit touches a file that earlier commits tied to a decision, and the message has noImplements:trailer. Install it withrdy_hook {op: "install", kind: "code", repo}, whererepois the name incode_repos. CLI:rdy hook install --kind code --repo <name>, orrdy setup --code-hook <name>. - The edit hook warns when an agent edits rdy working-copy files directly. Its one adapter is Claude Code: an entry in
.claude/settings.local.jsonthat runs after each successfulEditorWrite. Install it withrdy_hook {op: "install", kind: "edit", harness: "claude-code"}in the project root, and addworktreefor a registered worktree. CLI:rdy hook install --kind edit --harness claude-code [--worktree <name>], orrdy setup --edit-hook claude-code. op: "remove"with the same fields removes only what rdy installed. CLI:rdy hook remove.- Install and remove need a writer session on the machine that holds the checkout. Any session may run
op: "check". A result withchecked: falseis incomplete, not clean.
Git prints the code hook's warnings in the commit's output. Claude Code gives you the edit hook's warnings as extra context after the tool call. Act on each warning as follows:
W_HOOK_NO_CITATION: runrdy_brief {code_path}on the changed files. Then cite the specific blocks that the commit carries out in anImplements:trailer, such asImplements: <id>, <id>. Amend a commit that you have not pushed; else tell the person.W_HOOK_DIRECT_EDIT: the edit stands, and rdy did not record it. Tell the person which files you changed, so they can keep or undo the edit. Then make your change through rdy's tools: loadrdy:write.W_HOOK_UNAVAILABLE: the check could not finish, for the reason in the message, such asdeadline. The commit or the edit stands. Continue your work, and tell the person if the warning comes again.W_HOOK_CONFLICT: an install or remove left a file as it was, and rdy overwrote nothing. Causes include a person's owncommit-msghook, unreadable settings and a hooks folder outside the repository. Give the person the path and the reason, and do not change the file yourself.
- On Windows, Git for Windows runs the
commit-msglauncher in its own shell, and the launcher starts the nativerdy.exe. The edit hook's settings entry namesrdy.exeand its arguments directly, with no shell. - The edit hook sees only Claude Code's successful
EditandWritecalls. It does not see a shell command, another tool or another harness. Never tell the person that it watches every file change.