UI Production Builder

VerifiedSafe

Builds optimized production bundles for the trading platform UI with minification, code splitting, and chunk hashing. Supports staging builds, bundle analysis with visualizer, source maps, and a preview server. Helps ensure fast load times and stay within size budgets before deployment.

Sby Skills Guide Bot
DevelopmentIntermediate
806/2/2026
Claude Code
#ui-build#production-bundling#bundle-analysis#optimization

Recommended for

Our review

Builds an optimized production bundle for the trading platform UI, with integrated type checking and linting.

Strengths

  • Automates TypeScript validation and linting before the build.
  • Provides bundle analysis to identify large dependencies.
  • Enforces size budgets to ensure optimal performance.
  • Offers options for staging environments and preview.

Limitations

  • Specific to an existing build setup (npm, Vite/Rollup).
  • Does not handle build errors beyond pre-build checks.
  • Does not support other bundlers like Webpack without adaptation.
When to use it

When you need to generate a production-ready bundle for deployment with optimizations and size analysis.

When not to use it

For rapid development builds or if your project uses a non-standard build configuration.

Security analysis

Safe
Quality score90/100

This skill runs standard local build commands (npm run build, etc.) with no destructive or exfiltration actions. It does not involve network requests to external services or manipulation of sensitive data beyond what a typical build process entails.

No concerns found

Examples

Standard production build
/ui-build
Build with bundle analysis
/ui-build --analyze
Staging environment build
/ui-build --staging

name: ui-build description: Build production UI bundle with optimizations argument-hint: "[--staging|--analyze|--sourcemap]"

UI Production Builder

Build optimized production bundle for the trading platform UI.

Usage

  • /ui-build - Build for production
  • /ui-build --staging - Build for staging environment
  • /ui-build --analyze - Build with bundle analysis
  • /ui-build --sourcemap - Include source maps
  • /ui-build --preview - Build and start preview server

Build Outputs

services/ui/dist/
├── index.html
├── assets/
│   ├── index-[hash].js      # Main bundle
│   ├── index-[hash].css     # Styles
│   ├── vendor-[hash].js     # Vendor chunk
│   └── [chunk]-[hash].js    # Code-split chunks
└── favicon.ico

Instructions

When this skill is invoked:

  1. Parse arguments:

    • No args: npm run build (production)
    • --staging: npm run build:staging
    • --analyze: Add rollup-plugin-visualizer
    • --sourcemap: Enable source maps
    • --preview: Build then run preview
  2. Pre-build checks:

    • Run TypeScript check: npm run typecheck
    • Run linter: npm run lint
    • Check for environment variables
  3. Build:

    cd services/ui
    npm run build
    
  4. Display build results:

    UI Build Complete
    ═══════════════════════════════════════════════════════════
    
    Environment: production
    Build time:  12.4s
    
    Output: dist/
    ─────────────────────────────────────────────────────────
    index.html                    1.2 KB
    assets/index-a1b2c3.js      245.8 KB  (gzip: 78.2 KB)
    assets/index-d4e5f6.css      32.4 KB  (gzip: 6.8 KB)
    assets/vendor-g7h8i9.js     412.3 KB  (gzip: 132.1 KB)
    assets/charts-j0k1l2.js      89.5 KB  (gzip: 28.4 KB)
    ─────────────────────────────────────────────────────────
    Total:                      781.2 KB  (gzip: 245.5 KB)
    
    ✓ No unused exports detected
    ✓ All chunks within size budget
    
  5. For --analyze:

    • Generate bundle visualization
    • Open stats.html in browser
    • Show largest dependencies
    • Identify optimization opportunities
  6. For --preview:

    npm run preview
    
    • Serve built files locally
    • Test production build before deploy
  7. Build warnings to surface:

    • Large bundle sizes (>500KB)
    • Missing environment variables
    • Deprecated dependencies
    • TypeScript errors (build will fail)
  8. Size budgets:

    • Main bundle: <300KB (gzip <100KB)
    • Vendor bundle: <500KB (gzip <150KB)
    • Individual chunks: <100KB
Related skills