agentleFS
HazemBZHazemBZ/agent-skills/ui-migration/SKILL.md

ui-migration

Skill0 starsChanged 5 months agoMITView on GitHub

Track component provenance (shadcn, custom, wrapper) during UI library migrations. Optionally integrates with the todo-workflow skill for multi-step migration tracking.

The file

Show its rules and text

We split this skill into the rules it gives an agent

16 rules. About 0 are common, 7 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when migrating between UI component libraries (e.g., custom design system → shadcn/ui, or upgrading shadcn versions).

    line 12
  2. Very specific:

    If todo-workflow is loaded, migration tasks are tracked in TODOS.md and errors in ERRORS.md.

    line 17
  3. Very specific:

    If todo-workflow is not loaded, this skill operates on a standalone COMPONENT_CATALOG.md with no task tracking.

    line 18
  4. Distinctive:

    Every component in the project falls into one of these categories:

    line 22
  5. Very specific:

    Create or maintain COMPONENT_CATALOG.md at the project root with this format:

    line 34
  6. Distinctive:

    Run a survey to catalog every component file:

    line 67
  7. Very specific:

    If todo-workflow is active:

    line 94
  8. Distinctive:

    Delete old files only after all callers are updated.

    line 97
  9. Very specific:

    Commit after each completed task (see Commit discipline in todo-workflow).

    line 98
  10. Distinctive:

    After each component migration:

    line 102
  11. Distinctive:

    Update provenance, dependencies, and notes.

    line 104
  12. Very specific:

    If the old component was deleted, add a row to Legacy / Removed.

    line 105
  13. Distinctive:

    After deleting a legacy directory or alias, search for stale references:

    line 109
  14. Very specific:

    When migrating a legacy Select to shadcn:

    line 137
  15. Very specific:

    Create a SelectWrapper.jsx if backward compat is needed, or update callers directly.

    line 140
  16. Very specific:

    If using todo-workflow, mark task complete, log errors to ERRORS.md, and commit.

    line 146

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

UI Migration Skill

Track component provenance (shadcn, custom, wrapper) during UI library migrations. Optionally integrates with the todo-workflow skill for multi-step migration tracking.

When to use

Use this skill when migrating between UI component libraries (e.g., custom design system → shadcn/ui, or upgrading shadcn versions). It provides conventions for documenting component ancestry so future developers know what each component is built on.

Dependencies

This skill optionally depends on todo-workflow:

  • If todo-workflow is loaded, migration tasks are tracked in TODOS.md and errors in ERRORS.md.
  • If todo-workflow is not loaded, this skill operates on a standalone COMPONENT_CATALOG.md with no task tracking.

Component Provenance Categories

Every component in the project falls into one of these categories:

CategoryLabelMeaning
shadcnshadcnGenerated by shadcn@latest add <name>. Files live in src/components/ui/ and use @/lib/utils + cn().
shadcn-wrapperwrapCustom wrapper around a shadcn component providing backward-compatible API. Files live outside src/components/ui/.
customcustomFully hand-written, no shadcn dependency.
patternpatternDescribed in AGENTS.md conventions but no file exists yet.
design-systemlegacy-dsImported from a legacy @design-system alias. Used during active migration before deletion.

Component Catalog

Create or maintain COMPONENT_CATALOG.md at the project root with this format:

# Component Catalog

## UI Components (src/components/ui/)

| Component | Provenance | Depends On | Notes |
|---|---|---|---|
| Button | shadcn | @base-ui/react/button, cva | Added during Tailwind v4 migration |
| Card | shadcn | — | Pure Tailwind + cn() |
| Input | shadcn | @base-ui/react/input | |

## Custom Components (src/components/)

| Component | Provenance | Imports | Notes |
|---|---|---|---|
| AppIcon | custom | lucide-react (dynamic) | Dynamic icon lookup |
| Header | custom | AppIcon, lucide-react, react-router-dom | |
| Sidebar | custom | AppIcon, react-router-dom | Collapsible nav |

Sections

  • src/components/ui/ — shadcn-generated components, one row per file.
  • src/components/ — custom components, one row per file.
  • Legacy / Removed — components from the old design system that were deleted, with their migration path.
  • Patterns (unimplemented) — documented component patterns from AGENTS.md that don't yet have files. Only include these if they are part of the current migration scope.

Migration Workflow

1. Discover current state

Run a survey to catalog every component file:

src/components/ui/   → shadcn originals
src/components/      → custom components
src/features/*/      → consumers

For each component, record:

  • File path
  • Imports (to determine dependencies)
  • Which category it falls into

2. Plan the migration

For each component being migrated, decide:

CurrentTargetAction
legacy-dsshadcnInstall via pnpm dlx shadcn@latest add <name>, then rewrite callers
legacy-dscustomHand-write replacement, then rewrite callers
shadcn-wrappershadcnDelete wrapper, update callers to use shadcn directly
customshadcnInstall shadcn equivalent, rewrite component internally
shadcnshadcn (upgrade)Reinstall via shadcn CLI

3. Execute with todo-workflow (if loaded)

If todo-workflow is active:

  1. Break the migration into per-component tasks in TODOS.md.
  2. Process one task at a time: install/rewrite → update callers → verify.
  3. Delete old files only after all callers are updated.
  4. Commit after each completed task (see Commit discipline in todo-workflow).

4. Update the catalog

After each component migration:

  1. Move the row to its new section in COMPONENT_CATALOG.md.
  2. Update provenance, dependencies, and notes.
  3. If the old component was deleted, add a row to Legacy / Removed.

5. Clean up stale references

After deleting a legacy directory or alias, search for stale references:

rg '@design-system' --include '*.{js,jsx,ts,tsx}' src/

Also check:

  • vite.config.js — alias definitions
  • tsconfig.json / jsconfig.json — path aliases
  • README.md, AGENTS.md — documentation references

Component Survey Commands

# List all components by location
ls src/components/ui/*.{jsx,tsx} 2>/dev/null
ls src/components/*.jsx 2>/dev/null

# Find all feature imports to a component
rg "from '@/components/" src/features/ --include '*.jsx'
rg "from '@components/" src/features/ --include '*.jsx'

# Check for stale legacy imports
rg '@design-system' src/ --include '*.{js,jsx,ts,tsx}'

Example: shadcn Migration

When migrating a legacy Select to shadcn:

  1. pnpm dlx shadcn@latest add select
  2. Create a SelectWrapper.jsx if backward compat is needed, or update callers directly.
  3. Update COMPONENT_CATALOG.md:
    - | Select | legacy-ds | @design-system/ui/Select | Replaced by shadcn |
    + | Select | shadcn     | @base-ui/react/select, lucide-react | Installed during v4 migration |
  4. If using todo-workflow, mark task complete, log errors to ERRORS.md, and commit.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.