- Home
- Skills
- Code Quality & Review
- Code Craft
Code Craft
Industrial-grade software engineering skill library for architecture design, code review, and safe refactoring.
Free
Works with the AI Agents you already use
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
| Severity | Smell | Location | Recommended Refactoring |
|---|---|---|---|
| Blocker | 3.10 Switch Statements | OrderProcessor::processPayment() | Replace Conditional with Polymorphism (9.6): Extract payment logic into dedicated Strategy classes (e.g., CreditCardStrategy, PaypalStrategy). |
| Major | 3.4 Long Parameter List | Order::Order(...) | Introduce Parameter Object (10.9): Wrap order-related metadata into an OrderSpecification object to simplify the interface. |
| Major | 3.5 Divergent Change | OrderProcessor class | Extract Class (7.3): Move accounting and notification logic out of the processor to satisfy the Single Responsibility Principle. |
| Minor | 3.1 Magic Numbers | calculateTax() | 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
- Verify Test Suite: Ensure existing unit tests cover the
processPaymentbranching logic before starting. - Apply Baby Steps: Begin by extracting the
OrderDetailsstruct to fix the constructor smell. - Execute Polymorphic Shift: Create the
PaymentStrategyinterface 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
- Design Mode uses the CCP and ADP principles to partition components and define decoupled interface contracts.
- Review Mode scans existing source code against the "Code Smells" catalog to output a structured quality diagnosis.
- Refactor Mode applies one of 68 standard patterns, implementing small changes verified by automated tests.
- 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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