A monorepo for writing specs and other serious text on the AT Protocol.
portent stan-app
4 folders · 7 files

e2e
icons
sidecar
src
.gitignore
index.html
mollusc.json
package.json
README.md
tsconfig.json
vite.config.ts
README.md

Stan #

The app version of stan.computer: a specification for the code in a directory, written with an agent's help and handed to the agent to implement, with one rule: every iteration goes through the spec. You do not tell the agent what to change in chat. You change the specification, and run it again. When the agent has questions, they come back as comments on the blocks of the specification they concern, and the answers are edits to it.

npm run stan-app            # the page, on http://127.0.0.1:5176 (demo project, fake agent)
npm run stan-app:app        # the app, on Vite with hot reload (mollusc dev)
npm run stan-app:build      # Stan.app, a zip and a dmg in stan-app/out/ (mollusc build)
node stan-app/e2e/drive.mjs # the browser drive, against `npm run stan-app`

The loop #

  1. Open a directory. Stan keeps the specification in .stan/spec.json (a draft document with a title, a status and an abstract) and renders SPEC.md from it on every save, for the people and agents who read the directory. Both are the writer's: the agent is refused when it tries to write them. Saving is automatic.
  2. Write the spec, with help. The sidebar's Assistant is either the coding agent itself, with leave to read the code (so its suggestions know what is there) but not to change it, or a model through its API (the picker from draft). Either way it answers in draft's protocol: a note and structured suggestions, accepted or rejected one by one. [ reaches stan.computer's catalogue of specifications for references.
  3. Implement. The Build tab hands the specification (each block tagged with its id) to the agent with the rules: work in the directory, decide nothing the spec does not decide, collect questions, end with a JSON report. The run streams in: what the agent says, which tools it calls. The button is off while suggestions are pending, since the agent only ever sees an agreed specification.
  4. Answer in the spec. Each question becomes a comment by the agent on the block it named. Answer in the spec takes it to the Assistant with the question quoted; you write the answer and the assistant works it into the specification as suggestions. Accept, resolve the comment, implement again. Earlier runs (summary and questions) are recorded in .stan/runs/ and given to the agent so it knows what has since been settled.

The agent #

Agents are reached over the Agent Client Protocol (JSON-RPC on stdio), so any of them will do. Presets: Claude Code through @agentclientprotocol/claude-agent-acp (uses your Claude Code login), Gemini CLI (gemini --experimental-acp), DeepSeek Harness (dsh, adjust the command to your install), or any command that speaks ACP. The command runs in your login shell so it has your PATH. The app is a desktop window through mollusc (mollusc.json; the app scripts need mollusc on the PATH), and its sidecar, sidecar/agents.js, is a small bridge that starts the agent and pipes its lines over HTTP and server-sent events, for the page only: every request carries the token mollusc gives the page. The protocol lives in src/acp.ts. Permissions are decided by policy (src/protocol.ts): implementing allows tool calls except writes to SPEC.md and .stan/; designing allows reads only. File reads and writes are offered to the agent through the client, which is where the protection is enforced.

In the page (no processes) the demo project runs a fake agent that reads, writes once with a permission request, and asks one question, so the whole loop can be seen without a model.

Files in a project #

.stan/spec.json   the specification (draft document + metadata + review state)
.stan/agent.json  which agent, and where design suggestions come from
.stan/runs/*.json one record per run: summary, questions, tool calls, transcript
SPEC.md           rendered from the specification; generated, do not edit