본문으로 건너뛰기
cccskills
무료GitHub에 공개

codebase-migrate

Coordinate large-scale codebase migrations and multi-file refactors across hundreds of files. Manage framework upgrades, API renames, and config rewrites using batched PRs, issue tracking, and CI verification.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md6.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Codebase Migrate

Use This Skill When

  • Upgrading frameworks (React 17→19, Django 4→5, Node 18→22)
  • Renaming APIs or functions across entire codebase
  • Migrating configurations (webpack→vite, eslint→biome, jest→vitest)
  • Refactoring file structures or naming conventions
  • Running codemods on 100+ files simultaneously
  • Coordinating changes across monorepos or large projects
  • Need reviewable, batched PRs for large-scale changes

When NOT to Use

  • Small single-file changes (use direct edits instead)
  • When you want all changes in one massive PR
  • Projects without test coverage (risky to batch migrate)
  • Custom migrations with complex manual logic
  • When CI/CD pipeline is not stable

Context: Migration Maturity

Undeveloped: Single massive PR, hard to review, hard to debug failures.

Target: Changes batched into 25–50 file chunks, each PR passes CI, easy to revert per-batch.

Optimized: Fully automated pipelines, parallel batch testing, quick rollback, minimal manual intervention.

Core Principle

Large codebase migrations succeed when broken into small, reviewable, verifiable chunks. Batch changes to keep PRs under 10–15 files each, run full tests per batch, and use issue tracking to maintain checkpoint progress.

Prerequisites

curl -fsSL https://composio.dev/install | bash
composio login
composio link github        # PR creation + CI status
composio link linear        # Issue tracking (or jira)

Local Tools Required:

  • git (version control)
  • rg / grep (file search)
  • jscodeshift / ts-morph / comby / ast-grep (language-specific codemods)
  • Test runner for your language

Instructions

Step 1: Define and Scope the Transform

Good Definition Example:

  • ✓ "Replace jest.mock with vi.mock, swap jest.fn() for vi.fn(), rename jest.config.js → vitest.config.ts"

Bad Definition Example:

  • ✗ "Migrate to vitest" (too vague)

Scope the Blast Radius:

# Find all files that need changes
rg -l 'jest\.(mock|fn|spyOn)' | wc -l
rg -l 'from "jest"' | sort | wc -l

Document Findings:

MetricValue
Total files to migrateX
Estimated batch size25–50 files
Number of batchesX / 25 = N
Est. review time per PR15–30 min

Step 2: File a Tracking Issue

Create a central tracking issue to monitor progress:

composio execute LINEAR_CREATE_ISSUE -d '{
  "teamId":"TEAM_ID",
  "title":"Migrate: jest → vitest",
  "description":"Batches of ~25 files per PR. Track: batch-1, batch-2, ..."
}'

Document the issue ID (e.g., LIN-482).

Step 3: Plan Batch Strategy

Batch Structure:

BatchFilesScopeDepends On
11–25Core test config + base setupNone
226–50Unit tests in src/Batch 1 ✓
351–75Integration testsBatch 2 ✓
N......Batch N-1 ✓

Create Batch List:

# Extract files matching pattern
BATCH=$(rg -l 'jest\.mock' | grep -v done.list | head -25)
echo "$BATCH" > batch-01.list

Step 4: Execute Transform Per Batch

Workflow:

  1. Checkout feature branch
  2. Run codemod on batch files
  3. Test locally
  4. Commit and push
  5. Create PR with issue reference
  6. Wait for CI green
  7. Merge and move to next batch

Example:

# Start batch branch
git checkout -b migrate/vitest-batch-01

# Run codemod (language-specific)
xargs < batch-01.list jscodeshift -t transforms/jest-to-vitest.ts

# Test changed files
npm test -- --changed

# Commit
git add -A
git commit -m "migrate(test): jest → vitest (batch 1 of 8)"
git push -u origin migrate/vitest-batch-01

Step 5: Create PR and Track Progress

Create PR with automation:

composio execute GITHUB_CREATE_A_PULL_REQUEST -d '{
  "owner":"org","repo":"app",
  "head":"migrate/vitest-batch-01","base":"main",
  "title":"migrate(test): jest → vitest (batch 1 of 8)",
  "body":"Issue: LIN-482. Files: batch-01.list. Codemod: jest-to-vitest.ts"
}'

Update tracking issue:

composio execute LINEAR_CREATE_COMMENT -d '{
  "issueId":"LIN-482",
  "body":"Batch 1 PR opened. Waiting for CI. Tracking spreadsheet: [link]"
}'

Step 6: Verify and Merge

Check CI Status:

composio execute GITHUB_LIST_WORKFLOW_RUNS_FOR_A_REPOSITORY \
  -d '{"owner":"org","repo":"app","branch":"migrate/vitest-batch-01"}' \
  | jq '.workflow_runs[0].conclusion'

Verify Migration Progress:

# Count remaining jest references
rg 'jest\.(mock|fn|spyOn)' | wc -l

# Should trend toward 0 as batches merge

Merge when green:

  • Merge PR to main
  • Mark batch as complete in tracking issue
  • Start next batch

Safety Rails

Critical Rules:

RuleReason
One transform per PRNever mix rename + format change
Maintain done.listSkip already-migrated files in next batch
Full test suite on final batchCatch integration issues
Codemod first, hand-edit secondPatch exceptions manually, note in PR
Per-batch rollback onlyEach PR reverts cleanly
Keep batch size <50 filesReviewable in 20–30 minutes
Never force-push merged branchesMaintain clean history

Quality Checklist

After each batch merges:

  • ✓ No conflicts with main or other open batches
  • ✓ All tests pass (local + CI)
  • ✓ Old API references trending to 0
  • ✓ No regressions in unrelated code
  • ✓ PR reviewed and approved
  • ✓ Tracking issue updated with checkpoint

Troubleshooting

IssueSolution
Codemod regex too broadSwitch to AST-based tool (ts-morph, ast-grep)
Tests pass locally, fail in CICheck Node/Python version parity (.nvmrc, pyproject.toml)
PR too large to reviewReduce batch size from 50→25 files
Batch conflictsRebase open batch before merging current one
Manual edits in multiple batchesDocument in PR description for maintainers

Output

Provide:

  1. Migration Plan Document

    • Scope (file count, complexity)
    • Batch breakdown (number, size)
    • Tracking issue ID
    • Estimated timeline
  2. Per-Batch Deliverables

    • batch-01.list (files to transform)
    • Codemod script (e.g., jest-to-vitest.ts)
    • PR description template
    • Test instructions
  3. Progress Dashboard

    • Batch completion status
    • CI pass/fail per batch
    • Issue link for coordination
    • Rollback plan if needed

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

Automate Ably tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

Automate Abstract tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

Automate Abuselpdb tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

Automate Abyssale tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

manu14357의 스킬 모두 보기

이 스킬의 문제 신고