backend-architect
在資深指導下審查後端架構
後端服務可能逐漸演變成高度耦合、職責不清,以及測試脆弱的狀態。此技能會引導 Claude、Codex 和 Claude Code 進行架構審查、重構與實作決策。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
Agent 可讀資源
當 AI Agent、爬蟲或腳本需要乾淨脈絡、而不是讀取完整頁面時,請使用這些連結。
測試它
正在使用「backend-architect」。 審查新增使用者建立 use case 的 pull request。
預期結果:
- P1:此 use case 相依於具體 repository,而不是 port。
- P1:密碼雜湊應保留在 domain port 背後。
- P2:為 repository adapter 新增整合測試,並為 domain validation 新增單元測試。
正在使用「backend-architect」。 設計付款功能的後端配置。
預期結果:
結果應將付款 domain models 與 infrastructure adapters 分離,定義 payment gateway ports,並為成功與失敗路徑新增 use case tests。
正在使用「backend-architect」。 找出大型 service class 中的重構機會。
預期結果:
- 為會改變狀態的 commands 抽取獨立 use cases。
- 將驗證規則移入 value objects,以保護 domain invariants。
- 在替換 infrastructure dependencies 前先引入 ports。
安全審計
中風險Static analysis reported many high-risk weak-cryptography and Ruby backtick findings, but reviewed examples show markdown diagrams, prose, paths, and architecture terminology rather than executable cryptographic code or shell execution. No prompt injection, data exfiltration, network behavior, credential harvesting, or malicious intent was found. The remaining risk is medium because the skill allows Bash and recommends command-based review workflows.
中風險問題 (1)
低風險問題 (2)
風險因素
⚙️ 外部命令 (2)
偵測到的模式
品質評分
你可以打造什麼
設計新的後端功能
在開始實作前,規劃 bounded contexts、ports、adapters、use cases 與測試策略。
審查 Pull Request
檢查近期變更是否有 SOLID 違規、分層洩漏、程式碼異味與缺少測試的情況。
重構舊有服務
拆解大型服務、將邏輯移入 domain models,並引入更清楚的抽象。
試試這些提示
審查目前的後端變更,涵蓋架構、SOLID 原則、程式碼異味與缺少的測試。將問題優先分級為 P0、P1 或 P2。
使用六角形架構為此功能設計後端結構。識別 domain models、use cases、ports、adapters 與測試涵蓋範圍。
分析此服務是否有 god class、feature envy、primitive obsession、long method 與 shotgun surgery 風險。提出分階段重構計畫。
稽核這些後端 contexts 之間的模組邊界與相依方向。找出分層違規、耦合風險與缺少的抽象。
最佳實務
- 從商業 use case 開始,接著定義 domain models、ports 與 adapters。
- 要求提供含檔案位置、影響範圍與建議修正方式的優先排序 findings。
- 只執行必要的儲存庫命令,並在套用變更前審查結果。
避免
- 將此技能當作一般 shell 自動化工具,而不是架構審查器。
- 在識別最小且有用的重構步驟前,就要求大範圍重寫。
- 在服務並不需要時,機械式套用 DDD 或六角形架構。