code design

    1

    Architect maintainable systems using evolutionary design, SOLID principles, and clean package topology.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    code design

    Example session with this skill installed

    Design a notification system module. I need to handle Email and SMS, but it should be easy to add WhatsApp later. Organize the packages and define the core interfaces using OO principles.

    • Read your context and instructions
    • Compiled the code design

    I have designed the notification system module using evolutionary design principles. The structure prioritizes the Open-Closed Principle (OCP) for future extensions like WhatsApp and enforces Dependency Inversion (DIP) to decouple the sender logic from the business triggers.

    Notification System Design

    1. Package Topology

    PackageResponsibilityPrinciple Applied
    com.system.notify.apiPublic interfaces and DTOs.CRP (Common Reuse)
    com.system.notify.coreDispatcher logic and contract enforcement.CCP (Common Closure)
    com.system.notify.providerConcrete implementations (Email, SMS).OCP (Open-Closed)

    2. Core Contracts and Modeling

    /**
     * Role-based interface for notification providers.
     * Following ISP: clients only depend on the send capability.
     */
    interface NotificationProvider {
        /**
         * Precondition: recipient must be valid format; content non-empty.
         * Postcondition: returns a Receipt with provider-specific ID.
         */
        send(recipient: string, message: Message): Promise<Receipt>;
        supports(type: ChannelType): boolean;
    }
    
    /**
     * Strategy-based Dispatcher.
     * Uses composition over inheritance to manage multiple providers.
     */
    class NotificationDispatcher {
        private providers: NotificationProvider[];
    
        constructor(providers: NotificationProvider[]) {
            // ADP: Injected via constructor to avoid circular dependencies
            this.providers = providers;
        }
    
        async notify(request: NotifyRequest): Promise<void> {
            const provider = this.providers.find(p => p.supports(request.channel));
            if (!provider) throw new Error("Unsupported channel");
            await provider.send(request.target, request.payload);
        }
    }
    

    Next steps

    1. Implement the EmailProvider and SmsProvider within the provider package.
    2. Add a WhatsAppProvider to the provider package without modifying the Dispatcher class.
    3. Define the Receipt invariant to ensure consistent logging across all channels.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Stop fighting technical debt and over-engineered abstractions. This skill enforces Martin Fowler’s evolutionary design and Robert Martin’s component principles to build systems that remain maintainable as requirements shift. It moves your development process from "Big Design Up Front" to a lean, contract-based approach.

    What it does

    • Component Topology Mapping applies CCP and CRP principles to organize classes into cohesive packages that minimize cross-boundary ripple effects.
    • Dependency Graph Cleanup identifies and breaks circular dependencies (ADP) using Dependency Inversion or abstraction extraction to maintain a Directed Acyclic Graph.
    • Contract-Based Modeling defines clear interfaces using Design by Contract (DbC), specifying preconditions, postconditions, and invariants for every module.
    • Interface Refinement splits bloated "fat" interfaces into role-specific "lean" interfaces (ISP) to reduce client coupling.
    • Evolutionary Implementation applies the Four Rules of Simple Design to eliminate duplication and ensure code expresses intent with minimal elements.

    How it works

    1. Top-down Decomposition starts with package-level partitioning based on common closure and reuse principles.
    2. Interface Definition establishes polymorphic strategies and role-based interfaces to ensure the system is Open-Closed (OCP).
    3. Dependency Inversion applies DIP to decouple high-level business logic from low-level implementation details or circular loops.
    4. Refinement and Simplification applies YAGNI and KISS filters to prune unnecessary abstractions and favor composition over inheritance.

    Frameworks & tools

    Works with any object-oriented language including Java, C#, C++, TypeScript, or Python. It follows SOLID, GRASP, and specialized component principles (CCP, CRP, ADP, DbC).

    Why this beats prompting it yourself

    Generic AI prompts often produce rigid, boilerplate-heavy designs or deep inheritance trees that break easily. This skill prioritizes composition and evolutionary growth, ensuring your architecture stays flexible enough to change without requiring a full rewrite.

    Use cases

    • Designing a new microservice or module from scratch with a clean package structure.
    • Refactoring a monolithic "god class" into a decoupled set of interfaces and strategies.
    • Eliminating circular dependencies in a legacy codebase to improve build stability.
    • Auditing a design proposal to identify violations of the Open-Closed or Interface Segregation principles.

    Known limitations

    This skill focuses on mid-level (package) and low-level (class) design. It does not handle high-level infrastructure provisioning or cloud-native orchestration logic.

    Focused on mid-level (package) and low-level (class) OO modeling. Does not cover infrastructure, cloud orchestration, or hardware-level design.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 13 days ago

    • Free with an Agensi account

    Permissions

    Read Files
    Listed13 days ago

    What's inside

    Frequently Asked Questions

    The skill analyzes your system's package structure to identify circular dependencies (ADP violations) and applies the Dependency Inversion Principle to transform the codebase into a stable, Directed Acyclic Graph.

    Yes, while it follows OOP best practices, the principles of Interface Segregation and Dependency Inversion are highly effective for modern TypeScript and Python projects, especially when managing complex business logic.

    This skill focuses on internal software architecture, such as component topology and SOLID class design, rather than external infrastructure concerns like AWS/Azure provisioning or Kubernetes orchestration.

    Unlike generic prompts that often favor 'Big Design Up Front' or rigid inheritance, this skill uses evolutionary design to create lean, contract-based architectures that are easier to refactor as requirements change.

    You receive the specialized design logic, a set of architectural templates based on Robert Martin’s component principles, and a guide on how to integrate the skill into your existing development workflow.

    The skill is designed to be agent-agnostic and works with any AI assistant capable of processing code structures and providing architectural feedback, including most leading LLM-based agents.

    New in Agents & Orchestration