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.
npx skills add humanerd-drew/opencode-drewgent --skill codebase-consolidationgit clone --depth 1 https://github.com/humanerd-drew/opencode-drewgentWrote 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.
[](https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/codebase-consolidation)<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.
<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>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.
| Model | Per session | Once 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 |
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/ 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
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.
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.
- 2mo ago First seen · 306 lines · 38 tokens per session scan A efa0ed6f43f4
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.
codebase-consolidation compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| codebase-consolidationhumanerd-drew/opencode-drewgent | Skill | 3 | 3mo ago | MIT | A | 38 | Claude Code, Codex |
| rubber-duck-plusmohitmishra786/anti-vibe-skills | Skill | 8 | 8mo ago | MIT | A | 87 | Claude Code, Codex |
| brooks-lintskillmds/skillmd | Skill | 189 | 3d ago | MIT | A | 26 | Claude Code |
| the-pragmatic-programmerciembor/agent-rules-books | Skill | 3.2k | 1mo ago | MIT | A | 36 | Claude Code, Codex |
| improve-codebase-architectureseaworld008/Commonly-used-high-value-skills | Skill | 74 | 2d ago | MIT | A | 22 | Claude Code, Codex |
| refactoring-workflowpersonamanagmentlayer/pcl | Skill | 44 | 11d ago | Apache-2.0 | A | 83 | Claude Code |
| code-quality-reviewbahayonghang/my-ai-cli-toolkit | Skill | 17 | 8d ago | MIT | A | 149 | Claude Code |