Skill 寫法圖鑑

blueprint

affaan-m | 規劃與釐清 | 原文 | MIT

把一句話目標拆成多 session 可冷啟動執行的逐步施工計畫

中文翻譯

---
name: blueprint
description: "把一句話的目標,變成多 session、多 agent 工程專案的逐步施工計畫:每一步都是一個 PR 的大小,附有自成一體的 context 簡報、能偵測平行步驟的相依圖、對抗式的 review 關卡,以及計畫變更協定。規劃橫跨多個 PR 或 session 的大型功能、重構或路線圖時使用;單一 PR 的任務,或使用者說「直接做就好」時不要用。"
metadata:
  origin: community
---

# Blueprint:施工計畫產生器

把一句話的目標,變成任何 coding agent 都能冷啟動執行的逐步施工計畫。

## 何時使用

- 把大型功能拆成多個 PR,並有清楚的相依順序
- 規劃橫跨多個 session 的重構或遷移
- 協調跨 sub-agent 的平行工作流
- 任何 session 之間遺失 context 會造成重工的任務

**不要用在**一個 PR 就能完成的任務、少於 3 次工具呼叫的任務,或使用者說「直接做就好」的時候。

## 運作方式

Blueprint 執行五個階段的 pipeline:

1. **Research**:先做事前檢查(git、gh 驗證、remote、預設 branch),然後讀專案結構、既有的計畫和記憶檔案,蒐集 context。
2. **Design**:把目標拆成一個 PR 大小的步驟(通常 3 到 12 步)。替每一步指定相依關係、平行/循序順序、模型等級(最強的對預設的),以及 rollback 策略。
3. **Draft**:把自成一體的 Markdown 計畫檔案寫到 `plans/`。每一步都包含 context 簡報、任務清單、驗證指令和完成條件,這樣全新的 agent 不用讀前面的步驟,就能執行任何一步。
4. **Review**:把對抗式 review 委派給最強模型的 sub-agent(例如 Opus),依檢查表和反面模式目錄進行。定稿之前,修好所有嚴重的發現。
5. **Register**:儲存計畫、更新記憶索引,並向使用者呈現步驟數和平行度的摘要。

Blueprint 會自動偵測 git/gh 是否可用。有 git + GitHub CLI 時,它會產生完整的 branch/PR/CI 工作流程計畫。沒有的話,就切換到直接模式(原地編輯,不開 branch)。

## 範例

### 基本用法

```
/blueprint myapp "migrate database to PostgreSQL"
```

會產生 `plans/myapp-migrate-database-to-postgresql.md`,裡面的步驟像是:
- Step 1: 加上 PostgreSQL driver 和連線設定
- Step 2: 為每個資料表建立 migration script
- Step 3: 更新 repository 層以使用新的 driver
- Step 4: 加上針對 PostgreSQL 的整合測試
- Step 5: 移除舊的資料庫程式碼和設定

### 多 agent 專案

```
/blueprint chatbot "extract LLM providers into a plugin system"
```

會產生一份計畫,其中在可能的地方設有平行步驟(例如在 plugin 介面那一步完成之後,「實作 Anthropic plugin」和「實作 OpenAI plugin」平行執行)、模型等級的指派(介面設計那一步用最強的,實作用預設的),以及每一步之後都要驗證的不變條件(例如「所有既有測試都通過」「核心裡沒有 provider 的 import」)。

## 主要功能

- **冷啟動執行**:每一步都包含自成一體的 context 簡報。不需要先前的 context。
- **對抗式 review 關卡**:每份計畫都由最強模型的 sub-agent,依涵蓋完整性、相依正確性和反面模式偵測的檢查表來 review。
- **Branch/PR/CI 工作流程**:內建在每一步裡。沒有 git/gh 時,會平順降級成直接模式。
- **平行步驟偵測**:相依圖會找出沒有共用檔案或輸出相依的步驟。
- **計畫變更協定**:步驟可以被拆分、插入、跳過、重新排序或放棄,並有正式的協定和稽核軌跡。
- **零 runtime 風險**:純 Markdown 的 skill。整個 repo 只有 `.md` 檔案,沒有 hook、沒有 shell script、沒有可執行程式碼、沒有 `package.json`、沒有 build 步驟。安裝或呼叫時,除了 Claude Code 原生的 Markdown skill 載入器之外,沒有任何東西會執行。

## 安裝

這個 skill 隨 ECC 一起發布。安裝了 ECC 就不需要另外安裝。

### 完整的 ECC 安裝

如果你是從 ECC repo 的 checkout 工作,用這個指令確認 skill 存在:

```bash
test -f skills/blueprint/SKILL.md
```

之後要更新時,更新之前先審視 ECC 的 diff:

```bash
cd /path/to/ECC
git fetch origin main
git log --oneline HEAD..origin/main       # 更新之前,先審視新的 commit
git checkout <reviewed-full-sha>          # 固定到特定審視過的 commit
```

### 獨立的 vendored 安裝

如果你只在完整 ECC 安裝之外,vendor 這一個 skill,就把審視過的檔案從 ECC repo 複製到 `~/.claude/skills/blueprint/SKILL.md`。Vendored 的副本沒有 git remote,所以更新時要從審視過的 ECC commit 重新複製檔案,不要執行 `git pull`。

## 需求

- Claude Code(用於 `/blueprint` slash command)
- Git + GitHub CLI(選用,能啟用完整的 branch/PR/CI 工作流程;Blueprint 偵測到沒有時,會自動切換到直接模式)

## 來源

靈感來自 antbotlab/blueprint,是上游專案與參考設計。

英文原文

---
name: blueprint
description: "Turn a one-line objective into a step-by-step construction plan for multi-session, multi-agent engineering projects: one-PR-sized steps with self-contained context briefs, dependency graph with parallel-step detection, adversarial review gate, and plan mutation protocol. Use when planning a large feature, refactor, or roadmap that spans multiple PRs or sessions; not for single-PR tasks or when the user says \"just do it\"."
metadata:
  origin: community
---

# Blueprint — Construction Plan Generator

Turn a one-line objective into a step-by-step construction plan that any coding agent can execute cold.

## When to Use

- Breaking a large feature into multiple PRs with clear dependency order
- Planning a refactor or migration that spans multiple sessions
- Coordinating parallel workstreams across sub-agents
- Any task where context loss between sessions would cause rework

**Do not use** for tasks completable in a single PR, fewer than 3 tool calls, or when the user says "just do it."

## How It Works

Blueprint runs a 5-phase pipeline:

1. **Research** — Pre-flight checks (git, gh auth, remote, default branch), then reads project structure, existing plans, and memory files to gather context.
2. **Design** — Breaks the objective into one-PR-sized steps (3–12 typical). Assigns dependency edges, parallel/serial ordering, model tier (strongest vs default), and rollback strategy per step.
3. **Draft** — Writes a self-contained Markdown plan file to `plans/`. Every step includes a context brief, task list, verification commands, and exit criteria — so a fresh agent can execute any step without reading prior steps.
4. **Review** — Delegates adversarial review to a strongest-model sub-agent (e.g., Opus) against a checklist and anti-pattern catalog. Fixes all critical findings before finalizing.
5. **Register** — Saves the plan, updates memory index, and presents the step count and parallelism summary to the user.

Blueprint detects git/gh availability automatically. With git + GitHub CLI, it generates full branch/PR/CI workflow plans. Without them, it switches to direct mode (edit-in-place, no branches).

## Examples

### Basic usage

```
/blueprint myapp "migrate database to PostgreSQL"
```

Produces `plans/myapp-migrate-database-to-postgresql.md` with steps like:
- Step 1: Add PostgreSQL driver and connection config
- Step 2: Create migration scripts for each table
- Step 3: Update repository layer to use new driver
- Step 4: Add integration tests against PostgreSQL
- Step 5: Remove old database code and config

### Multi-agent project

```
/blueprint chatbot "extract LLM providers into a plugin system"
```

Produces a plan with parallel steps where possible (e.g., "implement Anthropic plugin" and "implement OpenAI plugin" run in parallel after the plugin interface step is done), model tier assignments (strongest for the interface design step, default for implementation), and invariants verified after every step (e.g., "all existing tests pass", "no provider imports in core").

## Key Features

- **Cold-start execution** — Every step includes a self-contained context brief. No prior context needed.
- **Adversarial review gate** — Every plan is reviewed by a strongest-model sub-agent against a checklist covering completeness, dependency correctness, and anti-pattern detection.
- **Branch/PR/CI workflow** — Built into every step. Degrades gracefully to direct mode when git/gh is absent.
- **Parallel step detection** — Dependency graph identifies steps with no shared files or output dependencies.
- **Plan mutation protocol** — Steps can be split, inserted, skipped, reordered, or abandoned with formal protocols and audit trail.
- **Zero runtime risk** — Pure Markdown skill. The entire repository contains only `.md` files — no hooks, no shell scripts, no executable code, no `package.json`, no build step. Nothing runs on install or invocation beyond Claude Code's native Markdown skill loader.

## Installation

This skill ships with ECC. No separate installation is needed when ECC is installed.

### Full ECC install

If you are working from the ECC repository checkout, verify the skill is present with:

```bash
test -f skills/blueprint/SKILL.md
```

To update later, review the ECC diff before updating:

```bash
cd /path/to/ECC
git fetch origin main
git log --oneline HEAD..origin/main       # review new commits before updating
git checkout <reviewed-full-sha>          # pin to a specific reviewed commit
```

### Vendored standalone install

If you are vendoring only this skill outside the full ECC install, copy the reviewed file from the ECC repository into `~/.claude/skills/blueprint/SKILL.md`. Vendored copies do not have a git remote, so update them by re-copying the file from a reviewed ECC commit rather than running `git pull`.

## Requirements

- Claude Code (for `/blueprint` slash command)
- Git + GitHub CLI (optional — enables full branch/PR/CI workflow; Blueprint detects absence and auto-switches to direct mode)

## Source

Inspired by antbotlab/blueprint — upstream project and reference design.