Skip to content
Back to skills

Z Refactor

ASecurity

Zero-regression refactoring and modularization workflow enforcing the Net Engineering Value (NEV) gate. Use when refactoring, splitting large classes, localizing DTOs, or cleaning tech debt.

  • 4 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 12, 2026
ai-agentsrefactoringperformance

Security analysis

A100/100

Scanned November 12, 2026

npx -y skills add kzxl/z-plugin --skill z-refactor --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Z Refactor?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Z Refactor
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/kzxl-z-refactor/badge)](https://www.skillsdirectory.com/skills/kzxl-z-refactor)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: z-refactor
description: Zero-regression refactoring and modularization workflow enforcing the Net Engineering Value (NEV) gate. Use when refactoring, splitting large classes, localizing DTOs, or cleaning tech debt.
---

# Z-Refactor Protocol

Refactoring improves code structure without altering external behavior. Never introduce new features or behavior changes during a refactor.

## Net Engineering Value (NEV) Gate

Every refactoring proposal must demonstrate a positive score across 4 axes:

| Axis | Requirement | Immediate Failure Condition |
| :--- | :--- | :--- |
| **1. Runtime Performance** | Latency $\le$ baseline, allocations $\le$ baseline | Memory spikes or query count increases |
| **2. Abstraction Tax** | Zero wrapper hell, deleted dead code | Single-implementation interfaces, LOC bloat > 30% |
| **3. Cognitive Complexity** | Direct call paths, nesting $\le 3$ | Indirection layers with zero domain value |
| **4. Test Contract** | 100% existing test pass rate | Broken or deleted assertions |

## Refactoring Steps

1. **Baseline Pinning**: Run all tests before touching code; ensure clean baseline.
2. **Atomic Steps**:
   - Extract method / Rename symbol / Localize DTO / Inline shallow wrapper.
   - Run tests after each micro-step.
3. **Deletion Test**: For every abstraction touched, ask: *"If this interface or wrapper is removed, does anything break?"* If no, delete it.
4. **Post-Refactor Benchmark**: Verify memory allocations and execution times did not regress.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.