# Code Perfection

> Autonomous code refactoring and optimization with enforced resolution loops. Uses mechanical scripts for zero-regression verification, auto-revert on failure, and large codebase auditing with domain-scoped tiered scanning. Every change preserves behavior, introduces zero bugs, and loses zero functionality.

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

---


# Code Perfection — Autonomous Refactoring Agent

Use this skill when the user asks to refactor, optimize, clean up, or audit code for quality issues. The skill provides enforced resolution loops that cannot exit until all issues are resolved or explicitly deferred.

## Tools Provided

| Tool | Purpose |
|------|---------|
| `codeperfect_verify` | 8-point verification checklist (compiles, tests, no any, no secrets, no dead code, no scope creep) |
| `codeperfect_loop` | Resolution loop — issue ledger, lock, revert-on-failure, auto-commit, auto-defer |
| `codeperfect_audit` | Domain-scoped audit state — triage, one-domain-at-a-time, boundary analysis, merge-findings |
| `codeperfect_triage` | Structural recon — risk-tier classification without reading code |

## Commands

| Command | Description |
|---------|-------------|
| `/code-perfection <path>` | Run the resolution loop on a target |
| `/code-perfection:audit <path>` | Full tiered codebase audit |
| `/code-perfection:verify` | Run verification checklist |

## Code Standards

Read `references/agents.md` for the full code standards the agent must follow during refactoring.

## Resolution Loop Protocol

Read `references/resolution-loop.md` for the loop protocol: SCAN → PLAN → FIX → VERIFY → DECIDE → PROGRESS CHECK.

## Audit Strategy

Read `references/audit.md` for the tiered audit approach: Tier 0 (triage) → Tier 1 (domain audits) → Tier 2 (boundary audits) → Tier 3 (merge & report).

## Parallel vs Sequential

Read `references/parallel-vs-sequential.md` for when to use parallel vs sequential scanning.

