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.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.00030 | $0.02904 |
| Opus 5 | $0.00015 | $0.01452 |
| Sonnet 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 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.
| **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.
- 3d 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 (2 stars, last pushed 1mo ago), licensed MIT. It adds 30 tokens to every session and 2,904 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
code-agent
General-purpose coding agent that reads, writes, and edits code, and searches codebases.
dead-code-cleanup
Use when the user asks about cleanup, removing unused code, refactoring, reducing bundle size, or identifying dead code in a Repowise-indexed codebase (.repowise/ directory exists). Also activates when discussing technical debt, code hygiene, or repository maintenance.
ast-grep
Write, debug, and validate ast-grep structural code search rules. Use for syntax-aware code search, AST pattern matching, structural refactor discovery, or searches plain text tools like rg can miss — functions with particular descendants, calls inside specific contexts, decorators, or other Tree-sitter-backed…
tldr-code
Token-efficient code analysis via 5-layer stack (AST, Call Graph, CFG, DFG, PDG). 95% token savings.
scip-system-compression
Compress systems with scip-query evidence. Use to zoom out, simplify architecture, eliminate layers, consolidate commands, scripts, or helpers, find the deeper role behind unlike-looking code, build a compression atlas before a large cleanup, or execute an ordered simplification without rework.
scip-integrity-audit
Audit whether implementations are real with scip-query. Use for suspected faked or half-implemented features, decorative checkers or verifiers that never fail, dead code paths hidden behind graceful fallbacks, metrics that may be lying, or a "does any of this actually work" interrogation of a system.