‹ 首页

remove-code

@hawkyre · 收录于 昨天 · 上游提交 1 个月前

Remove a feature, delete dead code, drop a dependency, or simplify an abstraction. Use when the user wants to delete or clean up code.

适合你,如果经常需要删除或清理代码

/ 通过 npx 安装 校验哈希
npx oh-my-skill add hawkyre/hawk-skills/remove-code
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- hawkyre/hawk-skills/remove-code
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify hawkyre/hawk-skills/remove-code
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
28GitHub stars
~392上下文体积 · 单文件
索引托管

怎么用

商店整理自技能原文 · 版本 6ffb2d6 · 表述以原文为准
它做什么

安装后,Claude 会帮你安全删除代码。它会先分析要删除的功能及其依赖,列出所有相关文件,等你确认后再执行删除,并自动验证是否还有残留引用。

什么时候触发

当你想删除功能、清理死代码、移除依赖或简化抽象时,Claude 会接管并按照删除流程操作。

装好后可以这样说
Claude 会追踪支付模块的依赖,安全移除相关代码。
Claude 会查找并移除不再需要的依赖及引用。
技能原文 SKILL.md作者撰写 · MIT · 6ffb2d6

Remove Code

Process
  1. Understand the capability to remove (not just files): What user-facing or internal capability is being removed?
  1. Trace dependencies before deleting anything:
  • All references to the functionality across the codebase
  • Code that ONLY exists to support this feature (can be fully deleted)
  • Code that is SHARED with other features (must be preserved)
  • Database migrations, config entries, env vars, feature flags, documentation that reference it
  1. Present the trace: List everything to delete and everything to modify, grouped by file. Wait for user review.
  1. Execute deletion:
  • Fully dead files: delete
  • Partially dead files: remove only dead parts
  • Update imports, exports, index files
  • Remove or update related tests
  1. Verify:
  2. Run the project's check command
  3. Grep for remaining references to removed code (function names, class names, route paths, config keys) — there are always stragglers
Rules
  • Describe the CAPABILITY being removed, not files — this finds things you forgot about
  • Always verify with a full check run after deletion
  • Do deletion in its own PR, separate from any new feature work
  • Check .agents/common-mistakes/ for any removal-specific patterns before executing
  • Big-output discipline. Heavy command output (project check, full git diff, repo-wide search, long log, large fetch) goes to /tmp/hawk-remove-code-<step>.log, then rg -n '<pattern>' /tmp/hawk-remove-code-<step>.log | head -50 extracts what you need. Read the file only with offset/limit. See README → Big-output discipline.
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。