Causal Loop MicroSim Generator
Overview
The causal-loop-microsim-generator skill creates interactive Causal Loop Diagram (CLD) MicroSims using the vis-network JavaScript library for systems thinking education. Each MicroSim visualizes cause-and-effect relationships, feedback loops, and system dynamics through an interactive node-edge diagram that can be embedded via iframe in educational content.
Purpose
This skill transforms complex system dynamics into interactive, explorable visualizations that enable students to understand feedback loops, reinforcing and balancing dynamics, and cause-and-effect relationships. CLDs are fundamental tools in systems thinking, helping learners recognize patterns in complex systems and identify intervention points.
Key Features
- Interactive Causal Diagrams: Node-link diagrams showing causal relationships with polarity indicators
- Feedback Loop Visualization: Reinforcing (R) and Balancing (B) loop indicators with automatic placement
- Polarity Indicators: Green (+) for positive relationships, Red (-) for negative relationships
- Click-to-Detail: Interactive panels showing node, edge, and loop descriptions
- Systems Archetypes: Support for common patterns like "limits to growth", "fixes that fail", "shifting the burden"
- Educational Content: Built-in discussion questions, key insights, and learning objectives
- MicroSim Architecture: Standardized patterns for iframe embedding at 500px height
- Width Responsive: Adapts to container width with re-centering
When to Use
Use this skill when users need to:
- Create causal loop diagrams for systems thinking courses
- Visualize feedback loops in business, ecology, or social systems
- Explain reinforcing and balancing dynamics
- Demonstrate systems archetypes (limits to growth, tragedy of the commons, etc.)
- Build interactive cause-and-effect visualizations
- Teach system dynamics concepts
Common Trigger Phrases
- "Create a CLD showing..."
- "Visualize the feedback loops in..."
- "Build a causal loop diagram for..."
- "Show the reinforcing loop between..."
- "Create a systems thinking diagram of..."
- "Generate a causal diagram showing..."
MicroSim Architecture
Educational MicroSims occupy the intersection of:
- Simplicity: Focused scope, transparent code
- Accessibility: Browser-native, universal embedding
- AI Generation: Standardized patterns, prompt-compatible design
Folder Structure
Each causal loop MicroSim contains:
1 2 3 4 5 6 | |
Educational Requirements Specification
Before generating, the skill gathers:
- MicroSim Name: kebab-case identifier (e.g.,
ai-flywheel,climate-feedback) - Title: Display title for the diagram
- Description: What system is being modeled
- Nodes: Variables in the system with descriptions
- Edges: Causal relationships with polarity (positive/negative)
- Loops: Feedback loop identification (reinforcing R or balancing B)
CLD Concepts
Causal Relationships (Edges)
- Positive Polarity (+): "More of A leads to more of B" (same direction change)
- Negative Polarity (-): "More of A leads to less of B" (opposite direction change)
Feedback Loop Types
| Type | Symbol | Behavior | Example |
|---|---|---|---|
| Reinforcing | R | Exponential growth or collapse | Viral adoption, compound interest |
| Balancing | B | Goal-seeking, stability | Thermostat, predator-prey equilibrium |
Loop Determination Rules
- Reinforcing Loop: All edges same polarity OR even number of negative edges
- Balancing Loop: Odd number of negative edges in the loop
Systems Thinking Archetypes
The skill recognizes and can generate common systems archetypes:
| Archetype | Loops | Pattern |
|---|---|---|
limits-to-growth |
R + B | Growth eventually limited by constraint |
fixes-that-fail |
B + R | Quick fix creates side effects |
shifting-the-burden |
2B + R | Symptomatic vs fundamental solution |
success-to-the-successful |
2R | Winner-take-all dynamics |
tragedy-of-the-commons |
Multiple R + B | Shared resource depletion |
escalation |
2R | Arms race pattern |
drifting-goals |
B + R | Standards erosion over time |
JSON Data Schema
The data.json file follows a comprehensive schema:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
Node Types
| Type | Description | Use Case |
|---|---|---|
stock |
Accumulation variable | Resources, inventory, population |
variable |
Flow or rate variable | Rates, decisions, activities |
parameter |
External constant | Policies, fixed factors |
Node Positioning Guidelines
The skill uses these positioning patterns for clean layouts:
Canvas Dimensions
- Standard canvas: 600x600 pixels
- Center point: (300, 300)
- Margin: 100px from edges
Layout Patterns
3-Node Triangle:
1 2 3 | |
4-Node Diamond:
1 2 3 4 | |
5-Node Pentagon:
1 2 3 4 5 | |
Visual Configuration
Polarity Colors
- Positive (+): Green
#28a745 - Negative (-): Red
#dc3545
Loop Indicators
- Reinforcing (R): Red ellipse background
#dc3545 - Balancing (B): Green ellipse background
#28a745
Edge Curves
Curves prevent edge overlap:
1 2 3 4 5 6 | |
Interactive Features
Click Events
- Node Click: Shows variable details (type, description, examples)
- Edge Click: Shows relationship details (polarity, strength, delay)
- Loop Click: Shows loop information (type, path, behavior pattern)
URL Parameters
menu=true: Show header and details panel (default hidden for iframe)file=filename: Load a specific JSON file
Educational Content Features
The skill generates:
Learning Objectives (Bloom's Taxonomy)
- Remember: Identify loop types and polarity
- Understand: Explain causal relationships
- Apply: Predict system behavior
- Analyze: Identify leverage points
- Evaluate: Assess intervention strategies
- Create: Design system modifications
Discussion Questions
Generated questions explore "what if" scenarios, challenge assumptions, and connect to real-world examples.
Key Insights
Highlights non-obvious relationships, counterintuitive behaviors, delay effects, and unintended consequences.
Best Practices
Diagram Design
- Start Simple: Begin with core feedback loop, add complexity gradually
- Clear Labels: Use concise, descriptive variable names (max 20 characters)
- Meaningful Relationships: Include only significant causal links
- Loop Labels: Name loops descriptively (e.g., "Growth Engine", "Quality Control")
Educational Value
- Context: Explain what real-world system the CLD represents
- Guided Exploration: Provide questions to focus investigation
- Intervention Points: Identify where to apply leverage
- Assessment: Include comprehension questions
Accessibility
- Color and Symbol: Use both color and +/- symbols for polarity
- Click Details: Provide text descriptions for all elements
- Legend: Include legend explaining visual conventions
- Alternative Text: Document provides text-based alternative
Output Files
- index.md: Documentation with iframe embed, learning objectives, and explanation
- main.html: HTML container with vis-network CDN and layout structure
- [sim-name].js: JavaScript code for loading data and rendering the CLD
- data.json: Complete CLD data with nodes, edges, loops, and educational content
- style.css: CSS for layout, legend, and details panel styling
Post-Generation Actions
After generating files, the skill reminds users to:
- Take a screenshot and save as
[sim-name].pngin the MicroSim directory - Update
mkdocs.ymlnavigation (entries should be alphabetically ordered) - Test the iframe embed in the documentation page
Integration with Other Skills
Primary Integrations:
- microsim-p5: For more complex dynamic simulations with animation
- vis-network: Base library for network visualization
- learning-graph-generator: Can visualize concept dependencies as CLD
Content Integrations:
- chapter-content-generator: Embed CLDs in systems thinking chapters
- quiz-generator: Create questions about system dynamics
- glossary-generator: Link CLD terms to glossary definitions
Technical Requirements
- vis-network.js: Loaded from CDN (unpkg.com)
- Modern Browser: Chrome, Firefox, Safari, Edge
- No Server: Runs entirely client-side
- Responsive: Container-based sizing
Example Use Cases
- AI Adoption Flywheel: Reinforcing loop of AI usage → data → accuracy → adoption
- Climate Feedback: Multiple loops showing warming → ice melt → albedo effects
- Technical Debt: Balancing pressures of speed vs. quality in software development
- Market Dynamics: Supply and demand with price equilibration
- Learning Curve: Skill → productivity → practice time feedback
Troubleshooting
Issue: Loops not displaying correctly
Solution: Verify loop paths form complete cycles, check polarity count for loop type
Issue: Edges overlapping
Solution: Use opposite curve directions (curvedCW/curvedCCW) for parallel edges
Issue: Nodes too close together
Solution: Adjust position coordinates, maintain 150px minimum spacing
Issue: Details panel not updating
Solution: Verify click handlers in JavaScript, check element IDs match
References
- vis-network Documentation: https://visjs.github.io/vis-network/docs/network/
- Systems Thinking Archetypes: Senge, P. (1990) The Fifth Discipline
- Causal Loop Diagrams: Sterman, J. (2000) Business Dynamics
- System Dynamics Society: https://systemdynamics.org/