adr-writer
Generates Architecture Decision Records capturing context, rationale, alternatives, and consequences in numbered status-tracked format. Triggers on: "write an…
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",
$ npx -y skills add Mathews-Tom/armory --skill code-refiner --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/code-refinerContext preview
The summary Claude sees to decide when to auto-load this skill.
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",
name: code-refiner description: '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".' metadata: version: 1.1.1 category: review tags: [refactoring, code-quality, simplification, readability] difficulty: intermediate phase: review
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.
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.
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).
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 modifications: `git diff --name-only HEAD~5` or `git diff --staged --name-only` 2. **Detect language and ecosystem** — Read file extensions, imports, config files (package.json, pyproject.toml, go.mod, Cargo.toml). Load the appropriate language reference from `references/` if needed for idiom-specific guidance 3. **Read project conventions** — Check for CLAUDE.md, .editorconfig, linter configs (eslint, ruff, golangci-lint, clippy). These override generic idiom preferences 4. **Understand test coverage** — Locate test files. If tests exist, note the test runner so you can verify behavioral equivalence after changes 5. **Baseline complexity snapshot** — For each target function/method, mentally note:
Identify what's actually wrong before reaching for solutions. Categorize issues by severity:
**Critical** (always fix):
**High** (fix unless there's a clear reason not to):
**Medium** (fix when it improves clarity without adding risk):
**Low** (fix only in a dedicated cleanup pass):
Apply changes using these tactics, ordered by impact-to-risk ratio:
Remove before restructuring. Less code = less to think about.
Reduce nesting and cognitive load:
(or use language-appropriate constructs: list comprehensions, iterators, streams)
Make the code's intent visible:
Apply language-specific patterns (consult `references/<language>.md` for details):
Types are documentation that the compiler checks:
Curated, production-grade skills, agents, hooks, rules, commands, utilities, and presets for AI coding agents. No magic, no demos — battle-tested workflows built for developers who use AI seriously.
Repo: Mathews-Tom/armory
Generates Architecture Decision Records capturing context, rationale, alternatives, and consequences in numbered status-tracked format. Triggers on: "write an…
Build AI agents and automate Claude Code programmatically via the Claude Agent SDK and headless CLI mode. Covers Python SDK, claude -p, SDK MCP servers, hooks,…
Audits and enhances FastAPI and REST API documentation: missing descriptions, response codes, examples, docstrings, Pydantic models, OpenAPI spec. Triggers on:…
Generate architecture diagrams as fully editable SVG with native AWS, Azure, and GCP icons for cloud diagrams, or hand-drawn generic icons for everything else.…
Architecture reviews across 7 dimensions (structural, scalability, enterprise readiness, performance, security, ops, data) with scored reports. Triggers on:…
Optimize and prepare figures for arXiv submission: format conversion (EPS/PDF/PNG/JPG), size reduction, metadata stripping, processor compatibility (DVI vs…