<< All versions
Skill v1.0.0
Trusted Publisher100/100microsoft/webui/webui-dev
──Details
PublishedJuly 8, 2026 at 12:10 AM
Content Hashsha256:bd0375b60584d79b...
Git SHA
──Files
Files (1 file, 2.3 KB)
SKILL.md2.3 KBactive
SKILL.md · 54 lines · 2.3 KB
version: "1.0.0"
name: webui-dev description: Build interactive WebUI apps with compiled-template hydration, template syntax, component patterns, and CLI usage.
WebUI App Development
Use this skill when building or modifying WebUI applications.
Critical rules (memorize these)
- Every template binding must exist in the server state JSON. The server renders from JSON. Missing keys render empty.
- HTML, CSS, TypeScript are separate files. No JSX. No CSS-in-JS. No JS in templates.
- The `<template>` tag is optional. The build tool auto-injects it. Include it only for root host events (
@custom-eventon the shadow root). - Components inside `<for>` loops do NOT inherit loop variables. Pass data via attributes.
- Expressions in bindings: comparisons and logic OK; ternaries NOT.
{{count > 0}},?active="{{section == 'guide'}}",<if condition="a && b">all work. Operators:==,!=,<,>,<=,>=,&&,||,!. Forbidden: ternary (? :), function calls, mixing&&with||, more than 5 logical operators. Seedocs/guide/ai.mdfor full rules. - No `this.querySelector()` for reactive state. Use
@observable+ template bindings. - Decorators: `@attr` (HTML attribute), `@observable` (reactive state). Both work in SSR.
- `@attr({ mode: 'boolean' })` for true/false. Present = true, absent = false. Never use string
"false".
Quick reference
typescript
import { WebUIElement, attr, observable } from '@microsoft/webui-framework';export class MyComponent extends WebUIElement {@attr label = '';@attr({ mode: 'boolean' }) disabled = false;@observable count = 0;@observable items: Item[] = [];inputEl!: HTMLInputElement; // populated by w-ref="inputEl"increment(): void { this.count += 1; }onKeydown(e: KeyboardEvent): void { if (e.key === 'Enter') this.submit(); }}MyComponent.define('my-component');
bash
webui build ./src --out ./dist --plugin=webuiwebui serve ./src --state ./data/state.json --plugin=webui --watch
Full reference
The complete guide covering all template syntax, CLI flags, patterns, anti-patterns, routing, and language integrations:
📖 [docs/guide/ai.md](/docs/guide/ai.md)
Read that file before generating any WebUI code.