plugins/skills/vendor-dep/SKILL.md
Extract a npm dependency into the shared vendor bundle
npx skillsauth add liriliri/tinker vendor-depInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Extract a plugin's npm dependency into the shared vendor/ bundle so it can be reused across plugins.
package-name: the npm package name (e.g. html-to-image)global-camel-name: camelCase name for globalThis and IIFE export (e.g. htmlToImage)plugin-name: one or more plugin folder names that use this dependency (e.g. tinker-code-image tinker-photo-collage)The vendor entry file name and build mode/script name are derived from global-camel-name lowercased (e.g. htmltoimage).
lowerName = global-camel-name lowercased (e.g. htmlToImage → htmltoimage)pluginVendorName = PluginVendor + PascalCase of global-camel-name (e.g. PluginVendorHtmlToImage)First check how the plugin imports the package:
import { foo } from '...' or import * as foo from '...'): use import *import Foo from '...'): use default importCreate vendor/<lowerName>.ts:
Named exports:
import * as <global-camel-name> from '<package-name>'
import { expose } from './util'
expose('<global-camel-name>', <global-camel-name>)
export { <global-camel-name> }
Default export:
import <global-camel-name> from '<package-name>'
import { expose } from './util'
expose('<global-camel-name>', <global-camel-name>)
export default <global-camel-name>
vendor/vite.config.tsAdd to globals map:
'<package-name>': '<global-camel-name>',
Add build target (before the final return createConfig('react', ...)):
if (target === '<lowerName>') {
return createConfig('<lowerName>', '<pluginVendorName>')
}
vendor/package.jsonAdd to devDependencies:
"<package-name>": "<version>"
Use the same version string currently in the plugin's package.json. Renderer libraries must always be installed as devDependencies, never dependencies.
Add build script:
"build:<lowerName>": "vite build --config vite.config.ts --mode <lowerName>"
Append to build script chain:
&& npm run build:<lowerName>
package.jsonFor each <plugin-name>, remove <package-name> from devDependencies. If devDependencies becomes empty, keep the key with an empty object {}.
index.htmlFor each <plugin-name>, add the following <script> tag in <head> after existing vendor scripts:
<script src="/vendor/<lowerName>.js"></script>
tools
Debug Tinker plugins with agent-browser. Use when the user needs to open, inspect, interact with, restart, or close a plugin in the running Tinker Electron app.
tools
Check code against Tinker plugin coding standards
tools
Create a new Tinker plugin from the template
development
Review changed code for reuse, quality, and efficiency, then fix any issues found.