code-janitor

A cleanup and verification workflow for a folder, package, or recent Git changes. It examines code for simpler structure, clearer names, readable documentation, and production-readiness.

In plain words
What is it for?
Use it to clean up a package or diff, simplify abstractions, improve readability and documentation, and optionally run unit tests before treating the work as ready.
Why use it?
It helps turn messy or recently changed code into a clearer final shape and checks more than formatting alone, including structure and release risks.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/docs-plus/docs.plus/code-janitor
Any agent
npx skills add docs-plus/docs.plus --skill code-janitor
Clone the repo
git clone --depth 1 https://github.com/docs-plus/docs.plus

Made for: Claude Code, Codex.

Per session 136 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,295 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00136 $0.08295
Opus 5 $0.00068 $0.04147
Sonnet 5 $0.00027 $0.01659
Haiku 4.5 $0.00014 $0.00830

Measured yesterday against content hash 7264d2b3f557, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-janitor 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 yesterday.

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.

.agents/skills/code-janitor/SKILL.md · 393 lines

How it starts

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

Code Janitor 🧹

Tactical, principle-driven cleanup pipeline that adapts to any workspace and ends with an industry-standard production-ready verdict. Reviews a folder/package (or the current git changes) in five ordered chains: Simplification → Abstraction → Readability → Documentation → Production-Readiness Sweep. One supervisor grants the flag at the end. Phase A auto-detects the workspace's package manager, scripts, monorepo layout, agent-instructions doc, and adjacent skills. The same skill therefore works in a Bun/pnpm/yarn/npm repo, a single-package or workspaces layout, with or without a sibling commit-review skill.

Autonomous by default; opt-in review. Auto-applies edits, prints one terse line per file. Pass --review to gate every file or --with-tests to run unit tests. The skill always stops on its own for the six gated edit types (see § Constraints) regardless of flags.

Senior-level scope. Performs real cleanup when the new shape is materially better. That means renaming exported symbols, fixing typos in identifiers and i18n keys, splitting overgrown files, moving files, and bumping dep versions. Algorithm rewrites and net-new dependencies remain forbidden.

Multiple goals, one flag. Chains 1–4 polish (simpler, better-bounded, readable, documented). Chain 5 sweeps for bugs, performance regressions, weak typing, dead code, security issues, and missing test coverage — absorbing /simplify and /review into the pipeline. The supervisor grants the industry-standard production-ready flag only when every chain is green and no BLOCK-severity finding survives.

Constraints

Single source of truth. Two tiers: Forbidden (absolute, no escape) and Gated (allowed via the forced-approval mechanism in Phase B).

Forbidden — no flag, gate, or supervisor verdict overrides these

  1. Change runtime behavior for any input the program currently handles.
  2. Edit generated files — bootstrap-detected exclusion list, sibling .d.ts for .ts source, lockfiles, CHANGELOG.md.
  3. Edit test fixtures, snapshots, or recorded HTTP responses.
  4. Reformat for style — defer to the workspace's formatter/linter via Chain 0.
  5. Refactor algorithms — defer to a detected architecture skill (e.g. improve-codebase-architecture); else surface as INFO. Naming/structure cleanup is fine; replacing a sort or rewriting a loop's logic is not.
  6. Add net-new dependencies, frameworks, or build tools (Boring Technology). Bumping or removing an existing dep is gated, not forbidden.
  7. Commit — defer to the detected commit-skill, or stop and let the user commit.
  8. Create branches or worktrees — work happens in the current branch only.
  9. Introduce new debug/info loggers in paths that didn't have them. Warn/error logs are fine when the workspace's existing pattern uses them.
  10. Delete pre-existing debug/info loggers unless the agent-instructions doc explicitly authorises removal on the surrounding paths.

Read the full file on GitHub · 393 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. yesterday First seen · 393 lines · 136 tokens per session scan A 7264d2b3f557

Subscribe to this mod's changes

code-janitor is a skill published in the GitHub repository docs-plus/docs.plus (88 stars, last pushed 4d ago), licensed MIT. It adds 136 tokens to every session and 8,295 once invoked, about $0.0007 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.

Related

Other skills, from other repositories

docx

Read, create, and convert Microsoft Word (.docx) documents — extract text and tables, build reports from markdown/JSON, and export to PDF.

zhixuli0406/DuDuClaw · 34 tokens

document-converter

Convert Office documents (PPTX, DOCX, XLSX, PDF, HTML, CSV, JSON, XML, images) to Markdown using Microsoft MarkItDown. Provides the agent with conversion strategies for academic and research workflows.

wentorai/Research-Claw · 50 tokens

docx-manipulation

Create, edit, and manipulate Word documents programmatically using python-docx.

claude-office-skills/skills · 20 tokens

add-format

End-to-end checklist for adding a new input or output format to AILANG Parse (docparse). Use when the user says 'add support for X format', 'wire up a new parser', 'add .foo format', 'add a parser for .bar', 'support .baz files', 'ship format X', 'can we parse .qux', 'new format rollout', or mentions a file extension…

sunholo-data/ailang-parse · 183 tokens

landing-page

Create a new AILANG Parse documentation/landing page targeting a specific keyword or topic. Use when user says 'new landing page', 'new page for X', 'create a page about X', 'landing page for keyword X', or wants to add a documentation page to the docs/ site. Also use when the user references long-tail keywords, SEO…

sunholo-data/ailang-parse · 81 tokens

benchmark

Run OfficeDocBench evaluation and refresh benchmark scores across the AILANG Parse website. Use when the user says 'run benchmarks', 'rerun the benchmark', 'refresh benchmark numbers', 'update bench scores', 'regenerate summary.json', mentions OfficeDocBench, asks to evaluate parsers, asks why scores are out of sync…

sunholo-data/ailang-parse · 115 tokens