extended-graph-stat-calculator
Installation
SKILL.md
Stat Calculator
Create a new node or link stat calculator that integrates with the existing factory pattern in src/statsCalculators/.
Critical
- All internal imports MUST use
"../../internal"— never import from specific files withinsrc/. The project uses a barrel export atsrc/internal.ts. - Every new calculator class, type literal, and label MUST be added to all four registration points (calculator file, factory, type union + label maps,
src/internal.tsexport). Missing any one will cause a build failure or silent omission from the UI. - Run
npm run buildto verify — there is no test framework. A clean build withtsc --noEmit+ esbuild is the only validation.
Instructions
Step 1: Create the calculator file
For a node calculator — create a new file in src/statsCalculators/nodes/ (e.g., src/statsCalculators/nodes/wordCountCalculator.ts following the pattern from src/statsCalculators/nodes/filenameLengthCalculator.ts):
import { GraphologyGraph, GraphStatsDirection, NodeStat, NodeStatCalculator } from "../../internal";