Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Applies Clean Architecture's dependency-direction and SRP-by-actor rules to system-level boundary design: separates business logic from infrastructure, identifies actor-coupling risks, and enforces inward-pointing dependency arrows. For system scope (multiple components, layers, or services), not routine or module scope (use cc-routine-and-class-design).
.claude/skills/ryanthedev-ca-architecture-boundaries/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-12 | ✗→✓ | ▲ Improved | -31% | 0% |
| case-15 | ✓→✗ | ▼ Worse | 23% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 11% | 0% |
| case-03 | ✓→✓ | = Same ✓ | -7% | 0% |
Operates at SYSTEM level (layers, boundaries, components). For MODULE level (interface depth, information hiding), use aposd-designing-deep-modules.
"A module should be responsible to one, and only one, actor."
An actor is a group of users/stakeholders who request changes. If two actors share a class, a change for one can break the other.
java// BEFORE: One class serves three actors class Employee { Money calculatePay() { } // CFO's accounting team String reportHours() { } // COO's HR team void save() { } // CTO's DBA team } // AFTER: Separate class per actor class EmployeeData { /* just data */ } class PayCalculator { Money calculatePay(EmployeeData e) { /* CFO */ } } class HourReporter { String reportHours(EmployeeData e) { /* COO */ } } class EmployeeSaver { void saveEmployee(EmployeeData e) { /* CTO */ } } // Optional: Facade for convenience class EmployeeFacade { // Delegates to actor-specific classes }
Test: For each class, ask "who requests changes to this?" If the answer is more than one actor, split.
Duplication across actor boundaries is safer than coupling.
If CFO's calculatePay and COO's reportHours both use the same regularHours helper, they appear duplicated — but they change for different reasons. Merging them couples two actors. When CFO's accounting rules change, COO's reports break.
Rule: DRY applies within a single actor's code. Across actors, prefer duplication over coupling.
Dependencies point inward: Frameworks → Adapters → Use Cases → Entities.
Nothing in an inner circle can know anything about an outer circle. Business rules never import database, UI, or framework code. If business logic needs to call infrastructure, define an interface in the business layer and implement it in the infrastructure layer (dependency inversion).
Pattern: interface defined in the business layer (where it's used), implemented in the infrastructure layer (dependency inversion).
java// Business layer — interface lives here, no infrastructure imports public interface OrderRepository { Order findById(String id); void save(Order order); } // Infrastructure layer — concrete class implements the business interface public class SqlOrderRepository implements OrderRepository { /* SQL */ }
The Use Case depends on OrderRepository (abstraction). The infrastructure layer depends on OrderRepository too — arrows point inward.
When applying to an existing system:
Adapt paths to your project's directory structure.
bash# Framework coupling in business logic grep -r "import.*servlet\|import.*spring.*web\|import.*express" src/domain/ grep -r "import.*sql\|import.*mongoose\|import.*prisma" src/entities/ # ORM annotations in domain grep -r "@Entity\|@Table\|@Column" src/domain/ # Type checking instead of polymorphism (scope to domain dirs, not all of src/) grep -r "instanceof\|getType()\|typeof.*===" src/domain/ src/entities/
| After | Next | |-------|------| | Boundaries drawn | aposd-designing-deep-modules (module-level design) | | SOLID violations found | cc-refactoring-guidance (safe restructuring) |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-15 | pass→fail | 15,703 | 12,979 | -17% | 1 | 1 | 0% | 2,435 | 2,987 | +23% | 0 | 0 | — |
case-01 | fail→pass | 20,689 | 11,239 | -46% | 1 | 1 | 0% | 3,206 | 3,033 | -5% | 0 | 0 | — |
case-02 | pass→pass | 12,627 | 8,460 | -33% | 1 | 1 | 0% | 2,004 | 2,234 | +11% | 0 | 0 | — |
case-03 | pass→pass | 12,821 | 5,900 | -54% | 1 | 1 | 0% | 2,015 | 1,878 | -7% | 0 | 0 | — |
case-04 | pass→pass | 14,057 | 5,948 | -58% | 1 | 1 | 0% | 2,357 | 1,836 | -22% | 0 | 0 | — |
case-05 | pass→pass | 9,348 | 8,267 | -12% | 1 | 1 | 0% | 1,584 | 2,288 | +44% | 0 | 0 | — |
case-06 | pass→pass | 13,142 | 9,075 | -31% | 1 | 1 | 0% | 2,300 | 2,470 | +7% | 0 | 0 | — |
case-07 | pass→pass | 9,139 | 4,083 | -55% | 1 | 1 | 0% | 1,598 | 1,506 | -6% | 0 | 0 | — |
case-08 | pass→pass | 11,524 | 6,671 | -42% | 1 | 1 | 0% | 1,964 | 2,054 | +5% | 0 | 0 | — |
case-09 | pass→pass | 17,970 | 14,180 | -21% | 1 | 1 | 0% | 2,709 | 3,185 | +18% | 0 | 0 | — |
case-10 | pass→pass | 9,065 | 4,960 | -45% | 1 | 1 | 0% | 1,525 | 1,759 | +15% | 0 | 0 | — |
case-11 | pass→pass | 13,820 | 9,029 | -35% | 1 | 1 | 0% | 2,290 | 2,426 | +6% | 0 | 0 | — |
case-12 | fail→pass | 14,033 | 3,126 | -78% | 1 | 1 | 0% | 2,075 | 1,430 | -31% | 0 | 0 | — |
case-13 | pass→pass | 11,714 | 6,697 | -43% | 1 | 1 | 0% | 1,884 | 1,995 | +6% | 0 | 0 | — |
case-14 | pass→pass | 20,678 | 17,313 | -16% | 1 | 1 | 0% | 2,982 | 4,150 | +39% | 0 | 0 | — |
case-16 | pass→pass | 12,343 | 8,689 | -30% | 1 | 1 | 0% | 2,070 | 2,479 | +20% | 0 | 0 | — |
case-17 | pass→pass | 12,844 | 7,564 | -41% | 1 | 1 | 0% | 1,906 | 2,116 | +11% | 0 | 0 | — |
case-18 | pass→pass | 8,458 | 2,786 | -67% | 1 | 1 | 0% | 1,425 | 1,352 | -5% | 0 | 0 | — |
case-19 | pass→pass | 14,063 | 13,233 | -6% | 1 | 1 | 0% | 2,124 | 2,991 | +41% | 0 | 0 | — |
case-20 | pass→pass | 14,935 | 10,010 | -33% | 1 | 1 | 0% | 2,268 | 2,429 | +7% | 0 | 0 | — |
case-21 | pass→pass | 11,057 | 2,996 | -73% | 1 | 1 | 0% | 1,661 | 1,383 | -17% | 0 | 0 | — |
case-22 | pass→pass | 20,611 | 10,494 | -49% | 1 | 1 | 0% | 2,280 | 2,344 | +3% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +5 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.