codex-skills-library: Skill for Codex

.agents/skills/refactor-large-file/SKILL.md

refactor-large-file is a skill for Codex from YankielDBC2/codex-skills-library. It costs 34 tokens per session (411 once invoked), scanned A, original, MIT.

A process for safely splitting an oversized code file into smaller modules with clearer responsibilities. A module is a separate piece of code that handles one related area of work.

In plain words
What is it for?
Use it when a file is too large, mixes responsibilities, repeats logic, or is difficult to maintain.
Why use it?
It reduces complexity and makes code easier to test and change without altering its public behavior.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: installed under .agents/ (shared by several agents).

This is YankielDBC2/codex-skills-library's own configuration. It tells Codex how to work on codex-skills-library itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything codex-skills-library configures →

Reuse

Borrowing it

Nothing to install: this file belongs to YankielDBC2/codex-skills-library. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/YankielDBC2/codex-skills-library/main/.agents/skills/refactor-large-file/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/YankielDBC2/codex-skills-library

Made for: Codex.

Wrote 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.

agentmods badge for refactor-large-file

README.md
[![agentmods](https://agentmods.dev/badge/skills/yankieldbc2/codex-skills-library/refactor-large-file/github.svg)](https://agentmods.dev/skills/yankieldbc2/codex-skills-library/refactor-large-file)
Your own site
<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/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.

agentmods 80×15 button for refactor-large-file

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 411 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00034 $0.00411
Opus 5.5 $0.00014 $0.00164
Sonnet 5.5 $0.00007 $0.00082
Haiku 4.5 $0.00003 $0.00041

Measured 2mo ago against content hash 7c60ffbe952e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 2mo 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.

.agents/skills/refactor-large-file/SKILL.md · 51 lines

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

  1. Identify existing responsibilities inside the file and note the current line count.
  2. Mark public API boundaries that must not change.
  3. 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.
  4. Extract cohesive units, not random line ranges.
  5. Move related tests near the new owner when practical.
  6. Preserve imports and behavior incrementally.
  7. Run tests after each meaningful extraction.
  8. If the refactor stalls, compare against the checkpoint before changing strategy.
  9. Delete dead code once references are removed.
  10. 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.

Files

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.

Changes

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.

  1. 2mo ago First seen · 51 lines · 34 tokens per session scan A 7c60ffbe952e

Subscribe to this mod's changes

refactor-large-file is a skill published in the GitHub repository YankielDBC2/codex-skills-library (13 stars, last pushed 3mo ago), licensed MIT. It adds 34 tokens to every session and 411 once invoked, about $0.0001 per session on Opus 5.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.

Related

refactor-large-file compared with skills from other repositories

refactor-large-file next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refactor-large-fileYankielDBC2/codex-skills-librarySkill133mo agoMITA34Codex
arch-optimizebfxh/arch-optimizeSkill512d agoMITA114Claude Code
iacadonai-labs/agent-runwaySkill22d agoMITA120Claude Code, Codex
Data Flow & State Ownerships977043/river-reviewSkill7yesterdayMITA29Claude Code
knossosAraneaDev/Knossos-MCPSkill21mo agoMITA78Claude Code
invest-repo-auditerikaflowers/investitureSkill5525d agononeA55Claude Code
invest-verify-remediationerikaflowers/investitureSkill5525d agononeA50Claude Code