- Home
- Skills
- Code Quality & Review
- craft gates
More screenshots
Works with the AI Agents you already use
craft gates
Quantitative quality gates and SOLID auditor for rigorous code reviews and spec-driven development.
Free
craft gates
Example session with this skill installed
Review this TS function
function process(data: any) {
if (data) {
if (data.items) {
data.items.forEach(i => {
if (i.valid) {
save(i);
}
});
}
}
}
- Read your context and instructions
- Compiled the craft gates
I have audited the provided TypeScript function against the Craft Gates rulebook. The deeply nested logic violates the nesting depth gate and relies on multiple levels of anonymous callbacks.
VERDICT: CHANGES_REQUIRED
BLOCKERS: 1 MAJORS: 0 MINORS: 1
GATES CHECKED (per function):
- process — lines: 11, nesting: 4, complexity: 4, callback-depth: 1 [VIOLATION: nesting]
FINDINGS
- [BLOCKER] line 4 — Nesting Depth — The function reaches 4 levels of nesting (if > if > forEach > if). This exceeds the maximum limit of 2. Fix by applying guard clauses to flatten the structure.
- [MINOR] line 1 — Primitive Obsession — The
data: anytype is an anemic signature. Define a proper interface for the input domain.
ACCEPTANCE CRITERIA
- Not met: The code fails the hard gate for nesting depth.
Refactored Implementation
interface DataItem {
valid: boolean;
}
interface ProcessInput {
items?: DataItem[];
}
/**
* Refactored using guard clauses to meet Nesting Depth <= 2.
*/
function process(data: ProcessInput | null): void {
if (!data?.items) return;
const validItems = data.items.filter(item => item.valid);
validItems.forEach(save);
}
Next steps
- Replace the
anytype with a concrete interface in your domain model. - Replace the remaining
forEachwith a named handler if logic grows. - Verify the
savefunction signature matches the newDataItemtype.
Connects securely to your tools. The creator never sees your data.
About this skill
Manual code reviews are inconsistent and slow. Human reviewers often miss deep nesting, high cyclomatic complexity, or SOLID violations because they focus on logic rather than structure. This skill enforces a quantitative quality-gate rulebook to ensure every line of code meets strict architectural standards before it merges.
What it does
- Enforce hard gates by measuring function length, nesting depth, cyclomatic complexity, and parameter counts against strict thresholds.
- Audit code smells to identify long parameter lists, feature envy, primitive obsession, and shotgun surgery.
- Verify SOLID principles using a five-question diagnostic for every module or class to ensure proper responsibility and dependency direction.
- Validate design patterns through a pressure rule that requires a specific requirement trigger before adding architectural ceremony.
- Generate review verdicts with a standardized protocol that categorizes findings into Blocker, Major, and Minor severities.
How it works
- Load the rulebook at the start of a design, implementation, or refactoring pass to set the quality baseline.
- Select a workflow mode ranging from full spec-driven documentation for greenfield features to spec-lite for informal requirements.
- Execute the review protocol by running the agent against a diff or file to generate a structured verdict.
- Apply refactor moves such as guard clauses, method extraction, or strategy patterns based on specific gate violations.
Frameworks & tools
This skill is language-agnostic but provides specific rules for JS/TS regarding anonymous callbacks and async/await. It integrates with any development environment supporting Markdown-based specifications and tasks.
Why this beats prompting it yourself
Generic prompts often give subjective feedback or miss subtle nesting issues. This skill uses a precise numerical matrix for complexity and depth, ensuring the agent acts as a rigorous auditor rather than a polite assistant.
Use cases
- Auditing a Pull Request to catch architectural technical debt before it merges.
- Refactoring legacy god-objects into clean, testable SOLID modules.
- Scaffolding new features with vertical slices and explicit acceptance criteria.
- Enforcing coding standards across a team without manual nitpicking.
Known limitations
Line-count exemptions are only allowed for data tables or config maps with specific comments. No exemptions exist for nesting, complexity, or callback-depth gates.
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 7 days ago
- Free to download with an account