.cursor/skills/bundle-optimization/SKILL.md
Keeps bundle size in mind when adding dependencies, changing helper packages, or modifying the web app. Use when adding npm deps, touching @podverse/helpers*, introducing heavy UI, or working on client-side code in apps/web.
npx skillsauth add podverse/podverse bundle-optimizationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill reminds you to consider client bundle size when making changes that affect the web app. Apply it when adding dependencies, modifying helper packages, or building client-side features.
apps/web@podverse/helpers, @podverse/helpers-requests, @podverse/helpers-validation, or @podverse/helpers-browserMeasure first
Use real JS bundle size (e.g. totalAssetSize from bundle analyzer stats), not HTML report size. Run tools/web-perf/bundle-analyzer and compare reports when optimizing.
Prefer tree-shaking
import { X } from 'pkg') or subpath imports (import X from 'pkg/x') instead of import * or barrel imports that pull the whole package."sideEffects": false in package.json.Minimize client-only code
@podverse/helpers-backend or @podverse/helpers-config in client code; they are for API/workers/build scripts.@podverse/helpers and @podverse/helpers-requests; avoid pulling unrelated DTOs or request helpers.Lazy-load heavy UI
Use next/dynamic for below-the-fold components, modals, players, and route-specific heavy UI. Provide loading fallbacks.
Watch heavy dependencies
date-fns/format, date-fns/formatDuration, etc.) and only the locales you need (date-fns/locale/en-US, etc.).@podverse/helpers-requests; avoid adding it elsewhere in client code.sideEffects: false)?helpers-backend or helpers-config; do not import those in apps/web client code."sideEffects": false? Add it if missing.next/dynamic?react-virtuoso where applicable.tools/web-perf/bundle-analyzer — run npm run analyze:web for apps/web; use reports to compare client total asset size. The analyzer is interactive (prompts for comparison and report name); do not complete those steps automatically — see interactive-prompts skill..llm/plans/active/bundle-optimizations/ — fix measurement, sideEffects, date-fns, lazy-load, optional ESM/audit.npm run build:packages, lint, and verification commands.When touching client bundles:
sideEffects: false in helper packages.documentation
Per-job env validation and config patterns for the workers app. Use when adding or changing worker commands, touching workers startup validation, or documenting worker env vars.
development
Common patterns and examples for the podverse-web Next.js application
tools
Ensures client-side time displays use formatDateTimeAbbrev for localized, readable timestamps. Use when rendering dates/times in the UI or when the user mentions time formatting or local timezone display.
testing
--- name: podverse-testing-policy description: Skip test implementation unless the user explicitly asks. Use when a plan or task includes adding unit tests, a test phase, or "Phase 3: Tests". version: 1.0.0 --- # Testing policy — skip tests for now ## When to use - When a plan or task includes adding unit tests, a test phase, or "Phase 3: Tests". - When deciding whether to implement tests for a feature. ## Rules 1. **We are not concerning ourselves with tests at this time.** Skip test imp