nextclaw: Skill for Claude Code

.agents/skills/nextclaw-dead-code-governance/SKILL.md

nextclaw-dead-code-governance is a skill for Claude Code, Codex from Peiiii/nextclaw. It costs 71 tokens per session (1,804 once invoked), scanned A, original, MIT.

A process for finding and safely removing dead code in the NextClaw repository. Dead code is code that is no longer used, such as obsolete files, exports, or dependencies.

In plain words
What is it for?
Use it to scan and clean unused files, exports, dependencies, duplicate implementations, and old paths, while reporting uncertain candidates instead of deleting them automatically.
Why use it?
It separates clearly removable code from items that may still be public APIs, plugin entry points, command-line tools, build resources, or compatibility paths.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is Peiiii/nextclaw's own configuration. It tells Claude Code and Codex how to work on nextclaw itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything nextclaw configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node .agents/skills/development-review/scripts/check-maintainability.mjs --non-feature --paths <touched-files...>.

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/Peiiii/nextclaw/master/.agents/skills/nextclaw-dead-code-governance/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Peiiii/nextclaw

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for nextclaw-dead-code-governance

README.md
[![agentmods](https://agentmods.dev/badge/skills/peiiii/nextclaw/nextclaw-dead-code-governance.svg)](https://agentmods.dev/skills/peiiii/nextclaw/nextclaw-dead-code-governance)
Your own site
<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>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,804 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 8d ago against content hash c80c899293a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

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.

.agents/skills/nextclaw-dead-code-governance/SKILL.md · 181 lines

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。

核心判断

死代码候选分三类:

  1. 确定可删:生产代码无引用、无 package exports、无 bin/脚本入口、无动态注册、无文档要求保留,且已有替代路径或本身无行为价值。
  2. 疑似可删:机器扫不到引用,但可能是公共 API、插件入口、协议类型、测试入口、构建资源、CLI/bin、动态 import 或外部包消费表面。
  3. 暂不删除:NCP 协议类型、SDK/export 表面、runtime/plugin 注册点、CLI/bin 入口、构建产物、资源文件、测试入口噪声、兼容迁移仍需要的旧路径。

默认只删除 确定可删疑似可删 先列入报告或下一批验证,不在同一刀里硬删。

扫描流程

1. 先读上下文

先确认:

  • 用户要的是只读审计,还是直接清理。
  • 作用域是全仓库、核心包,还是某个 package。
  • 当前工作区是否已有无关改动:git status --short

核心包优先级通常是:

  • packages/nextclaw
  • packages/nextclaw-core
  • packages/nextclaw-runtime
  • packages/nextclaw-app-runtime
  • packages/nextclaw-server
  • packages/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.ts barrel 暴露的公共类型:先判断是否属于 API surface,再决定是否收窄导出。

4. 反查证据

删除前必须至少做一次源码反查:

rg -n "<symbol-or-file-stem>" packages scripts apps docs -g '!**/dist/**' -g '!**/ui-dist/**' -g '!**/node_modules/**'

Read the full file on GitHub · 181 lines

Changes

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.

  1. 8d ago First seen · 181 lines · 71 tokens per session scan A c80c899293a4

Subscribe to this mod's changes

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.

Related

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.

vincentkoc/dotskills · 68 tokens

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.

vincentkoc/dotskills · 46 tokens

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.

vincentkoc/dotskills · 45 tokens

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.

vincentkoc/dotskills · 41 tokens

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…

vincentkoc/dotskills · 91 tokens

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.

vincentkoc/dotskills · 40 tokens