| name | plugin-authoring | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| description | Bootstrap and iterate TypeScript/TSX JupyterLab plugins in Plugin Playground for plugin development, using command-driven workflows and extension references. | |||||||||||||
| metadata |
|
Use this skill to bootstrap and iterate JupyterLab plugins inside Plugin Playground.
Produce working plugin code that can be loaded with plugin-playground:load-as-extension, using extension points and examples available in the running environment.
- Desired behavior (what the plugin should do)
- Optional UI target (command palette, sidebar, status bar, notebook, etc.)
- Optional package constraints (JupyterLab-only APIs vs external AMD modules)
- Prepare a TypeScript file
- If the user does not already have a plugin file open or specified, run
plugin-playground:create-new-pluginwith a meaningfulpathargument (for exampleapp.commands.execute('plugin-playground:create-new-plugin', { path: 'status-indicator.ts' })) instead of relying on untitled defaults. - Start from the generated TypeScript scaffold and adapt it.
- Focus on TypeScript/TSX plugin code. Do not scaffold Python projects (
pyproject.toml, Python package layout) unless explicitly requested.
- Discover available extension points
- Run
plugin-playground:list-tokensto get available tokens. - Run
plugin-playground:list-commandsto get available commands. - Use optional
queryargument to narrow results:app.commands.execute('plugin-playground:list-tokens', { query: 'status' })app.commands.execute('plugin-playground:list-commands', { query: 'notebook' })
- Discover reference examples
- Run
plugin-playground:list-extension-examples. - Filter by topic with
query(for exampletoolbar,commands,widget,notebook). - Open selected example source/README from the sidebar for implementation details.
- Implement plugin code
- Start from a minimal plugin shape (
id,autoStart,activate). - Add
requirestokens only after confirming availability from step 2. - Add commands with stable IDs (
<namespace>:<action>). - Use one or more
.ts/.tsxfiles as needed as complexity grows.
- Load and iterate
- Run
plugin-playground:load-as-extension. - Validate behavior in UI.
- Check the command return value for
ok/status/messageto detect and report loading or autostart errors. - If reloading the same plugin ID repeatedly, ensure cleanup is handled via
deactivate()where needed.
- Export for standalone development
- Run
plugin-playground:export-as-extensionto download a zip for local IDE + git workflows. - For deterministic automation (or when another file is focused), pass an explicit file path:
app.commands.execute('plugin-playground:export-as-extension', { path: 'my-extension/src/index.ts' })
- Read export result metadata (
ok,archiveName,rootPath,fileCount,message) and report failures.
- Share a file link for collaboration
- Run
plugin-playground:share-via-linkto create a shareable URL for a single file. - It can target the active file or an explicit path:
app.commands.execute('plugin-playground:share-via-link', { path: 'my-extension/src/index.ts' })
- The command keeps the same flow: it copies the generated link to clipboard and also returns metadata (
ok,link,sourcePath,urlLength,message).
- Imports and module safety
- Prefer JupyterLab/Lumino imports first.
- For external packages, ensure AMD-compatible import targets are used.
- Avoid Node/Webpack-only modules that are not AMD-compatible.
- TypeScript-first plugin implementation (
.ts/.tsx) - Clear command IDs and labels
- Minimal required tokens
- No unused imports
- JupyterLab Extension Tutorial:
- JupyterLab Extension Examples: