DocumentationUsing with AI agents

Open in Create
Search
astronomic.dev

Using with AI agents

How a coding agent learns your theme and the kit, and what to give it so it uses the parts you already have.

A coding agent is a tool that reads your project and changes the code for you. It does its best work when it knows the parts you already have. Astronomic UI gives it three sources: the AGENTS.md file in your theme, the kit's README files, and a Markdown copy of any page in this directory.

The AGENTS.md file in your theme

Every Astronomic theme has an AGENTS.md file at the root of its repo. Many coding agents read it on their own when they open the project. If yours reads a different file, point that file at AGENTS.md.

It tells the agent:

TopicWhat it covers
What the theme isIts pages and its content sources
CommandsHow to run, build and test the site
Folder mapWhere the pages, styles, content and kit packages live
RulesToken classes only, no dark: variant, and the theme's own rules

Whether an agent reads the file on its own depends on the tool. If you are not sure, tell your agent to read AGENTS.md before it starts. Then you do not need to repeat these rules in your requests.

The kit's README files

The kit lives in your theme at packages/ui, and Pro parts at packages/ui-pro in a paid theme that uses them. Each package has a README.md with the setup and a table of every part it holds: its props and its slots. In a paid theme, the Pro README lists only the Pro parts that theme includes.

An agent that reads these files knows which parts exist and how to call them.

Copy as Markdown

Each component and section page in this directory has a Copy as Markdown button in its toolbar. It copies the part's docs as Markdown, ready to paste into your agent:

Part of the copyWhat it holds
Name and purposeWhat the part is and when to use it
KindStatic (no JavaScript) or Interactive (a script or a React island)
UsageThe import line
ExamplesEach example's code
PropsA table of every prop, with its type, default and description, and the slots
AccessibilityThe keys it answers to and notes on what it does for you

The copy leaves out the Free or Pro tag and the list of tokens the part reads. Docs pages have the same button. On a page with generated tables, such as Presets, the copy has the tables filled in.

Ask for a change

Name the part and say what you want. Paste the part's Markdown when you want the agent to use it exactly as shown.

text
Add a testimonials section to the home page, after the features.
Use the kit's TestimonialGrid recipe. Here is its page:

<paste the copied Markdown>
text
The pricing page should show one plan, not three.
Swap PricingCards for PricingSingle and keep the same plan text.
text
Make the footer use the FooterColumns recipe.
Keep the links from the current footer.

Common mistakes

Watch for these in the agent's changes:

  • A new component that copies a kit part. Ask the agent to use the kit part, and to pick another recipe or pass other props to change its look.
  • Hard-coded colors or Tailwind's dark: variant. Parts take their colors from the --ui-* tokens, and dark mode swaps the token values. Ask for token classes, such as bg-bg and text-fg.
  • Edits inside packages/ui. You may change the kit, but a change in the theme's own files is easier to keep track of.
  • A Pro part your theme does not include. A paid theme ships only the Pro parts it uses. See Free and Pro.

Tip

Ask the agent to run the theme's checks and build, then open the changed page yourself in light and dark mode and at phone width.

Waitlist

Be first in line

Join the waitlist and we'll email you the moment it's out.

You'll also get our newsletter: new themes, plugins and guides. Unsubscribe any time.