vibe-stack / rules
Cursor rule8 starsChanged 8 months agoMITView on GitHub
Verification rules — forces the AI to verify its work before declaring done
- Reads credentials
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/ai-collaboration.mdcCursor rule
- .cursor/rules/api-design.mdcCursor rule
- .cursor/rules/api-validation.mdcCursor rule
- .cursor/rules/caching-revalidation.mdcCursor rule
- .cursor/rules/context-management.mdcCursor rule
- .cursor/rules/database-design.mdcCursor rule
- .cursor/rules/env-management.mdcCursor rule
- .cursor/rules/error-handling.mdcCursor rule
- .cursor/rules/file-naming.mdcCursor rule
- .cursor/rules/file-uploads.mdcCursor rule
- .cursor/rules/git-conventions.mdcCursor rule
- .cursor/rules/hydration-safety.mdcCursor rule
- .cursor/rules/middleware-auth.mdcCursor rule
- .cursor/rules/nextjs15-params.mdcCursor rule
- .cursor/rules/performance.mdcCursor rule
- .cursor/rules/project-context.mdcCursor rule
- .cursor/rules/react19-patterns.mdcCursor rule
- .cursor/rules/security.mdcCursor rule
- .cursor/rules/server-actions.mdcCursor rule
- .cursor/rules/server-vs-client-components.mdcCursor rule
- .cursor/rules/shadcn-patterns.mdcCursor rule
- .cursor/rules/stripe-payments.mdcCursor rule
- .cursor/rules/stripe-webhooks.mdcCursor rule
- .cursor/rules/supabase-auth-security.mdcCursor rule
- .cursor/rules/supabase-rls.mdcCursor rule
- .cursor/rules/supabase-ssr-only.mdcCursor rule
- .cursor/rules/testing.mdcCursor rule
- .cursor/rules/typescript-strict.mdcCursor rule
- llms.txtllms.txt
The file
We split this verify-before-use.mdc into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
After generating or modifying TypeScript files, ALWAYS run the type checker before declaring the task complete.
- Distinctive: line 18
If types fail, fix ALL errors before moving on.
- Distinctive: line 23
Before modifying ANY existing file, re-read it first.
- Very specific: line 34
Before writing Supabase queries, verify the table structure by checking the migration files in supabase/migrations/.
- Distinctive: line 37
Do NOT assume column names, types, or relationships.
- Distinctive: line 44
After creating new API routes or pages, verify:
- Very specific: line 58
Before using process.env.SOME_KEY, verify it exists in .env.example.
- Very specific: line 59
If the variable is new, ADD it to .env.example with a placeholder value and document it in the setup instructions.
- Very specific: line 62
NEVER put secrets in NEXT_PUBLIC_ variables — they are exposed to the browser.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: Verification rules — forces the AI to verify its work before declaring done
globs: ["*"]
alwaysApply: true
---
# Verify Before Use
## RULE 1: Run Type Checker After Every Code Generation
After generating or modifying TypeScript files, ALWAYS run the type checker
before declaring the task complete. Do not assume code is correct — verify it.
```bash
npx tsc --noEmit
```
If types fail, fix ALL errors before moving on. Do NOT leave type errors
for the developer to fix manually.
## RULE 2: Re-Read Before Modifying
Before modifying ANY existing file, re-read it first. Do NOT generate code
based on assumptions about what the file contains.
Common failures from skipping this step:
- Importing functions that were renamed or deleted
- Overwriting changes made in a previous turn
- Adding duplicate imports or declarations
- Breaking existing patterns by not matching the file's style
## RULE 3: Verify Database Schema Before Queries
Before writing Supabase queries, verify the table structure by checking
the migration files in `supabase/migrations/`.
Do NOT assume column names, types, or relationships. Common hallucinations:
- Using `user_id` when the column is `author_id`
- Assuming a `status` column exists when it doesn't
- Using wrong relationship names in `.select('*, profile(*)')`
## RULE 4: Test Route Patterns Before Declaring Done
After creating new API routes or pages, verify:
1. The file path matches the expected URL pattern
2. The HTTP method matches the use case (GET for reads, POST for mutations)
3. The response shape matches what the client expects
```
app/api/posts/route.ts → GET /api/posts, POST /api/posts
app/api/posts/[id]/route.ts → GET /api/posts/123, DELETE /api/posts/123
app/dashboard/page.tsx → /dashboard
app/posts/[slug]/page.tsx → /posts/my-first-post
```
## RULE 5: Verify Environment Variables Exist
Before using `process.env.SOME_KEY`, verify it exists in `.env.example`.
If the variable is new, ADD it to `.env.example` with a placeholder value
and document it in the setup instructions.
NEVER put secrets in `NEXT_PUBLIC_` variables — they are exposed to the browser.
```typescript
// CORRECT — server-only secret
const stripeKey = process.env.STRIPE_SECRET_KEY!
// WRONG — exposed to all users
const stripeKey = process.env.NEXT_PUBLIC_STRIPE_SECRET_KEY!
```
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

