Skip to content
PathGuided

Adding Rules to the Prompt Stops Working

A short rule file quickly improves AI-generated interfaces, but appending a new rule for every defect hits a hard ceiling. Situational selection and post-render checks scale better.

3 min read
Email

The first intervention that reliably improves AI-built interfaces is a short, concrete rule file. Ours began with a handful of explicit constraints: button labels use a verb and a noun, forms stay single-column with top-aligned labels, numeric table columns align right, and every view defines empty, loading, and error states.

Those rules outperformed vague instructions like "make it clean and intuitive" by a wide margin. The natural impulse is to keep extending the list—every time a generated screen comes back wrong, append another rule. In practice, that strategy hits a ceiling far earlier than most teams expect.

Situational Rules Cancel Each Other Out

Good interface guidance is almost always situational. An operational queue used by a specialist all day requires high information density and keyboard shortcuts. A first-run onboarding view requires a single clear action and almost nothing else. A marketing landing page benefits from an expressive display typeface; a settings page should never use one.

When you load all of these rules into a single prompt, the agent must infer which subset applies to the current screen. Often it does not choose cleanly—it compromises between competing directives and produces the exact generic average you wrote the rules to eliminate.

Even Small Rule Files Get Ignored

The observation that changed our workflow was simpler and more sobering. With only a few pages of guidance loaded directly in context, our agents still produced:

  • A confirmation button labeled "Done," despite the verb-and-noun rule sitting in the prompt.
  • Left-aligned numeric column headers above right-aligned numbers, despite the table alignment rule sitting in the prompt.
  • A link to a sample prototype page, despite an explicit rule forbidding prototype scaffolding.

None of these were missing instructions. The rule was present in context and simply lost to the model's trained habit. If rules are quietly overridden at a few pages of guidance, expanding the file to a few hundred pages will not solve the problem.

Select Before Building, Check After Rendering

Instead of handing the builder every rule at once, guidance needs two distinct moments: selection before work begins, and verification after the screen is rendered.

Full strategy catalogue Planner selects 2 to 4 strategies for this job Builder receives only selected strategies Rendered screen Reviewer checks screen against strategy questions

The right moment to select guidance is during planning, when the user, their job, and the stakes are explicitly stated. A planner can scan a compact catalogue—one line per strategy, such as "when a destructive action is reversible" or "when a list has fewer than fifteen rows"—and assign only the handful that fit. The builder starts with a narrow, uncluttered brief. In our backend tooling, we already cap each step at two strategies in under two kilobytes; UI work may warrant a slightly larger budget, but the starting point should remain small.

Just as important is what happens after the build. A rule stated beforehand is merely a request. The same rule phrased as a question about the finished interface becomes an objective test:

For every confirmation dialog on this screen: is the action irreversible? If not, why is there a dialog?

A reviewer examining a rendered screenshot does not have to guess whether the builder paid attention. Either an unnecessary dialog is on screen or it is not.

Keep a short, universal floor of rules that apply to every screen. Beyond that floor, stop stuffing the prompt. Put the effort into selecting a few strategies per screen before implementation and verifying the rendered result against them afterward.

Join the PathGuided Closed Beta

Onboard your repositories with local-to-cloud spec execution, split-tier model routing, and commit-bound Work Tours.

Request beta access