DocumentationDownload

Phased guide for agents

Nucleo 0.2+Free~16 min readUpdated October 31, 2026

A five-phase guide that tells the AI agent what to do next on the site, with rules and exit conditions.

On this page

01Overview

The guide divides the work on a site into five phases, numbered from 0 to 4. Phase 0 explains the Nucleo model. Phases 1 to 4 take the site from tokens and sections to the dynamic parts.

On every call the guide reads the state of the site and the saved documents. From these it calculates the current phase and the list of things to do.

The guide is read-only: it saves no state and does not remember previous calls.

You query it with the ability nucleo/guide, with wp nucleo guide (or wp nucleo ability run guide) and with the command nucleo guide of the local CLI.

The instructions of the MCP server ask the agent to call nucleo-guide before writing.

Every rule has a code (R1.2). Some errors and some quality reports show the same code in the guide field.

02Reading the guide

nucleo/guide

What it does: returns the requested phase, or the calculated current phase. The response contains the site state, the rules of the phase, the things to do, the exit conditions and the next command.

How to use it: via MCP with the tool nucleo-guide. Via REST with GET /wp-json/wp-abilities/v1/abilities/nucleo/guide/run. Example input: {"phase": 2, "design": "home.html"}.

Parameters:

NameTypeAllowed valuesDefaultNotes
phaseinteger0 to 4absentWithout phase the guide calculates the current phase. Out of range: error nucleo_guide_phase.
designstringat most 500 characters""Text only. Replaces the placeholder <design.html> in the rules and in the things to do. The guide does not read the file.

Response fields:

FieldContent
okAlways true.
phaseNumber of the returned phase.
titleTitle of the phase (see Phases).
stateSite state: see Site state.
basicsPhase 0 rules in short form: code and first sentence. Empty when the phase is 0.
todoThings to do of the phase, calculated from the state.
rulesRules of the phase: code, text, tools.
exitExit conditions of the phase, as text.
next"nucleo guide <phase+1>", or null at phase 4.

Permissions: current_user_can('edit_posts'). OAuth scope nucleo:read.

Edition: Free

Known limits:

  • The ability is annotated readonly, idempotent and not destructive. The write rate limit does not apply.
  • The texts of rules, things to do and exit are in English in the code, translatable with the nucleo domain.
  • If the Nucleo cache is empty but the data exists, the first entry of todo asks to run cache-rebuild.
  • If reading the documents stops at the limit, the last entry of todo says how many documents it read out of how many.

wp nucleo ability run guide

What it does: runs nucleo/guide from WP-CLI and prints the JSON response.

How to use it: wp nucleo ability run guide --input='{"phase":1}' --user=<id|login>. The nucleo/ prefix of the name is optional.

Parameters: --input, JSON object with the same fields of the ability. Default {}.

Permissions: as nucleo/guide. Edition: Free

Known limits: an --input that is not a JSON object returns invalid_json. The wp nucleo guide command is generated for the ability: see the next section.

wp nucleo guide

What it does: runs nucleo/guide with the command generated for every ability (nucleo/guide becomes wp nucleo guide) and prints the JSON response.

How to use it: wp nucleo guide --input='{"phase":1}' --user=<id|login>.

Parameters: --input, JSON object with the same fields of the ability.

Permissions: as nucleo/guide. Edition: Free

Known limits: the command is generated for the nucleo/* abilities: a dash in the name becomes a space (nucleo/doc-patch becomes wp nucleo doc patch). Commands starting with status, export, import, sync, docs, mcp or ability are not generated, so existing ones are not overwritten.

nucleo guide

What it does: calls nucleo/guide from the local computer and prints the response as text.

How to use it: nucleo guide [0-4] [--design PATH]. Example: nucleo guide 2.

Parameters:

NameTypeAllowed valuesDefaultNotes
phase (positional)integer0 to 4absentAny other value prints Usage: nucleo guide [0-4] [--design PATH].
--designstringtextabsentPassed to design as it is. The CLI does not read the file.

Lines printed, in order: Phase <n>: <title>, State: …, Checks: … (when present), Distinct: with one line per node (when present), Coverage: <read> of <total> documents read (with (truncated) when reading stopped), Basics:, To do:, Rules: (with tools: under each rule), Exit:, Next: …. Empty sections do not appear. Next does not appear when next is null.

Permissions: as nucleo/guide, with the CLI credentials.

Edition: Free

Known limits: the State line shows only tokens, sections, layouts, menus, types and documents. Checks, Distinct and Coverage have their own lines; Distinct appears only if there are distinct nodes. If the site responds with an error, the CLI shows the server message as an error.

MCP server instructions

What it does: the MCP server sends the agent a fixed text at start-up. The text asks to call nucleo-guide before writing and to follow the phases in order.

How to use it: automatic, INSTRUCTIONS field of the server response.

Parameters: None

Permissions: those of the MCP connection.

Edition: Free

Known limits: it is a hint. All tools remain visible in every phase.

03Phase calculation

Current phase

What it does: without phase, the guide checks phases 1 to 4 in order. It returns the first one not met. If all are met, it returns 4.

How to use it: call nucleo/guide without phase.

Parameters: None

Permissions: as nucleo/guide.

Edition: Free

Known limits:

  • Phase 0 is never chosen automatically. It is read only with phase: 0.
  • The verified conditions are these. The exit conditions are only text.
PhaseMet when
1At least one saved token, tokenLiterals = 0, repeated = 0.
2A header layout and a footer layout apply to the whole site, at least one menu exists, globalParts = 0.
3handLists = 0 and every model type has a single layout and at least one published item.
4inertButtons = 0.
  • pathLinks, mixedSections and forms generate things to do but do not block the exit from the phase.
  • With an empty model, phase 3 checks only handLists.
  • A single layout with the entire_site condition applies to all types.

Site state

What it does: collects the state on every call, with a few aggregate queries. It writes nothing to the database.

How to use it: state field of the response.

Parameters: state fields:

FieldContentSource
tokensNumber of saved keys for each token group. 0 if the group is missing.option nucleo_tokens
sectionsSections not in the trash and not automatic drafts.post type of the sections
layoutsLayouts per area. header and footer are always present.documents read, meta.area
menusNumber of navigation menus.wp_get_nav_menus()
postTypesSlugs of the model types.content model
documentsDocuments per type, excluding layouts and sections. page and post always present.meta _nucleo_doc
checksCounters of the document checks.Document checks
distinctNodes marked as deliberately different, in the form <ref>#<id>: <reason>. At most 3.Distinct block on purpose
coverageread, total, truncated: documents read, total documents, reading interrupted.document queries

Permissions: as nucleo/guide.

Edition: Free

Known limits:

  • Reading stops at 1000 documents. It reads layouts and sections first, then the most recently modified documents.
  • The posts trash, auto-draft and inherit are excluded. Drafts count.
  • The application of header, footer and single to the whole site comes from the layout map in the store. If the cache is empty, the guide sees these conditions as not met.
  • A draft without a slug appears with its ID in the references (page:14#r).

Document checks

What it does: goes through the tree of each document read and counts the signals of the rules. For each counter it keeps up to 3 example positions, in the form <ref>#<node id>.

How to use it: state.checks field. The examples appear in the entries of todo.

Parameters: counters:

CounterWhat it countsRule
tokenLiteralsValues of style equal to a saved token.R1.2
repeatedBlocks of at least 5 nodes with the same structure, present at least 2 times. Once per structure.R1.5
globalPartsDocuments of kind page that contain nc/menu or a node with settings.tag header or footer.R2.1
pathLinkssettings.href that starts with / but not with //.R2.3
handListsGroups of at least 3 siblings with the same structure and at least 2 nodes, outside nc/query and nc/collection.R3.1
inertButtonsnc/button without a valid href or with href #, and without a bind on settings.href.R4.5
formsnc/native-form nodes.R4
listsnc/query and nc/collection nodes.—
sectionRefsnc/section-ref nodes.—
mixedSectionsnc/section with mixed direct children: sections and other blocks.R1.7
distinctNodes with guide.distinct.R1.5

Permissions: as nucleo/guide.

Edition: Free

Known limits:

  • Structure of a block for repeated: type and some settings. level counts for nc/heading, section for nc/section-ref, postType for nc/query and nc/collection, layout and tag for the other blocks. A setting that is absent counts as the default of the block manifest.
  • Binds to a field of the current content also count, with source post, nucleo, item, acf, metabox, jetengine or woo. Texts, images, links and style do not count.
  • nc/section-ref and lists weigh 0. A container of only references is not a repetition.
  • The blocks inside nc/query, nc/collection and the hand lists do not count in repeated.
  • A block is reported if at least one copy is not inside a block already repeated. The group lists all the copies.
  • The to-do explains at most 3 groups and shows at most 4 copies per group.
  • For mixedSections, a nc/section-ref counts as a section if the root of the section is nc/section. If the section is not among the documents read, the reference does not count.

Distinct block on purpose

What it does: a node with "guide": {"distinct": "<reason>"} does not count as a repetition. The blocks inside it still count. The guide lists the node and the reason in state.distinct.

How to use it: add the guide key to the node in the document. Example: "guide": {"distinct": "home opening, deliberately different"}.

Parameters:

NameTypeAllowed valuesDefaultNotes
guide.distinctstringfrom 1 to 200 characters, at least one non-space characterabsentThe schema rejects other keys in guide.

Permissions: those of writing the document.

Edition: Free

Known limits: a distinct node makes its containers different too. state.distinct shows at most 3 nodes; state.checks.distinct counts all of them.

04Phases

Phase 0: template structure

What it does: explains the Nucleo model. Title in the code: Template structure.

How to use it: nucleo/guide with phase: 0. In the other phases the same rules appear in short form in basics.

Parameters: rules:

CodeContentTools
R0.1Two worlds: saving validates, compiles and checks the quality; the frontend reads only the result. An error gives node, path and rule.—
R0.2Document types: page and post, layout, section, popup.—
R0.3A document is a tree of nodes. catalog-get and catalog-list describe format, blocks and styles.nucleo/catalog-list, nucleo/catalog-get
R0.4Values that start with $ are tokens.—
R0.5Two channels with the same permissions: CLI for many files, MCP for reads and targeted changes.nucleo pull, nucleo push, nucleo/doc-patch
R0.6Plugins and theme are not modified. Every customization goes through documents, content and components.—

Permissions: as nucleo/guide.

Edition: Free

Known limits: enter this phase only on explicit request. The exit is text only: knowing the two worlds, the document model, the token syntax and the two channels. No verified condition. todo is always empty.

Phase 1: tokens and components

What it does: brings the design into tokens and reusable sections. Title in the code: Tokens and components.

How to use it: current phase when the condition of phase 1 is not met, or phase: 1.

Parameters: rules:

CodeContentTools
R1.1Before the components, extract the tokens from the design: colors, fonts, type scale, spacing, radii, shadows, durations.nucleo tokens suggest, nucleo/tokens-set
R1.2A value equal to a token uses $name. The push reports it as an error; push --use-tokens replaces it.nucleo push --use-tokens
R1.3A value present at least 3 times in the design without a token is a missing token.—
R1.4Before creating, read the existing sections (section-list: parameters and uses), then catalog and kit. The acknowledge of a section is valid only for the section: every page or layout that inserts it needs one with the id of its nc/section-ref.nucleo/section-list, nucleo/catalog-list, nucleo/kit-list
R1.5A block present at least 2 times becomes a section with parameters, inserted with nc/section-ref. Criterion: see Document checks.—
R1.6The variants are parameters of the same section.—
R1.7A section with a section among its direct children is a transparent container: all direct children reach the edges, also containers and headings. Bands with their own background are sibling sections, or the only children of a wrapper.nucleo/catalog-get

Things to do generated:

  • no saved token: run nucleo tokens suggest <design.html>, then tokens-set;
  • tokenLiterals > 0: replace the values with the tokens;
  • repeated > 0: create sections, with the explanation of the groups and the doc-patch operations (remove, then insert of a nc/section-ref with the same id);
  • mixedSections > 0: move the other blocks into a section of their own.

Permissions: as nucleo/guide.

Edition: Free

Known limits: the exit is text only: every repeated element has a section; no value matches a token. R1.3 has no check in the code. R1.4 cites nucleo/kit-list, which is Pro: without a license the ability is not registered.

Phase 2: global parts

What it does: moves header, footer and navigation into the layouts. Title in the code: Global parts.

How to use it: current phase when phase 1 is met and phase 2 is not, or phase: 2.

Parameters: rules:

CodeContentTools
R2.1Header and footer are layouts with area header/footer and condition entire_site. No page contains them.doc-create, layout-conditions-set
R2.2Variants are made with conditions and priorities, not with copies. To hide a part on a breakpoint, use the visibility of the node.—
R2.3Navigation uses menu-set and nc/menu. Internal links use references (page:<slug>, <post-type>:<slug>, term:<taxonomy>/<slug>, home). In menus, items use page, post or ref (the same references plus archive:<post-type>); url only for external links.nucleo/menu-set
R2.4Bands repeated on several pages are sections with parameters, or layouts of the before-content and after-content areas.—
R2.5Before exiting: layout-explain on a page, an article and an archive; screenshots at 390 and 1440 px.nucleo/layout-explain

Things to do generated: missing header or footer layout; layout present but without the entire_site condition; no menu; globalParts > 0; pathLinks > 0.

Permissions: as nucleo/guide.

Edition: Free

Known limits: the exit is text only: header, footer and menu apply to the whole site; no page repeats the global parts. pathLinks does not block the exit. R2.5 has no check in the code.

Phase 3: real content

What it does: turns the repeated elements into content with type, fields and a single layout. Title in the code: Real content.

How to use it: current phase when phases 1 and 2 are met and phase 3 is not, or phase: 3.

Parameters: rules:

CodeContentTools
R3.1An element that repeats with the same structure is a content: type, taxonomies and fields with model-set. Tiles that read different fields of the same element are not repetitions.nucleo/model-set
R3.2Before creating a type, read model-get: unmodeled lists the types registered by other code. Pages and articles accept fields with location.postType.nucleo/model-get
R3.3Every type has a single layout linked to the fields and a list with nc/query or nc/collection.—
R3.4The texts of the design go into the content (content/<type>/<slug>.json, terms/<taxonomy>.json, content-upsert, terms-set), not into the card.nucleo/content-upsert, nucleo/terms-set
R3.5Unique pages remain page documents built with sections.—
R3.6The single layout follows the data: nc/repeater, visibility filled/empty, nc/query with relatedTo, nc/post-meta with tax:<taxonomy>, nc/breadcrumbs.nucleo/catalog-get

Things to do generated: handLists > 0; for every type without a single layout; for every type without published items.

Permissions: as nucleo/guide.

Edition: Free

Known limits: the exit is text only: every list of the design reads real content; every item has its own page. The code does not check that a nc/query or nc/collection list exists for every type.

Phase 4: dynamic parts

What it does: replaces the fake controls with native blocks or components. Title in the code: Dynamic parts.

How to use it: current phase when phases 1 to 3 are met, or phase: 4. It is also the phase returned when all phases are met.

Parameters: rules:

CodeContentTools
R4.1First the native blocks: nc/collection, nc/tabs, nc/accordion, nc/slider, nc/native-form, nc/search. Email recipient of the form: admin (default), an address or field:<field>; replyTo is field:<field>.—
R4.2Then the PHP components, only when blocks, style keys and options are not enough. They live in the nucleo-components plugin. A component block is drawn at save time and does not see the current post.nucleo component new, nucleo component check
R4.3The component code does not go through MCP, REST or push. Locally nucleo component deploy copies the plugin onto the local WordPress disk; in staging and production the component arrives with the site migration or with the deploy (git), and the agent reports it as a step for a person.nucleo component deploy
R4.4The actions with external effects ask the user's consent before publishing the form.—
R4.5A button without a link or an action is a fake control (rule content.button.inert).—
R4.6No mu-plugins, no code in the theme, no snippets or CSS and scripts in wp_head/wp_footer. First style.parts and style keys, then style.custom; every gap must be reported with nucleo-gap-report, even when style.custom covers it. For PHP behavior a component is needed, only with the user's consent.—

Things to do generated: inertButtons > 0; a test submission for every form, with the number of forms.

Permissions: as nucleo/guide.

Edition: Free

Known limits: the exit is text only: no fake control; every form tested with a test submission. The code checks only inertButtons. The test submission cannot be verified: the entry stays in todo as long as forms exist. next is null.

05Rule codes in errors

What it does: adds the code of the guide rule in the guide field of some quality reports and some errors. The rule field remains the id of the quality rule.

How to use it: automatic, in the responses of save, validation, quality and import.

Parameters:

SourceIdguide code
qualitystyle.token.literalR1.2
qualitycontent.section.missingR1.5
qualitycontent.link.pathR2.3
qualitycontent.link.missingR2.3
qualitycontent.button.inertR4.5
qualityform.action.consequentialR4.4
errorcard_missingR3.3
errorcard_block_not_allowedR3.3
errorcomponent_codeR4.3

Permissions: those of the operation that produces the error.

Edition: Free

Known limits: the other rules have no link. The quality rules are described in the quality engine.

Esc
↑↓ to select↵ to openEsc to closeLocal search, no data sent