Clean architecture layers
Skill swd3k/skills/agent-skills/programming/clean-architecture-layers
Structure app code into Core, Infrastructure, UI/API layers with clear dependency direction. Use when scaffolding solutions, refactoring god-projects, or deciding where business logic lives.From its SKILL.md
npx -y skills add swd3k/skills --skill clean-architecture-layersAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.4 KB, 266 tokens by cl100k_base, as published. Nobody here has run it
Clean Architecture Layers
Dependencies point inward. UI and frameworks depend on Core — never reverse.
Default layout (.NET / general)
src/
App.Core/ # domain, use cases, ports (interfaces)
App.Infrastructure/ # files, HTTP, DB, OS integrations
App.Ui/ or App.Api/ # Photino, ASP.NET, CLI
tests/
App.Core.Tests/
App.Infrastructure.Tests/
Rules
- Core has no UI, EF, Photino, or HTTP client package refs.
- Infrastructure implements Core interfaces.
- Composition root (Program.cs) wires implementations.
- Feature changes: Core first if business rules change.
Workflow
- Name the use cases (ApplyHosts, CheckUpdate…).
- Define ports as interfaces in Core.
- Implement adapters in Infrastructure.
- UI only calls use cases / services via interfaces.
- Unit-test Core without OS; integration-test Infrastructure.
Pitfalls
- Business rules inside button click handlers
- Circular project references "just this once"
- Huge Shared project that becomes a dump
Acceptance
- Core tests run on Linux CI without Windows packages
- New storage backend = new Infrastructure class, Core untouched
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.