跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
浏览器与自动化

lego-plan

Use when a settled change must be turned into an ordered stack of small blocks before anyone implements. Don't use for unsettled intent, typos, comments, formatting, docs-only work, or writing the implementation itself.

AlemTuzlak · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add AlemTuzlak/skills --skill lego-plan

技能说明


name: lego-plan description: Use when a settled change must be turned into an ordered stack of small blocks before anyone implements. Don't use for unsettled intent, typos, comments, formatting, docs-only work, or writing the implementation itself.

Lego Plan

Turn a settled change into a layered DAG from simple primitives to a working feature. Plan only. Then stop.

The graph is a pyramid: independent blocks at the bottom, composed blocks above, one finish node. A later driver can run same-layer nodes in parallel, flip status, and redraw this graph. This skill does not dispatch subagents. It does not load other skills.

When To Use

Load when the job is to turn a settled change into an implementation map the driver can follow.

  • Need: what to build is already chosen. If a files-to-touch list or path pick is already in this conversation, use it. If not, work from the settled intent and the code. Do not invent a second system map.
  • Skip: typos, comments, formatting, docs with no code.
  • If intent is still open: stop. Ask until the change is settled. Do not stack blocks for a feature that is not chosen.

One node is still a DAG. Emit the full contract.

Hard Gates

  1. Plan only. Do not write production code. Do not write tests. Name the check in done when. Do not implement it here.
  2. Stop after emit. Chat DAG plus the scratch file. Do not dispatch. Do not load the next skill.
  3. No cycles. If a block depends on a later block, the split is wrong. Split again.
  4. Do not wait for approval. Show the DAG and stop. The user interrupts if it is wrong.
  5. Do not open the scratch file for the user. Do not write a plan under docs/.

Node grain

Graph node (parallel unit): one independently shippable primitive a subagent can own without waiting on another in-progress node.

Examples: write fetchOrder, write OrderCard, wire fetchOrder into the loader.

Too big: implement auth. Split it. Too small: rename a variable. Fold it into the node that needs it.

Parts (inside a node): the functions that must land together so that node compiles. One subagent does parts in order. Do not fan out parts.

Example node fetch-order:

  • files: src/fetchOrder.ts, src/fetchOrder.test.ts
  • parts: Order type, then fetchOrder, then write or extend src/fetchOrder.test.ts
  • those parts are not separate graph nodes

Graph shape

  • Layer 0: nodes with depends on: none. The driver can run all of them in parallel.
  • Layer N: nodes whose deps are all in earlier layers.
  • Last layer: one node (or a tight set) that means the feature works end to end.
  • Two nodes that do not depend on each other must share a layer (or sit in layers that do not wait on each other).
  • depends on lists node ids, never file names.

Same file: if two nodes create or edit the same path, they must not share a layer. Merge them, or add a depends on edge so one waits. Do not split a file only to run in parallel. Two nodes that only read a path can share a layer. files lists create-or-edit paths only. The same-file rule includes test files.

Node fields

Every node has all seven:

  1. id: kebab-case, unique in this plan, stable (a later driver marks this id done).
  2. name: short English name.
  3. depends on: other ids, or none.
  4. files: create or edit (paths). Include the test path from done when.
  5. parts: ordered C list. Last part is write or extend that test. If done when is a manual check and there is no test file, the last part is that check and files has no test path.
  6. done when: a test file or command the driver can run before starting dependents.
  7. status: this skill always writes pending. A later driver can set in-progress or done. This skill never writes those two.

Do not put full source in the plan.

Live board

Path: <repo>/.agent/scratch/lego-plan.json

Same JSON as the chat fence. Agents follow this file. The user-facing product is the chat picture.

  • Create .agent/scratch/ if needed.
  • Always overwrite. Do not ask, even if existing nodes are in-progress or done.
  • If the repo has git, make sure .gitignore contains .agent/scratch/. If .gitignore exists and the line is missing, append it. If .gitignore is missing, create it with that one line.
  • Do not open the file. Do not dump it as a second copy in chat. The JSON fence is the copy the user sees.

Procedures

Procedure 1: Confirm a settled change

  1. If the change is clear, continue.
  2. If the user is still choosing what they want, stop. Ask. Return here after it is settled.

Procedure 2: Collect inputs already in session

  1. If this conversation already has a finish-line file list, parts, or a path pick, use those as the starting set.
  2. If not, derive blocks from the settled intent and the code you must read to name files. Do not tour the whole repo.

Procedure 3: Split into nodes and parts

  1. List candidate primitives (B grain).
  2. For each primitive, list the C-parts that must compile together. End with write or extend the test (or the manual check).
  3. Draw depends on: a node depends on another only if it calls or embeds the result of that node.
  4. Assign layers from the deps. Independent nodes → same layer.
  5. If two nodes create or edit the same path and share a layer, merge them or add an edge. Then re-layer.
  6. If a cycle appears, split the wrong node and repeat this procedure.

Procedure 4: Fill each node

Fill the seven fields. status is pending on every node.

Procedure 5: Show the DAG in chat

Show, in this order:

  1. Layers: layer 0 to last. Under each layer, the nodes in that layer.
  2. Nodes: the seven fields for each id.
  3. Mermaid: always. One flowchart (or graph TD). Node ids in the diagram must match the plan ids. No classDef. No status colors. Every node is pending.
  4. JSON fence: a json block w
阅读完整来源 ↗