optimize_codebase
Skill3 starsChanged 2 months agoMITView on GitHub
Identifies and refactors monolithic files (>2k lines) into modular, performance-safe component structures.
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- krishnakanthb13/antigravity_global_skillsedited, first seen Jul 4, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- krishnakanthb13/antigravity_global_skills★ 50100% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository46 other files it gives its agents.
- agy-customizationsSkill
- antigravity-guideSkill
- api-and-interface-designSkill
- browser-testing-with-devtoolsSkill
- ci-cd-and-automationSkill
- code-review-and-qualitySkill
- code_reviewSkill
- code-simplificationSkill
- context-engineeringSkill
- create_launcherSkill
- create_skillSkill
- daily_logSkill
- debugging-and-error-recoverySkill
- debug_issueSkill
- deprecation-and-migrationSkill
- document_apiSkill
- documentation-and-adrsSkill
- enhance_uiSkill
- frontend_designSkill
- frontend-ui-engineeringSkill
- generate_release_imageSkill
- git-workflow-and-versioningSkill
- idea-refineSkill
- idea_to_actionSkill
- impeccableSkill
- incremental-implementationSkill
- list_featuresSkill
- open_source_prepSkill
- performance-optimizationSkill
- permissioned-githubSkill
- planning-and-task-breakdownSkill
- release_helperSkill
- repo_infographicSkill
- scaffold_testsSkill
- security-and-hardeningSkill
- security_auditSkill
- shipping-and-launchSkill
- software_architectureSkill
- spec-driven-developmentSkill
- test-driven-developmentSkill
- test_runnerSkill
- ui_ux_pro_maxSkill
- update_docsSkill
- using-agent-skillsSkill
- using-ui-stackSkill
- web_performance_optimizationSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 7 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill to clean up technical debt by checking for massive source files and logically breaking them down.
- Very specific: line 17
Use list_dir to see file sizes.
- Very specific: line 18
Use view_file_outline to understand structure before splitting.
- Very specific: line 19
Use write_to_file to create new modular files.
- Distinctive: line 29
Architecture Debt: Look for missing abstractions, circular dependencies, and feature envy.
- Distinctive: line 30
Testing Debt: Check for untested critical paths or brittle, environment-dependent tests.
- Distinctive: line 35
Before touching any code, propose a strategy:
- Very specific: line 37
Target Folder: Create a new directory named after the monolithic file (e.g., app.js -> app/).
- Very specific: line 44
Entry Point: Create an index file (or keep the original filename as a shell) that imports and aggregates the new modules, preserving the …
- Distinctive: line 49
Integrity: Ensure all imports are resolved.
- Distinctive: line 50
Functionality: Run existing tests or walk through the critical path to ensure nothing broke.
- Distinctive: line 51
Performance: verify that splitting the file didn't introduce significant load overhead (e.g., excessive network requests in a web context …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Optimize Code Base
Use this skill to clean up technical debt by checking for massive source files and logically breaking them down.
Inputs
- Scope: The directory to scan.
- Threshold: Line count limit (Default: 2000).
Tooling Strategy
- Use
list_dirto see file sizes. - Use
view_file_outlineto understand structure before splitting. - Use
write_to_fileto create new modular files.
Workflow
1. Analysis (The "Weigh-in")
- Scan: Identify files in the relevant scope (HTML, Python, JS, etc.) that exceed 2,000 lines.
- Assess: correct functionality is paramount. Does this file need to be this big (e.g., a generated asset), or is it just technical debt?
- Comprehensive Tech Debt Scan:
- Code Debt: Identify duplicated code (copy-paste), high cyclomatic complexity (>10), deeply nested conditionals (>3 levels), and long methods (>50 lines).
- Architecture Debt: Look for missing abstractions, circular dependencies, and feature envy.
- Testing Debt: Check for untested critical paths or brittle, environment-dependent tests.
- Impact Assessment: Quantify the cost (e.g., "Developer velocity is impacted by changing this logic in 5 places").
2. The Refactoring Plan
Before touching any code, propose a strategy:
- Target Folder: Create a new directory named after the monolithic file (e.g.,
app.js->app/). - Modules: Identify distinct logical blocks (classes, helper functions, distinct UI sections) that can be extracted.
- Dependencies: Map out how these new modules will import/export to each other to avoid circular dependencies.
3. Execution (The "Split")
- Create Modules: Move code into smaller, purpose-built files.
- Entry Point: Create an
indexfile (or keep the original filename as a shell) that imports and aggregates the new modules, preserving the original external API. - Constraint: Do not change the logic. This is a refactor, not a rewrite.
4. Verification
- Integrity: Ensure all imports are resolved.
- Functionality: Run existing tests or walk through the critical path to ensure nothing broke.
- Performance: verify that splitting the file didn't introduce significant load overhead (e.g., excessive network requests in a web context without bundling).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

