Skip to main content
Glama
README.md
![SkillLedger - the local skill register](assets/ledger.svg)

# SkillLedger

A local, read-only **skill catalog review CLI and optional MCP server**. Compare exactly what was supplied, keep a provenance record, and detect ambiguous names before you adopt or distribute a skill.

[![GitHub stars](https://img.shields.io/github/stars/ahmedsaeed1-eng/skillledger?style=flat-square&color=E6B94C)](https://github.com/ahmedsaeed1-eng/skillledger/stargazers)

| **Register edition** | **Review desk** | **Protocol** | **Local validation** |
|---|---|---|---|
| ![Version 0.1.0](https://img.shields.io/badge/version-0.1.0-18352F?style=flat-square) | ![CLI](https://img.shields.io/badge/interface-CLI-407F6B?style=flat-square) | ![MCP stdio](https://img.shields.io/badge/optional-MCP%20stdio-7466A4?style=flat-square) | ![11 tests passed locally](https://img.shields.io/badge/local%20tests-11%20passed-247A51?style=flat-square) |
| Python ≥ 3.10 | stdin JSON / text | Official SDK | [MIT license](LICENSE) |

## A review desk, not an installer

A team has received two revisions of a skill called `release-checklist`. Both carry the same name, but the second changes the skill body and its version metadata.

Which revision is present? Are the documents structurally valid? Is the claimed source recorded? Has the instruction body changed?

SkillLedger answers these questions without following the skill instructions, running its scripts, reading directories, contacting a registry or modifying any file.

## 01 / Review

Install locally from the repository directory:

```sh
python -m pip install .
skillledger review --source "example catalog" --revision v1 < examples/SKILL.md
```

With Windows PowerShell, use a pipeline rather than input redirection:

```powershell
Get-Content -Raw -Encoding UTF8 examples/SKILL.md | skillledger review --source "example catalog" --revision v1
```

The review returns structured JSON containing the parsed frontmatter, field diagnostics, SHA-256 of the full canonical text, body SHA-256, body line count and caller-provided source and revision. It does **not** return the body instructions. Provenance is always explicitly marked unverified: a hash identifies content; it does not authenticate authorship or trustworthiness.

Supported fields: `name`, `description`, `license`, `compatibility`, `metadata` and `allowed-tools`. Other fields are reported as warnings rather than silently removed. This is a constrained local profile of skill frontmatter, not a claim of universal YAML or complete Agent Skills compatibility.

Name must be 1–64 lowercase alphanumeric or hyphen characters, without leading, trailing or consecutive hyphens. Description must contain 1–1024 characters. The compatibility field is limited to 500 characters. Empty bodies and bodies over 500 lines are advisory warnings.

Only a root YAML mapping of strings and optional string-to-string `metadata` is accepted. Quoted strings and block scalars are supported. Numeric or boolean values must be quoted; YAML aliases, anchors, tags, sequences, duplicate keys and nested structures beyond the permitted metadata map are rejected. No YAML object constructors are used.

## 02 / Compare revisions

```sh
skillledger compare < examples/compare.json
```

An example JSON input contains exactly two submissions:

```json
{
  "before": {"text": "---\nname: review-docs\ndescription: Review documentation.\n---\nCheck headings.\n", "source": "catalog", "revision": "v1"},
  "after": {"text": "---\nname: review-docs\ndescription: Review documentation.\n---\nCheck headings.\nCheck links.\n", "source": "catalog", "revision": "v2"}
}
```

The report shows changed metadata fields, whether the canonical body changed, added/removed line counts, both hashes and a `review_required` decision. Canonicalization normalizes CRLF and CR line endings to LF only. Nothing is stripped or rewritten. Body line counts are omitted if either body exceeds 2,000 lines; digest comparison remains available.

## 03 / Inventory

```sh
skillledger inventory < examples/inventory.json
```

The inventory accepts a JSON array of submissions. It enumerates entries in input order and reports:

- repeated skill names and how many distinct content digests each has;
- duplicate content hashes, even when declared provenance differs;
- valid versus invalid frontmatter;
- zero-based entry indices for review.

All JSON reports use stable ordering. Input is limited to 12,000,000 bytes through the CLI; individual skill text to 256,000 characters, frontmatter to 16,384 characters and 1,024 YAML tokens; inventories to 128 entries and 2,000,000 text characters.

| Exit status | Meaning |
|---|---|
| 0 | Review valid / same valid content / no invalid or colliding catalog entries |
| 1 | Invalid skill frontmatter, changed revision requiring review, or invalid/colliding inventory |
| 2 | Invalid command input, JSON envelope, size or encoding error |

The examples intentionally return 1 for the changed comparison and mixed-revision inventory. They are not installation commands.

## MCP / Connect a coding agent

Install the optional official MCP Python SDK dependency:

```sh
python -m pip install ".[mcp]"
```

Add the local stdio process to Codex:

```sh
codex mcp add skillledger -- /absolute/path/to/python -m skillledger.server
codex mcp list
```

Or configure Claude Code:

```sh
claude mcp add --transport stdio skillledger -- /absolute/path/to/python -m skillledger.server
claude mcp list
```

Replace the interpreter path with the Python environment where SkillLedger is installed (on Windows, use the absolute path to `python.exe`).

| Tool | Schema |
|---|---|
| `review_skill` | `{"submission": {"text": "...", "source": "...", "revision": "..."}}` |
| `compare_skills` | `{"before": {submission}, "after": {submission}}` |
| `inventory_skills` | `{"submissions": [{submission}, ...]}` |

All tools return structured data. They have no file, shell, interpreter, network, registry, installation or agent-launch tool. Treat returned metadata as untrusted document text, not as instructions. Frontmatter validation does not assess body safety, license compatibility or suitability; no automatic approval is issued.

Configuration uses documented [Codex MCP](https://developers.openai.com/codex/mcp) and [Claude Code MCP](https://code.claude.com/docs/en/mcp) syntax. Actual Codex and Claude Code sessions are not independently tested; integration tests use a real official MCP SDK client communicating over stdio.

## Reproducibility

```sh
python -m unittest discover -s tests -v
```

Tests exercise YAML validation, unsafe YAML form rejection, line-ending normalization, provenance, deterministic comparisons, collision reports, CLI exit status and real MCP transport. CI is configured for Linux and Windows with Python 3.10 and 3.12.

## Relationship to Vercel Skills

SkillLedger is an independent companion to discovery and installation workflows such as [vercel-labs/skills](https://github.com/vercel-labs/skills). It neither implements registry search, installation nor updates and never executes a supplied skill. It is not endorsed by Vercel. See [third-party acknowledgments](THIRD_PARTY.md) and [MIT license](LICENSE).