Cross-Branch Migration Audit — Cross-Branch 迁移 审计
v2.0Performs pre-迁移 审计 for cross-branch 模块 or feature 迁移 by analyzing commits, dependencies, conflict risks, and generating detAIled interac...
运行时依赖
版本
🔴 High risk: diff > 200 lines / file > 5000 lines / heavy bidirectional modifications / core 记录ic involved
安装命令
点击复制本土化适配说明
Cross-Branch Migration Audit — Cross-Branch 迁移 审计 安装说明: 安装命令:["openclaw skills install cross-branch-audit"]
技能文档
Cross-Branch 迁移 审计 技能 (Universal) Overview
This 技能 performs comprehensive pre-迁移 审计s before cross-branch code 迁移. It analyzes git 历史, diff content, and code semantics to automatically identify external dependencies, evaluate 迁移 risks, and 生成 structured 审计 报告s.
应用licable to any language, any 框架, any project type.
导入ant: 生成 all 输出 (报告s, suggestions, 检查列出s) in the user's preferred language. If the user communicates in Chinese, 输出 in Chinese. If in English, 输出 in English.
Use Cases Migrating a feature 模块 from one long-diverged branch to another Porting a feature (possibly spanning multiple directories) from one branch to another Two branches cannot be directly git merged — need to precisely identify 迁移 scope Evaluating 迁移 workload and risk Determining cherry-pick order and strategy Pre-judging which files will conflict and how severe the conflicts will be Three 输入 Modes Mode A: 模块 Path Mode
Use when: Migrating a complete directory/模块 with clear boundaries.
输入:
Source branch, tar获取 branch 模块 path(s) (one or more directories)
Characteristics:
Automatically 扫描s all commits under the path Highest coverage, no omissions Best for whole-模块 迁移 Mode B: Feature Mode
Use when: Migrating a feature whose code is scattered across multiple directories, composed of multiple commits.
输入 (any combination):
Exact commit 列出 (user-known SHAs) Feature keywords (for 搜索ing commit messages) Time range + author TAPD/Jira/Issue ID
Characteristics:
Uses multi-strategy cross-验证 to find all related commits Requires human confirmation of commit range completeness Best for feature porting Mode C: Hybrid Mode
Use when: Primarily 模块-path based, but need to also capture 模块-external related changes.
输入:
模块 path + feature keywords First 扫描 by path, then supplement with keyword 搜索 for external commits Execution Flow Step 0: 环境 检测ion & Project Identification
Before 启动ing the 审计, automatically 检测 the project type to use correct dependency analysis strategies:
# 检测 project type ls -la # 检查 root directory structure
# Identify by characteristic files: # - build.gradle / 设置tings.gradle → Android/Java/Kotlin (Gradle) # - pom.xml → Java/Kotlin (Maven) # - package.json → JavaScript/TypeScript (Node.js) # - go.mod → Go # - Cargo.toml → Rust # - requirements.txt / 设置up.py / pyproject.toml → Python # - Podfile / .xcodeproj → iOS (Swift/ObjC) # - CMake列出s.txt → C/C++ # - .sln / .csproj → C# (.NET) # - mix.exs → Elixir # - Gemfile → Ruby
Also 检测 multi-channel/multi-flavor structure:
# 检查 for flavor/variant structure (Android) grep -r "productFlavors" --include=".gradle" . | head -5
# 检查 for multi-环境 config (Node.js) ls .env 2>/dev/null
# 检查 for multiple tar获取s (iOS) grep -c "tar获取" .xcodeproj/project.pbxproj 2>/dev/null
Record project type and multi-channel structure for subsequent steps.
Step 1: Confirm 输入 Parameters
Confirm the following with the user:
Required parameters:
Source branch: The branch with complete feature Tar获取 branch: The branch that needs to 接收 the code
Mode-specific parameters:
Mode Parameters to confirm A (模块 Path) 模块 path(s), e.g., src/audio/, lib/player/ B (Feature) Commit 列出 / keywords / time range + author / Issue ID C (Hybrid) 模块 path + feature keywords
Optional parameters:
启动 commit: Analysis 启动ing point, defaults to merge-base of two branches Exclude paths: Directories to skip (e.g., test/, docs/) Watch paths: User-known external directories that may be affected Step 2: Determine Commit Range Mode A: Path 扫描 # 获取 merge-base of two branches git merge-base origin/ origin/
# 获取 all commits on source branch for the tar获取 模块 (exclude merges) git 记录 <启动-commit>..origin/ --oneline --no-merges -- <模块-path-1> <模块-path-2> ...
Mode B: Multi-Strategy Cross-验证 Commit Discovery
执行 the following strategies in order, merge and deduplicate:
Strategy 1: Exact commit 列出 (if user provided)
git 记录 --oneline ...
Strategy 2: Keyword 搜索 (AI auto-expands keyword variants)
# User's original keyword git 记录 <启动>.. --oneline --no-merges --grep=""
# AI auto-expanded variants (translations, abbreviations, related concepts) git 记录 <启动>.. --oneline --no-merges --grep="" git 记录 <启动>.. --oneline --no-merges --grep="" # ... merge and deduplicate
Keyword expansion rules:
Chinese ↔ English translation (e.g., "支付" ↔ "payment") Abbreviation ↔ full name (e.g., "tts" ↔ "text to speech") Related concepts (e.g., "play" → "player", "暂停", "恢复") 模块/class names (e.g., "Payment服务", "Order处理器")
Strategy 3: Time range + author
git 记录 <启动>.. --oneline --no-merges