Skill Tree Generator
A skill that turns a pile of skills into a routing tree so the agent loads only the leaves it needs
- 66 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The skill restructures the skills directory and appends a routing protocol to the root `CLAUDE.md`
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/skill-tree-generatorDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The skill restructures the skills directory and appends a routing protocol to the root `CLAUDE.md`
This is third-party code. Review the repository files before installing.
What it does
Skill Tree Generator restructures a flat skill set into a hierarchy of tiny routing files: `ROOT.md`, then a branch `ROUTER.md` and leaf `SKILL.md` files. The agent first reads a short table at the root, narrows the choice branch by branch and opens only the matching leaves. A focused request lands on one leaf, and a multi-topic request fans out to several leaves read in parallel. The skill has three modes. Generate (`/skill-tree-generator <skill>`) splits one bulky skill into a tree. Aggregate (`/skill-tree-generator --aggregate a,b,... --domain x`) merges many skills into one tree, deduplicating shared capabilities. Update (`/skill-tree-generator --update <path> --add <skill>`) adds a skill to an existing tree. For a quick start in Claude Code, copy `skill-tree-generator` into `.claude/skills/` and run `./scripts/aggregate-skills.sh .claude/skills`: the script prints the exact command to paste into the agent. The result lands in `.claude/skills/{name}-tree/`, and the routing protocol is appended to the root `CLAUDE.md`. The script and skill are Bash and Markdown with no dependencies.
Who it is for. Users with dozens of installed skills whose descriptions overload the context and make it harder for the agent to pick the right one.
Good fit when
- Dozens of skills have piled up in `.claude/skills` and context is crowded with their descriptions
- One large skill must be split into topical branches with separate leaves
- Several skills from different areas must be merged into a single tree without duplicates
- A new skill must be added to an existing tree through the update mode
Not a fit when
- There are only a few skills: a routing tree adds an extra step
- A strict order of steps is needed: the tree picks leaves by the meaning of the request
- The agent does not read `AGENTS.md` or `CLAUDE.md` and cannot follow routing files
Example request
/skill-tree-generator --aggregate web-dev,data-pipeline,pdf-tools,seo-audit --domain workLimitations
The skill rewrites the structure of your skills and appends a protocol to the root `CLAUDE.md`, so back up the directory or commit it to Git first. Routing quality depends on how the agent reads the descriptions, and in ambiguous cases a leaf may need to be picked by hand. Codex CLI needs a one-time setup with `./scripts/install-codex-prompt.sh`, and other agents take the `--agent` flag and a directory. Launch formats differ between agents: some want a bare `/skill-tree-generator` command, others a `Read ... and execute` prefix. The latest repository changes date from August 2026.
How to disable. Delete the `skill-tree-generator` folder and the generated `{name}-tree/` trees from the skills directory, then remove the routing protocol from `CLAUDE.md`.
FAQ
How do I install Skill Tree Generator in Claude Code?
Clone the repository and run `cp -r skill-tree-generator .claude/skills/`. Then run `./scripts/aggregate-skills.sh .claude/skills` and paste the printed command into Claude Code.
Which agents are supported?
Claude Code, Codex CLI, OpenCode, OpenClaw, Bitfun and Hermes, plus agents that read `AGENTS.md` such as Cursor, Aider and Jules. The scanner takes its own directory and `--agent` flag for each.
What does aggregate mode do?
`/skill-tree-generator --aggregate a,b,... --domain x` merges the listed skills into one tree and removes duplicates of shared capabilities so they live in one branch.
How do I add a skill to an existing tree?
Run `/skill-tree-generator --update <tree-path> --add <skill>`. The tree is extended incrementally without a full rebuild.
Are dependencies needed?
No, the skill and scripts are pure Bash and Markdown. Codex CLI needs a one-time prompt install into `~/.codex/prompts/`.
Discussion
No questions or reviews yet.
Related
Skills11 skills for Claude Code: SKILL.md authoring, prompt tuning, refactoring, change review and planning in files.
A meta-skill that folds rules scattered across AGENTS.md, CLAUDE.md and Cursor files into one project skill with task routes.
A working folder for Claude Code where the agent asks questions and writes a new skill by Anthropic's guidance, not from memory.
Skill Flow groups skills from many sources and deploys them to many agents, including Claude Code, Cursor and Codex.
A skill for creating skills that proves them by behavior: before-and-after runs, regression evals and ecosystem audit
A desktop app and CLI to install, sync and organize agent skills across Claude Code, Codex, Cursor and other tools
README in short
The README explains context bloat, shows the tree before and after, the three modes, a 60-second quick start for Claude Code, a command table for other agents and the repository layout.
README badge
Original SKILL.md
--- name: skill-tree-generator description: Generates, aggregates, and extends modular skill-trees with hierarchical routing. Supports three modes — (1) convert a monolithic skill into a tree with ROOT.md/ROUTER.md/SKILL.md, (2) aggregate multiple skills into a unified cross-domain tree with shared leaves and disambiguation, (3) incrementally update an existing tree by adding new skills. Use when users need to restructure, merge, or extend skills into context-aware, load-on-demand hierarchies. --- # Skill Tree Generator ## Usage ``` /skill-tree-generator <skill-name-or-skill-path-or-description> /skill-tree-generator --aggregate skill1,skill2,... [--domain domain-name] [--no-decompose] /skill-tree-generator --update <tree-path> --add <skill> ``` | 输入特征 | Mode | 描述 | |---------|------|------| | 单个 skill 路径/描述,无特殊 flag | **Mode 1** | 将单体 skill 转为路由树 | | `--aggregate skill1,skill2,...` | **Mode 2** | 聚合多个 skill 为统一跨域树 | | `--update <tree-path> --add <skill>` | **Mode 3** | 增量更新已有 tree | **可选 flag**: | Flag | 适用 Mode | 作用 | |------|----------|------| | `--domain <name>` | Mode 2 | 声明同域聚合,ROOT.md 按域内能力差异路由 | | `--no-decompose` | Mode 2 | 跳过 Step A1 能力拆解,所有源 skill 一律按单叶处理。仅当源 skill 已预先拆到原子粒度时使用 | ## Overview Transform monolithic skills into modular, hierarchical skill-trees (ROOT.md → ROUTER.md → SKILL.md) with dynamic routing. Use when: - A skill has grown too complex and needs modularization - Multiple distinct workflows exist within a single skill - Multiple related skills need to be unified under one routing tree - Cross-domain workflows span multiple skills - Overlapping capabilities across skills need deduplication - An existing skill-tree needs new skills or capabilities added ## Strict Conformance Before creating or modifying tree output, read and follow `references/strict_conformance.md`. Do not use substitute workflows, fast versions, heuristic-only splitting, or partial validation. If full conformance is impractical, stop and report the blocker before continuing. --- ## Mode 1: Single Skill Tree Generation