large-file-refactor

large-file-refactor is a skill for Claude Code, Codex from JunMystery/Agent-Guidance-Python. It costs 48 tokens per session (1,123 once invoked), scanned A, original, MIT.

A workflow for splitting large or mixed-purpose source files into smaller parts organized by responsibility, such as components, services, or helpers.

In plain words
What is it for?
Use it to refactor large files, break up monolithic modules, extract React hooks or subcomponents, and separate validation, storage, and notification logic.
Why use it?
It makes code easier to understand and change when one file contains unrelated jobs, without splitting cohesive code just to meet a line-count target.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to refactor large files, break up monolithic modules, extract React hooks or subcomponents, and separate validation, storage, and notification logic.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/junmystery/agent-guidance-python/large-file-refactor
Install

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.

Any agent
npx skills add JunMystery/Agent-Guidance-Python --skill large-file-refactor
Clone the repo
git clone --depth 1 https://github.com/JunMystery/Agent-Guidance-Python

Made for: Claude Code, 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 large-file-refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/junmystery/agent-guidance-python/large-file-refactor/github.svg)](https://agentmods.dev/skills/junmystery/agent-guidance-python/large-file-refactor)
Your own site
<a href="https://agentmods.dev/skills/junmystery/agent-guidance-python/large-file-refactor"><img src="https://agentmods.dev/badge/skills/junmystery/agent-guidance-python/large-file-refactor/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 large-file-refactor

Your own site · 80×15
<a href="https://agentmods.dev/skills/junmystery/agent-guidance-python/large-file-refactor"><img src="https://agentmods.dev/badge/skills/junmystery/agent-guidance-python/large-file-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,123 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.00048 $0.01123
Opus 5.5 $0.00019 $0.00449
Sonnet 5.5 $0.00010 $0.00225
Haiku 4.5 $0.00005 $0.00112

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

Security

Grade A, and why

large-file-refactor 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.

skills/large-file-refactor/SKILL.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Large-File Refactor

Use this skill when a task asks to split a large file, reduce a monolithic module, extract services/controllers/helpers, or bring files closer to the 300 LOC guideline.

Core Rule

Split by responsibility, not by line count alone.

Do not cut a file into arbitrary chunks just to satisfy a numeric target. A 320-line cohesive algorithm may be better left intact, while a 260-line file with unrelated validation, persistence, and notification logic may deserve extraction.

Audit Scope

Audit only project-owned source files and project documentation, or a specific file path the user explicitly provided.

When discovering candidate files yourself, use git ls-files or an equivalent tracked-file list as the source of truth. Do not use a raw filesystem walk as the primary source unless repository ignore rules and the exclusions below have already been applied.

Always exclude:

  • .git/, .venv/, venv/, env/, .vscode/, .idea/
  • node_modules/, __pycache__/, .pytest_cache/, .cache/
  • build/, dist/, htmlcov/, coverage reports, and test artifacts
  • generated files, vendored files, externally synchronized files, and binary/media files

If the user provides a specific path, audit that path only. If the path is ignored, vendored, generated, or outside normal project scope, warn about that status and continue only when the user clearly requested that exact file.

For broad requests such as "AI Audit large-file-refactor violations", report only in-scope project candidates. Do not list excluded environment, editor, cache, build, vendor, generated, or binary/media files as violations.

Decision Thresholds

  • <300 LOC: keep the file unless it clearly mixes unrelated responsibilities.
  • 300-500 LOC: recommend splitting only when the file has more than one durable responsibility.
  • >500 LOC: perform an explicit split analysis before implementation.

Count meaningful code first. Ignore blank lines and comments when judging whether the file is truly large.

Read the full file on GitHub · 102 lines

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 · 102 lines · 48 tokens per session scan A 7de6cd910a89

Subscribe to this mod's changes

large-file-refactor is a skill published in the GitHub repository JunMystery/Agent-Guidance-Python (2 stars, last pushed 14d ago), licensed MIT. It adds 48 tokens to every session and 1,123 once invoked, about $0.0002 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-09-03.

Related

large-file-refactor compared with skills from other repositories

large-file-refactor next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
large-file-refactorJunMystery/Agent-Guidance-PythonSkill214d agoMITA48Claude Code, Codex
skill-benchmarkHoangNguyen0403/agent-skills-standardSkill5972d agoMITA16Codex
airdrop-hunting-guidenirholas/three.wsSkill2872d agoApache-2.0A54Claude Code, Codex
ue-mcp-epic-routingdb-lyon/ue-mcpSkill526todayMITA81Claude Code, Codex
common-observabilityHoangNguyen0403/agent-skills-standardSkill5972d agoMITA46Claude Code, Codex
authoring-decoratorssynaptiai/prompt-decoratorsSkill441mo agoApache-2.0A72Claude Code
orchardcore-search-indexingCrestApps/CrestApps.AgentSkillsSkill148d agoMITA182Claude Code