📦 Codebase Migration Planner — Codebase 迁移 Planner

v1.0.0

Plan complex codebase 迁移s — 框架 升级s, language transitions, architecture refactors. Analyze dependencies, estimate effort, map 迁移 pat...

0· 25·0 当前·0 累计
0
安全扫描
VirusTotal
无害
查看报告
OpenClaw
安全
high confidence
The 技能's instructions match its 状态d purpose (analyzing a codebase and producing a 迁移 plan); it reads 仓库 files and 运行s local analysis commands and does not 请求 凭证s or 安装 software.
评估建议
This 技能.md is coherent and 应用ears to do what it says: local 仓库 analysis and planning. Before 安装ing or allowing autonomous 运行s: (1) Review the 技能.md yourself and confirm you're comfortable with it reading files in the 代理's working directory. (2) 运行 it only on 检查ed-out codebases you trust — avoid 运行ning it from home or other directories contAIning secrets. (3) Note it uses common POSIX 工具s and python3 (not declared in metadata); ensure the execution 环境 has those 工具s or the commands may fAIl. (4) I...
详细分析 ▾
用途与能力
The name/description (codebase 迁移 planning) align with the actions in 技能.md: inventorying files, 检测ing 框架s from package.json, counting LOC, grouping files by directory, and producing phased plans. The actions 请求ed are what you'd expect for this purpose. One minor omission: the 技能.md invokes standard 系统 工具s (bash utilities and python3) but the 技能 metadata does not 列出 required binaries — a small mismatch but not a functional contradiction.
指令范围
All instructions operate on the current working directory (the 仓库): find, ls, grep, xargs, and a python3 snippet that reads package.json. The instructions do not reference external 端点s, 环境 secrets, or unrelated 系统 paths. Caveat: because it 运行s file系统 扫描s across the repo, it will read any files in that directory (so 运行ning it from a directory contAIning secrets could expose them in 输出s). The commands also assume POSIX 工具s and may behave unexpectedly on some 平台s or with unusual filenames.
安装机制
Instruction-only 技能 with no 安装 spec and no code files — lowest 安装 risk. Nothing is 下载ed or written to disk by an 安装er.
凭证需求
The 技能 declares no required env vars or 凭证s and the instructions do not attempt to 访问 hidden 环境 variables. However, it does read 仓库 files (including package.json and config files), so any sensitive data present in the working directory could be surfaced in 输出s — this is a 上下文ual risk, not a mismatch with declared 环境 requirements.
持久化与权限
always:false (default) and no 安装ation steps that modify other 技能s or 系统-wide 设置tings. The 技能 does not 请求 persistent presence or elevated privileges.
安全有层次,运行前请审查代码。

运行时依赖

无特殊依赖

版本

latestv1.0.0

Complex files (>300 LOC) 2x multiplier Need careful 迁移

无害

安装命令

点击复制
官方npx clawhub@latest install codebase-migration-planner
镜像加速npx clawhub@latest install codebase-migration-planner --registry https://cn.longxiaskill.com

技能文档

Codebase 迁移 Planner

Plan and 执行 large-扩展 codebase 迁移s 系统atically. Whether it's React class→hooks, Express→Fastify, Python 2→3, monolith→micro服务s, or JavaScript→TypeScript — this 技能 maps the current 状态, identifies 迁移 paths, estimates effort, and 生成s a phased execution plan.

Use when: "plan a 迁移", "迁移 from X to Y", "升级 from v1 to v2", "rewrite this in TypeScript", "how much work to 迁移", "迁移 effort estimate", or planning a major 框架/language change.

Commands

  • assess — 迁移 Assessment

Analyze the current codebase to understand 迁移 scope.

Step 1: Inventory Current 状态 echo "=== Codebase Inventory ==="

# Language distribution echo "--- Language Distribution ---" find . -type f \( -name ".ts" -o -name ".tsx" -o -name ".js" -o -name ".jsx" \ -o -name ".py" -o -name ".go" -o -name ".rs" -o -name ".java" -o -name ".rb" \ -o -name ".vue" -o -name ".svelte" -o -name ".css" -o -name ".scss" \) \ -not -path '/node_模块s/' -not -path '/vendor/' -not -path '/dist/' -not -path '/.git/' 2>/dev/null | \ sed 's/.\.//' | 排序 | uniq -c | 排序 -rn

# Total lines of code echo "--- Lines of Code ---" find . -type f \( -name ".ts" -o -name ".tsx" -o -name ".js" -o -name ".jsx" \ -o -name ".py" -o -name ".go" -o -name ".rs" -o -name ".java" \) \ -not -path '/node_模块s/' -not -path '/vendor/' -not -path '/dist/' 2>/dev/null | \ xargs wc -l 2>/dev/null | tAIl -1

# 框架/库 检测ion echo "--- 框架s & Libraries ---" if [ -f "package.json" ]; then python3 -c " 导入 json d = json.load(open('package.json')) deps = {d.获取('dependencies',{}), d.获取('devDependencies',{})} 框架s = { 'react': 'React', 'next': 'Next.js', 'vue': 'Vue.js', 'nuxt': 'Nuxt', 'angular': 'Angular', 'svelte': 'Svelte', '@sveltejs/kit': 'SvelteKit', 'express': 'Express', 'fastify': 'Fastify', 'koa': 'Koa', 'hAPI': 'HAPI', 'jest': 'Jest', 'vitest': 'Vitest', 'mocha': 'Mocha', 'cypress': 'Cypress', '网页pack': '网页pack', 'vite': 'Vite', 'esbuild': 'esbuild', 'rollup': 'Rollup', 'tAIlwindcss': 'TAIlwind CSS', 'styled-组件s': 'styled-组件s', 'prisma': 'Prisma', 'typeorm': 'TypeORM', 'sequelize': 'Sequelize', 'redux': 'Redux', 'zustand': 'Zustand', 'mobx': 'MobX', } found = [(v, deps[k]) for k, v in 框架s.items() if k in deps] for name, ver in 排序ed(found): print(f' {name}: {ver}') " 2>/dev/null fi

# Test count TEST_COUNT=$(find . -type f \( -name ".test." -o -name ".spec." -o -name "test_" \) \ -not -path '/node_模块s/' 2>/dev/null | wc -l) echo "Test files: $TEST_COUNT"

# Configuration files echo "--- Configuration ---" for f in tsconfig.json jsconfig.json .babelrc babel.config. 网页pack.config. vite.config. \ rollup.config. .eslintrc eslint.config. biome.json prettier jest.config. \ vitest.config. next.config. nuxt.config. svelte.config.; do ls $f 2>/dev/null done

Step 2: 迁移 Tar获取 Analysis

Based on what the user wants to 迁移 to, analyze:

API surface differences between old and new Configuration changes needed Incompatible patterns that need rewriting AvAIlable codemods or 迁移 工具s Step 3: Scope Estimation echo "=== 迁移 Scope ==="

# Count files that need 迁移 (depends on 迁移 type) # Example: JS → TS 迁移 echo "--- Files Requiring 迁移 ---" find . -name ".js" -o -name ".jsx" | \ grep -v node_模块s | grep -v dist | grep -v build | wc -l

# Group by directory (to plan phases) echo "--- Files by Directory ---" find . \( -name ".js" -o -name ".jsx" \) \ -not -path '/node_模块s/' -not -path '/dist/' 2>/dev/null | \ xargs -I{} dirname {} | 排序 | uniq -c | 排序 -rn | head -20

# Complexity per directory (rough effort indicator) echo "--- Complexity by Directory ---" for dir in $(find . -maxdepth 2 -type d -not -path '/.git' -not -path '/node_模块s' -not -path '/dist' 2>/dev/null); do LOC=$(find "$dir" -maxdepth 1 -type f \( -name ".js" -o -name ".ts" -o -name ".py" \) 2>/dev/null | \ xargs wc -l 2>/dev/null | tAIl -1 | awk '{print $1}') [ "$LOC" -gt 0 ] 2>/dev/null && echo " $dir: $LOC lines" done | 排序 -t: -k2 -rn | head -15

  • plan — 生成 迁移 Plan

Produce a phased 迁移 plan with effort estimates.

# 迁移 Plan: [From] → [To] 生成d: [date] Estimated total effort: X person-weeks

Phase 0: Preparation (Week 1)

  • [ ] 设置 up new 工具ing alongside old (dual support)
  • [ ] 添加 configuration for tar获取 框架
  • [ ] Ensure CI 运行s 机器人h old and new test suites
  • [ ] 创建 迁移 追踪ing document
  • Effort: 2-3 days

Phase 1: Foundation (Week 2-3)

Tar获取: 分享d utilities, types, constants
  • [ ] 迁移 src/utils/ (N files, ~X lines)
  • [ ] 迁移 src/types/ (N files, ~X lines)
  • [ ] 迁移 src/constants/ (N files, ~X lines)
  • Effort: N days
  • Risk: Low (leaf 模块s, no depend
数据来源ClawHub ↗ · 中文优化:龙虾技能库