refine-code
Simplify a named or current-task diff, or delete evidenced dead code when explicitly commissioned, while preserving supported contracts.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- refine-code
- description
- Simplify a named or current-task diff, or delete evidenced dead code when explicitly commissioned, while preserving supported contracts.
02 资源文件 1
- 参考文档agents/openai.yaml42 B
03 SKILL.md 正文
Refine Code
Simplify the user-named or current-task diff while preserving observable behavior and public contracts. Follow the contract in the outer task's worktree; confirm branch and task before editing. Prefer clear names, control flow and established local patterns without unrelated cleanup or compatibility layers.
Treat concurrency, exception timing, transactions, ordering, query predicates, persistence, isolation, serialization, public imports, API shape and assertions as semantic until equivalence is demonstrated. Route new behavior, abstraction boundaries or weakened tests to implement.
Deletion of code outside the current task diff requires explicit requester commissioning; an audit finding (code health) is a lead, not a commission. Choose a clean rollback commit before a deletion batch; if any check fails, restore the whole batch to it before debugging.
For deletion, establish that supported consumers, including dynamic entry points, registries, reflection, plugins, configuration, generated consumers and public exports, do not reach the code. Inspect base and current tree; local edits cannot prove base unreachability. Lint and coverage alone do not prove deadness, nor does one dead symbol prove its module dead. Preserve uncertain candidates and explain why. Keep removal recoverable in Git and validate affected runtime, build, packaging, deployment and documentation boundaries.
Explain the clarity gain and any apparently behavioral edit. Run focused success and relevant failure/cancellation tests and contract checks; record evidence and limits in task Notes.
After this step, resume the commissioned outcome within the authorized finish, or hand over its remaining acceptance; after two unsuccessful repairs, reconsider the route.
04 同仓库更多 Skills
typesafe-ai
Design or implement TypeSafe judgments for routing, ranking, extraction, and verification when application behavior needs semantic understanding; use as a supporting method within the current planning or delivery task.
write-tests
Add or improve behavior-focused coverage when testing is the task; use diagnose for observed failures.
write-design-doc
Create or refine a durable design contract: exploration, ADR, initiative, blueprint or guide.
work-issue
Deliver one live GitHub issue through verified merge and closure or an explicit partial-delivery boundary; use only for work anchored to an issue.
security-review
Add security review to diffs changing auth, sessions, permissions, secrets, endpoints, external calls, config, file or shell primitives, serialization, or dependencies.
review
Assess a non-diff artifact, system, architecture, workflow, agent configuration, or idea without changing it.