Turn a build plan into a starter repo
onchain_agent_scaffold_planUSE WHEN a plan has been agreed and the next step is a repository rather than more advice. Builds the plan (same brain as onchain_agent_build_plan) and writes it into a small starter repo, returned as a base64 zip plus a manifest naming every file.
WHAT IS IN THE ARCHIVE: README.md (the plan rendered, every source URL, and the disclosure that Sato OS is ours) · sato.plan.json (the plan, signed at its own checked_at when a signing key is configured) · .env.example (every environment variable the stack's own deploy specs ask for, values BLANK, each under a comment naming which listing wants it) · install.sh (the documented install lines in order, each under its Preflight verdict) · agent.config.json (chain, tokens and the venue Sato Route chose, with chosen_by) · .mcp.json (Sato Hub's MCP server plus any MCP-native stack item) · docker-compose.yml ONLY when every stack item documents a docker install.
RULE ENFORCED: nothing is generated. Every line is a template constant or a field of the plan, copied verbatim. An install line we were not told is never invented, and a value we do not hold is left blank with a comment rather than filled with a plausible default.
THE ONE SAFETY RULE: a documented install that pipes a remote script into a shell (curl … | sh) is written as a COMMENTED line with a warning above it, never as an executable one, and it is reported in quarantined_installs. Uncommenting it is the reader's decision to take deliberately.
DETERMINISTIC: the same plan produces a byte-identical archive — the timestamps come from the plan's checked_at, not the clock.
NON-CUSTODIAL: the archive holds no keys and no secrets, and nothing here signs, deploys or moves anything.
Returns (json): { name, files: [{ path, note, bytes }], env_names, quarantined_installs, zip_base64, bytes, plan: { goal, intent, chain, plan_url, checked_at, stack_slugs }, caveat }.
Example: { goal: "a Base trading agent that swaps USDC to ETH on a signal", chain: "Base" }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal | Yes | What the user wants to build, in plain words. The plan is built first, then written into files. | |
| chain | No | Chain the agent runs on, e.g. 'Base'. When omitted it is read from the goal. | |
| budget_usd | No | Rough monthly budget in USD. Restated in the plan; it does not filter the stack. | |
| constraints | No | Hard constraints to restate back, e.g. 'self-custody only'. | |
| include_zip | No | True (default) returns the archive base64-encoded alongside the manifest. False returns each file's contents inline instead. | |
| response_format | No | Output format: 'markdown' (default) or 'json'. | markdown |