一键导入
entity-models
Implement OOP API entities in api/model/ using the shared Model base class and relation helper.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Implement OOP API entities in api/model/ using the shared Model base class and relation helper.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Build or change API behavior in api/ using Express routers, middleware, CustomError, model instances, and camelCase JSON responses.
Review backend and frontend template code for real defects, boundary violations, security gaps, and missing tests. Auto-invoke for code reviews or bug investigations. Triggers: "bug review", "review code", "find bugs", "security audit", "check defects".
Maintain the api/helpers/postgres.js SQL boundary, CRUD helper surface, and safe filter conventions.
Update project-local agent guidance when architecture, workflows, commands, or conventions change. Auto-invoke when user or agent output indicates a reusable workflow or durable rule. Triggers: "update docs", "update skill", "create new skill", "update agent instructions", "document recurring pattern", "capture reusable workflow".
Add accurate JSDoc and focused comments when changing template code. Auto-invoke during code writing or refactoring. Triggers: "document code", "jsdoc", "code comments", "add comments", "explain logic".
Keep human docs, agent guidance, and touched code comments aligned with the real web/api implementation, compose workflow, and validation commands. Auto-invoke when auditing docs or after major architectural changes. Triggers: "audit docs", "check context", "documentation maintenance", "audit documentation", "verify docs".
| name | entity-models |
| description | Implement OOP API entities in api/model/ using the shared Model base class and relation helper. |
Use this skill when changing entity classes or persistence-facing business behavior.
api/model/.api/model/model.js for standard CRUD behavior.id (internal BIGINT identity for database FKs) and public_id (VARCHAR(14) NOT NULL UNIQUE generated via nanoid customAlphabet Base62 in Model.insert() and exposed in public toJSON() / route selectors).api/helpers/postgres.js.api/model/relation.js for relation tables instead of duplicating relation checks in routes.Use model unit tests for isolated behavior and integration tests when joins, auth, or real database behavior is involved.