causal-loop-diagram-generator
Generate complete causal-loop-diagram (CLD) infrastructure for an MkDocs Material site — a progressive build-up article that introduces each reinforcing and balancing loop in its own interactive vis-network diagram, plus the shared cld-viewer for fullscreen exploration. Use this skill whenever the user wants a CLD article, a systems-thinking diagram, a feedback-loop diagram, an article about reinforcing or balancing loops, a "limits to growth" or "tragedy of the commons" or other systems archetype, or any time they describe a topic where one runaway dynamic competes with stabilizing forces (AI scaling, supply chain bullwhip, climate feedback, addiction, virality). Also use when the user mentions "make me a CLD", "draw the loops", "model the dynamics", "show the system", or asks to extend an existing CLD article with a new loop. The skill produces interactive, draggable, vis-network-based diagrams — NOT static images, NOT mermaid, NOT ASCII art.
What this skill does
# Causal Loop Diagram Generator
This skill produces a complete, working multi-CLD article for an MkDocs Material site. The output is a set of files that together render an article where each section discusses one feedback loop and shows it as an interactive draggable diagram, building up to a full-system view at the end.
## What the user gets
When invoked on a topic (say, "make me a CLD article about supply chain bullwhip"), the skill produces:
1. **One JSON file per loop** (`docs/sims/cld-viewer/examples/<id>-cld.json`) — usually 3–5 nodes each, one per archetype loop in the topic.
2. **One full-system JSON** combining all loops around a shared central node.
3. **The article markdown** (`docs/articles/<slug>.md`) — progressive build-up, one section per loop, with inline interactive diagrams and a fullscreen-button per diagram.
4. **The shared infrastructure** (`docs/articles/cld-inline.js`, `docs/sims/cld-viewer/`) if not already present in the project.
5. **Updated `mkdocs.yml`** nav entries.
Every diagram is a live vis-network instance the reader can drag, zoom, and click to inspect. Not a static image.
## When to use this skill
Trigger on requests for any of:
- "Make a causal loop diagram for X"
- "Write an article about [the runaway dynamic in X]"
- "Show the feedback loops in X"
- "Add a CLD article to my site"
- A topic that has one or more reinforcing loops competing with balancing ones (AI race, virality, addiction, supply chain bullwhip, market dynamics, climate, organizational dysfunction)
If the user just wants a single quick diagram — not an article — generate just one CLD JSON and embed it inline; skip the article structure.
## High-level workflow
1. **Understand the system.** Ask clarifying questions if the topic is ambiguous, but a single sentence is usually enough to draft a plausible loop set. List the candidate reinforcing loops (R1, R2, …) and balancing loops (B1, B2, …) before writing any JSON. Show the list to the user and confirm before generating files.
2. **Verify the project layout.** Determine the project root (look for `mkdocs.yml`). Confirm or create:
- `docs/articles/` (article location)
- `docs/sims/cld-viewer/examples/` (CLD JSON location)
- `docs/articles/cld-inline.js` (inline renderer)
- `docs/sims/cld-viewer/main.html` + `cld-viewer.js` + the four R/B PNGs (fullscreen viewer)
3. **Port missing assets.** Copy the bundled assets from this skill's `assets/` directory if any are missing. See the "Bundled assets" section below for the exact file map.
4. **Generate one JSON per loop.** Read [references/json-schema.md](references/json-schema.md) and [references/layout-templates.md](references/layout-templates.md). Use the 3-node triangle template for simple loops, 4-node diamond for richer ones, hub-and-spoke for the full system.
5. **Write the article.** Follow [references/article-structure.md](references/article-structure.md) — frontmatter, lead, anchor example, R-loops, B-loops, status table, full system, leverage point, signals, bottom line. Required `<style>` and `<script src="../cld-inline.js">` block at the bottom.
6. **Update `mkdocs.yml`.** Add a nav entry for the new article. If `cld-viewer/index.md` doesn't exist yet, add it under MicroSims.
7. **Read [references/pitfalls.md](references/pitfalls.md) before changing anything in `cld-inline.js`, `cld-viewer.js`, or the rendering setup.** Nine specific footguns are documented — they each cost real debugging hours to find. The most important one: never use one iframe per inline diagram; both Chrome and Firefox silently fail to render past the 5th–6th iframe on a single page, and there is no client-side workaround.
## Bundled assets
Everything you need to install into a fresh project lives in `assets/`:
```
assets/
├── cld-inline.js # Inline vis-network renderer for article pages.
│ # Copy to: docs/articles/cld-inline.js
└── cld-viewer/
├── main.html # Fullscreen viewer page (used by the iframe
│ # buttons in the article). Has menu mode for
│ # sample buttons + Save/Copy positions.
├── cld-viewer.js # Fullscreen viewer's JS — loads JSON, renders
│ # network, handles drag/zoom/save.
├── reinforcing-loop-cw.png # R/B archetype icons referenced in the
├── reinforcing-loop-ccw.png # systems-thinking schema. Optional but copy
├── balancing-loop-cw.png # them through if the project will use loop
├── balancing-loop-ccw.png # iconography.
└── examples/
├── ai-flywheel-cld.json # 4-node diamond, single reinforcing loop.
├── runaway-hypothesis-cld.json # 3-node triangle, single reinforcing loop.
└── winner-takes-all-cld.json # 17 nodes, 8 loops, hub-and-spoke.
# Use as a model for full-system diagrams.
```
## Reference docs
Loaded as needed, in roughly this order:
- **[references/json-schema.md](references/json-schema.md)** — the CLD JSON format. Read first when generating loops.
- **[references/layout-templates.md](references/layout-templates.md)** — coordinate templates for 3-, 4-, 5-node loops and for hub-and-spoke. Read when placing nodes.
- **[references/article-structure.md](references/article-structure.md)** — section-by-section template for the article markdown, including the required `<style>` + `<script>` boilerplate. Read when writing the article.
- **[references/pitfalls.md](references/pitfalls.md)** — nine documented footguns with symptoms, root causes, and solutions. Read before modifying any rendering code or attempting an iframe-based design.
## Default loop count
When the user gives only a topic and asks for "a CLD article," default to:
- 1 anchor example (the canonical loop everyone agrees on)
- 3–4 reinforcing loops (the runaway dynamics)
- 3–4 balancing loops (the constraints)
- 1 full-system diagram
That's 8–10 diagrams total, matching the reference Winner-Takes-All article. If the topic has fewer real dynamics, scale down — don't pad. If the user asks for "a quick diagram" or "just one loop," produce one CLD JSON and a single inline embed; skip the article scaffolding entirely.
## Naming conventions
- CLD ids: lowercase, hyphenated, ending in `-cld`. Example: `bullwhip-amplification-cld`.
- Article slug: short, hyphenated, descriptive. Example: `supply-chain-bullwhip.md`.
- Loop labels: `R1: Recursive Self-Improvement`, `B1: Compute Constraint`. Always use `R<n>` for reinforcing and `B<n>` for balancing.
## What NOT to do
- **Do not embed diagrams as iframes inline in the article.** Use `<div class="cld-inline">` and the inline renderer. See [pitfalls.md](references/pitfalls.md) #1.
- **Do not use mermaid, ASCII art, or static images** for the loops. The whole point of this skill is interactive vis-network diagrams readers can drag.
- **Do not soften the `border: 2px solid blue`** on iframes or `.cld-inline` divs. It's the project-wide MicroSim standard signaling interactive content. See [pitfalls.md](references/pitfalls.md) #8.
- **Do not modify the global `iframe` CSS rule** in `extra.css` to "look nicer." Same reason.
- **Do not skip the `<script src="../cld-inline.js">` tag** at the bottom of the article. Without it, every `<div class="cld-inline">` is an empty bordered box.
## Confirming with the user
After you've drafted the loop list (step 1) but *before* generating files, show the user the proposed loop set with one-line descriptions. They almost always have an opinion on which loops to include and what to call them, and it's much cheaper to revise the list than to revise 8 JSON files.
After generating, tell the user the file paths, what `mkdocs.yml` changes you made, and remind them they can use the cld-viewer's "Save Positions" button to drag nodes into nicer positions and download an updated JSONRelated in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".