architecture-cleanup

architecture-cleanup is a skill for Claude Code, Codex from itlackey/akm. It costs 39 tokens per session (1,000 once invoked), scanned A, original, MPL-2.0.

A set of rules for reorganising code while keeping its existing behaviour unchanged. An architectural cleanup improves structure without adding product features.

In plain words
What is it for?
It guides narrow refactors, including moving modules or symbols, using adapters, and consolidating repeated pipeline stages when that solves a specific maintenance issue.
Why use it?
It reduces maintenance problems while protecting current functionality, tests, outputs, and command behaviour.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code; mentions OpenCode.

Good fit It guides narrow refactors, including moving modules or symbols, using adapters, and consolidating repeated pipeline stages when that solves a specific maintenance issue.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/itlackey/akm/architecture-cleanup
View source ↗ itlackey/akm
Install

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.

Any agent
npx skills add itlackey/akm --skill architecture-cleanup
Clone the repo
git clone --depth 1 https://github.com/itlackey/akm

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for architecture-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/itlackey/akm/architecture-cleanup.svg)](https://agentmods.dev/skills/itlackey/akm/architecture-cleanup)
Your own site
<a href="https://agentmods.dev/skills/itlackey/akm/architecture-cleanup"><img src="https://agentmods.dev/badge/skills/itlackey/akm/architecture-cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,000 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.01000
Opus 5 $0.00019 $0.00500
Sonnet 5 $0.00008 $0.00200
Haiku 4.5 $0.00004 $0.00100

Measured 8d ago against content hash d1d92c29c9bc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

architecture-cleanup 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 8d 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.

scripts/akm-eval/example-stash/skills/architecture-cleanup/SKILL.md · 172 lines

How it starts

The opening of the file, as written. The whole thing — 172 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Architecture Cleanup

Use this skill for narrow architectural cleanup where the code structure should improve but the product behavior must remain exactly the same.

Core rules

  1. No user-visible functionality changes.
  2. All existing tests must continue to pass with the same validation expectations.
  3. The only allowed test edits are import-path or symbol-import updates caused by file or module moves.
  4. Do not rewrite assertions, fixtures, or expected outputs to make a refactor easier.
  5. Prefer adapters first, rewrites second.
  6. Stop if the work starts to resemble framework-building instead of targeted cleanup.

Non-goals

This work is not for:

  • building a generalized plugin framework
  • adding complexity for its own sake
  • introducing runtime plugin loading or dynamic discovery
  • replacing simple direct code with abstract dispatch where no hotspot exists
  • changing command behavior, output envelopes, scoring semantics, or feature scope under the banner of refactoring

Repeated patterns

Use these patterns only when they remove a concrete maintenance problem.

Fixed-stage pipeline

Good for:

  • search
  • improve
  • indexing

Rule:

  • keep orchestration centralized
  • make stage order explicit
  • do not create contributor graphs

Ordered contributor registry

Good for:

  • ranking signals
  • proposal validators
  • search-hit enrichers

Rule:

  • define composition semantics once
  • keep registration static and deterministic

Structural contract

Good for:

  • refs
  • paths
  • canonical naming

Rule:

  • keep it small, boring, and stable

Classification as facts

Rule:

  • classification should produce facts
  • downstream processes should decide how to use those facts
  • avoid coupling classification directly to presentation names

SOLID / DRY / YAGNI guidance

SOLID

  • Single Responsibility: move one kind of policy behind one seam
  • Open/Closed: add behavior by registering a small contributor, not by growing a switchboard
  • Interface Segregation: prefer several narrow contracts over one large object
  • Dependency Inversion: higher-level workflows depend on small seams, not on concrete launchers or parsers

Read the full file on GitHub · 172 lines

Changes

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.

  1. 8d ago First seen · 172 lines · 39 tokens per session scan A d1d92c29c9bc

Subscribe to this mod's changes

architecture-cleanup is a skill published in the GitHub repository itlackey/akm (58 stars, last pushed 3d ago), licensed MPL-2.0. It adds 39 tokens to every session and 1,000 once invoked, about $0.0002 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.