Skip to content

AI Entry - Start Here

activeUpdated

Bạn là AI agent đang work trên DOL Education? Đây là entry duy nhất bạn cần đọc đầu tiên. Từ file này bạn sẽ biết: hard rules nào luôn apply, file detail nào load cho task của bạn, và cách self-verify trước khi declare done.

This single file gives you (a) hard rules that always apply, (b) a router from “what I’m doing” → “what file to read next”, and (c) a self-check before shipping. Detail content lives in linked files - load on demand, not eagerly.


DOL Edu = multi-repo education platform. Product pipeline: Spec (EduDoc) → Demo/validation (Playground) → Publish/runtime (Wiki). All code surfaces consume one design-system source: DS-Token.

Repo / surfaceRoleDesign-system consumption
DOL-DS-tokenToken, UI guideline, Tailwind/runtime mapping authorityOwns tokens/v4/, color contract, shared Tailwind helpers, Studio
DOL Education Documentation (EduDoc)Product spec, UX behavior, domain knowledgeStatic prototype CSS subset in assets/css/
dol-edu-playgroundRuntime demo/validation (React + Vite + TW v4 + TS)tailwind.config.cjs imports DS-Token color/shadow helpers; tokens:gen emits subset
DOL Wiki/sitePublish/docs runtime (Next.js + TW v4 + TS)tailwind.config.ts imports DS-Token color/shadow helpers; tokens:gen emits subset
DOL-DS-token/studioDS-owned design-system browser, mounted under Wiki at /design-system/studio/tailwind.config.cjs imports the same helpers; studio:build slims token CSS

Token mapping chain: tokens/v4/ → tailwind-color-contract.json → tailwind-color-config.cjs + tailwind-shadow-scale.js → consumer tailwind.config.* → generated token CSS → Tailwind classes.

Token changes propagate via node scripts/tokens-propagate.mjs. For the exact consumer contract and verification commands, read ../../docs/consumer-token-adapter.md.

For workspace-wide context (skills, hooks, approval matrix) → workspace CLAUDE.md (auto-loaded by Claude Code).


2. Hard rules (non-negotiable - apply to EVERY task)

Section titled “2. Hard rules (non-negotiable - apply to EVERY task)”

[!warning] Non-negotiable. Violating any rule below = stop, ask, fix.

These are the safety net. Memorize, don’t skip - even if you don’t load any detail file, never violate these.

  • Brand = bg-brand-* (custom class, NOT bg-red-*). bg-red-* = danger/error only.
  • Canonical shade = -600 (NOT TW default -500).
  • Text on colored/inverse bg = text-on-inverse-primary (--white-w100). text-white = --neutral-n00.
  • Neutral family = slate-* only. Never gray-* / zinc-* / neutral-* / stone-*.
  • No pure text-black. Use text-slate-900 as darkest.
  • Max 2 semantic accent colors per view.
  • If skill color and status color both apply, status is the feedback signal; skill color becomes context only.
  • 2 fonts only: Plus Jakarta Sans (heading) + Inter (body). Noto Serif reserved for quote/editorial.
  • Body baseline = 14px (text-sm). Never <13px.
  • Heading font-weight ≥ body by ≥1 level.
  • White-on-white elements: border-slate-200 mandatory. Shadow supplements, never replaces border.
  • Tab/segmented container: bg-slate-50 (NOT bg-slate-100).
  • Light-first. Dark allowed only for: overlay/scrim, media frame, small floating utility UI.
  • For toolbars, side rails, icon stacks, and micro-navigation: start with transparent composition or one minimal shared shell. Do not box every child by default.
  • Background color should signal containment, status, interaction, or elevation. If it adds no clear meaning, remove it.
  • Static classes only. No bg-${color}-600 (tree-shaken by scanner).
  • No bg-(--token) or var(--token) in class attributes.
  • No hex in class names. bg-[#D42525]bg-brand-600.
SkillClass
Readingbg-emerald-* / text-emerald-600
Listeningbg-blue-* / text-blue-600
Writingbg-amber-* / text-amber-600
Speakingbg-rose-* / text-rose-600 (NOT brand red)
Full/Online Testbg-purple-* / text-purple-600
AI Featuresbg-sky-* / text-sky-600

For full hard-rule list with rationale → CODE-UI.md §2. For “why these rules exist” → ../ds-guideline/DIRECTION.md.


3. Context defaults (assume unless user says otherwise)

Section titled “3. Context defaults (assume unless user says otherwise)”
  • Framework: React 19 + Tailwind CSS v4 + TypeScript 6
  • Target repo: dol-edu-playground (runtime) or DOL Wiki/site (publish) - pick by task; ask if unclear
  • UI copy language: Vietnamese
  • Code comments: English
  • Theme: Light-first (dark only per §2.3 carve-outs)
  • Component reuse: check ui-registry/ (DS-Token) and target repo’s src/components/ui/ BEFORE creating new
  • Aesthetic baseline: warm-professional · soft-large radius · generous whitespace · subtle shadow

Match your task → load the listed file(s). Don’t load more than needed.

4.1 Building / modifying UI code (Tailwind + React)

Section titled “4.1 Building / modifying UI code (Tailwind + React)”

Primary: CODE-UI.md (this folder) - comprehensive code-UI router with hard rules, context defaults, full task table mapping to specific CORE.md sections, self-check (Q1-Q8 quantified gates), and anti-pattern scope scan.

For very fast lookup of one-off questions:

Sub-taskRead
Pick a Tailwind color class../ui-style-guide/CORE.md §2 Color
Color deep mapping (18 families, edge cases)../../docs/tailwind-color-guideline.md
External AI paste mode (Cursor / v0 / Figma Make)../../docs/ai-color-context.md (self-contained color context)
Bridge architecture / TW v4 setup / dark mode / FAQ../../docs/DS-Tailwind-Bridge-Guide.md
Why a color decision was made (philosophy)../../docs/color-system-rules.md (34 Phase-1 rules)
Pattern lookup (named UI patterns)../pattern-registry.md
Anti-pattern lookup (151 rows × 26 scopes)../anti-pattern-registry.md

4.2 AI-assisted Figma design (components, variables, organizer)

Section titled “4.2 AI-assisted Figma design (components, variables, organizer)”

Primary: FIGMA-AI.md (this folder) - entry for design work in Figma file (DS V2 components, variable binding, canvas organizer).

Sub-taskRead
Variable binding to Figma nodeworkspace skill figma-bind-variable
Component instantiation in Figmaworkspace skill figma-instantiate-component
Build Figma screen from code/descriptionCodex skill figma-generate-design
Build/extend DS library (tokens, styles)Codex skill figma-generate-library
Figma → code (1:1 implementation)workspace skill figma-implement-design
TaskRead
Refactor touching 2+ repos (DS-Token, EduDoc, Playground, Wiki)workspace skill .claude/skills/cross-repo-refactor/SKILL.md
Token value change → propagate downstreamworkspace skill .claude/skills/dol-token-propagation/SKILL.md
Audit UI qualityworkspace skill .claude/skills/ui-quality-audit/SKILL.md
Anti-entropy sweep / stale lessonsworkspace skill /janitor
Approve learnings → persist to ai-memoryworkspace skill /reflect

For full skill registry → workspace SKILLS_REGISTRY.md.

TopicRead
Design philosophy / aesthetic intent / AI slop fingerprints../ds-guideline/DIRECTION.md
Specific topic philosophy (typography / color / spacing / radius / shadow / composition)../ds-guideline/{topic}.md
KID domain overrides (children’s product)../kid/Design System Guideline/KID_DS_Basic_Guideline.md
Color decision framework (34 rules from Phase 1 work)../../docs/color-system-rules.md

→ Read ../ui-style-guide/CORE.md in full. It is the single canonical UI reference (13 sections covering platform identity, color, typography, spacing, radius, surface, shadow, borders, components, motion, anti-patterns, KID overrides). Reading CORE.md alone is enough to build code that matches DOL standards.


[!important] Run this checklist before saying “done.” Skipping it is the most common cause of regressions.

Run through this compact checklist. For full quantified gates (Q1-Q8) and anti-pattern scope scan, see CODE-UI.md §5.

Color

  • No bg-red-* for brand accent? Use bg-brand-*.
  • No text-white on vivid bg (500-600)? Use text-on-inverse-primary.
  • No gray-* / zinc-* / neutral-* / stone-*? Use slate-*.
  • Canonical shade -600 used? No hex in classes?
  • ≤2 semantic accent colors in view?
  • Skill color does not override status color when both apply?

Typography

  • Body ≥14px (text-sm)? Only Plus Jakarta + Inter?

Surface

  • White card has border-slate-200? Tab uses bg-slate-50?
  • Toolbar / utility rail avoids decorative dark paneling or per-child boxing unless the shell has a clear role?

Tailwind

  • Static classes only? No bg-${...}-600? No var(--token) in className?

Interaction

  • Hover/focus state on interactive elements? Click target ≥36px (44px primary)?

Skill UI (if applicable)

  • Reading=emerald · Listening=blue · Writing=amber · Speaking=rose · Test=purple · AI=sky?

Automation gates (run if touching guideline files)

Terminal window
bash ../ui-style-guide/audit.sh <dir> # 19-pattern grep check
python3 ../ui-style-guide/contrast-check.py # WCAG AA validate

Audit clean ≠ design-correct. Q1-Q8 + anti-pattern scope still required (CODE-UI.md §5.1-5.2).


✅ Always-relevant (load on demand based on task)

Section titled “✅ Always-relevant (load on demand based on task)”
FilePurpose
CODE-UI.md (this folder)Code-UI entry router - DETAILED
FIGMA-AI.md (this folder)Figma-AI entry router - DETAILED
../ui-style-guide/CORE.mdSingle canonical UI reference (13 sections, fallback if uncertain)
../ui-style-guide/{landing,practice,data-entry}.mdProduct-specific patterns extending CORE
../../docs/DS-Tailwind-Bridge-Guide.mdNarrative entry: TL;DR + architecture + setup + FAQ
../../docs/tailwind-color-guideline.mdFull 18-family color reference
../../docs/ai-color-context.mdPaste-into-AI-prompt color context (self-contained)
../../docs/color-system-rules.md34 color decision rules (Phase 1)
../pattern-registry.mdNamed UI patterns index
../anti-pattern-registry.md151 anti-pattern rows (auto-generated)
Terminal window
bash ../ui-style-guide/audit.sh <dir> # grep violations
python3 ../ui-style-guide/contrast-check.py # WCAG AA
python3 ../ui-style-guide/extract-anti-patterns.py # regen registry
python3 figma-ai/tools/lookup.py <subcommand> # Figma metadata CLI (TIER 0)

📚 Read for “why” only (philosophy / Figma intent)

Section titled “📚 Read for “why” only (philosophy / Figma intent)”
FileWhen
../overview.mdHuman-facing design system orientation
../ds-guideline/DIRECTION.mdDesign philosophy + AI slop fingerprints
../ds-guideline/{typography,color,spacing,radius,shadow}.mdTopic-specific Figma intent
../kid/**KID domain UI

../../design-system-report/** (historical reports), ../operations/** (Figma MCP runbooks), ../../docs/alpha-decomposition-spec.md (token math).


  1. Hard rules § 2 - never break them. They’re the safety floor.
  2. CORE.md is the single canonical UI reference. When unsure, read it in full.
  3. Match task → router § 4 - load only what you need.
  4. Self-check § 5 before saying done.
  5. Cite anti-pattern by ID when refusing/rewriting (e.g., slop-02, core-11-color).

  • In this folder: orientation + routers + safety-net for AI agents
  • Not in this folder: actual guideline content → ../ui-style-guide/ / ../ds-guideline/ / ../../docs/
  • Human-facing overview: ../overview.md

When adding a new task domain (e.g., DOC-EDIT.md, CONTENT-AUDIT.md):

  1. Create new entry file in this folder
  2. Add a row to §4 task router
  3. Keep each entry focused - don’t merge domains

Pattern validated R6 (2026-04-23). Decision lesson: ai-memory/lessons/ai-entry-pattern-vs-split-decision.md.