Portable XID, Skill, Knowledge, workflow, and MCP runtime for XRefKit
Project description
XRefKit
AI agents often stop halfway, guess missing context, or produce work that looks plausible but cannot be reviewed or handed off.
XRefKit is a portable Python package and repository model for AI-assisted work that must reproduce domain procedures and judgments.
It runs as its own control repository and helps AI agents:
- load the right knowledge before acting
- select reusable Skills
- record judgments and evidence
- preserve handoffs across humans, agents, and sessions
- close work only through explicit quality gates
The package provides XID resolution, compact runtime contracts, Skill execution, catalog-first context loading, deterministic closure gates, client-side tools, and a thin MCP adapter over the same rules.
▶️ Download the 2-minute overview: Why XRefKit exists and how it helps AI teams use domain knowledge
Security and API Keys
XRefKit does not require Claude, OpenAI, GitHub, or other provider API keys to explore the repository.
This repository is a governance and knowledge-operations framework for AI-assisted work. It does not ask users to paste API keys into the repository, issue trackers, prompts, or configuration files.
If you use XRefKit with an external AI agent such as Claude Code, Codex, or GitHub Copilot, authenticate that agent through the official provider mechanism outside this repository.
Do not commit secrets, API keys, access tokens, .env files, or provider credentials to this repository.
XRefKit does not include repository-managed Claude settings, hooks, MCP server auto-approval, or provider endpoint redirection.
Before running any AI agent in this repository, review agent startup files and tool settings. XRefKit treats repository-controlled agent configuration as part of the trust boundary.
The Problem
Using AI for real work creates recurring operating problems:
- the AI can act from incomplete context or unsupported guesses
- procedures, domain facts, and judgment criteria get mixed together in prompts
- execution, checking, and handoff collapse into one opaque step
- work becomes hard to continue across agents, humans, or sessions
- outputs may lack evidence, closure discipline, or auditability
What XRefKit Provides
XRefKit makes AI work explicit by separating:
- Skills: executable work units, each identified by a capability/tuning/responsibility triad and carrying its execution and check contract
- Knowledge: source-backed domain facts and local rules loaded only when needed
- Workflow protocol: the generic, deterministic per-Skill control (phases, verification, closure) that wraps every Skill run
- Semantic routing: selecting the right Skill for a goal from user intent and the Skill catalog
- Evidence: logs, judgments, concerns, and quality checks
- XIDs: stable references that survive file movement and restructuring so AI can load targeted context without treating the whole repository as one prompt
This separation prevents prompts, domain facts, execution steps, review criteria, and handoff records from collapsing into one opaque instruction block.
How It Works
- Original materials are kept in
sources/. - AI-readable knowledge is maintained in
knowledge/. - Work is defined in
skills/(executable procedure with a capability/tuning/responsibility identity) andknowledge/. - Agents are routed semantically to the right Skill and load only the relevant context.
- Evidence and quality gates make incomplete or unsupported work visible.
Quick Start
Install the package and initialize an instance:
python -m pip install -e .
xrefkit init
xrefkit --help
Start the integrated MCP server over stdio:
xrefkit mcp serve --repo . --transport stdio
The server writes structured correlation events to
work/mcp/xid_audit.jsonl by default. After xrefkit skill run returns a
run_id, the client calls MCP bind_skill_run and executes the returned
client_record_command against the local run_log. Subsequent MCP Knowledge
searches and XID resolutions then share the same run_id as the client Skill
Run. The client separately records actual model-context loading and judgment
application with xrefkit skill knowledge --action load|apply.
XRefKit is designed to be driven by an AI agent. The agent first resolves the startup contract XID, selects a Skill or source target from a compact catalog, and expands only the selected body.
Here, sources/ is the human drop point for original materials, existing Skill artifacts, rules, and examples that the AI will turn into repository-managed assets.
If you are migrating an existing Skill:
- Place the source Skill or related source materials in
sources/. - Ask the AI agent to migrate that Skill into the XRefKit repository model.
- Have the migration process separate procedure, source-backed knowledge, and runtime structure as needed.
- Review whether the migrated Skill is usable for the intended work.
If you are creating a new Skill:
- Place the source materials, rules, or task examples in
sources/. - Ask the AI agent to use the Skill authoring flow (
skill_flow_authoring) to create a new Skill. - Have the authoring process separate procedure, source-backed knowledge, and runtime structure as needed.
- Review whether the new Skill is usable for the intended work.
In both cases:
- Give the AI agent a concrete work request with the goal, expected output, and constraints.
- Inspect
work/records as operational memory, then refine the Skill, knowledge, guard conditions, routing rules, and quality gates based on what happened.
How to Explore This Repository
Point your AI agent at this repository and ask directly.
Startup instruction files for Claude, Codex, and GitHub Copilot are included.
These files are plain-text operating instructions. They do not contain API keys, provider credentials, hooks, MCP server definitions, or network redirection settings.
The agent can read the operating contract and explain the repository structure in context.
Repository Map
xrefkit/: installable runtime, resolver, Skill control, tools registry, and MCP adapterdocs/: human-facing docs and policyknowledge/: source-backed knowledge fragmentssources/: original materials for verificationskills/: Skill definitions and routing indextools/: XID-backed client-side command implementations and packaged assetswork/: operational memory for execution logs, judgments, handoffs, retrospectives, and improvement inputagent/: agent entry and operating contracthuman-docs/: human-facing Japanese and English docs, materials, assets, and video packagessite/: generated publication output, source manifest, and compatibility routes
Runtime and Context Model
- Base runtime obligations are authored structurally and compiled into package resources with source hashes and token budgets.
- Repository, installed-package, and MCP providers resolve the same XID identities; conflicts and stale base packs fail explicitly.
The installed base runtime pack is generation-published. Formal consumers must
read xrefkit/resources/base/current.json first and then load both files from
the referenced generations/<generation>/ directory. The top-level
contracts.json and model_body.md files are compatibility snapshots only;
they are not an authoritative source and must not be used for generation
consistency checks.
- Source structure is split into a target catalog and finding catalog. The AI loads lists before selected details.
xrefkit catalog maintain --apply-safepromotes only unambiguous candidate findings; conflicts remain in a review queue.- MCP exposes the shared resolver and catalogs. It does not own independent domain rules or execute client tools.
Entry Points
- Human documentation:
docs/000_index.md - Human-facing language trees:
human-docs/ja/000_index.md,human-docs/en/ - Agent entry:
agent/000_agent_entry.md
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xrefkit-0.3.0.tar.gz.
File metadata
- Download URL: xrefkit-0.3.0.tar.gz
- Upload date:
- Size: 215.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50c01d22722b0a98e495bc6e63083c7580a7f2a6dd95a4810a4a1a76f1903bf5
|
|
| MD5 |
59852672fc83044d0a6908b1752ef7d1
|
|
| BLAKE2b-256 |
93453c1dcf54c9c39d685054f08d747d0d4bfcaa567f74d8b1667c108dc12f3b
|
Provenance
The following attestation bundles were made for xrefkit-0.3.0.tar.gz:
Publisher:
python-package.yml on synthaicode/XRefKit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xrefkit-0.3.0.tar.gz -
Subject digest:
50c01d22722b0a98e495bc6e63083c7580a7f2a6dd95a4810a4a1a76f1903bf5 - Sigstore transparency entry: 2148854066
- Sigstore integration time:
-
Permalink:
synthaicode/XRefKit@0de41d9371c70da2bdd3c7479cfe44957007d3ab -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/synthaicode
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-package.yml@0de41d9371c70da2bdd3c7479cfe44957007d3ab -
Trigger Event:
push
-
Statement type:
File details
Details for the file xrefkit-0.3.0-py3-none-any.whl.
File metadata
- Download URL: xrefkit-0.3.0-py3-none-any.whl
- Upload date:
- Size: 194.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc997e39cabc99b2543acb9c17ffe10575e93d9fcf54b39b6f83fd0abde0408c
|
|
| MD5 |
fdb4abbc8c7f8f27d3b1b2f96c172b5c
|
|
| BLAKE2b-256 |
e215f3c3b7503efb5cd9d45aed85a94bbf761d961f95fb95921a07e5be0d5129
|
Provenance
The following attestation bundles were made for xrefkit-0.3.0-py3-none-any.whl:
Publisher:
python-package.yml on synthaicode/XRefKit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
xrefkit-0.3.0-py3-none-any.whl -
Subject digest:
dc997e39cabc99b2543acb9c17ffe10575e93d9fcf54b39b6f83fd0abde0408c - Sigstore transparency entry: 2148854195
- Sigstore integration time:
-
Permalink:
synthaicode/XRefKit@0de41d9371c70da2bdd3c7479cfe44957007d3ab -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/synthaicode
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-package.yml@0de41d9371c70da2bdd3c7479cfe44957007d3ab -
Trigger Event:
push
-
Statement type: