graftkit#

CI PyPI Python Docs License: MIT

One CLI core for every repository, with each repository grafting on its own commands and agent skills. Works for people at a terminal, for CI, and for AI coding agents (Claude Code, Codex, Copilot, Cursor, opencode, pi, or your own harness).

  • Root-aware. graftkit finds the repository it runs in (the nearest graftkit.toml, as git finds .git) and runs the version that repository pins. Install it once; every repository stays reproducible.

  • Per-repository commands. A repository adds its own commands as an extension: an AWS repository gets AWS commands, a data repository gets data commands, all in the same shape.

  • Agent skills, distributed. Shared skills and bundles from your organisation’s content repository, skills from an allow-list of vendors, and each repository’s own skills: pinned, locked, hash-verified, and linked for every harness.

  • Agent-ready commands. Every command is a cli-interview-kit declaration, so it runs as an interview, from flags, or from an agent: <command> --describe prints one command’s examples, options and questions as JSON, graftkit describe --json lists every command in the repository, and each command says whether an agent may run it itself or must hand it to the user. skills sync writes the commands into a generated graftkit skill, one line each, so agents know them without being told and read the details only when they need them.

Why#

AI made building fast; review and consistency are the new bottleneck. When an agent can add a feature in minutes, the hard part is keeping every repository doing the routine things (CI checks, deploys, skills) the same, reviewed way. graftkit gives every repository one versioned core and one standard, and each repository grafts on only what is its own.

It is built for agents from the start. They learn a repository’s commands from a generated skill, run the ones marked safe, and hand the rest to a person. Agent skills are distributed like code: reviewed once centrally, then pinned and hash-checked everywhere.

For agents#

  • Provides: the graftkit CLI core (the root-aware launcher, skills distribution, the org commands) and the extension API, graftkit and graftkit.testing.

  • Concepts: root, extension, the command standard, agent policy, skill sources and bundles, the content repository, the generated skill, the organisation map.

  • Entry points: src/graftkit/_core/app.py (every core command), docs/design.md (how it works), docs/extending.md (writing an extension).

Status: alpha (0.x). The public API is listed in the API reference; a breaking change bumps the minor version.

Install#

uv tool install graftkit
graftkit config   # your settings, such as your organisation; asks for each
graftkit doctor

Requires uv (the launcher runs pinned versions with uvx) and, for skills from GitHub, the GitHub CLI logged in with gh auth login. graftkit never handles a token itself.

Start a repository#

graftkit init     # writes graftkit.toml and a CI check; asks which harnesses to serve
# graftkit.toml
[cli]
core = "0.4.0"                       # the graftkit version this repository runs

[settings]
content_repository = "acme/agent-skills"   # your organisation's shared skills, if any

[skills]
harnesses = ["claude", "codex", "copilot", "pi"]

Skills#

Every skill lives in .agents/skills/<name>/, which most harnesses read directly; Claude Code gets a relative link per skill in .claude/skills/. Commit both, with graftkit.lock. Next to your own and your sources’ skills, skills sync keeps the generated graftkit skill: this repository’s commands, for agents.

graftkit skills new                       # scaffold a skill of this repository's own
graftkit skills add shared --bundle common  # skills from your content repository
graftkit skills add databricks --all      # every skill of an allow-listed vendor
graftkit skills status                    # every skill, its origin and its state
graftkit skills update --pr               # move pins to the latest releases, as a pull request
graftkit skills sync --check              # for CI: offline, fails on any difference
[skills.sources.shared]          # the content repository: shared skills, bundles, allow-list
version = "v1.4.0"
bundles = ["common"]

[skills.sources.databricks]      # a vendor on the allow-list, pinned by this repository
version = "v0.2.56"
skills = ["*"]
exclude = ["databricks-serverless-migration"]

A skill folder the lock does not own is the repository’s own and is never touched. Every managed skill is locked by commit and content hash. Vendor skills that come through a bundle are also checked against what the content release reviewed, so a moved tag or changed content fails before anything is written; a vendor a repository pins itself is that repository’s review.

The content repository#

Your organisation’s shared skills live in one repository:

graftkit-content.toml   schema = 1, requires_core = ">=0.1,<1"
skills/<name>/SKILL.md  shared skills, to the Agent Skills specification
bundles.toml            named sets of shared and vendor skills
vendors.toml            the allow-list, with a reviewed version per bundled vendor
vendors.lock            commit and content hash of every bundled vendor skill

graftkit skills review there pins bundled vendor skills in vendors.lock and checks the release; tag it to release. Any repository proposes a skill to it with graftkit skills promote <skill>, as a pull request.

Your organisation#

With the organisation setting (usually in your user config), graftkit org works across your GitHub organisation, through your own gh login: you see exactly the repositories your access allows.

graftkit org repos          # the repositories you can see, and your access to each
graftkit org repos --json   # the same, for agents
graftkit org map            # what each repository offers others, and its commands
graftkit org map --json     # the same, for agents
graftkit org search "def deploy" --repo tools --limit 10   # code you can read, via GitHub's search
graftkit org clone --into ~/code/my-org   # clone what you can see that is missing
graftkit org sync --into ~/code/my-org    # fast-forward clean clones; says why it skipped any

With git_name and git_email set, every new clone gets that git identity, for example your work identity on a machine whose global one is personal.

The map reads each repository’s GitHub description and topics, its README’s ## For agents section (three bullets, which graftkit doctor checks), and the commands of its generated graftkit skill. The generated skill points agents to graftkit org map --json whenever a task reaches beyond the repository.

Your own commands#

In a Python repository:

graftkit extension new     # scaffolds commands/, workflows/ and tests, registers the entry point
uv sync
graftkit hello             # the example command, run inside the repository's environment

See Writing an extension. Each command is held to one standard (graftkit extension check), so every repository’s CLI reads the same.

Documentation#

https://northbridge-capital.github.io/graftkit/:

Development#

Requires uv and just. See CONTRIBUTING.md.

just sync   # install dependencies
just lint   # ruff, ruff format, mypy (strict)
just test   # pytest in parallel, with the coverage gate

License#

MIT. graftkit is maintained by Northbridge Capital.