write-script-php_skill

This skill guides you in writing PHP scripts by structuring main function, resource types, and required libraries for Windmill workflows.
  • 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-php

  • SKILL.md1.5 KB

Overview

This skill guides you to write PHP scripts that run on the Windmill platform. It explains the required script structure, how to declare resource types, and how to list runtime library dependencies so your script runs as a deployable Windmill task. It also covers the basic CLI steps to generate metadata and push scripts to the platform.

How this skill works

Scripts must begin with the PHP opening tag and expose a main function that Windmill will call with parameters. Credentials and configuration are modeled as resource objects; you must redefine resource classes in your script (guarded by a class_exists check) so Windmill can marshal those resources into typed parameters. External libraries are declared as in-file comments and are auto-installed for the runtime.

When to use it

  • When authoring PHP tasks intended to run on Windmill
  • When your script needs platform-managed credentials or typed configuration
  • When you want to declare runtime third-party libraries for the script
  • When preparing scripts to be converted into webhooks, UIs, or workflows on the platform
  • When validating that resource types exist and are correctly typed before use

Best practices

  • Always start the file with <?php and define a main function with typed parameters
  • Redefine resource classes exactly using the resource type names and protect definitions with class_exists
  • Declare each external dependency as a single-line comment before main (one package per line)
  • Keep resource classes minimal: only include fields Windmill will supply (host, port, user, password, etc.)
  • Run metadata generation and push commands after writing or changing scripts to update the platform's catalogs

Example use cases

  • A PHP task that reads credentials from a Postgresql resource and runs a query
  • A webhook handler that uses guzzlehttp/guzzle to call an external API
  • A scheduled workflow step that requires stripe/stripe-php for billing operations
  • A simple string-processing script that returns structured results via the main function
  • A self-hosted deployment where scripts are stored in a folder and synced to Windmill

FAQ

Define a class with the exact resource type name and fields you expect, guarded by class_exists. Windmill will instantiate and pass it to your main function.

How do I add third-party PHP libraries?

List each package on its own comment line before main using the require: comment format. The runtime installs them and autoloading is already handled.

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