Backend Clean Architecture
Use when the user asks where code belongs, clean architecture, hexagonal, ports and adapters, domain vs application vs infrastructure layer, or service vs repository. Produces a layer map and dependency rules. Not for GoF pattern choice (use design-patterns) or DDD modeling (use architecture-domain-driven-design).
Install
npx skills add j4flmao/agent-skills --skill backend-clean-architecturegit clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/backend/universal/clean-architecture ~/.claude/skills/backend-clean-architecturePersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Backend Clean Architecture
## Purpose
Enforce strict layer separation in backend code. Domain layer has zero dependencies on frameworks, databases, or external libraries. Every piece of code must belong to exactly one layer.
## Agent Protocol
### Trigger
Exact user phrases: "where does this code go", "what layer", "clean architecture", "hexagonal", "ports and adapters", "domain layer", "application layer", "infrastructure layer", "should this be in service or repository", "layer violation", "architecture rule".
### Input Context
Before activating, verify:
- The stack is known (NestJS, Go, Rust, Python, Spring Boot).
- The user has described a specific piece of code or asked about a specific location.
- The project's folder structure is visible or has been described.
### Output Artifact
No file output. This skill produces text guidance.
### Response Format
Answer exactly:
```
{code piece} -> {Layer}: {one-sentence justification}
File: {suggested file path}
```
If there is a violation:
```
VIOLATION: {file}:{line}
Layer {X} imports Layer {Y} which is NOT allowed.
Fix: {specific refactor instruction}
Direction: {layer name} -> {layer name} is the correct direction.
```
No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output.
### Completion Criteria
- [ ] The layer for the code has been identified.
- [ ] If a violation exists, it has been identified with specific file/line.
- [ ] The fix direction has been specified.Details
- Skill name
backend-clean-architecture- Repository
- j4flmao/agent-skills
- Path
skills/backend/universal/clean-architecture/SKILL.md- License
- MIT
- Repo updated
- 17 November 2026
FAQ
What does the Backend Clean Architecture skill do?
Use when the user asks where code belongs, clean architecture, hexagonal, ports and adapters, domain vs application vs infrastructure layer, or service vs repository. Produces a layer map and dependency rules. Not for GoF pattern choice (use design-patterns) or DDD modeling (use architecture-domain-driven-design).
How do I install the Backend Clean Architecture skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill backend-clean-architecture. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Backend Clean Architecture popular?
It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.
Related skills
Agent Observability
45j4flmao/agent-skills
Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).
AI Agent Architectures
45j4flmao/agent-skills
Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).
AI Agent Core Loop
45j4flmao/agent-skills
Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).
Backend Concurrency Mechanics
45j4flmao/agent-skills
Use when the user asks about race conditions, data races, deadlocks, mutex vs atomic, memory model, thread pool sizing, virtual threads, goroutines vs threads or blocking the event loop. Produces an explanation of runtime concurrency mechanics with fixes. Not for distributed locks (use backend-distributed-locking).
Backend Caching
45j4flmao/agent-skills
Use when the user asks about caching, adding a Redis cache in front of a query, cache-aside, write-through, cache invalidation, TTL jitter, cache stampede or Memcached. Produces a cache strategy with keys, TTLs, invalidation and code. Not for browser/HTTP caching (use frontend-browser-caching) or distributed locks (use backend-distributed-locking).
Backend Cqrs Patterns
45j4flmao/agent-skills
Use when the user asks about CQRS, splitting read and write models, command and query handlers, read models, materialized views or projections for reporting. Produces a CQRS design with handlers and projection updates. Not for event stores (use backend-event-sourcing).
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.