write-script-java_skill

This skill helps you write Java scripts with a standardized Main class, enabling structured input handling and JSON-friendly outputs.
  • HTML

15.8k

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill windmill-labs/windmill --skill write-script-java

  • SKILL.md1.2 KB

Overview

This skill provides concise rules and examples for writing Java scripts that run on the platform. It explains required class/method signatures, how to declare Maven dependencies inline, and the CLI steps to generate metadata and deploy scripts. Follow these conventions to ensure the platform recognizes and executes your Java script correctly.

How this skill works

The platform expects a single public class named Main with a public static Object main(...) method (or void). You can return any serializable object or void. Maven dependencies are declared using special comment lines at the top of the file, which the build system reads to fetch required libraries. After authoring, run the provided CLI commands to generate metadata and push the script to the platform.

When to use it

  • Creating a Java-based script that will be executed as a webhook, workflow task, or UI action
  • Needing external libraries—declare them via the inline requirements comments
  • Converting existing Java utility code into a platform script
  • Building scripts that return structured JSON-like objects to downstream steps
  • Deploying scripts to a self-hosted instance where explicit metadata generation is required

Best practices

  • Always name the top-level class Main and the entry method public static Object main(...) or void
  • Keep method parameters simple and serializable (strings, numbers, maps), and return plain Java maps/lists for easy JSON conversion
  • Declare external libraries at the top using //requirements:group:artifact:version one per line
  • Test locally with representative inputs before running metadata generation and deployment
  • Use wmill script generate-metadata to create .script.yaml and .lock files, then wmill sync push to deploy

Example use cases

  • Parsing JSON input with Gson: add gson via requirements and return a parsed object
  • Calling an HTTP API: declare httpclient in requirements and perform requests in main
  • Transforming database rows into structured objects for workflows
  • Wrapping utility Java code as a webhook handler that returns a map with keys read by later steps

FAQ

The class must be named Main and the entry must be public static Object main(...) or public static void main(...).

How do I add external libraries?

List Maven coordinates at the top of the file using comment lines that start with //requirements:group:artifact:version. The build system reads these to fetch dependencies.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
write-script-java skill by windmill-labs/windmill | VeilStrat