chore: remove duplicate credentials/ dir + add CLAUDE.md + .claude rules

credentials/ was a leftover duplicate — all credential routes already live
in cypher-executor/src/routes/credentials.ts. Adds the SDD protocol,
tech-stack, forbidden-list, component-architecture, and progress rules
that guide Phase 1-6 refactors.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-20 16:53:26 +08:00
parent 40df4025a6
commit 6ee6fee8b9
26 changed files with 1053 additions and 4757 deletions
+70
View File
@@ -0,0 +1,70 @@
# CLAUDE.md — arcrun
> 本檔是**索引 + 最高原則**,詳細規範拆到 `.claude/rules/`。
> Hook 強制機制在 `.claude/hooks/`,違反會直接 blockexit 2)。
---
## 絕對鐵律(違反 = 停手)
1. **任何 code 變動前必須先讀對應 SDD**,在回覆開頭宣告已讀清單與對應 task 編號(格式見 `.claude/rules/00-sdd-protocol.md`
2. **零件只能用 TinyGo 或 AssemblyScript 編譯成 WASM**`registry/components/` 下禁止 TypeScript
3. **cypher-executor TS 禁止實作 credential / auth / JWT / template 展開業務邏輯**;這些全在 WASM 零件
4. **Cypher binding = YAML 裡的 URL 清單**,不是 Cloudflare service binding;零件串接走 HTTP URL
5. **每個 WASM 零件 = 獨立 Worker = 公開 URL**;不從 R2 動態讀(R2 只 Phase 5 啟用)
6. **修改現有程式碼,不是新建資料夾重做**
7. **每完成一個 task 立刻更新 tasks.md 的 `[x]`**,不批次
---
## 工作流程(強制)
開始任一任務,按順序:
1.`.agents/specs/arcrun/arcrun.md`(總進度)
2. 讀對應的 SDD `design.md` + `tasks.md`
3. 在回覆開頭貼出:
```
📋 已讀 SDD<清單>
🎯 本次對應 task<編號>
📐 本次 task 的 SDD 規範摘要:<重點>
🚧 執行範圍:修改/建立/刪除 <檔案>
```
4. 動手前把 tasks.md 對應 task 標為 `[🔄]`,完成後標 `[x]`
5. 完成後確認:是否需要同步更新 design.md?
找不到對應 SDD → **停手問 richblack**,不要自行建立。
---
## 詳細規範索引
| 檔案 | 內容 |
|-----|------|
| `.claude/rules/00-sdd-protocol.md` | SDD 讀取協議(強制流程) |
| `.claude/rules/01-tech-stack.md` | 技術棧硬限制(語言/儲存/加解密) |
| `.claude/rules/02-forbidden.md` | 禁止清單(hook 強制執行) |
| `.claude/rules/03-component-architecture.md` | 零件架構(R2 用途 / cypher binding / service binding 邊界) |
| `.claude/rules/04-current-progress.md` | 當前進度 + SDD 索引 |
---
## SDD 位置速查
| 子系統 | 路徑 |
|-------|------|
| **進行中** Credential Primitives WASM | `.agents/specs/arcrun/credential-primitives-wasm/` |
| arcrun 總進度 | `.agents/specs/arcrun/arcrun.md` |
| Auth Recipe 系統 | `.agents/specs/arcrun/auth-recipe.md` |
| Landing Page | `.agents/specs/arcrun/landing-page.md` |
| SDK + Website | `.agents/specs/arcrun/sdk-and-website/` |
| arcrun MVP 整體 | `.agents/specs/u6u-core-mvp/` |
| u6u Platform Evolution | `.agents/specs/u6u-platform-evolution/` |
| Credential 長期規格(需求源) | `docs/user_requirements/credential_parts.md` |
| Tech Stack 詳細 | `.agents/steerings/tech.md` |
---
## 封測狀態
**推遲**richblack 2026-04-19 決定)。先完成 Phase 1-3 清除違規 TS,再啟動封測。