plan
Weave planning: compare independent adversarial plans, then synthesize the best one
- License 许可
- MIT
- 所属仓库
- tony/skills
- 最近更新
- 2026-11-08
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- plan
- description
- Weave planning: compare independent adversarial plans, then synthesize the best one
- allowed-tools
- [ "Bash", "Read", "Grep", "Glob", "Write", "Task", "AskUserQuestion", "EnterPlanMode" ]
- argument-hint
- [--passes=N] [--timeout=N|none] [--mode=fast|balanced|deep] [--no-deslop|--quiet-deslop|--verbose-deslop] [--workers=subagents|model-clis] <task description>
- disable-model-invocation
- true
02 资源文件 1
- 参考文档agents/openai.yaml280 B
03 SKILL.md 正文
Weave Plan
Get implementation plans from independent adversarial workers in parallel, then synthesize the best plan. The output is a finalized plan file ready for execution.
Session artifacts live in the session directory, outside your repository.
The task comes from $ARGUMENTS; if there are none, ask the user what they want planned.
<engine> is ../../scripts/engine.py resolved from this skill's directory to an absolute path, written literally in every command, and run with python3.
Worker selection
<!-- portable: ask-user-choice=headless-default -->
Before any other unresolved configuration choice or operational step, read
../../references/worker-backends.md (Caller contract). Resolve
worker_backend from --workers=subagents|model-clis using that reference;
if the flag is absent, ask its worker question first.
If interactive choice is unavailable, honor its documented headless default.
Phase 0: Enter plan mode
Call EnterPlanMode immediately and stay in it: the final output is the host's plan file, and the user approves execution from it. Never call ExitPlanMode. Emit Plan mode active: drafting implementation plan.
In plan mode the main agent reads (Read, Grep, Glob), asks questions, launches Task agents, and writes the plan file. It runs the read-only engine commands (flags, context, judge-parse) directly. Everything else goes through a session relay: a general-purpose Task agent with mode: "default" that receives exact engine commands or exact file contents, runs or writes them verbatim, and returns each command's JSON verbatim. It never judges, scores, edits content, or works in the repository checkout. The relay carries init, prompt, worktrees, labels, packet, update, guard, participant, write, and the deslop file work. Workers, the judge, and the critic still run in participant start snapshots. Never act on relayed JSON alone: after each relayed engine command, Read the file it writes (session.json, the guard result, the pass files) and check the relayed result against it.
Without plan mode (headless runs), the main agent runs those commands directly. Present the final plan as markdown text instead of a plan file.
Phase 1: Start the session
-
Read the project's CLAUDE.md / AGENTS.md. Explore the files most relevant to the task for architecture, patterns, and constraints.
-
Follow
../../references/ensemble-core.md(Start the session) with--command plan. Runinitthrough the relay. It asks each unresolved setting throughAskUserQuestion. -
Build the context packet per
ensemble-core.md(Context packet), usingcontextfor the repo state. Without a repository, say "no repository" up front and plan as greenfield: no existing files, conventions, or tests are assumed. Lead with the changed files and their diff stats, key snippets of code the plan touches, and known unknowns the plan should address. The relay writes it to<session_dir>/context-packet.md.
Phase 2: Get plans in parallel
The shared worker prompt body is:
Create a detailed implementation plan for the following task. Read the codebase for the existing architecture, patterns, and conventions, and the project's CLAUDE.md/AGENTS.md for standards.
Task: <the task>
Your plan must include:
- Files to create or modify: every file, with the changes it needs
- Implementation sequence: ordered steps with dependencies between them
- Architecture decisions: key choices justified by existing patterns
- Test strategy: tests to add or extend, using the project's test patterns
- Risks and edge cases: potential problems and mitigations
- Commit boundaries: each step is one atomic commit, with a commit message (no
Co-Authored-By, no tool trailer, no emoji) and the quality gates (lint, format, type-check, fast tests) to verify before committingBe specific: reference actual files, functions, and patterns from the codebase. Separate the user's requirements from proposed defaults. Explain how normal, failure and capacity paths satisfy each hard constraint; a fallback meets the same requirement as the main path. State the assumptions behind resource estimates, and label an estimate that covers only part of the cost as partial, never as a total.
Length cap: at most 700 words in total. One line per file and per step; no code blocks, no rejected alternatives, no restating the task.
Follow ensemble-core.md (Dispatch lanes) with this body, running the engine commands through the relay, then (Close the repo guard). If only one lane responds, continue with it alone and say so.
Phase 3: Synthesize the best plan
Apply ensemble-core.md (Blind judging, Synthesis protocol) to this pass's outputs, with the default rubric. The convergence mode is Merge. The judge participant scores the packet (ensemble-core.md, Synthesis protocol); you adjudicate and the relay writes the artifacts.
Put in the judge's brief: record the task's hard constraints in verification.md and check each plan's constraint traces and bounds as the worker brief requires. A fallback must satisfy the same requirement as the main path. Keep an unresolved policy choice explicit and block the affected step until the user decides, and recheck these constraints after integrating critic findings.
The synthesis holds at most 900 words: state each agreed step once and drop worker prose.
Steps 2 to 4 run on the final pass only (pass 1 when passes is 1, else the last pass of Phase 4), so the plan is rendered once. In this order:
-
Read
../../references/present-results.mdand../../references/results/plan.md, then have the relay write the synthesis to<session_dir>/pass-NNNN/synthesis.mdusing that result contract and../../references/prose-rules.md. Raw critic deltas stay incritic.md; the plan's Critic Findings uses the final risk/safeguard format from the result template. The plan must tell the executor to run the project's quality gates before each commit, and to write commit messages with noCo-Authored-Byline, no "Generated with" or other tool trailer, and no emoji. -
Unless
--no-deslopwas set, deslop through the relay: it reads../../references/deslop-pass.mdand applies it withARTIFACT_PATHset to that file,SESSION_DIR,BASELINE_SHAset tobaseline_shafrominit, andDESLOP_MODEfrom the flags. Re-readsynthesis.mdfor the desloped plan. The summary block stays out of the plan body; print its one line afterPlan ready for review. -
Apply the result references from step 1 with
RESULT_KIND=plan,ARTIFACT_PATH= the deslopedsynthesis.md,SESSION_DIR,PASS_COUNT= the resolved pass count,IN_PLAN_MODE= true,LABEL_MAP_PATH=<session_dir>/pass-NNNN/label-map.json. -
Write the rendered plan to the plan file, then emit
Plan ready for review. -
After every pass, record it through the relay (
update --completed-passes <N> --event pass_complete).
Phase 4: Multi-pass refinement
Skip when passes is 1. Run the later passes per ensemble-core.md (Later passes), targeting only unresolved conflicts from the prior adjudication, critic findings from the prior pass, and any dimension scored below 5 on any response; the relay creates the pass and writes the prompt. The Claude lane reads prior artifacts by path; external lanes get them inline. Re-synthesize per Phase 3.
On the final pass, run Phase 3 steps 2 to 5 on pass-<N>/synthesis.md, adding a Plan Evolution section that says what was strengthened, corrected, or added across passes.
Finish
Follow ensemble-core.md (Finish), through the relay.
Rules
- Never exit plan mode.
- Every plan step is one atomic commit.
04 同仓库更多 Skills
serene-bliss
Use when asked to make a CLI --help, docs page, error message, or tooling UX more serene or calmer for developer experience; returns text, no edits.
review
Weave code review: run independent adversarial reviews in parallel, then synthesize findings
refine
Use when asked to refine a draft, iterate on code until cleaner, or polish a README through repeated critique and improvement.
prompt
Weave prompt: compare independent adversarial implementations, then adopt the single best one
fix-review
Fix weave review findings: validate, add test coverage, fix, and commit each as atomic changes
execute
Weave execute: compare independent adversarial implementations, then synthesize their best parts