plan-loop

plan-loop:用于在编写任何代码之前,将用户的编码或工程类需求细化为详细且可执行的计划(“需求 → 计划 → 执行 → 调试”流水线的规划阶段)。流程从第一性原理分解需求(目标、最终状态、环境、构建模块、工具、依赖等),将工作拆成适合单个 PR 大小的任务,每个任务关联具体组件、涉及文件、测试和依赖;对任务进行拓扑排序并拆分为原子子任务;由独立首席工程师智能体评审并反复修订直至通过。最终产出 plan.md 和结构化的 tasks.json 供后续执行。注意:不负责执行、搭建脚手架或调试计划,也不适用于研究提案或实验方案设计。

仓库最近推送
GitHub Stars
185
Forks
21
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "plan-loop":https://skillpi.com/zh/skills/deepskill-fa786ab90bc2922df179a4e0d4382a59c21e1604e545aa17f272d64085c24d17。安装前核对上游来源和版本:https://github.com/gaasher/Agent-Loop-Skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

plan-loop:用于在编写任何代码之前,将用户的编码或工程类需求细化为详细且可执行的计划(“需求 → 计划 → 执行 → 调试”流水线的规划阶段)。流程从第一性原理分解需求(目标、最终状态、环境、构建模块、工具、依赖等),将工作拆成适合单个 PR 大小的任务,每个任务关联具体组件、涉及文件、测试和依赖;对任务进行拓扑排序并拆分为原子子任务;由独立首席工程师智能体评审并反复修订直至通过。最终产出 plan.md 和结构化的 tasks.json 供后续执行。注意:不负责执行、搭建脚手架或调试计划,也不适用于研究提案或实验方案设计。

0 下载

介绍来源: third_party · gaasher · 0.1.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
翻译待完成,请参阅来源文档。
软件、账号及付费要求
翻译待完成,请参阅来源文档。
限制与区别
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: plan-loop
description: >
  Use when the user has a coding or engineering prompt and wants it refined into a detailed, executable
  plan before any code is written — the planning stage of a prompt → plan → execute → debug pipeline. It
  decomposes the prompt from first principles (objective, end state, environment, building blocks, tools,
  packages), breaks the work into PR-sized tasks each tied to a component with its files, tests, and
  dependencies, orders them topologically, splits each into atomic subtasks, then a separate
  principal-engineer agent critiques the plan for alignment, coverage, sizing, and executability; it
  revises until the critique passes, emitting a plan.md layout and a structured tasks.json that a junior
  engineer or a smaller model can execute correctly. Not for executing, scaffolding, or debugging the
  plan (those are downstream loops), and not for research proposals or experiment plans.
compatibility: Requires Python 3.9+.
metadata:
  version: "0.1.0"

Plan Loop

A planning loop: it turns a prompt into a plan detailed and correct enough to hand to a lower-tier model. The artifact is the plan — plan.md (the layout) + tasks.json (PR-sized tasks, each with files, tests, dependencies, and atomic subtasks). The feedback signal is two-part, like the repo's other evaluator loops: an objective gate (tools/validate_plan.py — schema shape, an acyclic dependency graph, a valid topological order, full component coverage) and a qualitative gate (a separate principal engineer agent that critiques alignment, decomposition, testability, and whether a junior could execute each task without guessing). You build the plan from first principles, validate it, critique it, and revise until the critique passes. This is the plan stage of a larger prompt → plan → execute → debug pipeline; it stops once the plan is ready to delegate.

When to use

Use to convert a feature/bug/refactor prompt into an executable plan grounded in a real repository — when the goal is a hand-off artifact a downstream executor (or a smaller model) can implement task-by-task. The plan is only as good as its weakest task for a literal-minded implementer, so the loop optimizes for executability, not prose.

Default: ground the plan in the <repo> you are given and let the principal-engineer critique drive the revisions. Escape hatch: if a key decision can't be resolved from the prompt or the repo, record it as an open_question for the human rather than guessing. Not for writing the code (a downstream execute loop), and not for research/experiment proposals (use research-proposal).

Setup

Resolve bindings interactively. If loop.run.yaml exists, load it, confirm the values in one line, and skip to the loop. Otherwise: on Claude Code (the AskUserQuestion tool is available) infer a likely value per binding and recommend it; on other hosts ask each as a quoted prompt. Then write loop.run.yaml (format: examples/run.example.yaml) and confirm before creating any other files.

binding meaning default how to infer
<prompt> the task to plan — a file path or inline text — the user's request
<repo> the project the plan targets; read for ground-truth env + conventions (never edited) . the repo being worked on
<plan_file> the human-readable plan layout (markdown) <sandbox_root>/plan.md —
<tasks_file> the structured tasks, validated against schemas/plan.schema.json <sandbox_root>/tasks.json —
<pr_loc> target lines of code per task (PR-sized; a task may exceed it) 100-400 —
<sandbox_root> where plan, tasks, and the ledger live ./sandbox —
<budget> max refine cycles 5 —

<skill_dir> is this skill's installed folder; substitute the real path when writing loop.run.yaml. The objective gate runs each cycle:

python3 <skill_dir>/tools/validate_plan.py --tasks <tasks_file>

It prints one JSON object {ok, errors, warnings, stats} — ok must be true (no errors) before a plan is considered ready.

The loop

Copy this checklist and tick items off.

Build the plan (iteration 0 — first principles):

  • [ ] Ground. Read <prompt> and inspect <repo> for ground truth: language, package manager, runtime/OS, the test command, and existing modules/conventions to reuse. Check what you can; never assume what you can read.
  • [ ] Decompose. Lay out the components from first principles — objective; end state / definition of done; non-goals; environment; building blocks; interfaces/contracts between blocks; tools; packages; data/assets; reuse (existing code + installed skills); open questions. Recursively split any component too big to reason about in one piece.
  • [ ] Tasks (PR-sized). Break the work into tasks, each ~<pr_loc> and equivalent to one PR. For each record: which components it serves, a description, building_blocks/tools/packages, the exact files it creates/modifies, tests that prove it, acceptance_criteria, and estimated_loc.
  • [ ] Order. Fill each task's depends_on, then compute a topological order (every task after its dependencies).
  • [ ] Subtasks. Split each task into atomic subtasks a junior can do with no further decisions — "create file X", "define function f(args) -> T", "wire f into Y".
  • [ ] Write + validate. Write <plan_file> and <tasks_file>, then run tools/validate_plan.py; fix every error and weigh every warning before the first critique. Log the baseline ledger row.

Refine (repeat until the plan passes or <budget>):

  • [ ] Critique. Spawn the principal engineer (spawn-or-degrade, roles/principal-engineer.md) with the prompt, the repo, plan.md, tasks.json, the latest validate_plan.py output, and the list of installed skills on this host. It returns a structured critique (schemas/critique.schema.json): verdict, score, issues (blocking/major/minor, each with a fix), coverage gaps, and suggested skills.
  • [ ] Revise. Apply the fix for every blocking and major issue — re-decompose, re-size, re-order, add tests, pin packages, add concrete signatures/paths/data shapes so a junior can't go wrong. Re-run tools/validate_plan.py. Append a ledger row.
  • [ ] Stop when the critique returns pass (no blocking or major issues) and the validator is clean — the plan is ready to delegate. Else loop, up to <budget>; if the score plateaus with only minor issues, stop and record them as open notes.

On stop, the deliverable is <plan_file> + <tasks_file> (plus any open_questions for the human), built to be executed task-by-task in order by a downstream execute loop or a lower-tier model.

Plan artifacts

<tasks_file> (tasks.json) — the machine-executable plan; full contract in schemas/plan.schema.json. Compact shape:

{
  "objective": "...", "end_state": "...", "non_goals": ["..."],
  "environment": {"language": "python", "package_manager": "uv", "test_command": "pytest -q"},
  "components": [{"id": "c1", "name": "config", "description": "load + validate config"}],
  "open_questions": ["which auth provider?"],
  "tasks": [
    {"id": "T1", "title": "config loader", "serves": ["c1"], "description": "...",
     "building_blocks": ["dataclass Config"], "tools": ["pytest"], "packages": ["pyyaml"],
     "files": [{"path": "src/config.py", "action": "create", "what": "Config + load()"}],
     "subtasks": [{"id": "T1.1", "description": "define load(path) -> Config"}],
     "tests": [{"description": "load() parses a valid file", "kind": "unit"}],
     "acceptance_criteria": ["invalid config raises ConfigError"],
     "depends_on": [], "estimated_loc": 180, "suggested_skills": []}
  ],
  "order": ["T1"]
}

<plan_file> (plan.md) — the human-readable layout: objective, end state, non-goals, environment, the components, a task table (id · title · serves · depends_on · est. LOC) in order, risks/open questions, and a one-line "how to execute" pointer to tasks.json. It mirrors tasks.json; tasks.json is the source of truth the executor consumes.

Ledger

<sandbox_root>/ledger.tsv, tab-separated, never commas in free text. Header iter phase verdict score blocking major change:

iter    phase   verdict score   blocking    major   change
0   build   -   -   -   -   first-principles decomposition: 6 components, 8 tasks, validator ok
1   critique    revise  72  1   2   PE: T3 bundles 2 PRs; T5 has no real test; nothing covers config loading
2   revise  -   -   -   -   split T3 -> T3a/T3b; added retry test to T5; added T9 config loader; reordered
3   critique    pass    90  0   0   PE: solid; one minor naming nit recorded as an open note

Report the final plan at the cycle the critique passed (or the best score reached at <budget>).

Constraints

  • Plan only — do not implement. Write no production code, scaffolding, or files in <repo>; the output is plan.md + tasks.json. Execution and debugging are downstream loops.
  • Ground every claim in the real repo/environment. Do not invent packages, files, APIs, or commands; verify against <repo>. A genuine unknown is an open_question for the human, not a guess — a plan that confidently states something false is worse than one that flags the gap.
  • Keep tasks PR-sized and self-contained. Each task links to ≥1 component and has tests and acceptance criteria; each subtask is atomic. Optimize for a literal implementer who will not fill gaps.
  • Keep the critic independent. The principal engineer reviews the plan it did not write (spawn-or-degrade gives real isolation on Claude Code); never let the author pass its own plan.
  • Edit only inside <sandbox_root> (plan, tasks, ledger); <repo> is read-only context. Run the loop to a passing critique or <budget> without pausing to ask whether to continue.

Roles

roles/principal-engineer.md — the adversarial plan critic. Spawn-or-degrade: a real isolated subagent on Claude Code (the Agent/Task tool), else adopt the role inline. It is read-only, judges against a fixed rubric, and returns JSON validated against schemas/critique.schema.json. Pass it the host's installed-skill list so it can recommend reuse; if that list is unavailable, it simply skips suggested_skills.

当前收录版本

0.1.0

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值88/100

亮点

  • 提供工程任务的详细规划流程,解决真实用户痛点
  • 支持从需求到可执行计划的完整转换,具有高度实用性
  • 包含验证和评审机制,确保计划质量
触发精准92/100

亮点

  • 触发条件清晰明确,覆盖多种使用场景
  • 边界定义清楚,明确排除不适用场景
  • 描述完整且无歧义
结构规范85/100

待提升项

  • 文档长度 原报告严重程度:轻微

    单个文件内容较长,可能影响阅读体验

    改进建议:考虑将部分内容拆分为引用文件,保持主文档简洁

亮点

  • 阶段划分清晰,步骤完整
  • 包含具体示例和schema定义
  • frontmatter完整规范
执行可靠88/100

亮点

  • 包含客观验证机制(validate_plan.py)
  • 结构化评审流程确保计划质量
  • 明确的停止条件和错误处理机制
证据可验 (前四项均值)88/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

翻译待完成,请参阅来源文档。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。