src/Hex1b.McpServer/SKILL.md
# Hex1b MCP Server Skill This skill provides guidance for AI agents working with the Hex1b TUI (Terminal User Interface) library and its MCP diagnostic tools. ## Overview **Hex1b** is a .NET library for building terminal user interfaces with a React-inspired declarative API. The library ships to NuGet as `Hex1b`. - **Documentation**: https://hex1b.dev - **Repository**: https://github.com/AsciiCraft/hex1b - **NuGet**: https://www.nuget.org/packages/Hex1b ## MCP Tools Reference The Hex1b MCP
npx skillsauth add mitchdenny/hex1b src/Hex1b.McpServerInstall 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.
This skill provides guidance for AI agents working with the Hex1b TUI (Terminal User Interface) library and its MCP diagnostic tools.
Hex1b is a .NET library for building terminal user interfaces with a React-inspired declarative API. The library ships to NuGet as Hex1b.
The Hex1b MCP server provides tools for interacting with running Hex1b applications that have diagnostics enabled.
GetHex1bStacksWithDiagnosticsEnabledLists all running Hex1b applications with diagnostics enabled.
DiscoverHex1bStacksDiscovers and connects to all Hex1b applications with diagnostics enabled.
CaptureHex1bTerminalCaptures the terminal screen state.
processId: Process ID of the Hex1b applicationsavePath: File path to save the captureformat: "ansi", "svg", or "text" (default: "ansi")CaptureTerminalScreenCaptures the terminal screen in various formats.
sessionId: Session ID of connected terminalformat: "text", "ansi", or "svg"savePath: Optional file path to saveSendInputToHex1bTerminalSends input characters to a Hex1b application.
processId: Process ID of the target applicationinput: Text to send (supports \n, \t, \x1b escape sequences)SendTerminalKeySends a special key to a terminal.
sessionId: Session ID of terminalkey: Key name (Enter, Tab, Escape, Up, Down, Left, Right, F1-F12, etc.)modifiers: Optional array ["Ctrl", "Alt", "Shift"]SendTerminalMouseClickSends a mouse click to a terminal.
sessionId: Session ID of terminalx, y: Cell coordinates (0-based)button: "left", "middle", or "right"GetHex1bTreeIMPORTANT: Use this tool to debug layout, hit testing, and focus issues.
processId: Process ID of the Hex1b applicationtree: Full widget/node hierarchy with bounds, hit test bounds, and propertiespopups: Popup stack entries with anchor info and stale statusfocusInfo: All focusable nodes with positions and last hit test debug infoConnectToHex1bStackConnects to a remote Hex1b application by process ID.
ListTerminalsLists all active terminal sessions.
ListAllTerminalTargetsLists both local terminals and remote Hex1b connections.
To enable MCP diagnostics in a Hex1b application:
await using var terminal = Hex1bTerminal.CreateBuilder()
.WithDiagnostics() // Enable MCP diagnostics
.WithHex1bApp((app, options) => ctx => ctx.Text("Hello!"))
.Build();
await terminal.RunAsync();
Note: WithDiagnostics() is automatically disabled in Release builds for security. To force enable in Release:
.WithMcpDiagnostics(forceEnable: true)
For unit tests, use headless mode to avoid terminal I/O:
[Fact]
public async Task MyWidget_Click_PerformsAction()
{
// Arrange
await using var terminal = Hex1bTerminal.CreateBuilder()
.WithHeadless(80, 24) // No real terminal
.WithDiagnostics() // Enable for debugging if needed
.WithHex1bApp((app, options) => ctx =>
ctx.Button("Click me", e => { /* handler */ }))
.Build();
// Act
await terminal.StartAsync();
terminal.SendMouseClick(MouseButton.Left, 5, 0);
await terminal.ProcessEventsAsync();
// Assert
var snapshot = terminal.CreateSnapshot();
Assert.Contains("expected text", snapshot.GetText());
}
WithHeadless(width, height) - Runs without a real terminalterminal.SendMouseClick() / terminal.SendKey() - Inject inputterminal.ProcessEventsAsync() - Process pending eventsterminal.CreateSnapshot() - Capture screen for assertionsWithDiagnostics() - Enable when debugging test failuresWhen tests fail unexpectedly:
WithDiagnostics() in the testGetHex1bTree MCP tool to inspect:
*Widget): Immutable records describing what to render*Node): Mutable classes managing state and rendering| Node | Purpose |
|------|---------|
| ZStackNode | Popup host, layers children on Z-axis |
| VStackNode / HStackNode | Vertical/horizontal layout |
| ButtonNode | Clickable button |
| TextBlockNode | Text display |
| TableNode | Data table with scrolling |
| PickerNode | Dropdown selection |
| MenuNode | Menu bar item |
| BackdropNode | Modal backdrop with click-away |
| AnchoredNode | Positions popup relative to anchor |
FocusRing.HitTest(x, y) finds the focusable node at a positionnode.HitTestBounds which may differ from node.BoundsBounds return Rect.Zero for HitTestBounds to prevent ghost hitsGetHex1bTree to inspect focusInfo.focusablesbounds vs hitTestBoundsbounds: (0,0,0,0) but non-zero hitTestBoundspopups array in tree outputanchorInfo.isStale: true indicating stale anchor referencefocusInfo.currentFocusIndex and focusedNodeTypefocusables arrayisFocusable: true on the nodeIf you're an AI agent and want to save this skill for future use:
GetHex1bSkill to get this content.github/skills/hex1b-mcp.md or your project's skill directorytools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.