Skip to content

Guild builder ​

The Guild builder turns a sentence or two about what you want into a recipe: a full design for a guild. You describe an outcome. A coach, an AI designer, interviews you, splits the work into specialised agents, writes their Tasks and routines, and names the access each one needs. The result is a draft recipe you review, approve, and deploy.

The Builder is a design surface only. The coach never logs into anything, never creates a live agent, and never holds a credential. Deploy guild hands the recipe to the same apply flow as the Recipes library. Prompt Studio is its counterpart for a guild that already runs: it improves a live guild and does not design new ones.

When you use it ​

  • You know what a guild should achieve but not how to split the work into agents.
  • You want a design grounded in the connectors and limits of your own organisation, before anything is created.
  • You want to review and edit a blueprint, and discuss it, before it costs anything to run.

How it works ​

A session owns one draft ​

Starting the Builder opens a session and creates its draft recipe at once. Every message to the coach is one generation. The coach reads the draft, the organisation's capabilities, and your answers, and rewrites the draft as a whole. The draft is an ordinary recipe in the library: you can open it from Recipes too.

How the coach designs ​

The coach follows a design method:

  • Ground every system. The coach looks up what the organisation can actually use. It never names a connector that is not in the catalog. Each system you name gets one resolution.
  • Specialise. Work with more than one standing purpose becomes two or more agents. One agent stays one only when the whole job is one skill, one cadence, one login, and one playbook, and the coach records why.
  • Keep each agent narrow. An agent carries only the Task, notes, and tools its own work uses. Agents meet only in the collections and tagged messages their Tasks name.
  • Seed files with working content. A new note starts with the rules, rows, or entries its agent acts on at its first wake, never a line describing what the file will hold. A part still unknown is one line saying what is missing.
  • Write for a human reader. Every Task, note, routine instruction, table purpose, and guild description is ELI5, in a clear structure, each thing said once, and as short as it can be.
  • Write every Task to one shape. An opening line, then Inputs, Work, Outputs, and Files, in headings and bullets, about 300 words. The coach's own system message carries what every agent already reads: the system prompt's Guidelines, Task and State intros, and Memory rules. A Task repeats none of it.
  • Hand off through a collection. Agents pass work through a queue collection by default. Tagged messages in group chat are only for small, budgeted batches.
  • Remember what was seen in a collection. A routine that watches for new items keeps the items it has seen in a collection with a unique key, not in Memory.
  • Ask, do not guess. Interview questions come as option cards. A login comes as a connect card. Both pause the coach until you answer.

Reviewing what the coach wrote ​

Everything the coach writes is marked as written by the Builder and not reviewed. That is provenance, not a gate. You read the blueprint, edit a Task yourself or ask the coach to revise, switch off tools or drop connectors, and approve. A cut you make is sent back to the coach so it can fix the Tasks that relied on it, or ask why.

Looks ​

When the coach writes a draft, the Builder picks one DiceBear family for the guild and a unique variant and identity colour for each role. The coach does not choose the mascots.

In the app ​

Landing ​

Builder opens the landing page, Describe the guild you want.

  • A text box takes a sentence or two about the guild.
  • Coach picks the coach's model, from the organisation's chosen marketplace models, preselected with its default. While no provider is connected, a guide to Model keys shows instead. The coach's model is written into the roles it drafts without one, as their recommendation, but a subscription role.
  • Draft the recipe (or Cmd/Ctrl+Enter) starts a session with that description as its first message.
  • Try offers example descriptions that fill the box to edit before sending.
  • Your drafts lists your earlier sessions.

Workspace ​

A session's workspace has two panes: the blueprint of its draft recipe and the coach chat. A bar splits them. Drag it, or focus it and use the arrow keys; its share persists. On a narrow screen one pane shows at a time, switched with Show: Coach or Blueprint.

The header shows the recipe's name, its body version, and a status: draft or approved, and coach designing…, waiting for you, or coach ready. Its buttons are:

  • Builder, back to the landing
  • Approve, on a draft: it moves the recipe to ready so it can be applied. A later Builder write returns it to draft.
  • Deploy guild: it approves a draft first, then opens the apply preview

The blueprint is the same plan as a recipe's page. In it you rewrite Tasks, switch connector tools per role, or drop connectors. Save and tell the coach writes those access cuts and posts them to the coach.

The coach chat shows the coach's tool steps, then its reasoning and its reply as they stream. A reply that hit the output limit says so. Connect cards and question cards appear after the steps that asked for them:

  • A connect card names the service, with a Service picker when the coach offers several, and Where it logs in. An organisation login has Connect <name>, which connects now. A guild or agent login has Use at <scope> scope, which plans it for apply. Skip declines. A connector that is not set up on the box says a platform admin sets it up under Admin, Platform keys, and Connect stays disabled.
  • A question card offers options plus Other, and sends every answer at once.

Open questions the coach recorded in the design show as a question card above the message box. While a card waits for an answer, the message box is disabled. A card's buttons are disabled while its reply is on its way, and the card settles once the coach has the reply. A reply that fails shows its error and leaves the card open to answer again. When the session reaches the coach's input limit, a banner says so: the session stays readable, its draft stays in Recipes, and a new session continues the design.

The coach's spend counts toward the organisation's usage. Settings › Usage shows it in the Builder row (Usage).

Rules and limits ​

RuleValue
Coach modelA marketplace model whose provider the organisation has connected
Coach temperature0.2 by default
Steps per generation24
Output tokens per generation25,000 by default
Tool calls per generation40 by default
Input tokens200,000 by default; when a generation's projected input passes it, the session is blocked
Monthly runsEach generation counts against the organisation's monthly Studio and Builder runs, when a limit is set
One generation at a timeA message while the coach works is refused
SessionsVisible only to the user who started them
DraftsOne recipe per session
Coach writesRefused when every role has an empty Task, or when they drop roles from a roster of two or more
ConnectorsOnly those in the catalog; never invented
CredentialsThe coach never holds one
Logins in chatAn organisation login connects in the chat. A guild or agent login is chosen in the chat and connected on the apply checklist. Browser logins happen on the live agent after apply

Reference ​

Design rules ​

The coach's system message is apps/orchestrator/src/builder/system.md. Five blocks in apps/orchestrator/src/conversation/ are shared with Prompt Studio: content-trust.md (what is authoritative and what is evidence), prompt-placement.md (the design rules and where each kind of text belongs, stated once for both coaches), writing.md (how every document the coach writes reads: ELI5, structured, each thing once, short), task-shape.md (the shape every Task takes), and agent-prompt.md (what every agent already reads, with the live Guidelines template, the Task and State intros, and the Memory rules inlined). The rules below are the ones the checks enforce or the recipe records.

  • Grounding. builder_list_capabilities is the grounding tool. The coach may not name a server that is not in that result.
  • Specialisation. Any of these justifies a split: narrower tools, narrower access, narrower context (a distinct memory or playbook), volume, browser against non-browser work, code work against other work, and failure isolation. A single role records its reason in design.specialization.
  • Hand-offs. Two or more roles need a queue collection or a tagged protocol with a budget, recorded in design.handoffs. Each Task names its own side of a hand-off, not the peer's job. N items never produce N group messages.
  • Routines. Each trigger is a schedules row, recorded under the same key in design.routines with a cadence and a dedupe collection whose unique column carries the identity.
  • Narrow roles. A role's own rules and working files are notes that role alone writes: the role in writers and no guild. A note the guild reaches holds only what every role that embeds it uses. No note describes each role's job: the coach writes each role's focus as the domain it owns, so another agent can tell who to tag, and agents see those lines in State. The coach sets false in native_tools and in each connection role's tools for every tool a role does not call, and turns config.scripting off for a role that writes no scripts.
  • Working files. A file the agent revises is named in the Task and read with note_get. A file that must enter every run is embedded with ![[org/<key>]] (Task). Tasks name systems and outcomes, not namespaced tool ids.
  • Subscription. Every role that changes, runs, and ships code in git repositories is a subscription role, and so is any other role the operator asks to run on their own harness subscription (Code work). A role on a key whose work reads code without changing it stays on its key and lists the repositories it reads, as a subscription role does; its agent works in them with scripts. A role that reads a repository without pushing to it also lists it in config.read_only_repositories. For a subscription role, the coach writes no config.model, sets config.harness to the one the operator named, else claude-code, which the operator may change at apply, and cursor or antigravity only for a role that lists repositories. It sets config.harness_model, config.harness_effort, and config.secret_aliases only when the operator named them, and no model-loop settings. The recipe lists the repositories by name and purpose, never a URL or credential; each role that works in them lists them in config.repositories, and its Task names its repositories, the checks it runs, and how work reaches its reviewer: a pushed branch and a pull request opened with the host's connector tool. Apply creates it as a subscription agent (Agents); it counts against the subscription agents.
  • Scripts. Builder-written scripts are documents. They cannot run in the Builder.

Named systems ​

Each system the operator names becomes one design.systems entry. The coach tries a published catalog connector first (resolution: "catalog"). Otherwise it falls back, in order, to:

  1. a native capability (native)
  2. a reviewed script adapter plus a named secret (script)
  3. a browser role plus an operator login after apply (browser)
  4. a narrowed composition of available capabilities (composition)
  5. an explicit operator decision (decision), or a refusal (refused)

An entry whose fact is still unknown records accepted: false and a reason that starts with OPEN QUESTION., and the coach asks with builder_ask_question.

Collections ​

Every collection the Builder declares carries typed columns designed from how the records are used:

  • a queue or hand-off collection has one required text column with values, the closed list of states whose first value is what the producer writes
  • a collection whose records are entities carries their natural identity in one unique column, so record_add merges a repeat
  • a seen-set is a collection with a unique key column
  • each collection holds one record shape
  • free text lives in a named text column
  • a category lives in a text column with values
  • a short list of text lives in an array column
  • a count lives in a number
  • a moment lives in a datetime
  • no id or timestamp column is declared
  • purpose says what one record is and who writes it

Both Tasks name the state column. The producer writes every required column with record_add. The consumer finds work with record_list and where on it, and moves the record to the next state with record_update by id.

scope: "guild" is for the guild being built, whose agents all read and write it. scope: "org" is for a collection other guilds can share: the whole organisation reads it, and guild and writers say what the new guild and its roles get on its access list (see Recipe format). A seed note takes the same guild and writers, and org for the mode every agent of the organisation gets on it (see Recipe format).

Writes ​

builder_write_recipe replaces the whole draft. It sends the expected_body_version it last saw; a stale one returns recipe body_version conflict with the current body_version. A write is refused when every role has an empty task.body, and when it would drop roles from a roster of two or more. A column that breaks a rule is refused (collections[i].columns: column "x": …). Each accepted write:

  • recommends the coach's model on every role without config.model but a subscription role: one with a config.harness and no model (Recipe format)
  • keeps a reviewed field's author when its content did not change, and marks every other field { by: "builder", reviewed: false }
  • assigns the guild's looks: one DiceBear family, and a unique variant and colour per role, keeping the looks roles already had
  • returns the recipe to draft and emits recipe.changed

Approve assigns looks too when a role still lacks one.

Tools ​

ToolPurpose
builder_list_capabilitiesNative tools, the browser and subscription capabilities (tools, sandbox cost, the limit each counts against), published connectors, models, the organisation's limits and remaining capacity (agents, browser agents, subscription agents; null where nothing caps it), reusable connections
builder_search_capabilitiesSearch connector copy and canonical tool names
builder_describe_serverOne published connector's catalog record
builder_search_connectedSearch an organisation-connected workspace (Notion databases and pages)
builder_ask_org_connectionChat widget: connect one published connector to the organisation now
builder_ask_connectionChat widget: pick a connector and its scope. An organisation login connects now; a guild or agent login is confirmed and created at apply
builder_ask_questionChat widget: option card, plus Other, that pauses until the operator submits an answer
builder_validate_recipeMechanical and design findings against the current blueprint
builder_write_recipeCreate or revise the draft, sending body_version

Each tool's parameters are declared once: they are the JSON Schema the coach is offered and the decode its arguments pass before the tool runs. A call whose arguments do not match is refused with the first mismatch, named by its JSON pointer, and nothing is done.

A connect or question widget pauses the coach until the operator answers, connects, or skips.

The coach uses the shared conversation runner (apps/orchestrator/src/conversation/). Studio tools are absent.

Each generation composes the system message again and stores it over seq 0, so the stored transcript holds what the model saw. After the template it holds, in this order: the coach's model, temperature, and run limits; the write example (apps/orchestrator/src/builder/write-example.json) only while the recipe has no roles; the current recipe; the operator's access cuts; and the Session block (the UTC clock and expected_body_version) last, so the prefix before it stays the same between steps. The field-name hint is stated once, in builder_write_recipe's description.

An older tool result at or over 2048 bytes is stubbed in what is sent; the stub tells the coach to call the tool again and that the current recipe is in the system message.

Catalog copy (description, limitations, setup_hint) comes from each connector's manifest, with the instance admin's overrides applied (see The catalog in Admin). Platform admins edit it at Admin → Connector catalog (/admin). The Builder names the enabled connectors' manifest tools, and the tools the organisation's own logins have listed.

An empty stored tool list means "not connected here yet", never "this server cannot do that."

A connector whose oauth_setup_state is unsupported is not set up on this box. The coach says that a platform admin fills its keys under Admin, Platform keys before anyone can connect it, and asks the operator to do that or to pick another service. The connect widget shows the connector as Not set up with Connect disabled.

Validation ​

builder_validate_recipe runs the same checks as a recipe's validation. Every finding is listed in Recipe format. Operator tool and connector removals from the blueprint become access.tool_removed / access.connector_removed info findings, so the coach can update standing prompts or ask why they were cut.

Connected workspaces ​

When Notion is connected at organisation scope, the coach searches that workspace and asks which databases to use for long-lived records. Confirmed ones land on connections[].resources and a local map note.

Queues, seen-sets, drafts, playbooks, and Memory stay in local notes at organisation, guild, or agent scope, or in collections.

Stream ​

The workspace follows the session's stream: generation.started, assistant.delta, assistant.reasoning.delta, message.committed, recipe.changed, generation.finished, session.error. It shows a session.error's detail as a toast. The stream sends a keepalive every 15 s. While the coach works, the workspace also re-reads the session and its messages every 2.5 s.

Storage ​

text
builder_sessions (
  id, org_id, created_by_user_id, created_by_name,
  recipe_id,                        -- unique
  config_snapshot jsonb,
  status,                           -- active | blocked | archived
  blocked_reason,                   -- input_token_limit
  generation_state,                 -- idle | generating | cancelling
  generation_number, generation_token, generation_started_at,
  errors jsonb,
  created_at, updated_at, archived_at
)
builder_messages (id, session_id, seq, generation, payload, metadata, cost_usd, created_at)

One session owns one recipes row, with source_kind=builder and source_builder_session_id pointing back at it. The recipe cannot be deleted while its session exists. config_snapshot holds the coach's model, temperature, run limits, system prompt hash, and tool schemas; the system message shows only the model, temperature, and run limits. The first message (seq 0) is the system prompt, refreshed each generation.

The schema allows status=archived and archived_at. No route sets them: a Builder session is active, or blocked at the input limit.

The coach runs on the conversation runner Prompt Studio shares (Coach loop and usage). Posting a message takes the session's organisation admission slot before the turn is recorded, and the generation holds it until it ends, however it ends. A slot the admission refuses refuses the post and records nothing (see HTTP).

Whatever ends a generation, the session returns to idle with its generation_token and generation_started_at cleared, and the stream ends with generation.finished. A generation the process stopped during ends this way when the orchestrator starts again, after its unanswered tool calls are answered ERROR: execution interrupted. A failure the runner does not expect, such as a database error or an organisation the policy blocks after the generation started, ends the generation at that step and leaves the process running. It is added to the session's errors and published as session.error before generation.finished. When the database refuses that record too, the failure is logged and the stream still ends with generation.finished.

A cancel sets generation_state to cancelling only while a generation runs (generating). The runner stops that generation at its next step or while the model answers, answers its unanswered tool calls ERROR: execution interrupted, and the session returns to idle. A cancel of a session no generation runs on, idle or already cancelling, writes nothing and returns the session as it is.

Usage is charged to the organisation, global, and monthly counters.

HTTP ​

text
GET    /api/builder/sessions
POST   /api/builder/sessions                    { model, temperature? }
GET    /api/builder/sessions/:id
GET    /api/builder/sessions/:id/messages
POST   /api/builder/sessions/:id/messages
POST   /api/builder/sessions/:id/cancel
GET    /api/builder/sessions/:id/stream
PUT    /api/builder/sessions/:id/recipe
POST   /api/builder/sessions/:id/review
POST   /api/builder/sessions/:id/access
POST   /api/builder/sessions/:id/validate
POST   /api/builder/sessions/:id/publish
POST   /api/builder/sessions/:id/deploy
GET    /api/builder/capabilities
GET    /api/builder/capabilities/search
GET    /api/builder/servers/:server_ref
  • GET /api/builder/sessions lists the current user's sessions in the organisation.
  • A session of another user or organisation is 404.
  • POST /api/builder/sessions is 422 without a model, or with one that is not a marketplace model of a connected provider. model is a string and temperature a number; a message's content is a string, and a recipe write takes a number expected_body_version. Another type is 422 naming the field.
  • Posting an empty message is 422. Posting to a session that is not active is 409. Posting while the coach generates is 409 builder session is already generating. At the box's generation cap it is 409 the server is at its generation limit; try again shortly, and at the organisation's maxConcurrentRuns 409 plan limit reached: concurrent generations. A month past monthlyCoachRuns is 409. A refused post records nothing (no message, no coach run of the month, no entry in the session's errors, no stream event) and holds no slot.
  • review, access, validate, and publish behave like the recipe routes of the same names (see Recipes). publish is 422 with the blocking errors.
  • deploy takes the apply choices and creates the apply, exactly like POST /api/recipes/:id/apply (see Applying recipes), so it needs a ready recipe. The app does not call it: Deploy guild approves and opens the apply preview, which applies through the recipe route.

Screens ​

ScreenRoute
Landing/builder
Workspace/builder/<session_id>

Free software under the GNU Affero General Public License, version 3 only.