nav-simplify

Simplify recently modified code for clarity and maintainability while preserving functionality.

232|12|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/qf-studio/navigator --skill nav-simplify-qf-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nav-simplify
Source: https://github.com/qf-studio/navigator/tree/main/skills/nav-simplify
Command: npx skills add https://github.com/qf-studio/navigator --skill nav-simplify-qf-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Freshly written code often contains nested ternaries, deep nesting, unclear variable names, and redundant patterns that accumulate technical debt. This Skill analyzes recently modified files and refactors them for readability without changing behavior, so cleanup happens automatically after implementation instead of being deferred. ## Core Features & Use Cases - Automated Code Analysis: Detects deep nesting, nested ternaries, long functions, unclear names, and redundant boolean comparisons via Python analyzer scripts. - ROI-Based Gating: Optionally scores each file's simplification benefit versus regression cost (file age, import references, change surface) to skip, suggest, or auto-apply changes. - Autonomous and Interactive Modes: Integrates into post-implementation workflows with configurable auto-apply behavior, or runs interactively with per-file diff approval. - Use Case: After generating a new API endpoint, run this Skill to flatten nested conditionals into early returns and rename single-letter variables before committing, keeping the diff clean for reviewers. ## Quick Start Simplify the code I just modified in this session and show me a diff of the proposed changes before applying them.

Frequently Asked Questions about nav-simplify

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

FAQPage Schema
How do I automatically clean up code after implementing a feature?

Invoke the skill after implementation completes; it detects modified files via git diff, analyzes them for complexity issues like nested ternaries and deep nesting, and proposes simplifications. With auto_apply enabled it applies changes directly, otherwise it shows diffs for approval.

What code issues does automated simplification detect?

The analyzer detects deep nesting beyond three levels, nested ternary operators, functions longer than 50 lines, single-letter variable names excluding loop counters, and redundant boolean comparisons like === true. Each issue includes a severity rating and a concrete fix suggestion.

Does code simplification change program behavior?

No, the core rule is functionality preserved absolutely. Transformations only change how code reads, such as converting nested ternaries to if-else chains or using early returns, and the skill flags any change with potential behavior risk for manual review.

Can I skip low-value refactoring on stable legacy files?

Yes, enable ROI scoring mode in .agent/.nav-config.json. The analyzer computes a benefit score versus a cost score based on file age, import references, and change size, then skips files below the skip_below threshold automatically.

Why is simplification skipped in autonomous mode?

When invoked autonomously with auto_apply set to false, the skill skips entirely rather than pausing the workflow for approval. Set simplification.auto_apply to true in .agent/.nav-config.json to enable direct application in autonomous runs.

Which files are excluded from code simplification?

By default, test files, spec files, Markdown, JSON, and YAML are skipped via skip_patterns, and files exceeding max_file_size (default 50000 bytes) are skipped with a warning. Documentation-only changes and configuration-only edits do not trigger the skill.