Install the "plugin-bundle-size" agent skill from https://github.com/grafana/skills/tree/main/skills/grafana-plugins/plugin-bundle-size into .claude/skills/plugin-bundle-size/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "plugin-bundle-size", then confirm the skill loads.
Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Type this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
skills CLI
$ npx skills add grafana/skills --skill plugin-bundle-size -a codex
Project install goes to .agents/skills/; add -g for ~/.codex/skills/.
Install the "plugin-bundle-size" agent skill from https://github.com/grafana/skills/tree/main/skills/grafana-plugins/plugin-bundle-size into .agents/skills/plugin-bundle-size/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "plugin-bundle-size", then confirm the skill loads.
Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add grafana/skills --skill plugin-bundle-size -a cursor
Project install goes to .agents/skills/; add -g for ~/.cursor/skills/.
Install the "plugin-bundle-size" agent skill from https://github.com/grafana/skills/tree/main/skills/grafana-plugins/plugin-bundle-size into .cursor/skills/plugin-bundle-size/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "plugin-bundle-size", then confirm the skill loads.
Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
skills CLI
$ npx skills add grafana/skills --skill plugin-bundle-size -a gemini-cli
Project install goes to .agents/skills/; add -g for ~/.gemini/skills/.
Install the "plugin-bundle-size" agent skill from https://github.com/grafana/skills/tree/main/skills/grafana-plugins/plugin-bundle-size into .gemini/skills/plugin-bundle-size/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "plugin-bundle-size", then confirm the skill loads.
Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Installs for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
skills CLI
$ npx skills add grafana/skills --skill plugin-bundle-size -a github-copilot
Project install goes to .agents/skills/; add -g for ~/.copilot/skills/.
Install the "plugin-bundle-size" agent skill from https://github.com/grafana/skills/tree/main/skills/grafana-plugins/plugin-bundle-size into .github/skills/plugin-bundle-size/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "plugin-bundle-size", then confirm the skill loads.
GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
skills CLI
$ npx skills add grafana/skills --skill plugin-bundle-size -a opencode
OpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
Install the "plugin-bundle-size" agent skill from https://github.com/grafana/skills/tree/main/skills/grafana-plugins/plugin-bundle-size into .opencode/skills/plugin-bundle-size/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "plugin-bundle-size", then confirm the skill loads.
OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
Facts
Skill name
plugin-bundle-size
GitHub stars
278
Token cost
~3.6k tokens
SKILL.md length
832 words
Files
3 (incl. references)
Skills in repo
51
Repo updated
First seen
Licence
Apache-2.0
At a glance
Optimise Grafana app plugin bundle size using React.lazy, Suspense, and webpack code splitting.
Works in 8 steps: Add bundle size CI reporting (recommended) → Detect plugin context → Check and update create-plugin → …
The user asks to reduce plugin bundle size
SKILL.md covers Risk levels, Step 1: Add bundle size CI…, Step 2: Detect plugin context and Step 3: Check and update…, plus 6 more sections
Calls npm, yarn and npx
What it does
Plugin Bundle Size is an agent skill from grafana/skills, published by the product's own GitHub organization. Optimise Grafana app plugin bundle size using React.lazy, Suspense, and webpack code splitting. Use when the user asks to reduce plugin bundle size, optimise module.js, add code splitting, improve initial plugin load performance, split plugin chunks, lazy load plugin pages, or help implement lazy loading in a Grafana app plugin. Triggers on phrases like "optimise plugin bundle size", "module.js is too large", "plugin is slow to load", "code split the plugin", "reduce initial JS payload", or "help me with Suspense…
Its SKILL.md is about 3.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/datasource-plugins.md` and `references/troubleshooting.md`).
It sits in DevOps & Cloud, covering Web performance and Monitoring and alerting. It works with Grafana, webpack and React. The licence is Apache-2.0.
When your agent uses it
The user asks to reduce plugin bundle size
Optimise module.js
Add code splitting
Improve initial plugin load performance
Example prompts
“optimise plugin bundle size”
“module.js is too large”
“plugin is slow to load”
“/plugin-bundle-size”
Requirements
Node.js
Workflow steps
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 1ccacf2. It shows what the files ask for, not the result of running them.
Tool permissions
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Runs code
Shell commands in SKILL.md call:
npm
yarn
npx
jq
git
From the folder's file list and the shell code blocks in SKILL.md.
Network
Links to these hosts (documentation or services it may open):
github.com
web.dev
survivejs.com
webpack.js.org
From URLs in SKILL.md, links to its own repository left out.
Credentials
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Context cost
Plugin Bundle Size loads about 3.6k tokens when it runs, and up to ~4.9k if it reads all its reference files. Until then it costs about 138 tokens; SKILL.md has 832 words of instructions outside code blocks.
Always· name and description, kept in context so the agent knows when to use it
~138
When it runs· the whole SKILL.md, loaded when a task matches
~3.6k
With references· SKILL.md plus every file in references/, read only if the agent opens them
~4.9k
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
Safety
Auto-check passed
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
Download SKILL.mdSave it as .claude/skills/plugin-bundle-size/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
plugin-bundle-size
description
Optimise Grafana app plugin bundle size using React.lazy, Suspense, and webpack code splitting. Use when the user asks to reduce plugin bundle size, optimise module.js, add code splitting, improve initial plugin load performance, split plugin chunks, lazy load plugin pages, or help implement lazy loading in a Grafana app plugin. Triggers on phrases like "optimise plugin bundle size", "module.js is too large", "plugin is slow to load", "code split the plugin", "reduce initial JS payload", or "help me with Suspense in my plugin".
license
Apache-2.0
Grafana plugin bundle size optimisation
module.js is the render-blocking entry point for every Grafana app plugin. The smaller it is, the less impact the plugin has on Grafana's overall startup time. A well-split plugin should have a module.js under ~200 KB that contains nothing but lazy-loaded wrappers — all feature code loads on demand.
Target: ~15–25 JS chunks total. Fewer means too little splitting; far more (50+) means over-engineering.
Risk levels
Not all splitting opportunities carry the same risk. Apply them in this order:
Shared utility components (Markdown, Spinner) used across many files
High churn, many callsites
Low — already in shared vendor chunks
When in doubt, stop after Priority 2. Routes alone typically reduce module.js by 95%+.
Step 1: Add bundle size CI reporting (recommended)
Add the grafana/plugin-actions/bundle-size action to get automatic bundle size comparison comments on every PR. This posts a table showing entry point size changes, file count diffs, and total bundle impact.
Subdirectory plugins (e.g. plugin/ in a monorepo):
The action's install step runs at the repo root and cannot find yarn.lock in a subdirectory. Work around this by installing deps yourself and symlinking to root:
How it works: On push to main, builds and uploads a baseline artifact. On PRs, compares against it and posts a diff comment. Use workflow_dispatch to generate the first baseline.
# Confirm this is an app plugin (type: "app" — datasource/panel plugins have different needs)
jq -r '"\(.id) — \(.type)"' src/plugin.json
# Locate the entry point
ls src/module.ts src/module.tsx 2>/dev/null
# Measure the current PRODUCTION bundle size BEFORE making any changes
# Dev builds are unminified and much larger — always measure production
yarn build 2>/dev/null || npm run build
echo "=== module.js ===" && ls -lah dist/module.js
echo "=== all JS chunks ===" && ls -lah dist/*.js | sort -k5 -rh | head -20
echo "=== chunk count ===" && ls dist/*.js | wc -l
Record the baseline. A pre-split plugin commonly has a module.js of 1–3 MB with no other JS chunks.
Step 3: Check and update create-plugin
The @grafana/create-plugin tool controls .config/webpack/, .config/jest/, and other build scaffolding. Updating it often unlocks faster SWC compilation and better chunk output.
After updating, review the diff (especially .config/webpack/webpack.config.ts) and run a test build. If the plugin has a top-level webpack.config.ts that webpack-merges the base config, review the merge for conflicts.
Step 4: Analyse the codebase — find what to split
Do not start implementing until you have read all of these.
bash
# Entry point — look for direct (non-lazy) imports of App, ConfigPage, exposeComponent targets
cat src/module.ts 2>/dev/null || cat src/module.tsx
# Root App component — look for direct page/route imports that should be lazy
cat src/App.tsx src/components/App.tsx src/feature/app/components/App.tsx 2>/dev/null | head -80
# Extension registrations — each should become an independent chunk
grep -r "exposeComponent\|addComponent\|addLink" src/ --include="*.ts" --include="*.tsx" -n
# Exported side-effect singletons (Faro, analytics) — must be extracted before splitting
grep -n "^export const\|^export let" src/module.ts src/module.tsx 2>/dev/null
grep -rn "from '.*module'" src/ --include="*.ts" --include="*.tsx" | grep -v node_modules
# Heavy synchronous imports
grep -rn "from 'monaco-editor\|@codemirror\|d3\b\|recharts\|chart\.js" \
src/ --include="*.ts" --include="*.tsx" | grep -v node_modules
Key rule: If a file is imported by module.ts directly (even transitively), it ends up in module.js. Everything reachable from a lazy boundary becomes its own chunk.
Step 5: Implement splits — in priority order
Named vs default exports:React.lazy() requires a default export. Most Grafana plugin components use named exports — use .then() to re-map:
Priority 1: module.tsx (highest impact, always do this first)
If the entry point is module.ts, rename it: git mv src/module.ts src/module.tsx
Make module.tsx import nothing from feature code except through lazy():
tsx
import React, { lazy, Suspense } from 'react';
import { AppPlugin, AppRootProps } from '@grafana/data';
import { LoadingPlaceholder } from '@grafana/ui';
import type { MyExtensionProps } from './extensions/MyExtension'; // import type — erased at compile time
import type { JsonData } from './features/app/state/slice';
// Lazy Faro init — keeps @grafana/faro-react out of module.js
let faroInitialized = false;
async function initFaro() {
if (faroInitialized) { return; }
faroInitialized = true;
const { initializeFaro } = await import('faro');
initializeFaro();
}
const LazyApp = lazy(async () => {
await initFaro();
return import('./features/app/App').then(m => ({ default: m.App }));
});
function App(props: AppRootProps<JsonData>) {
return <Suspense fallback={<LoadingPlaceholder text="" />}><LazyApp {...props} /></Suspense>;
}
const LazyMyExtension = lazy(() =>
import('./extensions/MyExtension').then(m => ({ default: m.MyExtension }))
);
function MyExtension(props: MyExtensionProps) {
return <Suspense fallback={<LoadingPlaceholder text="" />}><LazyMyExtension {...props} /></Suspense>;
}
export const plugin = new AppPlugin<JsonData>().setRootPage(App);
plugin.exposeComponent({ id: 'my-plugin/my-extension/v1', title: 'My Extension', component: MyExtension });
Key details:
import type for props prevents webpack from following the import into the eager bundle
Use new AppPlugin<JsonData>() if App uses AppRootProps<JsonData> — without the generic, setRootPage() type won't match
Remove any App as unknown as ComponentClass<AppRootProps> cast — the lazy wrapper is a valid function component
Expected impact:module.js drops from MB range to ~50–200 KB.
Singletons (e.g. Faro): If module.ts has export const faro = initializeFaro(), do NOT keep it as a top-level import. Extract it to src/faro.ts, update all internal imports from '*/module' → '*/faro', then use the dynamic initFaro() pattern above.
Bypass barrel files: Target the actual component file in the import(), not an index.ts barrel that re-exports multiple things:
tsx
// Risky — barrel may pull in other heavy modules
const Catalog = lazy(() => import('features/catalog'));
// Better — only pulls in Catalog's tree
const Catalog = lazy(() => import('features/catalog/Catalog').then(m => ({ default: m.Catalog })));
Priority 3: Extension components
Each extension should export default its component. Use fallback={null} for extensions that load quickly:
For arrays of objects containing React components (e.g. tab panels), lazy-load each entry. Critical: ensure a <Suspense> boundary exists where the component renders.
Plugin Bundle Size next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
Add Temps analytics to React applications with comprehensive tracking capabilities including page views, custom events, scroll tracking, engagement monitoring, session recording, and Web Vitals…
A skill your agent uses for any question involving telemetry data: "investigate an issue", "debug a problem", "find out why something is slow", "check error rates", "analyze user behavior"…
Sync changes from the hotpath, hotpath-macros and hotpath-drain crates to their meta counterparts (hotpath-meta, hotpath-macros-meta and hotpath-drain-meta).
Specifies how to instrument an opik-backend pipeline with per-stage OpenTelemetry metrics for throughput, latency, errors and queue delay by workspace.
Write or review k6 documentation across the three k6 repositories - k6-DefinitelyTyped (TypeScript types), k6-docs (user documentation), and k6 (release notes / changelog).
Optimise Grafana app plugin bundle size using React.lazy, Suspense, and webpack code splitting. Plugin Bundle Size is an agent skill from grafana/skills, published by the product's own GitHub organization.lazy, Suspense, and webpack code splitting.
When should I use Plugin Bundle Size?
Plugin Bundle Size fits situations like: the user asks to reduce plugin bundle size; optimise module.js; add code splitting; improve initial plugin load performance.
How do I install Plugin Bundle Size in Claude Code?
Run `npx skills add grafana/skills --skill plugin-bundle-size -a claude-code`. Or copy the skill folder (skills/grafana-plugins/plugin-bundle-size in grafana/skills) into .claude/skills/plugin-bundle-size in your project. Claude Code loads it when a task matches its description.
How do I install Plugin Bundle Size in Codex?
Run `npx skills add grafana/skills --skill plugin-bundle-size -a codex`. Or copy the skill folder (skills/grafana-plugins/plugin-bundle-size in grafana/skills) into .agents/skills/plugin-bundle-size in your project. Codex loads it when a task matches its description.
Can I use Plugin Bundle Size in Cursor, Gemini CLI or GitHub Copilot?
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add grafana/skills --skill plugin-bundle-size -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/plugin-bundle-size, .gemini/skills/plugin-bundle-size, .github/skills/plugin-bundle-size and .opencode/skills/plugin-bundle-size in your project.
What does Plugin Bundle Size need to run?
Going by SKILL.md and its folder, Plugin Bundle Size needs the command-line tools its instructions call (npm, yarn, npx, jq and git). Our summary lists: Node.js.
Does Plugin Bundle Size access the network?
SKILL.md names 4 domains. As links in the text: github.com, web.dev, survivejs.com and webpack.js.org. This is read from the text; nothing was executed.
Is Plugin Bundle Size safe to install?
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
What licence does Plugin Bundle Size use?
Plugin Bundle Size is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
How many tokens does Plugin Bundle Size use?
About 3.6k tokens (SKILL.md is roughly 14k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.3k tokens, read only when the agent opens those files.
What are the alternatives to Plugin Bundle Size?
Skills that share tags, products or a category with Plugin Bundle Size: Add React Analytics (gotempsh/temps, 822 stars), Cx Telemetry Querying (coralogix/cx-cli, 121 stars), Modern Web Guidance (JetBrains/skills, 363 stars) and Syncmeta (pawurb/hotpath-rs, 1.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
Who maintains Plugin Bundle Size?
grafana (a GitHub organization, an official publisher) maintains it in grafana/skills, which has 278 GitHub stars. The repository holds 51 skills in this directory. The repository was last updated on October 6, 2026.
Source: grafana/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.