GitHub
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
作者提供的说明(英文原文)
Scan any codebase, generate CONVENTIONS.md, expose conventions as MCP tools for AI agents.
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"patchwork": {
"command": "uvx",
"args": [
"patchwork-conventions"
]
}
}
}在终端中运行这条命令
claude mcp add patchwork -- uvx patchwork-conventions粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"patchwork": {
"command": "uvx",
"args": [
"patchwork-conventions"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"patchwork": {
"type": "stdio",
"command": "uvx",
"args": [
"patchwork-conventions"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日
注册名称已通过 GitHub 账户 SaiNarayana-B 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(0.1.7)于4个月前进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。
同一分类中有:GitHub, Desktop Commander, Cloudflare MCP
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
MCP server for terminal commands, file operations, and process management
Cloudflare MCP servers
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Mine your codebase. Generate CONVENTIONS.md. Stop AI agents from making up your style.
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.
| Category | What's mined |
|---|---|
| Naming | Functions, classes, variables, constants, files — with confidence score and real examples |
| Imports | Absolute vs relative, path aliases (@/, src/), barrel files, destructuring style |
| Structure | Source root, test layout, feature vs layer organisation, monorepo detection |
| Error Handling | try/except vs Result types, logging framework, custom exception naming, propagation style |
| Testing | Framework, assertion style, mocking library, coverage tool, fixture patterns |
| API Patterns | Response shape, route param style, ORM, async pattern, GraphQL/gRPC presence |
| Git Workflow | Commit message style, branch naming, co-change file pairs |
| Tech Stack | Frameworks, package manager, linters, formatters, type checker, build tool, scripts |
pip install patchwork-conventions
cd your-project patchwork scan
That's it. You'll get a CONVENTIONS.md like this:
# CONVENTIONS.md
Auto-generated by patchwork on 2026-06-25
Language: python Runtime: Python >=3.11 Package Manager: uv Frameworks: fastapi, sqlalchemy Linters: ruff Formatters: ruff, black
snake_case (97% consistent)get_user, parse_response, create_sessionPascalCase (100% consistent)UserService, AuthHandler, DatabaseClientSCREAMING_SNAKEMAX_RETRIES, API_BASE_URLsnake_case_test_Source root: src/ Organisation: layer-based Tests: separate (tests/)
Key directories:
src/ — source roottests/ — test suitemigrations/ — database migrationsstructlogValidationError, AuthError, NotFoundErrorassert(...)pytest-covfeat(auth): add JWT refresh, fix(api): handle null user
| Feature | patchwork | argus | sourcebook |
|---|---|---|---|
| AST-based naming analysis | ✅ tree-sitter | ❌ filesystem only | ❌ not done |
| Confidence scores | ✅ per-category | ❌ | ❌ |
| Real examples from your code | ✅ | ❌ | ❌ |
| Counter-examples (inconsistencies) | ✅ | ❌ | ❌ |
| Error handling pattern mining | ✅ | ❌ | ❌ |
| API response shape detection | ✅ | ❌ | ❌ |
| Co-change file pairs | ✅ | ❌ | ✅ |
Convention checking (check cmd) | ✅ | ❌ | ❌ |
| MCP server with 8 tools | ✅ | ❌ | ✅ (4 tools) |
| Watch mode | ✅ | ✅ (sync) | ✅ |
| Zero LLM required | ✅ | ✅ | ✅ (layer A) |
| Open source / MIT | ✅ | ✅ | ❌ BSL |
# Generate CONVENTIONS.md
patchwork scan
patchwork scan /path/to/project
patchwork scan --agents-md
patchwork scan --claude-md
patchwork scan --json
patchwork scan --stdout
patchwork scan --lang python --lang typescript
patchwork update
patchwork diff
patchwork show
patchwork watch
patchwork serve --stdio # for Claude Code patchwork serve --port 3742 # HTTP mode
patchwork scan # run once
patchwork scan --claude-md
Claude Code — add to ~/.claude.json (or run claude mcp add interactively):
{
"mcpServers": { "patchwork": { "command": "patchwork", "args": ["serve", "/path/to/your/project", "--stdio"] } } }
Claude Desktop — add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": { "patchwork": { "command": "patchwork", "args": ["serve", "/path/to/your/project", "--stdio"] } } }
Cursor — add to .cursor/mcp.json in your project root:
{
"mcpServers": { "patchwork": { "command": "patchwork", "args": ["serve", ".", "--stdio"] } } }
Then your AI agent can use 8 on-demand tools:
| Tool | When to use |
|---|---|
patchwork_scan | Get complete conventions overview |
patchwork_naming | Before writing new identifiers |
patchwork_structure | Before creating new files/directories |
patchwork_stack | When choosing libraries or commands |
patchwork_errors | Before writing error handling |
patchwork_testing | Before writing test files |
patchwork_git | Before writing commit messages |
patchwork_check | Validate a proposed name |
Copy SKILL.md from this repo to ~/.claude/skills/patchwork/SKILL.md to get /patchwork slash commands.
# Keep CONVENTIONS.md updated as you code
patchwork watch &
patchwork diff || (patchwork update && git add CONVENTIONS.md && git commit -m "chore: update conventions")
from patchwork import scan
from patchwork.scanner import ScanOptions from pathlib import Path
report = scan(ScanOptions(root=Path(".")))
print(report.to_markdown())
import json data = json.loads(report.to_json())
naming = report.naming.get("python") print(f"Functions: {naming.functions.style} ({naming.functions.confidence:.0%})") print(f"Examples: {naming.functions.examples}")
structure = report.structure print(f"Source root: {structure.source_root}") print(f"Organisation: {structure.organisation}")
| Language | AST (tree-sitter) | Fallback regex |
|---|---|---|
| Python | ✅ full | ✅ |
| TypeScript | ✅ full | ✅ |
| JavaScript | ✅ full | ✅ |
| Go | ✅ (with full extra) | ✅ |
| Rust | ✅ (with full extra) | ✅ |
| Java | ✅ (with full extra) | ✅ |
| Ruby, PHP, C#, C++ | ❌ | ✅ regex only |
Install full language support:
pip install 'patchwork-conventions[full]'
your codebase
│ ▼ ConfigDetector ← reads package.json, pyproject.toml, go.mod, Cargo.toml │ ▼ File discovery ← respects .gitignore, skips node_modules etc. │ ▼ Per-language AST ← tree-sitter parses every file into a syntax tree │ ├── NamingMiner → extracts function/class/variable names, classifies style ├── ImportMiner → detects import patterns, aliases, barrel files ├── StructureMiner → analyses directory layout, test co-location ├── ErrorHandlingMiner → detects try/catch patterns, logging, custom exceptions ├── TestingMiner → identifies framework, assertion style, mocking ├── APIPatternMiner → finds response shapes, ORMs, route styles └── GitPatternMiner → mines commit history, branches, co-change pairs │ ▼ ConventionReport │ ├── CONVENTIONS.md (default) ├── AGENTS.md (--agents-md) ├── CLAUDE.md (--claude-md, appends) └── JSON (--json)
All analysis is 100% local — no API calls, no telemetry, no data leaves your machine.
On a 1,000-file TypeScript monorepo:
On a 500-file Python project:
Results are deterministic — same codebase always produces the same output.
git clone https://github.com/yourusername/patchwork
cd patchwork pip install -e '.[dev]' pytest
Pull requests welcome. See CONTRIBUTING.md.
MIT — free for personal and commercial use.
claude-code · agent-skills · mcp · context-engineering · hallucination-detection · code-conventions · static-analysis · tree-sitter · developer-tools · ai-coding