Borrowing it
Nothing to install: this file belongs to Peiiii/nextclaw. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Peiiii/nextclaw/master/.agents/skills/nextclaw-dead-code-governance/SKILL.mdgit clone --depth 1 https://github.com/Peiiii/nextclawWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/peiiii/nextclaw/nextclaw-dead-code-governance)<a href="https://agentmods.dev/skills/peiiii/nextclaw/nextclaw-dead-code-governance"><img src="https://agentmods.dev/badge/skills/peiiii/nextclaw/nextclaw-dead-code-governance.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00071 | $0.01804 |
| Opus 5 | $0.00036 | $0.00902 |
| Sonnet 5 | $0.00014 | $0.00361 |
| Haiku 4.5 | $0.00007 | $0.00180 |
Grade A, and why
nextclaw-dead-code-governance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.
NextClaw 死代码治理
目标
把“感觉项目越来越臃肿”变成可重复、低误删风险的清理流程。
这个 skill 只负责死代码治理:找出并删除无引用、重复、过期、被新路径替代的代码。它不负责一般性能优化、功能重构或目录治理战役;若任务扩大到长期自治推进,再联动 autonomous-maintainability-campaign。
使用前提
本 skill 命中后拥有本次死代码扫描、删除与实现结果,不拥有阶段切换;完成当前 slice 后返回生命周期,由 Validation、Review、Delivery 和 Retrospective 各自处理后续合同。长期自治战役、迭代留痕或规则修改只有条件实际成立时才加载对应 owner,不重新加载上游 lifecycle。
核心判断
死代码候选分三类:
确定可删:生产代码无引用、无 package exports、无 bin/脚本入口、无动态注册、无文档要求保留,且已有替代路径或本身无行为价值。疑似可删:机器扫不到引用,但可能是公共 API、插件入口、协议类型、测试入口、构建资源、CLI/bin、动态 import 或外部包消费表面。暂不删除:NCP 协议类型、SDK/export 表面、runtime/plugin 注册点、CLI/bin 入口、构建产物、资源文件、测试入口噪声、兼容迁移仍需要的旧路径。
默认只删除 确定可删。疑似可删 先列入报告或下一批验证,不在同一刀里硬删。
扫描流程
1. 先读上下文
先确认:
- 用户要的是只读审计,还是直接清理。
- 作用域是全仓库、核心包,还是某个 package。
- 当前工作区是否已有无关改动:
git status --short。
核心包优先级通常是:
packages/nextclawpackages/nextclaw-corepackages/nextclaw-runtimepackages/nextclaw-app-runtimepackages/nextclaw-serverpackages/ncp-packages/*packages/nextclaw-ui
2. 只读扫描
优先使用仓库已有信号:
pnpm metrics:local
pnpm lint:maintainability:hotspots
再用 knip 扫死代码,按作用域收窄:
pnpm dlx knip --workspace <package-or-path> --include files,exports,dependencies --reporter compact --no-exit-code --max-show-issues 200
对生产路径可补:
pnpm dlx knip --production --workspace <package-or-path> --include files,exports,dependencies --reporter compact --no-exit-code --max-show-issues 200
对局部未用符号可补:
pnpm -C <package> exec tsc -p tsconfig.json --noEmit --noUnusedLocals --noUnusedParameters
3. 降噪过滤
knip 常见误报必须先过滤:
*.test.*、tests/:多半是测试入口未配置,不等于可删。ui-dist/、dist/、public/sw.js、资源目录:可能是构建或发布资源。- package
exports指向的类型和入口:可能被外部用户消费。 - CLI
bin、scripts、worker entry、dynamic import、plugin manifest、runtime registry:不能只看静态 import。 index.tsbarrel 暴露的公共类型:先判断是否属于 API surface,再决定是否收窄导出。
4. 反查证据
删除前必须至少做一次源码反查:
rg -n "<symbol-or-file-stem>" packages scripts apps docs -g '!**/dist/**' -g '!**/ui-dist/**' -g '!**/node_modules/**'
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 181 lines · 71 tokens per session scan A c80c899293a4
nextclaw-dead-code-governance is a skill published in the GitHub repository Peiiii/nextclaw (256 stars, last pushed today), licensed MIT. It adds 71 tokens to every session and 1,804 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
openclaw-github-dedupe
Investigate a cluster of GitHub issues and PRs, determine canonical candidates, post duplicate/related status, preserve contributor credit, and execute cleanup actions. Supports autonomous mode for provided-link-only closeout, merge/fix follow-through, changelog, and post-merge issue/PR cleanup.
tmux-lane-orchestrator
Manage one tmux agent lane from its matching ops pane, inspect live pane state and Codex logs on cold start, and produce concise manager summaries for OpenClaw and adjacent project work.
ghcrawl-cluster-operator
Use when inspecting a ghcrawl SQLite store, pulling GitHub issue/PR data, refreshing summaries, embeddings, and clusters, or extracting one cluster and its evidence through the ghcrawl CLI.
opik-optimizer
Optimize LLM prompts, tools, and agents in Opik using standardized optimizer workflows (prompt optimization, tool optimization, and parameter tuning), dataset/metric wiring, and result interpretation.
org-branch-cleanup
Audit and safely prune stale branches across a GitHub organization with immutable snapshots, conservative merged-PR classification, live SHA/protection/open-PR revalidation, resumable deletion ledgers, and post-delete verification. Use when a maintainer asks to clean up old, dead, merged, bot-created, or abandoned…
crabpot-perf-metrics
Interpret Crabpot and OpenClaw performance dashboard metrics, import-loop profiles, runtime profiles, and branch-to-branch perf deltas without over-reading noisy samples.