gardener-tasks
它能做什么
这份指南讲解如何编写和检查 Gardener 任务。这些任务是简短的 Markdown 文件,用于设置自动运行的 AI 维护作业。适合在代码仓库中管理这些任务的开发者。
适用场景
- ✓当你想在代码仓库中创建新的 Gardener 维护任务时。
- ✓当你需要修改现有的 Gardener 任务文件时。
- ✓当 Gardener 检查失败,你需要了解任务格式有哪些要求时。
技能链接
https://github.com/cloudflare/computer/blob/main/.gardener/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请创建一个 Gardener 任务,每周检查我们文档中的失效链接,并且只编辑 docs 文件夹。”
每周 5 个新技能,1 分钟读完。
工作原理
这个技能会说明文件头部分,它规定任务何时运行、可以读取什么,以及可以做出哪些修改;正文部分则是具体指令。生成的工作流文件由命令重新生成,因此技能会要求你运行该命令,而不是手动编辑这些文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Gardener tasks
Gardener runs AI maintenance tasks on this repository from GitHub Actions. Each task is one Markdown file: YAML frontmatter says when it runs, what the model may read, and exactly which changes it may make; the body is the model's instructions. A planning job runs the model with only the declared tools and lets it plan only the declared effects. A separate job then applies that plan. Nothing outside the declaration is possible, whatever the instructions say.
Files
.gardener/
gardener.json project settings (release pin, optional "handle"); edit only "handle"
gardener.lock.json generated; never edit
SKILL.md this file; generated
tasks/<dir>/TASK.md one task per directory; the only files you write
.github/workflows/
gardener-<id>.yml generated, one per task; never edit
gardener-sync.yml generated (or the "syncWorkflow" name in gardener.json); never edit
Workflow
- Create
.gardener/tasks/<dir>/TASK.md. Start from the template below or an existing task. - Run
npx @scuffi/gardener@0.1.21 generatefrom the repository root (or the repository's ownpackage.jsonscript, if it has one). Use this exact version: a different one produces files the pull request's Check tasks check rejects. - Fix every error
generateprints and read its warnings. Repeat until it succeeds. - Commit the
TASK.md,.gardener/gardener.lock.jsonand the.github/workflows/gardener-*.ymlchanges together. When they reach the default branch, the sync workflow enables the task.
To change a task, edit its TASK.md and run generate again. To remove one, delete its
directory and run generate. Never hand-edit generated files.
Template
---
schema: gardener.task/v1
id: bug-intake
name: Bug intake
description: Asks issue authors for missing reproduction details.
trigger:
event: github.issue.opened
labels-all: [bug]
tools:
- repository.list_files
- repository.read_file
effects:
- issue.comment.create
network:
default: deny
allow: []
deny: []
limits:
runtime-seconds: 300
max-turns: 12
max-tool-calls: 16
input-tokens: 60000
output-tokens: 16000
---
Read the issue and the code it mentions. If it is missing reproduction steps, expected behaviour or
a version, comment once (`issue.comment.create`) asking for exactly what is missing. Otherwise
change nothing. Then finish.
Frontmatter
Unknown keys are errors.
| Key | Required | Meaning |
|---|---|---|
schema |
yes | Always gardener.task/v1. |
id |
yes | Stable identity: lowercase letters, digits, ., _, -. Names the workflow gardener-<id>.yml. Unique per repository. |
name |
yes | Short human name (up to 100 characters). |
description |
yes | One or two sentences (up to 1,000 characters). |
trigger / triggers |
exactly one | A single trigger object, or a list of them. See Triggers. |
tools |
yes | What the model may read or run. At least one. See Tools. |
effects |
no | What the task may change. Omit or [] for a read-only task. See Effects. |
network |
yes | Must be exactly as in Network. |
limits |
yes | Run budget. See Limits. |
model |
no | Model ID. Defaults to "@cf/zai-org/glm-5.3". Quote IDs starting with @. |
draft |
no | true makes the task run only by hand. See Trying a task. |
checkout |
no | pull-request-head checks out a pull request's head instead of GitHub's merge preview, also for comments on a pull request and manual runs naming one. Needs a pull request or issue comment trigger. Implied by commit.merge_base, and when commit.create may write beyond gardener/**. |
reactions |
no | false stops the 👀 reaction while the task works on an issue or comment, and the 🚀 or 😕 it leaves after. On by default. |
effect-scope |
no | trigger confines every run to the issue or pull request that triggered it, even a maintainer's. See Who a run may act on. |
Triggers
Each trigger is event: plus optional filters. A task may use each event at most once.
| Event | Filters |
|---|---|
github.issue.opened, github.issue.edited |
labels-all, mentions, authors |
github.issue.labeled, .unlabeled, .reopened |
labels-all, `op |
常见问题
AI 可以修改任何它想修改的文件吗?
不可以。任务只能做出其文件头中声明的修改。
我应该编辑生成的工作流文件吗?
不应该。生成器会重写这些文件,因此指南明确说明不要手动编辑。
我需要特定版本的生成器吗?
需要。指南要求使用指定的确切版本,因为其他版本生成的文件会无法通过检查。
详情
作者的原始描述
How to write, change and check Gardener tasks (.gardener/tasks/*/TASK.md), the AI maintenance tasks this repository runs from GitHub Actions. Use before creating or editing anything under .gardener/.
repo: cloudflare/computer
热度
- GitHub 星标
- 9.8k
- 排名
- #12209
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
cloudflare
9.8k在开始工作前,指引你的智能体查阅 Workers、Durable Objects、wrangler 及其他服务对应的 Cloudflare 平台指南。
prose
9.8k教你的智能体用简明易懂的英文撰写代码注释、提交信息、README 和文档,避免行话、缩写和官腔。
pull-requests
9.8k教你的智能体撰写清晰的拉取请求描述,讲清一项修改的来龙去脉、它解决的问题,以及如何进行验证。
test-driven-development
9.8k教你的智能体在修改代码前先写一个会失败的测试,并先用测试复现缺陷。帮助证明修改确实有效。