← Back to list

dcyfr-design-tokens
by dcyfr
DCYFR Labs
⭐ 2🍴 0📅 Jan 25, 2026
SKILL.md
name: dcyfr-design-tokens description: Enforce DCYFR design token patterns and fix hardcoded values license: MIT compatibility: opencode metadata: audience: developers workflow: compliance category: design-system
What I do
I enforce strict design token compliance across the DCYFR portfolio project by:
- Detecting hardcoded Tailwind values (gap-8, text-3xl, max-w-4xl, etc.)
- Replacing them with proper design tokens from
@/lib/design-tokens - Validating color, spacing, typography, and container width usage
- Providing ESLint auto-fix guidance for common violations
When to use me
✅ Use this skill when:
- Fixing ESLint design token violations (
@dcyfr/design-tokens/*) - Converting legacy code to use design tokens
- Reviewing PRs for token compliance
- Implementing new components following DCYFR patterns
❌ Don't use this skill for:
- General Tailwind CSS questions (use documentation)
- Non-DCYFR projects (patterns are project-specific)
- Performance optimization (use dcyfr-performance skill)
Core Rules (NON-NEGOTIABLE)
1. Import Design Tokens
// ✅ CORRECT: Import tokens
import { SPACING, TYPOGRAPHY, CONTAINER_WIDTHS, COLORS } from "@/lib/design-tokens";
// ❌ WRONG: Hardcoded values
<div className="gap-8 text-3xl max-w-4xl text-gray-900">
2. Use Token Categories
| Category | Import | Example Usage |
|---|---|---|
| Spacing | SPACING.section, SPACING.content | mt-${SPACING.section} |
| Typography | TYPOGRAPHY.h1.standard | className={TYPOGRAPHY.h1.standard} |
| Containers | CONTAINER_WIDTHS.standard | className={CONTAINER_WIDTHS.standard} |
| Colors | COLORS.text.primary | className={COLORS.text.primary} |
3. Common Replacements
// Spacing
gap-8 → gap-${SPACING.content}
mt-16 → mt-${SPACING.section}
p-4 → p-${SPACING.card}
// Typography
text-3xl → ${TYPOGRAPHY.h1.standard}
text-sm → text-base (use standard sizes)
// Containers
max-w-4xl → ${CONTAINER_WIDTHS.standard}
max-w-7xl → ${CONTAINER_WIDTHS.wide}
// Colors
text-gray-900 → ${COLORS.text.primary}
bg-neutral-50 → ${COLORS.background.subtle}
Validation Commands
# Check design token compliance
npm run lint
# Auto-fix violations
npm run lint -- --fix
# Enhanced validation (OpenCode-specific)
npm run check:opencode
ESLint Rules
The project uses custom ESLint rules to enforce design tokens:
@dcyfr/design-tokens/no-hardcoded-spacing- Blocksgap-*,mt-*,p-*@dcyfr/design-tokens/no-hardcoded-typography- Blockstext-*size utilities@dcyfr/design-tokens/no-hardcoded-containers- Blocksmax-w-*
Target: ≥90% design token compliance
Common Patterns
Blog Post Card
import { SPACING, TYPOGRAPHY, CONTAINER_WIDTHS } from "@/lib/design-tokens";
export function PostCard() {
return (
<article className={`flex flex-col gap-${SPACING.content}`}>
<h2 className={TYPOGRAPHY.h2.standard}>
{title}
</h2>
<div className={`mt-${SPACING.content}`}>
{excerpt}
</div>
</article>
);
}
Page Layout
import { PageLayout } from "@/components/layouts";
import { CONTAINER_WIDTHS, SPACING } from "@/lib/design-tokens";
export default function Page() {
return (
<PageLayout>
<div className={`mx-auto ${CONTAINER_WIDTHS.standard}`}>
<div className={`mt-${SPACING.section}`}>
Content
</div>
</div>
</PageLayout>
);
}
Related Documentation
- Full enforcement rules:
.github/agents/enforcement/DESIGN_TOKENS.md - Quick reference:
docs/ai/quick-reference.md - Component patterns:
.github/agents/patterns/COMPONENT_PATTERNS.md
Approval Gates
Design token violations are STRICT (hard block):
- ❌ PR builds fail with ESLint errors
- ❌ Pre-commit hooks warn about violations
- ✅ Must fix before merging
No exceptions - design tokens are mandatory for visual consistency.
Score
Total Score
65/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
Reviews
💬
Reviews coming soon


