# Spawn every agent with a spec, a plan, and the same workspace

> A NanoClaw skill that sets up every persistent agent the way a coding agent works: a spec, a saved plan, and one workspace layout, so I can rely on any agent I spawn before I read a line of its output.

As an analyst I spawn persistent agents in my NanoClaw harness with one command, one per recurring task. Coding agents taught me what they need to be reliable: a spec before code, a plan before work, and a repo laid out the same way every time. So I wrote `create-persistent-agent`, a skill that gives every agent all three before it exists.

![Map of how one conversation becomes a persistent agent. I ask the chief of staff, my parent agent: a persistent agent too, and the one I talk to. It writes a spec with a fixed structure: Problem, Objective, Success criteria, Non-goals, Constraints, Open questions, and I confirm it. It spawns a persistent agent on Sonnet with the spec as its system prompt and today's ask as its initial prompt. The agent has its own topic, container, memory, sessions and model. Inside, the planner subagent on Opus turns the spec into a plan file: goal and success criteria, tasks each with a checkable result, who runs each task and in what order, how the results assemble into the deliverable, how each criterion gets verified, and the schedule, state between runs and risks. That sets the orchestration design: inline, one subagent, or a fan-out. The plan is saved to plans/deliverable.md, which gates every cycle. The plan runs on general and fact-checker subagents, which inherit Sonnet, and the deliverable lands in outputs/. The refuter subagent on Gemini Flash attacks the conclusion, and the verifier subagent on GPT-5.6 Luna, a different provider from the planner, checks each success criterion pass or fail. Either one failing sends the work back to the run; a pass ships to me. Every agent gets the same workspace: plans/, outputs/, outputs/.verify/, .templates/, scripts/.](/garden-assets/experience/atom_notes/agent-spec-plan-workspace/agent-spec-plan-workspace-map.svg?v=abdaac5e48)

From one conversation to a running agent: who writes the spec, who picks the shape, and who checks the work.

## An agent that improvises is an agent I cannot trust

Every spawn leaves a topic and an agent group behind, and nothing cleans them up. The wasted container barely matters. What costs me is an agent that runs for a month against a purpose nobody wrote down, picks a new shape for the same report each cycle, and leaves its files wherever it likes. I cannot tell if it is working, and with several agents running I cannot check them all by hand. I kept hitting that after the [OpenClaw experiment](/garden/openclaw-analyst-workflows): capable agents that drifted because "done" was never defined.

## Borrow the coding agent's spec and plan

Coding agents already solved this. [OpenSpec](/garden/spec-driven-development-with-openspec) writes a proposal, specs, and a task list before any code. [Superpowers](https://github.com/obra/superpowers) brainstorms, writes the plan to a file, executes against it, and verifies before it claims done. I apply both to agents instead of code.

## The spec says what done looks like

The skill interviews me and fills in six sections: Problem, Objective, [Success criteria](/garden/success-criteria), Non-goals, Constraints, and Open questions. Spec tools call the success criteria acceptance criteria. The test for each one: by the deadline, could two reasonable people disagree about whether it was met? If yes, it is still an activity. The spec becomes the agent's standing instructions, its system prompt (`instructions` in NanoClaw), re-read every turn like a `CLAUDE.md`. Today's ask goes in as the initial prompt, delivered once. Anything I could not settle becomes an Open question, logged as [intent debt](/garden/intent-debt) instead of a quiet guess.

## The plan lives in a file, and the file is the gate

Before real work the agent runs a `planner` subagent on the objective and success criteria and saves the plan verbatim. Like a Superpowers plan or an OpenSpec `tasks.md`, it states the goal and success criteria and breaks the work into tasks that each end in a checkable result. Mine adds what a coding plan leaves to the runner, starting with the orchestration design: whether the work stays inline, goes to one subagent, or fans out, which subagent takes each task, and what runs in parallel. It also covers how the results assemble into the deliverable, how each criterion gets verified, and the schedule, the state carried between runs, and the risks. A recurring deliverable gets one plan at a fixed path, `plans/<deliverable>.md`, and every cycle checks it: if it is absent, plan first. If it is present, follow it. It replans only when scope changes. Without that fixed file I saw agents skip the planner and improvise a different shape every run, with `plans/` left empty.

## Every agent gets the same workspace

NanoClaw already gives every agent group its own container, memory (`CLAUDE.md`), sessions, mounts and model. On top of that, each agent preloads one layout on its first turn: `plans/` for plans, `outputs/` for deliverables, `outputs/.verify/` for the evidence that the done check passed, and `.templates/` for a starting skeleton matched to the deliverable (report, presentation, infographic, HTML), and `scripts/` for code the agent writes once and reruns, on a schedule or ad hoc. The script is idempotent and never touches existing files. There is no separate spec folder, because the spec already lives in `instructions` and a copy would drift. This is the part I lean on most: I can open any agent I spawned and know where the plan, the output and the proof are.

## What it does not do

It does not decide [the agent's shape](/garden/subagent-brief); that is a later step. It will not invent a metric to look impressive, so a standing beat gets service levels (coverage, latency, cadence) instead of a fake deadline. And it never blocks: if I will not sharpen something, it becomes an Open question and the agent spawns anyway.

## The bottom line

Treat a persistent agent like a coding task: spec first, plan in a file, the same workspace every time. Reliability comes from the setup the agent starts in. It is the same instinct as giving a [loop](/garden/loop-engineering) a criterion it cannot renegotiate.

![Title card: spawn every agent with a spec, a plan, and the same workspace, a NanoClaw skill.](/garden-assets/experience/atom_notes/agent-spec-plan-workspace/carousel/slide-01.png?v=30384859ed) ![Card 1 of 5: an agent that improvises is an agent I cannot trust.](/garden-assets/experience/atom_notes/agent-spec-plan-workspace/carousel/slide-02.png?v=1422da64cf) ![Card 2 of 5: borrow the coding agent's spec and plan, from OpenSpec and Superpowers.](/garden-assets/experience/atom_notes/agent-spec-plan-workspace/carousel/slide-03.png?v=8ea206d31b) ![Card 3 of 5: the spec says what done looks like.](/garden-assets/experience/atom_notes/agent-spec-plan-workspace/carousel/slide-04.png?v=5680c8f280) ![Card 4 of 5: the plan lives in a file, and the file is the gate.](/garden-assets/experience/atom_notes/agent-spec-plan-workspace/carousel/slide-05.png?v=c919e159f0) ![Card 5 of 5: every agent gets the same workspace.](/garden-assets/experience/atom_notes/agent-spec-plan-workspace/carousel/slide-06.png?v=8af41029f7) ![Closing card: reliability comes from the setup.](/garden-assets/experience/atom_notes/agent-spec-plan-workspace/carousel/slide-07.png?v=df2bc9de36)

The whole note in a few cards. Swipe or use the dots.
