Community程式設計與開發github.com

實作計劃提案

建立包含原子提交的實作計劃,逐步構建完整功能

實作計劃提案 是什麼?

此技能用於建立機器可解析的 TOML 實作計劃,驅動 `implement-commit` 技能。它從功能設計文件 (`design.md`) 和測試計劃 (`test-plan.md`) 中提取資訊,將其分解為一系列原子提交,每個提交包含標題、訊息、檔案路徑、驗收標準、反模式以及對應的測試名稱。該計劃會建立依賴圖以支援平行執行,並確保測試計劃中的每個測試都恰好對應到一個提交。最終輸出是一個位於 `docs/features/NNNN-feature-name/implementation-plan.toml` 的 TOML 檔案,並可透過獨立驗證代理檢查完整性。

相容平台~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 的新對話。

說明文件

實作計劃提案技能

目的

建立一個 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 = "..."           # 完整的 conventional commit 訊息
files = ["..."]           # 相對於工作區的路徑
acceptance = ["..."]      # 來自 CC 表格 + 測試描述
anti_patterns = ["..."]   # 來自 CC 表格,或空 []
tests = ["..."]           # 來自 test-plan.md 的測試名稱(必要)

8. 使用獨立代理進行驗證

草擬計劃後,啟動一個驗證代理:

result = spawn(
    prompt=draft_spawn_prompt(SkillDefined(
        "Verify implementation plan covers all test-plan.md tests"
    )),
    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"Plan incomplete: {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

相關技能