code-simplifier
Simplify user-selected code for clarity and lower maintenance burden while preserving intended behavior; not a mandatory post-edit cleanup.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-14
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- code-simplifier
- license
- Apache-2.0
- metadata
- { "hosts": [ "codex", "hermes-agent" ], "version": "1.2.1" }
- description
- Simplify user-selected code for clarity and lower maintenance burden while preserving intended behavior; not a mandatory post-edit cleanup.
02 资源文件 7
- 参考文档agents/openai.yaml252 B
- 许可证LICENSE11.1 KB
- 参考文档licenses/pstack-MIT.txt1.0 KB
- 参考文档licenses/SOURCE.txt240 B
- 其他NOTICE370 B
- 参考文档references/structural-simplification.md6.3 KB
- 参考文档references/validation.md5.5 KB
03 SKILL.md 正文
<!-- Modified for FAS 1.2.1, 2026-10-09: shared testing decisions; preserved structural simplification and conditional validation. -->
Code Simplifier
Scope and behavior
Use the user-selected component, files or change; default to recently modified code only when no wider scope is named. For change-based work, resolve the actual comparison base rather than assuming a branch name. Keep audit-only requests read-only. Read relevant implementation and consumers, including outside the edit scope, without treating inspection as permission to modify them. Preserve user work and repository conventions.
Preserve intended outputs, side effects, errors, compatibility and relevant ordering, lifetime and performance contracts. Explicitly requested removal or behavior changes follow the user's goal; otherwise do not retire supported behavior or mix unrelated bug fixes into simplification. Resolve only consequential missing authority or contract uncertainty; continue independent authorized work.
Choose a useful change
Reduce what a reader must trace: unnecessary indirection, scattered invariants, redundant branches, duplicated transformations and hidden mutable state. Prefer direct control flow, cohesive ownership and fewer representations. Before a nontrivial structural change, briefly establish the current burden, affected consumers, owner after removal, a counterexample that would invalidate it, and the smallest decisive check. Existing task context can supply this explanation; do not create a mandatory form, plan file or confidence score.
Check that the burden disappears rather than moving into callers, configuration, tests or runtime coordination. Do not replace an unnecessary abstraction with another wrapper, couple unrelated cases to remove similar text, or optimize for line count. Keep useful names, abstractions, non-obvious rationale, contracts and licensing. Do not infer dead code from zero search matches.
Load detail only when needed
Use structural simplification when a candidate changes shared ownership, state or representations, compatibility, registrations, generated consumers or lifecycle behavior; it also covers explicitly requested broad audits. Stay on the local path for straightforward edits.
Use validation when equivalence is uncertain, tests fail, or timing, failure paths or operational constraints need evidence. Load only the relevant reference, not both by default. Do not require a fixed model, delegation or a new tool before acting.
Apply Test Behavior before authoring or changing equivalence checks, comparison scripts or inline probes. Also apply it when the task removes or replaces a behavior contract or ends a migration or compatibility obligation, even if no test edit is planned. It owns check timing, valid expectations and retirement; useful simplification and preserved semantics remain the responsibility here.
Complete and stop
Make the smallest complete change within authorized scope. Migrate necessary consumers and remove genuinely retired machinery; a required compatibility layer is retained responsibility, not completed deletion. If completion would exceed scope, explain that boundary instead of leaving a broken half-migration.
Reuse valid evidence and run only checks that resolve actual uncertainty. Obvious semantic no-ops need no new test or model evaluation. Follow Test Behavior for directly affected protection; retain guarantees that still apply after a simplification or authorized behavior change.
Stop when the useful simplification is complete or remaining edits are style churn, unsupported deletion, or not worth their risk and verification cost. Do not enforce a findings quota or repeated cleanup rounds. Distinguish no worthwhile change from a blocked or incompletely investigated candidate. Report the removed burden or clarity gain, decisive evidence, and material limits; audit-only work reports proposals, not completed changes.
04 同仓库更多 Skills
test-behavior
Use when preparing to write or modify tests or code/scripts that check software behavior, including temporary scripts, inline checks, reproductions, debug probes, smoke/install/migration checks, benchmarks, fixtures and mocks. Apply before editing those checks to decide necessity, timing, meaningful expectations and temporary versus permanent placement. Also use to review directly affected tests when a task removes or replaces a behavior contract, completes a migration or ends compatibility obligations. Requirements and architecture decisions stay with the main workflow; design discussion and ordinary implementation alone do not call for this skill. Running existing checks alone does not require new tests.
software-quality-workflows
Apply explicitly requested engineering-quality guidance to implementation and maintenance work.
software-design
Resolve consequential requirements, ownership, API, data-model, or migration choices before implementation.
runtime-verification
Resolve evidence gaps that require actual running or installed behavior, beyond static inspection.
debugging
Diagnose failures, regressions, or performance problems whose cause is not yet established.
codebase-investigation
Explain implementation, cross-module behavior, or design history when that explanation is the task.