Back to Architecture & Design Patterns

Software Architecture Development

architecturedddrefactoringsoftware-designclean-code
β˜… 4.3 (230)⭐ 28.1kπŸ“„ MITπŸ•’ 2026-06-16Source β†—

Install this skill

npx skills add davila7/claude-code-templates

Works across Claude Code, Cursor, Codex, Copilot & Antigravity

What this skill does

  • β€’Enforces domain-driven design and strict separation of concerns
  • β€’Promotes a library-first approach to minimize custom maintenance
  • β€’Provides automated code style and structural rules
  • β€’Identifies and refactors anti-patterns like generic utility files
  • β€’Ensures business logic remains decoupled from framework dependencies

When to use it

  • βœ“Starting a new project to ensure long-term maintainability
  • βœ“Refactoring monolithic or disorganized codebase structures
  • βœ“Determining whether to build a custom solution or integrate an existing library
  • βœ“Standardizing team coding conventions for business logic and components

When not to use it

  • βœ•Building quick-and-dirty prototypes for temporary proof-of-concepts
  • βœ•Working in environments that require extreme performance optimizations over clean design

How to invoke it

Example prompts that trigger this skill:

  • β€œReview my existing codebase for violations of clean architecture principles.”
  • β€œHelp me design this new feature using domain-driven design concepts.”
  • β€œRefactor these utility functions into domain-specific modules.”
  • β€œShould I write a custom solution for this auth flow or use an established provider?”
  • β€œCheck if my component structure follows the separation of concerns requirements.”

Example workflow

  1. Analyze the proposed feature against domain-driven design boundaries.
  2. Identify third-party libraries that replace potential custom code requirements.
  3. Structure new files to keep business logic isolated from UI components.
  4. Apply naming conventions that reflect the specific business domain.
  5. Refactor any functions exceeding 50 lines to ensure readability.

Pitfalls & limitations

  • !Over-engineering simple tasks that do not require full DDD overhead
  • !Excessive reliance on third-party libraries that may introduce security vulnerabilities
  • !Strict adherence to line counts can sometimes lead to fragmented logic

FAQ

Why does this skill discourage using generic names like utils or helpers?
Generic names often lead to 'dumping ground' files that violate the single-responsibility principle and make code harder to navigate.
Is it ever okay to write custom code instead of using a library?
Yes, custom code is justified for unique domain logic, performance-critical paths, or when external dependencies are too heavy or insecure.
What is the recommended file length limit?
The skill suggests keeping files under 200 lines to maintain focus and ensure modularity.

How it compares

Unlike generic prompts, this skill enforces a structured architectural methodology that prevents technical debt rather than just generating functional code.

Source & trust

⭐ 28k starsπŸ“„ MITπŸ•’ Updated 2026-06-16πŸ›‘ no risky patterns found

From the source: β€œ# Software Architecture Development Skill This skill provides guidance for quality focused software development and architecture. It is based on Clean Architecture and Domain Driven Design principles. ## Code Style Rules ### General Principles - **Early return pattern**: Always use early returns whe…”

View the full SKILL.md source

# Software Architecture Development Skill

This skill provides guidance for quality focused software development and architecture. It is based on Clean Architecture and Domain Driven Design principles.

## Code Style Rules

### General Principles

- **Early return pattern**: Always use early returns when possible, over nested conditions for better readability
- Avoid code duplication through creation of reusable functions and modules
- Decompose long (more than 80 lines of code) components and functions into multiple smaller components and functions. If they cannot be used anywhere else, keep it in the same file. But if file longer than 200 lines of code, it should be split into multiple files.
- Use arrow functions instead of function declarations when possible

### Best Practices

#### Library-First Approach

- **ALWAYS search for existing solutions before writing custom code**
  - Check npm for existing libraries that solve the problem
  - Evaluate existing services/SaaS solutions
  - Consider third-party APIs for common functionality
- Use libraries instead of writing your own utils or helpers. For example, use `cockatiel` instead of writing your own retry logic.
- **When custom code IS justified:**
  - Specific business logic unique to the domain
  - Performance-critical paths with special requirements
  - When external dependencies would be overkill
  - Security-sensitive code requiring full control
  - When existing solutions don't meet requirements after thorough evaluation

#### Architecture and Design

- **Clean Architecture & DDD Principles:**
  - Follow domain-driven design and ubiquitous language
  - Separate domain entities from infrastructure concerns
  - Keep business logic independent of frameworks
  - Define use cases clearly and keep them isolated
- **Naming Conventions:**
  - **AVOID** generic names: `utils`, `helpers`, `common`, `shared`
  - **USE** domain-specific names: `OrderCalculator`, `UserAuthenticator`, `InvoiceGenerator`
  - Follow bounded context naming patterns
  - Each module should have a single, clear purpose
- **Separation of Concerns:**
  - Do NOT mix business logic with UI components
  - Keep database queries out of controllers
  - Maintain clear boundaries between contexts
  - Ensure proper separation of responsibilities

#### Anti-Patterns to Avoid

- **NIH (Not Invented Here) Syndrome:**
  - Don't build custom auth when Auth0/Supabase exists
  - Don't write custom state management instead of using Redux/Zustand
  - Don't create custom form validation instead of using established libraries
- **Poor Architectural Choices:**
  - Mixing business logic with UI components
  - Database queries directly in controllers
  - Lack of clear separation of concerns
- **Generic Naming Anti-Patterns:**
  - `utils.js` with 50 unrelated functions
  - `helpers/misc.js` as a dumping ground
  - `common/shared.js` with unclear purpose
- Remember: Every line of custom code is a liability that needs maintenance, testing, and documentation

#### Code Quality

- Proper error handling with typed catch blocks
- Break down complex logic into smaller, reusable functions
- Avoid deep nesting (max 3 levels)
- Keep functions focused and under 50 lines when possible
- Keep files focused and under 200 lines of code when possible

Quoted from davila7/claude-code-templates for reference β€” see the original for the authoritative, latest version.

πŸ“„ Full skill instructions β€” original source: davila7/claude-code-templates
This skill provides a systematic framework for building maintainable, scalable, and quality-focused software. It prioritizes Clean Architecture and Domain-Driven Design (DDD) to prevent the accumulation of technical debt and spaghetti code. By enforcing strict separation of concerns, the skill ensures that business logic remains decoupled from UI components and infrastructure dependencies. It emphasizes a library-first mindset, preventing 'Not Invented Here' syndrome by favoring established, vetted third-party solutions over custom-built utilities. Ideal for developers and technical leads aiming to improve project longevity, this skill enforces best practices such as early returns, modular component design, and explicit naming conventions. It serves as a guardrail against common architectural pitfalls, ensuring that codebase growth remains manageable and that domain logic stays clear, testable, and isolated from external implementation details.

How to Use This Skill Unit

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/skills/software-architecture/
  3. Save the file as SKILL.md
  4. The agent will automatically discover the skill based on its description.

Option B: Global Installation (All Agents)

Save the file to these locations to make it available across all projects:

  • Claude Code: ~/.claude/skills/davila7/claude-code-templates/software-architecture/SKILL.md
  • Cursor: ~/.cursor/skills/davila7/claude-code-templates/software-architecture/SKILL.md
  • Antigravity: ~/.gemini/antigravity/skills/davila7/claude-code-templates/software-architecture/SKILL.md

πŸš€ Install with CLI:
npx skills add davila7/claude-code-templates

Read the Master Guide: Mastering Agent Skills β†’

Recommended Rules

View more rules β†’

Recommended Workflows

View more workflows β†’

Recommended MCP Servers

View more MCP servers β†’

Take It Further

Maximize your productivity with these powerful resources

πŸ“‹

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
πŸ“–

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide

How to use this Skill in Claude Code & Cursor

For Claude Code (CLI)

To use this skill in Claude Code, copy the rule content into your project's custom instructions or follow our Add-Skill CLI guide. This ensures Claude follows your standards during every code generation.

For Cursor & Windsurf

For Cursor or Windsurf, individual skills are best used in the "Rules for AI" section. This specific unit helps the agent avoid architecture & design patterns issues, leading to cleaner, more efficient code.

Why the skill format matters: the standardized Agent Skills format lets your AI agent load detailed instructions only when they are relevant, keeping your prompt clean while improving results.

Source & attribution

This skill is categorized under Architecture & Design Patterns and is published by davila7, maintained in davila7/claude-code-templates.

← Browse All Agent Skills
Sponsored AI assistant. Recommendations may be paid.