home / skills / 404kidwiz / claude-supercode-skills / powershell-ui-architect-skill

powershell-ui-architect-skill skill

/powershell-ui-architect-skill

This skill helps you design PowerShell GUI and TUI tools using WinForms, WPF, or console interfaces for interactive admin utilities.

npx playbooks add skill 404kidwiz/claude-supercode-skills --skill powershell-ui-architect-skill

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
3.0 KB
---
name: powershell-ui-architect
description: Expert in building GUIs and TUIs with PowerShell using WinForms, WPF, and Console/TUI frameworks. Use when creating PowerShell tools with graphical or terminal interfaces. Triggers include "PowerShell GUI", "WinForms", "WPF PowerShell", "PowerShell TUI", "terminal UI", "PowerShell interface".
---

# PowerShell UI Architect

## Purpose
Provides expertise in building graphical user interfaces (GUI) and terminal user interfaces (TUI) with PowerShell. Specializes in WinForms, WPF, and console-based TUI frameworks for creating user-friendly PowerShell tools.

## When to Use
- Building PowerShell tools with GUI
- Creating WinForms applications
- Developing WPF interfaces for scripts
- Building terminal user interfaces (TUI)
- Adding dialogs to automation scripts
- Creating interactive admin tools
- Building configuration wizards
- Implementing progress displays

## Quick Start
**Invoke this skill when:**
- Creating GUIs for PowerShell scripts
- Building WinForms or WPF interfaces
- Developing terminal-based UIs
- Adding interactive dialogs to tools
- Creating admin tool interfaces

**Do NOT invoke when:**
- Cross-platform CLI tools → use `/cli-developer`
- PowerShell module design → use `/powershell-module-architect`
- Web interfaces → use `/frontend-design`
- Windows app development (non-PS) → use `/windows-app-developer`

## Decision Framework
```
UI Type Needed?
├── Simple Dialog
│   └── WinForms MessageBox / InputBox
├── Full Windows App
│   ├── Simple layout → WinForms
│   └── Rich UI → WPF with XAML
├── Console/Terminal
│   ├── Simple menu → Write-Host + Read-Host
│   └── Rich TUI → Terminal.Gui / PSReadLine
└── Cross-Platform
    └── Terminal-based only
```

## Core Workflows

### 1. WinForms Application
1. Add System.Windows.Forms assembly
2. Create Form object
3. Add controls (buttons, text boxes)
4. Wire up event handlers
5. Configure layout
6. Show form with ShowDialog()

### 2. WPF Interface
1. Define XAML layout
2. Load XAML in PowerShell
3. Get control references
4. Add event handlers
5. Implement logic
6. Display window

### 3. TUI with Terminal.Gui
1. Install Terminal.Gui module
2. Initialize application
3. Create window and views
4. Add controls (buttons, lists, text)
5. Handle events
6. Run main loop

## Best Practices
- Keep UI code separate from logic
- Use XAML for complex WPF layouts
- Handle errors gracefully with user feedback
- Provide progress indication for long operations
- Test on target Windows versions
- Use appropriate UI for audience (GUI vs TUI)

## Anti-Patterns
| Anti-Pattern | Problem | Correct Approach |
|--------------|---------|------------------|
| UI logic mixed with business logic | Hard to maintain | Separate concerns |
| Blocking UI thread | Frozen interface | Use runspaces/jobs |
| No input validation | Crashes, bad data | Validate before use |
| Hardcoded sizes | Scaling issues | Use anchoring/docking |
| No error messages | Confused users | Friendly error dialogs |

Overview

This skill is an expert assistant for designing and building PowerShell graphical and terminal interfaces using WinForms, WPF, and console-based TUI frameworks. It helps you choose the right UI approach, produce working code patterns, and avoid common pitfalls when adding interactivity to PowerShell tools. Use it to accelerate creation of admin tools, configuration wizards, and interactive automation utilities.

How this skill works

The skill inspects your UI requirements (complexity, target platform, and user environment) and recommends WinForms for simple desktop forms, WPF with XAML for rich layouts, or terminal TUI frameworks for cross-platform consoles. It provides concrete workflows: assembly loading and control creation for WinForms, XAML loading and control binding for WPF, and Terminal.Gui initialization for TUIs. It also suggests threading models, event wiring techniques, and validation patterns to keep interfaces responsive and maintainable.

When to use it

  • Building a Windows GUI front end for PowerShell scripts
  • Creating a rich WPF layout or XAML-based dialog
  • Adding simple WinForms dialogs or input boxes
  • Developing terminal UIs for cross-platform or headless use
  • Implementing interactive admin or configuration wizards
  • Adding progress indicators and non-blocking long-task handling

Best practices

  • Separate UI code from business logic; keep logic testable and modular
  • Use XAML for complex WPF layouts and data binding to reduce code-behind
  • Avoid blocking the UI thread; use runspaces, background jobs, or async patterns
  • Validate user input early and provide clear, friendly error feedback
  • Design layouts with anchoring/docking or adaptive sizing to handle scaling
  • Test UI behavior on target Windows versions and terminal environments

Example use cases

  • An installer-style configuration wizard built in WPF with next/back flow and validation
  • A small WinForms admin tool with buttons, textboxes and event-driven tasks
  • A terminal-based dashboard using Terminal.Gui for remote/sysadmin tasks
  • Dialogs to collect credentials or parameters from users in automation scripts
  • Progress windows that run long PowerShell jobs without freezing the interface

FAQ

Which UI should I pick for a simple script dialog?

Use WinForms MessageBox/InputBox for single prompts or small forms; they are simple to implement and integrate.

When should I use WPF instead of WinForms?

Choose WPF when you need complex layouts, styling, data binding, or richer visuals; author XAML for maintainability.

How do I prevent the UI from freezing during long operations?

Run long tasks in a runspace, background job, or separate thread and marshal progress updates back to the UI thread.