mcpField
B
bundle-size-optimization

bundle-size-optimization

github.com/aj-geddesDevelopment373563 installsUpdated 34w ago
Repository

About bundle-size-optimization

A development skill for analyzing and reducing JavaScript bundle size, aimed at build and performance optimization. It includes reference guides for analysis, optimization techniques, and implementation strategy.

Key features

  1. 01Bundle composition analysis
  2. 02Bundle optimization techniques
  3. 03Implementation strategy guidance
  4. 04Pre-deployment analysis guidance

Use cases

  1. 01Reviewing bundle size before deployment
  2. 02Improving mobile performance
  3. 03Assessing the impact of new dependencies

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill bundle-size-optimization

After installing, type/bundle-size-optimizationin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
best-practices.md
bundle-analysis.md
implementation-strategy.md
optimization-techniques.md
templates/
component-template.tsx

Details

From the project README

Bundle Size Optimization

Table of Contents

Overview

Smaller bundles download faster, parse faster, and execute faster, dramatically improving perceived performance especially on slower networks.

When to Use

  • Build process optimization
  • Bundle analysis before deployment
  • Performance baseline improvement
  • Mobile performance focus
  • After adding new dependencies

Quick Start

Minimal working example:

// Analyze bundle composition

class BundleAnalysis {
  analyzeBundle() {
    return {
      tools: [
        "webpack-bundle-analyzer",
        "Source Map Explorer",
        "Bundle Buddy",
        "Bundlephobia",
      ],
      metrics: {
        total_size: "850KB gzipped",
        main_js: "450KB",
        main_css: "120KB",
        vendor: "250KB",
        largest_lib: "moment.js (67KB)",
      },
      breakdown: {
        react: "85KB (10%)",
        lodash: "45KB (5%)",
        moment: "67KB (8%)",
        other: "653KB (77%)",
      },
    };
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Bundle AnalysisBundle Analysis
Optimization TechniquesOptimization Techniques
Implementation StrategyImplementation Strategy
Best PracticesBest Practices

Best Practices

✅ DO
  • Follow established patterns and conventions
  • Write clean, maintainable code
  • Add appropriate documentation
  • Test thoroughly before deploying
❌ DON'T
  • Skip testing or validation
  • Ignore error handling
  • Hard-code configuration values

Comments

Markdown supported