Agent skill

Data Model

by gjovanovicst in gjovanovicst/golang-auth-api

All 17 GORM database models with fields, relationships, indexes, and the entity relationship diagram for the Auth API.

MITAuto-check passedBackend & APIs

Install Data Model

skills CLI
$ npx skills add gjovanovicst/golang-auth-api --skill data-model -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install gjovanovicst/golang-auth-api data-model --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/gjovanovicst/golang-auth-api.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.opencode/skills/data-model .claude/skills/data-model && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
data-model
GitHub stars
129
Token cost
~2.7k tokens
SKILL.md length
826 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

All 17 GORM database models with fields, relationships, indexes, and the entity relationship diagram for the Auth API.

  • Works in 6 steps: UUID PKs everywhere except SystemSetting… → Multi-tenancy via AppID on User,… → Default sentinel AppID:… → …
  • Tasks that involve Diagrams
  • SKILL.md covers Overview, Entity Relationship Diagram, Models and Cross-Cutting Patterns, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Data Model is an agent skill from gjovanovicst/golang-auth-api. All 17 GORM database models with fields, relationships, indexes, and the entity relationship diagram for the Auth API.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Diagrams and Authentication. It works with PostgreSQL. The repository describes itself as: A modern, production-ready Go REST API for authentication and authorization, featuring social login, email verification, JWT, and Redis integration. The licence is MIT.

When your agent uses it

  • Tasks that involve Diagrams
  • Tasks that involve Authentication

Example prompts

  • “/data-model”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. UUID PKs everywhere except SystemSetting (string) and SchemaMigration (uint)
  2. Multi-tenancy via AppID on User, SocialAccount, ActivityLog, Role, OAuthProviderConfig, EmailServerConfig, EmailTemplate, ApiKey…
  3. Default sentinel AppID: 00000000-0000-0000-0000-000000000001
  4. Sensitive field hiding: All secrets use json:"-"
  5. Composite unique indexes enforce per-app uniqueness
  6. Nullable AppID enables global-vs-app-specific resolution (EmailTemplate, EmailServerConfig)

What it can do on your machine

Read from SKILL.md and the folder at commit 795d18d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Data Model loads about 2.7k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 826 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from gjovanovicst/golang-auth-api at commit 795d18d, republished under its MIT licence (© gjovanovicst). 826 words, ~2,719 tokens.

Download SKILL.mdSave it as .claude/skills/data-model/SKILL.md (or your agent's skills folder).
name
data-model
description
All 17 GORM database models with fields, relationships, indexes, and the entity relationship diagram for the Auth API.
license
MIT

Overview

All models are in pkg/models/. The project uses PostgreSQL with GORM. All models except SystemSetting and SchemaMigration use UUID primary keys (gen_random_uuid()). Sensitive fields use json:"-" to prevent API exposure.

Entity Relationship Diagram

Tenant
  |-- has-many --> Application
                      |-- has-many --> OAuthProviderConfig
                      |-- has-one  --> EmailServerConfig (nullable AppID)
                      |-- has-many --> ApiKey (ON DELETE CASCADE)
                      |-- has-many --> Role (via AppID)
                      |-- has-many --> EmailTemplate (nullable AppID)
                      |-- has-many --> WebAuthnCredential (nullable AppID)

User (scoped to AppID)
  |-- has-many --> SocialAccount
  |-- has-many --> UserRole
  |-- has-many --> ActivityLog (implicit)
  |-- has-many --> WebAuthnCredential (nullable UserID)

Role (scoped to AppID)
  |-- many-to-many --> Permission (join table: role_permissions)

UserRole (join table)
  |-- belongs-to --> User
  |-- belongs-to --> Role

EmailTemplate
  |-- belongs-to --> EmailType
  |-- belongs-to --> EmailServerConfig (nullable)

AdminAccount (standalone, system-level)
  |-- has-many --> WebAuthnCredential (via AdminID)

SystemSetting (standalone key-value store)
SchemaMigration (standalone migration tracker)

Models

User (pkg/models/user.go)

Table: users

FieldTypeKey TagsNotes
IDuuid.UUIDprimaryKey
AppIDuuid.UUIDuniqueIndex:idx_email_app_idDefault: 00000000-...0001
EmailstringuniqueIndex:idx_email_app_idComposite unique with AppID
PasswordHashstringjson:"-"
EmailVerifiedboolDefault: false
IsActiveboolDefault: true
Name, FirstName, LastNamestring
ProfilePicturestringURL from social login
Localestring
TwoFAEnabledbool
TwoFAMethodstring"totp" or "email"
TwoFASecretstringjson:"-" encrypted
TwoFARecoveryCodesdatatypes.JSONtype:jsonbjson:"-" encrypted
SocialAccounts[]SocialAccountforeignKey:UserIDHas-Many
Tenant (pkg/models/tenant.go)

Table: tenants

FieldTypeNotes
IDuuid.UUID
Namestring
Apps[]ApplicationforeignKey:TenantID Has-Many
Application (pkg/models/application.go)

Table: applications

FieldTypeNotes
IDuuid.UUID
TenantIDuuid.UUIDFK to Tenant
Namestring
Descriptionstring
TwoFAIssuerNamestringCustom name in authenticator apps
TwoFAEnabledboolMaster switch for 2FA
TwoFARequiredboolForce all users to set up 2FA
Email2FAEnabledboolEmail-based 2FA toggle
Passkey2FAEnabledboolPasskey as 2FA method
PasskeyLoginEnabledboolPasswordless login via passkey
MagicLinkEnabledboolPasswordless login via magic link
TwoFAMethodsstringComma-separated: "totp", "email", "passkey"
OAuthProviderConfigs[]OAuthProviderConfigforeignKey:AppID Has-Many
EmailServerConfig*EmailServerConfigforeignKey:AppID Has-One
Role (pkg/models/role.go)

Table: roles

FieldTypeNotes
IDuuid.UUID
AppIDuuid.UUIDuniqueIndex:idx_role_app_name
NamestringuniqueIndex:idx_role_app_name
Descriptionstring
IsSystemboolCannot be deleted
Permissions[]Permissionmany2many:role_permissions
Permission (pkg/models/role.go, same file as Role)

Table: permissions

FieldTypeNotes
IDuuid.UUID
ResourcestringuniqueIndex:idx_permission_resource_action
ActionstringuniqueIndex:idx_permission_resource_action
Descriptionstring
UserRole (pkg/models/role.go, same file)

Table: user_roles

FieldTypeNotes
UserIDuuid.UUIDComposite PK with RoleID
RoleIDuuid.UUIDComposite PK with UserID
AppIDuuid.UUIDDenormalized for fast lookup
AssignedAttime.Time
AssignedBy*uuid.UUIDNullable
RoleRoleBelongs-To
UserUserBelongs-To
AdminAccount (pkg/models/admin_account.go)

Table: admin_accounts (explicit TableName())

FieldTypeNotes
IDuuid.UUID
UsernamestringuniqueIndex
EmailstringuniqueIndex
PasswordHashstringjson:"-"
LastLoginAt*time.Time
TwoFAEnabled, TwoFAMethodSame pattern as User
TwoFASecret, TwoFARecoveryCodesjson:"-"
MagicLinkEnabledbool

Standalone entity -- not scoped to any application.

SocialAccount (pkg/models/social_account.go)

Table: social_accounts

FieldTypeNotes
IDuuid.UUID
AppIDuuid.UUIDuniqueIndex:idx_provider_user_id_app_id
UserIDuuid.UUIDFK to User
Providerstring"google", "facebook", "github"
ProviderUserIDstringuniqueIndex:idx_provider_user_id_app_id
Email, Name, FirstName, LastNamestringFrom provider
Usernamestringe.g., GitHub login
RawDatadatatypes.JSONComplete raw JSON from provider
AccessToken, RefreshTokenstringjson:"-"

Composite unique: (AppID, Provider, ProviderUserID)

WebAuthnCredential (pkg/models/webauthn_credential.go)

Table: web_authn_credentials

FieldTypeNotes
IDuuid.UUID
UserID*uuid.UUIDSet for regular users (nullable)
AppID*uuid.UUIDSet for regular users (nullable)
AdminID*uuid.UUIDSet for admin passkeys (nullable)
CredentialID[]byteuniqueIndex, json:"-"
PublicKey[]bytejson:"-"
NamestringUser-friendly label
TransportsstringComma-separated: "usb,ble,nfc,internal"

Polymorphic ownership: regular users use UserID+AppID, admins use AdminID.

ActivityLog (pkg/models/activity_log.go)

Table: activity_logs (explicit TableName())

FieldTypeNotes
IDuuid.UUID
AppIDuuid.UUIDDefault: sentinel UUID
UserIDuuid.UUIDindex:idx_user_timestamp, index:idx_cleanup
EventTypestringIndexed
Timestamptime.Time
IPAddress, UserAgentstring
Detailsjson.RawMessagetype:jsonb
SeveritystringCRITICAL, IMPORTANT, INFORMATIONAL
ExpiresAt*time.Timeindex:idx_expires
IsAnomalybool
ApiKey (pkg/models/api_key.go)

Table: api_keys (explicit TableName())

FieldTypeNotes
IDuuid.UUID
KeyTypestring"admin" or "app"
Name, Descriptionstring
KeyHashstringSHA-256, uniqueIndex, json:"-"
KeyPrefixstringFirst 8 chars for display
KeySuffixstringLast 4 chars
AppID*uuid.UUIDRequired when key_type = "app"
ExpiresAt*time.TimeOptional
IsRevokedbool
Application*ApplicationON DELETE CASCADE
Show full SKILL.md (307 more words)Show less
EmailType (pkg/models/email_type.go)

Table: email_types (explicit TableName())

FieldTypeNotes
IDuuid.UUID
CodestringuniqueIndex (e.g., "email_verification")
Namestring
DefaultSubjectstring
Variablesdatatypes.JSONArray of EmailTypeVariable structs
IsSystemboolSystem types cannot be deleted
IsActivebool
EmailTemplate (pkg/models/email_template.go)

Table: email_templates (explicit TableName())

FieldTypeNotes
IDuuid.UUID
AppID*uuid.UUIDNULL = global default
EmailTypeIDuuid.UUIDuniqueIndex:idx_app_email_type
Subject, BodyHTML, BodyTextstring
TemplateEnginestring"go_template", "placeholder", "raw_html"
FromEmail, FromNamestringOptional sender override
ServerConfigID*uuid.UUIDOptional FK to EmailServerConfig
EmailTypeEmailTypeBelongs-To
ServerConfig*EmailServerConfigBelongs-To

Composite unique: (AppID, EmailTypeID) -- one template per type per app scope.

EmailServerConfig (pkg/models/email_server_config.go)

Table: email_server_configs (explicit TableName())

FieldTypeNotes
IDuuid.UUID
AppID*uuid.UUIDNULL = global/system config
NamestringLabel (e.g., "Transactional")
SMTPHost, SMTPPortstring, int
SMTPUsername, SMTPPasswordstringPassword: json:"-"
FromAddress, FromNamestring
UseTLSboolDefault: true
IsDefaultboolOne default per scope
IsActivebool
OAuthProviderConfig (pkg/models/oauth_provider_config.go)

Table: oauth_provider_configs (explicit TableName())

FieldTypeNotes
IDuuid.UUID
AppIDuuid.UUIDuniqueIndex:idx_app_provider
Providerstring"google", "facebook", "github"
ClientIDstring
ClientSecretstringjson:"-"
RedirectURLstring
IsEnabledbool
SystemSetting (pkg/models/system_setting.go)

Table: system_settings (explicit TableName())

FieldTypeNotes
KeystringString primary key (matches env var name)
Valuestring
CategorystringIndexed

Resolution: env var > DB value > hardcoded default.

SchemaMigration (pkg/models/schema_migration.go)

Table: schema_migrations (explicit TableName())

FieldTypeNotes
IDuintAuto-increment PK (only model not using UUID)
VersionstringuniqueIndex, YYYYMMDD_HHMMSS format
Namestring
ExecutionTimeMsint
Successbool
ChecksumstringSHA256 of migration file

Cross-Cutting Patterns

  1. UUID PKs everywhere except SystemSetting (string) and SchemaMigration (uint)
  2. Multi-tenancy via AppID on User, SocialAccount, ActivityLog, Role, OAuthProviderConfig, EmailServerConfig, EmailTemplate, ApiKey, WebAuthnCredential
  3. Default sentinel AppID: 00000000-0000-0000-0000-000000000001
  4. Sensitive field hiding: All secrets use json:"-"
  5. Composite unique indexes enforce per-app uniqueness
  6. Nullable AppID enables global-vs-app-specific resolution (EmailTemplate, EmailServerConfig)

When To Use This Skill

Load this skill when working on database models, migrations, repository queries, or any feature that touches data persistence.

© gjovanovicst, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .opencode/skills/data-model of gjovanovicst/golang-auth-api.

Open the folder on GitHubat commit 795d18d

Compare with similar skills

Data Model next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Data Model compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Data Model this skillgjovanovicst/golang-auth-api129—~2.7kAutomated safety check: PassMIT
Supabase Development and Debuggingsupabase/agent-skills2.7k3 repos~3.6kAutomated safety check: PassMIT
Supabasecurvenote/curvenote1695 repos~2.2kAutomated safety check: PassCustom licence
Nodejs Express Serverever-works/ever-works158—~965Automated safety check: PassAGPL-3.0
Fastapi Appccplugins/awesome-claude-code-plugins967—~1.1kAutomated safety check: NotesApache-2.0
Fastapi Init Skilljiushiwon/wg-skills110—~1.8kAutomated safety check: NotesApache-2.0

Similar skills

  • Official

    General Supabase skill for database, auth, Edge Functions, Realtime and storage work, plus client libraries, migrations, security audits, debugging and reading logs.

    2.7k GitHub starsUsed in 3 repos~3.6k tokens
    Backend & APIsAuto-check passed
  • Supabase

    curvenote/curvenote

    A skill your agent uses when doing ANY task involving Supabase.

    169 GitHub starsUsed in 5 repos~2.2k tokens
    Backend & APIsAuto-check passed
  • Nodejs Express Server

    ever-works/ever-works

    Build production-ready Express.js servers with middleware, authentication, routing, and database integration.

    158 GitHub stars~965 tokensUpdated 2 days ago
    Backend & APIsAuto-check passed
  • Fastapi App

    ccplugins/awesome-claude-code-plugins

    Bootstrap a new FastAPI backend with async SQLAlchemy 2.0, asyncpg, Alembic, Pydantic v2, and no deprecated APIs.

    967 GitHub stars~1.1k tokensUpdated 1 mo ago
    Backend & APIsAuto-check: notes
  • Fastapi Init Skill

    jiushiwon/wg-skills

    FastAPI 项目一键初始化技能。面向零基础小白,提供环境探测、自动安装、完整 Web 骨架生成、SSE 流式框架、JWT 鉴权、统一响应封装、文件上传接口、一键启动/重启脚本、Swagger 文档,内置 MySQL(默认)/ PostgreSQL / MongoDB 数据库选择。用户只需说"帮我搭一个 FastAPI 项目"即可一条命令完成从零到跑的完整链路。触发词:"FastAPI…

    110 GitHub stars~1.8k tokensUpdated 3 days ago
    Backend & APIsAuto-check: notes
  • Senior Backend

    alirezarezvani/claude-skills

    Designs and implements backend systems including REST APIs, microservices, database architectures, authentication flows, and security hardening.

    28k GitHub starsUsed in 1 repo~3.8k tokens
    Backend & APIsAuto-check passed

More from gjovanovicst/golang-auth-api

  • Admin Gui

    gjovanovicst/golang-auth-api

    Documentation of the HTMX admin GUI including template rendering, session management, CRUD patterns, and the GUIHandler structure.

    129 GitHub stars~2k tokensUpdated 2 mo ago
    Auto-check passed
  • Auth Flows

    gjovanovicst/golang-auth-api

    Detailed documentation of the 4 authentication systems, token lifecycle, middleware pipeline, session management, and RBAC authorization.

    129 GitHub stars~2.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Email System

    gjovanovicst/golang-auth-api

    Complete documentation of the email subsystem including template resolution, variable pipeline, rendering engines, SMTP config, and default templates.

    129 GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • Project Map

    gjovanovicst/golang-auth-api

    Complete module inventory of the Auth API project with file paths, dependencies, and architecture overview.

    129 GitHub stars~2.6k tokensUpdated 2 mo ago
    Auto-check passed
  • Route Map

    gjovanovicst/golang-auth-api

    Complete HTTP route structure with auth layers, middleware chains, rate limiting, and handler mappings for all API and GUI endpoints.

    129 GitHub stars~4.7k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Data Model

What does Data Model do?

All 17 GORM database models with fields, relationships, indexes, and the entity relationship diagram for the Auth API. Data Model is an agent skill from gjovanovicst/golang-auth-api. All 17 GORM database models with fields, relationships, indexes, and the entity relationship diagram for the Auth API.

When should I use Data Model?

Data Model fits situations like: tasks that involve Diagrams; tasks that involve Authentication.

How do I install Data Model in Claude Code?

Run `npx skills add gjovanovicst/golang-auth-api --skill data-model -a claude-code`. Or copy the skill folder (.opencode/skills/data-model in gjovanovicst/golang-auth-api) into .claude/skills/data-model in your project. Claude Code loads it when a task matches its description.

How do I install Data Model in Codex?

Run `npx skills add gjovanovicst/golang-auth-api --skill data-model -a codex`. Or copy the skill folder (.opencode/skills/data-model in gjovanovicst/golang-auth-api) into .agents/skills/data-model in your project. Codex loads it when a task matches its description.

Can I use Data Model in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add gjovanovicst/golang-auth-api --skill data-model -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/data-model, .gemini/skills/data-model, .github/skills/data-model and .opencode/skills/data-model in your project.

What does Data Model need to run?

SKILL.md names no scripts, command-line tools or credentials: Data Model is instructions for the agent only.

Does Data Model access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Data Model safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Data Model use?

Data Model is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Data Model use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Data Model?

Skills that share tags, products or a category with Data Model: Supabase Development and Debugging (supabase/agent-skills, 2.7k stars), Supabase (curvenote/curvenote, 169 stars), Nodejs Express Server (ever-works/ever-works, 158 stars) and Fastapi App (ccplugins/awesome-claude-code-plugins, 967 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Data Model?

gjovanovicst (a GitHub user) maintains it in gjovanovicst/golang-auth-api, which has 129 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on July 30, 2026.

Source: gjovanovicst/golang-auth-api on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.