/semantic-node-build
Create and record semantic nodes in the active WFGY tree to capture reasoning insights and maintain memory.
$ npx -y skills add qdhenry/Claude-Command-Suite --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/semantic-node-build
Context preview
What this command does when you run it.
Create and record semantic nodes in the active WFGY tree to capture reasoning insights and maintain memory.
Command definition
semantic-node-build.mdtools:
- read
- write
- edit
- grep
arguments: $TOPIC
Semantic Node Builder
Create and record semantic nodes in the active WFGY tree to capture reasoning insights and maintain memory.
Based on the WFGY project: https://github.com/onestardao/WFGY
Instructions
1. **Prepare Node Context**
- Parse topic from "$TOPIC" or auto-detect from context
- Read active tree from `.wfgy/trees/active_tree.json`
- Load previous node for reference
- Get current context from `.wfgy/context.json`
2. **Calculate Semantic Metrics**
- Generate embedding for current topic
- Compare with previous node embedding
- Calculate ΔS (semantic tension): ΔS = 1 - cos(θ)
- Determine λ_observe (logic direction):
- → (convergent): Building on previous (ΔS < 0.4)
- ← (divergent): New direction (ΔS > 0.6)
- <> (recursive): Returning to earlier (pattern match)
- × (chaotic): Unstable (ΔS > 0.9)
- Calculate E_resonance (stability measure)
3. **Identify Active Module**
- Analyze which WFGY module is primary:
- BBMC: If minimizing residue
- BBPF: If exploring multiple paths
- BBCR: If recovering from failure
- BBAM: If optimizing attention
- Record module attribution for traceability
4. **Build Node Structure**
{
"id": "node_[timestamp]_[hash]",
"timestamp": "ISO_8601",
"topic": "$TOPIC",
"module": "BBMC|BBPF|BBCR|BBAM",
"metrics": {
"deltaS": 0.XX,
"lambda": "→|←|<>|×",
"e_resonance": 0.XX,
"confidence": 0.XX
},
"content": {
"insight": "Encoded reasoning conclusion",
"context": "Surrounding context",
"keywords": ["key1", "key2", "key3"]
},
"relationships": {
"parent_id": "previous_node_id",
"references": [],
"bridges_to": []
}
}5. **Apply Recording Logic**
- Check recording criteria:
- Primary: ΔS > 0.6 (always record)
- Secondary: ΔS ∈ [0.4, 0.6] AND λ ∈ {←, <>}
- Forced: User explicitly requests
- If criteria met:
- Append node to tree
- Update tree metadata
- Create cross-references
- Update indices
6. **Post-Processing**
- Update tree statistics:
- Increment node_count
- Update total_deltaS
- Recalculate avg_deltaS
- Track max_depth
- Check for patterns:
- Detect loops (recursive patterns)
- Identify clusters (related nodes)
- Find bridges (connection points)
- Trigger compression if node_count > threshold
- Update `.wfgy/context.json`
Output Format
✓ Semantic Node Recorded
═══════════════════════════════════════
Node ID: [node_id]
Topic: $TOPIC
Timestamp: [ISO_8601]
Metrics:
- ΔS (Tension): [value] [Low/Medium/High]
- λ (Direction): [symbol] [convergent/divergent/recursive]
- E (Resonance): [value]
- Confidence: [percentage]%
Module Used: [BBMC/BBPF/BBCR/BBAM]
Insight: [encoded reasoning]
Tree Status:
- Active Tree: [tree_name]
- Total Nodes: [count]
- Avg Tension: [value]
- Memory Usage: [size]
Related Nodes:
• [Previous topic] (ΔS: [value])
• [Related topic] (ΔS: [value])
Recording Patterns
Common node types:
- **Insight Nodes**: Major realizations (high ΔS)
- **Bridge Nodes**: Connections between concepts
- **Checkpoint Nodes**: Stable states for recovery
- **Decision Nodes**: Choice points in reasoning
- **Error Nodes**: Failed paths (for learning)
Integration
Works with:
- `/wfgy:formula-all` for comprehensive analysis
- `/semantic:tree-view` to see node in context
- `/boundary:detect` to check knowledge limits
- `/memory:compress` when tree gets large
Read more
tools: - read - write - edit - grep arguments: $TOPIC
Semantic Node Builder
Create and record semantic nodes in the active WFGY tree to capture reasoning insights and maintain memory.
Based on the WFGY project: https://github.com/onestardao/WFGY
Instructions
1. **Prepare Node Context**
- Parse topic from "$TOPIC" or auto-detect from context
- Read active tree from `.wfgy/trees/active_tree.json`
- Load previous node for reference
- Get current context from `.wfgy/context.json`
2. **Calculate Semantic Metrics**
- Generate embedding for current topic
- Compare with previous node embedding
- Calculate ΔS (semantic tension): ΔS = 1 - cos(θ)
- Determine λ_observe (logic direction):
- → (convergent): Building on previous (ΔS < 0.4)
- ← (divergent): New direction (ΔS > 0.6)
- <> (recursive): Returning to earlier (pattern match)
- × (chaotic): Unstable (ΔS > 0.9)
- Calculate E_resonance (stability measure)
3. **Identify Active Module**
- Analyze which WFGY module is primary:
- BBMC: If minimizing residue
- BBPF: If exploring multiple paths
- BBCR: If recovering from failure
- BBAM: If optimizing attention
- Record module attribution for traceability
4. **Build Node Structure**
{
"id": "node_[timestamp]_[hash]",
"timestamp": "ISO_8601",
"topic": "$TOPIC",
"module": "BBMC|BBPF|BBCR|BBAM",
"metrics": {
"deltaS": 0.XX,
"lambda": "→|←|<>|×",
"e_resonance": 0.XX,
"confidence": 0.XX
},
"content": {
"insight": "Encoded reasoning conclusion",
"context": "Surrounding context",
"keywords": ["key1", "key2", "key3"]
},
"relationships": {
"parent_id": "previous_node_id",
"references": [],
"bridges_to": []
}
}5. **Apply Recording Logic**
- Check recording criteria:
- Primary: ΔS > 0.6 (always record)
- Secondary: ΔS ∈ [0.4, 0.6] AND λ ∈ {←, <>}
- Forced: User explicitly requests
- If criteria met:
- Append node to tree
- Update tree metadata
- Create cross-references
- Update indices
6. **Post-Processing**
- Update tree statistics:
- Increment node_count
- Update total_deltaS
- Recalculate avg_deltaS
- Track max_depth
- Check for patterns:
- Detect loops (recursive patterns)
- Identify clusters (related nodes)
- Find bridges (connection points)
- Trigger compression if node_count > threshold
- Update `.wfgy/context.json`
Output Format
✓ Semantic Node Recorded ═══════════════════════════════════════ Node ID: [node_id] Topic: $TOPIC Timestamp: [ISO_8601] Metrics: - ΔS (Tension): [value] [Low/Medium/High] - λ (Direction): [symbol] [convergent/divergent/recursive] - E (Resonance): [value] - Confidence: [percentage]% Module Used: [BBMC/BBPF/BBCR/BBAM] Insight: [encoded reasoning] Tree Status: - Active Tree: [tree_name] - Total Nodes: [count] - Avg Tension: [value] - Memory Usage: [size] Related Nodes: • [Previous topic] (ΔS: [value]) • [Related topic] (ΔS: [value])
Recording Patterns
Common node types:
- **Insight Nodes**: Major realizations (high ΔS)
- **Bridge Nodes**: Connections between concepts
- **Checkpoint Nodes**: Stable states for recovery
- **Decision Nodes**: Choice points in reasoning
- **Error Nodes**: Failed paths (for learning)
Integration
Works with:
- `/wfgy:formula-all` for comprehensive analysis
- `/semantic:tree-view` to see node in context
- `/boundary:detect` to check knowledge limits
- `/memory:compress` when tree gets large
A comprehensive development toolkit designed following Anthropic's Claude Code Best Practices for AI-assisted software development.
Repo: qdhenry/Claude-Command-Suite
Other commands on claude-command-suite.
- /boundary-bbcr-fallback
Execute automatic BBCR (Collapse-Rebirth Correction) when knowledge boundaries are exceeded or reasoning fails.
Open command - /boundary-detect
Analyze semantic position relative to knowledge boundaries to prevent hallucination and identify uncertainty zones.
Open command - /boundary-heatmap
Generate a visual heatmap of knowledge boundaries showing safe zones, risk areas, and semantic coverage.
Open command - /boundary-risk-assess
Evaluate the current risk level and provide detailed analysis of potential hallucination or reasoning failure.
Open command - /boundary-safe-bridge
Find and construct semantic bridges to safely navigate from current position to target concept without crossing dangerous boundaries.
Open command - /optimize-prompt
Takes an input prompt and returns ONLY a token-optimized version that preserves meaning while minimizing token count. Based on LLM tokenization principles: common words tokenize more efficiently, unusual words break into more tokens, and conciseness reduces cost.
Open command

