@skill-tree/core
v0.1.0
Published
Skill tree schema, resolution, radial layout, theme model and renderer contract for skilltree journey maps.
Readme
@skill-tree/core
The pure core of skilltree: game-style RPG skill-tree journey maps for software projects. No I/O, no rendering - it parses the artifact and derives everything else from it.
npm install @skill-tree/coreWhat it does
A skilltree is one file, .skilltree/skilltree.json, holding the tree definition and the progress
together. This package turns that file into everything a renderer needs:
parseSkillTree/safeParseSkillTree- the zod schema for the artifact.resolveTree- statuses (locked / available / unlocked / maxed), edge states, XP totals, user level, and the validation issues a tree can carry.layoutTree- places every node on the hex board: depth is the column, branches are horizontal lanes, and each tier occupies a different patch of mesh.hex.ts- the one board geometry (a pointy-top mesh, flat-top node stages) that both the layout and the renderers measure against.parseTheme/uiColors- the theme model: design tokens, palette, per-tier frames, label placement.
import { parseSkillTree, resolveTree, layoutTree, defaultTheme } from '@skill-tree/core'
const tree = parseSkillTree(JSON.parse(await readFile('.skilltree/skilltree.json', 'utf8')))
const resolved = resolveTree(tree)
const layout = layoutTree(resolved, defaultTheme)
console.log(resolved.totals.spent, 'points spent,', layout.nodes.length, 'nodes placed')Related
@skill-tree/cli- theskilltreebinary: CLI, MCP server and REST API in one.@skill-tree/actions- every operation as a portable silkweave action.@skill-tree/frames- measuring raster frame art against the stage geometry.
MIT (c) Tobias Strebitzer
