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-structure-auditgit 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-structure-audit)<a href="https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/codebase-structure-audit"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/codebase-structure-audit/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-structure-audit"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/codebase-structure-audit.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.00030 | $0.02904 |
| Opus 5.5 | $0.00012 | $0.01162 |
| Sonnet 5.5 | $0.00006 | $0.00581 |
| Haiku 4.5 | $0.00003 | $0.00290 |
Grade A, and why
codebase-structure-audit 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 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
| **Low** | Additive only, no deletion of active code | Adding CSS @import, new route | Dev server + curl | How it starts
The opening of the file, as written. The whole thing — 263 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Codebase Structure Audit & Safe Refactoring
Systematic approach to understanding a project's dependency graph and making safe, incremental changes. Designed for the "안전한 것부터 하나씩" workflow.
When to Use
- Before refactoring a codebase you're unfamiliar with
- When asked to "구조 파악" or map file dependencies
- Before deleting files you suspect are dead code
- When consolidating duplicate resources (CSS, data files, templates)
- When planning incremental refactoring with live verification
Do NOT use for: greenfield architecture, performance profiling, or dependency upgrades.
Step 1 — Map the Dependency Graph
File Discovery
find . -type f \( -name '*.ts' -o -name '*.js' -o -name '*.css' -o -name '*.html' \) \
-not -path './node_modules/*' -not -path './dist/*' -not -path './.wrangler/*' | sort
Import/Reference Tracing
# TypeScript/JS imports
grep -rn "import " --include='*.ts' --include='*.js' \
--exclude-dir=node_modules --exclude-dir=dist . | sort
# CSS @import chain
grep -rn "@import" --include='*.css' --exclude-dir=node_modules . | sort
# HTML script/style references
grep -rn 'src=\|href=' --include='*.html' --exclude-dir=node_modules . | sort
Component Isolation Check
For each suspected subsystem, verify whether it shares a common CSS/JS entry point or maintains its own:
for html in $(find public -name '*.html' -not -path '*/node_modules/*'); do
echo "=== $(basename $html) ==="
grep -o 'href="[^"]*\.css[^"]*"' "$html" | sed 's/href="//;s/"//'
done
Step 2 — Dead Code Detection
File-Level Reference Check
Never delete a file before confirming zero references:
grep -rn "target-filename\|TargetModule" --include='*.{ts,js,html}' \
--exclude-dir=node_modules . | grep -v "target-file.js"
# For CSS: check HTML href references
grep -rn "target.css" --include='*.html' --exclude-dir=node_modules .
Dead Code Categories
| Signal | Likelihood | Confidence |
|---|---|---|
import from broken path (e.g. ../public/js/ doesn't exist) |
100% dead | Certain |
File exports but zero import from other files across project |
>95% dead | High |
Config key defined but zero grep hits for the key name |
>95% dead | High |
CSS file not in any @import chain nor directly linked from HTML |
100% dead | Certain |
What ships with it
2 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.
- 3mo ago First seen · 263 lines · 30 tokens per session scan A df8f2dd21126
codebase-structure-audit is a skill published in the GitHub repository humanerd-drew/opencode-drewgent (3 stars, last pushed 4mo ago), licensed MIT. It adds 30 tokens to every session and 2,904 once invoked, about $0.0001 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-structure-audit compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| codebase-structure-audithumanerd-drew/opencode-drewgent | Skill | 3 | 4mo ago | MIT | A | 30 | 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 |
| 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 |
| refactoring-guruciembor/agent-rules-books | Skill | 3.4k | 2mo ago | MIT | A | 29 | Claude Code, Codex |