windmill-labs / write-script-go
Install for your project team
Run this command in your project directory to install the skill for your entire team:
mkdir -p .claude/skills/write-script-go && curl -L -o skill.zip "https://fastmcp.me/Skills/Download/2989" && unzip -o skill.zip -d .claude/skills/write-script-go && rm skill.zip
Project Skills
This skill will be saved in .claude/skills/write-script-go/ and checked into git. All team members will have access to it automatically.
Important: Please verify the skill by reviewing its instructions before using it.
MUST use when writing Go scripts.
0 views
0 installs
Skill Content
---
name: write-script-go
description: MUST use when writing Go scripts.
---
## CLI Commands
Place scripts in a folder. After writing, tell the user they can run:
- `wmill script generate-metadata` - Generate .script.yaml and .lock files
- `wmill sync push` - Deploy to Windmill
Do NOT run these commands yourself. Instead, inform the user that they should run them.
Use `wmill resource-type list --schema` to discover available resource types.
# Go
## Structure
The file package must be `inner` and export a function called `main`:
```go
package inner
func main(param1 string, param2 int) (map[string]interface{}, error) {
return map[string]interface{}{
"result": param1,
"count": param2,
}, nil
}
```
**Important:**
- Package must be `inner`
- Return type must be `({return_type}, error)`
- Function name is `main` (lowercase)
## Return Types
The return type can be any Go type that can be serialized to JSON:
```go
package inner
type Result struct {
Name string `json:"name"`
Count int `json:"count"`
}
func main(name string, count int) (Result, error) {
return Result{
Name: name,
Count: count,
}, nil
}
```
## Error Handling
Return errors as the second return value:
```go
package inner
import "errors"
func main(value int) (string, error) {
if value < 0 {
return "", errors.New("value must be positive")
}
return "success", nil
}
```