Redis insight plugin

From redis/RedisInsight · View interactive version

Redis insight plugin is an AI agent skill from the GitHub repository redis/RedisInsight. Use when creating, modifying, debugging, deploying, or testing Redis Insight Workbench visualization plugins, plugin manifests, package.json visualizations, activationMethod functions, redisinsight-plugin-sdk usage, Parcel/Vite plugin builds, iframe rendering, Redis command parsing, Docker RedisInsi

How to use this skill

Skill file

Redis Insight Workbench Plugin

Build, deploy, and validate Redis Insight Workbench visualization plugins. Plugins render inside an iframe in Workbench and visualize the result of a Redis command. Trigger this skill for plugin manifests, package.json visualizations, activationMethod functions, redisinsight-plugin-sdk usage, Parcel/Vite plugin builds, iframe rendering, Redis command parsing, Docker RedisInsight deployment, /api/plugins verification, and Playwright plugin tests.

Use the redis-ui-components skill for every visual plugin UI. RedisInsight plugins use the RedisInsight product theme pair: light / dark, not light2 / dark2.

Official source-of-truth references:

See references/official-docs-summary.md for a condensed summary.

Repo Code Conventions (internal plugins)

You are inside the RedisInsight repo. An internal plugin lives in the redisinsight/ui/

tree, so its code must follow the same styleguides as the rest of the UI — not ad hoc plugin

code. These rules are mandatory for any plugin code written here and override generic

external-plugin guidance below where they conflict:

- frontend — component folder structure

(ComponentName/ComponentName.tsx + .styles.ts + .types.ts + .spec.tsx), functional

components with hooks, named exports, barrel files, layout components

(Row / Col / FlexGroup) instead of raw div, and theme usage.

- redis-ui-components — build all plugin UI from Redis UI

components. Import the internal uiSrc/components/ui wrappers; never import raw

@redis-ui/*. (This skill is a symlink into the installed @redis-ui/components package,

so it resolves after npm install; if it is missing, run install — the canonical source is

node_modules/@redis-ui/components/skills/redis-ui-components/.)

- code-quality — TypeScript everywhere (no any), naming

(PascalCase / camelCase / UPPER_SNAKE_CASE), import order, no magic numbers, no

!important in styles, semantic theme colors over CSS variables.

- testing — Jest + Testing Library, the renderComponent helper,

faker for test data, waitFor instead of fixed time waits.

- e2e-testing — any Playwright/E2E test follows this skill

(tests in tests/e2e-playwright/, page objects, fixtures, UI navigation; never page.goto()

directly, no CSS selectors or fixed waits).

External standalone plugins (below) are bundled in isolation and cannot import these

internals; they emulate the conventions with local code instead.

First Decision: Plugin Type

Decide before scaffolding anything else.

See references/internal-vite-plugin.md and references/external-parcel-plugin.md.

External Plugin Structure

<plugin-name>/
  package.json              # manifest + build scripts
  src/
    index.html              # iframe entry, has #app
    main.tsx                # activation functions, default export
    components/
    styles/
      styles.scss
  dist/
    index.js                # built bundle (referenced by manifest "main")
    styles.css              # built styles (referenced by manifest "styles")

Required Manifest

Top-level package.json fields:

Each visualization descriptor must include:

Set default: false unless the user explicitly asks for it to be the default visualization.

The activationMethod value must exactly match an exported function name in the bundle. The plugin entry must export that function via the default export:

export default { renderMyView };

Multiple visualizations:

export default {
  renderTableView,
  renderChartView,
};

See references/plugin-manifest.md for full examples and how to strip dev-only fields from the deployed manifest.

Activation Function Contract

Every activation function must:

  1. Get the host element: const root = document.getElementById('app');
  2. Defensively validate props (command, data, modules, theme).
  3. Wrap render logic in try/catch and render an error state on failure.
  4. Render an empty state when data is missing or empty.
  5. Log with a plugin-specific prefix, e.g. [MY_PLUGIN], never bare console.log.

See references/error-handling.md.

RedisInsight Product UI Contract

Every plugin UI must follow RedisInsight product styling:

See references/redisinsight-product-ui.md and use templates/external-styles.scss as the baseline src/styles/styles.scss.

Mandatory Phased Workflow

Build every new plugin in three phases. Do not skip phases — the failure mode in each phase tells you exactly what is wrong.

See references/iterative-development.md and the templates in templates/.

Review Hardening Loop

Before asking for review, run a small adversarial pass against the exact surfaces the plugin touches:

See references/review-hardening.md.

Build and Verify

npm run build
test -f dist/index.js
test -f dist/styles.css                       # if "styles" is declared
grep -c "process.env" dist/index.js           # must be 0 in a Parcel build

Confirm each activationMethod name appears in the bundle:

grep -o "renderMyView" dist/index.js | head

Deploy

External plugin → user plugins folder:

mkdir -p ~/.redis-insight/plugins/<plugin-name>
cp package.json ~/.redis-insight/plugins/<plugin-name>/
cp -R dist ~/.redis-insight/plugins/<plugin-name>/dist

Restart Redis Insight, then verify:

curl -s http://localhost:5540/api/plugins

The response must include the plugin name and its visualizations. See references/testing-and-deployment.md for Docker workarounds, Playwright smoke tests, and the static-plugin path inside the Docker image.

Security Rules

DO NOT

Final Checklist

Reference Index

| File | Load When |

|------|-----------|

| official-docs-summary.md | Need the canonical contract from Redis Insight docs. |

| redis-insight-plugin-guidelines.md | Need the long-form operational reference. |

| external-parcel-plugin.md | Building a standalone plugin with Parcel. |

| internal-vite-plugin.md | Building inside the RedisInsight monorepo with Vite. |

| plugin-manifest.md | Writing or stripping package.json manifests. |

| iterative-development.md | Phase 1/2/3 templates and pipeline. |

| redisinsight-product-ui.md | Applying RedisInsight product UI inside plugin iframes. |

| review-hardening.md | Pre-review checklist for matcher, parser, visualization state, and scoped regression tests. |

| testing-and-deployment.md | Deploy paths, Docker workaround, /api/plugins, Playwright. |

| redis-command-parsing.md | Parsing raw Redis command responses defensively. |

| third-party-libraries.md | Integrating a visualization library, custom .d.ts, bundle size. |

| error-handling.md | Defensive render, ErrorBoundary, log prefixes. |

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.