Code Craft

    1

    Industrial-grade software engineering skill library for architecture design, code review, and safe refactoring.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Code Craft

    Example session with this skill installed

    Review this order processing logic for code smells and suggest refactorings. It has a huge switch statement for payment types and 10+ parameters in the constructor.

    • Read your context and instructions
    • Compiled the code craft

    I have analyzed the order processing logic. The code exhibits significant design decay, specifically around the payment handling and object construction.

    Code Review & Refactoring Report

    🔍 Quality Diagnosis

    SeveritySmellLocationRecommended Refactoring
    Blocker3.10 Switch StatementsOrderProcessor::processPayment()Replace Conditional with Polymorphism (9.6): Extract payment logic into dedicated Strategy classes (e.g., CreditCardStrategy, PaypalStrategy).
    Major3.4 Long Parameter ListOrder::Order(...)Introduce Parameter Object (10.9): Wrap order-related metadata into an OrderSpecification object to simplify the interface.
    Major3.5 Divergent ChangeOrderProcessor classExtract Class (7.3): Move accounting and notification logic out of the processor to satisfy the Single Responsibility Principle.
    Minor3.1 Magic NumberscalculateTax()Replace Magic Number with Symbolic Constant (8.1): Define TAX_RATE_VAT to improve readability.

    Proposed Refactoring Plan

    // Phase 1: Introduce Parameter Object for the constructor
    struct OrderDetails {
        std::string customerId;
        std::vector<Item> items;
        std::string currency;
        // ... other 7 parameters
    };
    
    // Phase 2: Strategy Pattern for Payments
    class PaymentStrategy {
    public:
        virtual ~PaymentStrategy() = default;
        virtual void collectPayment(double amount) = 0;
    };
    
    class CreditCardStrategy : public PaymentStrategy {
        void collectPayment(double amount) override { /* CC Logic */ }
    };
    

    Next steps

    1. Verify Test Suite: Ensure existing unit tests cover the processPayment branching logic before starting.
    2. Apply Baby Steps: Begin by extracting the OrderDetails struct to fix the constructor smell.
    3. Execute Polymorphic Shift: Create the PaymentStrategy interface and migrate one switch case at a time.

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

    About this skill

    Software systems decay when design principles are ignored and technical debt accumulates. This skill package provides a comprehensive engineering framework for developers who need to build, review, and refactor complex systems using industry-standard methodologies. It integrates Martin Fowler's refactoring patterns, Uncle Bob's SOLID principles, and the Unix philosophy to ensure code remains maintainable and decoupled.

    What it does

    • Architectural Modeling guides high-level package topology and low-level interface contracts using evolutionary design patterns.
    • Automated C++ Quality manages environment checks, static analysis via clang-tidy, and incremental formatting for legacy codebases.
    • Standardized Code Review diagnoses 22 distinct code smells and provides structured reports with prioritized refactoring steps.
    • Safe Refactoring executes complex code transformations using the "Two Hats" rule and atomic baby steps to preserve system stability.
    • Technical Communication generates industrial-grade READMEs, RFCs, and Minimal Reproducible Examples (MRE) for effective problem-solving.

    How it works

    1. Design Mode uses the CCP and ADP principles to partition components and define decoupled interface contracts.
    2. Review Mode scans existing source code against the "Code Smells" catalog to output a structured quality diagnosis.
    3. Refactor Mode applies one of 68 standard patterns, implementing small changes verified by automated tests.
    4. Ops Mode triggers C++ toolchain initialization and runs static analysis in either full or incremental diff modes.

    Frameworks & tools

    The skill utilizes clang-format, clang-tidy, and cppcheck for C++ quality. It leverages Mermaid for architectural diagrams and follows Stack Overflow MRE and Stack Overflow "How to Ask" standards for technical documentation.

    Why this beats prompting it yourself

    Generic AI prompts often suggest "clean code" without a systematic methodology, leading to broken builds or shallow advice. This skill enforces rigorous workflows like the "Two Hats" rule and specific Unix design patterns, ensuring every architectural decision is grounded in proven engineering literature.

    Use cases

    • Refactoring a monolithic function into a decoupled strategy pattern.
    • Setting up a CI-ready C++ static analysis pipeline for a legacy project.
    • Conducting a formal code review to identify divergent change or shotgun surgery smells.
    • Drafting a high-impact RFC that compares technical trade-offs and underlying mechanisms.

    Known limitations

    C++ quality tools require local installation of clang-based utilities. Refactoring operations assume the presence of a test suite for behavior verification.

    Requires local clang-format/clang-tidy for C++ tasks. Refactoring depends on existing test coverage to guarantee safety. Scoped to design, review, refactoring, and technical communication.

    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

    Requires

    Python
    Git

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed13 days ago

    What's inside

    Frequently Asked Questions

    The skill provides an industrial-grade engineering framework that enforces SOLID principles, Unix philosophy, and Martin Fowler's refactoring patterns to prevent technical debt and architectural decay.

    While the architectural and code review modules work across most languages, the automated quality and static analysis features are specifically optimized for C++ using tools like clang-tidy and cppcheck.

    For the C++ quality and Ops modes, you will need a local installation of clang-based utilities (clang-format, clang-tidy); however, the architectural and review modes work out-of-the-box.

    The skill includes specialized modules for Architectural Modeling, Automated C++ Quality, Standardized Code Review, Safe Refactoring, and Technical Communication templates.

    It identifies 22 distinct code smells and 68 standard refactoring patterns, providing structured reports that prioritize fixes based on the 'Two Hats' rule for system stability.

    The Refactor Mode is designed for atomic, incremental changes; however, it assumes a test suite is in place to verify that system behavior remains unchanged during transformations.

    New in Code Quality & Review