spatie-data-transfer-objects
仓库创建 2026年7月4日最近提交 22 天前SkillHot 收录 22 天前
▸ 精选理由
确保后端 DTO 与前端类型一致,减少类型错误与集成问题。
▸ 风险提示
依赖项目命令脚本,误用可能影响类型生成与构建流程。
这个 Skill 做什么
管理 Spatie DTO 并强制生成 TypeScript 类型以保持同步。
负责管理后端用的 Spatie DTO 并确保前端的 TypeScript 类型保持同步,避免前后端契约不同步导致的运行时错误。每次创建或改动 DTO 后都要跑项目的类型生成命令(例如 php artisan typescript:transform)来更新 TypeScript 定义。重点是把后端的数据结构可靠地传递到前端,减少手工同步的风险。
▸ 展开 SKILL.md 英文原文
Creating and composing Spatie Laravel Data transfer objects for backend-to-frontend communication with automatic TypeScript type generation.
0
Stars
0
Forks
23
仓库内 Skill
+0
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/ceilidhboy/skills/master/skills/spatie-data-transfer-objects/SKILL.md或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/ceilidhboy/skills/master/skills/spatie-data-transfer-objects/SKILL.md"SKILL.MD 节选查看完整文件 ↗
# ⚠️ CRITICAL: Spatie Data Transfer Objects (DTOs) ## 🚨 FIRST THING: Generate TypeScript Types **WHENEVER YOU CREATE OR MODIFY A DTO, YOU MUST RUN THIS COMMAND:** ```bash php artisan typescript:transform ``` This is the **ONLY** correct way to generate TypeScript types from Spatie Data DTOs. Do NOT use npm build commands or other tools. This command must be run after any DTO changes to update `resources/js/types/generated.d.ts`. --- ## When to Activate This Skill Activate this skill whenever you are: - Creating or modifying data transfer objects in `app/Data/` - Composing DTOs using the composition pattern - Passing data from Laravel backend to Inertia React frontend - Working with S
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有