Skip to content
Back to skills

Lazy Loader

ASecurity

Identify components that should be lazy loaded using AI. Use when optimizing bundle size and initial load.

  • 14 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 7, 2026
developmentjavascriptjavabashreactnextjsnoderefactoringgitapiperformance

Works with

  • api

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill lazy-loader --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lazy Loader?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lazy Loader
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-lazy-loader/badge)](https://www.skillsdirectory.com/skills/modbender-lazy-loader)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: lazy-loader
description: Identify components that should be lazy loaded using AI. Use when optimizing bundle size and initial load.
---

# Lazy Load Analyzer

Your bundle is huge and your initial load is slow. This tool finds components that should be dynamically imported and tells you exactly how to split them. Stop shipping the entire app on first load.

**One command. Zero config. Just works.**

## Quick Start

```bash
npx ai-lazy-load ./src
```

## What It Does

- Analyzes your component tree for lazy loading opportunities
- Identifies below-the-fold components that don't need immediate loading
- Finds route-based splits for Next.js and React Router
- Suggests React.lazy() implementations with Suspense boundaries
- Estimates bundle size impact for each suggestion

## Usage Examples

```bash
# Analyze all components
npx ai-lazy-load ./src/components

# Focus on pages/routes
npx ai-lazy-load ./src/pages --routes-only

# Show bundle impact estimates
npx ai-lazy-load ./src --with-sizes

# Generate ready-to-use code
npx ai-lazy-load ./src --generate-code

# Next.js specific analysis
npx ai-lazy-load ./src --framework next
```

## Best Practices

- **Don't lazy load everything** - Above-the-fold components should load immediately
- **Group related components** - Lazy load a feature module, not individual buttons
- **Add proper loading states** - Every Suspense boundary needs a fallback
- **Measure the difference** - Check your bundle analyzer before and after

## When to Use This

- Initial bundle size is over 200KB gzipped
- Lighthouse says "reduce unused JavaScript"
- Adding features and worried about bloat
- Refactoring an app to improve TTI

## Part of the LXGIC Dev Toolkit

This is one of 110+ free developer tools built by LXGIC Studios. No paywalls, no sign-ups, no API keys on free tiers. Just tools that work.

**Find more:**
- GitHub: https://github.com/LXGIC-Studios
- Twitter: https://x.com/lxgicstudios
- Substack: https://lxgicstudios.substack.com
- Website: https://lxgic.dev

## Requirements

No install needed. Just run with npx. Node.js 18+ recommended.

```bash
npx ai-lazy-load --help
```

## How It Works

The tool parses your component imports and builds a dependency graph. It identifies components that are conditionally rendered, below viewport, or behind user interactions. AI evaluates which splits give you the best performance gains with minimal complexity.

## License

MIT. Free forever. Use it however you want.

Files in this skill

  • README.md303 B
  • SKILL.md2.5 KB
  • package-lock.json47.5 KB
  • package.json628 B
  • src/cli.ts1004 B
  • src/index.ts1.3 KB
  • tsconfig.json212 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…