From harness-claude
Provides guidance on using static import declarations for tree-shaking, bundler optimizations, and static analysis, including trade-offs vs dynamic import.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-claude:js-static-importThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Use static import declarations to load ES modules at parse time for tree-shaking and static analysis
Use static import declarations to load ES modules at parse time for tree-shaking and static analysis
import { name } from './module.js' at the top of the file for all compile-time dependencies.require() in ESM files — static import enables bundler dead-code elimination.// Named exports — tree-shakeable
import { useState, useEffect } from 'react';
import { formatDate, parseDate } from '../utils/date.js';
// Default export — avoid when possible
import MyComponent from './MyComponent.js';
import * as ns from './module.js' sparingly — it imports everything and can defeat tree-shaking.Static import declarations are resolved at parse time, before any code executes. This enables bundlers to analyze the dependency graph and eliminate unused exports (tree-shaking). Static imports are hoisted — they run before the module body regardless of where they appear in the file.
Trade-offs:
When NOT to use:
import() insteadhttps://patterns.dev/javascript/static-import
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeGuides on using static ES module imports with tree-shaking for optimal bundling performance. Covers when to use static vs dynamic import and avoiding barrel files.
Applies Vercel Engineering's 57 React/Next.js performance rules to eliminate waterfalls, reduce bundle size, fix re-renders, and optimize data fetching when writing, reviewing, or refactoring code.
Guides es-toolkit installation, import patterns, setup, bundle size, and performance across Node.js, Bun, Deno, and browsers.