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-refactoringgit 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-refactoring)<a href="https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/codebase-refactoring"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/codebase-refactoring/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-refactoring"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/codebase-refactoring.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.00044 | $0.05538 |
| Opus 5.5 | $0.00018 | $0.02215 |
| Sonnet 5.5 | $0.00009 | $0.01108 |
| Haiku 4.5 | $0.00004 | $0.00554 |
Grade C, and why
codebase-refactoring scanned grade C with 2 findings 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 3mo 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
| Dedicated directory | `rm -rf` entire dir | `terminal` | 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_code}" "http://localhost:PORT/path/to/deleted/file" How it starts
The opening of the file, as written. The whole thing — 320 lines — stays where its author put it; the contents beside it link to each section on GitHub.
코드베이스 안전 리팩토링
Systematic, safe refactoring — not big-bang rewrites. One change at a time, verified between each step.
Core Principles
- Map before you cut. Never delete or move code without tracing its import/reference graph first.
- Smallest safe step first. Dead config removal → orphan file deletion → data consolidation → structural change. Each step must be independently reversible.
- Verify between each change. With a running dev server, confirm HTTP 200 before the next edit.
- Master data pattern. When the same data exists in 2+ places (frontend constants, backend arrays, separate workers), extract to a JSON file and have every consumer import it. JSON is universally readable by JS and TS.
- No "while I'm here" expansions. One class of change per session.
Step-by-step Workflow
Phase 1 — Discovery
# 1. Map all files under the project root (exclude node_modules, build artifacts)
find . -type f -name '*.ts' -o -name '*.js' -o -name '*.html' -o -name '*.css' -o -name '*.sql' | grep -v node_modules | sort
# 2. Map all import/reference edges
grep -rn "^import\|from.*['\"]" --include='*.ts' --include='*.js' . | grep -v node_modules | sort
# 3. Identify dead code by reference counting
# If a file/export has zero import references, it's a candidate for deletion
grep -rn "export const\|export function\|export class" --include='*.ts' . | grep -v node_modules
# Cross-reference each export against import statements in other files
Phase 2 — Dead Code Removal (Risk: 🟢 Zero)
Safe to delete when:
- No
importorrequirereferences from any other file - No
<script src="...">or<link href="...">from any HTML - Config keys that are defined but never read (grep for the read-side)
Verification command:
# After deletion, confirm 404 on deleted paths and 200 on everything else
curl -s -o /dev/null -w "%{http_code}" "http://localhost:PORT/path/to/deleted/file"
Phase 2.5 — Complete Feature Removal (Risk: 🟢 Low–🟡 Medium)
What ships with it
6 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.
- references/analysis-engine-injection.md 4.1 KB
- references/extraction-completeness-checklist.md 26 KB
- references/m-log-frontend-backend-integration-20260612.md 4.2 KB
- references/m-log-refactoring-session-20260611.md 2.7 KB
- references/m-log-v2-structure-20260613.md 2.8 KB
- references/svelte-mpa-setup.md 4.2 KB
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.
- 3mo ago First seen · 320 lines · 44 tokens per session scan C d7fd46376d21
codebase-refactoring is a skill published in the GitHub repository humanerd-drew/opencode-drewgent (3 stars, last pushed 4mo ago), licensed MIT. It adds 44 tokens to every session and 5,538 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
codebase-refactoring compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| codebase-refactoringhumanerd-drew/opencode-drewgent | Skill | 3 | 4mo ago | MIT | C | 44 | Claude Code, Codex |
| tldr-codeparcadei/Continuous-Claude-v3 | Skill | 4.0k | 18d ago | MIT | A | 33 | Claude Code |
| dead-codeparcadei/Continuous-Claude-v3 | Skill | 4.0k | 18d ago | MIT | A | 13 | Claude Code |
| health-checkludo-technologies/pyscn | Skill | 1.1k | 2d ago | MIT | A | 49 | Claude Code |
| brooks-verifyhyhmrright/brooks-lint | Skill | 1.6k | 2d ago | MIT | A | 145 | Claude Code |
| code-agentinitializ/forge | Skill | 223 | 14d ago | Apache-2.0 | A | 21 | Claude Code, Codex |
| dead-code-cleanuprepowise-dev/repowise | Skill | 8.5k | 2d ago | AGPL-3.0 | A | 12 | Claude Code |