Using AI assistants
Coding assistants do not know this library's component contracts by default.
Without the library guidance, they may invent props, reach for a raw <div>
instead of a component, or copy patterns from a different design system.
Add the generated project guidance for your tool below. It gives the assistant the component map and house rules; use the linked component docs for the full API and use the migration guide for v1 applications.
- GitHub Copilot
- Cursor
- Claude Code
- Anything else
For GitHub Copilot, put the generated guidance at
.github/copilot-instructions.md. Copilot loads that file for work in the
repository; this is the Copilot-specific path.
mkdir -p .github
cp node_modules/@takeoff-ui/react-spar/agents/AGENTS.template.md \
.github/copilot-instructions.md
If the file already exists, merge the generated Rules and Components sections into it instead of overwriting the repository's instructions. Commit the resulting instructions file so the whole team gets the same guidance.
Copilot's agent mode can also use an AGENTS.md file at the repository root.
Inline completions do not load either file as a complete project guide; they
mainly use the current editor context.
Check it worked: open Copilot Chat and ask it to "add a primary button that
shows a loading spinner". You should get Button from @takeoff-ui/react-spar
with a loading prop — not a hand-rolled <button>.
Cursor reads AGENTS.md at the repository root automatically.
cp node_modules/@takeoff-ui/react-spar/agents/AGENTS.template.md ./AGENTS.md
If AGENTS.md already exists, merge the generated sections instead of
overwriting it. Commit the resulting instructions file so the whole team gets
the same guidance.
Optional — to scope the rules to your UI code instead of the whole
repository, use a rule file at .cursor/rules/takeoff.mdc with the same
content, prefixed with:
---
globs: ['src/**/*.tsx']
---
Check it worked: ask Cursor for "a primary button that shows a loading
spinner". You should get Button from @takeoff-ui/react-spar with a
loading prop — not a hand-rolled <button>.
Claude Code reads AGENTS.md (or CLAUDE.md) at the repository root
automatically.
cp node_modules/@takeoff-ui/react-spar/agents/AGENTS.template.md ./AGENTS.md
If AGENTS.md or CLAUDE.md already exists, merge the generated sections
instead of overwriting it. Commit the resulting instructions file so the whole
team gets the same guidance.
Check it worked: ask for "a primary button that shows a loading spinner".
You should get Button from @takeoff-ui/react-spar with a loading prop —
not a hand-rolled <button>.
Another editor or CLI agent? If the tool supports AGENTS.md, copy the
template to the repository root:
cp node_modules/@takeoff-ui/react-spar/agents/AGENTS.template.md ./AGENTS.md
Some tools need to be pointed at it explicitly. Check the tool's docs if it does
not load AGENTS.md automatically.
A chat window instead? For ChatGPT, Gemini, or a self-hosted model, give it the whole library once at the start of the session:
https://takeoff-v2.app.turkishtechlab.com/llms-full.txt
That single file contains every component's API and usage guidance. For a
smaller payload, paste just the component you're working on — append .md to
any docs URL:
https://takeoff-v2.app.turkishtechlab.com/docs/components/button.md
Package version note
Requires 0.4.0 or newer. If the agents/ directory isn't in your
node_modules, you're on an older version — upgrade, or copy from the
template on GitHub.
Already have that file? Don't overwrite it — paste the Rules and Components sections from the template into what you have.
Migrating a v1 application
For a v1-to-v2 migration, use the AI assistant as the primary operator for the repetitive work instead of manually rewriting every screen. The migration skill ships in the package, so there is nothing to clone:
ls node_modules/@takeoff-ui/react-spar/agents/migrate-takeoff-v1/
SKILL.md is the entry point; the references/ directory beside it holds the
inventory commands, the v1-to-v2 component map, the prop and event translation,
the one-time setup, and the known coverage gaps. To keep it beside the guidance
your assistant already loads, copy it into the repository:
mkdir -p .agents/skills
cp -R node_modules/@takeoff-ui/react-spar/agents/migrate-takeoff-v1 \
.agents/skills/migrate-takeoff-v1
migrate v1 ./src is a request to an AI assistant in Chat or Agent mode. It is
not a shell command and there is no migrate executable installed by the npm
package. Open the consumer repository as the assistant's workspace, then send
the request there:
Read node_modules/@takeoff-ui/react-spar/agents/migrate-takeoff-v1/SKILL.md and
migrate the React app at ./src from @takeoff-ui/react v1 to
@takeoff-ui/react-spar v2. Start with the inventory in references/inventory.md.
If the v2 packages, provider, or token CSS are missing, apply the one-time setup
before migrating a screen. Then migrate one bounded screen at a time, use the v2
component-specific API docs, keep v1 and v2 installed together, run focused
typecheck/tests after each screen, and report remaining gaps before continuing.
For a large application, continue with a route or screen boundary:
Migrate the /settings screen from the v1 inventory. Keep documented v1-only
gaps in place and show the diff plus validation results.
The assistant must not silently replace a v1-only gap component or remove v1 packages before the inventory confirms that only explicitly approved gaps remain. See Migrating from v1 for the complete workflow.
Giving it the full API
The file you just copied is an index: every component, what it's for, and the house rules. It deliberately doesn't include full prop tables — that would be too large to keep in context.
When an assistant needs the complete API for a component, point it at the
Markdown docs. Every page is available by appending .md to its URL:
| URL | Use it for |
|---|---|
/docs/components/<name>.md | One component. Start here — smallest payload. |
/llms-full.txt | The entire library, in one file. |
/llms.txt | An index of every page, for tools that crawl. |
These include guidance the API tables alone don't carry: when to reach for a component, and which neighbouring component to use instead when it isn't the right fit.