Borrowing it
Nothing to install: this file belongs to rajbos/ai-engineering-fluency. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/rajbos/ai-engineering-fluency/main/.claude/skills/refactor-large-function/SKILL.mdgit clone --depth 1 https://github.com/rajbos/ai-engineering-fluencyWrote 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/rajbos/ai-engineering-fluency/refactor-large-function)<a href="https://agentmods.dev/skills/rajbos/ai-engineering-fluency/refactor-large-function"><img src="https://agentmods.dev/badge/skills/rajbos/ai-engineering-fluency/refactor-large-function/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.
<a href="https://agentmods.dev/skills/rajbos/ai-engineering-fluency/refactor-large-function"><img src="https://agentmods.dev/badge/skills/rajbos/ai-engineering-fluency/refactor-large-function.svg" alt="Reviewed on agentmods" width="80" 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.01150 |
| Opus 5.5 | $0.00012 | $0.00460 |
| Sonnet 5.5 | $0.00006 | $0.00230 |
| Haiku 4.5 | $0.00003 | $0.00115 |
Grade A, and why
refactor-large-function 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactor Large Function
An ESLint complexity or max-lines-per-function rule is producing warnings for functions that are too long. Pick one of those functions (not from extension.ts, which is intentionally monolithic) and refactor it into smaller, focused private helpers.
Step 1 - Identify the target
Run ESLint with the complexity rules to get the current list of violations:
cd vscode-extension && node_modules/.bin/eslint src --rule '{"max-lines-per-function": ["warn", 80]}' --format stylish 2>&1 | grep "Lines/Fn\|max-lines-per-function" | head -20
Or, if the project already has the rule configured, just run:
cd vscode-extension && node_modules/.bin/eslint src 2>&1 | grep "max-lines-per-function\|Lines/Fn" | head -20
Choose one function to refactor, following these priorities:
- Skip
src/extension.ts- it is intentionally large and hard to test in isolation. - Prefer files that already have unit tests (check
test/unit/for a matching test file). - Among the remaining candidates, pick the one with the clearest logical sections (wizard steps, processing phases, format branches, etc.) - those decompose most cleanly.
Step 2 - Read the instructions file
Before touching any code, read the relevant sub-project instructions file. For vscode-extension/ work, read .github/instructions/vscode-extension.instructions.md.
Step 3 - Understand the function
Read the full function body and identify natural decomposition boundaries:
- Wizard / multi-step UI flows: each step becomes a private method returning
nullon cancellation. - Format dispatch (e.g. JSONL vs JSON vs delta): each format branch becomes its own function.
- Multi-phase processing: setup / main loop / finalization each become their own function.
- Complex sub-operations inside a branch that push complexity above the threshold: extract them too.
Introduce small result interfaces or types at the top of the file (not exported) to carry data between steps cleanly, rather than long parameter lists.
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.
- yesterday First seen · 116 lines · 30 tokens per session scan A 936cde47af26
refactor-large-function is a skill published in the GitHub repository rajbos/ai-engineering-fluency (119 stars, last pushed yesterday), licensed MIT. It adds 30 tokens to every session and 1,150 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-10-26.
Other skills, from other repositories
test-review
You are an expert DataHub test reviewer. Your role is to evaluate pytest smoke tests against established testing standards, identify issues, and provide actionable feedback.
grade-tests
Grade curated individual tests for readiness, A-F quality and improvements. ALWAYS USE FOR: grade tests, review only a named test, per-test readiness or quality bands for supplied methods, bodies, file spans or bounded PR diffs, including existing tests. Return Pass/Failed/Uncertain/Not applicable; unresolved/empty…
go-testing
Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.
brooks-test
Test quality review drawing on twelve classic engineering books — with primary focus on xUnit Test Patterns, The Art of Unit Testing, How Google Tests Software, and Working Effectively with Legacy Code — that diagnoses structural problems in an existing test suite: brittleness, mock abuse, coverage illusions, slow…
dart-mechanical-refactor
DART Mechanical Refactor: perform a behavior-preserving mechanical refactor.
quality-checklist
Validate implementation quality through custom checklists, scoring against constitution standards, specification coverage, and producing remediation recommendations.