Borrowing it
Nothing to install: this file belongs to Flexonze/claude-init. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Flexonze/claude-init/main/.claude/skills/generate-db-diagram/SKILL.mdgit clone --depth 1 https://github.com/Flexonze/claude-initWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/flexonze/claude-init/generate-db-diagram)<a href="https://agentmods.dev/skills/flexonze/claude-init/generate-db-diagram"><img src="https://agentmods.dev/badge/skills/flexonze/claude-init/generate-db-diagram.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00011 | $0.00757 |
| Opus 5 | $0.00005 | $0.00378 |
| Sonnet 5 | $0.00002 | $0.00151 |
| Haiku 4.5 | $0.00001 | $0.00076 |
Grade A, and why
generate-db-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 8d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Generate Database Diagram
Generate a Mermaid class diagram representing the database schema related to: $ARGUMENTS
Instructions
1. Identify Relevant Models/Tables
Search the codebase for models, entities, or schema definitions related to the specified feature.
Guidelines
- Focus on the core tables/models needed to understand the feature's data structure
- If a feature has many related models, prioritize the most important ones
- If uncertain about which models to include, err on the side of including related models
- Search thoroughly through the codebase to find all relevant schema definitions
2. Generate Mermaid Diagram
Follow these rules:
- Use Mermaid class diagram syntax
- Include only models directly related to the feature
- Show only important fields (exclude: id, created_at, updated_at, timestamps unless critical)
- Do NOT include field types UNLESS it's a relationship field
- For relationship fields, show them as:
FK to ModelName(foreign key / belongs to)O2O to ModelName(one-to-one)M2M to ModelName(many-to-many)
- Show relationships between models using Mermaid relationship syntax:
Model1 "1" --> "many" Model2 : relationship_nameModel1 "1" --> "1" Model2 : relationship_nameModel1 "many" --> "many" Model2 : relationship_name
- Keep it clean and focused on the feature's data structure
Example Output
classDiagram
class Project {
name
description
status
owner FK to User
}
class Task {
title
completed
project FK to Project
assignee FK to User
}
class User {
email
name
}
Task "many" --> "1" Project : project
Task "many" --> "1" User : assignee
Project "many" --> "1" User : owner
3. Generate the Diagram Image
- Create a PNG image:
.claude/outputs/db-diagram-<feature-name>.png(use kebab-case) - Create the
.claude/outputs/directory with a.gitkeepif it doesn't exist - No temporary files needed - pipe directly to mermaid-cli
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.
- 8d ago First seen · 104 lines · 11 tokens per session scan A 03a0b8702c8f
generate-db-diagram is a skill published in the GitHub repository Flexonze/claude-init (10 stars, last pushed 5mo ago), licensed MIT. It adds 11 tokens to every session and 757 once invoked, about $0.0001 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.
Other skills, from other repositories
add-sample-data
Use when the user wants to seed Dataverse tables with realistic sample records so a freshly-scaffolded code app shows real-looking data on first launch. Generates contextually appropriate rows from each table's schema and inserts them in dependency order. Mirrors…
setup-datamodel
Use when the user wants to design or redesign the Dataverse schema and connector plan for an existing mobile app, or has an ER diagram (image, Mermaid, or text) to apply. Skip when the user is creating a brand-new app — /create-mobile-app handles the data model inline.
add-dataverse
Adds Dataverse tables to a Power Apps code app with generated TypeScript models and services. Can also create new Dataverse tables. Use when connecting to Dataverse, adding tables, creating schema, or querying Dataverse data.
jpa-patterns
JPA/Hibernate patterns and common pitfalls (N+1, lazy loading, transactions, queries). Use when user has JPA performance issues, LazyInitializationException, or asks about entity relationships and fetching strategies.
ecto-patterns
Ecto patterns — schemas, changesets, queries, migrations, Multi, associations, preloads, upserts. Use when editing Repo calls, Ecto.Query, or schema fields. Skip for Ash.
phoenix-contexts
Phoenix context design — creating/splitting contexts, Scope (1.8+), Ecto.Multi, PubSub, routers, plugs, controllers. Use when editing contexts, routers, or designing boundaries.