design system token v0.5.1

This commit is contained in:
Juan
2026-04-16 11:10:06 -05:00
parent b8168261a1
commit 64d7df1439
4 changed files with 107 additions and 87 deletions

View File

@@ -1,15 +1,15 @@
#!/usr/bin/env npx tsx
/**
* Generates skill/SKILL.md and skill/AGENT.md from the shared component
* Generates skill/SKILL.md and skill/AGENTS.md from the shared component
* catalog and W3C DTCG token files. Run via `pnpm skill:build`.
*
* Both the MCP server and this script read from lib/catalog.ts and
* tokens/*.json, so all outputs stay in sync.
*
* Outputs:
* skill/SKILL.md — Claude Code skill (loaded via .claude/skills/)
* skill/AGENT.md — Generic AI agent instructions (Cursor, Copilot, etc.)
* skill/SKILL.md Full design system reference (tokens, components, rules)
* skill/AGENTS.md — Project-level instructions for any AI coding agent
*/
import * as fs from 'fs'
@@ -45,7 +45,7 @@ function componentCount(): number {
}
// ---------------------------------------------------------------------------
// Shared content blocks (used by both SKILL.md and AGENT.md)
// Shared content blocks (used by both SKILL.md and AGENTS.md)
// ---------------------------------------------------------------------------
function buildDesignPhilosophy(): string {
@@ -261,7 +261,7 @@ This skill gives you full context to generate pixel-perfect, on-brand UI using t
}
// ---------------------------------------------------------------------------
// AGENT.md (project-level instructions for non-Claude AI agents)
// AGENTS.md (project-level instructions for non-Claude AI agents)
// ---------------------------------------------------------------------------
function generateAgent(): string {
@@ -279,8 +279,8 @@ function generateAgent(): string {
> **Auto-generated** by the Greyhaven Design System.
> Re-generate: \`pnpm skill:build\` in the design system repo.
>
> Copy this file to your project root as \`AGENT.md\`, \`.cursorrules\`,
> or \`.github/copilot-instructions.md\` depending on your AI tool.
> Copy this file to your project root as \`AGENTS.md\` (standard), \`CLAUDE.md\`,
> \`.cursorrules\`, or \`.github/copilot-instructions.md\` depending on your AI tool.
This project uses the **Greyhaven Design System**.
@@ -345,12 +345,12 @@ function main() {
const skillLines = skill.split('\n').length
console.log(`skill/SKILL.md generated (${skillLines} lines, ${componentCount()} components)`)
// AGENT.md
// AGENTS.md
const agent = generateAgent()
const agentPath = path.join(outDir, 'AGENT.md')
const agentPath = path.join(outDir, 'AGENTS.md')
fs.writeFileSync(agentPath, agent, 'utf-8')
const agentLines = agent.split('\n').length
console.log(`skill/AGENT.md generated (${agentLines} lines, ${componentCount()} components)`)
console.log(`skill/AGENTS.md generated (${agentLines} lines, ${componentCount()} components)`)
}
main()