windmill-labs / write-script-csharp
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-csharp && curl -L -o skill.zip "https://fastmcp.me/Skills/Download/1787" && unzip -o skill.zip -d .claude/skills/write-script-csharp && rm skill.zip
Project Skills
This skill will be saved in .claude/skills/write-script-csharp/ 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 C# scripts.
0 views
0 installs
Skill Content
---
name: write-script-csharp
description: MUST use when writing C# scripts.
---
## CLI Commands
Place scripts in a folder. After writing, run:
- `wmill script generate-metadata` - Generate .script.yaml and .lock files
- `wmill sync push` - Deploy to Windmill
Use `wmill resource-type list --schema` to discover available resource types.
# C#
The script must contain a public static `Main` method inside a class:
```csharp
public class Script
{
public static object Main(string name, int count)
{
return new { Name = name, Count = count };
}
}
```
**Important:**
- Class name is irrelevant
- Method must be `public static`
- Return type can be `object` or specific type
## NuGet Packages
Add packages using the `#r` directive at the top:
```csharp
#r "nuget: Newtonsoft.Json, 13.0.3"
#r "nuget: RestSharp, 110.2.0"
using Newtonsoft.Json;
using RestSharp;
public class Script
{
public static object Main(string url)
{
var client = new RestClient(url);
var request = new RestRequest();
var response = client.Get(request);
return JsonConvert.DeserializeObject(response.Content);
}
}
```