codebase-consolidation

codebase-consolidation is a skill for Claude Code, Codex from humanerd-drew/opencode-drewgent. It costs 38 tokens per session (3,915 once invoked), scanned A, original, MIT.

A code-maintenance guide for finding repeated data, constants, and logic across parts of a project and replacing them with one shared source. A single source of truth is one authoritative place that other code reads from.

In plain words
What is it for?
Use it to consolidate frontend and backend constants, shared configuration, validation helpers, lookup tables, and repeated styles or utilities.
Why use it?
It helps prevent different copies of the same value or rule from drifting out of sync.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to consolidate frontend and backend constants, shared configuration, validation helpers, lookup tables, and repeated styles or utilities.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/humanerd-drew/opencode-drewgent/codebase-consolidation
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 humanerd-drew/opencode-drewgent --skill codebase-consolidation
Clone the repo
git clone --depth 1 https://github.com/humanerd-drew/opencode-drewgent

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 codebase-consolidation

README.md
[![agentmods](https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/codebase-consolidation/github.svg)](https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/codebase-consolidation)
Your own site
<a href="https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/codebase-consolidation"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/codebase-consolidation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for codebase-consolidation

Your own site · 80×15
<a href="https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/codebase-consolidation"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/codebase-consolidation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,915 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00038 $0.03915
Opus 5.5 $0.00015 $0.01566
Sonnet 5.5 $0.00008 $0.00783
Haiku 4.5 $0.00004 $0.00392

Measured 2mo ago against content hash efa0ed6f43f4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codebase-consolidation scanned grade A with 1 finding 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 2mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -o /dev/null -w "HTTP %{http_code}\n" http://localhost:8787/app/
skills/software-development/codebase-consolidation/SKILL.md · 306 lines

How it starts

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

Codebase Consolidation

Use this when a codebase has the same data or logic defined independently in multiple places — especially across different runtime environments (frontend JS, backend worker A, backend worker B). Consolidation prevents drift: one source updated, others forgotten.

When to Use

  • Same constants (천간/지지/오행 mappings, status enums, lookup tables) appear in 2+ files across frontend/backend
  • A backend utility function (retry, sign, validate) is re-implemented in a sibling worker
  • Two CSS files load the same component — one via <link> and one via @import
  • Config values (API endpoints, client IDs) defined in both frontend and backend
  • The user asks about "data duplication" or "master data source"

Core Principle

Single Source of Truth (SSOT) — pick one authoritative location for each piece of data, and make every consumer reference it. When runtime environments can't share code (e.g., separate Cloudflare Workers), use a data-level SSOT: a JSON file that both environments can import at build time.

Before:                    After:
  constants.js: {甲→wood}     src/data/constants.json: {甲→wood}
  worker.ts: ['甲','乙',...]       ↑                     ↑
  analyzer.ts: {甲→'wood'}      worker.ts ───┘    analyzer.ts ───┘
                              constants.js → (standalone copy + comment)

Three-Phase Process

Phase 1: Discovery

Find ALL copies of the same data. Cast a wide net:

# 1. Search for repeating character sequences (천간 10개, 지지 12개)
grep -rn "'甲','乙','丙','丁','戊','己','庚','辛','壬','癸'" --include='*.ts' --include='*.js' source/

# 2. Search for key-value patterns that suggest mapping data
grep -rn "'甲':.*'wood'\|'甲'.*element\|'wood'.*'목'" --include='*.ts' --include='*.js' source/

# 3. Check for the same array literal in multiple files
grep -rn "\[.*'子','丑','寅'.*\]" --include='*.ts' --include='*.js' source/

# 4. For CSS: compare <link> in HTML against @import chain in master CSS
grep -o 'href="[^"]*\.css"' public/**/*.html | sort
grep "@import" public/css/index.css | sort
# Any CSS loaded via <link> but NOT in @import (or vice versa) needs audit

Read the full file on GitHub · 306 lines

Files

What ships with it

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

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. 2mo ago First seen · 306 lines · 38 tokens per session scan A efa0ed6f43f4

Subscribe to this mod's changes

codebase-consolidation is a skill published in the GitHub repository humanerd-drew/opencode-drewgent (3 stars, last pushed 3mo ago), licensed MIT. It adds 38 tokens to every session and 3,915 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

codebase-consolidation compared with skills from other repositories

codebase-consolidation next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
codebase-consolidationhumanerd-drew/opencode-drewgentSkill33mo agoMITA38Claude Code, Codex
rubber-duck-plusmohitmishra786/anti-vibe-skillsSkill88mo agoMITA87Claude Code, Codex
brooks-lintskillmds/skillmdSkill1893d agoMITA26Claude Code
the-pragmatic-programmerciembor/agent-rules-booksSkill3.2k1mo agoMITA36Claude Code, Codex
improve-codebase-architectureseaworld008/Commonly-used-high-value-skillsSkill742d agoMITA22Claude Code, Codex
refactoring-workflowpersonamanagmentlayer/pclSkill4411d agoApache-2.0A83Claude Code
code-quality-reviewbahayonghang/my-ai-cli-toolkitSkill178d agoMITA149Claude Code