design-cleanup
gjkim42/kanon-repo
Remove design-change leftovers and rewrite code as if the new design was always there.
What is design-cleanup?
Cleans up abandoned design patterns after mid-work decision changes. Use when a design pivot happens and you need to eliminate fossils of the old approach—dead code, shims, old names, and comments—so the final tree reads as if it was designed this way from the start.
- Identifies and removes dead code, branches, and feature flags tied to the abandoned design
- Eliminates shims, adapters, and indirection layers that only bridged old and new approaches
- Renames identifiers, files, and modules to reflect the current design concept throughout
- Rewrites comments, docstrings, and documentation to describe only the current state
- Removes or rewrites tests that pinned abandoned behavior or transitional states
- Verifies the cleanup preserves behavior of the surviving design
How to install design-cleanup
npx skills add https://github.com/gjkim42/kanon-repo --skill design-cleanup- Git repository with a feature branch to clean up
- Access to the project's build and test suite
How to use design-cleanup
- 1.State the design decision as one line: current design vs. abandoned approach
- 2.Compute the branch diff to identify files touched by the decision
- 3.Grep in-scope files for dead code, shims, old names, comments, tests, and docs tied to the abandoned design
- 4.Rename identifiers and rewrite comments to reflect only the current design; delete dead code outright
- 5.Run the project's build and tests to verify behavior is preserved
- 6.Grep the result for history words (previously, instead of, legacy, V2) and confirm no dangling references to old names remain
Use cases
- After pivoting from one architectural approach to another mid-branch, clean up all traces of the old design
- Rename a core concept throughout the codebase after realizing a better name or structure
- Remove temporary adapters and shims that were only needed to transition between two implementations
- Update documentation and tests to reflect a design decision change without keeping migration notes
- Eliminate feature flags and configuration keys that only served the abandoned approach
- Developers managing mid-work design pivots and refactors
- Teams standardizing code after significant architectural decisions change
- Code reviewers ensuring branches don't carry fossils of abandoned designs
design-cleanup FAQ
Only code touched by the decision: files that implement the new design plus files that reference the old names. Everything else is out of bounds. Grep for the old concept names to find all references.
Delete it outright. Git history preserves the old version. Commented-out code is a fossil that confuses readers.
Reconstruct it from the branch diff and commit messages, then confirm the one-line summary with the user before making sweeping edits. Cleanup against a misread decision destroys correct code.
No. Rewrite all comments and docs to describe only the current state. Migration notes are part of the journey; the final tree must not narrate it.
Run the project's build and tests to confirm behavior is preserved. Grep the result for history words (previously, instead of, legacy, V2) as a smoke check. Grep the whole tree for abandoned names to confirm no dangling references remain.
Full instructions (SKILL.md)
Source of truth, from gjkim42/kanon-repo.
name: design-cleanup description: >- Sweep the current branch for leftovers of an abandoned design after a significant mid-work decision change, and rewrite the affected code, comments, tests, and docs so the result reads as if it had been designed this way from the beginning. Use when the user says "design cleanup", "clean up the old approach", "erase the journey", says a design decision changed and asks to clean up after it, or after a pivot in approach mid-branch. This is a rewrite pass over the code touched by the decision only — not a general refactoring or bug-hunting pass.
Design cleanup — make the tree read as designed-this-way
Why this skill exists
When a design decision changes mid-work — a different approach, a renamed concept, a replaced mechanism — the branch tends to keep fossils of the abandoned design: dead branches, shims that only served the old path, names shaped by the old concept, comments narrating the change, tests pinning behavior that no longer matters. The diff may show the journey; the final tree must not. This skill hunts those fossils down and rewrites the result as if the current design had been there from the beginning.
Step 1 — Establish the decision
State the decision as one line: "the design is X; the abandoned approach was Y". Take it from the user or the session context. If it is not stated, reconstruct it from the branch diff and commit messages, then confirm the one-line summary with the user before making sweeping edits — cleanup against a misread decision destroys correct code.
Step 2 — Determine scope
- Compute the branch diff:
git diff $(git merge-base HEAD origin/main)...HEAD(fall back toorigin/develop, thendevelop). - The cleanup covers only code touched by the decision: the changed files that implement it, plus files that reference the renamed or removed concepts (find them by grepping for the old names).
- Everything else is out of bounds. This skill is not a license for unrelated refactors, formatting passes, or opportunistic improvements.
Step 3 — Hunt the leftovers
Check each category against the in-scope files:
- Dead code: branches, parameters, feature flags, config keys, and helpers that only the abandoned path used.
- Shims and indirection: adapters, wrappers, and abstraction layers that existed only to bridge the old design to the new one.
- Names and structure: identifiers, files, and modules shaped by the
old concept —
newParser,handleV2,legacyFoo, or a module layout organized around a concept that no longer exists. - Comments and docstrings: anything describing the old design or narrating the change — "previously", "instead of", "now we", "changed from X to Y". Descriptions must state only the current design.
- Tests: tests that pin the abandoned behavior, transitional states, or the shape of the old API. Rewrite them for the intended behavior of the current design; do not keep them green by accident.
- Docs: README sections, ADRs, diagrams, and examples that describe the old mechanism. Update in place — no "migration note" additions.
- TODOs: items left for the old plan.
Step 4 — Rewrite, don't patch
- Rename to the current concept everywhere, not just where it is cheap.
- Delete dead code outright; never comment it out or gate it "just in case". Git history holds the old version.
- Collapse indirection that no longer earns its keep.
- Rewrite affected comments, docstrings, and docs to describe only the current state.
Step 5 — Verify and report
- Run the project's build and tests; the cleanup must not change behavior of the surviving design.
- Grep the resulting branch diff for history words as a smoke check:
previously|instead of|no longer|old |new |V2|legacy— hits are candidates to fix, not automatic violations; judge each. - Grep the whole tree for the abandoned names to confirm no dangling references remain.
- Report what was removed, renamed, and rewritten, grouped by the categories above, and call out anything suspicious that was left alone because it fell outside the decision's scope.
Related skills
More from gjkim42/kanon-repo and the wider catalog.

gjkim-instruction
Create and maintain gjkim_instruction.md, a root document for loop-engineering efforts.

pre-session-end
Capture session learnings and propagate project settings before ending work.

review-all
Run parallel code reviews from two independent agents for high-confidence findings.

api-review
Review Kubernetes API and CRD design quality for Kelos changes and proposals.

gluestack-ui-v4:components
Component usage patterns for gluestack-ui v4 - covers component selection, props vs className, compound patterns, icons, and provider setup.

gmgn-contract-dd
Single 0-100 contract safety score combining security, holder structure, and price action for one token address.