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.svg" alt="Measured on agentmods" 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 | $0.00019 | $0.01958 |
| Sonnet 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 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/ 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.
- 3d 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 (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.
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.
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…
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.
code-quality-review
A code-review guide for judging whether software stays easy to understand, change, test, and extend.
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…
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"…