Skip to main content

Craftsman

CI Version Python 3.10–3.13 Dependencies: stdlib only License: MIT

Craftsman makes an AI coding agent prove its change was reviewed and tested. The idea is build freely, review hard: while building, the agent works without review loops or ceremony. When it finishes, the final diff is frozen and the CLI plans the hunt from it. Fresh-context hunter subagents that did not write the code take every planned slot, separate verifier subagents try to disprove every finding, and the hunt continues while it keeps turning up real defects. The agent cannot finish until every slot is done and the tests pass on the final code.

Craftsman keeps a ledger in the .git directory with the evidence: which hunks each hunter covered, what each finding was judged to be and why, and the test runs. A platform hook checks the ledger when the agent tries to stop and sends it back with a list of what is missing. The gate checks outcomes, not effort, and a hook that fails is logged, never silent.

It works with Claude Code, GitHub Copilot, and Google Antigravity. In Codex and Cursor, the same protocol runs without hooks.

How It Works

Craftsman 5: build freely, review hard

The agent builds with no gate activity. Then the diff is frozen into a round and the CLI turns it into a hunt plan: slots of hunks and lenses, sized by the diff and its risk signals, not by how hard the model feels like trying. Each slot goes to a fresh-context hunter that records every candidate defect with a concrete trigger, and separate verifiers try to disprove each one and reproduce the survivors. Hunters maximize recall; verifiers maximize precision. While a wave proves a defect, another one runs. Confirmed defects are fixed at the root cause, the fix delta is re-checked by fresh hunters, and the tests run through craftsman run on the final code. /craft-review runs the same hunt on an existing change, and fixes only when you ask.

The full protocol, with diagrams, is in docs/how-it-works.md.

Platforms

Platform What blocks completion
Claude Code Stop hook
GitHub Copilot in VS Code Stop hook
GitHub Copilot CLI agentStop hook
Google Antigravity Stop hook
Codex, Cursor, and other tools that read AGENTS.md craftsman gate --complete

Where the platform cannot confirm that a separate subagent performed the review (Codex, Cursor, or a session without hooks), the review is advisory: it is complete when every hunk is covered, the gate still closes, and the report marks it as SELF-REVIEWED.

Measurements

Pilot on SWR-Bench: 5 PRs from pytest, flask, and requests, 9 confirmed defects, 1 repetition per configuration. The sample is too small for statistical conclusions. Details and Claude Code runs: docs/benchmark.md. These numbers were measured on an earlier protocol. The repository also ships a public seeded-defect suite, evals/, to measure recall on any agent platform.

Configuration Defects: without → with Craftsman Avg. time per PR
Antigravity · Gemini 4 Argon low 2/9 → 4/9 1.5 → 4.7 min
Antigravity · Gemini 4 Argon medium 2/9 → 5/9 2.0 → 6.7 min
Antigravity · Gemini 4 Argon high 3/9 → 7/9 15.6 → 26.3 min

Installation

Requires Python 3.10+, with no external dependencies.

pipx install craftsman-gate        # or: uv tool install craftsman-gate
craftsman install                  # detects Claude Code, Copilot, and Antigravity

Or as a plugin:

/plugin marketplace add BuczynskiRafal/craftsman              # Claude Code
/plugin install craftsman@craftsman
agy plugin install https://github.com/BuczynskiRafal/craftsman   # Antigravity

Usage

Type a request in plain words. There are no flags to remember.

/craftsman add pagination to the catalog search
/craftsman migrate the session store to Redis, this is critical
/craft-review review my staged changes and fix what you find
/craft-review review PR 42
/craft-review be thorough, this touches authentication

The agent works out the target (working tree, staged changes, a branch, a PR), whether to fix what it finds, and how deep to go. It goes deep on its own for risky changes or when you ask for care ("critical", "be thorough", ultracraft); the list of triggers is under Depth in the craft-review skill. Depth never goes down during a session. The final report explains what the agent decided and why. See docs/usage.md.

craftsman status shows the current round, coverage, and missing evidence.

Documentation

  • Usage: example requests, what the agent decides, optional flags
  • How it works: the protocol in full, the hunt plan, what hunters read, ledger, gate, lenses, platform enforcement
  • Installation: flags, platform setup, uninstall, craftsman doctor
  • Guards: gate state machine, review guard, command policy, search scope guard, hook error log
  • Skills: catalog of bundled skills
  • Benchmark: methodology, results, replication
  • Architecture: project internals for contributors

Contributing

See CONTRIBUTING.md.

Citation

@article{zeng2026swrbench,
  author    = {Zeng, Zhengran and Shi, Ruikai and Han, Keke and Li, Yixin and Sun, Kaicheng and Wang, Yidong and Yu, Zhuohao and Xie, Rui and Ye, Wei and Zhang, Shikun},
  title     = {{SWR-Bench}: Assessing {LLM} Performance in Real-World Code Review Comment Generation},
  journal   = {Proceedings of the ACM on Software Engineering},
  volume    = {3},
  number    = {FSE},
  articleno = {FSE137},
  year      = {2026},
  doi       = {10.1145/3808144}
}

License

MIT, see LICENSE and attribution in NOTICE.

Metadata

Release files for craftsman-gate 5.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for craftsman-gate 5.0.0
File Size Uploaded Provenance Actions
craftsman_gate-5.0.0.tar.gz 733.6 kB With provenance Details for craftsman_gate-5.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for craftsman-gate 5.0.0
File Interpreter ABI Platform Actions
craftsman_gate-5.0.0-py3-none-any.whl Python 3 none any Details for craftsman_gate-5.0.0-py3-none-any.whl

Total release size: 1.1 MB

Release files / craftsman_gate-5.0.0.tar.gz

Download URL craftsman_gate-5.0.0.tar.gz
Size 733.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6e73f37eab042f9aef9fddc425ac2194620c2f308e9b7fab5f6e5dadd9af8302
BLAKE2b-256 checksum
How to use checksums
8e5d8e4a68d907943bfb68e7ba5b0ccc246155a79bda8c257ed7ee850448b529
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Release files / craftsman_gate-5.0.0-py3-none-any.whl

Download URL craftsman_gate-5.0.0-py3-none-any.whl
Size 412.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c9f4cee21520861341f27ecf71b66be99d6d4b32fc263899a5af2ec0e08b56e
BLAKE2b-256 checksum
How to use checksums
d28ae9ed531f0bb46fbafa11c6e96302c2128645ba9e416b3c005c6fbe39671c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

Security for craftsman-gate 5.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for craftsman_gate-5.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page