$npx -y skills add harryleemedia/second-brain --skill pptx-generatorGenerate and edit presentation slides as PPTX files. Also create LinkedIn carousels and manage reusable slide layouts. TRIGGERS - Use this skill when user says: - "create slides for [brand]" / "generate presentation for [brand]" / "make slides for [brand]" - "create a carousel fo
| 1 | # PPTX 投影片產生器 |
| 2 | |
| 3 | 使用 python-pptx 產生專業、符合品牌風格的簡報投影片。此技能支援: |
| 4 | - **投影片產生** - 為 `brands/` 中的任何品牌建立簡報 |
| 5 | - **輪播圖產生** - 建立 LinkedIn 輪播圖(正方形格式,匯出為 PDF) |
| 6 | - **投影片編輯** - 修改現有的 PPTX 檔案 |
| 7 | - **版面管理** - 建立、編輯、更新版面範本庫版面 |
| 8 | |
| 9 | **重要:** 所有技能資源都在 `.claude/skills/pptx-generator/` 中。搜尋檔案時,請始終使用以 `.claude/skills/pptx-generator/` 開頭的 Glob 模式。 |
| 10 | |
| 11 | --- |
| 12 | |
| 13 | ## ⚠️ 關鍵:批次產生規則 |
| 14 | |
| 15 | **一次切勿產生超過 5 張投影片。** |
| 16 | |
| 17 | | 規則 | 詳情 | |
| 18 | |------|------| |
| 19 | | 每批次最多投影片數 | **5**(可以是 1、2、3、4 或 5) | |
| 20 | | 每批次結束後 | **停下來驗證輸出** | |
| 21 | | 必須驗證 | 檢查:沒有重複標題、正確的間距、正確的顏色 | |
| 22 | | 繼續的條件 | 驗證通過 | |
| 23 | | **所有批次完成後** | **合併成單一檔案並刪除分割檔案** | |
| 24 | |
| 25 | 這可以防止 token 上限錯誤,並及早發現品質問題。 |
| 26 | |
| 27 | **關鍵:合併後務必清理分割檔案。** 使用者應該只看到一個最終 PPTX 檔案,而不是多個分割檔案。 |
| 28 | |
| 29 | --- |
| 30 | |
| 31 | ## ⚠️ 前置條件:品牌檢查 |
| 32 | |
| 33 | **在產生投影片之前,請檢查是否有任何品牌存在。** |
| 34 | |
| 35 | ``` |
| 36 | Glob: .claude/skills/pptx-generator/brands/*/brand.json |
| 37 | ``` |
| 38 | |
| 39 | **如果找不到品牌(只有 `template/` 存在):** |
| 40 | |
| 41 | 1. **停止** - 不要繼續產生投影片 |
| 42 | 2. **詢問使用者:** |
| 43 | > "尚未設定任何品牌。您希望我先幫您建立一個品牌嗎? |
| 44 | > 我需要您的品牌色彩、字型和風格指南來完成設定。" |
| 45 | |
| 46 | 3. **如果使用者想建立品牌**,請按照下方的**建立新品牌**章節操作。 |
| 47 | |
| 48 | 4. **如果使用者拒絕**,解釋投影片需要品牌設定,並提供使用通用樣式作為備選方案。 |
| 49 | |
| 50 | --- |
| 51 | |
| 52 | ## 建立新品牌 |
| 53 | |
| 54 | 當沒有品牌存在或使用者要求建立新品牌時: |
| 55 | |
| 56 | ### 步驟 1:閱讀範本 |
| 57 | |
| 58 | ``` |
| 59 | Read: .claude/skills/pptx-generator/brands/template/README.md |
| 60 | Read: .claude/skills/pptx-generator/brands/template/brand.json |
| 61 | Read: .claude/skills/pptx-generator/brands/template/config.json |
| 62 | ``` |
| 63 | |
| 64 | ### 步驟 2:收集品牌資訊 |
| 65 | |
| 66 | 向使用者詢問(或從提供的素材中提取): |
| 67 | |
| 68 | | 必填 | 說明 | |
| 69 | |------|------| |
| 70 | | **品牌名稱** | 資料夾名稱(小寫、無空格) | |
| 71 | | **色彩** | 背景色、文字色、強調色(十六進位色碼) | |
| 72 | | **字型** | 標題字型、內文字型、程式碼字型 | |
| 73 | |
| 74 | | 選填 | 說明 | |
| 75 | |------|------| |
| 76 | | 輸出目錄 | 產生檔案的儲存位置(預設:`output/{brand}`) | |
| 77 | | 標誌 | 標誌檔案路徑(PNG/SVG) | |
| 78 | | 品牌指南 | 現有的風格指南或參考網站 | |
| 79 | | 語氣風格 | 書寫風格、用語偏好 | |
| 80 | |
| 81 | ### 步驟 3:建立品牌檔案 |
| 82 | |
| 83 | 1. **建立品牌資料夾:** |
| 84 | ```bash |
| 85 | mkdir -p .claude/skills/pptx-generator/brands/{brand-name} |
| 86 | ``` |
| 87 | |
| 88 | 2. **建立 brand.json**,填入收集到的值: |
| 89 | ```json |
| 90 | { |
| 91 | "name": "Brand Name", |
| 92 | "description": "One-line description", |
| 93 | "colors": { |
| 94 | "background": "hex-without-hash", |
| 95 | "background_alt": "hex-without-hash", |
| 96 | "text": "hex-without-hash", |
| 97 | "text_secondary": "hex-without-hash", |
| 98 | "accent": "hex-without-hash", |
| 99 | "accent_secondary": "hex-without-hash", |
| 100 | "accent_tertiary": "hex-without-hash", |
| 101 | "code_bg": "hex-without-hash", |
| 102 | "card_bg": "hex-without-hash", |
| 103 | "card_bg_alt": "hex-without-hash" |
| 104 | }, |
| 105 | "fonts": { |
| 106 | "heading": "Font Name", |
| 107 | "body": "Font Name", |
| 108 | "code": "Monospace Font" |
| 109 | }, |
| 110 | "assets": { |
| 111 | "logo": "assets/logo.png", |
| 112 | "logo_dark": null, |
| 113 | "icon": null |
| 114 | } |
| 115 | } |
| 116 | ``` |
| 117 | |
| 118 | 3. **建立 config.json**,填入輸出設定: |
| 119 | ```json |
| 120 | { |
| 121 | "output": { |
| 122 | "directory": "output/{brand}", |
| 123 | "naming": "{name}-{date}", |
| 124 | "keep_parts": false |
| 125 | }, |
| 126 | "generation": { |
| 127 | "slides_per_batch": 5, |
| 128 | "auto_combine": true, |
| 129 | "open_after_generate": false |
| 130 | }, |
| 131 | "defaults": { |
| 132 | "slide_width_inches": 13.333, |
| 133 | "slide_height_inches": 7.5 |
| 134 | } |
| 135 | } |
| 136 | ``` |
| 137 | |
| 138 | 4. **建立 brand-system.md** - 從範本複製並填入品牌指南 |
| 139 | |
| 140 | 5. **建立 tone-of-voice.md** - 從範本複製並填入語氣風格指南 |
| 141 | |
| 142 | 6. **新增素材** - 將標誌/圖片複製到 `brands/{brand-name}/assets/` |
| 143 | |
| 144 | ### 步驟 4:驗證 |
| 145 | |
| 146 | 建立品牌後,使用以下方式驗證: |
| 147 | ``` |
| 148 | Glob: .claude/skills/pptx-generator/brands/{brand-name}/* |
| 149 | ``` |
| 150 | |
| 151 | 然後繼續產生投影片。 |
| 152 | |
| 153 | --- |
| 154 | |
| 155 | ## 技能模式 |
| 156 | |
| 157 | 此技能有三種模式: |
| 158 | |
| 159 | ### 模式 1:產生簡報投影片 |
| 160 | 使用者希望使用品牌樣式建立簡報投影片(16:9)。 |
| 161 | → 依序執行:品牌探索 → 版面選擇 → 內容調整 → 執行 |
| 162 | → 版面位於:`cookbook/*.py` |
| 163 | |
| 164 | ### 模式 2:產生 LinkedIn 輪播圖 |
| 165 | 使用者希望為社群媒體建立 LinkedIn 輪播圖(正方形 1:1 格式)。 |
| 166 | → 依序執行:品牌探索 → 輪播圖規劃 → 產生 → 匯出 PDF |
| 167 | → 版面位於:`cookbook/carousels/*.py` |
| 168 | |
| 169 | ### 模式 3:管理版面範本庫 |
| 170 | 使用者希望建立、編輯或改善版面範本。 |
| 171 | → 依序執行:版面 CRUD 操作章節 |
| 172 | |
| 173 | --- |
| 174 | |
| 175 | ## 模式 1:產生簡報投影片 |
| 176 | |
| 177 | ### 步驟 1:品牌探索 |
| 178 | |
| 179 | 1. **列出可用品牌:** |
| 180 | ``` |
| 181 | Glob: .claude/skills/pptx-generator/brands/*/brand.json |
| 182 | ``` |
| 183 | 從路徑提取唯一的品牌名稱(例如 `brands/rasmus/...` → "rasmus") |
| 184 | |
| 185 | 2. **讀取品牌設定檔案:** |
| 186 | ``` |
| 187 | Read: .claude/skills/pptx-generator/brands/{brand-name}/brand.json |
| 188 | Read: .claude/skills/pptx-generator/brands/{brand-name}/config.json |
| 189 | ``` |
| 190 | - `brand.json` - 色彩、字型、素材 |
| 191 | - `config.json` - 輸出目錄、產生設定 |
| 192 | |
| 193 | 3. **讀取輔助 Markdown 檔案以獲取上下文:** |
| 194 | ``` |
| 195 | Glob: .claude/skills/pptx-generator/brands/{brand-name}/*.md |
| 196 | ``` |
| 197 | 這些提供語氣、風格和設計理念。 |
| 198 | |
| 199 | 4. **從品牌檔案中提取:** |
| 200 | - **從 brand.json:** 色彩(不含 # 的十六進位值)、字型、素材路徑 |
| 201 | - **從 config.json:** 輸出目錄、每批次投影片數、命名規則 |
| 202 | - **從 Markdown:** 語氣、風格、用語、視覺原則 |
| 203 | |
| 204 | 如果找不到品牌,列出可用品牌並請使用者選擇。 |
| 205 | |
| 206 | ### 步驟 2:版面探索(閱讀所有前置資訊) |
| 207 | |
| 208 | **⚠️ 必須:在選擇任何版面之前,先閱讀所有版面的 |