rdy agent guide v0.57.0

Agent guide

Write and change content

Load this ruleset when you create or change content, structure, decisions or links.

Using this guide

rdy delivers this guide through rdy_instructions. No file needs saving, and you download nothing. rdy setup writes three lines at the top of CLAUDE.md and AGENTS.md in the project root, and they tell an agent to call rdy_instructions. It also creates the person's meta project if none exists. Outside a project, and in the meta project, it writes no stub.

It is for an agent that works on an rdy project for a person. rdy computes. You write. The person decides.

From Release 1, a tool, parameter, result field, code or config key changes only with an upgrade path in the same release. A renamed name keeps working, with a warning, for two minor releases and at least 30 days. Message and fix texts can change in any release, so match the code, never the text. After an update, read rdy_schema again.

Agent instructions

At the start of every task, call rdy_session with your own actor and run, or state rdy/actor and rdy/run in _meta. Then call rdy_instructions. It returns every required rule in full, and a menu of the other rulesets. The bootstrap is rdy's one required built-in ruleset, and the rest of this guide is on the menu. CLI: rdy instructions. Until a call succeeds, rdy_overview and rdy_brief carry a reminder.

  • A menu entry is {id, name, when, layer, required, tokens, hints}. Read name and when, then load the rulesets that your task needs with rdy_instructions {load: [ids]}. rdy never picks for you, and hints are only hints.
  • Use the menu's id: rdy:<name>, project:<doc-id> or person:<doc-id>. rdy:<name> loads a built-in ruleset only, so a bare name such as write does not load one. A bare doc id that both layers hold fails with E_BAD_INPUT: use the layer-qualified id. An id that is not in the menu fails with E_NOT_FOUND.
  • To get every built-in ruleset whole, pass full: true. CLI: rdy instructions --full. Required rules of every layer still arrive. Stored optional rulesets still need load.
  • Each rule names its layer. The built-in rdy rules come first, then the project's, then the person's. When a person's rule and a project rule disagree, follow the person's. The built-in approval rule holds over both.
  • Follow the rules for the whole task. "Required" means that rdy always delivers the rule, not that rdy enforces it.
  • rdy gives only landed rules. A rule in a view or an open proposal is not in force yet.
  • A refused call gives no rules, never part of them. Do what its fix says, then call again. E_VALIDATION reads <layer> source: <first issue>. E_LIMIT names the bound that the call passed.
  • With no meta project, the person layer is empty, and hint names rdy setup, which creates one. Tell the person when it finishes.

Writing a rule. When the person states a rule, save it with one rdy_rule call, from any session: rdy_rule {scope, op: "add", text: "<the rule>", why: "<one line>", evidence: "<the person's exact words>"}. CLI: rdy rule add. If the person answered your question, pass that question as question. To change a rule, use op: "edit" with its id. To retire one, use op: "remove" with its id, and no text.

  • Scope. person is the person's meta project, for their preferences and their rules for all work. project is this project, for a rule specific to it. Ask the person only when you are unsure.
  • Evidence. Pass the person's exact words, never your own. Use rdy_rule only for a rule that the person stated. A subagent never relays, so a subagent never calls rdy_rule. rdy cannot check either rule.
  • Wording. When your text goes beyond the person's words, show it to the person before the call. After each landing, tell the person where the rule went and show all the saved wording, from rule.text: Saved to your own rules, for all your projects: "<rule>". If the place or the wording is wrong, the person says so, and you correct it the same way.
  • Default place. With no ruleset, the rule goes in My rules or Project rules. rdy creates these docs on first use, with required: true. With no applies_to, the selector is all.
  • Rules for some work. A required doc delivers every rule in it, so a narrower selector there is only a hint. It shows in the menu's hints, and the rule still arrives on every task. For a rule meant only for some work, pass ruleset with a named ruleset that is not required, and a narrower applies_to. A rule with all arrives on every task, wherever it is. Tell the person the ruleset's name. rdy_rule does not create a named ruleset (E_NOT_FOUND). Create it by the normal path below.
  • Stops. The reply can stop before the rule lands:
    • state: "card": the policy has rules_from_chat: card. Show the card as it is. Then relay the answer: rdy_rule {scope, answer: {ref, option, card_hash, evidence, question}}.
    • state: "not_ready": read issues, then finish the open proposal ref by the normal path. For scope: "person", use a session on the meta project.
    • corrected.state: "normal_path": the change touches stable content (E_BRIEF_REQUIRED), or the rule's decision governs other blocks (E_BAD_INPUT). Brief corrected.blocks and use the normal path.
    • E_NO_PROJECT: do what its fix says. With no meta project, the fix is run rdy setup.

Writing a rule by the normal path. Use this path for the stops above and for a named ruleset. For a rule that you inferred or want to suggest, ask the person first, or use this path and show the card. Record the rule as an instruction block under a doc or section, with a decided_by link to the decision that is its reason: {"op":"create","type":"instruction","parent":"<doc>","body":"<the rule>","fields":{"applies_to":["all"]},"links":{"decided_by":[{"target":"D-…"}]}}. Read rdy_schema {block_type: "instruction"} for its fields. CLI: rdy new instruction.

  • A selector is all, area:<name>, type:<block type> or act:<act>. A rule with all, or any rule in a doc with required: true, is required.
  • A named ruleset is a doc that holds instruction blocks. Leave required off. Its lead paragraph becomes the menu's when, so say there when to load it.
  • The person's own rules go in their meta project, ~/.rdy/meta by default. Outside an rdy project, rdy mcp serves it.
  • Propose the rule like any change. It is in force after it lands.
  • Pass on W_INSTRUCTION_SELECTOR: the area: selector names an area that the pack lacks, so it matches nothing yet.

Ground rules

  • The person talks to you in chat. You do the work through the rdy MCP tools, and you relay the person's decisions.
  • Don't ask the person to run routine rdy commands. The CLI is a fallback.
  • Use the tools only. Never edit files under .rdy/, the working copy, an export or the rendered site.
  • When you run the rdy CLI, set RDY_ACTOR to your own agent: actor on every call. Never run it as the person.
  • Never claim a human: actor. An agent session with one fails with E_PERMISSION. Relay the person's words instead.
  • When a command fails with E_BAD_INPUT because the configured actor is outside the actor form, tell the person. The fix names the file. Don't edit it yourself.
  • Never approve, tag or answer on your own judgment. Every one of those acts relays the person's own words.
  • rdy refuses a tag from an agent session unless it relays the person's words. See "Approvals and relays" in the rdy:approvals ruleset.
  • When an error says a store is open or locked, read the code. E_LOCKED means another process holds the store: stop that process or use the daemon. E_HELD_BY_READER means an earlier read state in this process holds it: release that state and try again.
  • "No suspects" means no stale pins. It does not mean that the content is correct.

Structure first

When you start a project or a new area, plan the tree first: folders by area, a doc type for each doc, decisions recorded with rdy_decide and no parent, open questions as question blocks and terms in the glossary; show the person the plan before the first content write.

A flat list of pages is the most common failure. These details make the plan work:

  • Create a folder with {"op":"create","type":"folder","fields":{"name":"billing","title":"Billing","description":"…"}}. Don't use a name prefix such as billing-overview in place of a folder.
  • A doc or folder name uses only A-Z, a-z, 0-9, ., _ and -. A name that reads as a block id fails with E_BAD_NAME. For d- and fd- ids, rdy ignores case. The refusal carries a fixed name in corrected.
  • Give every folder a one-sentence description, and open every doc with a plain lead paragraph.
  • Use the page doc type only when no other type fits. One topic per doc: split a long doc into sections, not into sibling docs.
  • A question's prompt states the product question and its options. Put your own advice in chat.
  • Close a question with a decision that has an answers link to it. Never write the answer into the question.
  • Define each term as a term block in the doc that explains it. The site's glossary page collects them.
  • To fix a flat project, create the folders, then move each doc with a move op. A move keeps block ids and history.

Show the person the plan as a tree, as in this example. A doc then moves before any content exists.

Text
billing/          folder: How customers pay and get refunds.
  overview        doc, type overview
  invoices        doc, type components
  refund-flow     doc, type flows
  limits          doc, type constraints
  • Put each term in the doc that explains it, beside the content that uses it. Never create a doc only for terms.
  • A decision needs no content doc. rdy_decide with no parent puts it in the decision home, and content links to it with decided_by.
  • Only decision, question, finding and source blocks may sit at the project root or directly in a folder. Every other block goes in a doc. A pack's own supporting type keeps the parent rule that its pack gives.

The loop, for every change

  1. Start. Call rdy_session with your own agent: actor, a run named for the task, and role writer. Keep the run name when you resume. See "Actors and runs" in rdy:troubleshoot for the form of each. Then call rdy_instructions, as "Agent instructions" says.
  2. Brief. Call rdy_brief on the blocks you will change, or on a doc with path. To brief one section, pass <doc>#<heading-slug>. To create a block, brief its parent. Read governs: "Decisions and their links" says what to check when you change a block's text.
  3. Write. Pass the briefing's base.token string as brief, not the whole briefing. An E_BRIEF_REQUIRED or E_BRIEF_STALE reply carries a fresh briefing: retry with its base.token.
  4. Answer the consequences of each write, as "What each consequence asks" in rdy:after-write says. Brief again before each follow-up write.
  5. Check. After your last write, run rdy_suspects and rdy_tensions with scope set to your view. Clear what your changes caused.
  6. Plan. Read rdy_plan for your view. Close or answer each item, as "Change plans" in rdy:after-write says.
  7. Propose. Call rdy_propose with a plain-words title and a summary. A version without a summary gets no card: rdy_pending lists it under not_ready.
  8. Land or ask. When ready is false, fix each issue and propose again. When policy.verdict is accepts, land with rdy_land. Otherwise relay the card, as "Approvals and relays" in rdy:approvals says.

Propose once per iteration, at the break that propose.cadence sets. Propose again only when the view changed since the last version.

To see what your view changes before you propose, call rdy_diff {from: "view:<run>"}. See "Reading changes" in the rdy:read ruleset.

  • Brief before editing (rdy_brief); writes to stable content must cite a briefing (brief: <token>).
  • Before editing a block, read it with format markdown or yaml: compact lines are a summary.
  • Work in your own view; include others' changes, never write into their views.
  • When a block comes back as a consequence a second time in a session, do not rewrite it again: confirm it (repin) or ask the person, and show what remains as a change plan.

Briefing a new decision. rdy_decide, rdy_supersede and rdy_revoke each create a decision under a parent. The parent is the doc, section or folder in parent. When you leave parent out, it is the project's decision home, or the project root when the project names none. rdy_schema names the decision home.

  • Brief that parent. A briefing of the old decision does not cover it.
  • rdy_decide and rdy_revoke take the token as brief. rdy_supersede takes it inside decision, as decision.brief.
  • The E_BRIEF_REQUIRED refusal names the parent, as <id> (the parent of the new decision). It carries a fresh briefing: retry with its token.
  • rdy_decide takes its own parameters. It has no message and no supersedes. To supersede, use rdy_supersede.
  • When the person states something that should hold, record it at once with rdy_decide as a proposed decision, in their words, and say so in one line.
  • A decision is worth recording when every agent should keep to it next month; a passing preference is not.
  • Record a decision with rdy_decide and no parent: it goes to the decision home, or to the project root when the project names none; link content to it with decided_by, and never put a decision in a content doc or create a doc to hold decisions.
  • When a change retires only some of a decision's rules, supersede that part (rdy_supersede with part), not the whole decision.
  • While coding, a change within the design is just code; a gap is a proposed decision plus the doc update; a contradiction is a finding plus a superseding decision, and you stop when it is blocking or one_way.

Reconstructed decisions. A decision that you infer from existing code or a running system, and that nobody ruled, is reconstructed.

  • First record what you read as a finding. Quote the code with its path and lines, or the system's output, in evidence.
  • Then call rdy_decide with authority_basis: "reconstructed" and a depends_on link to the finding. Say in body what you are not sure of, and why.
  • Keep it proposed. No authority policy can accept it, so it lands only when a person approves. It keeps the basis after that.
  • Only a direct_ruling is precedent for agents. When you find a reconstructed decision, cite it, and ask the person before you act on it.

Revising a decision

Revise a decision when the person changes its rule, its reason or its scope. Other content and code rest on it, so do these steps in order:

  1. Brief. Call rdy_brief on the decision. Count the blocks in dependents, and read each one that the change can touch.
  2. Choose the act from the table below. When you cannot tell which row applies, ask the person.
  3. Write the one change. For a new decision, brief its parent, as "Briefing a new decision" says.
  4. Repair the links. After a supersede, move each citing block's decided_by and implements links to the new decision. Send the full list for each link kind that you name.
  5. Answer the consequences, as rdy:after-write says. A refine or a part supersede gives confirm entries: check each block, and edit only a block that no longer holds.
  6. Propose. Read rdy_plan and close each item. Then call rdy_propose with a summary that names the old decision, the act and the reason.
Table 1
When the decisionActCall
still holds, and a change only made it suspectre-affirm ita reaffirm op in rdy_write
keeps every rule, and gains a condition, a limit or a new reasonrefine itrdy_decide with refines
loses some of its rules, and the rest still holdsupersede that partrdy_supersede with part
no longer holds, and a new decision replaces itsupersede itrdy_supersede
no longer holds, and nothing replaces itrevoke itrdy_revoke

Examples:

  • A decision says "Invoices use the customer's currency." The person adds that an invoice with no currency uses euros. No rule retires, so refine it.
  • A decision says "Refunds take 14 days, and they go back to the card." The person now allows a refund to a balance. The 14-day rule still holds, so supersede only the part "they go back to the card".

Adjustments while you code

While you code, sort each change to the design into one of three cases before you continue. Never change the design silently.

Table 2
CaseHow you knowWhat you doExample
Within the designThe design covers the change, or leaves it as an implementation detail.Write the code. Cite the blocks in the commit's Implements: trailer.The spec lists the line items of an invoice. You keep them in a vector.
Fills a gapThe design is silent, and every agent should keep to your choice next month.Record a proposed decision with rdy_decide. Keep coding, and update the doc in the same view.The spec does not say how to round tax. You round half to even, and every invoice must agree.
Contradicts the designThe code cannot keep to a decision, as a test or the system shows.Record a finding with evidence. Propose a superseding decision that depends on it.The spec says that refunds go back to the card. The payment provider refunds only to a balance.

For a contradiction:

  • Record the finding with rdy_write, type finding, as "Sources, findings and code" in rdy:as-built says. Quote the failing test, the error or the code, with its path.
  • Supersede the decision with rdy_supersede, and give the new decision a depends_on link to the finding. Its change plan lists what to update.
  • Stop and ask the person when the contradiction blocks the work or the decision is one_way.
  • Otherwise keep coding. Commits cite the proposed decision, and that code stays provisional until the person rules. A rejection flags those files for rework.

Content cited from a linked project

  • Content cited from a linked project is read-only here. A write that edits, moves, deletes, supersedes, refines or revokes it is refused with E_FOREIGN_READ_ONLY.
  • Write a citation as {{<alias>:<id>}}. The alias must name a repo link, and the block must be in what that link delivers.
  • To depart from a cited decision or instruction, propose a decision with deviates_from: ["<alias>:<id>"]. A person confirms it. A locked organization or team instruction refuses it with E_INSTRUCTION_LOCKED: add an instruction on top of it instead.
  • A delivery moves no pin. When it changes a cited block, an adopt card in rdy_pending asks the person to adopt the new version or keep theirs. Relay the person's answer, as for any card.
  • When the home project delivers back a copy of a local decision, supersede the local one with rdy_supersede {old, adopted_as: "<alias>:<id>"}. A person approves the landing.
  • A repo link widens what governs the project, so a person approves it. The authority policy never accepts it.

Grounded measures how well content ties to what it is about. It checks mentions only on normative blocks, such as requirements, constraints and claims.

  • Tie each content block to what it is about. A block with no tie gets the check untied_content.
  • Link each entity that a normative block names. An unlinked mention there counts against Grounded. When the mention is only in passing, dismiss it with rdy_resolve and a reason.
  • On prose, notes and other informative blocks, an unlinked mention is only a link suggestion. It adds no check. Accept the suggestion when the block is about that entity. Ignore a passing mention.
  • An entity with everyday: true gets no link suggestions anywhere.
  • Don't add links only to raise the score.
  • Search a thing's name, key or alias with rdy_search to get its fact sheet.
  • Write responses carry suggestions (links to the entities your text names, new entities for literals that recur): accept the right ones with one rdy_accept call; they never block.
  • Fact sheets, search hits and briefings carry a confidence level: act on high; on medium or low, widen the search, fix the coverage issues you can, or ask the person before you act.
  • Link every entity a normative statement names, and elsewhere the entities a block is about; dismiss a passing mention of an everyday word with rdy_resolve (mention, dismiss).

Examples:

  • You search refund window before you change the refund rules, and the fact sheet has confidence medium. Search its aliases, and read the decisions that govern the refund docs. Link it from each normative block that names it. If the confidence is still medium, ask the person before you change a rule.
  • A requirement says "An invoice shows the customer's tax number." Link the invoice and tax number entities, because a normative block names both. A prose line that says "See the invoice rules" only passes by. Ignore its suggestion: a mention in prose adds no check.
  • Never link a block to an entity that it is not about. A link added only for the score gives a wrong "Why?" trail.

New assessments use method 2. A stored method-1 assessment keeps its old scores, so the same content can score differently in an older version. Don't compare scores across methods. A score that rises with the move to method 2 shows a new method, not better docs. Never tell the person that their docs improved because of it.

Hygiene

  • Stop at the first failed write. Read the view before you run anything again.
  • Change each block at most once per write. To edit and move a block, use one update op with move_to.
  • When a decision narrows or reverses a rule, find every statement of the old rule. Search its words, and search with governed_by.
  • Before you propose, read each section that you changed from top to bottom. Two blocks on one page must not contradict.
  • Before you propose a decision, read its related decisions and the neighbours in its section. Search for closed lists that it changes.
  • When a block states an exception, link it to the block that states the rule.
  • Search the terms (rdy_search, types set to term) before you introduce a term or a field name.
  • Before you remove or move a doc, brief it and read each block in dependents.
  • Don't write decisions that sit in a sibling view's open proposal.
  • A list of ids in a hand-off names the project that holds each id. Read an id only in its own project.
  • Quote decisions from rdy_read, not from the site or an export.
  • When you retitle a doc, decide its name too, because the name sets its page path.
  • To show a ref as plain text, put a backslash before its two opening braces. Without it, rdy reads the text as a ref, and a ref to no block fails with E_UNKNOWN_REF.
  • A list item can hold more paragraphs and fenced code. Indent each part past the item's marker, with a blank line before a new paragraph. Code in an item is literal: a ref in it is not read as a ref and adds no link.
  • A section with collapsed: true shows closed until the reader opens it. Collapse a section only when the person asks, such as for a long optional part. Links, search and the page index still reach its text.
  • ![alt](url) with an HTTPS URL puts an image from another host in block text. The site and the prints show its alt text, and Markdown outputs keep the image.
  • A figure can carry a dark image: set dark_blob, from rdy_asset, and dark_media_type together. The project's first dark image turns on the store feature figure_dark for good, and rdy 0.50.0 and older then refuse the project. Ask the person before you add the first one.

A snapshot of rdy agent guide at v0.57.0.