From feature-workflow
Batch syncs .spec/ design files to Notion with Git change summaries, updates task status, and commits to Git for closing features or bugs.
npx claudepluginhub mark22013333/crew --plugin feature-workflowThis skill uses the workspace's default tool permissions.
將 `.spec/{slug}/` 中的所有設計文件一次性批次同步到 Notion,更新狀態,同步到知識庫,並提交設計文件到 Git。**整個流程僅 3-5 次 Notion API 呼叫**。
Transforms Notion spec pages into implementation plans and tasks with acceptance criteria, effort estimates, and progress tracking using Notion databases.
Sync tracking documents based on current conversation results. Updates subtask, progress, findings, task_plan, project CLAUDE.md. Use when finishing a task or reaching a milestone.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
將 .spec/{slug}/ 中的所有設計文件一次性批次同步到 Notion,更新狀態,同步到知識庫,並提交設計文件到 Git。整個流程僅 3-5 次 Notion API 呼叫。
依 references/config-resolver.md 的漸進式載入邏輯讀取設定。本 Skill 需要:
config.md(Notion IDs — 功能設計庫 / 專案資料庫)projects/{repo-id}.md(專案對應、技術棧 ID)stacks/{id}.md(技術棧定義,用於設計庫同步)Bug 類型還需 bug-workflow 設定檔(~/.claude-company/bug-workflow-config.md 或 ~/.claude/bug-workflow-config.md)。
/plan-start 建立任務.spec/{slug}/ 下有設計文件)前置檢查:參照 bug-workflow plugin 的
references/prerequisites.md執行完整前置檢查(CLAUDE.md + 設定檔 + 專案註冊)。
與 /plan 相同邏輯。讀取 .spec/{slug}/README.md 取得 type、notion_page_id、notion_url。
掃描 .spec/{slug}/ 目錄,列出所有可用文件:
Feature 類型:
| 檔案 | Notion 區塊 | 存在? |
|---|---|---|
| spec.md | 📐 技術規格 | ✅/❌ |
| db.md | 🗄️ 資料庫設計 | ✅/❌ |
| arch.md | 🏗️ 架構設計 | ✅/❌ |
| files.md | 📁 程式碼清單 | ✅/❌ |
| review.md | 📋 程式碼審查(新增區塊) | ✅/❌ |
| verify.md | 🧪 驗證報告(新增區塊) | ✅/❌ |
| log.md | 📝 開發日誌 | ✅/❌ |
Bug 類型:
| 檔案 | Notion 區塊 | 存在? |
|---|---|---|
| investigation.md | 🔍 調查過程 | ✅/❌ |
| root-cause.md | 🧠 根因分析 | ✅/❌ |
| fix.md | ✅ 修復方案 | ✅/❌ |
| log.md | 📝 經驗教訓 | ✅/❌ |
從專案設定檔讀取 prod_branch(PROD 分支),用作 merge-base 計算 diff:
# {prod_branch} 從 projects/{repo-id}.md 的 prod_branch 欄位讀取
git branch --show-current
git log --oneline $(git merge-base HEAD {prod_branch})..HEAD
git diff $(git merge-base HEAD {prod_branch})..HEAD --stat
git diff $(git merge-base HEAD {prod_branch})..HEAD
若
prod_branch未設定(舊專案),回退邏輯:先取origin/HEAD指向的分支,若無則依序嘗試production→master→main。
根據 CLAUDE.md 的架構描述,產出分層變更摘要。
狀態推斷邏輯:
已完成測試中測試中5-1. Fetch 現有頁面(1 次 notion-fetch)
使用 notion_page_id(從 README.md 取得)fetch 頁面。
5-2. 更新頁面內容(1 次 notion-update-page content)
將所有設計文件內容組合成一次 update_content 操作:
Feature 類型:
📐 技術規格 區塊 ← spec.md 內容
🗄️ 資料庫設計 區塊 ← db.md 內容
🏗️ 架構設計 區塊 ← arch.md 內容
📁 程式碼清單 區塊 ← files.md 內容 + Git diff 產出的分層變更摘要
📝 開發日誌 區塊 ← 附加結案紀錄:
### [{日期}] 開發完成
- **分支**:{branch}
- **Commit 數**:{N}
- **變更摘要**:{分層變更摘要}
若 review.md 存在,在「📝 開發日誌」前插入:
📋 程式碼審查 區塊 ← review.md 內容
若 verify.md 存在,在「📋 程式碼審查」後(或「📝 開發日誌」前)插入:
🧪 驗證報告 區塊 ← verify.md 內容
Bug 類型:
🔍 調查過程 區塊 ← investigation.md 內容
🧠 根因分析 區塊 ← root-cause.md 內容
✅ 修復方案 區塊 ← fix.md 內容 + Git diff 分層摘要
📝 經驗教訓 區塊 ← log.md 或自動產生的經驗教訓
5-3. 更新 Properties(1 次 notion-update-page properties)
Feature:
| 欄位 | 值 |
|---|---|
| 狀態 | 步驟 4 判斷結果 |
| 開發階段 | 測試中 |
| 修復分支 | 當前 Git branch |
Bug:
| 欄位 | 值 |
|---|---|
| 狀態 | 步驟 4 判斷結果 |
| 根因分類 | 從 root-cause.md 推斷(邏輯錯誤/資料異常/設定問題/第三方API/效能/權限/前端UI) |
| 修復分支 | 當前 Git branch |
Feature → 功能設計庫(1 次 notion-create-pages)
同步邏輯:
| 欄位 | 值 |
|---|---|
| Name | 功能標題 |
| Tags | 自動推測(API/報表/標籤/推播/排程 等) |
| 設計類型 | 依文件齊全度判斷 |
| 技術棧 | 設定檔中的技術棧 ID |
| 參考連結 | Notion 頁面 URL |
| 專案資料庫 | 同一專案 |
Bug → Bug 知識庫(1 次 notion-create-pages)
複用 bug-close 的同步邏輯:
| 欄位 | 值 |
|---|---|
| Name | Bug 標題 |
| Tags | 自動推測 |
| 難易度 | 依修改檔案數和行數判斷 |
| 專案資料庫 | 同一專案 |
| 參考連結 | Notion 頁面 URL |
若 README.md 中 related_feature 不為空:
.spec/{related_feature}/README.md 取得 notion_page_idnotion-fetch 取得關聯 Feature 的 Notion 頁面(1 次)### [{日期}] 🔴 相關 Bug
- Bug: {Bug 名稱}({Bug Notion URL})
- 根因: {root-cause.md 摘要}
- 修復: {fix.md 摘要}
notion-update-page 更新 Feature 頁面(1 次)將最終版本的設計文件提交:
在 .gitignore 中排除此 slug 的目錄:
!.spec/{slug}/ 到 .gitignoreGit 操作:
git add .spec/{slug}/
git commit -m "docs: 新增 {slug} 設計文件"
將任務從「進行中」移至「已完成」區段:
## 已完成
| slug | 類型 | 名稱 | 完成日期 | Notion |
|------|------|------|---------|--------|
| {slug} | {type} | {name} | {日期} | [連結]({url}) |
不刪除 .spec/{slug}/ 目錄,保留供未來 Bug 關聯匹配。
結案完成!
📊 Notion 頁面:{URL}(已更新)
📚 知識庫:{知識庫條目 URL}(已同步)
{📎 Feature 關聯:已更新 {related_feature} 的開發日誌}
📁 設計文件:已提交到 Git
Notion API 呼叫統計:{N} 次(fetch: 1, update: 2, create: 1{, 關聯更新: 2})
後續事項:
📋 測試驗證:在 Notion 頁面勾選驗證項目
🔀 Git 合併:{根據 CLAUDE.md Git Flow 產出合併建議}
update_content。.spec/ 忽略 + !.spec/{slug}/ 取消忽略的規則,可能被 .gitignore 中其他更後面的規則(如 *.bak)再次覆蓋。確保 !.spec/{slug}/ 放在所有相關忽略規則之後。related_feature 時會多 2 次(fetch + update 關聯 Feature 頁面),實際可達 7 次。回傳結果的統計數字要如實反映。/plan-sync 建立 Notion 條目/plan-sync 重試