# neon-auth-specialist

Configures Stack Auth integration with Neon database synchronization. Helps set up user management, protected routes, and safe query patterns.

- subagent · `type=agent` · Claude Code · 387 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/agents/database/neon-auth-specialist.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/agents/neon-auth-specialist

## What it 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.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --agent database/neon-auth-specialist
```

2. **Manually: put the files in place**
- File: `.claude/agents/neon-auth-specialist.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/neon-auth-specialist.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/neon-auth-specialist.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/agents/database/neon-auth-specialist.md

## When to use it
- 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
- Inspect our project auth setup and wire up Stack Auth with Neon
- Create a Next.js middleware that guards `/protected` and redirects unauthenticated guests
- Write a SQL query joining our application tables with `neon_auth.users_sync`

## Similar
- [fullstack-developer](https://affpapa.org/en/nevibecode/agents/fullstack-developer.md) — subagent · 18117 installs
- [python-pro](https://affpapa.org/en/nevibecode/agents/voltagent-community-python-pro.md) — subagent · 11689 installs
- [python-pro](https://affpapa.org/en/nevibecode/agents/python-pro.md) — subagent · 11689 installs
- [typescript-pro](https://affpapa.org/en/nevibecode/agents/voltagent-community-typescript-pro.md) — subagent · 9602 installs
- [ai-engineer](https://affpapa.org/en/nevibecode/agents/ai-engineer.md) — subagent · 7687 installs
- [code-explorer](https://affpapa.org/en/nevibecode/agents/code-explorer.md) — subagent · 1172 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 804 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
