generate-er-diagram

A tool for creating Entity-Relationship diagrams, which show data entities, their key fields, and the links between them, from Cortex data products. It can produce Mermaid, Graphviz DOT, or draw.io XML output.

In plain words
What is it for?
Use it to generate a diagram after choosing an output format and locating the target data product.
Why use it?
It turns data-product definitions into a visual model, making the structure and relationships easier to inspect or share.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/googlecloudplatform/cortex-framework/generate_er_diagram
Any agent
npx skills add GoogleCloudPlatform/cortex-framework --skill generate_er_diagram
Clone the repo
git clone --depth 1 https://github.com/GoogleCloudPlatform/cortex-framework

Made for: Claude Code, Codex.

Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,017 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00034 $0.01017
Opus 5 $0.00017 $0.00508
Sonnet 5 $0.00007 $0.00203
Haiku 4.5 $0.00003 $0.00102

Measured 2d ago against content hash b13931966929, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

generate-er-diagram scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/generate_er_diagram.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/generate_er_diagram/SKILL.md · 69 lines

How it starts

The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Generating Entity-Relationship (ER) Diagrams

This skill allows agents to automatically generate clean, structured Entity-Relationship (ER) diagrams from one or more Cortex data products. The diagrams represent data models, primary keys, and relationships inferred from the data product's manifest, annotations, and definitions.


Core Operating Behaviors

When asked to generate an ER diagram for a data product:

  1. Establish Output Format (CRITICAL):

    • You MUST check if the user has specified the desired format for the ER diagram (e.g., dot, mermaid, draw.io, or all).
    • If the format is not specified, you MUST explicitly ask the user:

      "Which format would you like to use for the ER diagram?

      1. Mermaid diagram (.mmd) - Best for quick markdown integration (also creates a .md file for immediate visual preview)
      2. Graphviz dot notation (.dot) - Best for custom graph rendering
      3. draw.io XML (.drawio) - Best for importing directly into draw.io as an interactive layout
      4. All formats - Generates Mermaid, DOT, and draw.io diagrams concurrently"
    • Wait for the user's choice before executing the generator.
  2. Locate target data product:

    • Determine the name or folder of the data product to analyze. If it is not specified, look inside src/data_modules/<namespace>/<source>/products/ for available products.
  3. Execute the generator script:

    • Use the virtualenv Python interpreter to run the tool:
      cortex-framework-core/.venv/bin/python external-skills/.agents/skills/generate_er_diagram/scripts/generate_er_diagram.py -p <data_product_path_or_name> -f <mermaid|dot|drawio> [options]
      
    • Optional Flags:
      • --include-siblings: Include sibling data products in the same namespace to map cross-product relationships. (Disabled by default to prevent oversized diagrams).
      • --all-foundation-fields: Render all fields for foundation tables (by default only keys and relationship-participating fields are shown to avoid clutter).
      • --all-data-product-fields: Render all fields for data product tables (by default only keys and relationship-participating fields are shown to avoid clutter).
    • Note: If the user selects All formats, execute the generator command three times sequentially, once for each format option (mermaid, dot, drawio).

Read the full file on GitHub · 69 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 69 lines · 34 tokens per session scan A b13931966929

Subscribe to this mod's changes

generate-er-diagram is a skill published in the GitHub repository GoogleCloudPlatform/cortex-framework (10 stars, last pushed 7d ago), licensed Apache-2.0. It adds 34 tokens to every session and 1,017 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

agent-platform-deploy

Deploy open models or custom weights from Model Garden to Agent Platform endpoints, check the status of an in-progress deployment operation, or clean up resources by undeploying models and deleting endpoints. Use when asked to actively deploy a model, list the Model Garden CATALOG of available models, check if a…

google/skills · 193 tokens

agent-platform-tuning

Agent Platform Model Tuning. Use when you need to fine-tune open models or Gemini models using Agent Platform infrastructure. Don't use for model training outside Agent Platform, model deployment to endpoints (use agent-platform-deploy), or managing serving endpoints (use agent-platform-endpoint-management).

google/skills · 64 tokens

application-design-center-design-deploy

Processes GCP infrastructure design and deployment workflows within Application Design Center (ADC). Use when: - Designing GCP infrastructure with Terraform. - Validating local HCL. - Performing best-practice plan scans. - Importing templates to Application Design Center (ADC). - Deploying templates. - Troubleshooting…

google/skills · 94 tokens

cloud-run-basics

Manages Cloud Run services, jobs, and worker pools. Use when you need to deploy applications responding to HTTP requests (services), run event-triggered or scheduled tasks (jobs), or handle always-on pull-based background processing (worker pools).

google/skills · 53 tokens

gcloud

Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations across Google Cloud Platform (GCP) services and infrastructure. Use when planning, generating, constructing, proposing, describing, or executing any gcloud CLI commands - including when answering questions about gcloud…

google/skills · 81 tokens

gemini-agents-api

Manages custom Agent resources on Gemini Enterprise Agent Platform. Use when the user wants to programmatically create, configure, list, update, or delete stateful, server-managed Agent resources (including mounting files, skills, and tools) before executing conversations.

google/skills · 56 tokens