跳到正文
TakoAPI
返回技能列表

fosmvvm-fluent-datamodel-generator

由 foscomputerservices 提供

Coding Agents & IDEs
437下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Generate Fluent DataModels for FOSMVVM server-side persistence.

描述

该技能的功能

Scaffolds Fluent DataModels for FOSMVVM server-side persistence in Vapor apps. Generates the model class, schema migration, seed migration, and unit tests for a given entity. Works alongside fosmvvm-fields-generator for form-backed entities.

Enforces FOSMVVM's strict separation between user-editable fields and system-assigned fields at generation time, catching architectural mistakes before they reach code review.

何时使用

  • Adding a new database-backed entity to a Vapor app
  • Creating a User or Session model with Fluent migrations
  • Scaffolding a junction table for many-to-many relationships
  • Generating seed data migrations for a new table
  • Setting up audit or system-only records without a Fields protocol

示例工作流

输入

User asks: Create a DataModel for an Idea entity that belongs to a User

智能体
  1. 1

    Checks Package.swift and existing models to confirm Fluent is the persistence layer

  2. 2

    Reads any existing IdeaFields protocol from context or from fosmvvm-fields-generator output

  3. 3

    Generates Idea.swift with @Parent(key: "created_by") satisfying the IdeaFields associated type

  4. 4

    Generates Idea+Schema.swift migration with foreign key reference to users table

  5. 5

    Generates Idea+Seed.swift idempotent seed migration and IdeaFieldsTests.swift, then registers migrations in database.swift

输出

Five files created covering the full Fluent persistence layer for the Idea entity

安装

clawhub install foscomputerservices/fosmvvm-fluent-datamodel-generator

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接