跳到正文
cccskills
免费在 GitHub 公开中文介绍

resources

在 Windmill 中用资源管理外部服务连接配置,并通过变量引用密码和 API 密钥等秘密信息;还可将已保存的资源用于脚本或流程运行参数,或定义自定义资源类型。

原文查看原文说明

MUST use when managing resources.

windmill-labs/windmill星标 18,314(GitHub 18,314 + 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 资源格式。”
  • “如何在流程参数中引用已保存的资源?”
  • “请为这个服务拟定自定义资源类型的模式。”

注意事项

不要将秘密信息以明文保存在仓库文件中。应在工作区创建秘密变量,并引用其路径。如果运行身份无权读取所引用的变量或资源,作业会失败。部署资源会改变远程状态,因此只有在用户明确要求时才进行部署。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

文档检查

AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。

安全性发送数据、删除文件、执行命令等是否有说明
A良好要求使用秘密变量,说明读取权限,并规定明确请求后才部署。
安装难易度所需工具和 API 密钥是否少且有说明
B部分不足以 Windmill 工作区和 CLI 为前提,但未提供安装步骤。

不计入评分。 由 AI(OpenAI Codex)于 2026年10月28日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(1)

  • SKILL.md8.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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. Before writing one, use the agents skill.

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 的隐私权政策和服务条款。

同一仓库的技能

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 智能体,为其配置指令、提供方、模型、对话记忆和工具。保存后可从页面运行、供流程步骤调用,或分享到 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 的全部技能

报告此技能的问题