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/yugasun/aiops/file-refactornpx skills add yugasun/aiops --skill file-refactorgit clone --depth 1 https://github.com/yugasun/aiopsWrote 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/yugasun/aiops/file-refactor)<a href="https://agentmods.dev/skills/yugasun/aiops/file-refactor"><img src="https://agentmods.dev/badge/skills/yugasun/aiops/file-refactor.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.00056 | $0.00419 |
| Opus 5 | $0.00028 | $0.00210 |
| Sonnet 5 | $0.00011 | $0.00084 |
| Haiku 4.5 | $0.00006 | $0.00042 |
Grade A, and why
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 4d 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
File Refactor
Keep every source file under 500 lines. Split before it crosses the limit.
When to trigger
- A file exceeds 500 lines
- A module mixes types, utils, handlers, rendering, and constants
- A screen component contains inline sub-components that are extractable
- A service combines pure helpers, dataclasses, and orchestration in one file
TypeScript / React splitting order
- Types — interfaces, type aliases, enums →
types.ts - Pure utilities — formatting, grouping, transforms →
utils.ts - Complex state logic →
hooks/useXxx.ts - Sub-components — UI pieces →
components/XxxYyy.tsx - Constants / config — hardcoded arrays, config objects →
constants.ts
Python splitting order
- Data models —
@dataclass,TypedDict,Protocol→models.py - Pure helpers — side-effect-free formatting/parsing →
utils.pyor*_format.py - Orchestration — original file stays as coordinator (CLI entry, service facade)
- CLI groups — subcommand handlers → dedicated modules
- Constants — templates, frozensets →
constants.py
Rules
- Single responsibility — each file does one thing
- Cohesion — related code stays together
- Preserve exports — never break existing imports; re-export from original file if needed
- Mirror neighbors — follow existing package layout; don't invent new patterns
- After splitting: typecheck + lint must pass
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.
- 4d ago First seen · 43 lines · 56 tokens per session scan A 8eda92f7f365
file-refactor is a skill published in the GitHub repository yugasun/aiops (4 stars, last pushed 15d ago), licensed Apache-2.0. It adds 56 tokens to every session and 419 once invoked, about $0.0003 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
hashiiiii-images
Use this skill to create project images, especially flat geometric images with a dark background and one accent color.
hashiiiii-pull-request
Use this skill to create or edit a GitHub pull request with the repository template or the default structure.
hashiiiii-issues
Use this skill to create or edit GitHub issues with a consistent body structure.
hashiiiii-git
Use this skill to name a Git branch or write a commit message.
hashiiiii-locale
Use this skill to set or change locale preferences for a user, project, or local Git worktree.
make_plan
For external plan request scenarios, guides the Agent to request a clear, actionable, step-by-step plan from a stronger Agent via listagents and chatwithagent, emphasizing that the plan is executed by the requester, not by the consulted Agent.