law-of-demeter-swift
Installation
SKILL.md
Law of Demeter for Swift (Strict Review Mode)
Purpose
Enforce Law of Demeter (LoD) in Swift code with a strict-by-default review posture:
- Flag deep structural access (
a.b.c,a?.b?.c) - Flag chained domain lookups across model/service boundaries
- Flag async/actor traversal chains after
await - Prefer owner-level, intent-focused APIs
- Preserve Swift API naming style (no Java-style
getX()suggestions)
Core rule: Ask for what you need. Do not traverse internal structure to reach strangers.
Strict Review Mode (Default Behavior)
In this strict version, assume a likely LoD violation when all of the following are true: