CSS Primer For the AI Era

A vocabulary for shaping interfaces with AI

User Tools

Site Tools


working_with_existing_code:working_with_themes_and_plugins_with_ai

08. Working With Themes and Plugins (How to Keep AI Inside the Boundaries)

How we help AI understand
what belongs to the theme,
what belongs to the plugin,
and 'what must remain untouched'

—Part of CSS Primer for the AI Era — Working with Existing Code

Themes and plugins
create natural boundaries in a system.
Each has its own purpose,
its own responsibilities,
and its own constraints.

But AI does not see these boundaries
unless we draw them.

To AI, 'a theme file' and 'a plugin file'
look identical —
just text waiting to be improved.

Our task is to help AI understand:

  • where it may act,
  • where it must not act,
  • and how the two layers relate
    without crossing into each other.

A simple mental model:

Themes shape appearance.
Plugins shape behavior.
and AI needs us to
name the boundary
.

This page teaches us how to guide AI so it works safely within themes and plugins
without blending responsibilities or breaking the separation that
keeps the system maintainable.


1. AI Cannot See the Difference Between a Theme and a Plugin

AI does not know:

  • which file belongs to the theme
  • which file belongs to the plugin
  • which layer controls structure
  • which layer controls behavior
  • which layer controls styling
  • which layer must remain stable
  • which layer is safe to modify

To AI, everything is simply → the code we showed it.

A simple truth:

We must name the layer
before AI can respect it
.


2. Tell AI Which Layer It Is Working In

We guide AI by declaring the context:

“This is theme code.
It controls appearance only.
Do not change behavior.”

Or:

“This is plugin code.
It controls logic and data.
Do not modify styling or markup.”

Or:

“This file belongs to the theme.
This other file belongs to the plugin.
Please keep their responsibilities separate.”

A simple reminder:

AI respects the boundaries we describe.
It cannot infer them
.


3. Define What the Theme Is Allowed to Change

Themes typically control:

  • layout
  • spacing
  • typography
  • colors
  • component appearance
  • responsive behavior
  • visual hierarchy

We tell AI:

“You may adjust styling, spacing, and layout.
Do not change markup or behavior.”

Or:

“This is a theme override.
Keep the plugin’s structure intact.”

A simple principle:

Themes decorate.
They do not redefine
.


4. Define What the Plugin Is Allowed to Change

Plugins typically control:

  • logic
  • data
  • behavior
  • dynamic content
  • server‑side processing
  • user interactions
  • business rules

We tell AI:

“You may adjust logic, 
but do not modify the theme’s classes.”

Or:

“This plugin outputs markup used by the theme.
Do not rename or restructure it.”

A simple truth:

Plugins provide structure.
Themes rely on that structure
.


5. Prevent AI From Mixing Responsibilities

AI may try to:

  • add CSS inside plugin files
  • add logic inside theme files
  • rename classes used by both layers
  • restructure markup that the theme depends on
  • move responsibilities across boundaries

We prevent this by saying:

“Do not mix theme and plugin responsibilities.
Keep styling in the theme.
Keep logic in the plugin.”

Or:

“This markup is consumed by the theme.
Do not change class names or structure.”

A simple reminder:

Boundaries keep the system predictable.
AI needs us to enforce them
.


6. Show AI Only the Files Relevant to the Task

When working with themes and plugins,
we reveal only what AI needs:

  • the specific theme file
  • the specific plugin file
  • the relevant snippet
  • the relationship between them

We avoid showing:

  • the entire theme
  • the entire plugin
  • unrelated components
  • global configuration
  • files that might distract AI

A simple principle:

We curate the window
so AI stays inside the boundary
.


7. Narrate the Relationship Between Theme and Plugin

AI cannot infer how the two layers interact.
We explain it.

For example:

“The plugin outputs this markup.
The theme styles it.
Please do not change the markup.”

Or:

“The theme overrides this class.
The plugin must keep the class name unchanged.”

Or:

“This plugin provides data to the theme.
Do not modify the data structure.”

A simple truth:

AI understands relationships only when
we describe them
.


8. When AI Suggests Changes Across Layers

AI may propose:

  • renaming classes used by both layers
  • restructuring markup the theme depends on
  • moving logic into the theme
  • moving styling into the plugin
  • introducing new patterns that cross boundaries

We evaluate these suggestions carefully.

If a suggestion crosses layers,
we decline:

“This crosses the boundary between theme and plugin.
Please keep the responsibilities separate.”

A simple reminder:

Boundaries are architectural decisions.
AI does not make architectural decisions
.


9. How to Safely Improve Theme–Plugin Integration

When improvements are needed,
we proceed gently:

  • Identify the boundary.
  • Explain the relationship to AI.
  • Show the relevant snippets.
  • Describe the desired outcome.
  • Ask for the smallest possible change.
  • Review the output carefully.
  • Test both layers together.

For example:

“We want to improve spacing in the theme.
Do not change the plugin’s markup.
Please propose the minimal CSS needed.”

A quiet principle:

Integration improves through clarity,
not through blending
.


10. Closing Note — Boundaries Are Part of the Architecture

Themes and plugins work because they are separate.

AI can help us maintain our themes and plugins,
improve them, and connect them —
but only when we guide AI with
clarity about 'what belongs where'.

A simple closing thought:

AI sees files.
We see boundaries.
Collaboration begins when
we name those boundaries
.



Tony de Araujo —New York | Lisbon


working_with_existing_code/working_with_themes_and_plugins_with_ai.txt · Last modified: by editor