code-architecture-wrong-abstraction

Analyze code modules to apply the Rule of Three before abstracting.

Updated Apr 29, 2026
One-click install
npx skills add https://github.com/dev-khoi/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/conHack-2026/tree/main/.opencode/skills/code-architecture-wrong-abstraction
Command: npx skills add https://github.com/dev-khoi/conHack-2026 --skill code-architecture-wrong-abstraction-dev-khoi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Premature abstraction can create confusion and maintenance pain; this guideline champions waiting until patterns stabilize and duplication is cheaper to fix.

Core Features & Use Cases

  • Enforces the Rule of Three: don't abstract until code appears in 3+ places.
  • Guides when to abstract vs duplicate, with clear criteria and anti-patterns.
  • Provides strategies for identifying and fixing wrong abstractions and recognizing when a facade is appropriate.

Quick Start

Analyze a code module, apply the Rule of Three, and decide on abstraction only after patterns are proven.

Frequently Asked Questions about code-architecture-wrong-abstraction

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

FAQPage Schema
How do I prevent premature abstraction when refactoring code?

Prevent premature abstraction by enforcing the Rule of Three: duplicate code first and only refactor to abstract it once the pattern appears in three or more distinct places. This avoids wrong abstractions and reduces maintenance pain.

When should I duplicate code instead of applying the DRY principle?

You should duplicate code instead of applying DRY when patterns have not yet stabilized. Duplication is cheaper to fix than a wrong abstraction, so waiting until clear criteria are met prevents over-engineering and design inefficiencies.

What is the Rule of Three in software design?

The Rule of Three is a refactoring principle stating you should not abstract code until it has been duplicated in at least three places. This ensures patterns are proven before introducing generalized abstractions.

How do I fix a wrong abstraction in my codebase?

Fix a wrong abstraction by identifying shared interfaces that create confusion, then refactoring them based on proven patterns. Apply strategies like introducing a facade or reverting to duplication until the actual design patterns stabilize.

When should I not use design patterns in my code architecture?

You should not use design patterns when code only appears in one or two places. Applying patterns prematurely creates over-engineering and maintenance pain; wait until clear criteria and stable patterns emerge naturally.

Can I use a facade to resolve design inefficiencies from over-engineering?

Yes, a facade is appropriate to resolve design inefficiencies when you need to simplify complex wrong abstractions. It provides a cleaner interface while you evaluate whether underlying patterns are stable enough for deeper refactoring.