Static Import
Teaches static ES2015 import syntax for module dependencies. Use when you need to import code that is required at load time and benefits from static analysis and tree shaking.
Install
npx skills add PatternsDev/skills --skill static-importgit clone --depth 1 https://github.com/PatternsDev/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/javascript/static-import ~/.claude/skills/static-importPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Static Import The `import` keyword allows us to import code that has been exported by another module. By default, all modules we're _statically importing_ get added to the initial bundle. A module that is imported by using the default ES2015 import syntax, `import module from 'module'`, is statically imported. Let's look at an example! A simple chat app contains a `Chat` component, in which we're statically importing and rendering three components: `UserProfile`, a `ChatList`, and a `ChatInput` to type and send messages! Within the `ChatInput` module, we're statically importing an `EmojiPicker` component to be able to show the user the emoji picker when the user toggles the emoji. ## When to Use - Use this for importing modules that are needed immediately on page load - This is the default import mechanism — understand it to know when to switch to dynamic imports ## Instructions - Use static imports for modules critical to the initial render - Be aware that all statically imported modules are bundled into the initial bundle - Consider switching to dynamic imports for modules not needed on initial render ## Details The modules get executed as soon as the engine reaches the line on which we import them. Since the components were statically imported, Webpack bundled the modules into the initial bundle: ```bash Asset Size Chunks Chunk Names main.bundle.js 1.5 MiB main [emitted] main ```
Details
- Skill name
static-import- Repository
- PatternsDev/skills
- Path
javascript/static-import/SKILL.md- Repo updated
- 15 April 2026
FAQ
What does the Static Import skill do?
Teaches static ES2015 import syntax for module dependencies. Use when you need to import code that is required at load time and benefits from static analysis and tree shaking.
How do I install the Static Import skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add PatternsDev/skills --skill static-import. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Static Import popular?
It lives in PatternsDev/skills, which has 259 GitHub stars and 28 forks.
Related skills
AI UI Patterns
259PatternsDev/skills
Teaches design patterns for building AI-powered React interfaces. Use when creating chatbots, intelligent assistants, streaming UIs, or any AI-driven user experience in React.
Async Components
259PatternsDev/skills
Teaches async component loading in Vue for performance optimization. Use when you have heavy components that aren't needed on initial render and can be loaded on demand.
Bundle Splitting
259PatternsDev/skills
Teaches bundle splitting techniques for web performance. Use when your application has a large JavaScript bundle that affects load times or when you need to reduce FCP/LCP.
Third Party
259PatternsDev/skills
Teaches strategies for mitigating third-party script performance impact. Use when third-party scripts like analytics, ads, or widgets are degrading your page load times or Core Web Vitals.
Singleton Pattern
259PatternsDev/skills
Teaches the singleton pattern for managing a single shared instance. Use when exactly one instance of a class or object is needed to coordinate actions across your application.
Tree Shaking
259PatternsDev/skills
Teaches tree shaking for dead code elimination in JavaScript bundles. Use when your bundle includes unused exports and you want to reduce the final bundle size during the build step.
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.