Community程式設計與開發github.com

臨時實作計畫

將粗略構想轉換為可提交實作的就緒成品。允許在實作時進行嚴謹審查。

臨時實作計畫 是什麼?

此技能提供了一個快速路徑,能將粗略構想或計畫,迅速轉換為可直接用於「implement-commit」技能的就緒成品(artifacts)。它犧牲了文件的完整性以換取速度,特別適合那些已經充分理解、無需大量設計迭代的功能。此技能可在支援子代理(subagent)與回合機制的平台上運作,例如 Claude Code。它透過一個機械化的路由流程,依序產生最小化的設計文件(design.md)、測試計畫(test-plan.md)以及完整的實作計畫(implementation-plan.toml),並自動驗證文件間的交叉引用,確保測試覆蓋率與一致性。最終產出的文件結構清晰,可直接交由 TDD 流程執行,大幅縮短從構想到實作的週期。

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

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

臨時實作計畫 是做什麼的?

快速將粗略構想轉化為可提交實作的就緒成品。 犧牲文件完整性以換取速度。

使用時機

  • 你已與使用者討論過粗略計畫或構想
  • 你想要 implement-commit 的 TDD 驗證,但不想經歷完整的 propose-* 鏈
  • 功能已充分理解,可跳過廣泛的設計迭代

先決條件

  • 使用者核准的粗略計畫(可以是對話、Markdown 或心智模型)
  • 已知的工作區路徑
  • 已知要修改的檔案

協調者角色

你是一個機械化路由器。你不思考功能的細節。 你的工作:

  1. 收集使用者提供的最低必要資訊
  2. 建立功能目錄結構
  3. 以適當技能作為上下文,產生子代理(subagent)
  4. 在階段之間傳遞輸出
  5. 驗證交叉引用

設定

from pydantic import BaseModel
from pathlib import Path
import os

class GatherResult(BaseModel):
    feature_name: str
    feature_id: str  # NNNN 格式
    workspace: str
    files_to_modify: list[str]
    constraints: list[str]
    test_names: list[str]
    rough_plan_summary: str

class PhaseResult(BaseModel):
    success: bool
    artifact_path: str
    errors: list[str]

# 子代理上下文的技能路徑
skills = {
    "design": "skills/propose-feature-design/SKILL.md",
    "test_plan": "skills/propose-feature-test-plan/SKILL.md",
    "impl_plan": "skills/propose-implementation-plan/SKILL.md",
}

# 風格指南(如果可用)
style_guides = [
    "docs/style/rust-design.md",
    "docs/style/rust-test.md",
    "docs/style/rust-impl.md",
]

階段 0:收集

以互動方式收集或從粗略計畫推斷:

# 如果尚未知道,請詢問使用者:
# 1. 功能名稱 → 建立 docs/features/NNNN-name/
# 2. 要修改的檔案 → commits[].files
# 3. 關鍵限制條件 → CC 表格條目
# 4. 測試名稱 → test-plan + commits[].tests

# 決定下一個功能 ID
existing = list(Path("docs/features").glob("[0-9][0-9][0-9][0-9]-*"))
next_id = f"{len(existing):04d}"

feature_dir = f"docs/features/{next_id}-{feature_name}"
os.makedirs(feature_dir, exist_ok=True)

階段 1:最小化設計

使用 propose-feature-design 技能產生子代理,但指示產生最小化輸出。

result = spawn(
    prompt=draft_spawn_prompt(SkillDefined(
        "依照技能流程建立最小化的 design.md。"
        "僅產生:概述(1 段落)、關鍵限制條件表格、模組結構。"
        "跳過:架構圖、解決方案機制說明、設計模式、設計決策。"
    )),
    context_files=[
        skills["design"],
        *[g for g in style_guides if exists(g)],
    ],
    context_data={
        "feature_dir": feature_dir,
        "feature_name": gathered.feature_name,
        "constraints": gathered.constraints,
        "files": gathered.files_to_modify,
        "rough_plan": gathered.rough_plan_summary,
        "minimal_mode": True,
    },
    response_model=PhaseResult,
    isolate_to=Cwd(gathered.workspace)
)

階段 2:最小化測試計畫

使用 propose-feature-test-plan 技能產生子代理。

result = spawn(
    prompt=draft_spawn_prompt(SkillDefined(
        "依照技能流程建立最小化的 test-plan.md。"
        "僅產生:需求覆蓋率表格、關鍵限制條件驗證表格。"
        "跳過:詳細測試實作筆記、整合測試說明。"
    )),
    context_files=[
        skills["test_plan"],
        f"{feature_dir}/design.md",  # 來自階段 1
        *[g for g in style_guides if exists(g)],
    ],
    context_data={
        "feature_dir": feature_dir,
        "test_names": gathered.test_names,
        "constraints": gathered.constraints,
        "minimal_mode": True,
    },
    response_model=PhaseResult,
    isolate_to=Cwd(gathered.workspace)
)

階段 3:實作計畫

使用 propose-implementation-plan 技能產生子代理。

result = spawn(
    prompt=draft_spawn_prompt(SkillDefined(
        "依照技能流程建立 implementation-plan.toml。"
        "所有欄位都需要 - 沒有最小化模式。"
        "確保 tests[] 與 test-plan.md 的測試名稱完全相符。"
    )),
    context_files=[
        skills["impl_plan"],
        f"{feature_dir}/design.md",
        f"{feature_dir}/test-plan.md",
        *[g for g in style_guides if exists(g)],
    ],
    context_data={
        "feature_dir": feature_dir,
        "workspace": gathered.workspace,
        "files": gathered.files_to_modify,
        "rough_plan": gathered.rough_plan_summary,
    },
    response_model=PhaseResult,
    isolate_to=Cwd(gathered.workspace)
)

階段 4:驗證交叉引用

產生驗證器以檢查測試覆蓋率。

class VerifyResult(BaseModel):
    valid: bool
    missing_tests: list[str]  # 在 test-plan 中但不在 impl-plan 中
    orphan_tests: list[str]   # 在 impl-plan 中但不在 test-plan 中
    missing_constraints: list[str]  # 未被覆蓋的 CC-N

result = spawn(
    prompt=draft_spawn_prompt(AdHoc(
        intents=["驗證 implementation-plan.toml 對 implement-commit 有效"],
        context=["檢查所有成品之間的交叉引用"],
        goal=Verify(constraints=[
            "test-plan.md 中的每個測試在 commits[].tests 中恰好出現一次",
            "design.md 中的每個 CC-N 在 test-plan.md 中都有驗證",
            "所有 commits[].files 都存在或將被建立",
            "TOML 正確解析",
        ])
    )),
    context_files=[
        f"{feature_dir}/design.md",
        f"{feature_dir}/test-plan.md",
        f"{feature_dir}/implementation-plan.toml",
    ],
    response_model=VerifyResult,
    read_only=True
)

if not result.parsed.valid:
    # 返回階段 3 並帶入錯誤
    pass

交接

驗證通過後,成品即可供 implement-commit 使用:

docs/features/NNNN-feature-name/
├── design.md              # 最小化:概述 + CC 表 + 模組結構
├── test-plan.md           # 最小化:僅覆蓋率表
└── implementation-plan.toml  # 完整:所有必填欄位

通知使用者:

成品已就緒。執行 implement-commit 技能以啟動 TDD 管線。

Individual skills in this repo

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

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

propose-implementation-plan

Create an implementation plan with atomic commits that build toward a complete feature

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

相關技能