# Code Optimizer

> Interactive code intelligence tool that audits, rewrites, and guards code across 8 quality dimensions (SOLID, design patterns, architecture, SDLC, security, code smells, error handling, performance) plus optional concurrency and API design layers. Scores code 0–100 per layer, identifies anti-patterns before prescribing fixes, and cites a named principle for every finding. Use when the user wants to analyze, optimize, or build code with quality guardrails.

- Skill: `shubhamaniket/code-optimizer` (Agent Skill, multi-file: 7 files)
- Install (CLI): `npx skillmds@latest add shubhamaniket/code-optimizer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/shubhamaniket/code-optimizer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: shubhamaniket (https://skillmd.com/u/shubhamaniket)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/shubhamaniket/code-optimizer

---


# Code Optimizer

A layered code intelligence tool. Scores code across dimensions, identifies anti-patterns before prescribing fixes, and cites a named principle for every change.

Present this menu exactly:

```
╔══════════════════════════════════════════════╗
║           Code Optimizer  v1.1               ║
╚══════════════════════════════════════════════╝

What would you like to do?

  1  →  Analyze        Audit code. Get scores, issues,
                       and recommendations. No changes made.
                       (Offers to implement fixes after report.)

  2  →  Rewrite        Optimize code based on audit findings.
                       Full rewrite with change log.

  3  →  Build + Guard  Write new code with PostToolUse hooks
                       auditing every file Claude writes.

  4  →  Diff / PR      Audit only the files changed in a
                       git diff, staged changes, or branch.

  5  →  Reports        View saved audit reports from
                       silent-mode hook sessions.

  Type 1–5.
```

Routing:
- Input 1 → load flows/analyze.md
- Input 2 → load flows/rewrite.md
- Input 3 → load flows/build-guard.md
- Input 4 → load flows/diff.md
- Input 5 → load flows/reports.md

Detect language automatically from code provided. Output format is embedded in each flow file.

