xinetzone/SpecWeave / .agents/skills/design-library-creator
design-library-creator
FlaggedCreate, expand, and refine professional Design Libraries / Design Systems with structured token architecture. ONLY invoke when user EXPLICITLY mentions design-system terminology: 'Design Library', 'Design System', '设计系统', '设计库', 'token system', 'design tokens', '组件库规范', or provides a parsed design-spec bundle (ZIP/Figma export). Also covers creating a new theme / color theme as a design-system deliverable (创建主题/新建暖色主题/深色主题等 — tokens + palette + component styling). Do NOT route here for: '素材库', '全套素材', '素材合集', '物料库', '生成素材', '做一套设计', '做几张图', '设计一套页面', '帮我出图', page/poster/landing-page creation, or any visual-asset generation intent where the user does not demonstrate knowledge of design-system concepts. Those belong to solo-design.
scripts/validate-design-library-output.mjs
View on GitHub#!/usr/bin/env node
import fs from 'node:fs';
import path from 'node:path';
import { validateDesignLibraryOutput } from './check-design-library-phase.mjs';
function exists(filePath) {
return fs.existsSync(filePath);
}
function parseArgs(argv) {
const args = {
outputDir: undefined,
maxMs: undefined,
tokenInput: undefined,
requireUiKitPlan: false,
};
for (let index = 0; index < argv.length; index += 1) {
const arg = argv[index];
if (arg === '--max-ms') {
args.maxMs = Number(argv[index + 1]);
index += 1;
} else if (arg === '--token-input') {
args.tokenInput = argv[index + 1];
index += 1;
} else if (arg === '--require-uikit-plan') {
args.requireUiKitPlan = true;
} else if (arg === '--json') {
// JSON output is the default; keep the flag for explicit callers.
} else if (!arg.startsWith('--') && !args.outputDir) {
args.outputDir = arg;
}
}
return args;
}
const { outputDir, maxMs, tokenInput, requireUiKitPlan } = parseArgs(process.argv.slice(2));
if (!outputDir) {
console.error('Usage: validate-design-library-output.mjs <output_dir> [--max-ms N] [--token-input design-tokens.json] [--require-uikit-plan] [--json]');
process.exit(2);
}
const rootDir = path.resolve(outputDir);
if (!exists(rootDir) || !fs.statSync(rootDir).isDirectory()) {
console.error(`Output directory does not exist: ${rootDir}`);
process.exit(2);
}
// Auto-enable uikit-plan validation when the plan file exists in the output dir,
// so the final (phase=all) validation never silently skips the component allowlist check.
// Auto-enabled mode is ADVISORY: uikit-plan gate findings are downgraded to warnings
// (legacy outputs without data-component markers must not start failing the final gate).
// Explicit --require-uikit-plan keeps them as hard failures.
const autoEnabled = !requireUiKitPlan && exists(path.join(rootDir, 'uikit-plan.json'));
const summary = validateDesignLibraryOutput(rootDir, {
phase: 'all',
tokenInput,
requireUiKitPlan: requireUiKitPlan || autoEnabled,
});
if (autoEnabled) {
const planFailures = summary.failures.filter((failure) => failure.gate === 'uikit-plan');
if (planFailures.length > 0) {
summary.failures = summary.failures.filter((failure) => failure.gate !== 'uikit-plan');
summary.warnings.push(
...planFailures.map((failure) => ({ ...failure, reason: `${failure.reason} (advisory: auto-enabled uikit-plan check; pass --require-uikit-plan to enforce)` })),
);
summary.ok =
summary.failures.length === 0 &&
summary.jsonFailures.length === 0 &&
summary.undefinedCssVars.length === 0 &&
summary.localCssVarDeclarations.length === 0 &&
summary.previewLinkFailures.length === 0 &&
summary.localImageRefFailures.length === 0 &&
summary.uiKitFailures.length === 0 &&
summary.componentSlugMismatches.length === 0;
}
}
if (Number.isFinite(maxMs) && summary.elapsedMs > maxMs) {
summary.warnings.push({
file: '.',
reason: `validator exceeded max-ms: ${summary.elapsedMs} > ${maxMs}`,
});
}
console.log(JSON.stringify(summary, undefined, 2));
process.exit(summary.ok ? 0 : 1);
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |