AgentSkillsCN

ui-import-audit

对@/components/ui/*的导入进行审计与修复。在添加新的shadcn/ui原语、创建占位符UI文件,或调试诸如“无法找到模块@/components/ui/…”或缺少导出的构建错误时使用。

SKILL.md
--- frontmatter
name: ui-import-audit
description: "Audit and fix @/components/ui/* imports. Use when adding new shadcn/ui primitives, creating placeholder UI files, or debugging build errors like 'Cannot find module @/components/ui/...' or missing exports."
argument-hint: "Optional: limit to a folder (e.g. src/components/screens)"
user-invocable: true

UI Import Audit (shadcn/ui)

When to use

  • You add a new shadcn component and imports start failing
  • You created placeholder src/components/ui/*.tsx and want to ensure coverage
  • You see runtime errors due to missing exports (e.g., Tooltip exports)

Outcome

  • Every @/components/ui/<name> import points to an existing file
  • Core exports in primitives match what the app imports

Procedure

  1. Run the helper script (fast):

  2. For each missing file:

    • Create src/components/ui/<name>.tsx
    • Export the same symbols the importing files expect
    • Prefer the canonical shadcn/Radix implementation over placeholders
  3. For export mismatches:

    • Search for from '@/components/ui/<name>' in src/**
    • Ensure the module exports those symbols
  4. Verify:

    • npm run lint
    • npm run build

Helper script