SuperAPI AI Directory

improve-codebase

Coding & development

View repository

Updated 10-16 09:45

About this skill

Improve Codebase

A one-time read-only audit of the codebase, outputting a concise list of items that can be directly deleted, replaced, or returned to a clear owner. It generates no files, modifies no code, and does not enter decision-making or implementation processes.

Scope

Use the loaded CONTEXT terminology and RULE; if not yet loaded, follow the project knowledge protocol; if knowledge is unavailable, continue and explain.

  • When the user specifies a module, directory, or pain point, scan that scope completely.
  • When the user does not specify, scan the entire repository's production code, dependency manifests, and registration entry points.
  • Exclude generated code, vendored code, build artifacts, and explicit test fixtures, and list the exclusions in the results.

Search

Understand entry points, consumers, and real call paths, and look for:

  • Code with no consumers, dead branches, deprecated flags, configuration that no one sets, and speculative capabilities;
  • Single-implementation interfaces, single-product factories, forward-only wrappers, single-export files, and future extension points;
  • Duplicate helpers, types, state, or a second implementation of a project's existing idiom;
  • Hand-written standard library capabilities, or code and dependencies that duplicate browser, database, runtime, and framework native capabilities;
  • New dependencies that only accomplish a small amount of naive code, or installed dependencies that already provide the same capability;
  • Implementations whose identical behavior can be expressed directly with fewer files and concepts;
  • Non-removable shared business rules scattered across multiple callers and lacking a clear owner.

For each finding, stop at the first applicable handling method:

  1. delete: Delete without replacement;
  2. reuse: Switch to the codebase's existing owner;
  3. stdlib: Switch to a specific standard library capability;
  4. native: Switch to a specific platform-native mechanism;
  5. dependency: Reuse an installed dependency without adding new dependencies;
  6. shrink: Preserve identical behavior with fewer files and concepts;
  7. owner: When none of the first six can resolve it, return the shared rule to its existing owner; only when there is no suitable owner, suggest the smallest new owner.

Keep only the highest feasible handling method for a finding.owner Candidate reads codebase-design and passes its ownership threshold; if it does not pass, do not report it.

Evidence Boundaries

Report only findings that can be proven from the current code: real consumers, dynamic registration, external contracts, and observable behavior after deletion must be confirmed. When consumers or compatibility are unclear, do not guess and do not downgrade to a low-confidence suggestion.

Do not suggest deleting behavior explicitly required by the user, project RULEs, trust boundary validation, security, accessibility, or necessary behavior that prevents data loss. Do not mix correctness defects, business rule deviations, and performance issues into this audit.

Ranking and Output

Rank by actual reduction in maintenance responsibility; when benefits are equal, rank by delete → reuse → stdlib → native → dependency → shrink → owner . Do not estimate LOC and do not output opinions just to fill a quota.

审计范围:<目录、生产入口和依赖清单>
排除:<生成、vendored、构建产物和 fixture>

1. delete: <删除什么>;<成立证据>。[`path:line`]
2. reuse: <哪套重复实现>;改用 <现有所有者>。[`path:line`]
3. native: <自建能力或依赖>;改用 <平台机制>。[`path:line`]
4. owner: <散落的共同规则>;收回 <现有或最小所有者>。[`path:line`]

汇总:delete <N>,reuse <N>,stdlib <N>,native <N>,dependency <N>,shrink <N>,owner <N>。

When there are no trustworthy findings, output only "No provable over-engineering or removable complexity was found in the current scope." Stop after outputting; when the user asks for implementation, enter separately impl。