Skip to content
Agent Orchestration
Skill

/css-design-tdd

Test-driven CSS design system modifications. Run checks before/after CSS changes to verify token usage, variable definitions, fallbacks, and consistency. Use when modifying CSS tokens, fixing design inconsistencies, or auditing CSS architecture.

From plugin
vmark
91810 skills6 agents7 commands1 MCP

Claude Code

$ npx -y skills add xiaolai/vmark --skill css-design-tdd --agent claude-code

SKILL.md

css-design-tdd.SKILL.md
name: css-design-tdd
description: Test-driven CSS design system modifications. Run checks before/after CSS changes to verify token usage, variable definitions, fallbacks, and consistency. Use when modifying CSS tokens, fixing design inconsistencies, or auditing CSS architecture.

CSS Design System TDD

Overview

Apply TDD principles to CSS design system work: 1. **RED**: Run checks that reveal current issues 2. **GREEN**: Fix CSS to pass checks 3. **REFACTOR**: Verify no regressions, clean up

Available Checks

1. Undefined Variable Check

Find CSS variables used but never defined:

# Extract all var(--name) usages
grep -rhoE 'var\(--[a-zA-Z0-9-]+' src/**/*.css | sort -u | sed 's/var(//' > /tmp/css-vars-used.txt

# Extract all --name: definitions
grep -rhoE '^[[:space:]]*--[a-zA-Z0-9-]+:' src/**/*.css | sed 's/://' | sed 's/^[[:space:]]*//' | sort -u > /tmp/css-vars-defined.txt

# Find undefined (used but not defined)
comm -23 /tmp/css-vars-used.txt /tmp/css-vars-defined.txt

2. Missing Fallback Check

Find `var(--name)` without fallbacks in container blocks:

# Blockquote variables without fallback
grep -n 'var(--[^,)]*)[^,]' src/components/Editor/editor.css | grep -E 'blockquote|alert|details'

# All containers - should have fallbacks for --list-indent, etc.
grep -rn 'var(--list-indent)' src/**/*.css  # Should be var(--list-indent, 1em)

3. Hardcoded Color Check

Find hex/rgba colors that should be tokens:

# Hex colors outside :root definitions
grep -rn '#[0-9a-fA-F]\{3,6\}' src/**/*.css | grep -v ':root' | grep -v 'var(--'

# Hardcoded rgba (should be tokens in dark mode)
grep -rn 'rgba(255, 255, 255' src/**/*.css | grep -v ':root'

4. Container Consistency Check

Verify container blocks use consistent values:

# Check margins across containers
echo "=== MARGINS ==="
grep -rn 'margin:.*em' src/components/Editor/editor.css src/plugins/alertBlock/*.css src/plugins/detailsBlock/*.css

# Check padding
echo "=== PADDING ==="
grep -rn 'padding:' src/components/Editor/editor.css src/plugins/alertBlock/*.css src/plugins/detailsBlock/*.css | head -20

# Check list multipliers
echo "=== LIST MULTIPLIERS ==="
grep -rn 'list-indent.*\*' src/**/*.css

5. Focus Indicator Check

Find interactive elements without focus styles:

# Find elements with hover but no focus-visible
for file in src/**/*.css; do
  if grep -q ':hover' "$file" && ! grep -q ':focus-visible\|:focus' "$file"; then
    echo "Missing focus: $file"
  fi
done

6. Token Usage Audit

Check if specific tokens are used consistently:

# Radius token usage
echo "=== RADIUS ==="
grep -rn 'border-radius:' src/**/*.css | grep -v 'var(--radius'

# Shadow token usage
echo "=== SHADOWS ==="
grep -rn 'box-shadow:' src/**/*.css | grep -v 'var(--shadow\|var(--popup-shadow'

TDD Workflow

Phase 1: RED (Establish Baseline)

# Run all checks, save baseline
echo "=== CSS TDD BASELINE ===" > /tmp/css-baseline.txt
echo "Date: $(date)" >> /tmp/css-baseline.txt

# Run each check category
echo -e "\n### Undefined Variables ###" >> /tmp/css-baseline.txt
# ... run check 1 ...

echo -e "\n### Missing Fallbacks ###" >> /tmp/css-baseline.txt
# ... run check 2 ...

# Count issues
echo -e "\n### Summary ###" >> /tmp/css-baseline.txt
wc -l /tmp/css-baseline.txt

Phase 2: GREEN (Fix Issues)

For each issue category:

1. **Read the target file** to understand context 2. **Make the minimal fix** (add fallback, use token, etc.) 3. **Re-run the specific check** to verify fix

Example fix workflow:

# Before: verify issue exists
grep -n 'var(--list-indent)' src/components/Editor/editor.css

# Make fix in editor.css (add fallback)
# var(--list-indent) → var(--list-indent, 1em)

# After: verify issue resolved
grep -n 'var(--list-indent)' src/components/Editor/editor.css  # Should show fallbacks

Phase 3: REFACTOR (Verify No Regressions)

# Run full check suite again
# Compare to baseline - issues should decrease, not increase

# Visual verification
pnpm dev  # Check in browser: light mode, dark mode, all container types

Check Scripts

Quick Check (run before/after changes)

#!/bin/bash
# scripts/css-quick-check.sh

echo "=== CSS Quick Check ==="

echo -e "\n1. Missing Fallbacks:"
grep -rn 'var(--list-indent)[^,]' src/**/*.css 2>/dev/null | grep -v '1em)' || echo "  ✓ All fallbacks present"

echo -e "\n2. Hardcoded Dark Hover:"
grep -rn 'rgba(255, 255, 255, 0.08)' src/**/*.css 2>/dev/null | wc -l | xargs -I{} echo "  {} occurrences (should be 0)"

echo -e "\n3. Container Margin Consistency:"
echo "  Blockquote:" && grep -o 'margin:.*em' src/components/Editor/editor.css | grep -A1 blockquote | head -1
echo "  Alert:" && grep -o 'margin:.*em' src/plugins/alertBlock/alert-block.css | head -1
echo "  Details:" && grep -o 'margin:.*em' src/plugins/detailsBlock/details-block.css | head -1

echo -e "\n4. Focus States:"
for f in src/plugins/detailsBlock/*.css src/plugins/alertBlock/*.css; do
  if ! grep -q 'focus-visible' "$f" 2>/dev/null; then
    echo "  Missing focus-visible: $f"
  fi
done

echo -e "\nDone."

Full Audit (run before major changes)

#!/bin/bash
# scripts/css-full-audit.sh

echo "=== CSS Full Audit ==="
echo "Date: $(date)"

echo -e "\n## 1. Undefined Variables"
grep -rhoE 'var\(--[a-zA-Z0-9-]+' src/**/*.css 2>/dev/null | sort -u | sed 's/var(//' > /tmp/used.txt
grep -rhoE '^\s*--[a-zA-Z0-9-]+:' src/**/*.css 2>/dev/null | sed 's/://' | tr -d ' ' | sort -u > /tmp/defined.txt
comm -23 /tmp/used.txt /tmp/defined.txt

echo -e "\n## 2. Hardcoded Hex Colors (outside :root)"
grep -rn '#[0-9a-fA-F]\{3,6\}' src/**/*.css 2>/dev/null | grep -v ':root' | grep -v '\.svg' | wc -l

echo -e "\n## 3. Hardcoded Z-Index"
grep -rn 'z-index: [0-9]' src/**/*.css 2>/dev/null | grep -v 'var(--' | wc -l

echo -e "\n## 4. Border Radius Not Using Tokens"
grep -rn 'border-radius:' src/**/*.css 2>/dev/null |
Read more
@xiaolai
Ships withvmark

The Plain-Text Workspace Where Humans and AI Collaborate Free. Local-first. Format-aware. VMark is the plain-text workspace where humans and AI collaborate.

91810 skills6 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
918
Star history of xiaolai/vmark on GitHub, a chart by star-history.com

Other skills on vmark.

mcp-dev

mcp-dev

Build or change VMark's MCP integration - the server/mcp sidecar's tools and schemas, the Rust bridge, the frontend bridge…

@xiaolai@xiaolaiInstall Skill
plan-audit

plan-audit

Audit or verify an implementation against a plan (dev-docs/plans/* or .claude/tdd-guardian/*). Audit mode inspects for gaps,…

@xiaolai@xiaolaiInstall Skill
planning

planning

Create comprehensive implementation plans and write them to plan files. Use when the user asks for a plan, comprehensive plan,…

@xiaolai@xiaolaiInstall Skill
react-app-dev

react-app-dev

Implement or modify VMark React UI with project conventions (Zustand selectors, Tailwind v4, shadcn/ui). Use for components,…

@xiaolai@xiaolaiInstall Skill
rust-tauri-backend

rust-tauri-backend

Implement or modify VMark's Rust/Tauri v2 backend and its frontend bridge - Tauri commands, invoke/emit/listen IPC, menu items…

@xiaolai@xiaolaiInstall Skill
tauri-mcp-testing

tauri-mcp-testing

E2E testing of a running VMark debug build through the Tauri MCP server - session management, webview interaction, IPC…

@xiaolai@xiaolaiInstall Skill

More skills from other plugins.

1password

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

openclaw3d395k
@steipete@steipeteInstall Skill
jira-tickets

jira-tickets

Read and update Jira tickets through Orca's saved Jira connections. Use when a task comes from Jira or the user asks for Jira…

orca1d128k
@stablyai@stablyaiInstall Skill
agentmail

agentmail

Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…

paperclip2d114k
@paperclipai@paperclipaiInstall Skill
adr-create

adr-create

Create a new Architecture Decision Record with sequential numbering and AgentDB registration

@ruvnet@ruvnetInstall Skill

Questions about css-design-tdd.

Which coding agents can use css-design-tdd?
css-design-tdd installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.