Zen

Refactor code by renaming identifiers, extracting helpers, and removing dead paths.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/Dinxeshh/agent-skills --skill zen-dinxeshh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Zen
Source: https://github.com/Dinxeshh/agent-skills/tree/main/skills/zen
Command: npx skills add https://github.com/Dinxeshh/agent-skills --skill zen-dinxeshh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Zen ensures messy or bloated code stays behaviorally stable while becoming readable, maintainable, and review-ready, guiding each pass through SURVEY → PLAN → APPLY → VERIFY → PRESENT with documented evidence and verification.

Core Features & Use Cases

  • Refactor: variable renaming, function extraction, magic-number constants, and dead-code removal inside a single scope tier, measured with before/after metrics and driven by documented recipes.
  • Review: structured PR reviews that surface smells, complexity metrics, and scope identification, plus routing signals to Radar, Judge, or Guardian when the request falls outside Zen’s domain.
  • Workflow Safety: enforces the contract of no behavior change, routing to the right agent (Judge, Atlas, Guardian) when necessary and always recording scope, verification, and metrics before handing off.

Quick Start

Ask Zen to rename unclear identifiers, extract helper functions, and delete unused logic while keeping tests green and behavior unchanged.

Frequently Asked Questions about Zen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor confusing code without changing its behavior?

To refactor code safely, you rename unclear identifiers, extract helper functions, and remove dead paths while running tests to verify behavior remains unchanged. Zen applies these improvements through a documented survey, plan, apply, verify, and present workflow.

What is the best way to improve code readability for a pull request review?

Improving code readability for a pull request involves replacing magic numbers with constants and extracting functions to reduce complexity. Zen provides structured PR reviews that surface code smells and measure before and after metrics to ensure maintainability.

Can I remove dead code and rename variables within a single scope tier?

Yes, you can remove dead code and rename variables within a single scope tier. Zen targets small to medium scopes, applying refactoring recipes like function extraction and identifier renaming while enforcing a strict contract of no behavior change.

How do I know if my code refactoring requires routing to another agent?

Code refactoring requires routing to another agent when the request falls outside safe readability improvements. Zen hands off to Radar, Judge, or Guardian if the scope exceeds small to medium refactoring or requires deeper architectural analysis.

Does Zen work for large scale refactoring tasks?

Zen does not work for large scale refactoring tasks. It is designed for small to medium scopes where a documented one-pass improvement fits, ensuring safe variable renaming, function extraction, and dead code removal without altering program behavior.

Why should I measure before and after metrics when extracting helper functions?

Measuring before and after metrics when extracting helper functions ensures the refactoring actually reduces complexity and improves readability. Zen records these measurements alongside scope and verification evidence before delivering final recommendations.