xiaohongshu
xiaohongshu
--- name: migration-assistant description: Assist with migrating frameworks, libraries, and language versions with automated refactoring ---
Full skill instructions
ช่วย migrate ระหว่าง frameworks, libraries, และ versions อย่างปลอดภัย พร้อม automated refactoring
// Before: Class Component
class Counter extends React.Component {
state = { count: 0 };
increment = () => {
this.setState({ count: this.state.count + 1 });
};
render() {
return (
<button onClick={this.increment}>
Count: {this.state.count}
</button>
);
}
}
// After: Function Component with Hooks
function Counter() {
const [count, setCount] = useState(0);
const increment = () => {
setCount(count + 1);
};
return (
<button onClick={increment}>
Count: {count}
</button>
);
}
// Before: pages/about.tsx
export default function About() {
return <h1>About</h1>;
}
export async function getServerSideProps() {
const data = await fetch('...');
return { props: { data } };
}
// After: app/about/page.tsx
async function getData() {
const res = await fetch('...');
return res.json();
}
export default async function About() {
const data = await getData();
return <h1>About</h1>;
}
// Before: Redux Slice
const counterSlice = createSlice({
name: 'counter',
initialState: { value: 0 },
reducers: {
increment: (state) => { state.value += 1; },
decrement: (state) => { state.value -= 1; },
},
});
// After: Zustand Store
const useCounterStore = create((set) => ({
value: 0,
increment: () => set((state) => ({ value: state.value + 1 })),
decrement: () => set((state) => ({ value: state.value - 1 })),
}));
// Before: Moment.js
import moment from 'moment';
moment().format('YYYY-MM-DD');
moment().add(1, 'days');
moment('2024-01-15').isAfter('2024-01-01');
// After: date-fns
import { format, addDays, isAfter, parseISO } from 'date-fns';
format(new Date(), 'yyyy-MM-dd');
addDays(new Date(), 1);
isAfter(parseISO('2024-01-15'), parseISO('2024-01-01'));
// Before: JavaScript
function greet(name) {
return `Hello, ${name}!`;
}
const user = {
name: 'John',
age: 30
};
// After: TypeScript
interface User {
name: string;
age: number;
}
function greet(name: string): string {
return `Hello, ${name}!`;
}
const user: User = {
name: 'John',
age: 30
};
1. ANALYZE current state
- Current version/library
- Usage patterns
- Breaking changes list
2. PLAN migration
- Create migration checklist
- Identify high-risk areas
- Plan rollback strategy
3. SETUP coexistence (if needed)
- Install new version alongside
- Create adapters/wrappers
- Gradual migration path
4. MIGRATE incrementally
- Start with low-risk files
- Migrate one pattern at a time
- Test after each change
5. VERIFY
- Run all tests
- Manual testing
- Performance comparison
6. CLEANUP
- Remove old dependencies
- Remove adapters
- Update documentation
## Migration: {From} → {To}
### Pre-Migration
- [ ] Read changelog and breaking changes
- [ ] Create branch for migration
- [ ] Document current state
- [ ] Ensure tests are passing
### During Migration
- [ ] Install new version/library
- [ ] Update imports
- [ ] Fix breaking changes
- [ ] Update configuration files
- [ ] Run tests after each change
### Post-Migration
- [ ] All tests passing
- [ ] Manual QA complete
- [ ] Performance verified
- [ ] Documentation updated
- [ ] Old dependencies removed
| Pitfall | Prevention |
|---|---|
| Big bang migration | Migrate incrementally |
| No rollback plan | Create backup branch |
| Skipping tests | Run tests frequently |
| Ignoring warnings | Address all deprecations |
| Rushing | Take time, be thorough |
# Check for breaking changes
npm info package-name changelog
# Codemods (automated refactoring)
npx jscodeshift -t transform.js ./src
# TypeScript migration
npx typescript --init
npx ts-migrate
# React upgrade
npx react-codemod
legacy-modernization - Modernize old coderefactoring - Improve code structuretesting - Ensure migration safetyxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience