Community编程与开发github.com

propose-implementation-plan

创建一份原子化提交的实施方案,逐步构建完整功能

propose-implementation-plan 是什么?

该技能(propose-implementation-plan)旨在帮助开发者将经过批准的功能设计文档转化为机器可解析的TOML格式实施方案,从而驱动implement-commit技能自动执行提交。它通过阅读两个核心输入文件——design.md(设计文档)和test-plan.md(测试计划)——来创建一份结构化计划,其中包含一系列原子化提交(每个提交约200-400行变更),并明确每个提交的依赖关系、验收标准、反模式和关联测试。该技能通过验证代理自动检查每个测试是否被分配且仅分配到一个提交,确保可审计的追溯链:test-plan.md → implementation-plan.toml → 代码。它支持Claude Code、Cursor等平台上的工作流编排,特别适用于需要协调多个开发步骤或跟踪进度的复杂功能实现场景。最终输出是一个名为implementation-plan.toml的文件,存储在功能目录下,供后续implement-commit技能使用。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cbgbt/bottlerocket-forest/tree/main/skills/propose-implementation-plan

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Propose Implementation Plan 技能

目的

创建一个 TOML 格式的实施方案,用于驱动 implement-commit 技能。 该方案必须是机器可解析的——编排器会机械式地读取它。

何时使用

  • 功能设计文档已存在且已批准
  • 准备好开始实现了
  • 需要协调工作或跟踪进度

先决条件

  • 功能设计文档位于 docs/features/NNNN-feature-name/design.md
  • 测试计划位于 docs/features/NNNN-feature-name/test-plan.md

输出格式

创建 docs/features/NNNN-feature-name/implementation-plan.toml:

[meta]
feature = "feature-name"
feature_dir = "docs/features/NNNN-feature-name"
workspace = "./path/to/workspace"

[dependencies]
1 = []
2 = []
3 = [1, 2]

[[commits]]
id = 1
title = "简短描述"
message = "feat(scope): conventional commit message"
files = ["path/to/file.rs"]  # 相对于工作区的路径
acceptance = ["来自CC表的标准 (CC-N)"]
anti_patterns = ["不要做什么"]
tests = ["test_name_from_test_plan"]  # 必需:映射到 test-plan.md

流程

1. 研究设计文档

仔细阅读 design.md,注意:

  • 模块结构和受影响的文件
  • 组件之间的依赖关系
  • 关键约束表(CC-1、CC-2 等)

2. 研究测试计划(至关重要)

阅读 test-plan.md 并创建一个映射:

  • 列出需求覆盖表中的所有测试名称
  • 每个测试必须恰好分配到一个提交
  • 测试是验收标准的唯一真相来源

3. 识别能力边界

寻找 能力边界,而不是代码工件边界。

好的边界:

  • 一个新模块及其类型、实现和测试合在一起
  • 一个用户可见的能力(例如,一个新的 CLI 命令)
  • 从端到端满足的一个需求

反模式:按工件拆分(类型在一个提交中,实现在另一个,测试在第三个)。

4. 构建依赖图

对于每个提交,列出必须先完成的提交。 编码为 [dependencies] 表,其中键为提交 ID,值为依赖 ID 列表。

编排器使用此信息来决定并行执行。

5. 将测试映射到提交

对于每个提交,列出 test-plan.md 中验证它的具体测试名称:

tests = [
  "test_protocol_encode_acquire_request",
  "test_protocol_decode_roundtrip",
]

test-plan.md 中的每个测试都必须恰好出现在一个提交的 tests 数组中。

这将创建一条可审计的追溯链:test-plan.md → implementation-plan.toml → 代码。

6. 提取关键约束

对于每个提交,复制设计的关键约束表中的相关条目:

  • acceptance = 必须满足的标准(引用 CC-N 和测试名称)
  • anti_patterns = 审阅者应当拒绝的内容

7. 编写提交条目

对于每个提交:

[[commits]]
id = N                    # 顺序整数
title = "..."             # 此提交完成的内容
message = "..."           # 完整的约定式提交消息
files = ["..."]           # 相对于工作区的路径
acceptance = ["..."]      # 来自 CC 表 + 测试描述
anti_patterns = ["..."]   # 来自 CC 表,或空 []
tests = ["..."]           # 来自 test-plan.md 的测试名称(必需)

8. 通过独立代理验证

起草计划后,生成一个验证代理:

result = spawn(
    prompt=draft_spawn_prompt(SkillDefined(
        "验证实施方案是否覆盖了 test-plan.md 中的所有测试"
    )),
    context_files=[
        f"{skill_dir}/agents/verifier.md",
        f"{feature_dir}/test-plan.md",
        f"{feature_dir}/implementation-plan.toml",
    ],
    response_model=VerificationResult,
    read_only=True,
)

if not result.parsed.valid:
    # 在继续之前修复遗漏
    agent_feedback(f"计划不完整:{result.parsed.gaps}")

验证器检查:

  • test-plan.md 中的每个测试都已分配给一个提交
  • 没有测试分配给多个提交
  • 验收标准引用了具体的测试

9. 验证 TOML

# 检查 TOML 能否解析
python3 -c "import tomllib; tomllib.load(open('implementation-plan.toml', 'rb'))"

提交大小指南

目标:每个提交变更 200-400 行

太小:

  • 类型没有实现
  • 特质至少没有一个实现
  • 实现没有测试

太大:

  • 多个不相关的能力
  • 超过 500 行
  • 涉及超过 5-6 个文件

恰到好处:

  • 一个包含类型、实现和测试的模块(约 200-400 行)
  • 一个包含处理程序和测试的 CLI 命令(约 150-350 行)
  • 一个包含测试的完整适配器(约 200-400 行)

验证模型

from pydantic import BaseModel

class VerificationResult(BaseModel):
    valid: bool
    total_tests_in_plan: int
    tests_assigned: int
    gaps: list[str]  # 未分配给任何提交的测试
    duplicates: list[str]  # 分配给多个提交的测试

示例

参见 docs/features/0000-templates/implementation-plan.toml 获取完整示例。

后续步骤

创建并验证计划后:

  1. 审查可行性和大小
  2. 运行 implement-commit 技能来执行

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

ad-hoc-implementation-plan

Transform a rough plan into implement-commit ready artifacts. Allows rigorous review while implementing.

build-kit-locally

Build a kit and publish it to a locally hosted registry for development testing

build-variant-from-local-kits

Build a variant using locally published kits for development validation

deep-research

Create educational documents that build understanding progressively with citations

edit-spec-file

Edit Bottlerocket RPM spec files following project style conventions

fact-find

Quick lookup of specific facts about Bottlerocket with citations

idea-honing

Clarify feature ideas through iterative Q&A, recording insights to guide concept development

implement-commit

Implement commits from an implementation plan using a TDD pipeline

local-registry

Start and manage a local OCI registry for Bottlerocket kit development

prepare-core-kit-release

Prepare bottlerocket-core-kit for release by bumping version and updating changelog

propose-feature-concept

Create a new feature concept document to pitch the idea and explain the problem/solution

propose-feature-design

Create or update feature technical design document with architecture and implementation guidance

propose-feature-requirements

Create or update feature requirements specification using EARS notation with examples and appendices

propose-feature-test-plan

Create a test plan mapping EARS requirements and Critical Constraints to specific tests

review-code

Deep code review generating PR comments via principled question-driven analysis

review-scope

Verify code changes match intended scope and requirements without exceeding boundaries

review-style

Verify code follows project style guides without providing improvement suggestions

test-local-twoliter

Build and test local changes to twoliter before releasing

update-twoliter

Update all Bottlerocket repositories to a new Twoliter version

相关技能