skills/vscode-extension-builder-lawvable/SKILL.md
Build VS Code extensions from scratch or convert existing JS/React/Vue apps. Supports commands, webviews (React/Vue), custom editors, tree views, and AI agent integration via file-bridge IPC. Use when user wants to create a VS Code extension, convert a web app to an extension, add webviews or custom UIs to VS Code, implement tree views, build custom file editors, integrate with AI agents, or package/publish extensions (.vsix).
npx skillsauth add lawvable/awesome-legal-skills vscode-extension-builder-lawvableInstall 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.
Build VS Code extensions from scratch or convert existing web apps into portable, shareable extensions.
VS Code extensions run in two contexts:
Build stack: TypeScript + esbuild (extension) + Vite (webviews)
assets/ based on your needs (see decision tree below)package.json: name, displayName, publisher, descriptionnpm install then npm run build| Need | Template |
|------|----------|
| Simple command/action | assets/basic-command/ |
| Custom UI panel (React) | assets/webview-react/ |
| Sidebar file tree | assets/tree-view/ |
| Custom file editor | assets/custom-editor/ |
| AI agent integration | assets/file-bridge/ |
Register actions triggered via Command Palette, keyboard shortcuts, or menus.
vscode.commands.registerCommand('myExt.doSomething', () => {
vscode.window.showInformationMessage('Done!');
});
See references/api-reference.md for common APIs.
Full HTML/CSS/JS UIs in panels or sidebar. Use React for complex interfaces.
const panel = vscode.window.createWebviewPanel(
'myView', 'My Panel', vscode.ViewColumn.One,
{ enableScripts: true }
);
panel.webview.html = getWebviewContent();
See references/webview-patterns.md for React setup, messaging, and CSP.
Hierarchical data in the sidebar (file explorers, outlines, lists).
vscode.window.registerTreeDataProvider('myTreeView', new MyTreeProvider());
See references/tree-view-patterns.md for TreeDataProvider patterns.
Replace the default editor for specific file types.
vscode.window.registerCustomEditorProvider('myExt.myEditor', new MyEditorProvider());
See references/custom-editor-patterns.md for document sync and undo/redo.
To convert a JS/React/Vue app into an extension:
| Web API | VS Code Equivalent |
|---------|-------------------|
| localStorage | context.globalState / context.workspaceState |
| fetch() | vscode.workspace.fs or keep fetch for external APIs |
| Router | Multiple webview panels or sidebar views |
| alert() | vscode.window.showInformationMessage() |
| prompt() | vscode.window.showInputBox() |
| confirm() | vscode.window.showWarningMessage() with options |
See references/conversion-guide.md for detailed step-by-step process.
Extension code — Use esbuild (fast, simple):
// esbuild.js
esbuild.build({
entryPoints: ['src/extension.ts'],
bundle: true,
outfile: 'dist/extension.js',
external: ['vscode'],
format: 'cjs',
platform: 'node',
});
Webview code — Use Vite (HMR, React support):
// vite.config.ts
export default defineConfig({
build: {
outDir: '../dist/webview',
rollupOptions: { output: { entryFileNames: '[name].js' } }
}
});
See references/build-config.md for complete configurations.
Essential fields:
{
"name": "my-extension",
"displayName": "My Extension",
"publisher": "your-publisher-id",
"version": "0.0.1",
"engines": { "vscode": "^1.85.0" },
"main": "./dist/extension.js",
"activationEvents": [],
"contributes": {
"commands": [{ "command": "myExt.hello", "title": "Hello" }]
}
}
The contributes section defines commands, menus, views, settings, keybindings, and more.
See references/contribution-points.md for all contribution types.
Use postMessage for bidirectional communication:
// Extension → Webview
panel.webview.postMessage({ type: 'update', data: {...} });
// Webview → Extension
panel.webview.onDidReceiveMessage(msg => {
if (msg.type === 'save') { /* handle */ }
});
Use file-based IPC for communication with Claude Code or other agents:
// Watch for command files
fs.watch(commandDir, (event, filename) => {
if (filename.endsWith('.json')) {
const command = JSON.parse(fs.readFileSync(path.join(commandDir, filename)));
processCommand(command);
}
});
See references/ai-integration.md for the file-bridge pattern.
npm install -g @vscode/vsce
vsce package
This creates my-extension-0.0.1.vsix.
Exclude unnecessary files:
.vscode/**
node_modules/**
src/**
*.ts
tsconfig.json
esbuild.js
vite.config.ts
code --install-extension file.vsixvsce publish (requires Microsoft account)For extensions with native dependencies:
vsce package --target win32-x64
vsce package --target darwin-arm64
vsce package --target linux-x64
| File | When to Read | |------|--------------| | api-reference.md | Implementing extension features | | contribution-points.md | Configuring package.json contributes | | webview-patterns.md | Building React webviews | | tree-view-patterns.md | Implementing tree views | | custom-editor-patterns.md | Building custom file editors | | build-config.md | Configuring esbuild/Vite | | conversion-guide.md | Converting web apps | | ai-integration.md | Integrating with AI agents |
| Template | Description | |----------|-------------| | basic-command/ | Minimal extension with one command | | webview-react/ | React webview panel with messaging | | tree-view/ | Sidebar tree view with provider | | custom-editor/ | Custom editor for specific file types | | file-bridge/ | File-based IPC for AI agents |
tools
Draft, adapt, and review contracts and clauses aligned with The Chancery Lane Project's methodology for reducing carbon emissions through legal agreements. Use when Claude needs to: (1) Draft new climate-aligned clauses (e.g., net zero commitments, carbon accounting, supply chain decarbonization), (2) Adapt or modify existing contracts to incorporate climate objectives, (3) Review and analyze clauses for alignment with climate goals and decarbonization strategies, (4) Provide guidance on The Chancery Lane Project's house style and drafting methodology for climate-conscious legal work.
development
Matter budgeting and ongoing WIP/variance monitoring. Build phase-based fee estimates at matter setup, run bottom-up budgets by jurisdiction or workstream, calculate contingency, and structure AFA arrangements (fixed fee, capped fee, phased fixed fees). Ongoing monitoring: WIP tracking against budget, proportionality assessment (spend vs progress), variance commentary with root cause analysis, forecast-to-complete, realisation monitoring, write-off analysis. Trigger on: 'build a budget', 'fee estimate', 'what will this cost', 'WIP review', 'budget vs actual', 'how are we tracking against budget', 'we're over budget', 'realisation is poor', 'what's our ETC', 'budget for the German workstream', 'model the financial impact of this scope change', 'draft a fee adjustment', 'write-off analysis', 'how much contingency', 'AFA structure', 'fixed fee estimate', 'budget update', 'forecast to complete'.
tools
Operational billing execution for legal matters. Monthly bill prep and billing instructions, LC invoice review and disbursement treatment, client billing query responses, cashflow modelling (LC payment obligations vs client receipts), and leverage and burn analysis (staffing mix, predicted total cost, margin trajectory). Trigger on: 'prepare the bill', 'billing instruction', 'end of month billing', 'LC invoice', 'local counsel invoice', 'pass through as disbursement', 'client querying the invoice', 'billing dispute', 'cashflow gap', 'when will we get paid', 'LC payment due', 'leverage analysis', 'staffing mix', 'predicted total cost', 'burn rate by grade', 'are we on track', 'what will this matter cost'.
tools
When your bar comes asking "show me how you billed AI-assisted work" — and ABA 512, Florida 24-1, California, New York, and DC all have opinions out — you need an artifact that survives review. billable-time produces it. From your Claude Code session logs, it drafts reviewable time entries plus a printable HTML audit packet with: SHA-256 chain of evidence (source files + matter.yml + active disclosure pack + verifiable artifact self-hash), attorney identity and signature block, a bar-opinion disclosure pack with starter language for five jurisdictions, and content-aware deterministic narratives derived from filename and tool shape — never from prompt text by default. The tool refuses to bill on its own. --strict mode refuses to ship the artifact if any audit invariant fails (broad routes, missing attorney, missing/unverified disclosure). Comes as a Node CLI and a self-contained browser version (no backend; JSONL never leaves the page). 15 invariant tests verify the contract. AGPL-3.0.