| name | git-change-simplifier |
|---|---|
| description | Review local Git changes and simplify newly added code while preserving behavior. Use when asked to clean up a working tree diff before commit or PR by removing unnecessary type aliases, thin abstractions, one-time constants, unused exports, unused public service methods, duplicated helpers, and non-essential or outdated implementations. |
Simplify only code introduced or changed in the local diff. Preserve behavior, keep edits small, and favor deletion over abstraction.
- Inspect scope with
git status --shortandgit diff. - Focus review on added or modified lines and dependent call sites.
- Apply simplification rules in order.
- Run targeted checks (
pnpm test,pnpm lint,tsc, or project-specific tests) for touched areas. - Summarize what was removed, what was consolidated, and why behavior is unchanged.
-
Remove unnecessary type aliases. Replace aliases that only restate an obvious inline type or are used once.
-
Remove thin abstractions. Inline wrappers that only pass through arguments, rename values, or forward one call without meaningful policy.
-
Remove one-time constants. Inline constants used once when they do not improve readability or reuse.
-
Remove unused exports. Delete exports not referenced by the repository, then keep symbols non-exported where needed internally.
-
Remove unused public service methods. If a service method is not used externally, mark it private and rename it with a leading underscore (for example,
buildPayload->_buildPayload) when it is only used inside the class. -
Reuse existing utilities. Search before adding helpers; prefer existing utilities and shared primitives over new local duplicates.
-
Eliminate non-essential or outdated code. Remove fallback paths, legacy branches, speculative helpers, and "nice-to-have" logic that does not support current requirements.
- Preserve runtime behavior and public APIs unless the diff itself is introducing the API.
- Confirm a symbol is truly unused with repository-wide search before deleting it.
- Avoid unrelated refactors outside the local diff.
- Prefer simple expressions and direct data flow over indirection.
- Keep naming literal and descriptive after inlining or consolidation.
- Provide a concise change summary grouped by file.
- List each removed abstraction/alias/export/method.
- Report validation commands that were run and any remaining risk.