Anthropic Financial Services 詳細教學
本教學對應 repo commit
3edda1c(2026-05-19),最後驗證日 2026-05-20。 涵蓋專案定位、安裝、核心架構(“one source, two wrappers”)、scripts CLI、應用場景、資安、FAQ、進階技巧、整合 9 個章節,重點放在「可移植到其他領域的 plugin 工程模式」。
1. 專案定位
1.1 是什麼
Anthropic 官方的 Financial Services Industry (FSI) Claude 解決方案模板庫,內含:
- 10 個 named agents(end-to-end workflow agents)
- 7 個 vertical plugins(skills + commands + 11 個 MCP 連接器)
- 2 個 partner plugins(LSEG + S&P Global)
- 11 個 managed-agent cookbooks(同樣 agent 的 Managed Agent API 部署版)
- Microsoft 365 add-in 安裝工具(給 IT admin)
- 7 個 repo 維護腳本(lint / sync / version bump / deploy / orchestrate)
官方定位:reference templates,FSI 公司直接 fork 後客製。不構成投資/法務/稅務建議,所有輸出 staged for human sign-off。
1.2 為什麼重要(對非 FSI 團隊也有價值)
| 看點 | 為什麼值得學 |
|---|---|
| “one source, two wrappers” 設計 | 同一份 agents/<slug>.md 同時是 Cowork plugin 與 Managed Agent — 避免維護兩份 prompt |
| 三層 plugin 切法 | agent-plugins(end-user 看到的)/ vertical-plugins(共用 skills)/ partner-built(外部夥伴)— 大型 plugin 庫的清晰切法 |
scripts/check.py | manifest lint + 跨檔 ref 驗證 + 自安裝 pre-commit hook — 可移植到任何 multi-plugin repo |
scripts/sync-agent-skills.py | 解決「skill 在多處有副本,誰是 source of truth」的工程實務 |
agent.yaml + subagents/*.yaml | Managed Agent API 的 callable_agents 範式:parent agent + leaf workers,每個 leaf 限制工具集(例如「只有 builder 有 Write」) |
| env var SAFE regex 校驗 | deploy-managed-agent.sh 內白名單字元 — 是 shell injection 防護的好範例 |
1.3 與相關工具的關係
| 工具 | 關係 |
|---|---|
| Claude Code Plugin 系統 | Cowork 是 Claude Code 在 Office workspace 的部署形式,plugin 機制共用 |
Claude Managed Agents API (/v1/agents) | 給「無 UI 自動化」用的部署路徑,與 plugin 共用 system prompt |
| MCP (Model Context Protocol) | 11 個商業金融資料平台都用 MCP server 接入 |
| Microsoft 365 add-in | Excel / PPT / Word / Outlook 內嵌 Claude;本 repo 提供 IT admin 部署工具 |
1.4 一句話總結
Anthropic 把 FSI 的 10 個 workflow agents 寫成「Cowork plugin + Managed Agent 雙路出貨」的官方模板庫,重點是 plugin 工程模式(check / sync / version-bump / deploy) 與 多層 plugin 切法,任何垂直領域都能 fork 後改造。
2. 安裝指南
2.1 場景 A — Claude Code 內當 plugin 用
1# 加 marketplace
2claude plugin marketplace add anthropics/financial-services
3
4# 先裝核心 vertical(11 個 MCP 連接器都在裡頭)
5claude plugin install financial-analysis@claude-for-financial-services
6
7# 再依需要裝 named agent
8claude plugin install pitch-agent@claude-for-financial-services
9claude plugin install gl-reconciler@claude-for-financial-services
10
11# 或裝整個 vertical(含其下所有 skill + command)
12claude plugin install investment-banking@claude-for-financial-services
13claude plugin install equity-research@claude-for-financial-services
安裝後:agents 出現在 Cowork dispatch;skills 在相關情境自動觸發;slash commands(
/comps、/dcf、/earnings、/ic-memo…)在 session 內可用。
2.2 場景 B — Managed Agents API 部署(無 UI 自動化)
1git clone https://github.com/anthropics/financial-services
2cd financial-services
3
4export ANTHROPIC_API_KEY=sk-ant-...
5# (可選)指向其他 MCP server
6export CAPIQ_MCP_URL="https://kfinance.kensho.com/integrations/mcp"
7export DALOOPA_MCP_URL="https://mcp.daloopa.com/server/mcp"
8
9# 一鍵部署
10scripts/deploy-managed-agent.sh gl-reconciler
11
12# Dry-run(不打 API)
13scripts/deploy-managed-agent.sh gl-reconciler --dry-run
部署腳本會:
- 解析
managed-agent-cookbooks/gl-reconciler/agent.yaml - 把
system.file: ../../plugins/agent-plugins/gl-reconciler/agents/gl-reconciler.md內聯成 string - 把
skills目錄上傳到/v1/skills,記下 skill_id - 把
callable_agents.manifest內每個 subagent yaml 先建好,記下 agent_id - POST 最終組裝後的 payload 到
/v1/agents
2.3 場景 C — Microsoft 365 add-in 部署
1# 在 Claude Code 內
2claude plugin install claude-for-msft-365-install@claude-for-financial-services
3/claude-for-msft-365-install:setup
不是 Cowork plugin!是給 IT admin 一次性部署 Office 365 add-in,指向自己雲(Vertex AI / Bedrock / 內部 LLM gateway)而非 Anthropic API。
2.4 系統需求
| 項目 | 需求 |
|---|---|
| Claude Code | 有 /plugin 支援的版本 |
| Python | 3 + pyyaml(給 scripts/) |
| 工具 | jq、curl、git |
| API key | ANTHROPIC_API_KEY(Managed Agents 用) |
| MCP 商業資料 | 依供應商需另購(Daloopa / S&P / FactSet …) |
3. 核心架構解析
3.1 “One source, two wrappers” 雙路出貨
flowchart LR
SRC[agents/<slug>.md
canonical system prompt
+ skills/] --> COWORK[Cowork Plugin Wrapper
.claude-plugin/plugin.json
UI dispatch]
SRC --> CMA[Managed Agent Wrapper
cookbook/agent.yaml
headless via /v1/agents]
COWORK --> U1[End user via Claude Code]
CMA --> U2[Automation / workflow engine]
關鍵設計:
- 唯一真實來源 =
plugins/agent-plugins/<slug>/agents/<slug>.md - Cowork plugin 直接讀 .md
- Managed Agent cookbook 的
agent.yaml用system.file: ../../plugins/agent-plugins/<slug>/agents/<slug>.mdreference 同一份 - Skills 寫在
vertical-plugins/<vertical>/skills/,跑sync-agent-skills.py同步到agent-plugins/<slug>/skills/
3.2 三層 plugin 切法
1plugins/
2├── agent-plugins/ # 10 個 self-contained named agent,end user 直接安裝
3│ ├── pitch-agent/
4│ ├── meeting-prep-agent/
5│ ├── market-researcher/
6│ ├── earnings-reviewer/
7│ ├── model-builder/
8│ ├── valuation-reviewer/
9│ ├── gl-reconciler/
10│ ├── month-end-closer/
11│ ├── statement-auditor/
12│ └── kyc-screener/
13│
14├── vertical-plugins/ # 7 個 vertical(skill source of truth)
15│ ├── financial-analysis/ ⭐ 核心 — 11 個 MCP 都在這裡
16│ ├── investment-banking/
17│ ├── equity-research/
18│ ├── private-equity/
19│ ├── wealth-management/
20│ ├── fund-admin/
21│ └── operations/
22│
23└── partner-built/ # 2 個夥伴 plugin
24 ├── lseg/
25 └── spglobal/
3.3 Managed Agent 部署流程
sequenceDiagram
participant Dev as Developer
participant Sh as deploy-managed-agent.sh
participant Y as agent.yaml
participant API as Anthropic API /v1
participant FS as Local filesystem
Dev->>Sh: scripts/deploy-managed-agent.sh gl-reconciler
Sh->>Y: yaml2json (env var 注入 + SAFE regex 校驗)
Sh->>FS: 讀 system.file → 內聯
loop 每個 skills[].path
Sh->>API: POST /v1/skills (upload skill 目錄)
API-->>Sh: skill_id
end
loop 每個 callable_agents[].manifest
Sh->>API: POST /v1/agents (建 leaf subagent)
API-->>Sh: agent_id
end
Sh->>API: POST /v1/agents (建 orchestrator)
API-->>Dev: orchestrator agent_id
3.4 model-builder 範例(agent.yaml 解析)
1name: model-builder
2model: claude-opus-4-7
3
4system:
5 file: ../../plugins/agent-plugins/model-builder/agents/model-builder.md
6 append: "You are running headless. Produce files in ./out/; do not assume an open Office document."
7
8tools:
9 - type: agent_toolset_20260401
10 default_config: { enabled: false } # 預設關
11 configs:
12 - { name: read, enabled: true } # 明確開白名單
13 - { name: grep, enabled: true }
14 - { name: glob, enabled: true }
15 - { type: mcp_toolset, mcp_server_name: capiq, default_config: { enabled: true } }
16 - { type: mcp_toolset, mcp_server_name: daloopa, default_config: { enabled: true } }
17
18mcp_servers:
19 - { type: url, name: capiq, url: "${CAPIQ_MCP_URL}" }
20 - { type: url, name: daloopa, url: "${DALOOPA_MCP_URL}" }
21
22skills:
23 - { from_plugin: ../../plugins/agent-plugins/model-builder }
24
25callable_agents:
26 - { manifest: ./subagents/data-puller.yaml }
27 - { manifest: ./subagents/builder.yaml } # ← only leaf with Write
28 - { manifest: ./subagents/auditor.yaml }
關鍵 pattern:
- 預設關所有工具,明確開白名單(
default_config: { enabled: false }) - Write 工具只給單一 leaf agent(builder.yaml)— 最小權限
- MCP server URL 來自 env var,並用 SAFE regex 校驗
- callable_agents = parent 可呼叫的子 agent,形成 depth-1 樹狀
3.5 7 個 scripts 工具總覽
| 腳本 | 角色 |
|---|---|
check.py | manifest lint + 跨檔 reference 驗證 + skill drift 檢查 + 自安裝 pre-commit hook (git config core.hooksPath .githooks) |
sync-agent-skills.py | 把 vertical-plugins/<v>/skills/ 同步到 agent-plugins/<slug>/skills/(避免 drift) |
version_bump.py | pre-commit hook 內呼叫,自動 patch bump plugin.json version(per-branch 一次) |
deploy-managed-agent.sh | yaml → JSON → 上傳 skills → 建 subagents → POST orchestrator |
orchestrate.py | reference event loop,路由 handoff_request 事件給對應 agent |
validate.py | 額外 manifest 校驗(schema) |
test-cookbooks.sh | 跑 cookbooks 測試 |
4. CLI 詳細用法
4.1 開發者本地工作流
1# 1. clone + 安裝 pre-commit
2git clone https://github.com/anthropics/financial-services
3cd financial-services
4python3 scripts/check.py # 第一次跑會自動 git config core.hooksPath .githooks
5
6# 2. 編輯 skill
7vi plugins/vertical-plugins/financial-analysis/skills/comps/SKILL.md
8
9# 3. 同步到 agent bundles
10python3 scripts/sync-agent-skills.py
11
12# 4. 跑檢查
13python3 scripts/check.py
14
15# 5. commit(自動 patch bump version)
16git add . && git commit -m "feat: update comps skill"
17# 若想 bypass version bump: git commit --no-verify
4.2 部署 Managed Agent
1# 部署
2scripts/deploy-managed-agent.sh <slug>
3# 例:pitch-agent / model-builder / gl-reconciler / market-researcher
4
5# Dry-run(看 payload 但不 POST)
6scripts/deploy-managed-agent.sh pitch-agent --dry-run
4.3 跑 orchestrator 範例
1python3 scripts/orchestrate.py
2# 提供 reference event loop,把 handoff_request 事件路由給對應 agent
3# 實際使用時建議基於這份 example 寫自己的 orchestration layer
4.4 跑 cookbook 測試
1bash scripts/test-cookbooks.sh
5. 應用場景
5.1 直接使用(FSI 場景)
| 場景 | 用哪個 agent |
|---|---|
| 投行 pitch 投影片 | pitch-agent |
| 客戶會議準備 | meeting-prep-agent |
| 產業 / 主題研究 | market-researcher |
| 季報 + 模型更新 | earnings-reviewer |
| DCF / LBO / 3-statement Excel 建模 | model-builder |
| LP statement 審核 | statement-auditor |
| GL 對帳 + 找差異 | gl-reconciler |
| 月結 / accrual | month-end-closer |
| GP package 估值複核 | valuation-reviewer |
| KYC 文件解析 + 規則檢查 | kyc-screener |
5.2 學習 / 移植(任何垂直)
| 學什麼 | 看哪 |
|---|---|
| Plugin 工程模式(check / sync / version-bump) | scripts/*.py |
| 多 plugin repo 切層方法 | plugins/{agent,vertical,partner}/ |
| 「one source two wrappers」設計 | 任一 agent + 對應 cookbook |
| Managed Agent API 用法 | managed-agent-cookbooks/*/agent.yaml + scripts/deploy-managed-agent.sh |
| Shell injection 防護範例 | scripts/deploy-managed-agent.sh SAFE regex |
| Anthropic 官方 MCP integration | plugins/vertical-plugins/financial-analysis/.mcp.json |
5.3 不適用
- ❌ 不能直接給 retail(散戶)用 — 設計給專業分析師
- ❌ 不會自動執行交易、發送、過帳 — 全部 staged for human review
6. 資安掃描報告
掃描日期:2026-05-20 / 範圍:
scripts/+plugins/+managed-agent-cookbooks/+claude-for-msft-365-install/scripts/
6.1 紅黃綠燈總結
| 等級 | 數量 | 摘要 |
|---|---|---|
| 🔴 高風險 | 0 | 無 |
| 🟡 中風險 | 0 | 無 |
| 🟢 低風險 / 良好實踐 | 多 | env var 校驗、最小權限、API 走 HTTPS |
6.2 詳細發現
✅ 無 eval / exec / os.system / shell=True — 整個 repo 完全乾淨
✅ API key 處理良好 — deploy-managed-agent.sh:
1[[ $DRY_RUN -eq 1 ]] || : "${ANTHROPIC_API_KEY:?ANTHROPIC_API_KEY must be set}"
2curl -sS -H "x-api-key: $ANTHROPIC_API_KEY" ...
- API key 走 env var、無 hardcoded
- dry-run 模式可在無 key 時跑
✅ Env var SAFE regex 校驗(重點!):
1SAFE = re.compile(r"^[A-Za-z0-9._/:@-]*$")
2def sub(m):
3 name = m.group(1)
4 v = os.environ.get(name)
5 if not SAFE.fullmatch(v):
6 sys.exit(f"refusing ${{{name}}}: value contains characters outside [...]")
- yaml 內
${ENV_VAR}替換時校驗白名單字元,防 yaml/shell injection - 可移植到任何用 env var 替換的 template 系統
✅ MCP server 全部 HTTPS 官方 URL(11 個)— 無自架 MCP(攻擊面小)
✅ Managed Agent 最小權限示範:
agent_toolset_20260401預設關,明確開白名單- 多 subagent 時,只給 1 個 leaf 有 Write
✅ plugin hook 自動化:check.py 安裝 pre-commit、version_bump.py 防止漏 bump version、CI backstop
6.3 注意事項
- MCP 商業資料需另購 — 11 個 connectors 都要 subscription
- 資料外送風險:用 MCP server 會把資料送到外部廠商(Daloopa / S&P / …),FSI 公司需評估合規
- API key 範圍:
ANTHROPIC_API_KEY有 Managed Agents beta 權限(anthropic-beta: managed-agents-2026-04-01)— 確認 key scope
6.4 結論
🟢 整體低風險 + 多處最佳實踐示範。Anthropic 官方水準的 plugin/Managed Agent 範本,env var 校驗、最小權限、HTTPS-only MCP 都做到位。可放心 fork 並作為內部 plugin 工程的參考標準。
7. FAQ
Q1: Cowork vs Claude Code plugin 差在哪? A: Cowork 是 Anthropic 的 Office workspace 部署形式,plugin 機制與 Claude Code 共用。本 repo 兩者皆支援。
Q2: 我不在金融業,這 repo 有用嗎?
A: 有!重點看 scripts/ 與 plugin 切法(§5.2)— 工程模式適用任何 multi-plugin repo。
Q3: “one source two wrappers” 怎麼運作?
A: 同一份 agents/<slug>.md 是 system prompt source;Cowork 直接讀,cookbook 的 agent.yaml 用 system.file: reference 同一份。
Q4: 為什麼要 sync-agent-skills.py?
A: skill 寫在 vertical-plugins/(共用),但 agent plugin 需要 self-contained(end-user 安裝一個 plugin 就能用),所以 bundle 一份 copy。check.py 會檢查 drift;sync-agent-skills.py 重新同步。
Q5: 那個 SAFE regex 真的安全嗎?
A: 白名單 [A-Za-z0-9._/:@-]* 排除所有 shell metachar(;、$、`、\、空白、引號等),對 yaml + bash 注入足夠。注意:若日後加 Unicode 路徑或特殊符號,需擴充字元集。
Q6: managed-agent-cookbooks 有 11 個,但 agent-plugins 只有 10? A: 11 個 cookbook 多了一個跨 verticals 用的(可能 orchestrator 範本);以實際 ls 為準。
Q7: 為什麼不用 npm version?
A: 純 Markdown/YAML/JSON repo,無 Node.js。用自寫 version_bump.py + .githooks/ 走 native git config,不依賴 Husky。
8. 進階技巧
8.1 把 scripts/check.py 移植到自己的 plugin repo
1# 1. 複製腳本
2cp scripts/check.py /your/repo/scripts/
3cp -r .githooks /your/repo/
4
5# 2. 改路徑常數
6sed -i 's|PLUGINS = ROOT / "plugins"|PLUGINS = ROOT / "your_plugin_dir"|' scripts/check.py
7
8# 3. 用法
9python3 scripts/check.py # 自動 git config core.hooksPath .githooks
8.2 設計自己的 vertical plugin
參考 plugins/vertical-plugins/financial-analysis/ 結構:
1your-vertical/
2├── .claude-plugin/plugin.json
3├── commands/ # /your-cmd-1, /your-cmd-2 (slash commands)
4├── skills/ # automatic skills(依 trigger condition 自動觸發)
5└── .mcp.json # 連你領域的 MCP servers
8.3 自己加 named agent + cookbook
- 建
plugins/agent-plugins/your-agent/agents/your-agent.md(canonical system prompt) - 建
plugins/agent-plugins/your-agent/.claude-plugin/plugin.json - 同步 skill:
python3 scripts/sync-agent-skills.py - 建
managed-agent-cookbooks/your-agent/agent.yaml(reference 上面 prompt) - 建
managed-agent-cookbooks/your-agent/subagents/*.yaml(leaf workers) - 建
steering-examples.json+README.md python3 scripts/check.py驗證scripts/deploy-managed-agent.sh your-agent --dry-run試跑
8.4 學最小權限模式
看任一 managed-agent-cookbooks/<slug>/agent.yaml:
default_config: { enabled: false }→ 全部關configs: [{ name: read, enabled: true }, ...]→ 明確白名單- 多 subagent 時,Write 工具只給單一 leaf
8.5 接 Vertex AI / Bedrock 而非 Anthropic API
- Cowork plugin:本 repo plugin 不依賴 API 路由,由 host 平台處理
- Managed Agents:改
ANTHROPIC_API_BASEenv var - Microsoft 365 add-in:
claude-for-msft-365-install/plugin 內有 Vertex / Bedrock / 內部 gateway 路由設定
9. 整合進其他工作流
9.1 與本知識庫其他 Layer 配合
| Layer | 用途 |
|---|---|
gh-tutorial-qd(本流程) | 取得本份教學 |
新 idea:把 scripts/check.py 套到本知識庫的 skills 一致性檢查 | .claude/skills/ 統一 lint |
| 新 idea:把「one source two wrappers」套到本知識庫 layer | 同一 skill 同時當 Claude/Codex/Gemini plugin |
meeting-intel(會前情資) | 結構上類似 meeting-prep-agent,可參考其 subagent 切法 |
paper-tutorial(多 paper 整合) | 結構上類似 market-researcher(產業/主題研究),可參考其 callable_agents 設計 |
9.2 衍生 / 後續題目
本知識庫 v2:把 15 個 layer 重組為
plugins/{layer,utility,partner}/三層架構(學自本 repo)本知識庫 sync:寫
sync-skills.py把 source skill 同步到各 CLI(Claude / Codex / Gemini / OpenCode)本知識庫 lint:寫
check.py校驗MEMORY.md內每個檔名實存、frontmatter 完整直接相關度低(FSI vs 生醫)
10. 重點摘要 Checklist
- 官方 FSI 模板庫:10 named agents + 7 verticals + 2 partners + 11 cookbooks + 11 MCPs
- 核心設計:“one source, two wrappers” — Cowork plugin 與 Managed Agent 共用 prompt
- 三層 plugin:agent / vertical / partner
- 工程腳本:
check.py+sync-agent-skills.py+version_bump.py+deploy-managed-agent.sh+orchestrate.py - 資安:🟢 低 + 多最佳實踐:env var SAFE regex、最小權限、HTTPS MCP only
- 可移植性:scripts/ 與 plugin 切法可用於任何垂直
- License:Apache-2.0(允許商用 + 衍生)
- 無 releases,用
plugin.json內 version 配 git SHA - 所有輸出 staged for human review — 不自動執行交易
11. 進一步閱讀
| 資源 | 連結 |
|---|---|
| GitHub repo | https://github.com/anthropics/financial-services |
| Claude Cowork | https://claude.com/product/cowork |
| Claude Managed Agents API docs | https://docs.claude.com/en/api/managed-agents |
| MCP 官方 | https://modelcontextprotocol.io/ |
| Microsoft 365 add-in install tool | claude-for-msft-365-install/ |
| Partner: LSEG | plugins/partner-built/lseg/ |
| Partner: S&P Global | plugins/partner-built/spglobal/ |
本教學由
gh-tutorial-qdskill 自動生成 / 2026-05-20 / commit3edda1c。 對「plugin 工程模式」感興趣的讀者應該特別細讀 §3.1(雙路出貨)與 §6.2(env var SAFE regex)。
Comments