Skip to content

Give a coding agent the context of a slice

When you hand part of a model to an AI assistant or a review pipeline, it needs the slices, what they take, record and show, the specifications they must pass, and the Screenplay they are written in. Studio exports exactly that part of the model in a form made for agents, so you do not paste whole models or verbose JSON.

  • Each slice in scope: its type, where it sits (event model, module and feature), its description, its command, events, read models and queries with their properties, and its trigger.
  • Every specification of each slice as Given, When and Then lines, including the rejections and the “no events” expectations. A slice without specifications says so.
  • The Screenplay documents the scope covers: the slice’s own document, or everything under the feature.
  • The Screenplay session guidance, unless you leave it out. It teaches an agent how to read Screenplay and build a slice from it, so the agent needs nothing installed. Studio checks the guidance against its published checksum before using it.
Format Use it for
Markdown Pasting into an assistant. A compact summary of each slice that always lists the specifications, then the Screenplay and the guidance
JSON Tools and pipelines that parse the context
YAML Reading the context by eye
TOON Fitting a large context into a token budget. Token-Oriented Object Notation writes lists such as properties as one header and a row per item
  • On a slice header, Copy for an agent copies the slice’s context as Markdown.
  • In a feature’s menu, Context for an agent copies the feature’s context or downloads it in any format.
  • In the project menu’s Export submenu, Context for an agent does the same for the open event model.
  • Over MCP, call studio_export_context with a scope (slice, feature, eventModel or domain), the id, a format (markdown, json, yaml or toon) and, to save tokens, includeGuidance: false.
  • From a terminal or CI, cratis studio fetch uses the same tool with your organization’s MCP credential. See the Cratis CLI.

Agents you talk to in Studio’s board chat get their context without being asked. Every message to every agent carries:

  1. The subject. The event model or brainstorming board the conversation is about, with an outline of every module, feature and slice. A model too large for a prompt drops slice detail and says so in the outline.
  2. The surroundings. The project, application and domain, and the names of the domain’s concepts.
  3. Where you are. The page you are on, what is selected or being edited, who you are and which organization you are in.

An agent that has the model open can read any part of it in full. Reading is never counted as work done: a reply that only read the model is an answer, not an action Studio carried out. If Studio cannot load the subject, the agent says exactly that instead of asking you to paste the model.