# Agents

Coding agents can read this site without a browser, and can build with ARK from the files the package ships.

## Read the site

Every page has a Markdown twin at the same address with `.md` added. The pages link to it at the bottom, and declare it in the page head as `<link rel="alternate" type="text/markdown">`.

| Address | What it returns |
| --- | --- |
| `/llms.txt` | An index of every page, with a one-line description and a link to its Markdown. |
| `/llms-full.txt` | The whole site as one Markdown document. |
| `/product/components/button.md` | One page as Markdown. Works for every page. |
| `/api/components.json` | Every component family: name, description, parts and related families. |
| `/api/components/button.json` | One family in full: each part's props, variants and what it wraps. |
| `/api/tokens.json` | Palettes, scales and every semantic token's value in each theme. |
| `/api/icons.json` | Every icon: component name, Figma name and import path. |

The reference content is generated from the installed packages, so it describes one exact version. Each response names that version.

## Build with ARK

`@kela-systems/ui-components` ships a skill that tells an agent how to look a component up and compose it. Add this line to the app's `AGENTS.md`:

```text
When writing UI with @kela-systems/ui-components, follow node_modules/@kela-systems/ui-components/skills/use-ark/SKILL.md.
```

The skill reads three files that ship with the packages, so it works offline and matches the installed version:

| File | What it holds |
| --- | --- |
| `@kela-systems/ui-components/dist/meta/index.json` | One line per component family. Read it whole. |
| `@kela-systems/ui-components/dist/meta/<family>.json` | One family's parts, props and variants. Open only the ones you need. |
| `@kela-systems/tokens/dist/utilities.index.json` | How the utility names are built. |

## Rules an agent should follow

- Use a component that exists. If ARK has no fit, use the closest part as it is and say what is missing.
- Pick a look with a variant. A `className` on an ARK part carries layout only.
- Use semantic utilities and logical directions (`ps`, `pe`, `ms`, `me`, `start`, `end`). Never write a raw colour.
- Never write an icon name you haven't found in `@kela-systems/icons/dist/outline/index.d.ts`.
- Pass every user-facing string as a prop, translated.
- Run the app's lint; it catches most of the above.
