name: ai-context-webview-ui
description: Guides the ai-context-writer subagent in generating and maintaining AI_CONTEXT_WEBVIEW_UI.md, documenting the webview-ui React + Rete.js architecture, message handling, node components, styling, and testing approach for the python-vis project. Use when creating or updating the webview UI AI context file.
AI Context Webview UI Skill
Purpose
Help the ai-context-writer subagent create and maintain docs/AI_CONTEXT/AI_CONTEXT_WEBVIEW_UI.md as the component-level reference for the webview-ui/ React + Rete graph editor:
How the webview is bootstrapped
How messages are handled
How graphs are rendered and updated
How node components map to AST node types
How styling and theming work
Sources to Read
Before updating the webview UI context, read:
@webview-ui/src/index.tsx
@webview-ui/src/App.tsx
@webview-ui/src/editor.tsx
@webview-ui/src/types.ts
@webview-ui/src/conversion.ts (if used)
@webview-ui/src/nodes/ components and nodes/index.ts
@webview-ui/src/index.css and @webview-ui/src/components/NodeStyles.css
Relevant tests under @tests/ (if any target webview behavior)
Optionally cross-check with:
@src/types.ts for shared message and graph types.
Required Sections in AI_CONTEXT_WEBVIEW_UI.md
Include at least:
Metadata
Version
Last Updated (ISO date)
Tags including webview-ui, react, rete
Cross-References to repository and extension-host AI_CONTEXT docs
Module Overview
Roles of:
index.tsx
App.tsx
editor.tsx
types.ts
nodes/ and components/
Bootstrap & Lifecycle
How index.tsx sets up the React root and connects to VS Code’s acquireVsCodeApi.
How App.tsx initializes ReteASTEditor and listens for messages via window.addEventListener("message", ...).
Message Handling
Types of messages expected from the extension:
updateGraph
error
loading
Messages the webview sends back:
navigateToSource
retry
How each message affects local React state and the editor.
Graph Rendering (editor.tsx)
How ReteASTEditor:
Initializes the Rete editor, area, connection, and React plugins.
Transforms ReteGraph into Rete nodes and connections.
Applies node positions and zoom-to-fit behavior.
How node click handlers are wired to send navigateToSource messages.
Node Components (nodes/)
How ASTNode.tsx serves as the base visual component.
How specialized nodes (BinOpNode, CallNode, ClassDefNode, FunctionDefNode, NameNode, etc.) extend the base.
How nodes/index.ts maps ast_type strings to concrete components.
Styling & Theming
Use of VS Code theme variables for colors.
Role of index.css and NodeStyles.css.
Any important class names (e.g. .ast-node-wrapper) that other agents might rely on.
Testing & Diagnostics (if available)
Describe how UI behavior is tested (if tests exist).
Mention how to debug message flow or graph rendering from within the webview.
Style & Constraints
Focus on behavior and integration rather than React basics.
Use concise descriptions and reference actual prop names and type names from types.ts.
Provide small code snippets for message payload shapes and example message handlers.
Keep the file within the content length limit; split into sub-documents if the webview grows significantly.
Update Strategy
When the webview UI changes:
Update message type lists and their behavior.
Add or update node component mappings.
Refresh styling/theming notes if CSS structure changes.
Adjust descriptions of initialization and lifecycle to match the current App.tsx and editor.tsx.
Bump version and last-updated metadata.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: benweatherall-vscode-python-ast-extension-ai-context-webview3description: ---4---5---6name: ai-context-webview-ui7description: Guides the ai-context-writer subagent in generating and maintaining AI_CONTEXT_WEBVIEW_UI.md, documenting the webview-ui React + Rete.js architecture, message handling, node components, styling, and testing approach for the python-vis project. Use when creating or updating the webview UI AI context file.8---910# AI Context Webview UI Skill1112## Purpose1314Help the `ai-context-writer` subagent create and maintain `docs/AI_CONTEXT/AI_CONTEXT_WEBVIEW_UI.md` as the **component-level reference** for the `webview-ui/` React + Rete graph editor:1516- How the webview is bootstrapped17- How messages are handled18- How graphs are rendered and updated19- How node components map to AST node types20- How styling and theming work2122## Sources to Read2324Before updating the webview UI context, read:2526- `@webview-ui/src/index.tsx`27- `@webview-ui/src/App.tsx`28- `@webview-ui/src/editor.tsx`29- `@webview-ui/src/types.ts`30- `@webview-ui/src/conversion.ts` (if used)31- `@webview-ui/src/nodes/` components and `nodes/index.ts`32- `@webview-ui/src/index.css` and `@webview-ui/src/components/NodeStyles.css`33- Relevant tests under `@tests/` (if any target webview behavior)3435Optionally cross-check with:3637- `@src/types.ts` for shared message and graph types.3839## Required Sections in AI_CONTEXT_WEBVIEW_UI.md4041Include at least:42431. **Metadata**44 - Version45 - Last Updated (ISO date)46 - Tags including `webview-ui`, `react`, `rete`47 - Cross-References to repository and extension-host AI_CONTEXT docs48492. **Module Overview**50 - Roles of:51 - `index.tsx`52 - `App.tsx`53 - `editor.tsx`54 - `types.ts`55 - `nodes/` and `components/`56573. **Bootstrap & Lifecycle**58 - How `index.tsx` sets up the React root and connects to VS Code’s `acquireVsCodeApi`.59 - How `App.tsx` initializes `ReteASTEditor` and listens for messages via `window.addEventListener("message", ...)`.60614. **Message Handling**62 - Types of messages expected from the extension:63 - `updateGraph`64 - `error`65 - `loading`66 - Messages the webview sends back:67 - `navigateToSource`68 - `retry`69 - How each message affects local React state and the editor.70715. **Graph Rendering (editor.tsx)**72 - How `ReteASTEditor`:73 - Initializes the Rete editor, area, connection, and React plugins.74 - Transforms `ReteGraph` into Rete nodes and connections.75 - Applies node positions and zoom-to-fit behavior.76 - How node click handlers are wired to send `navigateToSource` messages.77786. **Node Components (nodes/)**79 - How `ASTNode.tsx` serves as the base visual component.80 - How specialized nodes (`BinOpNode`, `CallNode`, `ClassDefNode`, `FunctionDefNode`, `NameNode`, etc.) extend the base.81 - How `nodes/index.ts` maps `ast_type` strings to concrete components.82837. **Styling & Theming**84 - Use of VS Code theme variables for colors.85 - Role of `index.css` and `NodeStyles.css`.86 - Any important class names (e.g. `.ast-node-wrapper`) that other agents might rely on.87888. **Testing & Diagnostics (if available)**89 - Describe how UI behavior is tested (if tests exist).90 - Mention how to debug message flow or graph rendering from within the webview.9192## Style & Constraints9394- Focus on **behavior and integration** rather than React basics.95- Use concise descriptions and reference actual prop names and type names from `types.ts`.96- Provide small code snippets for message payload shapes and example message handlers.97- Keep the file within the content length limit; split into sub-documents if the webview grows significantly.9899## Update Strategy100101When the webview UI changes:1021031. Update message type lists and their behavior.1042. Add or update node component mappings.1053. Refresh styling/theming notes if CSS structure changes.1064. Adjust descriptions of initialization and lifecycle to match the current `App.tsx` and `editor.tsx`.1075. Bump version and last-updated metadata.108109110---111> Converted and distributed by [TomeVault](https://tomevault.io/claim/benweatherall) — claim your Tome and manage your conversions.112<!-- tomevault:4.0:skill_md:2026-04-14 -->
Run npx skillmds@latest add tomevault-io/benweatherall-vscode-python-ast-extension-ai-context-webview in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
--- It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.