rdy agent guide v0.51.0

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 after after, the newest earlier dump or increment of this project. CLI: rdy dump --after <earlier> <file>.
  • When nothing is newer, out is null. rdy refuses an out that exists even then, so pick a new path each time.
  • rdy_load and rdy_clone write 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 with E_DUMP_CHAIN.
  • To load part of a chain, pass stop_at (landing:<hash>, tag:<name> or pos:<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_export writes 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, pass assets: a new or empty folder below the folder of out, such as assets. 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, or rdy upgrade. Don't run them yourself.
  • E_STORE_READ_ONLY means 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_BACKUP and E_UPGRADE_FAILED are for the person. On E_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_by names your session.
  • A version that carries an imported accepted or rejected decision shows the fact Imported and 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 out run for 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:

  1. 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.
  2. 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 returns source_digest, files, blocks and unmapped.
  3. Show the report. Tell the person how many files and blocks map, and list the unmapped rows by kind. Ask before you go on.
  4. Import. Call rdy_import again with expected_source set to the preview's source_digest. CLI: --expected-source <digest>. If the source changed after the preview, the import refuses: preview again, and show the new report.
  5. Review what did not map. Each unmapped row 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.
  6. 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.
  7. Read the baseline. The reply holds coverage and onboarding. They start the onboarding that "Onboarding" describes.
  8. Propose the view, with a summary that names the source and its digest. The person approves it.
Table 1
KindWhat it isWhat you do
linkA 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_matterFront 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.
htmlRaw HTML. It stays as text and never runs.Rewrite it in Markdown, or keep it.
imageAn image. rdy imports no attachment.Tell the person which images did not come across.
extensionStrikethrough, a footnote, a task list, an alert, or a table row with more cells than its header.Rewrite it in plain Markdown.
non_markdown_fileA 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/b finds a/b.md, a/b.markdown, a/b/index.md or a/b/index.markdown.
  • Front matter takes only title and doc_type. An unknown doc_type refuses the whole import with E_DOC_TYPE.
  • A .rdyignore file in the source root leaves files out, with the working copy's limits: 65,536 bytes and 1,024 patterns. rdy always leaves out .rdy and .git.
  • Past a limit, the import refuses with E_LIMIT and 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_IO with import 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_error in 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.

Text
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 hash
  • rdy-export.yaml holds only format: 3, pack and scope. pack is the project's pack or one that it extends.
  • A folder is a directory with _folder.yaml: one entry with id, type: folder and order.
  • A doc is <name>.yaml: a list whose first entry is the doc (type: doc), then the blocks inside it. Each later entry needs a parent: 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 name and no parent.
  • An entry takes only id, type, parent, order, fields, body, links and pins. It needs id, type and order. Quote order, as in order: '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 of 0-9 and A-Z, without I, L, O and U. An id that the view holds refuses the import with E_ALREADY_EXISTS.
  • A link targets a block id or a key, in the tree or in the view. rdy ignores pins and 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.

YAML
- 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_at and recorded_at. rdy_decide cannot set decided_at, and an import can.
  • Write a supersede as a supersedes link, and a part supersede as {target, part} with the words that retire. Write a refine as a refines link.
  • A version that carries an imported accepted or rejected status shows the Imported fact, and a person approves it.
  • An import adds no link to a block that the view already holds. Add those links, such as decided_by on 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:

Table 2
PhaseDimensionsWork
structureconnected, completeGroup the docs into folders, give each doc its type and a lead, and tie content to what it is about.
entitiesgroundedDefine terms and values, and accept the right mention suggestions.
decisionsgovernedRecord the decisions behind normative statements, and link the content to them with decided_by.
consistencyconsistent, currentResolve the tensions and suspects that the import showed.
  • Work the phases in order, from the phase that next names. next is null when 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.target in .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, with depends_on links to its findings, as "Reconstructed decisions" in rdy:write says. 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 reason without 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_recommended and an agent's own approval fail with E_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_QUOTES says 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_FAILED warning to the person: the act landed unsigned. Under always, 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-msg hook 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 no Implements: trailer. Install it with rdy_hook {op: "install", kind: "code", repo}, where repo is the name in code_repos. CLI: rdy hook install --kind code --repo <name>, or rdy 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.json that runs after each successful Edit or Write. Install it with rdy_hook {op: "install", kind: "edit", harness: "claude-code"} in the project root, and add worktree for a registered worktree. CLI: rdy hook install --kind edit --harness claude-code [--worktree <name>], or rdy 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 with checked: false is 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: run rdy_brief {code_path} on the changed files. Then cite the specific blocks that the commit carries out in an Implements: trailer, such as Implements: <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: load rdy:write.
  • W_HOOK_UNAVAILABLE: the check could not finish, for the reason in the message, such as deadline. 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 own commit-msg hook, 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-msg launcher in its own shell, and the launcher starts the native rdy.exe. The edit hook's settings entry names rdy.exe and its arguments directly, with no shell.
  • The edit hook sees only Claude Code's successful Edit and Write calls. It does not see a shell command, another tool or another harness. Never tell the person that it watches every file change.

A snapshot of rdy agent guide at v0.51.0.