No slash command · from archon-os
Guides safe, incremental refactoring by detecting code smells, planning small changes, and ensuring tests pass at each step. Use for improving code quality without changing behavior.
Ships in archon-os. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
AI-consumed reference. Optimized for Claude to read during execution. Human-readable explanation: see docs/architecture/HIERARCHICAL_PLANNING.md or docs/getting-started/ depending on topic.
Safe, incremental refactoring. Improve quality without changing behavior.
| Command | Output |
|---|---|
refactor:analyze <file> | .claude/logs/refactors/{target}-analysis.md |
refactor:plan <file> | .claude/logs/refactors/{target}-plan.md |
refactor:docs <file> | Analysis + Plan + Summary |
refactor:quick <file> | Skip approvals |
refactor:performance <file> | Performance-focused |
refactor:structure <file> | Structure-focused |
| Signal | Action |
|---|---|
| Code smell detected | Identify specific smell |
| Tests passing | Safe to refactor |
| No tests | Write tests FIRST |
| Large change | Break into small steps |
Golden Rule: Never refactor and add features simultaneously.
| Smell | Refactoring |
|---|---|
| Long Method | Extract Method |
| Large Class | Extract Class |
| Long Parameter List | Parameter Object |
| Duplicate Code | Extract Method/Class |
| Feature Envy | Move Method |
| Primitive Obsession | Replace with Object |
| Switch Statements | Polymorphism |
| Dead Code | Delete it |
1. Ensure tests pass
2. ONE small change
3. Run tests
4. Commit
5. Repeat
Never multiple changes between test runs.
Before: Tests exist and pass, understand current behavior, identify smell. During: One change at a time, test after each, commit frequently. After: All tests pass, code cleaner, behavior unchanged.
rules/core/simplicity-over-complexity.md — the point of refactoring: Rule of 3 before abstracting, delete before extracting, flatten before nestingrules/core/tdd-workflow.md — refactor only when tests are greenrules/core/verification.md — tests must still pass after every steprules/workflow/cross-review-workflow.md — refactorer ≠ reviewerskills/code-simplifier/SKILL.md — companion skill for pure simplification passesWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub nguyenthienthanh/archon --plugin archon-os45 skills in this plugin
/agent-detectorCRITICAL: MUST run for EVERY message. Detects agent, complexity, AND model automatically. Without this, tasks route to wrong agents and use wrong models, degrading quality and wasting tokens./api-designerDesigns RESTful APIs with endpoint naming, versioning strategies (URL path, header-based), pagination (offset and cursor), error response schemas, and OpenAPI conventions. Use when the user asks about REST API design, creating endpoints, URL structure, API versioning, status codes, Swagger, or OpenAPI specs./bugfix-quickFast bug fixes with root cause investigation + TDD. Enforces 'no fix without root cause' discipline and verification protocol. Without this skill, fixes are applied at symptoms instead of sources, and bugs return./chain-of-verificationDraft → generate verification questions → answer independently via tools → revise. Catches hallucinated facts in reports and reviews. MANDATORY for Phase 4 security/test claims. Paper: Dhuliawala et al. 2023./code-mapReverse-dependency lookup — "I am about to change this file, what breaks?" Use when assessing the blast radius of an edit, finding every importer of a module (including the ones that never name it), or checking what the startup code-map digest was derived from. Not for finding text: grep is better at that./code-reviewer8-aspect evidence-based code review/audit (security, correctness, compatibility, architecture, error handling, test gaps, type safety, simplicity) built on Google eng-practices, OWASP Top 10:2025, CWE Top 25, SemVer. Every finding needs file:line + a concrete failure scenario. Use when the user asks to review/audit code, check a PR, review before merge, in TDD Phase 4, via /check review or /run review.Other plugins' skills for the same job