code-architecture-wrong-abstraction

Guides decisions on when to abstract code versus accept duplication during refactoring.

Updated Apr 29, 2026
One-click install
npx skills add https://github.com/dev-khoi/AURA-conHack-2026 --skill code-architecture-wrong-abstraction-dev-khoi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-architecture-wrong-abstraction
Source: https://github.com/dev-khoi/AURA-conHack-2026/tree/main/.opencode/skills/code-architecture-wrong-abstraction
Command: npx skills add https://github.com/dev-khoi/AURA-conHack-2026 --skill code-architecture-wrong-abstraction-dev-khoi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often create premature or wrong abstractions that couple unrelated code, hide bugs behind indirection, and become painful to unwind. This Skill provides clear decision rules for when to extract shared utilities and when to keep duplicated code. ## Core Features & Use Cases - Rule of Three: Only abstract after the same code appears in at least three places, ensuring patterns have stabilized. - Wrong Abstraction Recovery: Step-by-step guidance to inline bad abstractions, delete unneeded branches, and re-extract cleanly. - Facade Evaluation: Criteria for when wrapper components (like a Typography component) add value versus when native HTML is clearer. - Use Case: When refactoring a React codebase and deciding whether to extract a shared utility or component, apply the Rule of Three and the junior developer test to avoid building a leaky abstraction. ## Quick Start Ask the assistant to review whether a piece of duplicated code should be abstracted into a shared utility or left as-is.

Frequently Asked Questions about code-architecture-wrong-abstraction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
When should I abstract duplicated code into a shared function?▼

Abstract only after the same code appears in at least three places and the pattern has stabilized. Two occurrences should stay duplicated, since early abstraction often locks in a wrong design before requirements are clear.

How do I fix a wrong abstraction in my codebase?▼

Inline the abstraction back into each caller, delete the portions each caller does not need, and accept temporary duplication. Re-extract a proper abstraction later only when genuine shared patterns emerge.

What is the difference between DRY, WET, and AHA programming?▼

DRY means don't repeat yourself and applies after patterns stabilize. WET means write everything twice and is the default starting point. AHA means avoid hasty abstractions and serves as the guiding principle between them.

When should I use a facade component instead of native HTML?▼

Use a facade when hiding complex logic like date pickers or enforcing design system constraints like button variants. Skip it for simple HTML elements like small or mark tags, where the facade just adds props for every edge case.

Why do wrong abstractions become hard to maintain?▼

Each new requirement adds conditional parameters to the shared function, creating spaghetti logic that couples unrelated callers. The abstraction obscures bugs behind indirection and organizational inertia makes teams reluctant to refactor it.