Back to skills
SKILL.md
Ui Design System Migration Engineer
ASecurityMigrates legacy UI components, ad-hoc stylesheets, and older design tokens to modern OKLCH design systems, CSS container queries, and fluid typography. Preserves external component prop contracts, event handlers, and test selectors while eliminating legacy CSS debt, deprecated utility classes, and hardcoded hex values.
- 7 stars
- 0 votes
- 0 copies
- 4 views
- Added November 9, 2026
Works with
Security analysis
100/100npx -y skills add Harmitx7/tribunal-kit --skill ui-design-system-migration-engineer --agent claude-codeAre you the author of Ui Design System Migration Engineer?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/harmitx7-ui-design-system-migration-engineer)---
name: ui-design-system-migration-engineer
description: 'Migrates legacy UI components, ad-hoc stylesheets, and older design tokens to modern OKLCH design systems, CSS container queries, and fluid typography. Preserves external component prop contracts, event handlers, and test selectors while eliminating legacy CSS debt, deprecated utility classes, and hardcoded hex values.'
version: 1.0.0
last-updated: 2026-10-30
skills:
- extract-design-system
- better-colors
- better-ui
tools: Read, Grep, Glob, Bash, Edit, Write
scripts-binding:
- .agent/scripts/lint_runner.js
- .agent/scripts/verify_all.js
inputs:
legacyComponentCode: 'string'
targetTokenSystem: 'object'
preserveContractProps: 'array'
outputs:
migratedComponent: 'string'
migrationDiff: 'string'
compatibilityReport: 'object'
trigger:
- 'design-system-migration'
- 'token-migration'
- 'legacy-ui-upgrade'
- 'modernize-components'
---
# UI Design System Migration Engineer — Legacy Component Modernization
## Mandatory Pre-Flight Context Inspection
Before upgrading or refactoring legacy frontend components, inspect these 5 critical parameters:
1. **Public API Contract Preservation**: Guarantee that component props (`props`), event callbacks (`onClick`, `onChange`), ref forwarding (`forwardRef`), and `data-testid` attributes remain 100% backward-compatible.
2. **Token Mapping Table**: Construct an explicit mapping table from legacy values (e.g. `#1e293b`, `bg-gray-800`, `px-3`) to target semantic tokens (`var(--surface-1)`).
3. **Non-Breaking Visual Parity**: Ensure migrated components maintain identical or strictly improved layout footprint to avoid breaking sibling components.
4. **AST Defect Elimination**: Replace deprecated patterns (e.g. `transition-all`, unnested radii, raw hex codes) with modern equivalents during migration.
5. **Incremental Rollout Strategy**: Support dual-theme coexistence during migration phase via fallback CSS variables.
## Activation Boundaries
- **Activate when:** Modernizing legacy components, migrating Tailwind v3 to v4, replacing raw CSS with design tokens, or refactoring ad-hoc styling into design system primitives.
- **DO NOT activate when:** Designing brand-new visual concepts from scratch without existing code.
## 🔁 Multi-Pass Migration Protocol
| Pass | Phase | Core Action | Observable Target |
| :--------- | :------------------------------ | :----------------------------------------------------------------------------- | :--------------------------- |
| **Pass 1** | **Interface Inspection** | Extract prop types, event signatures, and test selectors to preserve. | Component API Contract |
| **Pass 2** | **Legacy Style Extraction** | Identify hardcoded hex codes, inline styles, and deprecated classes. | Legacy Debt Catalog |
| **Pass 3** | **Token Substitution** | Replace legacy colors, spacing, and radii with semantic OKLCH variables. | Token-Mapped Markup |
| **Pass 4** | **Interactive State Injection** | Upgrade button and link interactions to satisfy the complete 5-state contract. | 5-State Compliance |
| **Pass 5** | **Regression & Type Audit** | Run TypeScript typecheck, test suite, and visual defect analyzer on output. | Certified Migration Artifact |
---
## 🛠️ Technical Architecture & Migration Recipes
### 1. Legacy to Modern Token Mapping Example
```tsx
// Before (Legacy Component with Debt)
export function LegacyButton({ text, onClick }: { text: string; onClick: () => void }) {
return (
<button
onClick={onClick}
style={{ backgroundColor: '#4f46e5', padding: '10px 16px' }}
className="text-white rounded transition-all outline-none"
>
{text}
</button>
);
}
// After (Modern Migrated Component)
export function MigratedButton({ text, onClick }: { text: string; onClick: () => void }) {
return (
<button
onClick={onClick}
type="button"
className="px-4 py-2 rounded-[8px] font-medium text-sm bg-[var(--accent-primary)] text-[var(--accent-contrast)] border border-[oklch(1_0_0/0.12)] transition-[transform,background-color,border-color] duration-150 ease-out hover:bg-[oklch(from_var(--accent-primary)_l_c_h/0.92)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--accent-primary)] active:scale-[0.98] disabled:opacity-40"
>
{text}
</button>
);
}
```
---
## 🏛️ Tribunal Verification & Guardrails
### 🛑 Verification-Before-Completion (VBC) Protocol
1. Verify that all existing component props, callbacks, and test selectors are preserved without regression.
2. Confirm zero raw hex values or inline styling remains in the migrated component.
3. Validate migrated component passes `analyzeVisualDefects()` with 0 defects.
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.