Maintaining Consistent Abstractions

Class interfaces present one cohesive abstraction - don't mix domain logic with serialization, persistence, or unrelated concerns

43 stars 26 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add obra/clank --skill Maintaining Consistent Abstractions
Manual install
git clone --depth 1 https://github.com/obra/clank.git /tmp/clank
mkdir -p ~/.claude/skills
cp -r /tmp/clank/skills/architecture/maintaining-consistent-abstractions ~/.claude/skills/Maintaining-Consistent-Abstractions

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Maintaining Consistent Abstractions

## Overview

A class interface should present ONE cohesive abstraction. All methods should work toward a consistent purpose at a consistent level.

**Core principle:** Each class implements one Abstract Data Type (ADT). If you can't identify what ADT the class implements, it has poor abstraction.

**Goal:** Anyone using the class should see a clear, consistent set of related operations, not a miscellaneous grab-bag.

## When to Use

**Apply when designing any class:**
- New class design
- Reviewing existing classes
- Refactoring
- API design

**Warning signs of poor abstraction:**
- Class groups unrelated functions
- Methods at different abstraction levels (high-level + low-level mixed)
- Domain object with serialization methods (to_json, to_xml)
- Business logic mixed with persistence (SQL in domain class)
- Temporal cohesion (things done at same time, not related by purpose)
- Can't clearly state what abstraction the class represents
- Class description has "and" connecting unrelated purposes

## Abstraction Anti-Patterns from Baseline Testing

### Anti-Pattern 1: Domain + Serialization Mixed

**Baseline violation:**
Read the full skill on GitHub

Details

Skill name
Maintaining Consistent Abstractions
Repository
obra/clank
Path
skills/architecture/maintaining-consistent-abstractions/SKILL.md
Repo updated
9 October 2025

FAQ

What does the Maintaining Consistent Abstractions skill do?

Class interfaces present one cohesive abstraction - don't mix domain logic with serialization, persistence, or unrelated concerns

How do I install the Maintaining Consistent Abstractions skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add obra/clank --skill Maintaining Consistent Abstractions. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Maintaining Consistent Abstractions popular?

It lives in obra/clank, which has 43 GitHub stars and 26 forks.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.