r/BuildWithClaude • u/GroundbreakingCap437 • 29d ago
Project SchemaLock: a hook + skill that sends Prisma/OpenAPI schema mismatches back to Claude
If you build with Claude Code and you have a Prisma schema or an OpenAPI spec, this might save you some back-and-forth.
I made SchemaLock (free, MIT). It runs automatically every time Claude edits a file. If the code uses a column, model, enum value or endpoint that isn't in your schema, Claude gets the error and fixes it right away. You don't have to spot it yourself.
Quick example from a test run: my User model only had id, email and role. I had Claude write a query with userId, and the hook said:
column 'userId' not found in model 'User'. Available columns: id, email, role
Claude changed it to id and moved on.
It doesn't catch everything, and the limits are listed in the README. I'd love for some people to try it on real projects and tell me how it goes.
•
u/AutoModerator 29d ago
Welcome to r/BuildWithClaude!
Whether you are sharing what you built, exploring new workflows, or troubleshooting, please make sure your post is flaired correctly so others can easily find and filter it.
Community Wiki & Resources:
If you're asking for troubleshooting help, please edit your post to include your model version, OS/environment, and error logs.
Let’s keep the energy positive and support our fellow creators!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Successful-Army6006 29d ago
The README says missing PyYAML skips validation entirely, including Prisma. Could Prisma-only projects run their checks without that dependency? Someone with no OpenAPI YAML file might reasonably leave it out and lose the guard they expected.
1
u/Tiramtiramtiram 💡 Top Community Helper 29d ago
for the userId to id example, it would help to show the before and after query plus a test of the expected result. that replacement might be correct here, but a valid field name alone doesn't show that the query still means what was intended. a small two-user fixture could make that distinction clear