agentsclimarketplace

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

Install
npx -y skills add swd3k/skills --skill clean-architecture-layers

Assembled 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

  1. Core has no UI, EF, Photino, or HTTP client package refs.
  2. Infrastructure implements Core interfaces.
  3. Composition root (Program.cs) wires implementations.
  4. Feature changes: Core first if business rules change.

Workflow

  1. Name the use cases (ApplyHosts, CheckUpdate…).
  2. Define ports as interfaces in Core.
  3. Implement adapters in Infrastructure.
  4. UI only calls use cases / services via interfaces.
  5. 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.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.