$npx -y skills add TanStack/intent --skill tree-generatorGenerate, update, and version a complete skill tree (collection of SKILL.md files) for any JavaScript or TypeScript library. Produces core skills (framework-agnostic) and framework skills (React, Solid, Vue bindings) with dependency linking. Activate when producing skill files fr
| 1 | # Skill Tree Generator |
| 2 | |
| 3 | You produce and maintain a tree of SKILL.md files for a library. Every file |
| 4 | you create is read directly by AI coding agents across Claude, GPT-4+, |
| 5 | Gemini, Cursor, Copilot, Codex, and open-source models. Your output must |
| 6 | be portable, concise, and grounded in actual library behavior. |
| 7 | |
| 8 | ### Skill types |
| 9 | |
| 10 | Every skill has a `type` field in its frontmatter. Valid types: |
| 11 | |
| 12 | | Type | Purpose | Example | |
| 13 | | ------------- | ---------------------------------------------------------- | ------------------------- | |
| 14 | | `core` | Framework-agnostic concepts, configuration, patterns | `db-core` | |
| 15 | | `sub-skill` | A focused sub-topic within a core or framework skill | `db-core/live-queries` | |
| 16 | | `framework` | Framework-specific bindings, hooks, components | `react-db` | |
| 17 | | `lifecycle` | Cross-cutting developer journey (getting started, go-live) | `electric-quickstart` | |
| 18 | | `composition` | Integration between two or more libraries | `electric-drizzle` | |
| 19 | | `security` | Audit checklist or security validation | `electric-security-check` | |
| 20 | |
| 21 | Agents discover skills via `npx @tanstack/intent list` and read them directly |
| 22 | from `node_modules`. Framework skills declare a `requires` dependency on |
| 23 | their core skill so agents load them in the right order. |
| 24 | |
| 25 | There are two workflows. Detect which applies. |
| 26 | |
| 27 | **Workflow A — Generate:** Build a complete skill tree from a domain map. |
| 28 | **Workflow B — Update:** Diff a library version change and update skills. |
| 29 | |
| 30 | --- |
| 31 | |
| 32 | ## Workflow A — Generate skill tree |
| 33 | |
| 34 | ### Prerequisites |
| 35 | |
| 36 | You need one of: |
| 37 | |
| 38 | - `skills/_artifacts/domain_map.yaml` and `skills/_artifacts/skill_spec.md` |
| 39 | from skill-domain-discovery |
| 40 | - Raw library documentation and source code (run a compressed domain |
| 41 | discovery first) |
| 42 | |
| 43 | If starting from raw docs without a domain map, run a compressed |
| 44 | discovery. This produces lower-fidelity output than the full |
| 45 | skill-domain-discovery skill — prefer running that when time permits. |
| 46 | |
| 47 | 1. Build a concept inventory (every export, config key, constraint, warning) |
| 48 | 2. Group into capability domains using work-oriented names (let library complexity drive the count — 2–3 for focused libraries, more for large frameworks) |
| 49 | 3. Enumerate 10–20 task-focused skills from the intersection of domains |
| 50 | and developer tasks |
| 51 | 4. Extract 3+ failure modes per skill (plausible, silent, grounded) |
| 52 | 5. Proceed to Step 1 below |
| 53 | |
| 54 | ### Scaffold flow output |
| 55 | |
| 56 | If the maintainer uses a custom skills root, replace `skills/` in the paths |
| 57 | below with their chosen directory. |
| 58 | |
| 59 | For the scaffold workflow, produce a single artifact before writing any |
| 60 | SKILL.md files: |
| 61 | |
| 62 | - `skills/_artifacts/skill_tree.yaml` |
| 63 | |
| 64 | This file enumerates every skill that must be generated in the next step. |
| 65 | Do not write SKILL.md files yet unless explicitly asked. |
| 66 | |
| 67 | Use this format: |
| 68 | |
| 69 | ```yaml |
| 70 | # skills/_artifacts/skill_tree.yaml |
| 71 | library: |
| 72 | name: '[package-name]' |
| 73 | version: '[version]' |
| 74 | repository: '[repo URL]' |
| 75 | description: '[one line]' |
| 76 | generated_from: |
| 77 | domain_map: 'skills/_artifacts/domain_map.yaml' |
| 78 | skill_spec: 'skills/_artifacts/skill_spec.md' |
| 79 | generated_at: '[ISO date]' |
| 80 | |
| 81 | skills: |
| 82 | - name: '[task-focused skill name]' |
| 83 | slug: '[kebab-case]' |
| 84 | type: 'core | sub-skill | framework | lifecycle | composition | security' |
| 85 | domain: '[domain slug]' |
| 86 | path: 'skills/[path]/SKILL.md' |
| 87 | package: '[package directory, e.g. packages/client]' # monorepo only — which package this skill belongs to |
| 88 | description: '[1–2 sentence agent-facing routing key]' |
| 89 | requires: |
| 90 | - '[other skill slugs]' # omit if none |
| 91 | sources: |
| 92 | - '[Owner/repo]:docs/[path].md' |
| 93 | - '[Owner/repo]:src/[path].ts' |
| 94 | subsystems: |
| 95 | - '[adapter/backend name]' # omit if none |
| 96 | references: |
| 97 | - 'references/[file].md' # omit if none |
| 98 | ``` |
| 99 | |
| 100 | **Monorepo layout:** For monorepos, each skill's `path` is relative to its |
| 101 | package directory (e.g. `packages/client/skills/core/SKILL.md`). Set the |
| 102 | `package` field so generate-skill knows where to write the file. The domain |
| 103 | map artifacts stay at the repo root. |
| 104 | |
| 105 | ### Minimal library fast path |
| 106 | |
| 107 | If t |