Skip to content

Architecture Patterns

Design backend code with clean layers, ports and adapters, and DDD boundaries that stay testable.

Repository
wshobson/agents
Stars
42,095
Licence
MIT
Files
3 files

What it does

When installed, the agent gets guidance on structuring backend services using Clean Architecture, Hexagonal (ports and adapters) Architecture, and Domain-Driven Design. It keeps business rules separate from databases, web frameworks and external services, so the agent can propose folder layouts, interface definitions and dependency rules, and write unit tests that run without a real database. It also includes troubleshooting advice for common problems such as circular imports and framework code leaking into domain entities.

Great for

  • Backend developers designing a new microservice or module from scratch
  • Teams refactoring a monolith toward bounded contexts before splitting services
  • Developers whose unit tests need a running database and want in-memory alternatives

Skip it if

  • Frontend or purely static projects, where these backend layering patterns do not apply
  • Small scripts or prototypes, where the added layers may be more overhead than benefit
  • Anyone expecting it to replace reading the architecture decisions of their own team: the patterns are generic and must be adapted to the existing codebase

Try asking

  • “Design a clean architecture layout for a new order-processing microservice”
  • “Help me refactor this Django monolith into bounded contexts”
  • “Show me how to add a hexagonal port and an in-memory adapter for our payment service”
  • “Why do I get circular import errors between my use_cases and adapters packages?”
Step-by-step guide: how to use Architecture PatternsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 3 original files, the MIT licence and an attribution note.

    architecture-patterns.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip architecture-patterns.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip architecture-patterns.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Name the language and framework you use (the examples are Python-style), so the agent adapts the structure rather than giving generic advice.
  • Point the agent at your existing code so it can map current modules onto the layers instead of proposing a full rewrite.
  • Ask for a dependency rule check (for example, which imports are forbidden) so the guidance becomes something you can enforce in review.

What's inside

  • references/advanced-patterns.md
  • references/details.md
  • SKILL.md

Redistributed unmodified from wshobson/agents under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.