Token导航 LogoToken导航TokenDH.com
研究检索需要联网clawhub未标认证来源可访问clear审计通过

decompose-plan分解计划

Agent Skill

decompose-plan 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,899

周安装

122

GitHub Stars

公开资料未说明

下载量

1,015
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:decompose-plan(分解计划)
来源仓库:https://github.com/stephenlthorn/decompose-plan
安装命令:
openclaw skills install decompose-plan
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install decompose-plan

简介

强制生成结构化开发计划,避免隐含推理,提升代码编写前思考清晰度。

  • 适用于复杂项目开发前的任务分解与步骤规划。
  • 帮助明确思路树结构,增强开发流程可控性。
  • 安装前需确认权限范围、维护状态及是否影响本地执行环境。
  • decompose-plan 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
decompose-plan
version
1.0.0
description
|
triggers
tools
inputs
outputs
sub_problems
list of {title, description, depends_on}
apis
list of {name, version_requirement, purpose}
risks
list of {risk, mitigation, severity}
files_affected
list of {path, change_type}
order
ordered list of sub_problem titles
estimated_loc
integer
metadata
openclaw
category
coding
tags
requires_openclaw
>=2026.3.31
env_vars

Decompose and Plan

The problem this solves

Local models generate code reactively — they start typing the moment they see the task. This works for trivial tasks but produces mediocre output for anything complex. Sonnet's "extended thinking" mode is essentially a forced decomposition pass before generation.

We can replicate this behavior with M2.7 by requiring it to fill out a structured plan template before any code is written. The act of filling the template is the reasoning step.

The planning prompt

You are planning the implementation of the following task. Your job is NOT
to write code yet — only to plan.

Task: {task}

{rag_context_if_any}

Produce a plan in the following exact JSON structure:

{ "sub_problems": [ { "title": "short title", "description": "one paragraph describing what must be done", "depends_on": ["title of prior sub_problem"] or [] } ], "apis": [ { "name": "Framework.API.name", "version_requirement": "iOS 18+" or "Python 3.11+" or "none", "purpose": "why this API is needed" } ], "risks": [ { "risk": "specific thing that could go wrong", "mitigation": "how to avoid or handle it", "severity": "high" | "medium" | "low" } ], "files_affected": [ { "path": "relative/path/to/file.ext", "change_type": "create" | "modify" | "delete" } ], "order": ["sub_problem title", "sub_problem title", ...], "estimated_loc": integer }


Requirements:
1. Break the task into 2-6 sub_problems. Fewer is better if possible.
2. List ALL APIs you will use, including their version requirements.
   If using iOS/Swift APIs, check iOS 26 deprecations.
3. Identify at least 2 risks. "No risks" is never acceptable — be critical.
4. File list must be complete — no files added later during implementation.
5. Order must be a valid topological sort of sub_problems based on depends_on.
6. Estimated LOC should be realistic. If > 500, flag for decomposition into
   smaller tasks.

Output ONLY the JSON. No explanation, no preamble, no markdown fences.

Execution

async def decompose_plan(task, rag_context=None, specialist_prompt=None,
                        force_schema=True):
    prompt = PLANNING_PROMPT.format(
        task=task,
        rag_context_if_any=f"\
Relevant context:\
{rag_context}\
" if rag_context else ""
    )

    system = specialist_prompt or "You are a senior engineer planning code."

    response = await llm.generate(
        prompt=prompt,
        model="m27-jangtq-crack",
        system=system,
        temperature=0.2,  # low temp for structured output
        max_tokens=2000
    )

    # Parse JSON
    try:
        plan = json.loads(response.strip().strip("`").strip("json").strip())
    except json.JSONDecodeError:
        # Try to extract JSON from response
        match = re.search(r"\{.*\}", response, re.DOTALL)
        if match:
            plan = json.loads(match.group())
        else:
            if force_schema:
                raise PlanSchemaError("Model did not produce valid JSON")
            return {"error": "parse_failed", "raw": response}

    # Validate schema
    required_keys = {"sub_problems", "apis", "risks", "files_affected",
                     "order", "estimated_loc"}
    missing = required_keys - set(plan.keys())
    if missing and force_schema:
        raise PlanSchemaError(f"Missing keys: {missing}")

    # Validate order is topological
    if not _is_valid_topological(plan["sub_problems"], plan["order"]):
        raise PlanSchemaError("order is not a valid topological sort")

    # Flag if estimated_loc too large
    if plan["estimated_loc"] > 500:
        plan["warning"] = "Task may be too large — consider decomposing further"

    return plan


def _is_valid_topological(sub_problems, order):
    title_to_deps = {sp["title"]: set(sp.get("depends_on", [])) for sp in sub_problems}
    seen = set()
    for title in order:
        if title_to_deps[title] - seen:
            return False
        seen.add(title)
    return True

Using the plan downstream

The plan becomes part of the context for code generation. Inject it like:

You have planned this task as follows:

{plan_as_readable_text}

Implement ONLY the sub_problem "{current_sub_problem}" now.
Do not attempt sub_problems that come later in the order.

This keeps the generation focused on one concern at a time and leverages the decomposition to prevent the model from trying to write everything at once.

Why force the schema

Without schema enforcement, M2.7 tends to produce prose plans that are easy to generate but hard to use programmatically. Structured JSON forces the model to commit to specifics: exact file paths, exact API versions, exact risk factors. Vagueness becomes syntactically impossible.

When to skip this skill

For tasks where decomposition adds no value:

  • Single-line fixes ("rename this variable")
  • Trivial format conversions ("convert this JSON to CSV")
  • Questions rather than implementation requests
  • Tasks under 30 lines of expected output

The orchestrator handles this triage — decompose-plan is only invoked when it will add value.

Output usage

The parent orchestrator stores the plan in task.scratchpad["plan"]. Subsequent steps (generation, build-feedback, reflection) read from this plan rather than re-deriving what the task is about.

For iOS tasks specifically, the plan's apis section feeds into:

  • RAG query expansion (retrieve docs for those specific APIs)
  • Build feedback (validate those APIs are actually available at target iOS version)
  • Reflection checklist (verify those APIs are used correctly)

Failure modes

If M2.7 can't produce a valid plan after 2 retries, escalate to claude-handoff. This is a strong signal that the task is outside local capability — if the model can't even plan it, it certainly can't implement it.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

85.86%
按下载量换算871

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills