agentleFS
GlamgarOnDiscordGlamgarOnDiscord/claude-saas-blueprint/.claude/skills/schema-gen/SKILL.md

schema-gen

Skill2 starsChanged 6 months agoMITView on GitHub

Génère un schéma de base de données complet avec migrations, types et repository de base.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Arguments

  • entity : Nom de l'entité (ex: "Invoice", "Project")
  • fields : Description des champs en langage naturel

Instructions

1. Détection ORM

Lire .claude/memory/stack.md ou détecter :

  • drizzle.config.ts → Drizzle ORM
  • schema.prisma → Prisma
  • alembic/ → SQLAlchemy
  • Sinon → demander à l'utilisateur

2. Génération du Schema

Créer le fichier de schema avec :

  • Tous les champs demandés avec types appropriés
  • id : UUID v7 par défaut (ordonné chronologiquement)
  • organizationId : FK pour multi-tenancy (sauf si explicitement exclu)
  • createdAt : timestamp, default now
  • updatedAt : timestamp, auto-update
  • deletedAt : timestamp nullable (soft delete)
  • Index sur les FK et champs fréquemment recherchés
  • Relations définies explicitement

3. Fichiers Générés

  1. Schema/Migration : Dans le dossier de l'ORM
  2. Entity type dans core/entities/{entity}.ts :
    • Type TypeScript pur (pas d'import ORM)
    • Validation via Zod schema
  3. Port dans core/ports/i-{entity}-repo.ts :
    • Interface du repository avec CRUD de base
  4. Adapter dans adapters/db/{entity}-repo.ts :
    • Implémentation du port avec l'ORM choisi
    • Inclut soft delete, pagination, filtres de base

4. Validation

  • Générer et exécuter la migration
  • tsc --noEmit
  • Mettre à jour .claude/memory/domains.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.