shelf-spec
shelf-spec — a portable, vendor-neutral memory format for AI agents — plus a thin validator/scaffolder around it.
A shelf is a git repository of human-readable Markdown: categories, an
INDEX.md catalog, per-category metadata, an optional journal
(ledger.tsv) and policy (POLICY.md). Any MCP client attaches the same
shelf; migration between vendors is git clone. The product is the
format (spec/SPEC.md); the reference implementation is
docshelf-mcp.
Status: v0 (draft, descriptive) — the spec fixes what already works on
live shelves. Final name: shelf-spec (decided 2026-07-26, ADR 0007; before
the production repo).
What is in this repo
spec/SPEC.md— shelf-spec v0 (RFC 2119).spec/shelf.schema.json— JSON Schema (draft 2020-12) forshelf.yml.spec/examples/— example manifests (memory, document, reserved multi).src/shelf_spec/— engine (manifest loader, validator, scaffolder, info) with two thin transports: an MCP server and a CLI.docs/advisory-ci.md— drop-in advisory CI stage for shelf repos.
Install
pip install -e '.[dev]'
CLI
shelf-spec init PATH --name "My shelf" --profile memory --categories topics,research,sessions
shelf-spec validate [PATH] # human-readable report
shelf-spec validate --ci [PATH] # machine JSON on stdout, exit 0/1/2
shelf-spec validate --json [PATH] # JSON report
shelf-spec validate --manifest CANDIDATE.yml PATH # validate a tree against
# an external manifest without touching it
shelf-spec info [PATH] # manifest + index summary for a client
shelf-spec serve # MCP server on stdio
Exit codes: 0 — shelf conforms (warnings allowed; --strict promotes
warnings to failure), 1 — spec violations (error findings), 2 —
config-error (manifest missing / unparseable / schema-invalid; checked
before any rule).
The default shelf root is $SHELF_SPEC_ROOT, falling back to the current
directory.
MCP server
Three tools, same engine as the CLI:
| tool | type | what it does |
|---|---|---|
shelf_init |
write (local) | scaffold a shelf: shelf.yml, docs root and categories, POLICY.md stub, .gitignore; idempotent |
shelf_validate |
read | lint a shelf against the spec; report with findings and severities |
shelf_info |
read | manifest + index summary for a connecting client |
Tools take flat keyword arguments — a hand-written tools/call looks like
{"name": "shelf_validate", "arguments": {"shelf_path": "/path/to/shelf"}},
no wrapper object.
Client configuration (stdio):
{
"mcpServers": {
"shelf-spec": {
"command": "shelf-spec",
"args": ["serve"],
"env": { "SHELF_SPEC_ROOT": "/path/to/your/shelf" }
}
}
}
Validation and info never scaffold a shelf silently: pointing them at a directory without a manifest is a config-error, not an invitation to create one.
Compatibility promise
An existing docshelf/memshelf shelf becomes spec-conformant by adding
one file — shelf.yml with mode: single. Nothing is migrated
(ADR-0005). .docshelf.json remains a legal implementation detail;
shelf.yml is the contract. Ready-to-apply manifests for the shelves
named in the roadmap live in docs/adoption/.
License
MIT.
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 shelf_spec-0.1.0.tar.gz.
File metadata
- Download URL: shelf_spec-0.1.0.tar.gz
- Upload date:
- Size: 41.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19b516a499e9fe4ea9c9cdb3f44a331f738943267cf0a18c5487b6c4be7644ae
|
|
| MD5 |
4febdde57a217b27e3a2ca32e5cfadbd
|
|
| BLAKE2b-256 |
7d20166ad165669af2c3247ce461cec87bd6474cb054c544329bc5d44d184127
|
Provenance
The following attestation bundles were made for shelf_spec-0.1.0.tar.gz:
Publisher:
release.yml on ignatenkofi/shelf-spec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shelf_spec-0.1.0.tar.gz -
Subject digest:
19b516a499e9fe4ea9c9cdb3f44a331f738943267cf0a18c5487b6c4be7644ae - Sigstore transparency entry: 2301189154
- Sigstore integration time:
-
Permalink:
ignatenkofi/shelf-spec@c5630caf0cb6f022f89d7f79f9d9338e19a700f6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ignatenkofi
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c5630caf0cb6f022f89d7f79f9d9338e19a700f6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file shelf_spec-0.1.0-py3-none-any.whl.
File metadata
- Download URL: shelf_spec-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a24ab9d4663d469b75f9783279766737eec7e72446afb4ea189a48bf6803f71
|
|
| MD5 |
4c724666dfb9135367e683e2d0b42b5b
|
|
| BLAKE2b-256 |
80f4cb21334d5f4557f368e5ab924db1916b4bce9edfb660032366ea3e844091
|
Provenance
The following attestation bundles were made for shelf_spec-0.1.0-py3-none-any.whl:
Publisher:
release.yml on ignatenkofi/shelf-spec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shelf_spec-0.1.0-py3-none-any.whl -
Subject digest:
3a24ab9d4663d469b75f9783279766737eec7e72446afb4ea189a48bf6803f71 - Sigstore transparency entry: 2301189300
- Sigstore integration time:
-
Permalink:
ignatenkofi/shelf-spec@c5630caf0cb6f022f89d7f79f9d9338e19a700f6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ignatenkofi
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c5630caf0cb6f022f89d7f79f9d9338e19a700f6 -
Trigger Event:
push
-
Statement type: