update
將一個或多個 skills 或 tracked 儲存庫更新到最新版本。
skillshare update my-skill # 更新單一 skill
skillshare update a b c # 一次更新多個
skillshare update --group frontend # 更新群組中所有 skills
skillshare update team-skills # 更新 tracked 儲存庫
skillshare update --all # 更新全部
skillshare update agents --all # 更新所有 tracked/可更新的 agents
使用時機
- 某個 tracked 儲存庫有新的 commits(透過
check發現) - 某個已安裝的 skill 有新版本可用
- 你想從原始來源重新下載某個 skill
$ skillshare update pdf
✓ Update pdf · from github.com/anthropics/skills/skills/pdf · 1.9s
✓ Audit no findings
Next
skillshare sync link the changes into your targets
執行內容
對於 Tracked 儲存庫
對於一般 Skills
從遠端來源安裝的 skill 會從該來源重新安裝。從本機路徑安裝的 skill(skillshare install /path/to/skill)會從該路徑重新複製,因此 update 會取得那裡的變更;check 會在該路徑有變更時提示。
選項
| Flag | 說明 |
|---|---|
--all, -a | 更新所有 tracked 儲存庫/skills,或在 update agents --all 中更新所有 agents。位於已跟進的 source 連結背後的 tracked repo 會被略過並顯示警告,因為那是你自己的 checkout;請以名稱更新它 |
--group, -G <name> | 更新群組中所有可更新的 skills,或某個 agent 子目錄中所有 agents |
--force, -f | 捨棄本機變更並強制執行,即使有 audit 發現的問題,並重新安裝已在 upstream commit 的遠端 skill |
--dry-run, -n | 預覽而不做任何變更 |
--skip-audit | 跳過安全性 audit 關卡 |
--audit-threshold <t>, --threshold <t>, -T <t> | 覆寫更新 audit 的封鎖門檻(`critical |
--diff | 在 skill/儲存庫更新後顯示檔案層級的變更摘要 |
--audit-verbose | 在批次模式下顯示每個 skill 的詳細 audit 發現 |
--prune | 移除過期的 skills(上游已刪除),而非僅發出警告 |
--project, -p | 使用目前目錄的 project 層級設定 |
--global, -g | 使用 global 設定(~/.config/skillshare) |
--json | 以 JSON 輸出 |
--help, -h | 顯示說明 |
update agents 支援:--all、--group、--force、--dry-run、--skip-audit、--audit-threshold / --threshold / -T、--json,以及 --project / --global。它不支援 --diff、--audit-verbose 或 --prune。
JSON 輸出
skillshare update --all --json
{
"updated": 3,
"skipped": 1,
"security_failed": 0,
"pruned": 0,
"dry_run": false,
"duration": "4.567s",
"items": [
{"name": "_team-skills", "type": "repo", "status": "updated"},
{"name": "my-skill", "type": "skill", "status": "updated"},
{"name": "another-skill", "type": "skill", "status": "updated"},
{"name": "local-only", "type": "skill", "status": "skipped"}
]
}
可能的 status 值:updated、skipped、failed、security_blocked。當某個項目失敗時,會包含 error 欄位。因本機變更而被略過的遠端 skill,是一個帶有 "error": "local changes since install" 的 skipped 項目。
批次更新時,若遠端 skill 已在 upstream commit,會保持不變並計入 up_to_date 欄位。數量為 0 時省略此欄位。
當 tracked 儲存庫已在 metadata 中宣告但實際磁碟上缺失時,每個項目會被回報為已跳過的 repo 項目,附上簡短的 error(clone directory absent),並在彙總的 missing_tracked_repos 中列出名稱及一次性的復原提示:
{
"updated": 0,
"skipped": 1,
"items": [
{"name": "_team-skills", "type": "repo", "status": "skipped", "error": "clone directory absent"}
],
"missing_tracked_repos": {
"names": ["_team-skills"],
"hint": "Run 'skillshare install' to rehydrate tracked repositories"
}
}
若沒有任何 tracked 儲存庫缺失,則不會出現 missing_tracked_repos 欄位。
Agent JSON 輸出
skillshare update agents --all --json
{
"agents": [
{"name": "reviewer", "status": "updated", "source": "github.com/user/agents/reviewer.md"},
{"name": "team/tutor", "status": "up_to_date", "source": "github.com/user/agents/team/tutor.md"}
],
"dry_run": false,
"duration": "1.234s"
}
可能的 agent status 值包括 updated、failed、skipped、up_to_date、update_available、dirty、drifted、local 與 error。error 表示該 agent 無法檢查,例如連不上 remote 或讀不到 metadata。此時指令不會把 agents 回報為最新,而是以非零結束碼結束。
更新 Agents
當你只想更新獨立的 .md agents 時,使用 agents 類型選擇器:
skillshare update agents reviewer
skillshare update agents --group team
skillshare update agents --all -T high
skillshare update agents --all --json
Agent 更新遵循與 skills 相同的 audit 關卡:
- tracked agent 儲存庫執行
git pull,然後對更新後的儲存庫做 audit - 由 metadata 支援的單檔 agents 會從來源重新安裝,對暫存的
.md做 audit,只有成功時才會取代本機檔案
更新多個
一次更新多個 skills:
skillshare update skill-a skill-b skill-c
只有可更新的 skills(tracked 儲存庫或有 metadata 的 skills)會被處理。找不到的 skills 會有警告但不會導致失敗。不過,若任何 skill 被安全性 audit 關卡封鎖,批次指令會以非零狀態碼結束。
Glob 模式
Skill 名稱支援 glob 模式(*、?、[...])用於批次操作:
skillshare update "core-*" # 更新所有符合 core-* 的 skills
skillshare update "_team-?" # 單字元萬用字元
skillshare update "core-*" "util-*" # 多個模式
Glob 模式比對的是每個 skill 或 tracked 儲存庫的基底名稱(路徑最後一段)。例如,"react-*" 會比對到 frontend/react-hooks,因為其基底名稱是 react-hooks。
Glob 比對不分大小寫:"Core-*" 會比對到 core-auth、CORE-DB 等。
務必以引號包住 glob 模式("core-*"),以避免你的 shell 將 * 展開成目前目錄中的檔案名稱。
更新群組
更新群組目錄中所有可更新的 skills:
skillshare update --group frontend # 更新 frontend/ 中所有 skills
skillshare update -G frontend -G backend # 多個群組
skillshare update x -G backend # 混用名稱與群組
群組中沒有 metadata 或 .git 的本機 skills 會被靜默跳過。
若位置參數對應到一個群組目錄(而非儲存庫或 skill),會自動展開:
skillshare update frontend # 等同於 --group frontend
# 'frontend' is a group — expanding to 3 updatable skills
--all 不能與 skill 名稱或 --group 合併使用。
更新全部
一次更新所有內容:
skillshare update --all
這會更新:
- 所有 tracked 儲存庫(git pull)
- 所有帶有來源 metadata 的 skills(upstream 有變更時重新安裝)
update --all 與 update --group 會依儲存庫將遠端 skill 分組,每個儲存庫只 clone 一次。資料夾在 upstream 沒有變更的 skill 維持不動,並計為 up to date。資料夾中含有 symlink 的 skill 例外:資料夾不變時檔案也可能改變,因此只要 upstream commit 有變動就會重新安裝。在專案模式(-p)下依名稱指定多個 skill 時也相同。使用 --force 可重新安裝所有 skill。只更新一個 skill,或在全域模式下依名稱指定時,一律重新安裝。安裝後你修改過檔案的 skill,在任何情況下都會被略過,直到你加上 --force(參見處理衝突)。無法取得某個儲存庫時,其 skill 計為 skipped,update 會顯示一則警告,寫明該儲存庫與錯誤,並移除 URL 中的憑證。
同一個 git checkout 一次只由一個 skillshare 程序更新。若另一個 update 或 dashboard 正在更新同一個 tracked repo 或透過 git 安裝的 skill,這次更新會等它完成。等待一分鐘後仍未完成,就以 another skillshare process is still updating <path> 放棄。
輸出範例
$ skillshare update --all
✓ Audit 3 skills, no findings
✓ Updated 4, 12 up to date, 1 skipped · 6.2s
Next
skillshare sync link the changes into your targets
缺失的 Tracked 儲存庫
若 .metadata.json 宣告了某個 tracked 儲存庫(tracked: true),但其 clone 目錄在磁碟上不存在 — 這在全新的機器上很常見,因為 clone 目錄位於受管理的 .gitignore 區塊中 — update --all 不會再靜默跳過它。它會回報每個缺失的儲存庫,並提示你進行復原:
! 1 tracked repo declared in metadata but missing on disk
! _team-skills clone directory absent
Run 'skillshare install' to rehydrate tracked repositories
這適用於 global 與 project(-p)模式。若要從 metadata 重新建立 clones,執行不帶參數的 install(詳見 Rehydrating After a Fresh Clone)。
清理過期 Skills(--prune)
當上游儲存庫重新命名或移除某個 skill 時,update 會偵測為 stale(過期) 並發出警告:
Deleted upstream
! frontend/old-skill stale — no longer in the upstream repository
Run with --prune to remove them
加上 --prune 可自動移除過期的 skills(移到垃圾桶,而非永久刪除):
skillshare update --all --prune
check 也會回報過期的 skills:
skillshare check --all
# ! old-skill stale — no longer in the upstream repository
Tracked 儲存庫(_repo)不受 --prune 影響。當 tracked 儲存庫內部移除某個 skill 時,sync 會透過 PruneOrphanLinks 自動清理孤立的 symlinks。
安全性 Audit 關卡
發布 tracked 更新前,update 會稽核隔離的候選 checkout。核准前,正式 checkout 與既有 target 連結仍提供舊內容:
- Tracked 儲存庫(
git pull) 在私有 checkout 中拉取並依生效門檻(audit.block_threshold,預設為CRITICAL)掃描,再發布已稽核的確切 commit,不再從上游拉取 - 一般 skills(重新安裝路徑) 使用相同的門檻政策
- 對於所有更新類型,都會顯示風險標籤/分數以供檢視參考
→ risk: LOW (12/100)
互動模式(TTY,Tracked 儲存庫)
當偵測到達到或超過目前生效門檻的發現時,你會被提示做出決定:
[HIGH] Source repository link detected — may be used for supply-chain redirects (SKILL.md:5)
Security findings at or above active threshold detected.
? Apply anyway? Yes No
- Yes — 接受更新,即使有發現的問題
- No(預設)— 捨棄候選,正式 checkout 保持不變
非互動模式(CI/CD)
在非互動環境中,阻擋性發現會拒絕候選,指令以非零狀態碼結束。掃描錯誤也會保留正式 checkout 與 metadata,即使使用 --force。發布並非多檔案原子切換。
# 當你信任來源時,可繞過 audit 關卡
skillshare update --all --skip-audit
--skip-audit 會完全停用安全性掃描。僅在你信任來源,或有外部 audit 流程時才使用。
已接受的發現
當你以 --force(或在提示中回答 y)覆寫關卡時,你所接受的發現會記錄在 .metadata.json 的 audit_accepted 下。同一個 skill 之後的更新不會再對這些完全相同的發現封鎖,因此你不需要在每次 update --all 都重複 --force。dashboard Updates 分頁的 Force Retry 也會以相同方式記錄,兩者都會沿用在任一處接受的發現。
1 previously accepted finding skipped
一項發現是以規則、檔案與比對到的文字來比對 — 而非行號 — 因此即使無關內容有位移,它仍會維持已接受狀態。任何新的發現,或同一規則比對到不同文字,都會再次封鎖。這適合會合理引用攻擊字串作為範例的 skills(例如安全掃描工具、紅隊文件),同時仍能在後續版本中攔截新的 payload。
你可以用 --audit-threshold、--threshold 或 -T 針對單一指令覆寫門檻:
skillshare update _team-skills --threshold high
skillshare update --all -T h
檔案變更摘要(--diff)
使用 --diff 在每次更新後查看檔案層級的變更摘要:
skillshare update team-skills --diff
skillshare update --all --diff
對於 tracked 儲存庫,diff 使用 git diff,並包含行層級的統計數字:
Files changed
~ SKILL.md (+12 -3)
+ scripts/deploy.sh (+45 -0)
- old-helper.sh (+0 -22)
~ utils/format.md (+5 -2)
對於一般 skills(從遠端來源安裝),diff 會比較重新安裝前後的檔案雜湊值:
Files changed
~ SKILL.md
+ new-helper.sh
標記:+ 新增、- 刪除、~ 修改。最多顯示 20 個檔案;超過的檔案會彙總為「... and N more file(s)」。
處理衝突
若 tracked 儲存庫有未提交的變更:
# 選項 1:先提交你的變更
cd ~/.config/skillshare/skills/_team-skills
git add . && git commit -m "My changes"
skillshare update _team-skills
# 選項 2:捨棄並強制更新
skillshare update _team-skills --force
如果 skillshare 無法讀取該儲存庫的 git status,該儲存庫的更新會以 failed to check git status 失敗;--force 會略過此檢查。
從儲存庫安裝的 skill 同樣受到保護。當它的檔案與安裝時記錄的檔案不再一致時,update 會略過它並回報 local changes since install;skillshare check 會將其列為 modified,skillshare check <name> --diff 會顯示你改了什麼。如果想保留你的修改,請先複製到別處,再捨棄它們:
skillshare update my-skill --force
在 dashboard 的 Updates 分頁中,該 skill 顯示為 Modified locally,並有 View changes 按鈕,可於該 skill 的頁面查看變更;更新前請勾選 Force overwrite local edits,或對被略過的列使用 Force Retry。從該 skill 自己的頁面更新時,會顯示這些變更,並在捨棄前詢問。update <name> --dry-run 會將該 skill 回報為將被略過。若一個 modified 的 skill 同時已在 upstream 被刪除,即使使用 --prune,在你加上 --force 之前也會保留它。
更新後
執行 skillshare sync 將變更分發到所有 targets:
skillshare update --all --diff # 帶檔案層級變更摘要的更新
skillshare sync
Project 模式
更新 project 中的 skills 與 tracked 儲存庫:
skillshare update pdf -p # 更新單一 skill(重新安裝)
skillshare update a b c -p # 更新多個 skills
skillshare update --group frontend -p # 更新群組中所有 skills
skillshare update team-skills -p # 更新 tracked 儲存庫(git pull)
skillshare update --all -p # 更新全部
skillshare update --all -p --dry-run # 預覽
skillshare update --all -p --diff # 帶檔案變更摘要的更新
skillshare update --all -p --skip-audit # 跳過安全性 audit 關卡
運作方式
| 類型 | 方法 | 判斷依據 |
|---|---|---|
Tracked 儲存庫(_repo) | git pull | 以 _ 開頭且有 .git/ 目錄的資料夾 |
| 遠端 skill(有 metadata) | upstream 有變更時從來源重新安裝 | 列於 .metadata.json |
| 從本機路徑安裝 | 從記錄的路徑重新複製 | 列於 .metadata.json,且 type: local |
| 本機 skill | 跳過 | 未列於 .metadata.json |
_ 前綴是選填的,路徑最後一段也一樣 — skillshare update team-skills -p 會自動偵測為 _team-skills,skillshare update devops/team-skills -p 會找到以 --into devops 安裝的 devops/_team-skills。
Lockfile
update -p 是讓釘選的 commit 往前推進的方式。每個移動到新 commit 的 skill 或 tracked 儲存庫,它在 .skillshare/skills.lock.json 中的項目都會被重寫;沒有變更的 skills 則保留原本的釘選。把 lockfile commit 進 git,隊友下次執行 skillshare install -p 時就會得到相同的 commit。詳見 Lockfile。
處理衝突
有未提交變更的 tracked 儲存庫預設會被封鎖:
# 選項 1:先提交變更
cd .skillshare/skills/_team-skills
git add . && git commit -m "My changes"
skillshare update team-skills -p
# 選項 2:捨棄並強制更新
skillshare update team-skills -p --force
如果 skillshare 無法讀取該儲存庫的 git status,該儲存庫的更新會以 failed to check git status 失敗;--force 會略過此檢查。
典型工作流程
skillshare update --all -p
skillshare sync
git add .skillshare/ && git commit -m "Update remote skills"
另請參閱
- install — 安裝 skills
- upgrade — 升級 CLI 與內建 skill
- sync — 同步到 targets
- Project Skills — Project 模式概念