backfill-documentation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

補充文件(Backfill Documentation)

Backfill Documentation

概述

Overview

當功能已經實作完成,但沒有經過正式的設計流程時,使用此技能來補充文件。這確保所有功能都有完整的文件記錄,便於未來維護和理解。
開始時宣布: "我正在使用 backfill-documentation 技能來補充文件。"
必要子技能:
  • 使用 hi-skills:brainstorming 的設計文件格式
  • 使用 hi-skills:executing-plans 的實作計劃格式
Use this skill to supplement documents when a feature has been implemented without going through a formal design process. This ensures that all features have complete documentation records for future maintenance and understanding.
Announce at start: "I am using the backfill-documentation skill to supplement documents."
Required sub-skills:
  • Use the design document format of hi-skills:brainstorming
  • Use the implementation plan format of hi-skills:executing-plans

流程

Procedure

步驟 1:載入參考格式

Step 1: Load reference formats

先調用技能取得格式規範:
  1. 調用
    Skill: brainstorming
    - 取得設計文件的格式要求
  2. 調用
    Skill: executing-plans
    - 取得實作計劃的格式要求
Call skills first to obtain format specifications:
  1. Call
    Skill: brainstorming
    - Get format requirements for design documents
  2. Call
    Skill: executing-plans
    - Get format requirements for implementation plans

步驟 2:收集資訊

Step 2: Collect information

  1. 識別相關 commits
    bash
    git log --oneline --since="YYYY-MM-DD" --grep="<關鍵字>"
  2. 閱讀變更的檔案
    • 從 git diff 或 git show 了解變更內容
    • 識別涉及的檔案和變更範圍
  3. 理解功能
    • 這個功能解決什麼問題?
    • 使用者體驗流程是什麼?
    • 資料如何流動?
    • 有哪些關鍵決策?
  1. Identify relevant commits
    bash
    git log --oneline --since="YYYY-MM-DD" --grep="<關鍵字>"
  2. Read changed files
    • Understand changes from git diff or git show
    • Identify involved files and scope of changes
  3. Understand the feature
    • What problem does this feature solve?
    • What is the user experience flow?
    • How does data flow?
    • What are the key decisions?

步驟 3:生成設計文件

Step 3: Generate design document

參照 brainstorming 技能格式,建立
docs/plans/YYYY-MM-DD-<topic>-design.md
必要元素(來自 brainstorming):
  1. 概述 - 功能目的和背景
  2. 需求 - 明確的需求清單
  3. 使用者體驗流程 - ASCII 流程圖
  4. 資料流程 - 資料如何在系統中流動
  5. 資料結構變更 - 新增或修改的型別/欄位
  6. UI 變更 - ASCII UI 圖(如適用)
  7. 修改檔案清單 - 表格列出所有變更
  8. 實作邏輯 - 關鍵程式碼片段
  9. 驗收標準 - 所有項目標記為
    [x]
    已完成
Refer to the format of the brainstorming skill, create
docs/plans/YYYY-MM-DD-<topic>-design.md
:
Required elements (from brainstorming):
  1. Overview - Feature purpose and background
  2. Requirements - Clear list of requirements
  3. User experience flow - ASCII flow chart
  4. Data flow - How data flows in the system
  5. Data structure changes - New or modified types/fields
  6. UI changes - ASCII UI diagram (if applicable)
  7. List of modified files - Table listing all changes
  8. Implementation logic - Key code snippets
  9. Acceptance criteria - All items marked as
    [x]
    completed

步驟 4:生成實作計劃

Step 4: Generate implementation plan

參照 executing-plans 技能格式,建立
docs/plans/YYYY-MM-DD-<topic>-plan.md
必要元素(來自 executing-plans):
  1. 狀態標記 -
    > **狀態:** ✅ 已完成
  2. 目標和架構 - 簡短描述
  3. 任務清單 - 每個任務標記 ✅,包含:
    • 檔案清單
    • 完成內容
  4. 變更摘要 - 影響檔案和風險等級 🟢
  5. 相關 Commits - 列出相關的 git commits
Refer to the format of the executing-plans skill, create
docs/plans/YYYY-MM-DD-<topic>-plan.md
:
Required elements (from executing-plans):
  1. Status tag -
    > **狀態:** ✅ 已完成
  2. Goals and architecture - Short description
  3. Task list - Each task marked ✅, including:
    • List of files
    • Completed content
  4. Change summary - Affected files and risk level 🟢
  5. Relevant Commits - List relevant git commits

步驟 5:建立索引檔

Step 5: Create index file

建立
~/.claude/plans/YYYY-MM-DD-<project>-<topic>.md
markdown
undefined
Create
~/.claude/plans/YYYY-MM-DD-<project>-<topic>.md
:
markdown
undefined

<project>-<topic>

<project>-<topic>

project_path: <專案路徑> status: done design_file: docs/plans/YYYY-MM-DD-<topic>-design.md plan_file: docs/plans/YYYY-MM-DD-<topic>-plan.md
undefined
project_path: <專案路徑> status: done design_file: docs/plans/YYYY-MM-DD-<topic>-design.md plan_file: docs/plans/YYYY-MM-DD-<topic>-plan.md
undefined

步驟 6:更新索引

Step 6: Update index

執行
/hi-update-plans-index
更新計畫索引。
Run
/hi-update-plans-index
to update the plan index.

步驟 7:提交文件

Step 7: Commit documents

bash
git add docs/plans/
git commit -m "docs: 補充 <功能名稱> 的設計與實作計劃文件

- 新增 <topic>-design.md(設計文件)
- 新增 <topic>-plan.md(實作計劃,已完成)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>"
bash
git add docs/plans/
git commit -m "docs: 補充 <功能名稱> 的設計與實作計劃文件

- 新增 <topic>-design.md(設計文件)
- 新增 <topic>-plan.md(實作計劃,已完成)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>"

設計文件範本

Design Document Template

參照
/hi-brainstorm
輸出格式:
markdown
undefined
Refer to the /hi-brainstorm output format:
markdown
undefined

<功能名稱>設計

<功能名稱>設計

概述

概述

<簡短描述功能目的和解決的問題>
<簡短描述功能目的和解決的問題>

需求

需求

  1. <需求 1>
  2. <需求 2>
  3. ...
  1. <需求 1>
  2. <需求 2>
  3. ...

使用者體驗流程

使用者體驗流程

┌─────────────────────────────────────────────────────────┐
│ <流程步驟>                                               │
├─────────────────────────────────────────────────────────┤
│  <UI 元素描述>                                           │
└─────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────┐
│ <流程步驟>                                               │
├─────────────────────────────────────────────────────────┤
│  <UI 元素描述>                                           │
└─────────────────────────────────────────────────────────┘

資料流程

資料流程

<步驟描述>
┌──────────────────────────────────────────────────────┐
│ <元件/系統名稱>                                       │
│                                                      │
│ 1. <動作 1>                                          │
│ 2. <動作 2>                                          │
└──────────────────────────────────────────────────────┘
<步驟描述>
┌──────────────────────────────────────────────────────┐
│ <元件/系統名稱>                                       │
│                                                      │
│ 1. <動作 1>                                          │
│ 2. <動作 2>                                          │
└──────────────────────────────────────────────────────┘

資料結構變更

資料結構變更

<collection/type 名稱>

<collection/type 名稱>

typescript
{
  existingField: string;
  newField: string;  // 新增:說明
}
typescript
{
  existingField: string;
  newField: string;  // 新增:說明
}

UI 變更

UI 變更

<ASCII UI 圖>
<ASCII UI 圖>

修改檔案清單

修改檔案清單

檔案變更內容
path/to/file.ts
<變更描述>
檔案變更內容
path/to/file.ts
<變更描述>

實作邏輯

實作邏輯

typescript
// 關鍵程式碼片段(說明核心邏輯)
typescript
// 關鍵程式碼片段(說明核心邏輯)

驗收標準

驗收標準

  • <標準 1>
  • <標準 2>
undefined
  • <標準 1>
  • <標準 2>
undefined

實作計劃範本

Implementation Plan Template

參照
/hi-ace
輸出格式:
markdown
undefined
Refer to the /hi-ace output format:
markdown
undefined

<功能名稱> 實作計劃

<功能名稱> 實作計劃

狀態: ✅ 已完成
目標: <功能目標>
架構: <技術架構簡述>
技術棧: <使用的技術>

狀態: ✅ 已完成
目標: <功能目標>
架構: <技術架構簡述>
技術棧: <使用的技術>

任務 1:<任務名稱> ✅

任務 1:<任務名稱> ✅

檔案:
  • 修改:
    path/to/file.ts
完成內容:
  • <完成的項目 1>
  • <完成的項目 2>

檔案:
  • 修改:
    path/to/file.ts
完成內容:
  • <完成的項目 1>
  • <完成的項目 2>

任務 2:<任務名稱> ✅

任務 2:<任務名稱> ✅

...

...

變更摘要

變更摘要

影響檔案:
  • file1.ts
    - <變更描述>
  • file2.ts
    - <變更描述>
整體風險: 🟢(已完成,無問題)
相關 Commits:
  • <commit message 1>
  • <commit message 2>
undefined
影響檔案:
  • file1.ts
    - <變更描述>
  • file2.ts
    - <變更描述>
整體風險: 🟢(已完成,無問題)
相關 Commits:
  • <commit message 1>
  • <commit message 2>
undefined

記住

Remember

  • 必須參照子技能 - 先調用 brainstorming 和 executing-plans 確認最新格式
  • 從現有程式碼反推設計,不是編造
  • 所有驗收標準標記為已完成(因為功能已實作)
  • 實作計劃的任務從 git commits 推斷
  • 確保文件能幫助未來的開發者理解功能
  • 使用一致的格式和命名規則
  • Must refer to sub-skills - Call brainstorming and executing-plans first to confirm the latest format
  • Infer design from existing code, do not fabricate
  • All acceptance criteria are marked as completed (since the feature has been implemented)
  • Tasks in the implementation plan are inferred from git commits
  • Ensure that documents can help future developers understand the feature
  • Use consistent format and naming rules