From workflow
Architectural principles (Ports & Adapters, Single Source of Truth, Generated Contracts). Auto-loads when designing new modules, defining interfaces between layers, discussing system architecture, drawing system boundaries, reviewing architectural decisions, or any time the design or implement skill is active.
How this skill is triggered — by the user, by Claude, or both
Slash command
/workflow:design-principlesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
These principles govern architectural decisions. Apply them when designing modules, interfaces, and system boundaries.
These principles govern architectural decisions. Apply them when designing modules, interfaces, and system boundaries.
Core domain logic must not depend on infrastructure. Infrastructure depends on the domain.
Ports are interfaces defined in the domain layer that describe what the domain needs (a database, a file store, an HTTP client, a clock). Adapters are infrastructure implementations of those interfaces.
How to apply during design:
Example structure:
src/
domain/
user.ts # core logic — imports only domain types and ports
ports.ts # UserRepository interface, EmailSender interface
infrastructure/
db/user-repo.ts # implements UserRepository using Drizzle
email/smtp.ts # implements EmailSender using nodemailer
app/
wire.ts # assembles: new UserService(new DbUserRepo(), new SmtpEmailSender())
Design checklist:
import { db } or import { fs } in domain modulesWhen a concept can have multiple variants that may grow over time (roles, statuses, event types, providers, feature flags), define that set of variants once as a data structure. All logic — types, validation, routing, display — derives from that single definition.
How to apply during design:
Example structure:
// Defined once
const ROLES = ['admin', 'editor', 'viewer'] as const
type Role = typeof ROLES[number]
// Or richer: a config map where behavior flows from data
const ROLE_CONFIG = {
admin: { level: 2, label: 'Admin' },
editor: { level: 1, label: 'Editor' },
viewer: { level: 0, label: 'Viewer' },
} satisfies Record<string, RoleConfig>
type Role = keyof typeof ROLE_CONFIG
Design checklist:
When designing a boundary between two systems (client/server, package/consumer, service/service), prefer generating the contract from the source of truth rather than hand-authoring both sides.
Common approaches by boundary type:
How to apply during design:
Design checklist:
npx claudepluginhub nklisch/skills --plugin workflowGuides structured conversations to define repository architecture principles in clean (default), hexagonal/ports & adapters, modular monolith, or custom styles. Produces formal architecture.md document for project standards.
Guides domain-driven design and hexagonal architecture with functional core pattern. Use when designing features, modeling domains, breaking down tasks, or evaluating component responsibilities.
Implements Clean Architecture, DDD, and Hexagonal Architecture patterns in NestJS/TypeScript apps for complex backend structuring, domain layers with entities/aggregates, ports/adapters, use cases, and refactoring anemic models.