Skip to content
Back to skills

Refactoring

ASecurity

Deletion-focused unification principles for consolidating duplicated code paths into one shared implementation — what to optimize for, how to slice delivery, and the countable acceptance ledger. Use when planning, designing, executing, or reviewing a consolidation/unification refactor, when decomposing one into slices or PRs, and when writing subagent prompts for any refactoring task (carry the Principles section verbatim into those prompts).

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 12, 2026
code-qualitygorefactoring

Security analysis

A100/100

Scanned November 12, 2026

npx -y skills add ZenUml/conf-app --skill refactoring --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Refactoring?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Refactoring
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/zenuml-refactoring/badge)](https://www.skillsdirectory.com/skills/zenuml-refactoring)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: refactoring
description: Deletion-focused unification principles for consolidating duplicated code paths into one shared implementation — what to optimize for, how to slice delivery, and the countable acceptance ledger. Use when planning, designing, executing, or reviewing a consolidation/unification refactor, when decomposing one into slices or PRs, and when writing subagent prompts for any refactoring task (carry the Principles section verbatim into those prompts).
---

# Deletion-Focused Unification Refactoring

Not general refactoring advice. These are the standing rules for
consolidation/unification work in this repo, distilled from the
content-opening unification design (2026-07-31) and the rejection of PR #423.

## Principles

Carry this section **verbatim** into every subagent prompt for refactoring
work:

- Consistency and structural simplicity are the primary goals.
- When current code paths behave differently, choose one reasonable rule
  instead of preserving every historical variation with hooks and adapters.
- Small user-visible changes are acceptable if they result naturally from that
  simplification.
- Do not add states, fallbacks, telemetry, recovery UI, or other code merely
  to make behavior "better".
- Preserve only hard requirements such as data integrity,
  authorization/paywall enforcement, and essential content compatibility.
- Success means fewer concepts, fewer branches, and preferably less production
  code — not perfect behavioral equivalence.

## Delivery rules

- **Vertical slices only.** Every PR migrates a real production path AND
  deletes that path's old implementation in the same PR. No framework-only or
  foundation-first PRs. Encoding differences through lifecycle/adapter/hook
  infrastructure instead of eliminating them is the failure mode (PR #423:
  net +852 production LOC, closed for exactly this).
- **Evolve the existing shared module** into the unified one; do not found a
  new abstraction beside it. If a partial consolidation already exists, it is
  the successor's seed, not a competitor to delete around.
- **Differences may live in exactly three places:** a small policy enum
  (e.g. read vs write), a per-family declarative spec, or the presenter.
  A family/type branch inside the shared code means the design failed —
  fix the design, don't add an `if`.
- **Replace shared-mutable-state coupling with a typed hand-off value**
  (e.g. a load→save `origin` contract). If two "independent" slices
  communicate through module state, they are one slice.
- **Verify before designing.** Every factual claim about the current code gets
  file:line evidence against current `main` — not a stale branch checkout.
  Check for concurrent worktrees and already-adopted design docs touching the
  same files before committing to a direction.

## Acceptance: the countable ledger

Net production LOC may be modestly positive only when a before/after ledger of
countable structure shrinks — number of implementations of the concept,
number of variants of the same decision, copies of each rule, whole files
deleted. If no ledger row shrinks, the refactor didn't happen; LOC alone is
neither proof nor disproof.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in code-quality →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.