본문으로 건너뛰기
cccskills
무료GitHub에 공개한국어 소개

write-script-go

Windmill용 Go 스크립트의 패키지 구조, 진입 함수, 입력과 반환값, 오류 처리 방식을 안내합니다. 배포 전 로컬 변경 사항을 미리 실행하고 생성된 스키마, 의존성 잠금 파일, 콘텐츠 해시를 맞추는 방법도 다룹니다.

원문원문 설명 보기

MUST use when writing Go scripts.

windmill-labs/windmill스타 18,314(GitHub 18,314 + cccskills 0)

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Windmill용 Go 스크립트 작성
  • Go 함수의 입력과 반환값 정리
  • 배포 전에 로컬 변경 사항 확인

한국어 소개

할 수 있는 일

이 스킬은 Windmill에서 실행할 Go 스크립트의 구조를 안내합니다. 스크립트를 inner 패키지에 두고, 소문자 main 함수가 입력을 받아 JSON으로 변환할 수 있는 값과 error를 반환하도록 작성하는 방법을 설명합니다. 인증 정보와 연결 설정은 코드에 직접 넣지 않고 리소스 인자로 전달하는 방식도 안내합니다. 로컬 변경 사항을 확인할 때는 wmill script preview를 사용하고, 이미 배포된 버전을 실행하는 wmill script run과 구분합니다. 가져오기 항목이나 함수 인자를 바꾼 뒤 .script.yaml, .lock, wmill-lock.yaml을 갱신하는 방법도 다룹니다.

이럴 때 유용합니다

Windmill용 Go 스크립트를 처음 작성하거나 입력, 반환값, 오류 처리의 형태를 확인할 때 사용할 수 있습니다. 배포 전에 로컬 변경 사항을 시험하거나 의존성 잠금 파일과 생성된 메타데이터를 코드에 맞추려는 경우에도 도움이 됩니다.

사용 예시

  • “이 처리를 Windmill용 Go 스크립트로 작성해 주세요.”
  • “Go 스크립트의 인자와 반환값을 정리해 주세요.”
  • “배포 전에 로컬 변경 사항을 미리 실행해 주세요.”

주의 사항

Windmill CLI인 wmill을 사용합니다. wmill script preview는 스크립트를 실행하므로 코드에서 부수 효과가 발생할 수 있습니다. 배포는 사용자가 명시적으로 요청한 경우에만 진행합니다.

이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.

문서 점검

AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.

안전성전송·삭제·명령 실행 등을 명시하고 있는가
A양호미리보기의 부수 효과와 명시적 요청이 있을 때만 배포한다는 조건을 적습니다.
도입의 용이성필요한 도구나 API 키가 적고 적혀 있는가
B일부 부족`wmill` CLI가 필요하지만 설치 방법은 제시하지 않습니다.

점수에는 넣지 않았습니다. 2026년 10월 28일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.

평가가 다르다고 생각되면 재검토를 요청하기

어느 항목이 왜 다르다고 생각하는지 적어 주세요. 로그인은 필요 없습니다. SKILL.md와 대조해 평가를 다시 만들고 이곳에 반영합니다.

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

포함된 파일(1)

  • SKILL.md10.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

CLI Commands

Place scripts in a folder.

After writing, tell the user which command fits what they want to do:

  • wmill script preview <script_path> — default when iterating on a local script. Runs the local file without deploying.
  • wmill script run <path> — runs the script already deployed in the workspace. Use only when the user explicitly wants to test the deployed version, not local edits.
  • wmill generate-metadata — regenerate the local .script.yaml (input schema) and .lock (resolved dependencies) for scripts you changed, and refresh their content hashes in wmill-lock.yaml. Local files only — not a deploy. See "Keep metadata in sync" below.
  • Deploy local changes to the workspace — via git push or wmill sync push depending on how the repo is wired (see the Deploying section in AGENTS.wmill.md). Only suggest/run a deploy when the user explicitly asks to deploy/publish/push — not when they say "run", "try", or "test".

Preview vs run — choose by intent, not habit

If the user says "run the script", "try it", "test it", "does it work" while there are local edits to the script file, use script preview. Do NOT push the script to then script run it — pushing is a deploy, and deploying just to test overwrites the workspace version with untested changes.

Only use script run when:

  • The user explicitly says "run the deployed version" / "run what's on the server".
  • There is no local script being edited (you're just invoking an existing script).

Only use sync push when:

  • The user explicitly asks to deploy, publish, push, or ship.
  • The preview has already validated the change and the user wants it in the workspace.

Keep metadata in sync after editing

wmill-lock.yaml tracks a content hash for each item. Editing a script's content — most importantly adding or removing an import or changing main's arguments — invalidates that hash and leaves the .lock, the .script.yaml input schema, and the hash row out of date. Run wmill generate-metadata (scoped to what you touched) after such edits so the resolved lock, the auto-generated args UI (driven by .script.yaml), and wmill-lock.yaml all match the code. Leaving them stale produces spurious diffs in git-sync and CI.

This only writes local files (it is not a deploy), but it re-resolves dependencies, so it can bump unpinned versions (the same as deploying from the UI; expected, not a bug). So by default offer it and run it once the user agrees, rather than running it silently after every edit — unless the project's AGENTS.md opts into running metadata automatically (see the "Keeping metadata in sync" preference there). Either way YOU run the command, not the user. After running it, diff the regenerated .lock / .script.lock files and tell the user which dependency versions changed (e.g. requests 2.31.0 → 2.32.0), so they can catch an unwanted bump before deploying — even under Metadata: auto, since it's information, not a confirmation gate. Pin versions in code to keep them fixed.

With no path argument, generate-metadata regenerates only the items whose content hash drifted — not everything. Imports propagate: editing a script that others import marks every importer stale too, so a one-line change to a shared module can regenerate many locks (by design — their locks must reflect the imported code). If it touches more than you expect, run wmill generate-metadata --dry-run — it lists each stale item with a reason (content changed or depends on <path>) without changing anything — then narrow with a path argument (wmill generate-metadata f/foo) or --strict-folder-boundaries.

If the on-disk .lock and .script.yaml are already correct and only wmill-lock.yaml needs its hashes refreshed (hash drift, or bootstrapping missing entries), use wmill generate-metadata rehash — it re-records hashes from disk with no backend round-trip and no dependency changes.

After writing — offer to test, don't wait passively

If the user hasn't already told you to run/test/preview the script, offer it as a one-sentence next step (e.g. "Want me to run wmill script preview with sample args?"). Do not present a multi-option menu.

If the user already asked to test/run/try the script in their original request, skip the offer and just execute wmill script preview <path> -d '<args>' directly — pick plausible args from the script's declared parameters. The shape varies by language: main(...) for code languages, the SQL dialect's own placeholder syntax ($1 for PostgreSQL, ? for MySQL/Snowflake, @P1 for MSSQL, @name for BigQuery, etc.), positional $1, $2, … for Bash, param(...) for PowerShell.

wmill script preview does not deploy, but it still executes script code and may cause side effects; run it yourself when the user asked to test/preview (or after confirming that execution is intended). wmill generate-metadata does not deploy either — it only writes local files (locks, schemas, hashes) — but offer it before running (or run automatically if the project's AGENTS.md opts in), per "Keep metadata in sync" above. Deploying to the workspace (git push or wmill sync push depending on how the repo is wired — see the Deploying section) is the only step that mutates remote state — do it only when the user explicitly asks to deploy/publish/push.

For a visual open-the-script-in-the-dev-page preview (rather than script preview's run-and-print-result), use the preview skill.

Use wmill resource-type list --schema to discover available resource types.

Windmill Script Writing Guide

General Principles

  • A script's inputs are its parameters. Credentials and configuration come in as resource-typed parameters, never hard-coded or read from the environment; the language section below shows how that language declares parameters
  • When no resource type exists for a service, still take its connection as one resource-typed parameter, of a custom type holding the connection fields (base URL, account identifiers, credentials), its secret in a variable the resource references. A custom type is named c_<name>, which keeps it apart from a hub type synced later: the parameter takes RT.C<Name> in TypeScript, a c_<name> TypedDict in Python. A plain string parameter or a variable read inside the code only when the user asks for it: the resource keeps a connection's fields together, lets whoever runs the script pick an existing connection, and keeps the secret out of the arguments a run records. If the instance is reported as not having synced the Windmill Hub's resource types, mention that a superadmin can sync them, since the hub has types for most services. Otherwise, or when the user prefers it to syncing, propose the resource type and ask before creating it
  • A Windmill Hub script takes a resource type the hub publishes, so on an instance that has not synced the hub's types that type is missing: say so, and that a superadmin can sync them, before asking for a resource of it. Hub scripts often declare the type inline (type Stripe = { token: string }), which is still the stripe resource type; in code you write, name it the way the language section shows (RT.Stripe in TypeScript) rather than copying the inline declaration
  • Before relying on a resource type, a hub script's included, run wmill resource-type list: it shows whether the workspace has the type, and warns when the instance has not synced the hub's types
  • Libraries are installed automatically - do not show installation instructions
  • In a language with an entrypoint function (TypeScript, Python, Go, Rust, PHP, R, …), name it main (Main in C#) and do not call it; in TypeScript it must be async. SQL, GraphQL, Bash, PowerShell and Ansible scripts have no main: their language section shows how they take arguments
  • Where the language has a Windmill client (wmill), use it to interact with the platform
  • A script's input schema may carry a top-level prompt_for_ai string: its author's instructions to an AI choosing the inputs. Follow it when you pick arguments to run that script, and keep it when you rewrite the schema

Return Values

  • A script can return any JSON-serializable value; a SQL script returns the rows its query produces
  • Return values become available to subsequent flow steps via results.step_id

Preprocessor Scripts

Preprocessor scripts process raw trigger data from various sources (webhook, custom HTTP route, SQS, WebSocket, Kafka, NATS, MQTT, AMQP, Postgres, GCP Pub/Sub, Azure, or email) before passing it to the flow. This separates the trigger logic from the flow logic and keeps the auto-generated UI clean.

A preprocessor is written in TypeScript or Python: its function is named preprocessor instead of main, and it receives a single parameter called event (the language section gives its type).

The returned object determines the parameter values passed to the flow. e.g., { b: 1, a: 2 } calls the flow with a = 2 and b = 1, assuming the flow has two inputs called a and b.

Go

Structure

The file package must be inner and export a function called main:

package inner

func main(param1 string, param2 int) (map[string]interface{}, error) {
    return map[string]interface{}{
        "result": param1,
        "count":  param2,
    }, nil
}

Important:

  • Package must be inner
  • Return type must be ({return_type}, error)
  • Function name is main (lowercase)

Return Types

The return type can be any Go type that can be serialized to JSON:

package inner

type Result struct {
    Name  string `json:"name"`
    Count int    `json:"count"`
}

func main(name string, count int) (Result, error) {
    return Result{
        Name:  name,
        Count: count,
    }, nil
}

Error Handling

Return errors as the second return value:

package inner

import "errors"

func main(value int) (string, error) {
    if value < 0 {
        return "", errors.New("value must be positive")
    }
    return "success", nil
}

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Plan the code changes needed to add a TriggerCrud-based trigger to Windmill. The checklist covers backend, database, API, CLI, frontend, capture, and validation work so the new trigger can be managed across the product.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Add a Kafka, GCP, or Azure style trigger to Windmill
  • Find all product areas affected by a new trigger kind
  • Review implementation and validation steps before a trigger PR
windmill-labs/windmill1.8만2026년 10월 29일 업데이트

agents

무료요약 있음

Windmill에서 지침, AI 제공자와 모델, 대화 기억, 도구를 갖춘 재사용 가능한 AI 에이전트를 정의합니다. 저장한 에이전트를 자체 페이지에서 실행하고, 흐름 단계에서 호출하거나 Slack 채널에 공유할 수 있습니다.

  • 재사용 가능한 지원 에이전트 만들기
  • 흐름에서 저장된 에이전트 호출
  • Slack 채널에 에이전트 공유
windmill-labs/windmill1.8만2026년 10월 29일 업데이트

ai-chat

무료요약 있음

Windmill AI 채팅의 도구, 프롬프트, 결과 형식, 컨텍스트 사용량을 검토하는 지침입니다. 공유 지침의 배치와 반복 토큰 비용 절감, 변경 전후 동작을 A/B 평가로 비교하는 방법을 다룹니다.

  • 채팅 도구와 결과 형식 수정
  • 프롬프트 배치 위치 검토
  • 컨텍스트 창 사용량 줄이기
windmill-labs/windmill1.8만2026년 10월 29일 업데이트

ai-evals

무료요약 있음

Windmill의 AI 생성 모드에서 블랙박스 벤치마크 사례를 만들고 실행합니다. 플로, 앱, 스크립트, CLI, 전역 요청을 실제 생성 경로로 시험하고, 필수 조건을 검사한 뒤 대규모 언어 모델 평가로 변경 전후의 사용자 관점 결과를 비교합니다.

  • AI 생성 모드 평가 사례 추가
  • AI 채팅 변경 전후 비교
  • copilot 생성 품질 확인
windmill-labs/windmill1.8만2026년 10월 29일 업데이트

cli-commands

무료요약 있음

Windmill CLI로 스크립트, 흐름, 데이터 테이블과 작업 공간 설정을 관리하는 참조 자료입니다. 작업 실행 기록, 세부 정보, 로그와 결과를 확인하고 실패한 작업을 재실행하는 방법도 다룹니다.

  • 작업 실패 원인 조사하기
  • 실행 기록과 작업 로그 확인하기
  • CLI로 스크립트와 흐름 관리하기
windmill-labs/windmill1.8만2026년 10월 29일 업데이트

codebase-design

무료요약 있음

인터페이스는 간결하게 유지하면서 복잡한 동작은 모듈 내부에 모으는 설계를 돕습니다. 호출자가 알아야 할 내용을 줄이고, 동작을 바꿀 위치를 정하며, 코드를 테스트하고 수정하기 쉽게 정리할 수 있습니다.

  • 모듈 인터페이스 설계
  • 기존 모듈의 복잡성 정리
  • 동작을 바꿀 위치 결정
windmill-labs/windmill1.8만2026년 10월 29일 업데이트

windmill-labs의 스킬 모두 보기

이 스킬의 문제 신고