
patchwork — Codebase Conventions for AI Agents
io.github.SaiNarayana-BPublished by GitHub account SaiNarayana-Bv0.1.7Updated Oct 24, 2026
Scan any codebase, generate CONVENTIONS.md, expose conventions as MCP tools for AI agents.
The publisher's own server: Codebase
Overview
Scans a local codebase to mine its coding conventions and exposes them as MCP tools so AI agents follow the project's real style.
- What you can do
- patchwork analyzes source files with AST parsing (tree-sitter) plus config and git history to detect naming, import, structure, error-handling, testing, API and git conventions, with confidence scores and real examples. It generates a CONVENTIONS.md (or AGENTS.md, or appends to CLAUDE.md) and can run as an MCP server exposing eight tools such as patchwork_scan, patchwork_naming, patchwork_structure, patchwork_stack, patchwork_errors, patchwork_testing, patchwork_git and patchwork_check. It also offers scan, update, diff, show and watch commands plus a Python API.
- When to use it
- Use it when AI coding assistants keep inventing names, file layouts, error handling or commit styles that do not match your project. It is meant for teams that want agents to read the codebase's actual conventions instead of a hand-written, quickly stale style guide.
- Requirements
- Runs locally as a stdio process on the user's machine (desktop only). Install the PyPI package patchwork-conventions with pip; Python is required, and optional full AST support for Go, Rust and Java comes from the 'full' extra. No accounts, API keys, environment variables or headers are declared, and no network access is needed.
Installation
In SourceWeft
- Open patchwork — Codebase Conventions for AI Agents in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
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
Source: README.md at commit 595de70
Tools
0Version history
1- v0.1.7LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
Other Codebase integrations
Codebase
design.codebaseOfficial publisher
Lets an AI agent build, preview and update web apps, download their source, and publish them when the user permits.
Reactable Codebase Readiness Assessments
Published by GitHub account reactable-io
Remote MCP server that scores a codebase across 12 readiness areas, returning findings, fix prompts and re-assessment from inside an AI agent.

Codebase Doctor
Published by GitHub account subhajitlucky
Read-only codebase auditor that lets a coding assistant scan a repository for secrets, dependency drift, RLS and auth issues, and get review verdicts with…

Dsh Codebase Chat
Published by GitHub account shinzarou-eng
A local-first MCP server that answers questions about a codebase with cited evidence, plus audits and reports.

Codebase Chat
Published by GitHub account shinzarou-eng
Local-first codebase intelligence MCP server that lets an assistant chat about, search, audit and safely patch a repository with file-and-line citations.