Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Clean Code And Architecture Skill

    1

    Practical code review and architectural refactoring based on Clean Code principles and dependency health analysis.

    $4.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Clean Code And Architecture Skill

    Clean Code And Architecture Skill

    Example session with this skill installed

    Review this Express controller for clean code issues and suggest a refactoring plan:

    app.post('/user', (req, res) => {
      const user = req.body;
      if(!user.email) return res.status(400).send('No email');
      db.query('INSERT INTO users...', [user.email], (err, result) => {
        if(err) throw err;
        emailService.sendWelcome(user.email);
        res.send('Saved');
      });
    });
    
    • Read your context and instructions
    • Compiled the clean code

    I have reviewed the app.post('/user') handler. The current implementation couples HTTP concerns directly with database infrastructure and side effects.

    Code Quality and Architecture Audit

    SeverityReferenceFindingRecommendation
    HighController LogicInfrastructure Leakage: The HTTP handler directly executes SQL queries via db.query.Extract database logic into a repository or service layer.
    MediumError HandlingFragile Error Path: throw err inside a callback will crash the process in many Node.js versions.Use a try/catch block or pass the error to the Express next middleware.
    MediumResponsibilitySide-effect Coupling: The welcome email is triggered inside the DB callback.Move side effects to an application service or event emitter.
    LowValidationBasic Validation: Manual check for user.email is primitive.Use a validation schema (e.g., Joi or Zod).

    Architecture Assessment

    The current structure is

    Transaction Script style. The Presentation layer (Express) is heavily coupled to the Infrastructure layer (Database). There is no visible Domain or Application layer to house business rules.

    Refactoring Roadmap

    Add Characterization Test: Create a test case that hits the /user endpoint to verify the 400 and 200 responses.
    2. Extract Data Access: Move the INSERT query into a UserRepository.js file.
    3. Handle Errors Gracefully: Replace the throw with a proper Express error handler response.
    4.

    Introduce Application Service: Create a RegisterUser use case that coordinates the Repository and the emailService.

    Next steps

    • Would you like me to generate the UserRepository and UserService files?
    • Should I provide the updated Express route using these new abstractions?
    • Do you want a Joi schema for the input validation?

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

    About this skill

    Deeply nested logic, circular dependencies, and leaked infrastructure details make codebases hard to maintain. This skill acts as a pragmatic software quality engineer to review your project and provide a structured roadmap for incremental improvement.

    What it does

    • Code quality review identifies readability issues, improper naming, and bloated functions using file-specific references.
    • Architectural mapping evaluates boundaries between domain logic, presentation, and infrastructure to detect layer leakage.
    • Dependency health analysis audits manifests and lockfiles for version consistency and upgrade risks.
    • Safe refactoring plans generates step-by-step sequences for improving code without breaking existing behavior.
    • Severity classification prioritizes findings from critical risks to low-impact readability improvements.

    How it works

    1. Provide your repository files, language details, and any specific maintenance goals.
    2. The agent inspects your project structure to summarize current conventions and architectural boundaries.
    3. You receive a prioritized report including code smells, architectural risks, and dependency health.
    4. Request implementation for specific findings to receive incremental, behavior-preserving code changes.

    Frameworks & tools

    Works with any language or framework including JavaScript/TypeScript, Python, Java, Go, and C#. It integrates with package managers via manifest analysis and uses standard unit testing patterns for validation.

    Why this beats prompting it yourself

    Generic prompts often lead to "hallucinated" refactors that break production code or force enterprise patterns on small scripts. This skill follows a strict workflow to preserve observable behavior and ensures every recommendation is grounded in your specific file context.

    Use cases

    • Reviewing a legacy module before adding new features to ensure testability.
    • Auditing dependency lockfiles for version drift and framework compatibility.
    • Decoupling business logic from framework-specific code in growing applications.
    • Onboarding to a new codebase by generating an architectural assessment.

    Known limitations

    Cannot verify security vulnerabilities without external advisory data. Refactoring implementation requires the user to provide the relevant file context and execution environment for testing.

    Cannot verify security vulnerabilities without external advisory data. Refactoring requires full file context. Testing only occurs if an execution environment is provided.

    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

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 14 days ago

    Permissions

    Read Files
    Listed14 days ago

    What's inside

    Frequently Asked Questions

    This skill is language-agnostic and performs equally well across JavaScript/TypeScript, Python, Java, Go, and C#, adapting its refactoring logic to the specific syntax and package managers of your project.

    While it highlights architectural risks and code smells, it does not function as a security scanner; it focuses on maintainability and structural integrity rather than identifying active vulnerabilities or malware.

    Unlike generic prompts, this skill uses a structured multi-step workflow to map your specific architectural boundaries, ensuring that refactoring suggestions preserve existing behavior rather than just changing syntax.

    You will receive the full 'Clean Code and Architecture' agent configuration, ready to be deployed within your compatible AI agent environment for immediate project analysis.

    The skill provides a prioritized roadmap that classifies issues by severity, allowing you to address critical architectural leaks first while saving minor readability improvements for later.

    Yes, it is specifically designed to audit manifests and lockfiles, helping you identify version drift and compatibility risks across your project's dependency tree.

    New in Code Quality & Review