ln-830-code-modernization-coordinator by levnikolaevich/claude-code-skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-830-code-modernization-coordinator路径说明: 文件路径(
shared/、references/、../ln-*)是相对于技能仓库根目录的。如果在当前工作目录未找到,请定位此 SKILL.md 文件所在的目录,然后向上返回一级以找到仓库根目录。如果缺少shared/目录,请通过 WebFetch 从https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}获取文件。
类型: L2 领域协调器 类别: 8XX 优化
通过委派给 L3 工作者来协调代码现代化:ln-831(开源软件替换器)和 ln-832(打包优化器)。执行来自 6XX 审计发现的迁移计划。
| 方面 | 详情 |
|---|---|
| 输入 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 审计报告(ln-645 迁移计划)或目标模块 |
| 输出 | 经过现代化改造的代码库及验证证明 |
| 工作者 | ln-831(开源软件替换器),ln-832(打包优化器) |
阶段: 预检 → 分析输入 → 委派 → 收集 → 验证 → 报告
| 检查项 | 必需 | 缺失时的操作 |
|---|---|---|
| 审计报告或目标模块 | 是 | 阻止现代化改造 |
| Git 状态干净 | 是 | 阻止(需要干净的基线以便回退) |
| 测试基础设施 | 是 | 阻止(工作者需要测试来决定保留/丢弃) |
必读: 加载 shared/references/ci_tool_detection.md 以进行测试/构建检测。
| 条件 | ln-831 | ln-832 |
|---|---|---|
| 存在 ln-645 发现(开源软件候选) | 是 | 否 |
| 具有 package.json 的 JS/TS 项目 | 否 | 是 |
| 两个条件都满足 | 是 | 是 |
| 指定了目标模块 | 是 | 否 |
| 指标 | 技术栈 | 符合 ln-832 条件 |
|---|---|---|
| package.json + JS/TS 文件 | JS/TS | 是 |
| *.csproj | .NET | 否 |
| requirements.txt / pyproject.toml | Python | 否 |
| go.mod | Go | 否 |
关键: 所有委派都使用 Agent 工具,并设置
subagent_type: "general-purpose"和isolation: "worktree"— 每个工作者根据shared/references/git_worktree_fallback.md创建自己的分支。
FOR each selected worker:
Agent(description: "Modernize via ln-83X",
prompt: "Execute modernization worker.
Step 1: Invoke worker:
Skill(skill: \"ln-83X-{worker}\")
CONTEXT:
{delegationContext}",
subagent_type: "general-purpose",
isolation: "worktree")
| 字段 | 类型 | 描述 |
|---|---|---|
| projectPath | string | 项目的绝对路径 |
| auditReport | string | 指向 codebase_audit.md 的路径(如适用) |
| targetModule | string | 目标模块路径(如适用) |
| options.runTests | bool | 现代化改造后运行测试 |
| 顺序 | 工作者 | 原因 |
|---|---|---|
| 1 | ln-831(开源软件替换器) | 可能添加/移除包,影响打包 |
| 2 | ln-832(打包优化器) | 在包变更确定后运行 |
规则:
每个工作者产生一个独立的分支。协调器汇总分支报告。
| 工作者 | 分支模式 | 内容 |
|---|---|---|
| ln-831 | modernize/ln-831-{module}-{ts} | 开源软件替换 |
| ln-832 | modernize/ln-832-bundle-{ts} | 打包优化 |
| 字段 | 类型 | 描述 |
|---|---|---|
| worker | string | ln-831 或 ln-832 |
| status | enum | success, partial, failed |
| branch | string | 工作者的结果分支名称 |
| changes_applied | int | 应用的变更数量 |
| changes_discarded | int | 丢弃的尝试数量 |
| details | object | 工作者特定的报告 |
每个工作者在其分支中独立验证(测试、构建由工作者自身运行)。协调器不重新运行验证或回退工作者的变更。
| 字段 | 描述 |
|---|---|
| input_source | 审计报告或目标模块 |
| workers_activated | 哪些工作者运行了 |
| modules_replaced | 应用的开源软件替换(ln-831) |
| loc_removed | 移除的自定义代码行数(ln-831) |
| bundle_reduction | 打包大小减少量(字节/百分比)(ln-832) |
| build_verified | 通过 或 失败 |
| per_worker[] | 各个工作者的报告 |
Options:
# Input
audit_report: "docs/project/codebase_audit.md"
target_module: ""
# Workers
enable_oss_replacer: true
enable_bundle_optimizer: true
# Verification
run_tests: true
run_build: true
# Safety
revert_on_build_failure: true
| 错误 | 恢复措施 |
|---|---|
| ln-831 失败 | 继续执行 ln-832 |
| ln-832 失败 | 报告部分成功(ln-831 结果有效) |
| 构建失败 | 回退最后一个工作者,重新验证 |
| 错误 | 操作 |
|---|---|
| 没有工作者被激活 | 报告 "未找到现代化改造目标" |
| 所有工作者都失败 | 报告失败,建议手动审查 |
| Git 状态不干净 | 阻止并提示 "请先提交或暂存变更" |
../ln-831-oss-replacer/SKILL.md../ln-832-bundle-optimizer/SKILL.md../ln-645-open-source-replacer/SKILL.md(审计配套)shared/references/ci_tool_detection.mdTodoWrite 格式(强制):
- Invoke ln-831-oss-replacer (in_progress)
- Invoke ln-832-bundle-optimizer (pending)
- Aggregate reports (pending)
| 阶段 | 工作者 | 上下文 |
|---|---|---|
| 2 | ln-831-oss-replacer | 隔离(Agent 工具)— 针对自定义代码的开源软件替换 |
| 2 | ln-832-bundle-optimizer | 隔离(Agent 工具)— 打包大小优化(在 ln-831 之后运行) |
所有工作者: 通过 Agent 工具调用,并设置 isolation: "worktree" — 顺序执行,ln-831 先于 ln-832。
isolation: "worktree",ln-831 先于 ln-832)必读: 加载 shared/references/meta_analysis_protocol.md
技能类型:optimization-coordinator。在所有阶段完成后运行。使用 optimization-coordinator 格式输出到聊天。
版本: 1.0.0 最后更新: 2026-03-08
每周安装
75
仓库
GitHub 星标
253
首次出现
2026年3月8日
安全审计
安装于
cursor71
claude-code70
github-copilot69
codex69
kimi-cli69
opencode69
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. Ifshared/is missing, fetch files via WebFetch fromhttps://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
Type: L2 Domain Coordinator Category: 8XX Optimization
Coordinates code modernization by delegating to L3 workers: ln-831 (OSS replacer) and ln-832 (bundle optimizer). Executes migration plans from 6XX audit findings.
| Aspect | Details |
|---|---|
| Input | Audit report (ln-645 migration plan) OR target module |
| Output | Modernized codebase with verification proof |
| Workers | ln-831 (OSS replacer), ln-832 (bundle optimizer) |
Phases: Pre-flight → Analyze Input → Delegate → Collect → Verify → Report
| Check | Required | Action if Missing |
|---|---|---|
| Audit report OR target module | Yes | Block modernization |
| Git clean state | Yes | Block (need clean baseline for revert) |
| Test infrastructure | Yes | Block (workers need tests for keep/discard) |
MANDATORY READ: Load shared/references/ci_tool_detection.md for test/build detection.
| Condition | ln-831 | ln-832 |
|---|---|---|
| ln-645 findings present (OSS candidates) | Yes | No |
| JS/TS project with package.json | No | Yes |
| Both conditions | Yes | Yes |
| Target module specified | Yes | No |
| Indicator | Stack | ln-832 Eligible |
|---|---|---|
| package.json + JS/TS files | JS/TS | Yes |
| *.csproj | .NET | No |
| requirements.txt / pyproject.toml | Python | No |
| go.mod | Go | No |
CRITICAL: All delegations use Agent tool with
subagent_type: "general-purpose"andisolation: "worktree"— each worker creates its own branch pershared/references/git_worktree_fallback.md.
FOR each selected worker:
Agent(description: "Modernize via ln-83X",
prompt: "Execute modernization worker.
Step 1: Invoke worker:
Skill(skill: \"ln-83X-{worker}\")
CONTEXT:
{delegationContext}",
subagent_type: "general-purpose",
isolation: "worktree")
| Field | Type | Description |
|---|---|---|
| projectPath | string | Absolute path to project |
| auditReport | string | Path to codebase_audit.md (if applicable) |
| targetModule | string | Target module path (if applicable) |
| options.runTests | bool | Run tests after modernization |
| Order | Worker | Reason |
|---|---|---|
| 1 | ln-831 (OSS replacer) | May add/remove packages, affecting bundle |
| 2 | ln-832 (bundle optimizer) | Runs AFTER package changes are settled |
Rules:
Each worker produces an isolated branch. Coordinator aggregates branch reports.
| Worker | Branch Pattern | Contents |
|---|---|---|
| ln-831 | modernize/ln-831-{module}-{ts} | OSS replacements |
| ln-832 | modernize/ln-832-bundle-{ts} | Bundle optimizations |
| Field | Type | Description |
|---|---|---|
| worker | string | ln-831 or ln-832 |
| status | enum | success, partial, failed |
| branch | string | Worker's result branch name |
| changes_applied | int | Number of kept changes |
| changes_discarded | int | Number of discarded attempts |
| details | object | Worker-specific report |
Each worker verified independently in its branch (tests, build run by worker itself). Coordinator does NOT rerun verification or revert worker changes.
| Field | Description |
|---|---|
| input_source | Audit report or target module |
| workers_activated | Which workers ran |
| modules_replaced | OSS replacements applied (ln-831) |
| loc_removed | Custom code lines removed (ln-831) |
| bundle_reduction | Bundle size reduction in bytes/% (ln-832) |
| build_verified | PASSED or FAILED |
| per_worker[] | Individual worker reports |
Options:
# Input
audit_report: "docs/project/codebase_audit.md"
target_module: ""
# Workers
enable_oss_replacer: true
enable_bundle_optimizer: true
# Verification
run_tests: true
run_build: true
# Safety
revert_on_build_failure: true
| Error | Recovery |
|---|---|
| ln-831 failure | Continue with ln-832 |
| ln-832 failure | Report partial success (ln-831 results valid) |
| Build failure | Revert last worker, re-verify |
| Error | Action |
|---|---|
| No workers activated | Report "no modernization targets found" |
| All workers failed | Report failures, suggest manual review |
| Dirty git state | Block with "commit or stash changes first" |
../ln-831-oss-replacer/SKILL.md../ln-832-bundle-optimizer/SKILL.md../ln-645-open-source-replacer/SKILL.md (audit companion)shared/references/ci_tool_detection.mdTodoWrite format (mandatory):
- Invoke ln-831-oss-replacer (in_progress)
- Invoke ln-832-bundle-optimizer (pending)
- Aggregate reports (pending)
| Phase | Worker | Context |
|---|---|---|
| 2 | ln-831-oss-replacer | Isolated (Agent tool) — OSS replacements for custom code |
| 2 | ln-832-bundle-optimizer | Isolated (Agent tool) — bundle size optimization (runs after ln-831) |
All workers: Invoke via Agent tool with isolation: "worktree" — sequential execution, ln-831 before ln-832.
isolation: "worktree", ln-831 before ln-832)MANDATORY READ: Load shared/references/meta_analysis_protocol.md
Skill type: optimization-coordinator. Run after all phases complete. Output to chat using the optimization-coordinator format.
Version: 1.0.0 Last Updated: 2026-03-08
Weekly Installs
75
Repository
GitHub Stars
253
First Seen
Mar 8, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
cursor71
claude-code70
github-copilot69
codex69
kimi-cli69
opencode69
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
46,600 周安装