/stackblitz-pack:stackblitz-local-dev-loopfrom stackblitz-pack
Configures a Vite-based local dev environment for WebContainer apps with hot reload, cross-origin headers, and Vitest for testing file system operations.
Ships in stackblitz-pack. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Set up a Vite-based development environment for WebContainer applications with cross-origin headers, hot module replacement, and Vitest for testing file system operations.
npm create vite@latest wc-app -- --template vanilla-ts
cd wc-app
npm install @webcontainer/api
// vite.config.ts
import { defineConfig } from 'vite';
export default defineConfig({
server: {
headers: {
'Cross-Origin-Embedder-Policy': 'require-corp',
'Cross-Origin-Opener-Policy': 'same-origin',
},
},
});
// tests/webcontainer.test.ts
import { describe, it, expect } from 'vitest';
// Note: WebContainer tests require a browser environment
// Use Playwright for full integration tests
describe('FileSystemTree Builder', () => {
it('creates valid tree from flat paths', () => {
const tree = buildFileTree({
'src/index.ts': 'console.log("hello")',
'package.json': '{"name":"test"}',
});
expect(tree['package.json']).toHaveProperty('file');
expect(tree.src).toHaveProperty('directory');
});
});
function buildFileTree(flatFiles: Record<string, string>) {
const tree: any = {};
for (const [path, contents] of Object.entries(flatFiles)) {
const parts = path.split('/');
let current = tree;
for (let i = 0; i < parts.length - 1; i++) {
if (!current[parts[i]]) current[parts[i]] = { directory: {} };
current = current[parts[i]].directory;
}
current[parts[parts.length - 1]] = { file: { contents } };
}
return tree;
}
| Error | Cause | Solution |
|---|---|---|
| COOP/COEP errors | Missing headers | Add to vite.config.ts |
SharedArrayBuffer undefined | Not cross-origin isolated | Check response headers |
| Test failures | WebContainer needs browser | Use Playwright for integration |
Proceed to stackblitz-sdk-patterns for production patterns.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub flight505/skill-forge --plugin stackblitz-pack18 skills in this plugin
/stackblitz-ci-integrationCI testing for WebContainer apps with Playwright browser tests.
Use when working with WebContainers or StackBlitz SDK.
Trigger: "stackblitz CI".
/stackblitz-common-errorsFix WebContainer and StackBlitz errors: COOP/COEP, SharedArrayBuffer, boot failures.
Use when WebContainers fail to boot, embeds don't load,
or processes crash inside WebContainers.
Trigger: "stackblitz error", "webcontainer error", "SharedArrayBuffer not defined".
/stackblitz-core-workflow-aBuild a browser-based code editor with WebContainers: file tree, editor, terminal, and preview.
Use when creating interactive coding environments, building educational tools,
or embedding development environments in web apps.
Trigger: "webcontainer IDE", "browser IDE", "stackblitz editor", "code playground".
Other plugins' skills for the same job