Token导航 LogoToken导航

Agent Skill · 前端设计

migration(迁移)

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

migration 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 9,642。

总安装 198周安装 8GitHub Stars 11下载 62核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:migration(迁移)
来源仓库:https://github.com/lobbi-docs/claude
仓库路径:skills/migration
安装命令:
npx skills add https://github.com/lobbi-docs/claude --skill migration
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lobbi-docs/claude --skill migration

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。适合提炼结构、补齐章节、统一术语或检查链接,提升内容可读性。使用时保留项目已有事实和命令,避免将未确认信息写成确定结论。涉及对外文案时需控制语气,防止过度营销或夸大能力。安装方式:通过 npx 从 GitHub 仓库添加技能。

来源仓库内路径:skills/migration

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/lobbi-docs/claude --skill migration;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

migration 怎么安装?

在终端执行 npx skills add https://github.com/lobbi-docs/claude --skill migration。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

migration 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

migration 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

migration 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

migration 用的人多吗?

公开数据是累计安装 198 次,近一周安装 8 次,下载 62 次,GitHub 11 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

migration 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
migration

迁移 · 本页

19811需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

MUI Version Migration

v4 → v5 Migration

Package Renames

# Uninstall v4 packages
npm uninstall @material-ui/core @material-ui/icons @material-ui/lab @material-ui/system

# Install v5 packages
npm install @mui/material @mui/icons-material @mui/lab @mui/system
npm install @emotion/react @emotion/styled   # new required peer deps

# If using styled-components instead of emotion (less common):
npm install @mui/material @mui/styled-engine-sc styled-components

Run the v5 Codemod

The codemod handles ~80% of the mechanical changes automatically.

# Run the v5 preset-safe codemod (safe subset — no breaking changes)
npx @mui/codemod v5.0.0/preset-safe src/

# Run on a single file
npx @mui/codemod v5.0.0/preset-safe src/components/MyComponent.tsx

# Run individual transforms
npx @mui/codemod v5.0.0/component-rename-prop src/
npx @mui/codemod v5.0.0/moved-lab-modules src/
npx @mui/codemod v5.0.0/optimal-imports src/

After running the codemod, review the diff carefully — some transformations may need manual adjustment.

Import Path Changes

// v4
import { makeStyles } from '@material-ui/core/styles';
import { createMuiTheme } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';

// v5
import { styled } from '@mui/material/styles';     // replaces makeStyles
import { createTheme } from '@mui/material/styles'; // createMuiTheme → createTheme
import Button from '@mui/material/Button';
import TextField from '@mui/material/TextField';

createTheme Changes

// v4
import { createMuiTheme } from '@material-ui/core/styles';

const theme = createMuiTheme({
  palette: {
    primary: { main: '#1976d2' },
  },
  overrides: {                       // v4: overrides
    MuiButton: {
      root: { textTransform: 'none' },
    },
  },
  props: {                           // v4: props
    MuiButton: { disableRipple: true },
  },
});

// v5
import { createTheme } from '@mui/material/styles';

const theme = createTheme({
  palette: {
    primary: { main: '#1976d2' },
  },
  components: {                      // v5: components (combines overrides + props)
    MuiButton: {
      defaultProps: {                // was: props
        disableRipple: true,
      },
      styleOverrides: {              // was: overrides
        root: {
          textTransform: 'none',
        },
      },
    },
  },
});

makeStyles → styled / sx

This is the most impactful change. JSS (makeStyles, withStyles) is replaced by Emotion.

Pattern 1: sx prop (simple, inline styles)
// v4 with makeStyles
const useStyles = makeStyles((theme) => ({
  root: {
    padding: theme.spacing(2),
    backgroundColor: theme.palette.background.paper,
    borderRadius: theme.shape.borderRadius,
  },
}));

function MyComponent() {
  const classes = useStyles();
  return <div className={classes.root}>Content</div>;
}

// v5 with sx prop
function MyComponent() {
  return (
    <Box
      sx={{
        p: 2,
        bgcolor: 'background.paper',
        borderRadius: 1,
      }}
    >
      Content
    </Box>
  );
}
Pattern 2: styled() (reusable styled components)
// v4 with makeStyles + clsx
const useStyles = makeStyles((theme) => ({
  card: {
    padding: theme.spacing(3),
    border: `1px solid ${theme.palette.divider}`,
    borderRadius: theme.shape.borderRadius * 2,
  },
  cardHighlighted: {
    borderColor: theme.palette.primary.main,
    backgroundColor: theme.palette.primary.light,
  },
}));

function MyCard({ highlighted }: { highlighted: boolean }) {
  const classes = useStyles();
  return (
    <div className={clsx(classes.card, { [classes.cardHighlighted]: highlighted })}>
      Content
    </div>
  );
}

// v5 with styled()
import { styled } from '@mui/material/styles';

const StyledCard = styled('div', {
  shouldForwardProp: (prop) => prop !== 'highlighted',
})<{ highlighted?: boolean }>(({ theme, highlighted }) => ({
  padding: theme.spacing(3),
  border: `1px solid ${theme.palette.divider}`,
  borderRadius: theme.shape.borderRadius * 2,
  ...(highlighted && {
    borderColor: theme.palette.primary.main,
    backgroundColor: theme.palette.primary.light,
  }),
}));

function MyCard({ highlighted }: { highlighted: boolean }) {
  return <StyledCard highlighted={highlighted}>Content</StyledCard>;
}
Pattern 3: tss-react (drop-in makeStyles replacement)

For large codebases where a full migration is impractical, tss-react provides a near-identical API:

npm install tss-react @emotion/react
// Minimal diff from v4 makeStyles
import { makeStyles } from 'tss-react/mui';

const useStyles = makeStyles()((theme) => ({
  root: {
    padding: theme.spacing(2),
    backgroundColor: theme.palette.background.paper,
  },
}));

function MyComponent() {
  const { classes } = useStyles();
  return <div className={classes.root}>Content</div>;
}

withStyles → styled

// v4
const StyledButton = withStyles((theme) => ({
  root: {
    margin: theme.spacing(1),
  },
  label: {
    color: theme.palette.primary.main,
  },
}))(Button);

// v5
const StyledButton = styled(Button)(({ theme }) => ({
  margin: theme.spacing(1),
  '& .MuiButton-label': {          // target internal class
    color: theme.palette.primary.main,
  },
}));
// Or better — use sx prop on Button directly

color Prop Changes

// v4 — color accepted any string
<Button color="default">Default</Button>

// v5 — 'default' removed; use 'inherit' or omit color
<Button>Default</Button>
<Button color="inherit">Inherit parent color</Button>

System Props Removed from Most Components

In v5, system props (like mt, p, bgcolor) work on Box and Stack but not on all components. Use the sx prop instead.

// v4 — system props on Typography
<Typography mt={2} color="primary.main">Text</Typography>

// v5 — use sx prop
<Typography sx={{ mt: 2, color: 'primary.main' }}>Text</Typography>

Lab Component Moves

Several components graduated from @mui/lab to @mui/material:

v4 labv5 core
@material-ui/lab/Alert@mui/material/Alert
@material-ui/lab/Autocomplete@mui/material/Autocomplete
@material-ui/lab/Pagination@mui/material/Pagination
@material-ui/lab/Rating@mui/material/Rating
@material-ui/lab/Skeleton@mui/material/Skeleton
@material-ui/lab/SpeedDial@mui/material/SpeedDial
@material-ui/lab/ToggleButton@mui/material/ToggleButton

v4 → v5 Breaking Changes Checklist

  • Replace @material-ui/* with @mui/*
  • Add @emotion/react and @emotion/styled peer deps
  • Replace createMuiTheme with createTheme
  • Replace theme.overrides + theme.props with theme.components
  • Replace all makeStyles/withStyles (JSS) with styled/sx/tss-react
  • Remove color="default" — use color="inherit" or omit
  • Update Lab imports to core for graduated components
  • Replace <Hidden> with sx={{display: {xs: 'none', sm: 'block'}}}
  • Update Box system shorthand keys (some changed)
  • Check all className overrides — internal class names changed in v5

v5 → v6 Migration

Run the v6 Codemod

# Run preset-safe (recommended first step)
npx @mui/codemod v6.0.0/preset-safe src/

# Run on specific directories
npx @mui/codemod v6.0.0/preset-safe src/components/ src/pages/

# Individual transforms (if preset-safe missed something)
npx @mui/codemod v6.0.0/grid-v2-props src/
npx @mui/codemod v6.0.0/sx-prop src/

Grid v2 (Major Breaking Change)

Grid v2 is the default Grid in v6. The item prop is removed; use size instead. The xs, sm, md, lg, xl props are replaced by a single size prop with an object.

// v5 Grid
import Grid from '@mui/material/Grid';

<Grid container spacing={2}>
  <Grid item xs={12} sm={6} md={4}>
    <Card />
  </Grid>
  <Grid item xs={12} sm={6} md={8}>
    <Content />
  </Grid>
</Grid>

// v6 Grid (Grid v2) — same import path, new API
import Grid from '@mui/material/Grid';

<Grid container spacing={2}>
  <Grid size={{ xs: 12, sm: 6, md: 4 }}>
    <Card />
  </Grid>
  <Grid size={{ xs: 12, sm: 6, md: 8 }}>
    <Content />
  </Grid>
</Grid>

// Shorthand for full-width only
<Grid size={12}>Full width</Grid>

// Auto-grow
<Grid size="grow">Fills remaining space</Grid>

Grid v2 — Offset

// v5 — offset via empty grid items or negative margins
<Grid item xs={4} />   // spacer
<Grid item xs={8}><Content /></Grid>

// v6 — offset prop
<Grid size={8} offset={4}><Content /></Grid>

// Responsive offset
<Grid size={{ xs: 12, md: 8 }} offset={{ md: 4 }}>
  <Content />
</Grid>

Slots Pattern Standardized

In v6, the slots/slotProps API is standardized across all MUI X components (DatePicker, DataGrid, Charts). The old components/componentsProps API is removed.

// v5 (deprecated in v6)
<DatePicker
  components={{ TextField: CustomTextField }}
  componentsProps={{ textField: { variant: 'outlined' } }}
/>

// v6 (required)
<DatePicker
  slots={{ textField: CustomTextField }}
  slotProps={{ textField: { variant: 'outlined' } }}
/>

Pigment CSS (Experimental in v6)

v6 introduces optional Pigment CSS — a build-time CSS extraction alternative to Emotion. It enables zero-runtime styling (faster SSR, smaller bundles).

# Install Pigment CSS (optional — still experimental in v6)
npm install @mui/material-pigment-css @pigment-css/react

# Next.js setup
npm install @pigment-css/nextjs-plugin
// next.config.js
const { withPigment } = require('@pigment-css/nextjs-plugin');

module.exports = withPigment({
  // your next config
}, {
  theme: require('./src/theme').default,
});

With Pigment CSS, styled() and sx are processed at build time — no Emotion runtime. Server components can use styled components directly without 'use client'.

v5 → v6 Breaking Changes Checklist

  • Update all packages: npm install @mui/material@6 @mui/x-date-pickers@7 @mui/x-data-grid@7
  • Replace Grid v1 props (item, xs/sm/md) with Grid v2 size prop
  • Replace components/componentsProps with slots/slotProps in all MUI X components
  • Check @mui/x-date-pickers peer dep: now requires dayjs or another adapter explicitly
  • useMediaQuery now requires a theme argument in some contexts — verify usages
  • Stack divider spacing changed — verify visual output
  • Review @mui/x-data-grid API: some column definition fields changed

Incremental Migration Strategy

For large codebases (100+ components), do not migrate everything at once.

Phase 1: Package and Config (1 day)

# 1. Update packages
npm uninstall @material-ui/core @material-ui/icons
npm install @mui/material @mui/icons-material @emotion/react @emotion/styled

# 2. Run codemods
npx @mui/codemod v5.0.0/preset-safe src/

# 3. Fix obvious import errors
# 4. Run the app; expect red errors — that's normal at this stage

Phase 2: Theme Migration (1–2 days)

// Migrate theme file first — everything depends on it
// Old: createMuiTheme with overrides/props
// New: createTheme with components.MuiXxx.styleOverrides/defaultProps

Phase 3: Component-by-Component (ongoing)

Prioritize components that are:

  1. Used most frequently (Button, TextField, etc.)
  2. Already have a clear sx-based replacement
  3. Self-contained (not deeply composed)
// Migrate one component at a time:
// 1. Remove makeStyles import
// 2. Replace className={classes.xxx} with sx={...} or styled()
// 3. Run tests
// 4. Commit

Phase 4: Remove JSS Entirely

# Once all makeStyles are removed:
npm uninstall @material-ui/styles

Coexistence Strategy (v4 + v5 during migration)

// Temporarily keep both packages during migration
// @material-ui/core for unmigrated components
// @mui/material for migrated components

// Wrap each style engine separately
import { StylesProvider } from '@material-ui/core/styles';   // v4 JSS
import { ThemeProvider } from '@mui/material/styles';         // v5 Emotion

function App() {
  return (
    <StylesProvider injectFirst>
      <ThemeProvider theme={v5Theme}>
        {/* migrated components use v5 theme */}
        {/* unmigrated components use v4 styles */}
        <Router />
      </ThemeProvider>
    </StylesProvider>
  );
}

makeStyles → styled/sx Conversion Reference

makeStyles patternv5 equivalent
padding: theme.spacing(2)sx={{p: 2}}
margin: theme.spacing(1, 2)sx={{my: 1, mx: 2}}
color: theme.palette.primary.mainsx={{color: 'primary.main'}}
backgroundColor: theme.palette.grey[100]sx={{bgcolor: 'grey.100'}}
display: 'flex'sx={{display: 'flex'}}
[theme.breakpoints.up('sm')]: {...}sx={{md: {...}}}
'&:hover': {...}sx={{'&:hover': {...}}}
'&.MuiButton-root': {...}sx={{'&.MuiButton-root': {...}}}
theme.transitions.create('opacity')styled()(({theme}) => ({transition: theme.transitions.create('opacity')}))

Common Post-Migration Issues

Styles not applying:

  • Check that CssBaseline is inside ThemeProvider
  • Confirm @emotion/react and @emotion/styled are installed
  • Ensure no JSS StylesProvider is conflicting

TypeScript errors after codemod:

  • makeStyles return type changed — classes is now in a {classes} object with tss-react
  • Theme import moved from @material-ui/core to @mui/material/styles
  • Some prop types narrowed (e.g., color no longer accepts 'default')

SSR style flash (FOUC):

  • Missing Emotion cache setup — see the performance skill for full SSR config
  • Ensure createEmotionCache() is called per request, not once globally

Grid layout broken after v6 upgrade:

  • The item prop is removed — add size prop to every grid item
  • Run npx @mui/codemod v6.0.0/grid-v2-props src/ to automate this

平台分布

Codex

34.58%
按下载量换算21

Claude

32.11%
按下载量换算20

Cursor

18.01%
按下载量换算11

Gemini CLI

10.29%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills