skills/design-redesign/SKILL.md
Audits existing UI components/pages/CSS against docs/design-system/DESIGN.md and applies fixes to restore design consistency. Uses design-token-validator to detect hardcoded color/font/spacing violations, and invokes designer-persona to report a senior-perspective score (0-10) and anti-AI aesthetic violations (generic shadcn look, purple gradient cliché). Fixes are applied automatically (--apply) or proposed as a PR (--pr); after changes, design-token-validator is re-run and must PASS before completion. Input: target directory (e.g., src/components/Button), single file, or git diff. Output: audit report (docs/design-system/audit-{date}.md) + fix proposals + application results.
npx skillsauth add astra-technology-company-limited/astra-methodology design-redesignInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audits existing UI assets against the DESIGN.md SSoT and applies fix proposals. Orchestrates two agents — design-token-validator + designer-persona — to perform quantitative and qualitative evaluation together.
In ASTRA, design consistency breaks in two ways at once:
#fff, 12px, 'Helvetica' and other token bypasses — detected quickly by design-token-validator (haiku).designer-persona (sonnet) from a senior perspective.These two results are merged into a prioritized fix patch, applied after user confirmation.
$ARGUMENTS:
src/components/Button, src/pages/*.tsx, --diff for git staged)--apply: auto-apply fixes (Step 5)--pr: propose fix result as a PR (delegated to /pr-merge)--auto: HITL default handlingBuild the target file list:
if [ "$TARGET" = "--diff" ]; then
TARGETS=$(git diff --name-only --diff-filter=AM HEAD | grep -E '\.(tsx?|jsx?|vue|svelte|css|scss|html)$')
elif [ -d "$TARGET" ]; then
TARGETS=$(find "$TARGET" -type f \( -name "*.tsx" -o -name "*.ts" -o -name "*.jsx" -o -name "*.css" -o -name "*.scss" -o -name "*.html" -o -name "*.vue" \))
else
TARGETS="$TARGET"
fi
If there are 0 targets, exit with an error.
if [ ! -f "docs/design-system/DESIGN.md" ]; then
echo "ERROR: docs/design-system/DESIGN.md is missing."
echo "Run /design-init first to initialize the design system."
exit 1
fi
Load the DESIGN.md Front Matter and keep the following information as context:
tokens.color.primitive.* — allowed color listtokens.typography.fonts.* — allowed font familiestokens.spacing.scale — allowed spacing valuesaesthetic_rules.forbidden_generic_patterns — anti-AI rulesTask(
subagent_type: "astra-methodology:design-token-validator",
description: "Audit DESIGN.md token violations",
prompt: "Detect every hardcoded value in the following files that bypasses the allowed tokens in the docs/design-system/DESIGN.md Front Matter:\n\nFile list:\n{TARGETS}\n\nDetection categories:\n- Hardcoded color: hex (#FFF, #f5f5f5), rgb(), rgba(), hsl() (non-token values)\n- Hardcoded spacing/size: direct 0-9999px, 0.x rem values (non-token)\n- Hardcoded font-family: font names not in DESIGN.md tokens.typography.fonts\n- Inline style usage (style={{...}}, style=\"...\")\n- !important overuse\n\nFor each violation, provide file path:line number + violated value + recommended token. Output as JSON."
)
Save the response to the VIOLATIONS_QUANT variable.
Task(
subagent_type: "astra-methodology:designer-persona",
description: "Senior designer-perspective audit",
prompt: "Using the brand·aesthetic_rules·accessibility sections of docs/design-system/DESIGN.md as the baseline, review the following files from a senior designer's perspective:\n\nFile list:\n{TARGETS}\n\nReview items:\n1. Design system consistency (0-10): token usage, component variants, spacing consistency\n2. Component reusability (0-10): duplicated definitions, hardcoding, prop design\n3. WCAG 2.1 AA accessibility (0-10): contrast, focus ring, keyboard, aria\n4. Interaction patterns (0-10): hover-only reliance, touch target, feedback timing\n5. Motion appropriateness (0-10): over-eager spring, looping, missing prefers-reduced-motion\n6. Vibe Coding aesthetic (0-10): generic AI look, purple gradient cliché, emoji feature icons\n\nFor each item: score + 1-2 sentences on what would have to change to make it a 10 + priority (P0/P1/P2).\nOutput as a markdown table."
)
Save the response to the VIOLATIONS_QUAL variable.
Write the following to docs/design-system/audit-{YYYY-MM-DD-HHmm}.md:
# Design Audit Report
**Date**: {timestamp}
**Targets**: {N} files
**DESIGN.md version**: {meta.version}
## Summary
- Quantitative violations: {VIOLATIONS_QUANT.count}
- Qualitative violations: {average score from VIOLATIONS_QUAL}
- P0 (Critical): {n}
- P1 (Major): {n}
- P2 (Minor): {n}
## Quantitative Violations (design-token-validator)
{VIOLATIONS_QUANT rendered as a markdown table}
| File | Line | Violation | Recommended token | Severity |
|------|------|-----------|-------------------|----------|
| ... | ... | `#fff` | `var(--surface-base)` | P0 |
## Qualitative Findings (designer-persona)
{VIOLATIONS_QUAL quoted verbatim}
## Recommended Fix Plan
{fix items by priority — P0 first}
### P0 (Critical — merge-blocking)
1. {file:line} — {fix content} (auto-fix: ✅/❌)
...
### P1 (Major — within 1 week)
...
### P2 (Minor — backlog)
...
## Aesthetic Red Flags
{patterns detected from DESIGN.md aesthetic_rules.forbidden_generic_patterns}
If --apply is set or the user agrees to apply, start with P0 items and auto-fix per the rules below:
| Violation pattern | Substitution rule |
|-------------------|-------------------|
| #ffffff / #FFF | var(--surface-base) (semantic) |
| #000000 / #000 | var(--primitive-neutral-1000) |
| rgba(0, 0, 0, 0.X) shadow | match to var(--shadow-{xs|sm|md|lg|xl}) |
| font-family: 'Helvetica', ... | var(--font-sans) |
| padding: 16px | padding: var(--space-4) |
| border-radius: 8px | border-radius: var(--radius-lg) |
| transition: ... 200ms ease | transition: ... var(--duration-normal) var(--ease-out) |
Before each substitution, ask the user for confirmation in batches (5-10 at a time):
Apply the following 12 quantitative fixes?
src/components/Button.tsx:42 — #3b82f6 → var(--action-primary)
src/components/Card.tsx:18 — padding: 16px → var(--space-4)
...
In --auto mode, apply P0 automatically; leave P1/P2 in the report only.
For P0 items flagged by designer-persona that require code structure changes:
style={{color: '#fff'}} → define a class and apply it<Card variant="elevated">:hover effect equivalently to :focus-visibleoutline: none → apply focus_ring: use DESIGN.md accessibility.focus_ringStructural changes are hard to automate, so confirm each fix one-by-one with the user before applying. In --auto mode, classify them as P1 in the report and skip.
After fixes are applied, re-invoke design-token-validator to confirm 0 violations remain:
Task(
subagent_type: "astra-methodology:design-token-validator",
description: "Re-verification after fixes",
prompt: "Re-verify that all violations against docs/design-system/DESIGN.md have been resolved in the files just modified. Report any remaining violations."
)
If violations remain, re-enter Step 5 (max 3 times). If violations persist after 3 attempts, instruct the user to handle them manually.
If --pr is set, delegate to /pr-merge:
Skill("astra-methodology:pr-merge",
args="--title='Design audit: apply DESIGN.md compliance fixes' --body-file=docs/design-system/audit-{date}.md")
Without --pr, leave the changes in the working tree and instruct the user to commit manually.
✅ Design Audit Complete
Targets: {N} files
Fixes applied: P0 {n} / P1 {n} / P2 0 (skipped)
Re-verification: PASS (0 remaining violations)
📋 Next steps:
- Review changes: git diff
- Report: docs/design-system/audit-{date}.md
- Create PR: /pr-merge
| Argument | Behavior |
|----------|----------|
| <path> (no option) | Generate audit report only. No fixes applied. |
| <path> --apply | P0 auto-applied. P1/P2 confirmed with user. |
| <path> --apply --auto | P0 auto-applied. P1/P2 skipped. No HITL. |
| <path> --apply --pr | Above + create a PR via /pr-merge after applying. |
| --diff | Audit only git staged changes. CI / pre-commit scenario. |
/design-init.| Timing | Invocation |
|--------|-----------|
| Just before PR after feature development | /design-redesign --diff --apply |
| Legacy component refactor | /design-redesign src/components/legacy/ --apply --pr |
| Sprint retrospective | /design-redesign src/ (report only) |
| CI gate (future) | /design-redesign --diff + non-zero exit code on P0 |
tools
Runs UAT (User Acceptance Testing) cases in TRUE PARALLEL using Playwright Test runner with isolated browser contexts per worker (separate cookies, localStorage, sessionStorage). Solves the two main limits of /user-test: (1) sequential single-page execution that does not scale beyond a few cases, and (2) one stuck case blocking the rest of the run. Reuses 100% of the /user-test UAT case Markdown+YAML format under docs/tests/uat-cases/, runs them via `npx playwright test --workers=N`, and emits the same report layout (index.html + issues.md + session.json + screenshots/) under docs/tests/uat-reports/. Use when the user asks to "run UAT in parallel", "speed up UAT", "test multi-user", "song song", "uat parallel", or runs /uat-parallel. Distinct from /user-test (sequential Chrome MCP, supports interactive mode), /test-run (developer integration tests), /test-scenario (scenario authoring).
tools
Performs end-user UAT (User Acceptance Testing) by driving a real browser through Chrome MCP, self-verifying each step with hard assertions (DOM / Network / URL / Console), auto-assigning severity on failure, and emitting an HTML report plus issues.md into a timestamped session folder. Supports two modes: interactive (URL + Vietnamese natural-language flow description) and --auto (batch-run pre-authored test cases under docs/tests/uat-cases/). Use when the user asks for "UAT", "user acceptance test", "kiểm thử người dùng", "regression test", or runs /user-test, /uat. Distinct from /test-run (developer-authored technical integration testing) and /test-scenario (scenario authoring from blueprints).
tools
Authors and validates LLM tool descriptions and input schemas (Anthropic Tool Use, MCP servers, LangChain @tool, Pydantic, Zod). Use when the user mentions "tool description", "function calling", "MCP tool", "Pydantic schema", "Zod schema", "@tool decorator", "input_schema", "tool spec", "툴 정의", "함수 호출 스키마", or when editing files that define LLM tool surfaces. Enforces the six required attributes (one-line summary, anti-pattern, synonyms, parameter examples, enum constraints, return shape) and blocks the seven known failure modes — wrong-tool selection, skipped tool, malformed arguments, retry loops, user-intent bypass, wrong side-effect, and un-auditable traces. For authoring ASTRA SKILL.md files use /skill-author instead — this skill is for *runtime* LLM tool surfaces, not for skill files themselves.
development
Creates new SKILL.md files or refactors existing skills to comply with the ASTRA skill best practices guide (docs/development/skill-best-practices.md). Use when user mentions "new skill", "create skill", "SKILL.md", "skill authoring", "스킬 작성", "스킬 만들기", or when editing any file matching skills/**/SKILL.md.