skills/review-orm-usage/SKILL.md
Review ORM usage patterns for N+1 queries, connection management, migration safety, transaction handling, and query efficiency. Library-level atomic skill; output is a findings list.
npx skillsauth add nesnilnehc/ai-cortex review-orm-usageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
仅在库级别查看ORM 使用模式。不要定义范围(差异与代码库)或执行安全/架构分析;这些是通过范围和cognitive技能来处理的。以标准格式发出结果列表以进行聚合。专注于跨 ORM 库(Prisma、Entity Framework、SQLAlchemy、Sequelize、TypeORM、Hibernate、Django ORM、ActiveRecord 等)的 N+1 查询检测、连接管理、迁移安全、事务处理、查询效率和模型设计。
首要目标:生成一个 ORM 使用结果列表,涵盖给定代码范围的 N+1 查询、连接管理、迁移安全、事务处理、查询效率和模型设计。
成功标准(必须满足所有要求):
library-orm)、严重性、标题、描述和可选建议验收测试:输出是否包含以 ORM 为中心的结果列表,其中包含涵盖所有相关库维度的文件/模型引用,而无需执行安全性、架构或范围分析?
本技能负责:
本技能不负责:
review-sqlreview-performance转交点:当所有 ORM 结果发出后,将其交给“orchestrate-code-review”进行聚合。对于 SQL 注入风险(未经净化的原始查询),请记下它们并建议“审查安全性”。对于复杂的原始 SQL 质量,请注意并建议“review-sql”。
何时使用:当正在审查的代码使用 ORM 库并且任务包括库级质量时。范围由调用者或用户确定。
SELECT *或过度获取的列;识别暗示缺少索引的查询模式(未索引的 WHERE/ORDER BY 列);评估原始查询回退的适当性;评估查询复杂性(深度连接、循环中的子查询)。不要做这些(其他技能可以处理它们):
review-sql何时停止并交接:
library-orm)、严重性、标题、描述和可选建议输出是否包含以 ORM 为中心的结果列表,其中包含涵盖所有相关库维度的文件/模型引用,而无需执行安全性、体系结构或范围分析?
include、EF Include、SQLAlchemy joinedload、Hibernate @EntityGraph)。类别=库-orm。prisma.$queryRaw、DbContext.Database.ExecuteSqlRaw、session.execute(text(...)))进行查询的存储库方法,可以使用 ORM 查询构建器来表达。development
Generate an LLM agent test suite (golden cases, mock-LLM unit tests, evaluator harness) from an agent implementation and its agent-test contract. Use when an agent has no tests, or a contract exists but the test code is missing.
development
After code changes, auto-detect the project's build system and local deployment method for a given directory, then build the project and restart its locally-deployed environment (Docker Compose / systemd / process manager). Never assumes — asks only when detection is ambiguous. Caches detected commands per project in .cortex/redeploy-local.yaml; re-invocations on the same project skip re-scanning until signal files change, the cache expires (30 days), or the skill version bumps.
tools
Publish a NATS message conforming to a cross-team contract, using NATS MCP tools. Authors the contract on first use if missing. Reads project-level cache (.cortex/nats.yaml) to avoid re-prompting basics across sessions.
tools
Drain pending NATS messages from a producer contract via NATS MCP tools (default batch / drain-style). Applies Tolerant Reader semantics and per-message ack/nak/term, returning aggregated stats. Reads project-level cache (.cortex/nats.yaml) to avoid re-prompting.