一键导入
code-migration
Migrate between frameworks, libraries, and code patterns safely.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Migrate between frameworks, libraries, and code patterns safely.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Migrate from Next.js 15 to Next.js 16 and handle breaking changes
Configure Content Security Policy and security headers for the portfolio
Deploy Next.js to Cloudflare Workers using OpenNext adapter
Manage the canary token honeypot system for detecting security scanning
Write, debug, and optimize GROQ queries for Sanity CMS in this portfolio
Advanced TypeScript patterns and type safety as used in this portfolio
| name | code-migration |
| description | Migrate between frameworks, libraries, and code patterns safely. |
Safely migrate codebases between frameworks, libraries, and architectural patterns with minimal risk.
--dangerouslyUseUnsupportedNextVersion)sanity, next-sanity, @sanity/client)@opennextjs/cloudflare or wranglerThe portfolio migrated from Next.js 15 to 16. Key changes:
middleware.ts → proxy.ts convention (but OpenNext requires middleware.ts, so we kept middleware.ts)output: 'standalone' set conditionally for Cloudflare builds--dangerouslyUseUnsupportedNextVersion flag required for OpenNextWhen updating Sanity packages:
next-sanity peer dependency (^14.2 || ^15.0.0 — may not officially support Next.js 16)npm run build to verify GROQ queries still parsestudio/package.json for Sanity studio compatibilitystudio/package-lock.json doesn't introduce new vulnerabilitiesWhen updating @opennextjs/cloudflare:
npm run cloudflare:build locallywrangler.jsonc compatibility_date is current--dangerouslyUseUnsupportedNextVersion is still needednpm run build, npm run test -- --run, npm run cloudflare:build## Migration: [Source] → [Target]
### Pre-Migration
- [ ] Backup repository
- [ ] Run full test suite
- [ ] Document current behavior
- [ ] Create feature branch
### Migration Steps
- [ ] Step 1: [Description]
- [ ] Step 2: [Description]
- [ ] ...
### Post-Migration
- [ ] Run full test suite
- [ ] Manual testing
- [ ] Performance comparison
- [ ] Code review
- [ ] Merge to main
// Before: pages/about.tsx
export default function About() {
return <div>About</div>;
}
// After: app/about/page.tsx
export default function AboutPage() {
return <div>About</div>;
}
// Before: Class component
class MyComponent extends React.Component<Props, State> {
state = { count: 0 };
render() {
return <div>{this.state.count}</div>;
}
}
// After: Functional component
function MyComponent() {
const [count, setCount] = useState(0);
return <div>{count}</div>;
}