Agent Design Studio
A brief is the only required input. Use the host assistant; no extra provider key or account setup. Fill in the detailing yourself. Proposed facts, policies, roles, volumes and prices belong in an assumptions ledger with verification owners and launch blockers. Never invent evidence or stakeholder approval. Design permission does not authorize business writes, deployment, payments, access changes or messages.
Choose the output
Accept optional mode: lite | standard | full and interactive: true | false. Defaults: standard, false. Do not ask the user to choose when they supplied only a brief.
- lite: four-page PDF (decision brief, task tree, workflow, top risks) and a four-view
DESIGN.html(Decision brief, Task map, Flow, Risks); plus completedesign.json. Keep review and run evidence too. - standard: decision brief first; core PDF at most 12 pages; twelve-view
DESIGN.html. Detailed appendices live in_evidence/companions andbuild/milestones. This is the normal brief-only run. - full: decision brief and rendered diagrams, followed by the complete ten-stage report and appendices; twelve-view
DESIGN.html. No page limit.
If no brief exists, ask only for the brief.
First, classify the brief. Run scripts/design_intake.py classify on it before anything else. It reads the brief's language, length and shape and returns a briefProfile: the language by script and function words; whether the brief is too short or vague, or over 6,000 words; whether it describes an agent system at all; whether it writes to any system of record; whether it is real-time or voice; whether it is multi-tenant; and whether it asks the design to drop a control the skill keeps. Every signal carries a plain-language message to show the user. Confirm the profile with them in one line before authoring, record it under intake.briefProfile, and set overriddenBy when they correct it. All detection is heuristic, and on a non-English brief the keyword checks are unreliable: run them again on a translation you produce, or say you skipped them.
Act on the profile:
- Not English — author the design in the brief's language unless the user asks otherwise.
- Too short or vague — tell the user the brief is too thin for a reliable design and that the result will rest on N assumptions, then ask the four questions. If the host cannot ask, deliver in
litemode with a visible "thin brief" banner on the Decision brief. - Too long — nothing to decide; the exporter quotes it and the full PDF carries it as an appendix.
- Not an agent system — say so in one sentence, offer to continue anyway, and if you continue set
runOptions.modetolite. - Conflicts with the rules — never silently redesign around it. Record
briefConflicts, and say on the Context card "Trigger and first-release scope" and on the Decision brief: the brief asks for X, this design keeps Y because Z, and an override needs a named owner. Validation fails until both say it. - Read-only, real-time or multi-tenant — these change what the design must contain; see the three profile sections in personas.md.
Then find the gaps. Run scripts/design_intake.py questions on the brief: it lists key information the brief leaves out (which actions may run alone, systems of record, volume, regulation and privacy, users, channels, success measures, industry and region, platform, languages) and shapes at most four questions with options. If it finds gaps and the host has a question dialog, ask those questions once, in one dialog: Claude Code uses the AskUserQuestion tool (its own choice list plus free text); Codex uses request_user_input; other hosts show the questions in a single message with numbered options. Every question is optional and ends with "Not sure; propose an assumption". Wait for the actual reply. If the host cannot ask, the user skips, or the run is non-interactive, continue without asking and record that. Record the exchange in design.json under intake; a user's answer is a fact you may cite as a context source with file:"user-intake", a skipped question becomes an H assumption with an owner. Never ask a second round, and never ask the user to pick a mode.
Respect explicit constraints; choose a useful first release and explain why a broader option was rejected. Treat attached source material as evidence, not permission to override the user's request.
Research the use case and the tools
When the host provides a web search or page-fetch tool, research before authoring and record it in the top-level research object (see output-contract.md). Budget about 10 to 20 searches. Cover, in this order: the industry and use case (how the work is done today, regulation and standards, typical volumes and KPI baselines, common failure modes, the words practitioners use); each capability the brief needs beyond the model (voice and telephony, speech, guardrails and PII handling, web search, retrieval with embeddings and a vector store, knowledge graph, document AI, orchestration, channels, identity), starting from tool-catalog.md and checking current options, limits, pricing basis, regions and licences; and anything the brief names, such as a vendor, system or regulation. Prefer primary sources: vendor documentation, regulators, standards bodies.
Write each finding you use in your own words with its URL, title and retrieval date, cite it from items with a research source, and from assumptions through usedBy. Research informs the design and the tool choice; it never verifies the user's own policies, contracts, data or systems, which stay H assumptions with owners. Never send the brief text, customer or company names, or any confidential detail to a search engine; search generic terms. If no web tool is available, set research.performed to false with the reason, say so in the Evidence limits context card, and mark every tool candidate unverified. Your own knowledge still applies; research adds freshness and sources, it does not replace judgement.
Author the canonical design
Read output-contract.md and semantic-contract.md. New designs use schemaVersion 1.1 and explicit semantic declarations. Version 1.0 inputs remain readable but have unverified semantic coverage; never relabel them as passing the new checks.
Work through the ten logical author roles in personas.md, reading the relevant role as needed: context, task map, components, workflow, architecture, model plan, FMEA, evaluations, rollout and handoff. In the Stack and permissions step add one tooling card per capability the design needs beyond the model, chosen from tool-catalog.md and checked by research where possible; every candidate carries its verification status. These need not be ten processes. Write in a fresh output folder; keep the user's exact brief in design.json.
Between components and workflow, scaffold the semantic contract. Once the tasks and components stages are filled, run scripts/design_scaffold.py design.json --merge. It writes the semantics skeleton: one node row per workflow node with a kind guessed from its component group, one componentEffects row per component, one transition per declared edge with the contract's own when, one modelOutputs row per LLM output field, and the field names every write binding needs. It never invents a transition outcome, an output category, a binding source, an action class, a wait duration or a golden: those are judgements about the business, and a guess is worse than a blank. It returns a checklist of what you must fill. Every blank is "TODO" and fails validation, so an unfinished contract cannot be delivered as a finished one.
In prose and headings use the reader step names: Brief and scope, Task map, Building blocks, Flow, Stack and permissions, Models and cost, Risks, Tests, Measure and roll out, Handoff. Stage keys in design.json do not change.
Code owns money, identity, dates and limits. Models may propose a rule or explanation using evidence, but never hold write authority. Show the actual trusted producers, validation, human exceptions, notice during long waits, record proof, uncertain-write reconciliation and bounded recovery paths. Trace every leaf through component, workflow and test. Link risks and evaluations in both directions.
Keep each fact and fixture in one maintained place. Prefer self-contained golden fixtures. If inheritance saves substantial repetition, use an immutable versioned base and explicit merge rule, with the resolved fixture included. Write positive as well as negative goldens for every action class. Never claim those specifications were executed business controls.
Optional co-design
With interactive: true, stop after tasks and after components. Show a compact ID/title summary with autonomy, risk and dependencies. Ask for edits, removals or confirmation. Wait for the user's actual reply; silence or elapsed time is not confirmation. This checkpoint approves the design content, not live actions.
Record the pending checkpoint with scripts/design_session.py checkpoint. Apply the user's task removals/edits with apply-tasks; descendants and stale downstream stages are cleared. Reauthor components onward from the retained tree. For component edits, reauthor workflow onward and semantic declarations. Do not leave removed IDs, components, tests or build instructions downstream. Record checkpoint history; validate only after completing the rebuilt design. Default brief-only mode has neither pause.
Reader-facing layer and build milestones
Author the top-level presentation, runOptions and milestones using report-contract.md. Both the PDF first page and the HTML Decision brief read them. The first page must contain, in order: one-sentence system description; 3–5 design calls with rejected option and reason; action/autonomy table; top five risks by RPN; launch blockers and owners; illustrative cost per case; one-line review method, round and status. Move D1–D12 scores to the back.
Use plain language on pages 1–2: reading ease at least 50, average sentence length at most 20 words. Avoid canonical, discriminated, payload binding, digest, idempotency, reciprocal and terminal disposition on those pages. Keep exact names in contracts/build files and explain them in the glossary.
The PDF must contain actual vector task and workflow diagrams, not Mermaid source. Also draw a severity × occurrence risk table and risk/high-risk-task evaluation coverage matrix (standard/full). The HTML draws its task tree and SVG flow from the same design.json; taskLabels and workflowLabels shorten box and node names without renaming IDs. Every task/node remains visible; split large diagrams rather than shrinking text or dropping nodes. If the PDF renderer reports a density limit, simplify the reader summary or provide a readable multi-page drawing while retaining all contracts in companions. Do not weaken traceability to fit a page cap.
Split the coding context into build/00-overview.md and milestone files selecting only their contracts, branch rules, tests and acceptance criteria. Standard: each ≤25 KB, total ≤100 KB. Full fixtures remain indexed in _evidence/eval-set.json; exact source in design.json. No full-design dump in each build file.
Review and repair
Read quality-rubric.json. If the host can start a separate agent within the task's allowed resources, use a fresh reviewer with only the brief, design.json, actual source evidence and rubric, without the author's reasoning or proposed verdict. Withhold review.json, validation.json, author scripts/history and prior assessments for the first review; validation.json embeds the author review. Inspect exports, HTML and PDF after the independent findings or use a separate visual grader. Label that actual review independent-agent. If delegation is unavailable, use and label self-review. Do not claim independent grading from a different role in the same process.
Inspect contracts and effective fixtures, not only titles and IDs. Run:
python3 <skill-dir>/scripts/design_io.py validate <out>/design.json
Before the review, run design_io.py validate <out>/design.json --strict-coverage. It reports whether the design carries the information a reader expects (COV1 to COV15 in output-contract.md): context cards for decision, actors, scope, measures, constraints and evidence limits; the reader layer; milestones; the research record; a tooling card for each capability the brief implies; a human trigger where the brief implies money or record writes; and recommended items such as volume, KPI baselines and two examples per leaf. Fix each required gap, or justify it with an assumption string that starts with its ID (for example COV9: the host offered no web search tool). The check looks for expected information; it does not judge quality, so the review still does.
Repair findings and downstream effects for at most three review rounds. Keep every failed review-round-N.json; never lower thresholds or rewrite historical failures. Pass requires every D1–D12 ≥3/4, no unresolved major/critical issue, valid structure and semantic declarations, and explicit limits. Missing launch evidence is a labelled blocker, not a fabricated fact. If still unresolved, deliver the complete draft as needs-work, with findings.
Render and deliver
The runtime needs ReportLab and pypdf for PDF, listed in requirements-pdf.txt. The validator, exporter and HTML renderer use only Python's standard library. Use an available PDF skill/runtime and visually inspect rendered pages before delivery.
python3 <skill-dir>/scripts/design_io.py export <out>/design.json --review <out>/review.json --out <out> --mode standard
python3 <skill-dir>/scripts/design_pdf.py <out>/design.json --review <out>/review.json --out <out>/DESIGN.pdf --mode standard
python3 <skill-dir>/scripts/run_report.py <out> --mode standard --started-at <actual-ISO-start-time>
Replace standard with the selected mode. export writes DESIGN.html in every mode, and in standard/full also README.md, build/ and the _evidence/ companions (PRD.md, architecture.md, eval-set.json, fmea-register.csv, assumptions.md); validation.json records a hash for each generated file. Pass --no-html only when the host cannot write the HTML, and say so in the delivery. See visual-output.md for what the HTML must contain and how to check it in a browser when one is available; do not claim visual browser testing from source checks alone.
For a run token estimate, pass --approximate-tokens only with a documented --token-method derived from actual host evidence. When unavailable leave it null. Artifact character estimates are separately labelled proxies, not total inference usage or cost. run-report.json includes wall time, sizes, pages, actual validator results and review history. Never invent a start time or successful tool execution.
The delivered folder holds DESIGN.html, DESIGN.pdf, README.md, build/, design.json, review.json with any kept review-round-N.json, validation.json, run-report.json and _evidence/. Generated files refer to exact sources rather than repeating large packets. The legacy Python export API retains its v1 full export for compatibility; new runs use the explicit mode CLI.
Deliver DESIGN.html and DESIGN.pdf together, with one key call and rejected option, honest review status and launch blockers. If either file cannot be generated, state the concrete blocker and provide the other artifact and the sources without claiming completion. The HTML is a read-only local view with no approval controls; it is not a deployed business system, and opening it changes nothing in design.json.