Form types and named data templates can live in herd/models/*.model.goat,
loaded with contracts:include. value:define --name --type --body declares
a static value using literal, record or list. Initialize a view with
state:add --name=draft --initial-from=model.identity.emptyLogin; its type
is inferred. Reset with state:set --name=draft --from=model.identity.emptyLogin.
Each assignment copies the data. Literal state initializers still require
an explicit type. Compose an assignment with state:set --name=draft --data=<<DATA.
Service bindings may use implementation:use --name=native --body containing
go:bind --package --name, web:bind --module --name and
mock:bind --module --name. Existing syntax and if remain supported.
After upgrading, refresh MCP tool discovery and reload the editor catalogue.
Model files are edited as project sources; no separate visual model editor was added.

Views load resources with resource:add --from=notifications.list and bind
events with on:activate --call=notifications.markRead. Service and repository
contracts live in herd/services/ and herd/repositories/, explicitly loaded
through contracts:include. Methods declare types, documentation and separate
Web/MCP publication. Previews use isolated mocks. Refresh the full MCP client
catalogue after upgrading to discover view_* tools; existing names remain.

Run goat view:format to indent view files with two spaces per nesting level,
preserving comments and literal data. Format one file with
goat view:format --path=herd/views/pilot-notifications.view.goat.
Use goat view:format --check to check formatting without writing, including in CI.

Open Editor menu to find document actions (including Git save, source, history and templates), undo and redo under Editing, and device sizes and simulation under Preview. Use Editor panel to switch between screens, elements, structure, components and model data.

Mockups in Git

Open Model data to add typed sources, configure view state, and choose its initial values. Under Route and publication, choose a context from the catalogue, enter sample parameters, and set the published paths and navigation labels. Use Registered component in the element palette to add the search filters and results.

Select a node in the inspector to edit its data bindings and events. For each event, reuse an action or create one from a registered operation, map its arguments, and configure success and error effects. Run uses sample data. Save to Git writes the validated .view.goat file. Published routes pick up the changes with the application release.

A configured repository and base branch are enough to start creating mockups. Users access the repository with their own Git profiles. If the project has older database mockups, components or templates, the owner can import them through Mockups in Git. If mockups already live on a separate branch, use Transfer mockups to the task working branch.

Import and Save to Git commit to your active change set's working branch, where accepted tasks are integrated. The panel opens a new change set from the project base when needed. Mockup commits go into that change set's pull request. A conflict leaves the draft in the editor. Resolve branch conflicts in Git. Goat source also lets you edit the stored definition. Run goat view:validate to validate herd/views/*.view.goat.

Use --data for typed sample sources and local state, --layout for component bindings, and --actions for typed inputs, mappings and success or error effects. In Run, choose the simulated outcome. The preview uses sample data.

Open a project, choose Mockups in its navigation, then select a starting layout and name. The mockup is saved in that project’s Git repository. Add controls from Elements by dragging them onto containers or by selecting a container and pressing Add. Structure shows nesting; Move to, Move up and Move down also work with a keyboard.

Containers own vertical, horizontal, grid and sidebar layouts. Appearance and spacing follow Goat styles. Phone, tablet and desktop previews display the same responsive document.

Lists and card grids repeat one item template over sample records. Edit the template once to change every item; bind content to a record field. Tables have columns and cell templates. Save a fragment as a project component, edit its definition to update instances, or detach an instance for independent editing.

Run activates tabs, expandable sections, modals and links between screens. Form input is temporary. Save explicitly after reviewing the draft. On a conflict, download the local copy before reloading. History previews older versions and restores them as a new revision.

MCP clients use the full catalogue with mockups:read and optionally mockups:write. After an upgrade, refresh the catalogue or reconnect, then discover tools through find_tools and get_tool_schema. Existing connections need the new scopes granted in the panel. Export shows the validated source and pinned commit.

The catalogue shows wireframe thumbnails and elements allowed in the selected container. Use Element actions to add a child, add next to a leaf, or change position and nesting. The Structure panel also accepts drops before, after or inside an element. Forms cannot contain other forms, including through containers or shared components.

When creating a mockup, choose List and details, Website, Dashboard, Form, or Blank. The chooser immediately shows previews and suggests a name. Demos include sample content and prototype navigation. Every created mockup is an independent, fully editable copy.

To reuse your own layout, open a mockup and choose Save as template. Enter a name after explicitly saving pending document edits. Your template appears alongside demos in the creator across accessible projects. It contains an independent snapshot of all screens and components, so later changes to the original do not affect it. Saving requires project editor or owner access.

Manage templates lets you rename a project template, replace its contents from a mockup in the same project, or delete it. Update and deletion require confirmation. Mockups already created from the template stay unchanged. Reload the list after a version conflict. Viewers have read-only access.

The creation chooser includes templates from all projects you can read and labels their source project. To create an independent copy, open a project you can edit and choose the template there. Read access to the source project is enough.

Running pilot views

Combobox values can read and write view state. Pagination uses a one-based page (value) and page count (pages), checks boundaries and emits change with a page field. Charts read records with label and numeric value fields. Modals contain focus, block the background and close on Escape. Failed submissions show errors even without a load action and preserve entered values. Generate aliases by repeating view:use for the same view with another published path. After upgrading, refresh the MCP client catalogue and reread documents.

The Angular generator supports the shared mockup format: nested layouts, multiple screens, data, state, events and effects. Select a published view and route in herd/gen.goat with view:use --id=... --path=.... The component bundles its definition and component dependencies from the same revision and uses the shared preview renderer. Declare a new business operation as a contract method and register its implementation; the application adapter supplies the execution context. Try the generated board at /app/pilot/generated-boards/{project}, also with ?sample=1.

Full search is available at /app/search. Definitions in herd/views/ publish routes with the application release. Pilot routes include /app/pilot/search, /app/pilot/notifications and /app/pilot/boards/{project}. Add ?sample=1 for sample data (use sample-board as the project). The same definitions use real operations when signed in. The original routes still provide the full features.

In the mockup editor, open the search definition and choose Run to filter sample data. The preview uses the view, catalogue, and components from the same Git revision.

To try the task board, open the move-task view in the editor and select Run. In Preview, choose Move denied (403) or Revision conflict (409) and drag a task. After a conflict, choose Reload to read the newer revision, then select Success to retry the move.

Hold a dragged task near the edge of the visible board to scroll. Follow the insertion marker to place it.

Portable views v1

portable-ui/1.0 describes abstract components. field:add derives its control,
validation and presentation variant from its type. Labels and help use
PL/EN/DE/ZH translations. JSON uses camelCase; translation keys use snake_case
segments separated by dots. Imports do not carry individual versions.

Use layout:set --variant=illustrated --illustration=/static/data/theme/welcome.webp on a screen to show an illustration beside the content, or above it in a narrow preview. Supply a translated illustration-alt role when the image conveys information. In core.action, set prop:set --name=variant --value=solid (also outline and text) and optionally prop:set --name=icon --value=chevron-end.

In the editor and MCP, edit document.portable.source. Saving uses the shared
parser and reports source line numbers. Refresh the MCP client catalogue after
upgrading. Preview uses a simulator; published execution requires application
operation and permission adapters. Resolve an uncertain write using its original
attempt key, without automatically issuing another mutation.

The search, board and notification pilots now use portable-ui/1.0, preserving their routes, sample data and Web controls. Field types select components, with typed outputs grouped under on:event. If a move response is lost, check the save status: the client reads its receipt without moving the task again. Legacy definitions remain supported and tested separately.

Unresolved writes remain in the attempt journal after contract upgrades. Check their status before submitting another write. Resolving an earlier operation neither repeats it nor runs actions from the new view definition.

Portable editor

Choose Save selection as component to create a reusable component and replace the fragment in your draft. Save the document to keep the replacement; local undo restores the fragment. View-owned bindings, events and exposed properties must be resolved before extraction. MCP exposes the same operation as view_mockup_editor_make_component; its receipt preserves the original draft and replacement after a lost reply.

The project list and editor use the portable contract. Save explicitly after editing; preview values are temporary. Document, inspector, template and Git settings drafts have separate leave guards. Save the document before creating a template snapshot. A revision conflict keeps the draft for comparison with the current version. History previews a pinned revision and restores it as a new write.

Older semantic documents retain their original data, bindings, events and screen navigation in an isolated legacy preview. Portable documents use the common portable runtime. Both previews use sample services and offer success, error, permission and conflict outcomes.

Refresh the full MCP catalogue to discover view_mockup_editor_*, including source export, history, versions, templates and publication status. An uncertain request uses its original input and key. Publication status only observes the existing commit. If its metadata or checkout is pending, review the commit and operation marker before explicitly finishing that publication. Checking status never repeats the save.

A portable dialog can use prop:set --name=returnFocus --value=filters to name a fallback focus target in its parent screen. The target must be a literal node ID outside dialogs and collections. The opener and a newer focus choice keep precedence. Hidden or unavailable targets use the usual fallback; stale views never restore focus. The CLI, local editor and MCP validate the same reference.

A nested review may additionally declare the literal prop:set --name=returnFocusDialog --value=editor-dialog. The node named by returnFocus must then belong directly to that dialog: it must be its nearest modal owner. Both IDs must be unique, on the same screen and outside collections. References to the closing dialog, its descendants, unknown or dynamically bound IDs, and cycles are rejected. The renderer restores focus only into the same native owner instance that was open before the review and remains open after it closes. A newer successor dialog keeps focus. Without returnFocusDialog, the target must still remain outside every dialog; the existing rules are unchanged. This is presentation metadata and performs no domain read or write.

Shared definitions with parameters

Use definitions:import --path=herd/shared/name.goat --as=common in a view body or at catalogue root. Shared files contain definitions and private imports; they cannot define services or views. Qualified uses such as common.requestsIdle do not re-export nested imports. Local definitions can appear before or after their uses.

Define reusable condition:define, action:define and error-set:define blocks, then use condition:use, action:use and error-set:use. Error sets contain error:add --code=… and other error-set uses; identical codes are included once. Effects retain their order. Request groups contain request:use --name=…; every expands a nonempty group to all during compilation.

Declare parameters through parameter:add --name=… --kind=…. Supported kinds are request, request-group, operation, state, form, dialog and value. State/value parameters require --type. Every argument is required: use bind --name=… --from=…, or --value for typed literals. References use parameter.name; no text interpolation occurs. Shared definitions receive view dependencies through parameters.

The source editor has a Shared definitions section for opening, validating and explicitly saving one shared file. Saving checks the commit and recompiles dependent views and contracts; a conflict preserves the draft. Saving a view preserves its imports. MCP exposes the same operations as get_shared_definitions, validate_shared_definitions and save_shared_definitions through /api/mcp/v1/all. Refresh the full client catalogue after upgrading. Existing scopes and project restrictions apply.

Imports use canonical project paths under herd/shared/ from the same authorized revision, with no host filesystem fallback. Cycles, duplicate names, invalid arguments and empty groups fail validation. Limits: 20 import levels, 40 expansion levels and 2 MiB of declarations. goat view:format preserves references and literal data; run the standard isolated test recipes before publishing.

# herd/shared/requests.goat
condition:define --name=requestsIdle --parameters=<<PARAMETERS
  parameter:add --name=targets --kind=request-group
PARAMETERS --body=<<CONDITION
  every --group=parameter.targets --as=item --condition=<<CHECK
    all --condition=<<FLAGS
      equals --from=item.pending --value=false
      equals --from=item.unsettled --value=false
    FLAGS
  CHECK
CONDITION
# Inside view:add --body
 definitions:import --path=herd/shared/requests.goat --as=common
 request-group:define --name=changes --body=<<REQUESTS
   request:use --name=start
   request:use --name=cancel
 REQUESTS
 condition:define --name=idle --body=<<IDLE
   condition:use --name=common.requestsIdle --arguments=<<ARGUMENTS
     bind --name=targets --from=request-group.changes
   ARGUMENTS
 IDLE
# Inside an enabled:when --condition block
 condition:use --name=idle

Shared interface fragments

Regenerate projects using a CLI built from sources that support content:define and content:use; older CLI binaries cannot compile these declarations.

Use content:define --name --parameters --body in herd/shared/*.goat and content:use --id --name --arguments inside screen content or a component slot. Parameters use the existing typed parameter:add / bind grammar; value references can select object fields. Bind values from declared state, route context or resources. Imports and literals remain source data; no shell or textual interpolation is executed.

Each use expands at build time to ordinary portable components inside a stack. Its required ID prefixes every child ID as use-id--child-id; duplicate IDs, missing bindings, incompatible types and recursive imports/uses fail validation. Local form/dialog references are subject to the same validation as ordinary content. Optional --current=child-id marks that action as the active page; an unknown action is an error. For route-dependent selection, place uses in mutually exclusive declarative containers.

Formatting, generation and the model editor retain the import and use. Editing an expanded child through the consuming view is rejected with the owning definition path. Edit that shared file instead; its dependent publications are revalidated. The project header is defined once in herd/shared/project-navigation.goat, with independent current-membership data from projectNavigation.read. Content-load failure does not hide a successfully loaded header. MCP exposes view_project_navigation through the full /api/mcp/v1/all endpoint; refresh the client tool catalogue after upgrading. Existing account, scope and project restrictions remain effective.

# herd/shared/header.goat
content:define --name=header --parameters=<<PARAMETERS
  parameter:add --name=name --kind=value --type=short_text
PARAMETERS --body=<<CONTENT
  component:add --id=title --type=core.heading --body=<<TITLE
    bind:add --property=content --from=parameter.name
  TITLE
CONTENT

# Inside a view body:
definitions:import --path=herd/shared/header.goat --as=shared
state:add --name=projectTitle --type=short_text --initial-value="Example"
# Inside content:set:
content:use --id=project-header --name=shared.header --arguments=<<ARGUMENTS
  bind --name=name --from=state.projectTitle
ARGUMENTS