Metadata-Version: 2.5
Name: graftkit
Version: 0.1.0
Summary: Root-aware CLI framework and agent-skill distribution: one core, each repository grafts on its own commands and skills, for every coding-agent harness.
Project-URL: Homepage, https://github.com/Northbridge-Capital/graftkit
Project-URL: Documentation, https://northbridge-capital.github.io/graftkit/
Project-URL: Source, https://github.com/Northbridge-Capital/graftkit
Project-URL: Issues, https://github.com/Northbridge-Capital/graftkit/issues
Project-URL: Changelog, https://github.com/Northbridge-Capital/graftkit/blob/main/CHANGELOG.md
Author: Northbridge Capital
License-Expression: MIT
License-File: LICENSE
Keywords: agent-skills,ai-agents,claude-code,cli,codex,coding-agents
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: cli-interview-kit<0.3,>=0.2
Requires-Dist: packaging>=23.0
Requires-Dist: pydantic>=2.7
Requires-Dist: pyyaml>=6.0
Requires-Dist: tomlkit>=0.12
Description-Content-Type: text/markdown

# graftkit

[![CI](https://github.com/Northbridge-Capital/graftkit/actions/workflows/ci.yml/badge.svg)](https://github.com/Northbridge-Capital/graftkit/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/graftkit?style=flat)](https://pypi.org/project/graftkit/)
[![Python](https://img.shields.io/pypi/pyversions/graftkit?style=flat)](https://pypi.org/project/graftkit/)
[![Docs](https://img.shields.io/badge/docs-latest-blue)](https://northbridge-capital.github.io/graftkit/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/Northbridge-Capital/graftkit/blob/main/LICENSE)

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](https://pypi.org/project/cli-interview-kit/) declaration, so it runs as an
  interview, from flags, or from an agent: `--questions` prints the interview 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 this
  into a generated `graftkit` skill, so agents know the repository's commands without being
  told.

> **Status:** alpha (`0.x`). The public API is listed in the
> [API reference](https://northbridge-capital.github.io/graftkit/api.html); a breaking change
> bumps the minor version.

## Install

```bash
uv tool install graftkit
graftkit doctor
```

Requires [uv](https://docs.astral.sh/uv/) (the launcher runs pinned versions with `uvx`) and,
for skills from GitHub, the [GitHub CLI](https://cli.github.com/) logged in with `gh auth login`.
graftkit never handles a token itself.

## Start a repository

```bash
graftkit init     # writes graftkit.toml and a CI check; asks which harnesses to serve
```

```toml
# graftkit.toml
[cli]
core = "0.1.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.

```bash
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
```

```toml
[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 own commands

In a Python repository:

```bash
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](https://northbridge-capital.github.io/graftkit/extending.html). 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/>:

- [Writing an extension](https://northbridge-capital.github.io/graftkit/extending.html)
- [Settings](https://northbridge-capital.github.io/graftkit/settings.html)
- [API reference](https://northbridge-capital.github.io/graftkit/api.html)
- [Requirements](https://northbridge-capital.github.io/graftkit/requirements.html): what it
  must do, each verified by a test
- [Design](https://northbridge-capital.github.io/graftkit/design.html): how it works, and the
  decisions behind it

## Development

Requires [uv](https://docs.astral.sh/uv/) and [just](https://github.com/casey/just). See
[CONTRIBUTING.md](https://github.com/Northbridge-Capital/graftkit/blob/main/CONTRIBUTING.md).

```bash
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](https://github.com/Northbridge-Capital).
