warp-app-services

Bootstraps WinForms applications with WARP-Toolkit hosting, DI, and app-level services.

1|1|Updated Jun 12, 2022
One-click install
npx skills add https://github.com/KlausLoeffelmann/WinFormsDevTools --skill warp-app-services-klausloeffelmann
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: warp-app-services
Source: https://github.com/KlausLoeffelmann/WinFormsDevTools/tree/main/.github/skills/WARP-AppServices
Command: npx skills add https://github.com/KlausLoeffelmann/WinFormsDevTools --skill warp-app-services-klausloeffelmann

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Classic WinForms apps start with Application.Run(new MainForm()) and lack dependency injection, structured configuration, and testable view-models. This Skill guides you through refactoring that startup into the WARP-Toolkit's IHost-based model, giving WinForms apps the same hosting, DI, and JSON-settings patterns that ASP.NET Core developers already know. ## Core Features & Use Cases - Hosted App Bootstrap: Replace Application.Run with WinFormsApplication.CreateBuilder, configuring color mode, High DPI, visual styles, and the startup form through a fluent builder. - App-Level Services via DI: Register and consume IDialogService, IWinFormsAppExceptionService, IUserSettingsService, and EnvironmentVariableKeyService for AI provider API keys. - MVVM Without WinForms Coupling: View-models reference only WarpToolkit.Desktop.AppServices contracts, so they stay unit-testable and UI-framework agnostic. - Use Case: You are modernizing a line-of-business WinForms app. Use this Skill to convert Program.cs to the builder model, persist form bounds and DataGridView column widths as user settings, and let view-models show confirmation dialogs without referencing System.Windows.Forms. ## Quick Start Ask the AI to refactor your WinForms Program.cs from Application.Run into the WARP WinFormsApplication builder with dialog, exception, settings, and key-retrieval services registered.

Frequently Asked Questions about warp-app-services

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add dependency injection to a WinForms application?▼

Use WinFormsApplication.CreateBuilder from WarpToolkit.WinForms.AppServices instead of Application.Run. Register services on builder.Services with extension methods like AddWinFormsDialogService, then call builder.Build().Run() to start the hosted app.

How to show dialogs from a WinForms view-model without System.Windows.Forms?▼

Inject IDialogService from WarpToolkit.Desktop.AppServices into the view-model and call methods like ShowConfirmationAsync or ShowDialogAsync. The view-model references only the contracts package, keeping it unit-testable with a mocked IDialogService.

Does the WARP WinForms builder work with VB.NET projects?▼

Yes, but you must create a Program.vb with a Main method and disable the VB Application Framework. The WARP builder model replaces the AppFramework's My Application singleton, which otherwise causes designer and multi-form issues.

Why does my DI-injected WinForms Form break the Designer?▼

The parameterized constructor must chain to the parameterless Designer constructor with : this() and wrap the provider in a DeferredServiceProvider. Calling InitializeComponent directly from the parameterized constructor breaks Designer round-trips and runs it twice.

How do I store AI provider API keys in a WinForms app?▼

Register EnvironmentVariableKeyService via AddLocalKeyRetrievalService and use GetAiProviderKey or SetAiProviderKey with WellKnownAIProviders. Keys live in environment variables, never in source code; use TryGetAiProviderKey when a key may not be configured yet.