Routing is the procedure that the agent uses to select work in a session. The agent examines the site. The agent classifies the request. The agent then loads one skill for the current step.
The operator does not configure routing. The theme defines the procedure. This document states the terms, the principles, and the sequence.
Terms
| Term | Definition |
|---|---|
| Site state | The design, templates, content, and open Memory items that the site has at the start of the session. |
| New build | A request to set up, create, or start the site, or to build a major new surface from a brief when no target exists. |
| Subsequent request | A request that changes or inspects work that already exists. |
| Site templates | The templates that display pages: single pages or posts, archives, search results, 404 pages, and shop pages. A header, footer, loop item, or comments template alone does not count. |
| Intake skill | The first skill on a new build from a brief. The intake skill matches the form of the input. |
| Step skill | A skill for one stage of work. Examples: design, templates, build, finish. |
A new chat is not a new build. A new chat on a site that already has work is a subsequent request, unless the operator asks to set up the site.
Principles
- The agent must read site state before it writes.
- The agent must load one skill at a time.
- The agent must select the intake skill from the form of the input. It must not select a skill from a word in the request.
- The agent must not load an intake skill on a subsequent request.
- The agent must not list all skills or all abilities at the start of a session.
Example for principle 3. The request “build a blog” does not load a skill because it contains the word “blog”. The agent loads blog-and-conditions when the session reaches the build step for archives and singles.
Principle 3 comes from measurement. An earlier router picked a skill because the request mentioned a page, and then never loaded the design skill, so the site was built on the seed defaults with no design decision made. The current procedure reads site state first and picks the intake skill from the form of the input. We keep measuring sessions against the criteria at the end of this page, and the procedure changes when the measurements say it should.
Classification of site state
The agent reads site state first. It reads open Memory items before it classifies the request, because an open item can name the subject of the request or contradict it.
| Condition | Classification |
|---|---|
| The request asks to set up, create, or start the site. | New build |
| The request asks for a major new surface from a brief, and no target exists. | New build |
| The request changes or inspects work that already exists. | Subsequent request |
A site with no published site templates shows bare content. On such a site, the onboarding skill tells the operator this once and offers setup. No templates does not mean a new site: content and design can already exist.
New build
A request to set up, create, or start the site loads onboarding. For any other new build, the intake skill is a function of input form. It is not a function of subject matter.
| Form of the input | Intake skill |
|---|---|
| Request to set up, create, or start the site | onboarding |
| Written prompt or brief | build-from-prompt |
| Screenshot, mockup, or Figma export | build-from-visual |
| Live URL | clone-from-url |
The agent proceeds by step. It runs only the steps that the request needs, and it loads a step skill only when that step starts.
| Step | Skill | Condition |
|---|---|---|
| 1. Site basics | onboarding | The site needs a name, tagline, logo, or browser icon. |
| 2. Content model | content-types | The request needs custom post types or fields, and the plugin is active. |
| 3. Design | design, or change-design-system | The request asks for a new look. Use change-design-system to replace the design system. |
| 4. Menus | onboarding | The site needs navigation. |
| 5. Templates | build-site-templates | Site templates are missing. Full setup is not complete without them. |
| 6. Build | blog-and-conditions, or pages directly | Always. Use blog-and-conditions for archives and singles. |
| 7. Finish | polish-and-verify | Always. The agent must complete this step before it reports that the work is done. |
Shop, forms, and components are not steps. The agent loads woocommerce, contact-forms, or components during the build step when the work requires those skills. It loads woocommerce and contact-forms only after the plugin is active.
Subsequent requests
A subsequent request must stay on one layer.
| Request | Step skill |
|---|---|
| Change the header. | build-site-templates |
| Change the site name or the menus. | onboarding, the matching step only |
| Add a call to action on posts. | blog-and-conditions |
| Change a color. | design |
| Use our own design system. | change-design-system |
| Report a defect on a page. | troubleshooting |
If the intent of the request is not clear, the agent loads session-router first. session-router classifies the intent and names at most one skill to load next.
The intake skills build-from-prompt, build-from-visual, and clone-from-url apply only to a new build. The agent must not load those skills for a subsequent request.
Criteria of a correct path
A session follows the procedure if all of these statements are true:
- The agent read site state before the first write.
- The agent loaded one skill, then the next skill. It did not load all skills at the start.
- The agent did not list the full set of abilities.
- The agent did not change the full design when the request asked for one page or one template.
- The agent read the result of each write before it reported completion.
If a subsequent request starts a new homepage as a new build, the path is not correct. Stop the agent. State the layer that the request requires.
Related
- Tools and abilities: the four tools and the ability model
- Skills, rules, and guardrails: the skills that routing selects
- Starting a build: setting up a new site, and the three forms of input for a new build