Usage Examples

Real-world scenarios demonstrating effective use of the Domain-Driven Development plugin for establishing code quality standards and applying Clean Architecture principles.

Examples

Project Initialization with DDD Standards

Scenario: You're starting a new TypeScript project and want to establish consistent code quality from day one.

# Initialize Claude for your project
/init

# Set up project constitution with Clean Architecture
/sdd:00-setup Use TypeScript, PostgreSQL, Clean Architecture, domain-driven design

# Add TypeScript-specific best practices
/tech-stack:add-typescript-best-practices

# Add code formatting standards
/ddd:setup-code-formating

Expected Flow:

  1. Project gets CLAUDE.md with base configuration

  2. Constitution establishes architectural principles in specs/constitution.md

  3. TypeScript guidelines added to CLAUDE.md

  4. Code formatting rules enforced in CLAUDE.md

Resulting CLAUDE.md Section:

Implementing a Feature with DDD Principles

Scenario: Building a user authentication service following Clean Architecture.

Expected Output Structure:

The AI will generate code following Clean Architecture layers:

Code Quality Applied:

Refactoring Legacy Code to Clean Architecture

Scenario: Existing codebase has business logic mixed with controllers.

AI Analysis Output:

Library-First Decision Making

Scenario: Need to implement retry logic for API calls.

Expected AI Response:

Enforcing Naming Conventions

Scenario: Code review finds generic naming that violates DDD principles.

Before:

After:

Setting Up a Microservice with Bounded Contexts

Scenario: Designing a new microservice that needs clear bounded context boundaries.

Expected Domain Model:

Code Quality Review with DDD Standards

Scenario: Reviewing a pull request for architectural compliance.

Expected Review Output:

Integration Patterns

With Reflexion for Continuous Improvement

With SDD for Full Development Lifecycle

With Code Review for Quality Gates

Anti-Pattern Detection Examples

Detecting NIH Syndrome

AI Response:

Detecting Mixed Concerns

AI Response:

Last updated