login_auto

A guide for adding email and Google or GitHub sign-in to a Next.js project using Supabase Auth, with Resend delivering authentication emails.

In plain words
What is it for?
Use it to review or plan password login, OAuth sign-in, email-code registration, and password changes, including the required dashboard and environment settings.
Why use it?
It compares the project’s existing login setup with a defined standard, making missing configuration and flow differences easier to find.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/weiyi88/cc-code/login_auto
Any agent
npx skills add weiyi88/cc-code --skill login_auto
Clone the repo
git clone --depth 1 https://github.com/weiyi88/cc-code

Made for: Claude Code, Codex.

Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,703 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00082 $0.07703
Opus 5 $0.00041 $0.03852
Sonnet 5 $0.00016 $0.01541
Haiku 4.5 $0.00008 $0.00770

Measured 2d ago against content hash 868054985a5d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

login_auto scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/login_auto/SKILL.md · 787 lines

How it starts

The opening of the file, as written. The whole thing — 787 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Supabase Auth 通用登录系统实现指南

本 skill 是与项目无关的通用登录逻辑指南,适用于任意 Next.js + Supabase 项目。不绑定特定 i18n 框架、不绑定特定语言组合、不绑定特定 UI 库。三大场景全覆盖:

  • 登录:邮箱密码 + OAuth (Google/GitHub)
  • 注册:邮箱 + 验证码 + 密码 + 确认密码
  • 修改密码(忘记密码/未登录):邮箱 + 验证码 + 新密码

邮件通道:验证码邮件由 Supabase Auth 触发,经 Supabase 自定义 SMTP 接入 Resend 投递(不在代码里调 Resend API,不自造验证码存储)。


Skill 启动流程(显式触发时按此走)

Step 1  整理项目当前登录逻辑
        读项目 auth 相关代码(auth-modal/回调路由/profile/middleware)
        → 画「项目现状登录逻辑」ASCII 图
Step 2  对比 skill 标准逻辑 vs 项目现状
        逐链路差异表: ✅一致 / ⚠️偏离 / ❌缺失
        (标准逻辑见下方「三大场景」与 Phase 1-3)
Step 3  环境盘点 + 询问 key
        检查: 依赖 / Supabase(URL+anon key, service_role可选)
              / Resend(API Key+发件域名) / OAuth(Client ID+Secret)
              / Dashboard(Confirm email关闭? SMTP配Resend? Redirect URLs? Providers?)
        缺什么列清单 → 询问主人提供
Step 4  整理改动清单
        输出表: 文件 | 现状 | 目标 | 动作
Step 5  调用 /cc-code:cc-code 执行
        按角色串行 PM→Architect→Dev→QA 落地
        (本 skill 只整理方案, 执行交 cc-code 工作流)

本 skill 主体是「标准逻辑 + 实现指南」,供 Step 2 对比、Step 4 改动参考。Step 5 不在本 skill 内写代码,交由 /cc-code:cc-code。


实现指南流程

Phase 0 → Phase 1 → Phase 2 → Phase 3 → Phase 4
环境检查   后端实现   前端UI    回调路由   构建验证

Phase 0: 环境检查

0.1 检查已有 Supabase 配置

扫描:
├── package.json → @supabase/supabase-js 存在?
├── package.json → @supabase/ssr 存在?
├── lib/supabase/client.ts 存在?
├── lib/supabase/server.ts 存在?
├── middleware.ts (或 Next.js 16 的 proxy.ts) → 包含 supabase session 刷新?
├── .env.local → NEXT_PUBLIC_SUPABASE_URL + ANON_KEY 存在?
└── app/auth/callback/route.ts 存在?

若项目使用 i18n,额外检查其 Auth 命名空间是否已含本 skill 所需的错误消息 key(见文末「错误消息键名清单」)。i18n 框架与语言组合由项目自定,本 skill 不强制。

0.2 若缺失,先安装依赖

pnpm add @supabase/supabase-js @supabase/ssr

0.3 若缺失,先创建基础设施文件

按下面的模板创建缺失文件,已有的跳过。


Phase 1: 后端实现

1.1 环境变量

.env.example 追加:

# Supabase Auth
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=

.env.local 填入实际值。

1.2 Supabase 客户端

lib/supabase/client.ts (浏览器端):

import { createBrowserClient } from '@supabase/ssr'

export function createClient() {
  return createBrowserClient(
    process.env.NEXT_PUBLIC_SUPABASE_URL!,
    process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
  )
}

Read the full file on GitHub · 787 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 787 lines · 82 tokens per session scan A 868054985a5d

Subscribe to this mod's changes

login_auto is a skill published in the GitHub repository weiyi88/cc-code (5 stars, last pushed 6d ago), licensed MIT. It adds 82 tokens to every session and 7,703 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.