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 agentmods add skills/yankieldbc2/codex-skills-library/refactor-large-filenpx skills add YankielDBC2/codex-skills-library --skill refactor-large-filegit clone --depth 1 https://github.com/YankielDBC2/codex-skills-libraryWrote 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/yankieldbc2/codex-skills-library/refactor-large-file)<a href="https://agentmods.dev/skills/yankieldbc2/codex-skills-library/refactor-large-file"><img src="https://agentmods.dev/badge/skills/yankieldbc2/codex-skills-library/refactor-large-file.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 | $0.00034 | $0.00411 |
| Opus 5 | $0.00017 | $0.00205 |
| Sonnet 5 | $0.00007 | $0.00082 |
| Haiku 4.5 | $0.00003 | $0.00041 |
Grade A, and why
refactor-large-file scanned grade A with 0 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 5d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Refactor Large File
Goal
Reduce complexity safely without changing public behavior or letting code files grow past 400 lines.
When to use
Use when a file is too large, mixes responsibilities, contains duplicated logic, exceeds 400 lines, or is difficult to test.
When not to use
Do not use for greenfield features unless the feature requires extracting existing behavior first.
Inputs
Inspect the large file, direct imports/exports, tests, public interfaces, and nearby modules with similar patterns.
Workflow
- Identify existing responsibilities inside the file and note the current line count.
- Mark public API boundaries that must not change.
- If the file is at or above 400 lines, create a checkpoint before editing: copy the file to a backup path or save a patch diff that can be compared or restored later.
- Extract cohesive units, not random line ranges.
- Move related tests near the new owner when practical.
- Preserve imports and behavior incrementally.
- Run tests after each meaningful extraction.
- If the refactor stalls, compare against the checkpoint before changing strategy.
- Delete dead code once references are removed.
- Document important ownership changes.
Extraction targets
Prefer named modules such as invoiceTotals, userPermissions, orderStatusPolicy, or useGalleryFilters instead of generic utils files.
Validation
Run tests for affected behavior after each meaningful extraction, then the repo's size validation and any typecheck, lint, or build checks if exports changed. If the file started over 400 lines, compare behavior against the checkpoint before declaring the refactor done.
Final response
Report extracted responsibilities, changed files, validation commands, and compatibility risks.
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.
- 5d ago First seen · 51 lines · 34 tokens per session scan A 7c60ffbe952e
refactor-large-file is a skill published in the GitHub repository YankielDBC2/codex-skills-library (10 stars, last pushed 1mo ago), licensed MIT. It adds 34 tokens to every session and 411 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
sparc-methodology
SPARC (Specification, Pseudocode, Architecture, Refinement, Completion) comprehensive development methodology with multi-agent orchestration.
code-to-diagram
Analyze codebases and automatically generate architecture diagrams, flowcharts, and org charts. Uses AST parsing to map import dependencies for Python, JS/TS, Go, and Java, outputting Mermaid or SVG files. Triggered when users ask to visualize code architecture, understand dependencies, draw a flowchart, or create a…
architecture-diagram
Dark-themed SVG architecture/cloud/infra diagrams as HTML.
studio
Architecture Studio control plane — initialize or inspect a studio workspace, create and register projects, or route an architecture/AEC task to the right agent or skill. Use when the user runs /as:studio, asks to set up or open their studio, manage its projects, or describes a task without naming a skill.
csv-to-sif
Export a project's FF&E product-library CSV as dealer-system SIF. Use to produce a .sif schedule; use sif-to-csv for the reverse direction.
modular-skills
Build composable skill modules with hub-and-spoke loading. Use when token budget is tight.