بنقرة واحدة
validate-db
Validate Prisma schema against requirements specification (read-only)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Validate Prisma schema against requirements specification (read-only)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Implement new feature with self-testing loop until 100% pass
Fix Prisma schema compilation errors
Fix Interface and Controller compilation errors
Fix Provider, Collector, Transformer compilation errors
Fix Test compilation errors
Validate Controllers and DTOs against requirements (read-only)
| name | validate-db |
| description | Validate Prisma schema against requirements specification (read-only) |
| allowed-tools | Read, Grep, Glob |
Validate that Prisma schema matches the requirements specification. This skill only checks for discrepancies - it does NOT modify any files.
Compare requirements documents with Prisma schema and report:
┌─────────────────────────────────────┐
│ Step 1: Read Requirements │
│ /docs/analysis/*.md │
└───────────────┬─────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Step 2: Read Prisma Schema │
│ /prisma/schema/*.prisma │
└───────────────┬─────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Step 3: Compare & Report │
│ - Missing tables │
│ - Missing columns │
│ - Type mismatches │
│ - Relationship issues │
└─────────────────────────────────────┘
find docs/analysis -name "*.md" -type f
Extract from each document:
find prisma/schema -name "*.prisma" -type f
Extract from schema:
For each entity in requirements:
For each required field:
For each relationship:
{prefix}_{entities} patternBoolean fields:
is_ prefix (e.g., is_active, is_public)is_ prefix (e.g., active → is_active)Field name consistency:
expires_at in one table, expired_at in another)*_at timestamps, *_id foreign keys, status fieldsCompare with requirements to identify unnecessary tables:
Duplicate tables:
Unnecessary snapshot/history tables:
# Validation Report: Database Schema
## Summary
- Total entities in requirements: X
- Entities found in schema: Y
- Missing entities: Z
## ✅ Valid Items
- [Entity] `users` - All fields match
- [Entity] `posts` - All fields match
## ❌ Issues Found
- [Missing Entity] `comments` - Defined in requirements but not in schema
- [Missing Field] `users.phone` - Required but not defined
- [Type Mismatch] `posts.view_count` - Expected Int, found String
- [Naming] `users.active` - Boolean field should be `is_active`
- [Naming] `sessions.expired_at` - Inconsistent with `tokens.expires_at`
- [Unnecessary Table] `post_snapshots` - Requirements say posts are directly editable
## ⚠️ Warnings
- [Nullable] `users.bio` - Requirements say required, schema allows null
- [Index] `posts` - Consider adding index on `created_at`
- [Duplicate] `user_profiles` and `users` - May have overlapping responsibilities
## Recommendation
Run `/fix-db` to fix the issues above.
This skill is READ-ONLY.
To fix issues, use /fix-db skill.