技能 c4-architecture-c4-architecture
📦

c4-architecture-c4-architecture

安全

生成 C4 架構圖

此技能透過由下而上分析程式碼結構,自動產生全面的 C4 架構文件,建立 Context、Container、Component 和 Code 層級的圖表,並包含 API 規格說明。

支援: Claude Codex Code(CC)
📊 71 充足
1

下載技能 ZIP

2

在 Claude 中上傳

前往 設定 → 功能 → 技能 → 上傳技能

3

開啟並開始使用

測試它

正在使用「c4-architecture-c4-architecture」。 Use c4-architecture skill on a Node.js project

預期結果:

建立 C4-Documentation/ 資料夾,包含 c4-code-api-routes.md、c4-code-models.md、c4-component.md、c4-container.md、c4-context.md,以及帶有 OpenAPI 規格的 apis/

正在使用「c4-architecture-c4-architecture」。 Run skill on microservices repo

預期結果:

為每個服務產生個別的容器文件、服務之間的關係圖,以及顯示外部相依性的上下文圖表

安全審計

安全
v1 • 2/25/2026

All static findings are false positives. This is a documentation-generation skill that outputs markdown files with C4 architecture diagrams. The skill does not execute external commands, make network requests, or implement cryptographic algorithms. References to shell syntax and URLs are part of documentation examples, not actual execution.

1
已掃描檔案
392
分析行數
0
發現項
1
審計總數
未發現安全問題
審計者: claude

品質評分

38
架構
100
可維護性
87
內容
31
社群
100
安全
91
規範符合性

你能建構什麼

新團隊入職

透過產生全面的 C4 文件,快速了解現有程式碼庫的架構。

架構審查

為架構審查會議或技術文件記錄目前的系統架構。

API 文件產生

從程式碼分析自動為所有容器 API 產生 OpenAPI 規格。

試試這些提示

基本 C4 產生
Use the c4-architecture skill to generate C4 architecture documentation for this repository.
完整分析與排除項目
Generate C4 documentation with target_directory set to ./src, exclude_patterns set to ["node_modules", ".git", "dist"], and include_tests set to true.
容器聚焦視圖
Use c4-architecture skill focusing on container and deployment analysis. Map all components to Docker containers and Kubernetes manifests if present.
API 優先文件
Generate C4 documentation with emphasis on API specifications. For each container, create comprehensive OpenAPI 3.1 specs with all endpoints, request/response schemas, and authentication requirements.

最佳實務

  • 在註釋良好的程式碼上執行,以獲得更好的文件品質
  • 檢查產生的 OpenAPI 規格是否準確
  • 使用上下文圖表與利害關係人溝通

避免

  • 不要用於執行時期行為分析
  • 避免期待動態相依性偵測
  • 不要依賴未經人工審查的產生文件

常見問題

什麼是 C4 模型?
C4 代表 Context、Container、Component 和 Code。這是一種分層式描述軟體架構的方法,可在不同詳細程度下呈現。
此技能會修改我的程式碼嗎?
不會。此技能只會讀取您的程式碼並產生檔案,絕不會修改現有的原始碼。
支援哪些程式語言?
此技能支援任何程式語言。它會以通用方式分析程式碼結構、函數和相依性。
輸出結果儲存在哪裡?
所有文件都會寫入存放庫根目錄中的新 C4-Documentation/ 目錄。
可以自訂要分析的目錄嗎?
可以。使用 target_directory 和 exclude_patterns 設定選項來自訂分析範圍。
會產生 API 文件嗎?
可以。此技能會為所有容器 API 建立 OpenAPI 3.1 規格,並儲存在 apis/ 子目錄中。

開發者詳情

檔案結構

📄 SKILL.md