Skip to main content

SkillTree

SkillTree

Licence Version Stars Last commit

SkillTree turns a flat folder of agent skills into a tree that a model walks one layer at a time. Every skill gets an address (0, 0.1, 0.1.1), every branch tells the model what lies below it and how to go down into it, and a set of checks keeps the tree true as skills are added, moved or removed. It is a Python library and a command line, skilltree, published on PyPI as agent-skilltree, and it ships as a Claude Code plugin whose one skill teaches Claude to install and use it.

The problem it solves

Claude Code loads a skills folder one layer deep: every skill in ~/.claude/skills or a project's .claude/skills is offered to the model at once, and a .claude folder nested inside another is never loaded. With ten skills that costs nothing. With a hundred, every skill's description is in front of the model on every turn, and choosing the right one gets worse as the pile grows, because the model has to work out, each time, how the skills relate — which is general and which is specific, which belongs under which — from a list that no longer says.

Those relations are already there in the skills themselves; the flat folder throws them away. The platform ships the nodes and forbids the edge: no skill can cause a deeper skill to be loaded. SkillTree puts the edges back on the disk. A model then reads the top layer, chooses a branch, and reads into it, so what it holds at any moment grows with how deep it has gone, not with how many skills exist.

Install

pip install agent-skilltree

First use

Point it at a skills folder, see what shape it is in, turn it into a tree, and undo it if you want:

skilltree cohere ~/my-project            # is it a tree, or a flat pile with no root?
skilltree emit ~/my-project --root-forest --name my-project   # make it a tree, in place
skilltree tree ~/my-project              # show the tree, every skill by its address
skilltree search ~/my-project "deploy rollback" --scope 0.1   # search inside one branch
skilltree unemit ~/my-project            # put everything back exactly as it was

From a clone of the repository, pip install -e . installs the same command.

From Python:

from skilltree import SkillTree, TreeNode, materialize, validate

tree = SkillTree(TreeNode("root", "sc", children=[TreeNode("debug", "cor"), TreeNode("explain", "cor")]))
materialize(tree, "out/", coords=True)    # write it to disk
assert validate("out/") == []             # every branch can be walked

Its interface

Show its interface

The command line, skilltree <command>:

command what it does
discover <root> · tree <root> read the tree that is actually on disk and print it, every skill by its address
cohere <root> report where the tree on disk has drifted from its recorded shape; exits 1 on any drift
emit <root> [--root-forest] [--name N] [--localize] rewrite addresses and breadcrumbs in place; --root-forest turns a flat folder into a tree, moving each skill whole and recording every move
unemit <root> undo the last journaled step — a tree-making emit or a place — exactly; run again, the step before
place <skill> --into <node> --tree <root> [--name N] [--kind K] [--description D] put a skill folder under a node: a new name becomes a new child, a name the node has becomes that child's next version, the earlier kept on disk and the breadcrumb led to the newest
relink <root> [--localize] rewrite only the breadcrumb paths: relative (what you ship) or absolute for this machine
build <manifest> <root> [--localize] write a tree from its manifest, then check it
validate <root> check that every node loads and every breadcrumb leads somewhere
map <folder> [--write] render any folder as one addressed index file
search <folder> <query> [--scope C] [--ext E] [--limit N] [--all-versions] ranked search over any folder, optionally inside one branch; a skill kept in several versions answers with its newest unless every version is asked for
fold <target> --into <node> --tree <root> [--kind K] [--what-for TEXT] [--name NAME] [--absolute] add a pointer row to a node's table; --kind names a kind a detector speaks for
adapt codex|gemini <root> [<target>] [--node N] write the layer of a node — its skill and each child's, with their summaries — into the .agents/skills/ folder Codex or Gemini reads, each skill saying how to descend under that agent
detectors list the detectors installed: each kind SkillTree has been taught beyond a skill
project <root> <target> [--policy progressive|flat] [--link absolute|relative] [--node N] surface a tree into a skills folder as links, the place recorded so a link removed is reported and restored
unproject <root> <target> retire a place a tree was projected into: its links removed and its record dropped
position [<root>] [--node N] [--all] [--hook] write and show a node's positional map — where it is, the path down to it, every top-level branch and the siblings at each level; --hook is the hook the plugin installs, run after every Read
notify <root> [--rules-dir D] [--remedy TEXT] · watch <root> [--interval S] [--once] [--remedy TEXT] write the tree's health into one notice file, once or on a timer
demo build a small tree, walk it, check it, break it, and show the check catching the break

The library, import skilltree: SkillTree, TreeNode, parse_identity, parse_version, version_identity, logical_name and newest (the model), materialize and validate (write and check), discover, cohere, emit, place, unemit and watch (coherence), project, link_tree and build_forest (surfacing), Detector, Problem, detectors, register, add_row and fold (detectors and rows), build_map, build_index and search (navigation), and adapters, adapter and ADAPTERS (other coding agents), and position, write_maps, register_section, placements, missing_placements, restore_placements and unproject (the positional map and the places a tree is projected into).

How it works

SkillTree uses the only three levers the platform leaves open. Placement: each node is a plain folder carrying its own one-skill .claude/, so the path is the coordinate. The inert nested .claude: only the top layer loads, so deeper nodes stay out of context until entered. Breadcrumbs: each node's SKILL.md ends with what lies below it and the instruction to Read into it. A coordinate stands in for a node's identity and a breadcrumb for an edge — emulations of what a graph would hold natively.

So a tree is plain folders. The root's skill lives at <root>/.claude/skills/0-<root>/SKILL.md; each child is a folder beside that .claude, holding its own one-skill .claude/skills/, and only the root's skill is offered at first. The root's SKILL.md ends with two generated parts: an index summary, which names everything reachable below it so that a search for a deep skill still finds the branch that leads to it, and the breadcrumbs, one line per child of the form - 0.1-debug (cor): Read `debug/.claude/skills/0.1-debug/SKILL.md` .

Descending is reading. When the model uses Claude Code's Read tool on a child's SKILL.md, Claude Code loads that folder's layer — its CLAUDE.md, its rules and its skills — and nothing below it; a folder outside the project loads nothing when read. A shell cat of the same file loads nothing either, so every breadcrumb says Read, never cat.

The shape is recorded in a manifest, skilltree.json, beside the tree. Breadcrumbs and the manifest's paths are relative, so a tree names no machine and still works when copied; installing a tree writes them absolute for the place it is installed. Because the platform does nothing to keep such a structure intact, SkillTree keeps it itself: validate refuses a tree a model could not walk, cohere names every way the disk has drifted from the manifest, emit repairs it in place, and a watch writes the verdict into one notice file that every session reads, so a broken tree announces itself.

Wherever the model stands in a tree it is also shown, without asking, where it is: each node's folder holds a generated map skill — the node's address, the path down to it, every top-level branch and the siblings at each level — which loads with the node, and the plugin's hook hands it to the model the moment it Reads into a node. So a model deep in a tree never loses the shape of the whole.

What it needs

Python 3.11 or later and the click package, which pip installs with it. Search uses SQLite's FTS5, which ships with Python. Walking a tree by its breadcrumbs needs a coding agent whose file reader loads a folder's skills when it reads a file there, as Claude Code's does; Codex and Gemini, which load skills from an .agents/skills/ folder instead, walk the same tree through skilltree adapt.

Roadmap

version what it holds where it stands
0.1.0 the tree and its gate: materialize, validate, discover, cohere, emit, unemit, the watch and its notice, the command line. reached
0.2.0 one product: map and search folded in as commands, and the tree view. reached
0.3.0 rows on a node: a node holding pointer rows to skill folders, the operation that adds one, project, and the check that every row resolves. reached
0.4.0 trees that ship portable: relative breadcrumbs and manifest paths, localized only at install. reached
0.4.1 the install line names this package. reached
0.4.2 the design and its face: every file of SkillTree explained in its design, the README written from that design, one roadmap, frontmatter every parser reads, search that finds a tree's skills and answers any query, and no hosted workflow. reached
0.5.0 detectors: a package plugs in what SkillTree should detect in a folder beyond a skill, and what a node holds for it; SkillTree itself knows only skills and names nothing built on it, and the exchange, the reports queue and the marketplace modules are gone. reached
0.6.0 the checks made true: every gate exiting non-zero on a fault, one rule of addressing, and a notice whose remedy fits the installation. reached
0.7.0 versioned skills: a skill placed again keeps its history, and descent and search go to its newest version. reached
0.8.0 adapters for other coding agents: the same tree walked under Codex and under Gemini, each by its own emulation of descent. reached
1.0.0 the positional map: wherever the agent stands, it is shown the branches above it and around it, and skills placed by the graph that owns them are restored when missing. next

PyPI · Marketplace · Paper — Flat versus Tree · Paper — Coordinate-Addressed Skill Trees

Changelog

Every publish is recorded in CHANGELOG.md.

Licence

MIT License — see LICENSE.

Metadata

Release files for agent-skilltree 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-skilltree 1.0.0
File Size Uploaded Provenance Actions
agent_skilltree-1.0.0.tar.gz 82.5 kB Without provenance Details for agent_skilltree-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-skilltree 1.0.0
File Interpreter ABI Platform Actions
agent_skilltree-1.0.0-py3-none-any.whl Python 3 none any Details for agent_skilltree-1.0.0-py3-none-any.whl

Total release size: 145.6 kB

Release files / agent_skilltree-1.0.0.tar.gz

Download URL agent_skilltree-1.0.0.tar.gz
Size 82.5 kB
Tags Source
SHA-256 checksum
How to use checksums
34f0d223cb55a68e3e63270a81ae5731a7a0a2ffd326f27d7d7bd612b0f4800f
BLAKE2b-256 checksum
How to use checksums
00a6200ee8ee13befbb0baec5b8ccf4880e19cf124f92bbf0ec737814253ea67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.13

Release files / agent_skilltree-1.0.0-py3-none-any.whl

Download URL agent_skilltree-1.0.0-py3-none-any.whl
Size 63.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
475f90b29492939c67ed8c30209773b39c86c03da113d611d08f16a9cf2d370d
BLAKE2b-256 checksum
How to use checksums
8a6d1c6fbad3a28bfa6cbf201c17e50dad32b1024797a5e9e36ea1da89eacf07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.13

Security for agent-skilltree 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page