- Home
- Skills
- Code Quality & Review
- make code
make code
Enforce KISS, DRY, and YAGNI principles to write, refactor, or optimize application code with low cyclomatic complexity.
Free
Works with the AI tools you already use
make code
Example session with this skill installed
Refactor the processOrder function in orders.js to be simpler. It currently has too many nested if-statements and handles its own database connections.
- Read your context and instructions
- Compiled the make code
I have classified this as a
refactor branch. I identified processOrder as the entrypoint and noted that database logic should be handled by the existing db.js helper rather than inside the function. I've flattened the logic using guard clauses to reduce cyclomatic complexity from 12 to 4.
Refactored processOrder
import { saveOrder } from './db.js';
import { isValidOrder } from './validators.js';
/**
* Validates and persists an order to the database.
* @param {Object} order The order data to process.
*/
export async function processOrder(order) {
if (!isValidOrder(order)) {
throw new Error('Invalid order data');
}
const result = await saveOrder(order);
if (!result.success) {
throw new Error(`Persistence failed: ${result.error}`);
}
return result.id;
}
Next steps
- Verify that
saveOrderindb.jscorrectly handles the connection pooling as assumed. - Run the existing test suite; the
processOrderlogic now relies on externalized validation which should be verified against edge cases. - Remove any unused database driver imports from
orders.js.
Connects securely to your tools. The creator never sees your data.
About this skill
Development cycles often stall due to over-engineering, scope creep, and inconsistent coding standards. This skill enforces strict software engineering principles to ensure every line of code is necessary, maintainable, and performant. It eliminates speculative features and deep nesting by prioritizing simplicity and observable proofs.
What it does
- Classifies intent by branching between new behavior, refactoring for simplicity, or targeted performance improvements.
- Enforces complexity caps by limiting cyclomatic complexity (CC) to 20 or less per function to ensure readability.
- Validates existence by checking the codebase, stdlib, and dependencies before writing new code to prevent duplication.
- Generates observable proofs using red-green testing patterns that mock only at trust boundaries like networks or filesystems.
- Normalizes style by tracing and matching existing project conventions, naming patterns, and documentation shapes.
How it works
- Classify: Identify if the task is a
write,refactor, orimprovebranch based on whether a performance hotspot is named. - Trace: Map the entrypoints, symbols, and callers while identifying the shared root for bug fixes.
- Climb: Search for the simplest implementation rung, favoring existing helpers or stdlib over new custom code.
- Apply: Implement the logic following KISS, DRY, and YAGNI principles.
- Prove: Write the smallest possible test to observe the behavior change.
Frameworks & tools
This skill is language-agnostic and adapts to local project tools like eslint, ruff, or gocyclo. It integrates with existing AGENTS.md or CLAUDE.md convention files.
Why this beats prompting it yourself
Generic prompts often produce "hallucinated" utility functions or over-engineered abstractions. This skill forces a systematic search for existing code and strictly caps cyclomatic complexity, preventing the technical debt that standard LLM outputs usually introduce.
Use cases
- Feature implementation where you need the minimum viable code without extra knobs or layers.
- Code refactoring to flatten deeply nested logic and improve readability without changing behavior.
- Performance tuning to fix specific N+1 queries, hot loops, or quadratic complexity hotspots.
- Bug fixing by identifying and patching the shared root cause rather than applying surface-level hacks.
Known limitations
This skill skips documentation-only tasks, agent instruction updates, Makefiles, and CSS-only restyles. Performance improvements require a named hotspot to avoid speculative optimization.
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scanned
Verified clean today
- Free to download with an account