Skip to content
delta

Agent routing

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

TermDefinition
Site stateThe design, templates, content, and open Memory items that the site has at the start of the session.
New buildA request to set up, create, or start the site, or to build a major new surface from a brief when no target exists.
Subsequent requestA request that changes or inspects work that already exists.
Site templatesThe 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 skillThe first skill on a new build from a brief. The intake skill matches the form of the input.
Step skillA 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

  1. The agent must read site state before it writes.
  2. The agent must load one skill at a time.
  3. 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.
  4. The agent must not load an intake skill on a subsequent request.
  5. 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.

ConditionClassification
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 inputIntake skill
Request to set up, create, or start the siteonboarding
Written prompt or briefbuild-from-prompt
Screenshot, mockup, or Figma exportbuild-from-visual
Live URLclone-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.

StepSkillCondition
1. Site basicsonboardingThe site needs a name, tagline, logo, or browser icon.
2. Content modelcontent-typesThe request needs custom post types or fields, and the plugin is active.
3. Designdesign, or change-design-systemThe request asks for a new look. Use change-design-system to replace the design system.
4. MenusonboardingThe site needs navigation.
5. Templatesbuild-site-templatesSite templates are missing. Full setup is not complete without them.
6. Buildblog-and-conditions, or pages directlyAlways. Use blog-and-conditions for archives and singles.
7. Finishpolish-and-verifyAlways. 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.

RequestStep 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:

  1. The agent read site state before the first write.
  2. The agent loaded one skill, then the next skill. It did not load all skills at the start.
  3. The agent did not list the full set of abilities.
  4. The agent did not change the full design when the request asked for one page or one template.
  5. 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