code-refiner

Featured

Deep code simplification and refactoring preserving behavior across Python, Go, TypeScript, Rust. Targets complexity, anti-patterns, readability debt. Triggers on: "simplify this code", "refactor for clarity", "reduce complexity", "make this more readable", "tech debt cleanup", "too much nesting".

AI & Automation 343 stars 55 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
84
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Code Refiner A structured, multi-pass code refinement skill that transforms complex, verbose, or tangled code into clean, idiomatic, maintainable implementations — without changing what the code does. ## Philosophy The goal is **not** fewer lines. The goal is code that a tired engineer at 2am can read, understand, and safely modify. Every change must pass three tests: 1. **Behavioral equivalence** — identical inputs produce identical outputs, side effects, and errors 2. **Cognitive load reduction** — a reader unfamiliar with the code understands it faster after the change 3. **Maintenance leverage** — the change makes future modifications easier, not harder When clarity and brevity conflict, clarity wins. When idiom and explicitness conflict, consider the team's experience level. When DRY and locality conflict, prefer locality for code read more than modified. ## Prerequisites - **git** — used in Phase 1 for scope detection (`git diff`) when the user doesn't specify target files - **Python 3.10+** — required to run `scripts/complexity_report.py` for quantitative complexity metrics ## Workflow Follow this sequence. Each phase builds on the previous one. Do not skip phases, but adapt depth to the scope of the request (a single function gets a lighter pass than a full module). ### Phase 1: Reconnaissance Before touching anything, build a mental model: 1. **Identify scope** — What files/functions are in play? If the user hasn't specified, check recent git modific...

Details

Author
Mathews-Tom
Repository
Mathews-Tom/armory
Created
9 months ago
Last Updated
2 days ago
Language
Python
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Listed

refactor-code

Change existing code through narrow, behavior-preserving, test-backed simplification without speculative architecture or scope growth. Use for requests to refactor, clean up, restructure, or simplify code. Use explain-code instead when the user only wants an explanation of the current structure.

1 Updated 1 weeks ago
drafael
Code & Development Listed

refactor

Surgical code refactoring to improve maintainability without changing behavior. Invoke when user says "refactor this", "clean up this code", "extract functions", "this is messy", "improve maintainability", "fix code smells", "simplify this", "this function is too long", or when you see god functions, nested conditionals, duplicate logic, magic numbers, unclear naming, or dead code. Always run a discovery pass first — catalog smells before touching anything. Gradual evolution, not revolution.

3 Updated today
LucasSantana-Dev
Code & Development Listed

refactor

Surgical code refactoring to improve maintainability without changing behavior. Invoke when user says "refactor this", "clean up this code", "extract functions", "this is messy", "improve maintainability", "fix code smells", "simplify this", "this function is too long", or when you see god functions, nested conditionals, duplicate logic, magic numbers, unclear naming, or dead code. Always run a discovery pass first — catalog smells before touching anything. Gradual evolution, not revolution.

2 Updated 6 days ago
LucasSantana-Dev