What problem does it solve?
This Skill helps you model, traverse, and transform recursive parent-child structures without writing error-prone custom recursion logic.
Core Features & Use Cases
- Recursive Tree Construction: Build roots, leaves, and nested forests for hierarchies like categories, comments, and org charts.
- Query & Search: Retrieve root values, enumerate immediate children, compute total size, check leaf nodes, and find nodes by predicates.
- Transform & Flatten: Map and filter values, then convert the tree into pre-order arrays with optional depth metadata for rendering or analytics.
- Aggregation via Fold: Compute recursive results (e.g., sums, derived metrics, or validation checks) by folding values and child results.
- Pretty Rendering: Generate human-readable tree diagrams using a default stringifier or a custom value display function.
Quick Start
Use the tsentials/tree Skill to create a hierarchy for your domain (like categories or comments), then call Tree.findAll to collect every matching node and prepare the result for rendering or further processing.