> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cessy.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cessy.ai/_mcp/server.

# Frontend Prompting

> Prompt AI builders to create Cessy custom pages that respect runtime contracts, permissions, data states, and page preview feedback.

When an AI builder creates or edits a custom page, give it Cessy-specific context. Generic UI prompts often produce pages that look plausible but duplicate business rules or call the wrong surface.

## Good prompt shape

Use this structure:

```text
Use the Cessy Design MCP server for this app. Inspect the current model,
projection schemas, commands, permissions, and page references before editing.
Build a custom page for <user task>. The page must read from <projection>,
execute <commands>, handle empty/loading/error/permission states, and avoid
duplicating business rules that belong in DomainConfig.
```

## Required context

Give the agent:

* target app and environment
* page slug or page name
* intended users and permissions
* projections the page may read
* commands the page may execute
* states the UI must handle
* whether a BFF is allowed
* preview and verification expectations

## Review checklist

Before accepting a generated page:

* all command calls use generated runtime contracts
* projection reads match the published schema
* permission failures are visible and useful
* text fits in buttons and compact panels
* mobile and desktop layouts are verified
* page preview works with realistic data
* no business rule is hidden only in the frontend

## When to use a BFF

Use a BFF when the page needs external service data, server-side composition, or sensitive credentials. Do not use a BFF to bypass DomainConfig or permissions.