write-script-java

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

1|Updated Aug 3, 2026
One-click install
npx skills add https://github.com/vpzed-dev/smithy --skill write-script-java-vpzed-dev
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: write-script-java
Source: https://github.com/vpzed-dev/smithy/tree/main/windmill/local-dev/.agents/skills/write-script-java
Command: npx skills add https://github.com/vpzed-dev/smithy --skill write-script-java-vpzed-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing Java scripts for the Windmill platform requires following specific structural conventions—a public Main class with a static main method, comment-based Maven dependency declarations, and correct CLI workflows for previewing, running, and syncing metadata. This Skill ensures every Java script you write conforms to those requirements and that you use the right wmill command at each stage. ## Core Features & Use Cases - Java Script Structure: Enforces the required public class Main with a public static Object main(...) entry point, returning Object or void. - Maven Dependencies via Comments: Declares dependencies like Gson or Apache HttpClient using //requirements: comment blocks at the top of the file. - CLI Workflow Guidance: Distinguishes wmill script preview (test local edits) from wmill script run (deployed version) and wmill generate-metadata (sync locks and schemas), preventing accidental deploys. - Use Case: You need a Windmill script that parses JSON input with Gson. The Skill produces a compliant Main class, adds the Gson requirement comment, and previews it locally with sample arguments before any deploy. ## Quick Start Write a Windmill Java script that takes a name and count as arguments 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's input arguments. The method returns an Object or void, and the file is placed in a folder within the Windmill workspace.

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

Add dependencies as comments at the top of the file using a //requirements: block, with each dependency on its own line in groupId:artifactId:version format, such as //com.google.code.gson:gson:2.10.1. Then import and use the classes normally.

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

wmill script preview executes the local script file without deploying, making it the default for iterating on edits. wmill script run executes the version already deployed in the workspace, so use it only when you explicitly want to test the deployed version.

Why is my Windmill script metadata out of sync after editing?▼

Editing a script's imports or main arguments invalidates its content hash in wmill-lock.yaml and leaves the .lock and .script.yaml files stale. Run wmill generate-metadata to regenerate locks, input schemas, and hashes so git-sync and CI stay clean.

Does wmill generate-metadata deploy my script?▼

No, generate-metadata only writes local files such as locks, schemas, and hashes; it does not deploy. However, it re-resolves dependencies, which can bump unpinned versions, so review the diff before deploying.