plugin-bundle-size

plugin-bundle-size is a skill for Claude Code from grafana/skills. It costs 120 tokens per session (3,605 once invoked), scanned A, original, Apache-2.0.

A guide for reducing the initial JavaScript file size of a Grafana app plugin, an extension that adds features to Grafana. It uses delayed loading so feature code is downloaded only when needed.

In plain words
What is it for?
Use it to add React.lazy, Suspense, and webpack code splitting to plugin pages, extensions, tabs, or other independently loaded features.
Why use it?
A smaller initial file lets Grafana start with less code, while separate files load heavier pages or extensions later.

Skill for Claude Code ✓ vendor

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node-version-file: ./plugin/.nvmrc.

Part of the grafana-plugins plugin — 5 skills shipped together

Good fit Use it to add React.lazy, Suspense, and webpack code splitting to plugin pages, extensions, tabs, or other independently loaded features.

Compare 6 skills from other repositories ↓
About the project

Grafana Skills is a collection of agent skills for working with Grafana, Prometheus, Loki, Tempo, Pyroscope, k6, and the broader LGTM observability stack. Developers and operators use the skills with coding agents that support the Agent Skills standard. The catalogue entries are the repository’s own skills, plugins, and instructions for using these observability tools.

grafana/skills · 326 stars · on GitHub

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/grafana/skills
agentmods
npx agentmods add skills/grafana/skills/plugin-bundle-size

Made for: Claude Code.

Or install grafana-plugins, the plugin that ships this one along with the rest of its 5 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for plugin-bundle-size

README.md
[![agentmods](https://agentmods.dev/badge/skills/grafana/skills/plugin-bundle-size/github.svg)](https://agentmods.dev/skills/grafana/skills/plugin-bundle-size)
Your own site
<a href="https://agentmods.dev/skills/grafana/skills/plugin-bundle-size"><img src="https://agentmods.dev/badge/skills/grafana/skills/plugin-bundle-size/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for plugin-bundle-size

Your own site · 80×15
<a href="https://agentmods.dev/skills/grafana/skills/plugin-bundle-size"><img src="https://agentmods.dev/badge/skills/grafana/skills/plugin-bundle-size.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 120 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,605 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk pass 15 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium MCP Rug Pull · line 137
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 343
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00120 $0.03605
Opus 5.5 $0.00048 $0.01442
Sonnet 5.5 $0.00024 $0.00721
Haiku 4.5 $0.00012 $0.00361

Measured 3mo ago against content hash 6e23e8d77848, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

plugin-bundle-size scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/grafana-plugins/plugin-bundle-size/SKILL.md · 367 lines

How it starts

The opening of the file, as written. The whole thing — 367 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:

Level What Risk Impact
Safe module.tsx lazy wrappers (Priority 1) Very low — no behaviour change Highest — module.js drops 90%+
Safe Route-level lazy() (Priority 2) Low — each route is self-contained High — one chunk per route
Safe Extension lazy() (Priority 3) Low — extensions are isolated Medium — independent chunk per extension
Moderate Component registries / tab panels (Priority 4) Medium — verify Suspense placement Medium — splits heavy pages further
Do not touch Vendor libraries (@grafana/scenes, @reduxjs/toolkit) N/A N/A — webpack splits these automatically
Do not touch 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%+.


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.

Root-level plugins (plugin at repo root):

# .github/workflows/bundle-size.yml
name: Bundle Size
on:
  pull_request:
  push:
    branches: [main]
  workflow_dispatch:

jobs:
  bundle-size:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      id-token: write
      pull-requests: write
      actions: read
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version-file: .nvmrc
      - name: Install and build
        run: yarn install
      - name: Bundle Size
        uses: grafana/plugin-actions/bundle-size@a66a1c96cdbb176f9cccf10cf23593e250db7cce # bundle-size/v1.1.0

Read the full file on GitHub · 367 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 367 lines · 120 tokens per session scan A 6e23e8d77848

Subscribe to this mod's changes

plugin-bundle-size is a skill published in the GitHub repository grafana/skills (326 stars, last pushed today), licensed Apache-2.0. It adds 120 tokens to every session and 3,605 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

plugin-bundle-size compared with skills from other repositories

plugin-bundle-size next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
plugin-bundle-sizegrafana/skillsSkill326todayApache-2.0A120Claude Code
build-ghost-appTryGhost/GhostSkill56ktodayMITA44Claude Code, Codex
material-ui-tailwindmui/material-uiSkill99ktodayMITA67Claude Code, Codex
fuzzy-rankingTanStack/tableSkill29k6d agoMITA62Claude Code, Codex
r3f-best-practiceszebbern/claude-code-guideSkill4.7k4d agoMITA74Claude Code, Codex
git-safetytamagui/tamaguiSkill14k3d agoMITA42Claude Code
onchainkitalsk1992/CloddsBotSkill3.1k16d agoMITA24Claude Code, Codex