Coherent
v0.33.1Governs UI edits by coding agents in Next.js: scope, real-browser verification, rollback.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
coherent_inventory Project inventory and edit state
Call first. Returns the code-derived inventory (design tokens, shared components with props and the routes that render them, UI primitives, pages), any open edit, and server capabilities. Use it to decide whether a change belongs in tokens, an existing component, a variant, or one page, and to reuse a component by PURPOSE, not by shape.
| Parameter | Type | Description |
|---|---|---|
root | string | Absolute project root. Defaults to the project this server was started for. |
coherent_begin_edit Declare an edit
Declare the files you will change BEFORE writing any of them. Returns the impact (every route that renders those files, transitively) and opens a transaction; writes to undeclared files fail verification. Takes a "before" render of affected routes (may take ~30-60s on a cold project). Need another file mid-edit? Call again with amend=<txId> and only the extra files.
| Parameter | Type | Description |
|---|---|---|
request * | string | The user's request, verbatim. |
scope * | string | tokens: design tokens in the stylesheet. component: one shared component, every consumer changes. variant: an opt-in prop on a shared component, set only on some pages; other consumers must render ide… |
amend | string | txId of the open edit to add files to. |
create | array | New files you will create (project-relative). |
modify | array | Existing files you will change (project-relative). |
refactor | boolean | A change that must not show: extracting components, replacing hardcoded values with equal tokens, renames. Every affected page must then render pixel-identically, and nothing visible is expected to ch… |
root | string | Absolute project root. Defaults to the project this server was started for. |
target | string | What the user addressed: a component ID (CID-007), an exact component name (@KpiCard), or a token (--radius). Its file is added to modify, and the scope must fit it. |
coherent_ds_sync Sync the design system
Give every component an ID (a `@coherent-id CID-NNN` comment) and write the /design-system page that lists every token and component with its ID and the pages that use it. Opens an edit that Coherent writes itself; then call coherent_verify_edit level "final" (every page must render exactly as before). Run it after the first build of an app, or when the user asks for the design system. Later edits keep the page current on their own.
| Parameter | Type | Description |
|---|---|---|
root | string | Absolute project root. Defaults to the project this server was started for. |
coherent_verify_edit Verify the open edit
fast (seconds): files changed outside the declared set, new TypeScript errors, real names/emails written into the UI. Use while iterating. final (~30-90s): fast checks + production build + renders of affected routes and controls; affected routes must change, controls must be pixel-identical. A final pass commits the edit; a failed final leaves it open to fix and re-verify, or roll back. Report the verdict to the user as returned: only "verified" means fully verified.
| Parameter | Type | Description |
|---|---|---|
level * | string | |
root | string | Absolute project root. Defaults to the project this server was started for. |
txId | string | Defaults to the open edit. |
coherent_rollback_edit Roll back an edit
Restore the files an edit owns, byte-for-byte: the open edit's declared files, or a committed edit's recorded changes. Files the user changed elsewhere are left alone. Refuses when a committed edit's files changed since (pass force only if the user agrees to discard that).
| Parameter | Type | Description |
|---|---|---|
force | boolean | |
root | string | Absolute project root. Defaults to the project this server was started for. |
txId | string | Defaults to the open edit, else the last committed one. |