kalilurrahman/kr-claudiator-skills/code-splitting
Claude Code and agent skill by kalilurrahman/kr-claudiator-skills
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Implement code splitting to reduce initial bundle size and improve web application load time. Outputs splitting strategy, lazy loading patterns, preloading rules, and performance measurement approach.
Install
npx vskill@latest install kalilurrahman/kr-claudiator-skills/code-splittingSKILL.md
Code Splitting
Code splitting breaks a large JavaScript bundle into smaller chunks loaded on demand. Instead of loading everything at startup, the browser loads only what's needed for the current view. The result is faster initial load, better Time to Interactive (TTI), and lower data usage.
Process
- Measure first. Analyse the current bundle with webpack-bundle-analyzer or similar. Find the biggest chunks.
- Split at route boundaries. Each route loaded lazily is the highest-impact split.
- Split large third-party libraries. Chart libraries, date pickers, editors — load only when used.
- Add preloading for likely next routes.
<link rel="prefetch">or React.lazy with prefetch. - Set performance budgets. Max bundle size per chunk. Fail CI if budgets are exceeded.
- Measure improvement. Before/after Lighthouse scores, Core Web Vitals.
React Route-Based Splitting
Vite / Webpack Bundle Analysis
Dynamic Imports for Heavy Libraries
Performance Budget (CI Gate)
Anti-Patterns to Avoid
| Anti-Pattern | Problem | Fix | |
|---|---|---|---|
| Splitting every component | Too many small chunks; HTTP overhead | Split at route or feature boundaries | |
| No Suspense boundary | Lazy component errors crash the app | Wrap every lazy component in Suspense | |
| Loading without preloading | Users wait on navigation | Preload on hover/focus for predictable next routes | |
| Splitting without measuring | Random splits may not help | Analyse bundle first; split biggest chunks | |
| No loading states | Layout shift when chunk loads | Skeleton screens or spinners for lazy sections |
10 Rules
- Measure before splitting — bundle analyser reveals actual bottlenecks.
- Route-based splitting is the highest-impact first step.
- Heavy third-party libraries (charts, editors, date pickers) are split separately.
- Every
React.lazy()has a<Suspense>boundary with a loading fallback. - Preload likely next routes on hover — eliminates perceived loading delay.
- Set performance budgets and enforce them in CI — chunks grow without gates.
- Prefer named exports from split chunks — tree-shaking works better.
- Prefetch on network idle for routes users haven't visited but likely will.
- Test on throttled connections — 3G simulation reveals real-world impact.
- Core Web Vitals (LCP, TTI) are the outcome metrics — bundle size is a proxy.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking01-software-dev/code-splitting/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kalilurrahman/kr-claudiator-skills/code-splitting)