用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/PaulRBerg/agent-skills --skill naming-refactor命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Assess recurrence risk for agent behavior using local Codex/Claude Code transcripts and recommend evidence-backed durable fixes to AGENTS.md or skills. Not for routine post-success skill-evolution or agent self-improvement reviews.
Create or polish repo agent context: README.md, AGENTS.md/CLAUDE.md, installed project skills, and other Markdown context docs.
Use for current official documentation about Codex, Codex CLI, or Claude Code behavior, configuration, prompting, skills, permissions, tools, surfaces, capabilities, troubleshooting, hooks, app-server, or hook trust; fetch the relevant official URL before answering.
正在显示 SKILL.md
| compatibility | Requires Git, uv, and local command and edit access. |
| disable-model-invocation | true |
| name | naming-refactor |
| user-invocable | true |
| description | Refactor naming and repository structure exhaustively while preserving behavior and external contracts. |
If these instructions are already present in the conversation from a slash or dollar invocation, follow them directly; do not invoke this skill again through a skill tool.
Make every name in the current repository communicate one coherent domain model, regardless of refactor cost.
Resolve scripts/naming-ledger.py relative to this SKILL.md and create its ledger outside the repository:
uv run "<skill-dir>/scripts/naming-ledger.py" init --root <repo> --ledger <scratch.json>
The helper maps every tracked and non-ignored untracked path and records pre-existing worktree state. Account for a path only after inspecting its name, relevant contents, and role:
uv run "<skill-dir>/scripts/naming-ledger.py" mark \
--ledger <scratch.json> --status <pending|retained|renamed|excluded|blocked> \
--path <path> [--path <path>...] [--reason <text>]
Use retained when the current name is justified, renamed when the path or its contents joined a verified rename,
excluded for generated, vendored, binary, or bulk artifacts validated through their source or invariant, and blocked
when behavior or contract safety cannot be established. excluded and blocked require reasons.
uv run "<skill-dir>/scripts/naming-ledger.py" pending --ledger <scratch.json> [--limit <n>]
uv run "<skill-dir>/scripts/naming-ledger.py" refresh --ledger <scratch.json>
uv run "<skill-dir>/scripts/naming-ledger.py" summary --ledger <scratch.json>
Refresh after path moves and before final validation. New paths become pending; removed paths remain in the ledger and must be accounted as renamed, excluded, or blocked. The run is complete only when the helper reports no pending or blocked paths.
Completion of this phase requires a recorded baseline, explicit contract boundaries, and a ledger covering the entire repository.
Inspect every ledger path and build an evidence-backed map before changing each coherent domain slice. Cover directories, files, packages, modules, namespaces, exports, types, classes, functions, methods, parameters, variables, booleans, constants, tests, fixtures, documentation, configuration, scripts, and CI.
Apply these rules together:
data, info, item, manager, process,
handle, and utils when a specific name is supported by evidence.For every rename group, record the old and new concept, rationale, contract classification, affected consumers, collision risks, dynamic string references, migration order, and proving checks. Resolve ambiguity through symbol and reference inspection before choosing a name. Never use blind global replacement for an overloaded term.
Completion of this phase requires every non-excluded path to be retained with a reasoned naming model, assigned to a validated rename group, or marked blocked with concrete evidence.
After completing the codebase analysis and rename map, present the evidence-backed refactor plan, including its rename
groups, dependency waves, contract boundaries, risks, and proving checks. Before editing, use the repository's
coordination mechanism to acquire a claim covering the complete worktree. For ai-coord, run
ai-coord start 'naming refactor' '.' and proceed only after it returns READY; BLOCKED, UNKNOWN, and pathless
INTENT results do not authorize edits and cannot be overridden by user confirmation. Hold the claim through final
verification.
After acquiring the claim, re-read the current commit and worktree status, refresh the ledger, and compare the repository with the recorded baseline. Reinspect every path whose content or presence changed during analysis, then update the rename map, contract boundaries, and proving checks before implementing. The ledger refresh detects path changes, not content changes to existing paths.
If the repository has no reliable coordination mechanism, ask the user to confirm that no other coding agent will write to the repository through implementation and verification. Stop until the user explicitly confirms that fallback window; do not infer it from a stable worktree, absent processes, or the initial invocation.
With the implementation scope active, apply rename groups in coherent dependency waves. Keep every delegated write within the same coordination ownership. If scope ownership is lost or an uncovered writer appears, stop before continuing.
Continue until every planned rename is applied or blocked; refactor cost, diff size, and elapsed time are not stopping criteria.
Refresh the ledger, inspect every new path, and repeat the semantic naming pass until it finds no material naming issue. Search for stale old names and paths, including case variants and non-code literals. Run aggregate repository checks and compare them with baseline; no new unexplained failure is acceptable. Verify stable external contracts through available API snapshots, schemas, CLI help, import surfaces, or focused smoke tests.
Lead success with ### ✅ Naming refactor complete — <rename groups> groups · <accounted>/<mapped> paths accounted.
Report exact file and directory moves, every public or exported rename, compact local-identifier group counts,
baseline-versus-final checks, intentional retained external names, incidental bug fixes, and residual risks. Keep
commands, paths, names, diagnostics, and contract identifiers exact and undecorated.
If the ledger is incomplete, behavior parity is unproven, or an external contract would require unapproved breakage,
lead with ### ⛔ Naming refactor incomplete and report the blocking evidence and required decision. Do not describe
the run as complete while any path remains pending or blocked.