generate-db-diagram
Generate database diagram for a feature
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Generate database diagram for a feature
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Explain how code, a feature, or system works
Generate a commit message for staged changes
Generate PR title and description
Generate sequence diagram for a feature
Get a general understanding of the codebase (stack, key files, structure, etc) and/or specific feature
Update the changelog based on commits in the current git branch
| name | generate-db-diagram |
| description | Generate database diagram for a feature |
| argument-hint | ["feature-name"] |
| disable-model-invocation | true |
| allowed-tools | Bash(npx *) |
Generate a Mermaid class diagram representing the database schema related to: $ARGUMENTS
Search the codebase for models, entities, or schema definitions related to the specified feature.
Follow these rules:
FK to ModelName (foreign key / belongs to)O2O to ModelName (one-to-one)M2M to ModelName (many-to-many)Model1 "1" --> "many" Model2 : relationship_nameModel1 "1" --> "1" Model2 : relationship_nameModel1 "many" --> "many" Model2 : relationship_nameclassDiagram
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
.claude/outputs/db-diagram-<feature-name>.png (use kebab-case).claude/outputs/ directory with a .gitkeep if it doesn't existnpx @mermaid-js/mermaid-cli using stdin:
mkdir -p .claude/outputs && touch .claude/outputs/.gitkeep && cat << 'EOF' | npx -y @mermaid-js/mermaid-cli -i - -o .claude/outputs/db-diagram-<feature-name>.png
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
EOF
.claude/outputs/db-diagram-<feature-name>.png