
patchwork — Codebase Conventions for AI Agents
io.github.SaiNarayana-B由 GitHub 帳號 SaiNarayana-B 發布v0.1.7更新於 Oct 24, 2026
Scan any codebase, generate CONVENTIONS.md, expose conventions as MCP tools for AI agents.
發布方自己的服務:Codebase
概覽
掃描本機程式碼庫,挖掘其編碼慣例,並透過 MCP 工具提供給 AI 代理,讓它遵循專案真正的風格。
- 可以做什麼
- patchwork 以 AST 解析(tree-sitter)搭配設定檔與 git 歷史分析原始碼,偵測命名、匯入、結構、錯誤處理、測試、API 與 git 慣例,並附上信心分數與真實範例。它會產生 CONVENTIONS.md(或 AGENTS.md,或附加到 CLAUDE.md),也能以 MCP 伺服器執行,提供 patchwork_scan、patchwork_naming、patchwork_structure、patchwork_stack、patchwork_errors、patchwork_testing、patchwork_git 與 patchwork_check 等八個工具。另外還有 scan、update、diff、show、watch 指令以及 Python API。
- 適用情境
- 當 AI 編碼助理老是編出與專案不符的命名、檔案配置、錯誤處理或提交風格時使用。它適合希望代理讀取程式碼庫實際慣例、而非依賴手寫且很快過時的風格指南的團隊。
- 執行需求
- 以本機 stdio 程序在使用者機器上執行(僅桌面端)。需以 pip 安裝 PyPI 套件 patchwork-conventions,需要 Python;Go、Rust、Java 的完整 AST 支援來自 'full' 附加套件。未宣告任何帳號、API 金鑰、環境變數或標頭,也不需要網路存取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 patchwork — Codebase Conventions for AI Agents,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
patchwork
Mine your codebase. Generate CONVENTIONS.md. Stop AI agents from making up your style.
[PyPI] [License: MIT] [Python 3.9+] [agent-skills] [MCP]
Every team that uses AI coding assistants hits the same wall: Claude writes getUserById in a codebase that uses get_user_by_id. Cursor creates components/userCard.tsx in a project that uses user-card.tsx. The agent invented a response shape that doesn't match the rest of the API.
You write a CLAUDE.md manually. It goes stale in two weeks. You write it again.
patchwork automates this. It scans your actual source code using AST analysis and detects what your team really does — not what you think you do.
What it detects
Quick start
That's it. You'll get a CONVENTIONS.md like this:
Why not argus or sourcebook?
Commands
Claude Code integration
Option 1: CONVENTIONS.md (recommended)
Option 2: Append to CLAUDE.md
Option 3: MCP server
Claude Code — add to ~/.claude.json (or run claude mcp add interactively):
Claude Desktop — add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Cursor — add to .cursor/mcp.json in your project root:
Then your AI agent can use 8 on-demand tools:
Option 4: Claude Code skill (SKILL.md)
Copy SKILL.md from this repo to ~/.claude/skills/patchwork/SKILL.md to get /patchwork slash commands.
Watch mode (CI/auto-update)
Python API
Supported languages
Install full language support:
How it works
All analysis is 100% local — no API calls, no telemetry, no data leaves your machine.
Performance
On a 1,000-file TypeScript monorepo:
- Without tree-sitter: ~0.8s
- With tree-sitter (full AST): ~2.1s
On a 500-file Python project:
- ~1.1s
Results are deterministic — same codebase always produces the same output.
Contributing
Pull requests welcome. See CONTRIBUTING.md.
License
MIT — free for personal and commercial use.
Topics
claude-code · agent-skills · mcp · context-engineering · hallucination-detection · code-conventions · static-analysis · tree-sitter · developer-tools · ai-coding
來源:README.md,提交 595de70
工具
0版本歷史
1- v0.1.7最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Codebase 整合
Codebase
design.codebase官方發布者
讓 AI 助理建置、預覽和更新網頁應用程式、下載原始碼,並在使用者允許時發布。
Reactable Codebase Readiness Assessments
由 GitHub 帳號 reactable-io 發布
遠端 MCP 伺服器,可在 AI 代理中依 12 個面向為程式碼庫評分,並提供問題發現、修正提示與重新評估。

Codebase Doctor
由 GitHub 帳號 subhajitlucky 發布
唯讀的程式碼庫稽核工具,讓編碼助理掃描儲存庫中的密鑰、相依性漂移、RLS 與驗證問題,並給出附覆蓋範圍說明的審查結論。

Dsh Codebase Chat
由 GitHub 帳號 shinzarou-eng 發布
一個本地優先的 MCP 伺服器,能針對程式碼庫提供附引用的回答,並產生稽核與報告。

Codebase Chat
由 GitHub 帳號 shinzarou-eng 發布
本地優先的程式碼庫智慧 MCP 伺服器,讓助理針對整個儲存庫問答、搜尋、稽核並安全修改程式碼,答案附上檔案與行號引用。