# Solid Liskov Substitution

> Subclasses must honor the contract of their parent class Use when designing system architecture. Architecture category skill.

- Skill: `majiayu000/solid-liskov-substitution` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add majiayu000/solid-liskov-substitution`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/solid-liskov-substitution/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/majiayu000/solid-liskov-substitution

---


# SOLID - Liskov Substitution

Subclasses must honor the contract of their parent class. Don't override methods to throw "not implemented" exceptions. If a subclass can't fulfill the parent's behavior, the inheritance hierarchy is wrong—consider composition instead. Preconditions can't be strengthened; postconditions can't be weakened. Violating LSP leads to fragile code with instanceof checks.
