write-script-java

Write Java scripts for Windmill with Main class conventions and Maven dependencies.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing Java scripts for the Windmill platform requires following specific structural conventions, such as a public Main class with a static main method, and knowing how to declare Maven dependencies inline. This Skill provides the exact rules and CLI workflow so scripts run correctly on the first attempt. ## Core Features & Use Cases - Java Script Structure: Enforces the required public class Main with a public static Object main(...) entry point and correct return types. - Maven Dependency Management: Shows how to declare dependencies via //requirements: comments, such as Gson or Apache HttpClient. - Windmill CLI Workflow: Guides when to use wmill script preview for local testing versus wmill script run for deployed scripts, and when wmill sync push is appropriate. - Use Case: A developer needs a Java script that parses JSON input with Gson. The Skill produces a compliant Main class, declares the Gson dependency, and previews it locally with sample arguments before any deployment. ## Quick Start Write a Windmill Java script that accepts a name and count parameter and returns them as a map, then preview it locally with sample arguments.

Frequently Asked Questions about write-script-java

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

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

Create a public class named Main containing a public static Object main method whose parameters become the script arguments. Return type must be Object or void, and the method's return value becomes the script result.

How do I add Maven dependencies to a Windmill Java script?

Declare dependencies in comments at the top of the file using the //requirements: block, listing coordinates like com.google.code.gson:gson:2.10.1. You can then import and use those packages normally in your Main class.

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

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

When should I use wmill sync push with Java scripts?

Use wmill sync push only when you explicitly want to deploy local changes to the workspace. Do not push just to test a script, since pushing overwrites the workspace version with untested changes; use script preview instead.

Why does my Windmill Java script fail to run?

Common causes are naming the class something other than Main, missing the public static modifier on the main method, or using a return type other than Object or void. Verify the structure matches the required Main class convention.