Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

8.5 KB
Raw Blame

If you are inside the Webstudio monorepo, use the local CLI exactly as node packages/cli/local.js ... as your first command path. Do not use packages/cli/bin.js for local source-tree work; it is the packaged build entry and may use stale built output. Before editing a Webstudio project, do one small discovery step, then act. For delegated design-system or “use every component” tasks, the first MCP command is workflow.next {"goal":"design-system-page"}; report that returned checkpoint to the parent/user and stop until continued. For a simple authored/styled section, the intended path is literal: call meta.index, call meta.get-more-tools with {"tools":["insert-fragment"]}, read the target parent id with list-pages/get-page-by-path/list-instances only if needed, then call insert-fragment. Prefer insert-fragment for authored/styled sections; use insert-component only when inserting one automatic component template. Do not grep source files, dump full MCP resources, or write parser scripts before trying focused MCP calls. Good first calls are meta.index for orientation, meta.guide for a goal workflow, workflow.next for one bounded delegated phase, meta.get-more-tools for exact tool schemas, and components.coverage-plan, components.coverage-insert-next, components.find, or components.get for component work. Do not call every discovery tool up front. For delegated or non-streaming agents whose parent cannot see live stderr/stdout, treat each parent-visible checkpoint as the unit of work. If the parent asks for status within 30 seconds, run exactly one shortcut command such as webstudio meta.index or one explicit webstudio mcp single-op-call command, report its command/result, and wait for the parent before the next MCP command. Do not run long shell loops of shortcut or webstudio mcp single-op-call commands; they hide progress from the parent. Do not take a broad task such as creating a full design-system page as one execution unit. Instead call workflow.next {"goal":"design-system-page"}, report the returned phase/checkpoint to the parent, wait until the parent continues, call checkpoint.ack {"reported":true,"continueAfterReport":true,"summary":"<what you reported>"}, complete exactly that bounded phase, and return: discovery, page creation, one dry-run JSX section, one committed JSX section, one components.coverage-insert-next call, or one presentation pass. Phase commands do not include nextPhase in their own output. After the parent continues, acknowledge the previous checkpoint first, then call workflow.next with the next phase. For design-system or “use every component” tasks, start with workflow.next, acknowledge its checkpoint only after parent/user continuation, then run compact components.coverage-plan, checkpoint, create the page, checkpoint, then call components.coverage-insert-next once per coverage checkpoint, and finish with the presentation-pass workflow phase. Coverage 72/72 is necessary but not sufficient: the page must be organized into styled, real-world design-system examples instead of raw unstyled component dumps. Request component coverage details with components.coverage-plan {"detail":"roots"} or components.coverage-plan {"detail":"parts"} only when needed. list-pages does not accept detail; use list-pages {} or get-page-by-path for page lookup. Read overview resources such as webstudio://project/guide, webstudio://project/tools-overview, and webstudio://project/components-overview only when focused tools are insufficient. Do not dump or parse full resources such as webstudio://project/tools or webstudio://project/components unless the focused tools are insufficient. Run one-shot shortcut or explicit webstudio mcp single-op-call commands sequentially against the same linked .webstudio folder. For experiments, pass --dry-run to local-capable mutations. Copying a .webstudio folder is not an isolated project clone; .webstudio/config.json still points to the same remote project, so non-dry-run mutations can commit to that project. If a one-shot call returns checkpoint.required, the CLI persists CHECKPOINT_REQUIRED across later one-shot calls until you report the checkpoint, wait until continued, and call checkpoint.ack {"reported":true,"continueAfterReport":true,"summary":"<what you reported>"}. If you receive PROJECT_SESSION_BUSY, another CLI/MCP process is updating the local session; wait a moment and retry sequentially. Complete one bounded phase and return a checkpoint before continuing. Follow the guide: read ids and Builder breakpoints first, use focused component discovery for component ids, props, and content model composition, prefer semantic tools over apply-patch, use direct value tools for fixed text/props, use bindings only for dynamic expressions/resources/actions, fixed page metadata text requires a quoted string expression, while fixed resource URLs accept plain strings, put page/resource update fields under values, and do not edit generated files for normal content/design changes. Never run visual verification automatically: ask first unless the user explicitly requested screenshots, visual verification, or a rendered audit, and only then use preview.start plus screenshot/vision.

When report-issue is available and the user explicitly asks to report a problem, call it once without requiring a GitHub login. Also call it automatically after a Webstudio-controlled tool crash, hang, malformed result, misleading success, repeated failure of the same documented operation, failed documented recovery, or required undocumented workaround. Do not automatically report expected confirmation/checkpoint flow, a clearly explained invalid input, missing permissions, PROJECT_SESSION_BUSY, a recovered version conflict, rate limiting, cancellation, or an offline environment. The LLM must write a complete technical report with the generalized user story, summary, attempted workflow, expected behavior, actual result, recovery attempts, user impact, technical context, acceptance criteria, exact model identifier, and reasoning effort. The CLI attaches the project ID and recognized entity IDs from the failed tool input; do not copy additional IDs into the authored text. Never include names, usernames, emails, phone numbers, organizations, domains, URLs, IP addresses, local paths, credentials, tokens, customer content, or other exact unique values. Do not copy raw tool inputs, outputs, or contextual errors; preserve only stable tool names, schema fields, error codes, CLI versions, and generalized input shapes. Use unknown instead of guessing unavailable model metadata.

If a mutation returns an unclear transport or response error, make one read-only check to see whether it committed and include that outcome in the report. For browser startup failures, include the selected browser family, whether fallback was attempted, and any shown exit signal or code, but never an executable path. The CLI adds bounded failure diagnostics automatically; do not paraphrase missing values as facts.

Content Block completion

Content Block work is not complete after one editable heading works. For every creation, migration, or repair, with or without MDX, inventory all intended editor-owned fields and their write destinations before implementation. Use semantic controls (calendar for dates, image picker for image replacement), keep fixed wording separate from direct writable bindings, and preserve existing field types and wording. Verify each field through Content mode, saved data, and reload; restore test values. Report passed, failed, or not tested per field. Missing or read-only required controls are unfinished requirements. Never substitute a correct preview or MCP write for the UI test.

For MDX articles, include the designed header, reading time, dates, images, alternative text, links, author fields, and custom-component content—not just the body. For a designed Image, use bind-props with src bound directly to document.frontmatter.featureImage.src and explicit binding.mode:"readwrite"; the default read-only mode can render correctly while hiding replacement controls. Choose source changes the article's image $ref, not shared resolved Asset metadata; the disabled URL input is expected. Keep the .description alt binding read-only and edit shared Description through Asset settings. Inspect binding mode, document scope, loaded reference, and permissions before claiming image replacement is unsupported. Follow the expressions guide's image recipe and whole-article verification checklist before handoff.