@silktree/core
v1.4.0
Published
Skill tree schema, resolution, radial layout, theme model and renderer contract for silktree journey maps.
Readme
@silktree/core
The pure core of silktree: 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 @silktree/coreWhat it does
A silktree is one file, .silktree/silktree.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), 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 '@silktree/core'
const tree = parseSkillTree(JSON.parse(await readFile('.silktree/silktree.json', 'utf8')))
const resolved = resolveTree(tree)
const layout = layoutTree(resolved, defaultTheme)
console.log(resolved.totals.spent, 'points spent,', layout.nodes.length, 'nodes placed')Related
silktree- thesilktreebinary: CLI, MCP server and REST API in one.@silktree/actions- every operation as a portable silkweave action.@silktree/frames- measuring raster frame art against the stage geometry.
MIT (c) Tobias Strebitzer
