gardeners

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Gardeners

园丁Agent团队

A team version of the
garden
skill. Instead of one gardener pulling one weed, you spawn a small team that each pulls a different weed in parallel. They share a task list so two gardeners don't fight over the same issue.
Use this when the user wants a broader sweep than a single
garden
run would do -- several small, independent issues fixed in one pass. For a single focused fix, use the
garden
skill directly instead.
garden
技能的团队版本。不同于单个园丁Agent处理一个问题,你可以生成一个小型团队,每个成员并行处理不同的问题。他们共享任务列表,避免两个园丁Agent争抢同一个问题。
当用户希望比单次
garden
运行覆盖更多内容时使用此技能——一次性修复多个独立的小问题。如果是单个聚焦的修复任务,请直接使用
garden
技能。

Flow

流程

  1. Create a team with a shared task list
  2. Spawn N gardeners (default 5) into the team, each instructed to run the
    garden
    skill with coordination rules
  3. Gardeners coordinate via the shared task list -- claim before scanning, stand down on collisions
  4. Collect results as each gardener reports in with a PR URL
  5. Review and merge the PRs, then clean up
  1. 创建团队:创建一个带有共享任务列表的团队
  2. 生成N个园丁Agent(默认5个)加入团队,每个Agent都被指示遵循协作规则运行
    garden
    技能
  3. 园丁Agent协作:通过共享任务列表协作——扫描前先认领任务,遇到冲突时停止操作
  4. 收集结果:每个园丁Agent提交PR链接后汇总结果
  5. 审核并合并PR:完成后清理资源

Step 1: Create the team

步骤1:创建团队

Use
TeamCreate
to make a team named
gardeners
(or similar -- match to the session if helpful):
TeamCreate({team_name: "gardeners", description: "Gardeners running /garden in parallel, coordinating via shared task list"})
This gives the team a shared task list. That task list is the coordination backbone -- it's how siblings discover what's already claimed.
使用
TeamCreate
创建名为
gardeners
的团队(或类似名称——可根据会话调整):
TeamCreate({team_name: "gardeners", description: "Gardeners running /garden in parallel, coordinating via shared task list"})
这会为团队提供一个共享任务列表,该列表是协作的核心——成员们通过它了解哪些任务已被认领。

Step 2: Spawn gardeners

步骤2:生成园丁Agent

Default to five gardeners unless the user asks for a different count. More gardeners means more coverage but more collisions; fewer means less parallelism.
Spawn each one with the
Agent
tool, passing
team_name: "gardeners"
and a distinct
name
. Give them real names, not numbers -- it makes the team feel like a team and the task list easier to read. Pick from the default roster of gardener names and extend it if you need more than five:
  • Herb
  • Basil
  • Rose
  • Fern
  • Pip
  • Sage
  • Hazel
  • Rosemary
Give each the same prompt -- the coordination rules are what keep them from stepping on each other.
默认生成5个园丁Agent,除非用户要求其他数量。数量越多覆盖范围越广,但冲突也越多;数量越少则并行度越低。
使用
Agent
工具生成每个园丁Agent,传入
team_name: "gardeners"
和唯一的
name
。使用真实姓名而非数字——这会让团队更具团队感,任务列表也更易阅读。可从默认的园丁姓名列表中选择,若需要超过5个可扩展列表:
  • Herb
  • Basil
  • Rose
  • Fern
  • Pip
  • Sage
  • Hazel
  • Rosemary
为每个园丁Agent设置相同的提示词——协作规则是避免他们互相干扰的关键。

Gardener prompt template

园丁Agent提示词模板

Each gardener needs:
  • An identity (their name in the team)
  • A reminder that siblings exist
  • The coordination rules below
  • Instructions to run the
    garden
    skill to completion and report back the PR URL
The coordination rules (include these verbatim in every gardener prompt):
1. Before scanning, call TaskList to see what other gardeners have already claimed or completed. Avoid duplicating their work.
2. When you pick an issue, immediately call TaskCreate with a specific subject (e.g. "Fix typo X in file Y") and TaskUpdate to set yourself as owner and status=in_progress. This tells siblings what you're working on.
3. If another gardener has already claimed the issue you'd have picked, scan for a different one -- don't open a duplicate PR.
4. On collision (two gardeners on the same issue), earliest claim wins. The later claimer stands down and picks something else.
5. When done, TaskUpdate status=completed and include the PR URL.
6. You fix exactly one issue. If the scan surfaces others, leave them for the next gardening pass -- don't spin up more tasks or expand scope.
Run gardeners in the background (
run_in_background: true
) so they work in parallel. You'll get a notification as each reports in.
每个园丁Agent需要:
  • 身份标识(团队中的姓名)
  • 提醒存在其他团队成员
  • 以下协作规则
  • 完成
    garden
    技能运行并返回PR链接的指令
协作规则(需逐字包含在每个园丁Agent的提示词中):
1. Before scanning, call TaskList to see what other gardeners have already claimed or completed. Avoid duplicating their work.
2. When you pick an issue, immediately call TaskCreate with a specific subject (e.g. "Fix typo X in file Y") and TaskUpdate to set yourself as owner and status=in_progress. This tells siblings what you're working on.
3. If another gardener has already claimed the issue you'd have picked, scan for a different one -- don't open a duplicate PR.
4. On collision (two gardeners on the same issue), earliest claim wins. The later claimer stands down and picks something else.
5. When done, TaskUpdate status=completed and include the PR URL.
6. You fix exactly one issue. If the scan surfaces others, leave them for the next gardening pass -- don't spin up more tasks or expand scope.
让园丁Agent在后台运行(
run_in_background: true
),以便他们并行工作。每个Agent完成后你会收到通知。

Step 3: Let them work

步骤3:让他们工作

Gardeners will:
  • Post a claim to the task list when they pick an issue
  • Broadcast (via
    SendMessage
    ) if they detect a collision, citing earliest-claim-wins
  • Open a PR and mark their task completed
You generally don't need to intervene. If a gardener seems stuck, send them a message or check the task list for blocked tasks.
园丁Agent会:
  • 选中问题后在任务列表中发布认领信息
  • 检测到冲突时通过
    SendMessage
    广播(引用“最早认领者获胜”规则)
  • 打开PR并标记任务为已完成
通常无需干预。如果某个园丁Agent似乎停滞,可向其发送消息或查看任务列表中的阻塞任务。

Step 4: Collect results

步骤4:收集结果

As each gardener reports in, note the PR URL. Expect between
N-2
and
N
PRs from a team of
N
-- some gardeners may find nothing new to pick after coordination, which is fine.
每个园丁Agent汇报后,记录PR链接。N个成员的团队预计会产生
N-2
N
个PR——部分园丁Agent在协作后可能找不到新任务,这是正常情况。

Step 5: Merge and clean up

步骤5:合并并清理

Review the PRs together. Look for:
  • Duplicates that slipped through (close the losers)
  • PRs that should be combined
Then:
  • Merge the good ones (squash, delete branch)
  • Close any duplicates with a comment pointing at the survivor
  • Prune stale local
    garden/*
    branches that are left over from the team run
  • Shut down the team:
    SendMessage
    a
    shutdown_request
    to each gardener, then
    TeamDelete
统一审核PR,检查:
  • 遗漏的重复PR(关闭次要的)
  • 应该合并的PR
然后:
  • 合并优质PR(压缩提交,删除分支)
  • 关闭重复PR并附上指向保留PR的评论
  • 清理团队运行后遗留的本地
    garden/*
    分支
  • 关闭团队:向每个园丁Agent发送
    shutdown_request
    消息,然后执行
    TeamDelete

Notes

注意事项

  • Earliest claim wins is the simplest collision-resolution rule and the one that worked in practice. Don't overthink it.
  • Shared task list beats chat for coordination. Use
    TaskList
    for status; reserve
    SendMessage
    for collision alerts and direct asks.
  • This skill composes with
    garden
    -- each gardener is just running
    garden
    with extra coordination. If the single-gardener flow changes, this one benefits automatically.
  • Talk like a gardener -- to the user. While running this skill, the orchestrating agent should shift register when addressing the user: speak like a gardener tending a plot, with dry humor. Weeds, flower beds, pruning, seasons. Keep it subtle -- one turn of phrase per update, not a costume. Sibling-gardener prompts stay plain; the vibe is only for the user-facing narration.
  • 最早认领者获胜是最简单的冲突解决规则,且在实践中有效。无需过度复杂化。
  • 共享任务列表比聊天更适合协作。使用
    TaskList
    查看状态;仅在冲突提醒和直接请求时使用
    SendMessage
  • 此技能与
    garden
    组合使用——每个园丁Agent只是在额外协作规则下运行
    garden
    。如果单个园丁Agent的流程发生变化,此技能会自动受益。
  • 以园丁的口吻与用户交流。运行此技能时,编排Agent与用户沟通时应转换语气:像园丁照料菜园一样说话,带点冷幽默。比如用杂草、花坛、修剪、季节等词汇。保持含蓄——每次更新用一个相关短语即可,不必全程扮演。园丁Agent之间的提示词保持平实;这种风格仅用于面向用户的叙述。