# Decide Abstraction Timing

> When to abstract vs copy-paste. The rule of three.

- Skill: `attac-t/decide-abstraction-timing` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add attac-t/decide-abstraction-timing`
- Raw SKILL.md: https://api.skillmd.com/api/skills/attac-t/decide-abstraction-timing/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: attac-t (https://skillmd.com/u/attac-t)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/attac-t/decide-abstraction-timing

---


# Skill: Abstraction Timing

> "Duplication is far cheaper than the wrong abstraction."

## The Decision

**Copy-Paste when:**
- First occurrence (always)
- Second occurrence (usually)
- Contexts differ slightly

**Abstract when:**
- Third occurrence with same pattern
- Change in one requires change in all
- Test coverage becomes repetitive

## The Heuristic

Ask: *"If I change one, must I change all?"*

## The Quick Test

| Ask | Answer | Use |
|-----|--------|-----|
| First time seeing this pattern? | Yes | Copy-paste |
| Second time, same context? | Yes | Copy-paste (note it) |
| Third time, identical pattern? | Yes | Abstract |
| Slight variations each time? | Yes | Keep separate |

## Real-World Examples

See [examples.md](examples.md).

