跳转到正文
报告库
用途分类 / 开发辅助

Deprecation And Migration Skill 安全审计

作者说它能做什么(原文)

Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.

第三方安全检查结论

发现安全风险

已检查文件
1
发现的风险
4
会不会运行危险命令?检查是否下载程序后直接运行、让他人远程控制电脑,或藏起要运行的命令。发现 1 项风险
中风险

示例建议运行来源和版本均未固定的 npx 命令

原文依据:2 处
发现了什么

迁移通知模板让用户运行 `npx migrate-check`,但没有固定版本、来源或校验方式。`npx` 在本地不存在该包时可能从配置的软件包注册表下载并执行代码。该命令出现在示例中,并非自动执行,但代理可能把它直接复制到真实迁移步骤。

为什么需要注意

如果注册表、包名解析或软件包本身遭到篡改,执行命令可能让第三方代码获得当前用户在项目目录中的文件和环境变量访问权限。

这段代码的正常用途

`npx migrate-check` 是弃用通知模板内的示例,不是脚本中的自动执行行为,也没有证据表明这个包真实存在。风险只在代理或用户把占位命令直接复制到实际流程时出现;此时 `npx` 可能下载并执行未固定版本的软件。可要求真实迁移步骤先核实包身份,并固定版本与注册表来源。

这项判断针对展示的代码和适用条件,不表示风险已经实际发生。
SKILL.md:88来自说明文档打开原文件
### Migration Guide1. Replace `import { client } from 'old-service'` with `import { client } from 'new-service'`2. Update configuration (see examples below)3. Run the migration verification script: `npx migrate-check````
查看另外 1 个位置
SKILL.md:77来自说明文档打开原文件
### Step 2: Announce and Document```markdown## Deprecation Notice: OldService
会不会泄露文件和密钥?检查是否发送含密码或密钥的文件,以及代码里是否直接写了密钥。发现 1 项风险
中风险

收缩阶段会删除生产数据库旧列及其中的数据

原文依据:3 处
发现了什么

示例最终要求停止写入并删除旧列。分阶段部署和确认无旧代码引用可降低兼容性风险,但删列仍是破坏性数据库操作;“每个迁移都有 down 路径”的规则本身不能保证被删除的数据可恢复。

为什么需要注意

如果回填不完整、双写产生差异或仍有未发现的读取方,删列可能造成生产数据丢失和应用故障;没有删除前快照时,结构回滚也无法还原旧列内容。

生产数据库示例最终明确要求删除旧列,这会移除该列中的数据。分阶段、双写、回填和单独部署能降低兼容性与发布风险,但“down 路径”没有说明如何恢复已删除数据。用户可要求删列前获得数据库负责人批准,验证无读取方,并保留经过恢复测试的备份或归档;也可限制代理只能准备迁移而不能执行收缩步骤。

SKILL.md:177来自说明文档打开原文件
1. **Expand.** Add `full_name` as nullable. Deploy. (Old code ignores it; nothing breaks.)2. **Dual-write.** App writes both `name` and `full_name` on every insert/update. Deploy.3. **Backfill.** Copy `name → full_name` for existing rows, in batches, so you don't lock the table.4. **Switch reads.** Point the app at `full_name`, keep writing both. Deploy and bake.5. **Contract.** Stop writing `name`, then — in a *separate, later* deploy — drop the column.
查看另外 2 个位置
SKILL.md:185来自说明文档打开原文件
**Rules:**- **Additive first, destructive last and alone.** Adds (new nullable column, new table, new index) are safe in any deploy; drops and renames get their own deploy *after* no code references the old shape.- **Every migration has a tested down path.** A migration you can't reverse is a deploy you can't roll back. Write and run the `down` before merging.- **Backfill in batches, off the hot path.** A single `UPDATE` over millions of rows locks the table; chunk it and throttle.- **Build large indexes without blocking writes** (e.g. Postgres `CREATE INDEX CONCURRENTLY`).
SKILL.md:166来自说明文档打开原文件
A schema change is the riskiest migration because the data is the one thing you cannot roll back by reverting a deploy. The failure mode is coupling the schema change to the code change: rename a column in the same release that starts using the new name, and during the rollout window — when old and new code run at once — one of them is querying a column that doesn't exist. The fix is to **never change a column in place**. Migrate in additive phases so old and new code are both valid at every step.
会不会删除文件或一直在后台运行?检查是否大范围删除文件、改写磁盘,或设置自动启动。发现 1 项风险
中风险

完成条件判断错误时,清理步骤会永久删除项目资产

原文依据:4 处
发现了什么

指南指示在迁移后删除旧代码及相关测试、文档和配置。虽然它要求先确认所有使用方已迁移并且活跃使用量为零,但没有规定人工批准、备份、保留期或可恢复删除机制。指标或依赖分析遗漏隐蔽使用方时,这个判断可能出错。

为什么需要注意

仍被使用的代码或配置可能被删除,测试与操作文档也可能同时消失,造成构建失败、服务中断或恢复困难。

指南明确要求删除旧代码、测试、文档和配置,因此在使用方识别错误时会造成项目资产丢失或回归。它用“所有使用方已迁移”和“零活跃使用量”作为前置条件,显著降低风险,但没有要求人工批准、备份或可恢复删除。用户可限制代理只生成清理清单或补丁,并要求负责人确认、版本控制备份及回滚验证后再删除。

SKILL.md:110来自说明文档打开原文件
Only after all consumers have migrated:```1. Verify zero active usage (metrics, logs, dependency analysis)2. Remove the code3. Remove associated tests, documentation, and configuration4. Remove the deprecation notices5. Celebrate — removing code is an achievement
查看另外 3 个位置
SKILL.md:96来自说明文档打开原文件
Migrate consumers one at a time, not all at once. For each consumer:```1. Identify all touchpoints with the deprecated system2. Update to use the replacement3. Verify behavior matches (tests, integration checks)4. Remove references to the old system5. Confirm no regressions```
SKILL.md:108来自说明文档打开原文件
### Step 4: Remove the Old SystemOnly after all consumers have migrated:```1. Verify zero active usage (metrics, logs, dependency analysis)2. Remove the code3. Remove associated tests, documentation, and configuration4. Remove the deprecation notices5. Celebrate — removing code is an achievement```
SKILL.md:235来自说明文档打开原文件
- [ ] Replacement is production-proven and covers all critical use cases- [ ] Migration guide exists with concrete steps and examples- [ ] All active consumers have been migrated (verified by metrics/logs)- [ ] Old code, tests, documentation, and configuration are fully removed- [ ] No references to the deprecated system remain in the codebase- [ ] Deprecation notices are removed (they served their purpose)
会不会绕过安全保护?检查是否跳过网站安全验证、开放过多文件权限,或取消操作前的确认。发现 1 项风险
低风险

安装命令没有固定依赖版本

原文依据:3 处
发现了什么

安装命令没有指定依赖版本。同样的命令以后可能下载不同代码,你实际安装的内容可能与这次检查时不同。

为什么需要注意

即使命令和报告没变,以后安装时也可能下载到另一份代码。

这段代码的正常用途

该文本位于虚构的弃用通知 Markdown 示例中,`migrate-check` 是占位名称,并非本技能的安装步骤或实际依赖。它确实未固定版本,若代理把示例原样用于真实项目,`npx` 可能获取并执行注册表代码;用户可要求作者把示例明确标为占位符,并在实际指南中指定受信来源和固定版本。仅凭这些行不能认定技能会安装该包。

这项判断针对展示的代码和适用条件,不表示风险已经实际发生。
SKILL.md:91来自说明文档打开原文件
2. Update configuration (see examples below)3. Run the migration verification script: `npx migrate-check````
查看另外 2 个位置
SKILL.md:79来自说明文档打开原文件
```markdown## Deprecation Notice: OldService
SKILL.md:88来自说明文档打开原文件
### Migration Guide1. Replace `import { client } from 'old-service'` with `import { client } from 'new-service'`2. Update configuration (see examples below)3. Run the migration verification script: `npx migrate-check````
会不会误导 AI 或隐藏内容?检查工作说明是否要求 AI 忽略你的指令、干扰检查结果,或夹带看不见的文字。未发现风险
会不会偷偷改推广链接或收款方?检查是否强制替换推广链接或收款对象,同时要求隐瞒更改。未发现风险

Skill 逻辑拆解

8 个说明模块

该 Skill 是一份迁移与弃用流程指南;其目标包括替换旧系统、下线功能、删除死代码和生产数据库架构迁移。提供的来源只有 Markdown,没有随附脚本或安装配置可供审计。

查看原文
SKILL.md:2来自说明文档打开原文件
---name: deprecation-and-migrationdescription: Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.---

指南通常要求先提供可用替代方案、逐个迁移使用方并验证行为,最后才删除旧系统;它也要求通过指标、日志和依赖分析确认活跃使用量为零。

查看原文
SKILL.md:96来自说明文档打开原文件
Migrate consumers one at a time, not all at once. For each consumer:```1. Identify all touchpoints with the deprecated system2. Update to use the replacement3. Verify behavior matches (tests, integration checks)4. Remove references to the old system5. Confirm no regressions```
SKILL.md:108来自说明文档打开原文件
### Step 4: Remove the Old SystemOnly after all consumers have migrated:```1. Verify zero active usage (metrics, logs, dependency analysis)2. Remove the code3. Remove associated tests, documentation, and configuration4. Remove the deprecation notices

数据库建议采用“扩展—迁移—收缩”:先添加并回填新列,再切换读取,最后在单独部署中删除旧列。它还建议分批回填,避免长时间锁表。

查看原文
SKILL.md:177来自说明文档打开原文件
1. **Expand.** Add `full_name` as nullable. Deploy. (Old code ignores it; nothing breaks.)2. **Dual-write.** App writes both `name` and `full_name` on every insert/update. Deploy.3. **Backfill.** Copy `name → full_name` for existing rows, in batches, so you don't lock the table.4. **Switch reads.** Point the app at `full_name`, keep writing both. Deploy and bake.5. **Contract.** Stop writing `name`, then — in a *separate, later* deploy — drop the column.
从这里开始 · 工作说明SKILL.md
deprecation-and-migration
连线表示工作说明包含的模块,不是实际运行顺序。点击模块可查看原文。 另有 3 个章节,可在原文件中查看。
文件与检查记录1 个文件

检查范围与遗漏

逐文件查看涉及的内容

下方列出本次涉及的原文范围;纳入检查不代表已查清所有问题。

  • SKILL.md已纳入全文

这份报告只针对上方版本。我们看了拿到的代码和说明文件,没有实际运行 Skill,也没有检查它另外安装的软件包。因此,这不是“保证安全”的承诺;换了版本或使用环境,结果也可能不同。

  • SKILL.md工作说明

代码和说明中提到的操作

安装其他软件包
SKILL.md:91来自说明文档打开原文件
2. Update configuration (see examples below)3. Run the migration verification script: `npx migrate-check````
读取了多少行
248
文件校验值(用于核对版本)
c1e33cc702c9512154261bfc7387c5b4854d2b69be1e43a9f3045b667d1b062b