wit
Guide for WebAssembly Interface Type (WIT) language. Use when defining component interfaces, writing WIT files, designing worlds and interfaces, or working…
от vinnie357★ 30 звёзд на GitHub
Установить wit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
WIT (WebAssembly Interface Types)
WIT is the Interface Definition Language (IDL) for the WebAssembly Component Model. It defines typed contracts between components in a language-agnostic way, enabling interoperability across programming languages at the wasm boundary.
See also: wasmtime skill for runtime embedding and compilation details.
Anti-fabrication
This skill follows core:anti-fabrication. The claim area is the WIT type system and
package syntax (packages, interfaces, worlds, records/variants/enums/flags, resources,
use declarations, result<T,E>, borrow<T>), shared with wasmtime under the same
Bytecode Alliance umbrella. Re-verified live 2026-08-04 (claude-skills-204) against
component-model.bytecodealliance.org's design/wit.html: no drift found in the documented
syntax. Re-verify against that page, or wasm-tools component wit, before asserting a
type-system feature this skill doesn't cover — the Component Model is still evolving.
WIT File Structure
A WIT file contains one or more of: package declaration, interfaces, worlds, and use declarations.
package namespace:[email protected];
use wasi:io/[email protected].{input-stream, output-stream};
interface my-interface {
// types and functions
}
world my-world {
import my-interface;
export my-interface;
}
Packages
Every WIT file belongs to a package. The package declaration names the namespace, package, and optional semver version.
package my-org:[email protected];
namespace: organization or project identifier (kebab-case)package: library name (kebab-case)@version: optional semver string
Package names use kebab-case identifiers. Dots are not allowed in identifiers; use hyphens.
Identifiers
WIT identifiers use kebab-case. Reserved words may be used as identifiers when prefixed with %:
interface example {
// 'type' is reserved — prefix with %
get-type: func() -> %type;
type %type = string;
}
Interfaces
An interface groups related types and functions into a named, reusable unit.
interface geometry {
record point {
x: f64,
y: f64,
}
distance: func(a: point, b: point) -> f64;
translate: func(p: point, dx: f64, dy: f64) -> point;
}
Interfaces can be imported by worlds or by other interfaces using use.
Worlds
A world defines a complete component contract: what it imports (needs) and what it exports (provides). Worlds serve a dual role — they describe a component's requirements AND define the hosting environment that runs it. The only ways a component can interact with anything outside itself are by having its exports called or by calling its imports. A component cannot access resources it does not explicitly import, providing strong sandboxing boundaries.
world image-processor {
// Imports: capabilities the component requires from the host
import wasi:filesystem/[email protected];
import log: func(msg: string);
// Exports: capabilities the component provides to callers
export process: func(input: list<u8>) -> result<list<u8>, string>;
export geometry;
}
World Items
| Item | Syntax | Purpose |
|---|---|---|
| Import interface | import name: interface { ... } |
Inline imported interface |
| Import named | import wasi:io/[email protected]; |
Import by package path |
| Import function | import log: func(msg: string); |
Single function import |
| Import type | import wasi:io/streams.{input-stream}; |
Import specific types |
| Export interface | export my-interface; |
Export a named interface |
| Export function | export run: func(); |
Export a single function |
| Include world | include other-world; |
Inherit another world's items |
World Includes
Worlds can include other worlds to inherit their imports and exports:
world base {
import wasi:cli/[email protected];
}
world extended {
include base;
export my-app: func();
}
The with clause renames included items to avoid conflicts:
world combined {
include world-a with { run as run-a };
include world-b with { run as run-b };
}
Type System
Full reference: syntax-reference.md
Primitives
| Type | Description |
|---|---|
bool |
Boolean |
u8, u16, u32, u64 |
Unsigned integers |
s8, s16, s32, s64 |
Signed integers |
f32, f64 |
IEEE 754 floats |
char |
Unicode scalar value |
string |
UTF-8 string |
Compound Types
interface types {
// List: variable-length sequence
type byte-array = list<u8>;
// Option: nullable value
type maybe-string = option<string>;
// Result: success or error
type parse-result = result<u32, string>;
type io-result = result<_, string>; // ok with no payload
type check-result = result; // both ok and err have no payload
// Tuple: fixed-length heterog
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/patterns.md
- references/syntax-reference.md
FAQ
Что делает скилл wit?
Guide for WebAssembly Interface Type (WIT) language. Use when defining component interfaces, writing WIT files, designing worlds and interfaces, or working with the Component Model type system.
Как установить скилл wit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл wit запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
AnthropicGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
academy-guide
AnthropicStop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
internal-comms
AnthropicA set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
skill-development
AnthropicThis skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…