Agent skill

Codebase Hygiene

by romiluz13 in romiluz13/cc10x

Two-mode skill: (1) find semantic duplicates — functions doing the same thing under different names, invisible to copy-paste detectors; (2) deepen shallow modules — thin wrappers and pass-through…

MITAuto-check: notes

Install Codebase Hygiene

skills CLI
$ npx skills add romiluz13/cc10x --skill codebase-hygiene -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install romiluz13/cc10x codebase-hygiene --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/romiluz13/cc10x.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/cc10x/skills/codebase-hygiene .claude/skills/codebase-hygiene && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codebase-hygiene
GitHub stars
164
Token cost
~1.5k tokens
SKILL.md length
741 words
Files
1
Skills in repo
22
Repo updated
First seen
Licence
MIT

At a glance

Two-mode skill: (1) find semantic duplicates — functions doing the same thing under different names, invisible to copy-paste detectors; (2) deepen shallow modules — thin wrappers and pass-through…

  • Works in 6 steps: Scope before you scan — take the user's… → Extract catalog — Grep/Glob for exported… → Categorize by domain (cheap tier) —… → …
  • SKILL.md covers Mode: DUPLICATE DETECTION and Mode: MODULE DEEPENING
  • Calls git

What it does

Codebase Hygiene is an agent skill from romiluz13/cc10x. Two-mode skill: (1) find semantic duplicates — functions doing the same thing under different names, invisible to copy-paste detectors; (2) deepen shallow modules — thin wrappers and pass-through layers that spread complexity. Advisory and read-only; changes route through BUILD with full gates.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: The Loop Engine for Claude Code — engineer the loop, not the prompt. 1 router · 9 agents · 16 skills · 4 workflows. Fail-closed gates, test honesty, anti-anchored review. The licence is MIT.

Example prompts

  • “/codebase-hygiene”

Requirements

  • Pre-approved tools (allowed-tools): Read, Grep, Glob, Bash

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Scope before you scan — take the user's named target; else git log --oneline for hot spots and weight recently-changed code — deepening…
  2. Extract catalog — Grep/Glob for exported functions. Record name | file:line | signature.
  3. Categorize by domain (cheap tier) — validation, formatting, path manipulation, HTTP shaping, date handling. Mechanical bucketing to shrink…
  4. Drop categories with <3 functions — can't hide a meaningful duplication pattern.
  5. Detect duplicates per category (capable tier) — read implementations, decide which share intent. Never use cheap tier for detection — it…
  6. Emit findings — group by confidence, highest first. Each finding: what is duplicated, why it matters, the fix, file:line evidence. Route…

What it can do on your machine

Read from SKILL.md and the folder at commit 891acf0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Grep
    • Glob
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codebase Hygiene loads about 1.5k tokens when it runs. Until then it costs about 78 tokens; SKILL.md has 741 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~78
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Grep, Glob, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from romiluz13/cc10x at commit 891acf0, republished under its MIT licence (© romiluz13). 741 words, ~1,511 tokens.

Download SKILL.mdSave it as .claude/skills/codebase-hygiene/SKILL.md (or your agent's skills folder).
name
codebase-hygiene
description
Two-mode skill: (1) find semantic duplicates — functions doing the same thing under different names, invisible to copy-paste detectors; (2) deepen shallow modules — thin wrappers and pass-through layers that spread complexity. Advisory and read-only; changes route through BUILD with full gates.
allowed-tools
Read, Grep, Glob, Bash
user-invocable
false

Codebase Hygiene (Duplicate Detection + Module Deepening)

Advisory and read-heavy. Diagnoses and proposes; does not refactor. Any actual change goes through BUILD with full gates.

Mode: DUPLICATE DETECTION

Semantic duplicates: functions serving the same purpose but implemented independently under different names. Copy-paste detectors catch syntactic duplicates; this finds "same intent, different implementation."

Method
  1. Scope before you scan — take the user's named target; else git log --oneline for hot spots and weight recently-changed code — deepening pays off in proportion to future change.
  2. Extract catalog — Grep/Glob for exported functions. Record name | file:line | signature.
  3. Categorize by domain (cheap tier) — validation, formatting, path manipulation, HTTP shaping, date handling. Mechanical bucketing to shrink comparison space.
  4. Drop categories with <3 functions — can't hide a meaningful duplication pattern.
  5. Detect duplicates per category (capable tier) — read implementations, decide which share intent. Never use cheap tier for detection — it anchors on names and rubber-stamps "these look different."
  6. Emit findings — group by confidence, highest first. Each finding: what is duplicated, why it matters, the fix, file:line evidence. Route through code-reviewer finding contract.
High-Risk Zones
ZoneWhy it duplicates
utils/, helpers/, lib/Catch-all dumping grounds
Validation code"Is this a valid email/id/url" rewritten per feature
Error formattingEvery module invents its own Error → string
Path manipulationJoin/normalize/relativize reimplemented
String formattingTruncate, slugify, titlecase, pad re-rolled
Date formattingParse/format/diff scattered
API response shapingEnvelope/pagination/error-body copied per endpoint
Consolidation Discipline

Never delete a duplicate until all three hold:

  1. Survivor has tests — pick the implementation with real coverage. If neither has tests, write the test against the chosen survivor first.
  2. All callers updated — Grep to enumerate callers. Missing one is a silent break.
  3. Re-run after consolidation — test suite + build/typecheck pass. Green tests on the survivor license the deletion.

Mode: MODULE DEEPENING

Existing code works; the problem is shape, not features. LLM-grown codebases accrete shallow modules — thin wrappers, pass-through layers, near-duplicate helpers. Each looks harmless; together they spread complexity across every caller.

Deep module: hides a lot of behavior behind a small interface. Shallow module: interface is almost as complex as its implementation — callers learn a thing without getting much.

The Deletion Test

For each candidate: If I deleted this module and inlined its code at every call site, where does the complexity go?

  • Complexity vanishes → the module was a pass-through / shallow. It adds indirection without hiding complexity. Deepening candidate (delete it or deepen its interface).
  • Complexity reappears across N call sites → the module is deep. It earns its existence by hiding complexity that would otherwise be duplicated. Leave it alone.

This verdict agrees with cc10x:codebase-design (canonical) and cc10x:architecture. Depth is leverage at the interface — not a lines-ratio.

SmellUsually
Thin wrapper (doX(a){ return lib.doX(a) })Shallow
Pass-through layer (service maps 1:1 to repo)Shallow
Near-duplicate helper (same intent, different name)Shallow — consolidate first
Config/leverage module (small interface, branching/retry/state inside)Deep — keep
Show full SKILL.md (267 more words)Show less
Diagnosis Flow (READ-ONLY)
  1. Enumerate exported surface (name | file:line | signature)
  2. Flag shallow shapes
  3. Cross-reference near-duplicates (run duplicate detection mode first — consolidate before deepening)
  4. Run deletion test on each survivor
  5. Output: candidate list, not a refactor
Present Candidates Before Proposing Interfaces

Badge each candidate: Strong (unambiguous), Worth-exploring (real cost/risk), Speculative (hunch, low confidence).

For each: before/after sketch (current shallow interface vs proposed deeper one) with deletion test result. Then stop and ask which to pursue. Do not design interfaces for candidates the user hasn't chosen.

Two-Adapters Rule for Seam Placement

When designing the deeper interface, a port (an injected external dependency seam) needs two concrete adapters — e.g. a production transport and a test stand-in. An ordinary caller or a test exercising a public interface is NOT an adapter; the two-adapter rule is about ports, not every seam.

For a non-port seam (the common case for module deepening): the test must be able to reach the interface. If only production code crosses the seam and no test can reach it → the seam is a guess. Put the interface where a test can reach it, or don't introduce it. This aligns with cc10x:codebase-design — "one adapter means a hypothetical seam" applies to ports; internal seams need reachability, not a second adapter.

Handoff to BUILD

This skill ends at: chosen candidate + deeper-interface proposal + named seam. It does NOT edit code. The refactor routes through planner → BUILD workflow (builder → reviewer → verifier → doc-sync → memory). The deepening is verified: survivor interface has tests at its seam, every caller is repointed, suite + typecheck pass after merge.

Proposing is read-only; changing is gated.

© romiluz13, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/cc10x/skills/codebase-hygiene of romiluz13/cc10x.

Open the folder on GitHubat commit 891acf0

Compare with similar skills

Codebase Hygiene next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codebase Hygiene compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codebase Hygiene this skillromiluz13/cc10x164—~1.5kAutomated safety check: NotesMIT
Finding Duplicate Functionsobra/superpowers-lab4292 repos~1.2kAutomated safety check: PassMIT
Semantic Liststhedaviddias/Front-End-Checklist74k—~504Automated safety check: PassMIT
Duplicate JSthedaviddias/Front-End-Checklist74k—~423Automated safety check: PassMIT
Azure Functionsdavila7/claude-code-templates32k1 repos~344Automated safety check: PassMIT
Semantic Versioningsickn33/agentic-awesome-skills47k1 repos~2.6kAutomated safety check: PassMIT

Similar skills

  • Finding Duplicate Functions

    obra/superpowers-lab

    A skill your agent uses when auditing a codebase for semantic duplication - functions that do the same thing but have different names or implementations.

    429 GitHub starsUsed in 2 repos~1.2k tokens
    Auto-check passed
  • Semantic Lists

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing rendered HTML, interactive components, or design-system patterns related to Use semantic list elements.

    74k GitHub stars~504 tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Duplicate JS

    thedaviddias/Front-End-Checklist

    A skill your agent uses when auditing slow page loads, heavy assets, or rendering delays related to Remove duplicate JavaScript libraries.

    74k GitHub stars~423 tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Azure Functions

    davila7/claude-code-templates

    Expert patterns for Azure Functions development including isolated worker model, Durable Functions orchestration, cold start optimization, and production patterns.

    32k GitHub starsUsed in 1 repo~344 tokens
    Backend & APIsAuto-check passed
  • Semantic Versioning

    sickn33/agentic-awesome-skills

    Automate versioning and changelog generation using semantic versioning principles.

    47k GitHub starsUsed in 1 repo~2.6k tokens
    DevelopmentAuto-check passed
  • Neon Functions

    sickn33/agentic-awesome-skills

    Long-running, serverless Node.js HTTP functions deployed onto your Neon branch, with DATABASEURL injected automatically and compute that runs next to your data.

    47k GitHub starsUsed in 1 repo~8.6k tokens
    Backend & APIsAuto-check: notes

More from romiluz13/cc10x

All 22 skills in this repo
  • Diff Driven Docs

    romiluz13/cc10x

    A skill your agent uses when a BUILD phase completes, a commit is staged, or a PR is about to be created, and the diff has not yet been reflected in documentation.

    164 GitHub stars~2.7k tokensUpdated 7 days ago
    Auto-check: notes
  • Cc10x Guide

    romiluz13/cc10x

    Answers questions about cc10x itself — what it is, how to install and configure it, how the router, workflows, memory, and hooks operate, and how to troubleshoot.

    164 GitHub stars~1.7k tokensUpdated 7 days ago
    Auto-check passed
  • Cc10x Router

    romiluz13/cc10x

    THE ONLY ENTRY POINT FOR CC10X. An agent skill from romiluz13/cc10x.

    164 GitHub stars~17k tokensUpdated 7 days ago
    Auto-check passed
  • Codebase Design

    romiluz13/cc10x

    Canonical deep-module vocabulary (module, interface, depth, seam, adapter, leverage, locality) for designing a module's shape — a lot of behaviour behind a small interface at a clean seam, testable…

    164 GitHub stars~1.9k tokensUpdated 7 days ago
    Auto-check passed
  • MCP CLI

    romiluz13/cc10x

    A skill your agent uses when you need a one-off MCP server capability during research or debugging without permanently mounting it as a context-polluting integration.

    164 GitHub stars~739 tokensUpdated 7 days ago
    Auto-check: notes
  • A skill your agent uses when a git merge or rebase reports conflicts and the operation is in progress.

    164 GitHub stars~709 tokensUpdated 7 days ago
    Auto-check: notes

Questions about Codebase Hygiene

What does Codebase Hygiene do?

Two-mode skill: (1) find semantic duplicates — functions doing the same thing under different names, invisible to copy-paste detectors; (2) deepen shallow modules — thin wrappers and pass-through…. Codebase Hygiene is an agent skill from romiluz13/cc10x. Two-mode skill: (1) find semantic duplicates — functions doing the same thing under different names, invisible to copy-paste detectors; (2) deepen shallow modules — thin wrappers and pass-through layers that spread complexity.

How do I install Codebase Hygiene in Claude Code?

Run `npx skills add romiluz13/cc10x --skill codebase-hygiene -a claude-code`. Or copy the skill folder (plugins/cc10x/skills/codebase-hygiene in romiluz13/cc10x) into .claude/skills/codebase-hygiene in your project. Claude Code loads it when a task matches its description.

How do I install Codebase Hygiene in Codex?

Run `npx skills add romiluz13/cc10x --skill codebase-hygiene -a codex`. Or copy the skill folder (plugins/cc10x/skills/codebase-hygiene in romiluz13/cc10x) into .agents/skills/codebase-hygiene in your project. Codex loads it when a task matches its description.

Can I use Codebase Hygiene in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add romiluz13/cc10x --skill codebase-hygiene -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codebase-hygiene, .gemini/skills/codebase-hygiene, .github/skills/codebase-hygiene and .opencode/skills/codebase-hygiene in your project.

What does Codebase Hygiene need to run?

Going by SKILL.md and its folder, Codebase Hygiene needs the command-line tools its instructions call (git). Its frontmatter pre-approves these tools: Read, Grep, Glob, Bash.

Does Codebase Hygiene access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Codebase Hygiene safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Codebase Hygiene use?

Codebase Hygiene is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codebase Hygiene use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codebase Hygiene?

Skills that share tags, products or a category with Codebase Hygiene: Finding Duplicate Functions (obra/superpowers-lab, 429 stars), Semantic Lists (thedaviddias/Front-End-Checklist, 74k stars), Duplicate JS (thedaviddias/Front-End-Checklist, 74k stars) and Azure Functions (davila7/claude-code-templates, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codebase Hygiene?

romiluz13 (a GitHub user) maintains it in romiluz13/cc10x, which has 164 GitHub stars. The repository holds 22 skills in this directory. The repository was last updated on September 30, 2026.

Source: romiluz13/cc10x on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.