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.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.svg" alt="Measured on agentmods" 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 $0.00019 $0.01958
Sonnet 5 $0.00008 $0.00783
Haiku 4.5 $0.00004 $0.00392

Measured 3d ago against content hash efa0ed6f43f4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-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 3d 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. 3d 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 (2 stars, last pushed 1mo ago), licensed MIT. It adds 38 tokens to every session and 3,915 once invoked, about $0.0002 per session on Opus 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

Other skills, from other repositories

rubber-duck-plus

Ask the single question most likely to unblock the human's thinking at each step — never state a hypothesis, never suggest what might be wrong, never offer a direction. The human talks; the AI asks; the human finds the path.

mohitmishra786/anti-vibe-skills · 87 tokens

refactoring-workflow

Improve the structure of existing code without changing its behaviour, in small verified steps under a green test suite. Use when the user asks to refactor, clean up, restructure or simplify code, wants to reduce duplication or coupling, is preparing a codebase for a feature it cannot currently accommodate, or when…

personamanagmentlayer/pcl · 83 tokens

mandu-mcp-orient

A session-start workflow for quickly understanding a software project’s current state. It gathers the project summary, recent commits, documentation list, architecture rules, errors, and suggested next steps.

konamgil/mandu · 72 tokens

code-quality-review

A code-review guide for judging whether software stays easy to understand, change, test, and extend.

bahayonghang/my-ai-cli-toolkit · 149 tokens

github-actions-workflow

Scaffolds or audits a GitHub Actions CI/CD workflow for a project. Covers job structure, caching, secrets handling, concurrency groups, environment gates, and reusable workflows via workflowcall. Invoked when the user asks to set up CI, add a GitHub Actions workflow, improve pipeline performance, or share workflow…

soulcodex/agentic · 72 tokens

persist-plan

Persists the current or completed plan as a structured Markdown file under .agentic/plans/ with a datestamped, slugged filename and registers it in the plans index. Enables multi-agent setups to discover past architectural decisions and plans without re-deriving context. Invoked when the user says "save this plan"…

soulcodex/agentic · 92 tokens