Stop AI from hallucinating your database. One command, full context.
## AI Instructions
When working with this database schema, follow these rules:
1. Always use the exact table and column names defined above
2. Always include proper foreign key references in queries
3. Use the relationships defined above — do not infer new ones
### Example Queries
**posts**
```sql
-- Get all posts
SELECT * FROM posts;
-- Get posts by ID
SELECT * FROM posts WHERE id = ?;
-- Get posts with users info
SELECT t.*, r.*
FROM posts t
JOIN users r ON t.user_id = r.id
WHERE t.id = ?;
```
---
## Common Mistakes
- When querying `posts` with `user_id`, always JOIN on
`users`.`id` — do not select `user_id` as a raw integer
- The column is `posts`.`user_id`, not `posts.user`
- `posts`.`body` is nullable — use COALESCE or handle NULL
## Relationships Map
```
users 1──* posts (user_id)
users 1──* comments (user_id)
posts 1──* comments (post_id)
```Without Groundwork
"users table has id, name, email"
AI hallucinates posts.user instead of posts.user_id
Forgets nullable columns, writes queries that crash on NULL
You re-explain the schema every new chat
With Groundwork
Full schema with types, constraints, and relationships
Example queries with correct JOINs using your real column names
Common mistake warnings — body is nullable
Drop it in your project, works with Cursor, Copilot, and Claude
Describe
Write your database in plain English — tables, columns, relationships. Or use the CLI.
Review
See the parsed schema as visual cards. Catch anything wrong before generating.
Export
Download as GROUNDWORK.md, .cursorrules, or copilot-instructions.md.
One command. Done.
No config, no setup. Describe your schema, get your context file.
$ npx groundwork-cli
Describe your database schema in plain English.
(Press Enter twice when done)
> I have a users table with id, name, email.
> Posts belong to users via user_id.
> Comments belong to both posts and users.
✓ Parsed 3 tables, 12 columns, 3 relationships
✓ Written to GROUNDWORK.md
87 lines · 3,240 chars · Cursor + Copilot + Claude readyRequires OPENROUTER_API_KEY or ANTHROPIC_API_KEY in your environment
Coming Soon
groundwork check
Validate your schema for common issues
Import from SQL
Paste DDL or Prisma schema, get GROUNDWORK.md
Schema History
Track how your schema evolves over time
Team Sharing
Share schemas across your team