feat(harness): 用戶 CC harness(acr install-harness)+ 公開 repo 只留對外

讓「用 arcrun 開發」的用戶,他的 CC 自動載入 arcrun 防護、不退回自寫 Python。

新增 user-cc-harness(SDD: .agents/specs/user-cc-harness,本機):
- acr install-harness:冪等裝進用戶當前專案(新/舊專案皆可),acr init 末尾也順便裝
  - CLAUDE.md arcrun 區塊(標記包夾,append 不破壞既有)
  - .claude/skills/arcrun-mindset(世界觀 + 資源去哪取 acr parts/auth-recipe)
  - .claude/commands/arcrun.md(/arcrun slash command)
  - .claude/hooks/arcrun-guard.sh(python→提醒不硬擋、暴露→exit 2、每條含正路)
  - settings.json 合併 hook(不覆蓋用戶既有 hooks/設定)
- llms.txt + README「給 AI」段:第一接觸點(用戶丟連結,CC 讀了知道第一步 install-harness)
  含 CF 憑證白話照抄式引導(不對用戶講 KV/Worker/R2 術語)
- harness 素材內嵌 npm 套件(cli/harness/,files 帶上),不依賴用戶有 arcrun repo
- 實測:空目錄/冪等/既有檔合併皆通過,tsc exit 0,npm pack 含 harness 5 檔

公開 repo 清理(richblack:用戶要用不要開發 arcrun):
- git rm --cached 移除開發痕跡 + 思考過程出公開 repo(本機保留供 richblack 開發):
  .claude/CLAUDE.md/AGENTS.md/.agents/docs/DECISIONS/BACKLOG/landing/.github
- .gitignore 防回流;補 MIT LICENSE

MCP(P7)納入 install-harness/update 的接點已設計,實作待 MCP 對齊(BACKLOG 另一條線)。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
uncle6me-web
2026-06-03 20:02:44 +08:00
parent 922a57fe34
commit 037cf9b6a4
139 changed files with 442 additions and 30768 deletions
+51
View File
@@ -0,0 +1,51 @@
# arcrun — 給 AI 操盤手的啟動指南
> 你(Claude Code / AI 助手)正在幫一位使用者用 arcrun 做自動化。
> 使用者可能只會跟你聊天、把這個連結丟給你。接下來的事大多由你做。
> arcrun = 讓自動化變成「純文字工作流」跑在使用者自己的 Cloudflare,而不是每次重刻 Python 腳本。
## 你的第一步(務必先做)
```
npm i -g arcrun && acr install-harness
```
`acr install-harness` 會把 arcrun 的防護裝進使用者**當前專案**:
- arcrun-mindset Skill(世界觀 + 資源去哪取)
- CLAUDE.md 區塊(提醒:用 arcrun 不要自寫 Python
- arcrun-guard hook(你走歪時當場提醒/糾正)
- /arcrun slash command(使用者可打 `/arcrun <需求>`
裝完你就有完整指引,照著走即可。
## 裝 harness 前先記住的鐵則
- **使用者選 arcrun = 不要自己寫 Python/Node 一次性腳本。** 用 arcrun 工作流。
- 打外部 API → 寫 recipe`acr recipe push`),不自刻 HTTP client。
- 不自製零件(WASM)—— 零件由 arcrun 維護走 PR。你能用的是現有零件 + recipe + 工作流。
- 需要 AI 判斷時你自己做,不要讓工作流回頭呼叫 LLM。
- 所有 CLI 操作你來做,別丟指令叫使用者自己打(除非他想自己來)。
## 完整啟動流程
1. `npm i -g arcrun && acr install-harness`(裝 CLI + 防護)
2. `npm i -g wrangler`Cloudflare CLI,部署用)
3. **帶使用者拿 Cloudflare 的兩串憑證**(唯一只能他做的事)——
用白話照抄式引導,**不要對使用者講 KV / Worker / R2 / zone 等術語**(他多半聽不懂,也不需要懂):
- 帳號代碼(Account ID):登入 https://dash.cloudflare.com 右側欄複製。
- 金鑰(API Token):https://dash.cloudflare.com/profile/api-tokens → Create Custom Token →
照抄勾三組權限(Account/Workers Scripts/Edit、Account/Workers KV Storage/Edit、Account/Workers R2 Storage/Edit
→ 複製產生的 token。
- 叫使用者把這兩串貼給你。
4. `acr init --self-hosted`(你幫跑,貼使用者的兩串)—— 自動建資源、部署、seed。
5. 跑完照提示 `wrangler secret put ENCRYPTION_KEY`CLI 會印確切指令)。
6. 把使用者需求拆成 workflow → `acr push`。完成給客觀證據(HTTP 2xx / trace)。
## 暴露提醒
部署對外 webhook / push recipe 會讓東西可被外部呼叫 → 停下來讓使用者明示同意,不替他決定公開。
## 更多
- 指令:`acr --help`
- 開始開發後讀 arcrun-mindset Skill。