/neon:add-docs [claude.md | cursorrules | agents.md]from neon
Add Neon best practices documentation to the project
Ships in neon. Installing the plugin adds it to Claude Code.
Add Neon best practices and AI rules files to the project.
Determine which documentation to add:
claude.md → Create CLAUDE.md onlycursorrules → Create .cursorrules onlyagents.md → Create AGENTS.md onlyCheck for existing files and ask before overwriting.
Create CLAUDE.md at project root:
# CLAUDE.md - Neon Project Configuration
## Database Configuration
- **Database**: Neon Serverless Postgres
- **Project ID**: [Get from Neon Console]
- **ORM**: [Drizzle/Prisma/None]
## Connection Setup
- Driver: `@neondatabase/serverless`
- Connection Pooling: Enabled (use -pooler hostname)
## Environment Variables
DATABASE_URL=postgresql://... # Pooled connection DATABASE_URL_UNPOOLED=postgresql://... # Direct (migrations)
## Best Practices
- Use branching for schema changes
- Test migrations on dev branch first
- Use connection pooling for serverless deployments
- Leverage MCP server for database operations
## Neon MCP Commands
- Branch creation: Use `create_branch` tool
- Migrations: Use `prepare_database_migration` for safety
- Query tuning: Use `explain_sql_statement` for analysis
Create .cursorrules at project root:
# Neon PostgreSQL Development Rules
## Database Connection
- Always use `@neondatabase/serverless` driver
- Use pooled connections by default (DATABASE_URL)
- Use unpooled connections only for migrations
## Schema Changes
- Never run migrations directly on production
- Use Neon branching to test schema changes
## Query Patterns
- Use parameterized queries
- Prefer template literals: sql`SELECT * FROM users WHERE id = ${id}`
- Use transactions for multi-step operations
## Neon Auth
- Auth data in neon_auth schema
- Use @neondatabase/neon-js for unified auth + data
Create AGENTS.md at project root:
# AGENTS.md - Neon Database Agent Instructions
## Database Operations
1. **Creating Tables**: Include indexes on foreign keys
2. **Migrations**: Use `prepare_database_migration` to test first
3. **Queries**: Use `explain_sql_statement` for complex queries
## Branch Workflow
1. Create branch from main
2. Make changes on branch
3. Test thoroughly
4. Apply to main: `complete_database_migration`
Print confirmation of created files.
Files this command reads when invoked
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
11 commands in this plugin
/branchNeon Branch CommandCreate a Neon database branch for testing, development, or preview environments. Branches are instant copy-on-write snapshots./create-ephemeral-dbCreate an ephemeral Neon database for testing/migrateNeon Migrate CommandRun Drizzle migrations on your Neon database. Supports generate, migrate, push, and studio commands with proper connection handling.npx claudepluginhub innocraft-systems/innocraft-plugin --plugin neon