How mode detection, data flow, and KG-enhanced scoring work together in the Learning Skill.
When a user invokes the Learning Skill, the orchestrator analyzes the prompt for keywordsDefined in skill.md under modes.[mode].keywords. Multilingual — both German and English terms are recognized. In case of ambiguity, the more specific mode wins.. Three keyword groups determine the mode: course words ("course", "tutorial", "HTML"), understand words ("understand", "graph", "analyze"), and combination words ("both", "combined", "everything").
# Mode detection in skill.md
mode_detection:
course:
keywords: ["course", "tutorial", "HTML", "Kurs"]
pipeline: Phase 0-6
understand:
keywords: ["understand", "graph", "analyze"]
pipeline: Phase 0-7
combined:
keywords: ["both", "combined", "everything"]
pipeline: A0-A7, then B0-B6The orchestrator scans the user prompt for keywords. On a match, the corresponding mode is activated and its pipeline starts. In case of ambiguity, the combined mode wins since it produces both outputs.
In combined mode, the full KG pipeline runs first (Phase A0-A7). Its result — the Knowledge Graph — then serves as input for the course pipeline (Phase B0-B6). The key advantage: KG data makes helpfulness scoring more objective.
Without KG data, HS scoring relies purely on heuristics. With KG data, objective metrics are added: How many files import this one? Which architecture layer does it belong to? How complex is its dependency graph?
In integration mode, helpfulness scoring receives four additional data points from the Knowledge Graph as bonus factors:
| KG Metric | Bonus | Logic |
|---|---|---|
| Complexity | +1 | Node has high cyclomatic complexity or many internal dependencies |
| Fan-in | +1 | Node is imported by many other nodes (high inbound connectivity) |
| Core Layer | +1 | Node belongs to Core/Domain layer (architectural center) |
| Edge Density | +1 | Node has above-average inbound + outbound edges |
// KG-enhanced HS scoring
function calculateHS(topic, kgData) {
let hs = complexity(0-3) + relevance(0-3)
+ learningValue(0-2) + independence(0-2);
if (kgData) {
if (node.complexity > threshold) hs += 1;
if (node.fanIn > avgFanIn * 1.5) hs += 1;
if (node.layer === "Core") hs += 1;
if (node.edgeDensity > avg * 2) hs += 1;
}
return Math.min(hs, 10);
}The orchestrator in skill.md controls which phases run sequentially and which run in parallel. Core rule: phases with dependencies run sequentially, independent work units within a phase run in parallel.
| Rule | Sequential | Parallel |
|---|---|---|
| Phases | Phase N must complete before Phase N+1 | -- |
| Agents | Scanner before analyzer, analyzer before assembler | 5 file-analyzers simultaneously |
| Audiences | -- | Users, developers, executives simultaneously |
| Languages | -- | DE and EN simultaneously per audience |
| Modes | Combined: KG pipeline before course pipeline | -- |
In combined mode, the KG pipeline must fully complete before the course pipeline starts, since the course pipeline needs KG data as input. Within each pipeline, as many steps as possible are parallelized to minimize total runtime.