用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/SocketDev/socket-btm --skill updating-hooks-dry命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | updating-hooks-dry |
| description | Read-only DRY sweep of fleet hooks and oxlint rules for overlap and consolidation. |
| user-invocable | true |
| allowed-tools | Workflow, Task, Read, Grep, Glob, Write, AskUserQuestion, Bash(node scripts/fleet/check/shared-hook-helpers-are-used.mts:*), Bash(node scripts/fleet/check/hooks-have-no-guard-nudge-overlap.mts:*), Bash(node scripts/fleet/check/hook-registry-is-current.mts:*), Bash(rg:*), Bash(grep:*), Bash(find:*), Bash(ls:*), Bash(wc:*), Bash(cat:*), Bash(head:*), Bash(tail:*) |
| model | claude-opus-4-8 |
| context | fork |
| metadata | {"internal":true} |
The fleet hook tree grows every time codifying-disciplines lands a new enforcer — and growth invites drift: two hooks that copy-paste the same logic instead of sharing a _shared/ helper, a _shared/ export nobody imports anymore, a lint rule and a hook both catching the identical AST shape, a 400-line hook doing one job its 80-line siblings do. This skill finds that bloat and writes a plan. It is read-only and plan-only by design: it applies nothing and opens no PR — a consolidation is a judgment call a human makes from the report. The one mechanical, safe gate — dead _shared/ exports — is already a hard check (shared-hook-helpers-are-used.mts); this skill is the broader, advisory companion.
codifying-disciplines.refactor-cleaner run) executes. No Edit/Write to hook source, no commits._shared/ exports already fail check --all via shared-hook-helpers-are-used.mts; guard/reminder overlap is already checked by hooks-have-no-guard-nudge-overlap.mts. This skill SURFACES candidates those gates don't (near-duplicate logic, KISS smells, subsuming lint selectors) and ranks everything for a human.Scout the surface so the fan-out has a work-list:
.claude/hooks/fleet/*/ and .claude/hooks/repo/*/ (exclude _shared/)._shared/ exports: rg '^export (async )?function|^export const|^export interface|^export type' .claude/hooks/fleet/_shared/..config/fleet/oxlint-plugin/fleet/*/.node scripts/fleet/check/shared-hook-helpers-are-used.mts — dead _shared/ exports (advisory).node scripts/fleet/check/hooks-have-no-guard-nudge-overlap.mts — known guard/reminder collisions.Run as a Workflow (sanctioned opt-in; pass the inventory as args). Four read-only scanner dimensions in parallel, then an adversarial verify, then synthesis. Each scanner uses agentType: 'Explore' (read-only) and returns a structured finding list.
phase('Scan') — four parallel scanners, each over the hook + lint-rule tree:
_shared/ helper. Compare STRUCTURE — the AST shape via _shared/shell-command.mts concepts — not just text. Schema per finding: { kind: 'copy-paste', members: [file:line], sharedHelperProposed, evidence }._shared/ exports — start from shared-hook-helpers-are-used.mts output; for each candidate, confirm whether it's genuinely unused or consumed out-of-tree — the check is advisory precisely because some _shared/ exports are consumed by wheelhouse-root or sibling repos. Schema: { kind: 'dead-export', symbol, file, confirmedUnused: bool, evidence }.{ kind: 'overlap', enforcers: [name], subsumes, evidence }._shared/ AST parser exists (the no-hook-cmd-regex concern); a hook reimplementing a _shared/ helper inline. Schema: { kind: 'kiss', file, smell, siblingNorm, evidence }.phase('Verify') — adversarial pass: per finding, a skeptic tries to REFUTE it — two guards that look similar but guard genuinely different surfaces are NOT a duplicate (e.g. a PreToolUse edit-guard vs a Stop reminder for related-but-distinct concerns the overlap check already knows are fine); a _shared/ export "unused" in-tree may be consumed by wheelhouse-root. Drop a finding unless the skeptic confirms it's a real consolidation opportunity. Default to refuted when uncertain.agent() writes the ranked report: highest-leverage consolidations first — a _shared/ helper that would absorb 4 hooks beats a one-off — each with evidence (file:line), the proposed consolidation, and a concrete diff sketch.Return { report, findingCount, byKind }.
Write the report to .claude/reports/hooks-dry-sweep-<YYYY-MM-DD>.md (untracked — the fleet .gitignore excludes /.claude/*; never write it to a committable path, the report-location-guard enforces this). The report is the deliverable. Apply nothing.
Report shape:
file:line), the proposed _shared/ helper or merge, a diff sketch, and the blast radius (how many hooks it touches → cascade scope).This skill is the advisory wide net; the deterministic gates are the safety floor. Dead _shared/ exports → shared-hook-helpers-are-used.mts (advisory check). Guard/reminder one-surface-per-concern → hooks-have-no-guard-nudge-overlap.mts (hard gate). Hook-registry currency → hook-registry-is-current.mts. When this skill finds a pattern worth enforcing deterministically, that itself is a codifying-disciplines candidate — promote it to a check rather than re-running the sweep to find it again.