Goal: turn instructions (an agent’s plan, or a bashy sprint card with its stories, or a set of todos) into a shapeware spec folder that another agent can build from with no further questions. Format: the shapeware spec format. Worked example of a finished spec: bashy examples/desk/form (CONTRACT.md, features.yaml, examples/). Related: [[shapeware-lift-app]] when the app already exists; [[shapeware-source-from-spec]] for the builder; a rebuild test (a builder that has not seen the source rebuilds the app and the judge decides) to test the result.
Tools and format: the judge is bashy conform (spec check, run, cert, mutate). Where a step says conform ..., type bashy conform ...; on a machine without bashy use the standalone conform binary (github.com/dhnt/conform). The format on one page is examples/desk/form/references/shapeware.md in the bashy source, and the folder around it is the worked example, with a full CONTRACT.md, features.yaml and dag.md. bashy src fetch bashy puts the source under ${BASHY_HOME:-$HOME/.bashy}/src/bashy.
Steps
- Collect the instructions as given. For a sprint:
bashy sprint show Nand each story body. For todos:bashy todo show ID. For a plan: the plan text. Do not read the app’s source, even if it exists; the spec must come from the instructions. - Separate behaviour from implementation. A story mixes what the app does (commands, outputs, pages) with how to build it (libraries, paths, tests, commit rules). Only behaviour goes into the spec. Record a library or path only when a user or agent would observe it.
- Resolve conflicts by date. Later stories override earlier ones (a renamed command, a changed output). Write the final behaviour; list each override in a short “Decisions” section of
SKILL.mdwith the story it came from. - Write
features.yaml. One feature per user-visible capability:id,intent,effort(Fibonacci points),status: tbd, andacceptancelines of the formcommand => expectedtaken from the instructions. - Write
CONTRACT.md.- A rules section first: the output envelope and always-present keys, every flag that works on several commands, open versus closed outputs, where errors go and their exit code.
- Then numbered assertions in dependency order: a command, its expected output, its exit code. Use placeholders (
{ID},{PORT},{TIME},{KEY}) for run-specific values. Give page requirements as auiassertion on the accessible inventory.
- Write
examples/. One worked file per input format the instructions name, each used by at least one assertion. - Write
SKILL.md. The type line and the standard run block from the format, a behaviour summary that points at the contract, the venue an implementation must run on, and the “Decisions” and “Open questions” sections. - Mark what the instructions do not say. Where an output shape or an error text is not given, choose the simplest form, state it as a rule, and list it under “Open questions”. Never leave a requirement in prose only: if you cannot write an assertion or an acceptance line for it, it is an open question, not a requirement.
- Check.
conform spec check DIRmust report nothing. Fix and rerun until clean. - Reference. With no app yet, the first build that passes the contract becomes the reference; then certify it (
conform cert) and measure the suite (conform mutate). If an app exists, run the contract against it: every failing assertion is either a spec error or a place where the app left its instructions, and each one is recorded.
Guardrails
- Do not guess a literal the instructions never give. A status name, a field name or an error code that no story states goes in as an open value (
"status":"...") and under “Open questions”. In the first use, three converters each guessed a first status ofopen; the existing app says otherwise, the first assertion failed, and every later assertion that needed its id failed with it. - Do not hang the whole contract on one assertion. Give the first create step a fixed id (
--id NAME) where the app allows one, so a mismatch in one output does not unbind the rest. - The owner settles the open questions before anyone builds. Three converters given the same stories chose different names for the same things. The spec review is where a person decides; the list of open questions is its agenda.
- Do not invent features the instructions do not contain; do not drop ones they do.
- Keep outputs open (
"...": "...") unless closing one protects content. - Text that only a person reads (list formatting, help) is free: require the exit code, not the wording.
- Keep the spec small: an assertion per behaviour, not per example.