Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/mathews-tom/armory/code-refinernpx skills add Mathews-Tom/armory --skill code-refinergit clone --depth 1 https://github.com/Mathews-Tom/armoryWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00069 | $0.02743 |
| Opus 5 | $0.00034 | $0.01372 |
| Sonnet 5 | $0.00014 | $0.00549 |
| Haiku 4.5 | $0.00007 | $0.00274 |
Grade A, and why
code-refiner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 263 lines — stays where its author put it; the contents beside it link to each section on GitHub.
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:
- Behavioral equivalence — identical inputs produce identical outputs, side effects, and errors
- Cognitive load reduction — a reader unfamiliar with the code understands it faster after the change
- 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.pyfor 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:
- Identify scope — What files/functions are in play? If the user hasn't specified, check recent
git modifications:
git diff --name-only HEAD~5orgit diff --staged --name-only - 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 - Read project conventions — Check for CLAUDE.md, .editorconfig, linter configs (eslint, ruff, golangci-lint, clippy). These override generic idiom preferences
- Understand test coverage — Locate test files. If tests exist, note the test runner so you can verify behavioral equivalence after changes
- Baseline complexity snapshot — For each target function/method, mentally note:
- Nesting depth (max indentation levels)
- Number of branches (if/else/match/switch arms)
- Number of early returns vs single-exit
- Parameter count
- Lines of code
- Number of responsibilities (does it do more than one thing?)
What ships with it
6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 263 lines · 69 tokens per session scan A 1c2970980194
code-refiner is a skill published in the GitHub repository Mathews-Tom/armory (316 stars, last pushed 4d ago), licensed MIT. It adds 69 tokens to every session and 2,743 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
manager
Sync session work into GitHub issues, or query track status across repos. Write: find/update issue + W-label. Read: "что по ". Triggers: "создай issue", "синкни сессию", "manager". Not day/week plans (daily-tasks).
weekly-retro
Use when the user is closing an ISO week, reviewing planned outcomes against evidence, interviewing work Areas, resolving unfinished commitments, or asking for "ретро", "weekly retro", "week review", or lessons from the week.
art-director
Orchestrate iterative visual style searches with branch prompts, decision graphs, feedback loops, and final direction selection.
corp-doctor
Use when a Personal Corp operating loop needs setup, repair, a new department, or task routing: HQ files and agent rules, GitHub issue workflow, corp- owner map, department repositories, or deciding which repo an issue belongs to. Triggers: "corp doctor", "почини контур", "заведи отдел", "куда положить задачу"…
html-draft
Use when user wants a standalone HTML diagram in flat engineering blueprint style — architecture diagrams, system flows, technical spec sheets, component maps. Generates one HTML file using Tailwind v4 (browser CDN) for layout and D3 v7 (CDN) for SVG diagrams. User-invoked only — do NOT auto-trigger. Triggers on…
idea
Use when capturing ONE new idea the user voices and wants recorded — "save this idea", "I have an idea", "log this idea", "/idea", "idea: ...". Creates a provenance-tracked folder (one folder per idea) in your ideas repo, dedups against an index, optionally mirrors to a GitHub Project view filtered by label:idea. NOT…