orchestrating-gemini-workers
Use when a coding task can be split into small, independently-specifiable file-writing subtasks and you want to delegate each to a sandboxed headless LLM worker (e.g. gemini via dsh) instead of writing every file yourself — especially across a long series of similar subtasks (extractors, one-screen-at-a-time ports, repetitive refactors) where you want to stay the reviewer, not the typist.
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- orchestrating-gemini-workers
- description
- Use when a coding task can be split into small, independently-specifiable file-writing subtasks and you want to delegate each to a sandboxed headless LLM worker (e.g. gemini via dsh) instead of writing every file yourself — especially across a long series of similar subtasks (extractors, one-screen-at-a-time ports, repetitive refactors) where you want to stay the reviewer, not the typist.
02 资源文件 6
- 参考文档agents/openai.yaml161 B
- 其他templates/AGENTS.md.template1.5 KB
- 参考文档templates/BRIEF.template.md1.1 KB
- 参考文档templates/dsh/base.yml1.1 KB
- 参考文档templates/dsh/model-example.yml370 B
- 脚本templates/run-worker.ps15.4 KB
03 SKILL.md 正文
Orchestrating Gemini Workers
Controller specifies/reviews; sandboxed headless worker writes one small, independently specified unit. Worker sees no conversation: brief must contain all needed context. Use for repetitive file tasks with independently derived, checkable acceptance criteria and fast objective checks. Architecture/exploration decisions, unclear criteria or context that cannot fit a self-contained brief stay with controller.
The historical source example-log.md is intentionally omitted: its task IDs, model names, and run outcomes are project-specific evidence, not portable validation for new tasks. No run results are claimed here.
Setup and launch
Within authorized project scope, adapt these shipped templates:
| Source | Destination / adaptation |
|---|---|
| run-worker.ps1 | orchestration/run-worker.ps1; adapt paths. |
| base.yml | orchestration/dsh/base.yml; sandbox/approval overlay. |
| model-example.yml | orchestration/dsh/model-<id>.yml; real installed model/adapter fields. |
| AGENTS.md.template | <workspace>/AGENTS.md; forbidden files, technical constraints, comment language. |
| BRIEF.template.md | orchestration/briefs/<name>.md; one per task. |
Worker cwd is workspace root. Copy needed source/reference material into it before launch and remove temporary copies afterward; exclude them from shipped build. Verify installed dsh/adapter, selected overlays, preset and sandbox behavior; templates do not prove tool availability or read confinement. base.yml sets workspace-write, root process.cwd(), approval never, and matching workspace-auto preset. Do not silently widen permissions.
If dsh, a compatible Gemini adapter/model, or the required sandbox/approval preset is unavailable, stop before dispatch and report the missing prerequisite. Do not substitute another runner or model, widen permissions, or claim a run started.
.\orchestration\run-worker.ps1 -Model 37 -Brief G25 -AutoApprove
-Model selects model-<id>.yml. -Brief reads orchestration/briefs/<name>.md, creates an exclusive temporary BRIEF-<run-id>.md in the sandbox, sends only the instruction to read it, and removes its own copy when the run closes. Keep brief in a file: PowerShell interpolation corrupts backticks/${...}. Each run retains its transcript as orchestration/reports/<brief>-<model>-<run-id>.log and reports its path; the launcher propagates the worker exit code.
-AutoApprove selects base.yml for non-interactive execution. Without it launcher selects probe.yml, which is not shipped; supply an authorized compatible overlay or stop. Interactive approval cannot be answered in headless mode. Confirm exact sandbox/approval pair is registered, rather than bypassing a denied policy.
Brief contract
Tell worker to read project AGENTS.md first. Include:
- Exact allowed paths at top under FILES YOU WRITE (
FILE CHE SCRIVIin shipped template). Any other written file voids entire task. Explicitly name any incidental SVG/JSON/log output exempted from that list. - Prohibitions: no build/package commands, configuration edits, browser or dev-server; controller owns those.
- Self-contained format, numbers, names and source/reference context; preserve existing comments when needed.
- Numeric/checkable acceptance criteria derived independently by controller, not accepted from brief's own claims.
- Fix failed criteria; reporting failure alone does not finish task. Unverifiable values become
TODOand are flagged underDATI NON RICAVATI/DUBBI; never estimate. - Exact final
=== REPORT ===block required by template, listing files written, checks/results, underived data and doubts.
Controller review gates
After every worker, apply in order:
- Scope: compare before/after tree or hashes. Only allowed files/exempt outputs may differ; catch stray generated artifacts such as compiled
.jsbeside.ts. - Static check: project's fast typecheck/build check.
- Tests/verification: suite remains fully green.
- Real visual/functional check: exercise actual output. UI/game surfaces require opening/using them; correct numbers can still produce invisible UI. For other tasks, verify whether gate 3 fully covers functional behavior before considering gate 4 redundant.
Controller retains brief writing, independent criteria, scope decisions, small review corrections and fixing its own spec errors. If independent data supports worker against brief, correct brief assumption instead of forcing wrong output. Worker chooses how within scope, never what task to do.
| Failure | Action |
|---|---|
| Comments disappear on full rewrite | Require preservation in brief or restore in review. |
| Large formatting-only diff | Compare ignoring CRLF/LF to isolate real changes; preserve intended endings. |
| Numbers pass, UI broken | Perform required real-use gate; task remains unfinished. |
| Headless approval blocks | Check selected overlay and matching preset; do not loosen denied policy. |
| Value cannot be derived | TODO plus report; no plausible invention. |
04 同仓库更多 Skills
writing-plans
Use when a spec or requirements need a multi-step implementation plan before code changes, including standalone MDX plans.
writing-for-agents
Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.
wayfinder
Map a large, uncertain effort as decision tickets; resolve them until the route to the destination is clear.
ui-ux-pro-max
Use only when the user explicitly invokes `ui-ux-pro-max` for web or mobile design, implementation, or review.
to-spec
Use when the user asks to turn an existing conversation, wayfinder map, or planning context into a standalone MDX spec.
test-driven-development
Use when implementing features, fixing bugs, changing behavior, or refactoring tested code.