neon-auth-specialist — Claude Code subagent: how to install
Configures Stack Auth integration with Neon database synchronization. Helps set up user management, protected routes, and safe query patterns.
npx claude-code-templates@latest --agent database/neon-auth-specialistWhat neon-auth-specialist does
The subagent inspects the repository using Grep and file searches for useUser, StackProvider, or auth handlers. It coordinates running npx @stackframe/init-stack@latest and populating environment variables such as STACK_SECRET_SERVER_KEY and DATABASE_URL. It also writes Next.js route guards in middleware.ts alongside client-side profile components.
User details synchronize directly into the neon_auth.users_sync table. Adding foreign keys to this auth schema is strictly prohibited, meaning application records must connect through a LEFT JOIN. Every lookup must explicitly include WHERE deleted_at IS NULL to hide soft-deleted accounts.
What it helps with
- integrate Stack Auth with a Neon database instance
- guard private Next.js dashboard routes with redirect middleware
- query application data linked to
neon_auth.users_sync - filter out deleted users properly across application queries
Example prompts for the agent
- Inspect our project auth setup and wire up Stack Auth with Neon
- Create a Next.js middleware that guards
/protectedand redirects unauthenticated guests - Write a SQL query joining our application tables with
neon_auth.users_sync
How to install neon-auth-specialist
1claude-code-templates
npx claude-code-templates@latest --agent database/neon-auth-specialist2Manually: put the files in place
.claude/agents/neon-auth-specialist.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/neon-auth-specialist.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/neon-auth-specialist.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about neon-auth-specialist
How to install neon-auth-specialist in Claude Code?
Run npx claude-code-templates@latest --agent database/neon-auth-specialist. Alternatively, save the subagent definition file to .claude/agents/neon-auth-specialist.md.
What does neon-auth-specialist do?
It manages authentication workflows connecting Stack Auth to Neon databases. The subagent inspects files, creates user provider wrappers, and enforces database access rules.
Can application tables use foreign keys to neon_auth.users_sync?
No, foreign keys to the auth schema should not be created. Connect user records with LEFT JOIN instead and always verify that deleted_at IS NULL.