本文へ移動
cccskills
無料GitHub で公開日本語紹介

resources

Windmillで外部サービスの接続情報や設定をリソースとして管理し、秘密情報を変数参照で扱うためのスキルです。

原文原文の説明を見る

MUST use when managing resources.

windmill-labs/windmillスター 18,283(GitHub 18,283 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • Windmillの接続設定をリソース化したいとき
  • 秘密情報を変数参照で管理したいとき
  • 実行引数から保存済みリソースを使いたいとき
  • 独自サービス用のリソース型を定義したいとき

日本語での紹介

できること

Windmillで、データベースや外部サービスへの接続情報をリソースとして管理するためのスキルです。リソースファイルの形式や必須項目を確認し、PostgreSQL、MySQL、Slack、S3、HTTP/API、Kafka、NATS、MQTTなどの設定例に沿って内容を組み立てます。パスワードやAPIキーなどの秘密情報はファイルに直接書かず、Windmillの変数に保存して $var:<path> で参照します。スクリプトやフローの実行引数では、リソースや変数を $res:<path>、$var:<path> の文字列として渡す方法も扱います。既存の型が合わない場合は、カスタムリソース型の定義方法を確認できます。

こんなときに便利

Windmillのワークスペースで接続設定を整理したいときや、スクリプト・フローから保存済みの資格情報を安全に参照したいときに向いています。OAuthリソースや独自の接続型を扱う際の形式確認にも使えます。

使い方の例

  • 「このPostgreSQL接続をWindmillのリソース形式にしてください」
  • 「フローの引数で保存済みのリソースを参照する方法を確認してください」
  • 「このサービス用のカスタムリソース型のスキーマ案を作ってください」

注意点

秘密情報はリポジトリ内のファイルに平文で保存せず、ワークスペース上の秘密変数として作成し、そのパスを参照します。参照先の変数やリソースを実行時の実行者が読み取れない場合、ジョブは失敗します。リソースのデプロイはリモート状態を変更するため、明示的に依頼された場合に限ります。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md8.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Windmill Resources

Resources store credentials and configuration for external services.

File Format

Resource files use the pattern: {path}.resource.json

Example: f/databases/postgres_prod.resource.json

Resource Structure

{
  "value": {
    "host": "db.example.com",
    "port": 5432,
    "user": "admin",
    "password": "$var:g/all/db_password",
    "dbname": "production"
  },
  "description": "Production PostgreSQL database",
  "resource_type": "postgresql"
}

Required Fields

  • value - Object containing the resource configuration
  • resource_type - Name of the resource type (e.g., "postgresql", "slack")

Agents

An agent, as the Agents page lists it, is a resource of type ai_agent. Its value holds the agent's provider, system prompt, tools and memory settings, and a flow step uses a saved agent by linking its path.

Variable References

Reference variables in resource values:

{
  "value": {
    "api_key": "$var:g/all/api_key",
    "secret": "$var:u/admin/secret"
  }
}

Reference formats:

  • $var:g/all/name - Global variable
  • $var:u/username/name - User variable
  • $var:f/folder/name - Folder variable

Secrets

Never put a secret (password, API key, token) inline in a resource value. Store it in a secret variable and reference that variable as $var:<path>.

  • $var:<path> is a reference, not a value: it resolves to the variable's value at run time. Never invent a value for a variable.
  • A resource that references a variable needs the variable to exist first, so create or deploy the variable before the resource.
  • A secret's plaintext never goes in a file of the repo: a .variable.yaml holding it would be committed. Ask the user to create the secret on the workspace instead, e.g. wmill variable add '<value>' <path> (a secret by default), then reference it by path.

Resource References

Reference other resources:

{
  "value": {
    "database": "$res:f/databases/postgres"
  }
}

Passing a Resource or Variable as a Run Argument

A script or flow argument typed as a resource (schema format: resource-<type>) is passed as the bare string $res:<path> — the whole argument value. Same for a variable, with $var:<path>. This applies everywhere job arguments are supplied: wmill script run/preview, wmill flow run/preview, the runScriptByPath / runFlowByPath API, a schedule's args, a trigger's configured static args.

{
  "db": "$res:f/databases/postgres_prod",
  "api_token": "$var:g/all/api_token"
}

The reference is resolved when the job runs, under the job's run-as identity — the caller for an ordinary run, but the configured principal for a schedule, a trigger, or a runnable set to run on behalf of someone else. The run fails if that identity cannot read the referenced resource or variable.

Never wrap it in an object. The resolver only rewrites a JSON value that is a string starting with $res: / $var:; keys are never inspected. These are all wrong and are passed through to the script unchanged:

{ "db": { "$res": "f/databases/postgres_prod" } }
{ "db": { "resource": "f/databases/postgres_prod" } }
{ "db": "f/databases/postgres_prod" }

The string may sit anywhere a string can — a top-level argument, a nested object field ({ "gh_auth": { "token": "$var:g/all/gh_token" } }), or an array element (array elements are walked only while nested at most two levels deep, and only for arrays of at most 1000 items). The prefix must be on the string itself.

Common Resource Types

PostgreSQL

{
  "resource_type": "postgresql",
  "value": {
    "host": "localhost",
    "port": 5432,
    "user": "postgres",
    "password": "$var:g/all/pg_password",
    "dbname": "windmill",
    "sslmode": "prefer"
  }
}

MySQL

{
  "resource_type": "mysql",
  "value": {
    "host": "localhost",
    "port": 3306,
    "user": "root",
    "password": "$var:g/all/mysql_password",
    "database": "myapp"
  }
}

Slack

{
  "resource_type": "slack",
  "value": {
    "token": "$var:g/all/slack_token"
  }
}

AWS S3

{
  "resource_type": "s3",
  "value": {
    "bucket": "my-bucket",
    "region": "us-east-1",
    "accessKeyId": "$var:g/all/aws_access_key",
    "secretAccessKey": "$var:g/all/aws_secret_key"
  }
}

HTTP/API

{
  "resource_type": "http",
  "value": {
    "baseUrl": "https://api.example.com",
    "headers": {
      "Authorization": "Bearer $var:g/all/api_token"
    }
  }
}

Kafka

{
  "resource_type": "kafka",
  "value": {
    "brokers": "broker1:9092,broker2:9092",
    "sasl_mechanism": "PLAIN",
    "security_protocol": "SASL_SSL",
    "username": "$var:g/all/kafka_user",
    "password": "$var:g/all/kafka_password"
  }
}

NATS

{
  "resource_type": "nats",
  "value": {
    "servers": ["nats://localhost:4222"],
    "user": "$var:g/all/nats_user",
    "password": "$var:g/all/nats_password"
  }
}

MQTT

{
  "resource_type": "mqtt",
  "value": {
    "host": "mqtt.example.com",
    "port": 8883,
    "username": "$var:g/all/mqtt_user",
    "password": "$var:g/all/mqtt_password",
    "tls": true
  }
}

When No Resource Type Fits

The Windmill Hub publishes resource types for most services, and an instance gets them by syncing with the hub. When none fits the service:

  • If the instance is reported as not having synced the hub's types, mention that a superadmin can sync them: the hub most likely has one for the service. That holds for a type a hub script takes too: it is missing here until the sync, so say so before asking for a resource of it. Create one of your own only if the user still wants it, since after a sync the workspace would hold both.
  • Otherwise, or when the user prefers it to syncing, propose a custom resource type named c_<name> holding the service's connection fields (base URL, account or region identifiers, credentials), as in "Custom Resource Types" below, and ask the user before creating it: every resource of that type and every script taking one depends on its fields.
  • A plain variable instead of a resource is fine when the user asks for it; without that, default to the resource, its secret in a variable it references.

Custom Resource Types

A custom type's name starts with c_: the hub's types reach every instance under their plain names, so the prefix keeps a custom type from clashing with one synced later. Scripts and flows refer to the full name: format: resource-c_custom_api, RT.CCustomApi in TypeScript, a c_custom_api TypedDict in Python.

Create custom resource types with JSON Schema:

{
  "name": "c_custom_api",
  "schema": {
    "type": "object",
    "properties": {
      "base_url": {"type": "string", "format": "uri"},
      "api_key": {"type": "string"},
      "timeout": {"type": "integer", "default": 30}
    },
    "required": ["base_url", "api_key"]
  },
  "description": "Custom API connection"
}

Save as: c_custom_api.resource-type.json

OAuth Resources

OAuth resources are managed through the Windmill UI and marked:

{
  "is_oauth": true,
  "account": 123
}

OAuth tokens are automatically refreshed by Windmill.

Using Resources in Scripts

TypeScript (Bun/Deno)

export async function main(db: RT.Postgresql) {
  // db contains the resource values
  const { host, port, user, password, dbname } = db;
}

Python

class postgresql(TypedDict):
    host: str
    port: int
    user: str
    password: str
    dbname: str

def main(db: postgresql):
    # db contains the resource values
    pass

CLI Commands

# List resources
wmill resource list

# List resource types with schemas
wmill resource-type list --schema

# Get specific resource type schema
wmill resource-type get postgresql

# Deploy resources to the workspace — destructive to remote state, so only run when
# the user explicitly asks to deploy/publish/push. Depending on how the repo is wired,
# deploy via `git push` or `wmill sync push` (see the Deploying section in AGENTS.wmill.md).
wmill sync push

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

adding-a-trigger

無料概要あり

Windmillに新しいTriggerCrud型のトリガーを追加する際、バックエンドからCLI、画面、同期やキャプチャ機能まで必要な変更箇所を確認できる開発チェックリストです。

  • 新しい外部サービスのトリガーを追加したいとき
  • 実装箇所の抜け漏れを点検したいとき
  • トリガー追加のPR前に検証したいとき
windmill-labs/windmill1.8万2026年10月26日 更新

ai-chat

無料概要あり

WindmillのAIチャットを変更するときに、ツールやプロンプト、結果の返し方、コンテキスト量を整理し、評価で変更前後の挙動を比べるための指針です。

  • チャットツールを変更したいとき
  • プロンプトの配置を見直したいとき
  • コンテキスト消費を抑えたいとき
windmill-labs/windmill1.8万2026年10月26日 更新

ai-evals

無料概要あり

WindmillのAI生成モード向けに、実際の利用要求に沿ったベンチマークケースを作成・実行します。生成結果を決定的な検証とLLM評価で確認し、AIチャットやcopilotの変更前後を比較できます。

  • AI生成モードの評価ケースを追加したいとき
  • AIチャットの変更前後を比較したいとき
  • copilotの生成品質を確認したいとき
windmill-labs/windmill1.8万2026年10月26日 更新

cli-commands

無料概要あり

Windmill CLIのコマンドを使い、スクリプトやフローなどの管理、ジョブの実行履歴確認、失敗原因の調査を進めるためのリファレンスです。

  • 失敗したジョブの原因を調べたいとき
  • 実行履歴やジョブログを確認したいとき
  • CLIでスクリプトやフローを管理したいとき
windmill-labs/windmill1.8万2026年10月26日 更新

codebase-design

無料概要あり

モジュールのインターフェースを小さく保ちながら、内部に複雑な処理をまとめる設計を支援します。テストしやすさや変更のしやすさを考え、処理の境目を整理できます。

  • モジュールのインターフェースを設計したいとき
  • 既存モジュールの複雑さを整理したいとき
  • 処理を差し替える境目を決めたいとき
windmill-labs/windmill1.8万2026年10月26日 更新

commit

無料概要あり

変更内容を確認し、対象ファイルだけを選んで、形式や長さの規則に沿ったConventional Commits形式のGitコミットを作成するスキルです。

  • 機能追加をコミットしたいとき
  • バグ修正を記録したいとき
  • 変更内容に合うコミット文を作りたいとき
windmill-labs/windmill1.8万2026年10月26日 更新

windmill-labs のスキルをすべて見る

このスキルの問題を報告する