write-script-bunnative

Writes Windmill Bun Native TypeScript scripts that run on the native worker.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires windmill-client.

What problem does it solve? Writing scripts for Windmill's native worker requires following strict conventions — the //native first-line marker, a single exported async main function, and code restricted to fetch and the JavaScript standard library. This Skill ensures generated scripts are routed to the native worker correctly and guides the full local workflow of previewing, metadata regeneration, and deployment. ## Core Features & Use Cases - Native Worker Script Authoring: Generates TypeScript scripts with the mandatory //native header, async main export, and RT namespace resource types. - CLI Workflow Guidance: Distinguishes wmill script preview (local iteration) from wmill script run (deployed version) and wmill generate-metadata (lock/schema sync), preventing accidental deploys. - Windmill Client Integration: Uses windmill-client for resources, variables, state, S3 file operations, job orchestration, and workflow-as-code primitives like step, taskScript, and waitForApproval. - Use Case: You need a lightweight, highly parallelizable script that calls an external HTTP API and stores the result in S3. The Skill produces a //native script using fetch and wmill.writeS3File, then previews it locally with sample arguments. ## Quick Start Write a Bun Native Windmill script that fetches data from an external API and saves the result to S3, then preview it locally with sample arguments.

Frequently Asked Questions about write-script-bunnative

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

FAQPage Schema
How do I write a Bun Native script for Windmill?▼

Start the TypeScript file with //native on the first line and export a single async function named main. Without the //native marker, the same script runs on the regular Bun worker instead of the native worker.

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 local edits. wmill script run executes the version already deployed in the workspace and should only be used when you explicitly want to test the deployed version.

Can Bun Native scripts use npm packages and Node.js APIs?▼

Native scripts can import npm packages and relative Windmill scripts, which are bundled like regular Bun scripts. However, all imported code must rely only on fetch and the JavaScript standard library; anything needing node: modules, the Bun API, or native addons must use the regular bun language instead.

When should I run wmill generate-metadata after editing a script?▼

Run it after edits that change imports or main's arguments, since these invalidate the content hash in wmill-lock.yaml and leave the .lock and .script.yaml input schema stale. It only writes local files and is not a deploy, but it can bump unpinned dependency versions.

How do Windmill native scripts read and write S3 files?▼

Import windmill-client and use wmill.loadS3File, wmill.loadS3FileStream, and wmill.writeS3File with the wmill.S3Object type. The client handles authentication, workspace, and base URL automatically, defaulting to the workspace S3 resource when no resource path is given.