Claude Code

Session 4: GitHub Repo & OSS

202605 | PM

Wiki Source 升級

kb/wiki/summarize-llm-tokens.md      → simonwillison.net
kb/wiki/summarize-context-window.md  → anthropic.com
kb/wiki/summarize-transformer.md     → jalammar.github.io

今天升級:source 從文章變成 GitHub Repository (repo)

從寫到讀

動作對象誰建的
push / pull(上週)你自己的 repo
(今天)世界上其他 repo別人

理解別人的 repo適時地接進自己系統

OSS:Open Source Software

程式碼或內容公開可讀、可用、可改、可分享。開源者拿「被使用」換 reputation。

動作需要 license 嗎PM 日常場景
永遠可以看別人怎麼設計
抄想法永遠可以把 4 條原則接進 /kickoff
商業用途要看 LICENSE(見下)產品內含 OSS 對外賣

商業用途前先看 LICENSE

90% OSS 是 MIT / Apache 2.0,內部用 OK。看到別的 license 暫停問人。

LICENSE內部用商業 / 重發限制 / 注意
MITOKOK保留版權聲明即可,最寬鬆
Apache 2.0OKOK保留聲明 + 含明示專利授權,企業偏好
BSD (2/3-Clause)OKOK類似 MIT,不可用作者名義背書
GPL / AGPLOK慎用衍生物必須同樣開源,AGPL 連 SaaS 都算發佈
CC BY / CC BY-SAOK看條款適用文件、設計素材,需標註來源
CC BY-NCOK不可禁止商業使用
無 LICENSE 檔慎用不可預設保留所有權利,不是 public domain
Custom / Source-available暫停暫停逐條讀過再問人,例如 BSL、SSPL

讀陌生 Repo 三步驟

1. README

前 5 行回答 3 件事:這是什麼 / 解決什麼 / 怎麼開始。答不出來就跳過。

2. 結構(看資料夾)

看到 意思
src/ lib/有 code
docs/ examples/有文件、有範例
templates/有可直接拿的範本
.github/有 CI / 自動化
root 一堆雜亂檔案結構沒整理,慎讀

3. 挑 1 個具體檔案讀

挑 README 提到的關鍵檔案 1 份。不要試圖讀整個 repo。

GitHub Repo 不只 Code

5 種類型:

類型內容範例
Code可執行的程式React、curl
Library給其他程式呼叫的元件OpenAI Python SDK
Docs only純文件Anthropic claude-cookbook
純概念(gist)單檔 markdownKarpathy LLM Wiki gist
知識庫 / 配置別人的工作系統dotfiles、.claude/skills

Repo = 任何被人 clone 下來的東西。不一定有 code

案例 1:Karpathy LLM Wiki gist

gist.github.com/karpathy/...

類型gist(單檔迷你 repo)
體積一份 markdown
內容「LLM 該怎麼維護一個個人 wiki」的設計主張
程式碼

一份 markdown 也叫 repo。S3 KB 心法就基於這份。

案例 2:Matt Pocock /grill-me

github.com/mattpocock/skills(55k stars)。今天看 productivity/grill-me

SKILL.md 全文兩句話:

Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer. Ask the questions one at a time. If a question can be answered by exploring the codebase, explore the codebase instead.
#原則為什麼
1一次只問一題一口氣問 5 題,使用者只答最後一題
2每題附推薦答案沒方向 = 把工作丟回給使用者
3走完整棵決策樹跳問留下未解決的依賴
4能查 codebase 就先讀檔問能自己查的問題 = 浪費使用者時間

核心練習:把這 4 條接到你 S1 建的 /kickoff

Demo Part 1:讓 CC 幫你讀 repo

通用框架,套任何有趣的 repo:

> 去 fetch <URL>
> 拆解設計原則 / 摘要重點 / 找跟我相關的部分

今天的例子

> 去 fetch https://github.com/mattpocock/skills/blob/main/skills/productivity/grill-me/SKILL.md
> 這份 SKILL.md 藏了哪些設計原則?拆出可重用的 rules。

完全不觸及本機。對應後面 P10 層次 1(瀏覽)

Demo Part 2:接進 /kickoff Step 2

原本(S1 建的)

### Step 2: Acknowledge & Clarify
1. Acknowledge the user's parameters
2. Ask clarifying questions if anything is ambiguous

換成 4 條原則

### Step 2: Acknowledge & Clarify

Use these 4 rules when asking clarifying questions:

1. Ask one question at a time. Wait for the answer before asking the next.
2. For each question, provide your recommended answer first, then ask if user agrees.
3. Walk down the decision tree systematically. Resolve dependencies between decisions one-by-one.
4. If a question can be answered by reading project files, read them first before asking.
升級前升級後
一口氣問 5 題一題一題問
純問題、無方向每題附推薦答案
跳著問有邏輯順序
不管專案資料先讀專案再問

沒搬 /grill-me,挑 4 條原則接到自己已有的 /kickoff

安全光譜:4 個層次

層次動作風險今天 demo
1. 瀏覽WebFetch / GitHub 網頁看,不觸及本機0✓ Part 1
2. 抄想法把原則接進自己已有的 skill極低✓ Part 2
3. clone 探索git clone 到本機,只讀不執行課後可選
4. 整個裝執行cp~/.claude/commands/ + 跑課後可選

分界線:clone 後檔案進電腦,誤跑可能性開始出現。3+4 比 1+2 高一個量級。

走到 3 或 4,先過這 4 條:

  1. 看 commit 歷史新鮮度(git log -5 --oneline,兩年沒動的慎用)
  2. star 數不等於品質(看 issues 比看 star 準)
  3. 不直接執行 install script(cat 看內容再跑)
  4. LICENSE 商業使用前確認

作業:找 1 個自己領域的 repo

prompt template / 競品框架 / PM SOP / AI tool example / 別人的 toolkit 都行。挑一個版本:

版本動作對應光譜
輕量WebFetch 拆解 + 寫 wiki summary層次 1
標準輕量 + 借 1 個想法接進自己 skill層次 2
進階標準 + git clone 深讀結構層次 3
完整進階 + 整個裝 1 元件試跑層次 4

輕量已經夠。Wiki summary frontmatter 含 source_urllicense、內容。

Takeaway

OSS 真正的用法是偷想法。讀懂設計原則,接進已有的系統。

課後三件事

  1. 把 4 條原則接進 /kickoff(沒做完的)
  2. 找 1 個自己領域的 repo 做作業
  3. 下次開新專案前先用升級版 /kickoff