@usevyre/ai-context
Single source of truth for all AI tooling. Generates structured context for Claude,
Cursor, Windsurf, and Copilot — component schemas, cheat sheets, anti-patterns, and
version info — all from one components.json file.
Installation
npm install @usevyre/ai-context
# or
pnpm add @usevyre/ai-context Usage per tool
Each AI tool has a dedicated export. Copy the content into your project's config file once — it stays in sync whenever you update the package.
The package ships pre-built markdown files — no build step required in your project.
Claude (CLAUDE.md)
node -e "
const { claudeContext } = await import('@usevyre/ai-context');
require('fs').writeFileSync('CLAUDE.md', claudeContext);
" Or reference directly in your system prompt:
import { claudeContext } from '@usevyre/ai-context';
// inject into system prompt
const systemPrompt = claudeContext + yourOtherInstructions; Cursor (.cursor/rules)
node -e "
const { cursorRules } = await import('@usevyre/ai-context');
require('fs').mkdirSync('.cursor', { recursive: true });
require('fs').writeFileSync('.cursor/rules', cursorRules);
" Windsurf (.windsurf/rules)
node -e "
const { windsurfRules } = await import('@usevyre/ai-context');
require('fs').mkdirSync('.windsurf', { recursive: true });
require('fs').writeFileSync('.windsurf/rules', windsurfRules);
" Copilot (.github/copilot-instructions.md)
node -e "
const { copilotInstructions } = await import('@usevyre/ai-context');
require('fs').mkdirSync('.github', { recursive: true });
require('fs').writeFileSync('.github/copilot-instructions.md', copilotInstructions);
" Exports
| Export path | Content |
|---|---|
@usevyre/ai-context | JS module — all exports as structured data |
@usevyre/ai-context/claude | CLAUDE.md formatted markdown |
@usevyre/ai-context/cursor | .cursor/rules formatted markdown |
@usevyre/ai-context/windsurf | .windsurf/rules formatted markdown |
@usevyre/ai-context/copilot | .github/copilot-instructions.md markdown |
@usevyre/ai-context/schema | Full component schema JSON |
@usevyre/ai-context/anti-patterns | All hallucination patterns JSON |
@usevyre/ai-context/cheat-sheets | Per-component cheat sheet index |
@usevyre/ai-context/version-info | Version and compatibility info |
@usevyre/ai-context/tokens | Design token reference JSON — semantic colors with light/dark values, usage, related tokens |
@usevyre/ai-context/tokens-md | Design token reference markdown — ready to paste into AI prompts |
JS API
import {
schema, // full component schema
antiPatterns, // all hallucination patterns
versionInfo, // version + compatible package versions
cheatSheets, // per-component cheat sheet strings
claudeContext, // ready-to-paste CLAUDE.md content
cursorRules, // ready-to-paste .cursor/rules content
windsurfRules, // ready-to-paste .windsurf/rules content
copilotInstructions,
} from '@usevyre/ai-context';
// Access a single component
const button = schema.components.Button;
console.log(button.props.variant.values);
// → ["primary", "secondary", "ghost", "accent", "teal", "danger"] Token Reference API
@usevyre/ai-context/tokens exposes the full design token reference as structured
data — useful for MCP servers, custom agents, or any tool that needs to query tokens
programmatically rather than parsing markdown.
import tokensRef from '@usevyre/ai-context/tokens';
// All 30 semantic color tokens with light + dark values, usage, and related tokens
const accent = tokensRef.categories.color.semantic.find(t => t.name === 'color.semantic.accent');
console.log(accent.values); // { light: "#7c3aed", dark: "#a78bfa" }
console.log(accent.usage); // ["Button primary background", "Link active state", ...]
console.log(accent.relatedTokens); // ["color.semantic.accent-hover", ...]
// Spacing, typography, border-radius, shadow, transition, z-index
console.log(tokensRef.categories.spacing.tokens.map(t => t.cssVar));
// AI usage rules
console.log(tokensRef.rules); // 8 rules for AI agents