.claude/skills/rezi-add-widget/SKILL.md
Add a new widget type to the Rezi framework. Use when creating new ui.* factory functions with layout, rendering, and tests.
npx skillsauth add rtlzeromemory/rezi rezi-add-widgetInstall 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.
Use this skill when:
@rezi-ui/coreui.* factory functionpackages/core/src/widgets/types.ts — all widget prop types and VNode unionpackages/core/src/widgets/ui.ts — all ui.* factory functionspackages/core/src/layout/kinds/ — layout handlers by categorypackages/core/src/renderer/renderToDrawlist/widgets/ — render handlers by categorypackages/core/src/index.ts — public exportspackages/core/src/ui/ — design tokens, recipes, and capabilitiesdocs/guide/widget-authoring.md — widget authoring guide with design system integrationAdd props type to packages/core/src/widgets/types.ts:
Readonly<{...}> patternkey?: string if the widget can appear in listsAdd VNode kind to the VNode discriminated union in types.ts
Add factory function to packages/core/src/widgets/ui.ts:
@example tagAdd layout handler in packages/core/src/layout/kinds/:
leaf.ts for non-container widgetsbox.ts / stack.ts for containerscollections.ts for data widgetsoverlays.ts for layered widgetsAdd render handler in packages/core/src/renderer/renderToDrawlist/widgets/:
basic.ts, containers.ts, collections.ts, editors.ts, overlays.ts, navigation.ts, or files.tsAdd design system support (if the widget is interactive):
packages/core/src/widgets/protocol.tsdsVariant?, dsTone?, dsSize?) for advanced customizationThemeDefinition semantic tokens are available; DS props override defaults when specifieddocs/guide/widget-authoring.md for the full patternExport both props type and factory from packages/core/src/index.ts
Add JSX wrapper (if needed) in packages/jsx/src/components.ts
Write tests in packages/core/src/widgets/__tests__/
Add docs in docs/widgets/{widget-name}.md
node scripts/run-tests.mjs
packages/core/src/index.tscreateTestRendererds* props for design-system-based styling (if interactive)testing
Write tests for Rezi widgets, screens, or app logic using createTestRenderer and node:test.
development
Add routing with guards and nested outlets to a Rezi app. Use when building multi-page/screen TUI applications.
tools
Profile and optimize Rezi app performance. Use when app feels slow, frames drop, or render phases take too long.
tools
Add modal dialogs and overlay UI with focus trapping. Use when implementing confirmations, alerts, or layered interfaces.