write-script-go

Writes Go scripts for Windmill with correct package structure and CLI preview commands.

Updated May 28, 2026
One-click install
npx skills add https://github.com/kma-core/windmill --skill write-script-go-kma-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-script-go
Source: https://github.com/kma-core/windmill/tree/main/system_prompts/auto-generated/skills/write-script-go
Command: npx skills add https://github.com/kma-core/windmill --skill write-script-go-kma-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing Go scripts for the Windmill platform requires following specific conventions (package inner, a main function, JSON-serializable return types) and knowing which CLI command to use for testing versus deploying. This Skill ensures generated Go scripts follow those rules and that scripts are previewed locally rather than accidentally deployed. ## Core Features & Use Cases - Go Script Conventions: Enforces the required package inner structure, lowercase main function, and ({return_type}, error) return signature. - CLI Command Guidance: Distinguishes between wmill script preview for local iteration, wmill script run for deployed scripts, and wmill sync push for explicit deployments. - Error Handling Patterns: Demonstrates idiomatic Go error returns and JSON-serializable struct return types. - Use Case: A developer asks for a Go script that processes input parameters and returns a structured result; the Skill produces a compliant script and offers to run wmill script preview with sample arguments. ## Quick Start Write a Windmill Go script that takes a name and count as parameters and returns them as a JSON object, then preview it locally.

Frequently Asked Questions about write-script-go

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

FAQPage Schema
How do I write a Go script for Windmill?

Create a file with package inner and export a lowercase main function that accepts parameters and returns a JSON-serializable type plus an error. Place the script in a folder and use wmill script preview to test it locally.

What is the difference between wmill script preview and script run?

wmill script preview executes a local script file without deploying it, making it the default for iterating on edits. wmill script run executes the version already deployed in the workspace and should only be used when testing the deployed version.

What return types can a Windmill Go script use?

Any Go type serializable to JSON works, including maps like map[string]interface{} or custom structs with json tags. The function must return that type plus an error as the second value.

When should I use wmill sync push?

Use wmill sync push only when explicitly deploying or publishing changes to the workspace. Pushing overwrites the workspace version, so local edits should be validated with script preview first.

How do I handle errors in a Windmill Go script?

Return errors as the second return value of the main function, for example returning an empty result with errors.New when validation fails. Windmill surfaces the returned error as the script's failure output.