Token导航 LogoToken导航

Agent Skill · 研究检索

create-auth(创建授权)

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

create-auth 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 69,087。

总安装 220周安装 9GitHub Stars 22下载 71核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:create-auth(创建授权)
来源仓库:https://github.com/himself65/auth-spec
仓库路径:skills/create-auth
安装命令:
npx skills add https://github.com/himself65/auth-spec --skill create-auth
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/himself65/auth-spec --skill create-auth

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于为项目搭建用户认证系统, 包括登录、注册及相关流程。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。自动检测项目技术栈并推荐适配方案, 生成完整鉴权代码。create-auth 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

需识别数据库、框架和依赖项,避免重复造轮子,确保与现有系统集成。

来源仓库内路径:skills/create-auth

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/himself65/auth-spec --skill create-auth;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

create-auth 怎么安装?

在终端执行 npx skills add https://github.com/himself65/auth-spec --skill create-auth。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

create-auth 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

create-auth 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

create-auth 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

create-auth 用的人多吗?

公开数据是累计安装 220 次,近一周安装 9 次,下载 71 次,GitHub 22 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

create-auth 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
create-auth

创建授权 · 本页

22022接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Create Auth

You are scaffolding authentication (signin + signup) for the user's project.

Step 1: Detect Existing Project Context

Before asking any questions, scan the user's project to detect their stack:

  1. Look for framework config files (e.g., next.config.*, package.json, go.mod, Cargo.toml, pyproject.toml, build.gradle*, pom.xml)
  2. Look for existing database/ORM setup (e.g., prisma/schema.prisma, drizzle.config.*, alembic/, diesel.toml, ormconfig.*)
  3. Look for existing auth code or dependencies

Use what you find to pre-select the best options in the questions below. If the project clearly uses a specific stack, set that as the recommended option.

Step 2: Gather Context with Interactive Questions

Use the AskUserQuestion tool to ask the user to make selections. Ask up to 3 questions in a single AskUserQuestion call so the user can answer everything at once.

Question 1: Language/Framework

Ask "Which language and framework are you using?" with header "Framework".

Pick the top 4 most relevant options based on what you detected in the project. If you detected the framework, put it first and mark it "(Recommended)". If you could not detect it, use these defaults:

  • Next.js — "TypeScript, App Router, API routes"
  • Express — "TypeScript/JavaScript, minimal and flexible"
  • FastAPI — "Python, async-first with type hints"
  • Go + Chi — "Go, lightweight and idiomatic"

The user can always pick "Other" to specify a different stack.

Question 2: Database/ORM

Ask "Which database and ORM/query layer?" with header "Database".

Again, pick the top 4 most relevant options based on the project. If detected, mark it "(Recommended)". Defaults:

  • PostgreSQL + Prisma — "Type-safe ORM with migrations (JS/TS)"
  • PostgreSQL + Drizzle — "Lightweight TypeScript ORM, SQL-like syntax"
  • PostgreSQL + SQLAlchemy — "Full-featured Python ORM"
  • SQLite + raw queries — "Simple, no server needed, good for prototyping"

Question 3: Session Strategy

Ask "How should sessions be managed?" with header "Sessions".

  • Database sessions (Recommended) — "Server-side sessions stored in your database. More secure — sessions can be revoked instantly"
  • JWT tokens — "Stateless tokens signed by the server. Simpler to scale, but harder to revoke"

Step 3: Ask Which Features to Add

After the user answers the stack questions, use AskUserQuestion again to ask which additional auth features they want. Use multiSelect: true so they can pick multiple features at once.

Question 1: Authentication Methods

Ask "Which authentication methods do you want to add?" with header "Auth methods". Set multiSelect to true.

  • Email OTP — "Passwordless sign-in via one-time codes sent to email"
  • Magic Link — "Passwordless sign-in via emailed links"
  • Phone Number — "SMS-based OTP authentication"
  • Passkey — "WebAuthn/FIDO2 passwordless authentication"

Question 2: Security Features

Ask "Which security features do you want?" with header "Security". Set multiSelect to true.

  • Two-Factor Auth (Recommended) — "TOTP-based second factor with backup codes"
  • Captcha — "Bot protection on sign-up and sign-in (reCAPTCHA, hCaptcha, Turnstile)"
  • Password Breach Check — "Check passwords against the Have I Been Pwned database"
  • Rate Limiting — "Throttle auth endpoints to prevent brute-force attacks (includes KV cache)"

Question 3: Additional Capabilities

Ask "Any additional capabilities?" with header "Extras". Set multiSelect to true.

  • Multi-Session — "Allow multiple concurrent sessions per user"
  • Username Auth — "Sign in with username instead of (or in addition to) email"
  • Organization / Teams — "Multi-tenant support with roles, invitations, and RBAC"
  • API Keys — "Generate API keys for programmatic access"

Step 4: Wait for All Answers

Do not write any code until the user has answered all questions. Once you have their selections, proceed to Step 5.

Step 5: Generate Auth

Generate the core auth (schema + endpoints below) plus any selected features. For each selected feature, read the matching reference file from references/features/ to get the schema additions, endpoint specs, and implementation details.

Dependency: If the user selects Rate Limiting, also read references/features/kv-cache.md and generate the KV cache module first — rate limiting depends on it. The KV cache is a general-purpose utility that other features can also use, so generate it as a standalone module.

FeatureReference file
Email OTPreferences/features/email-otp.md
Magic Linkreferences/features/magic-link.md
Phone Numberreferences/features/phone-number.md
Passkeyreferences/features/passkey.md
Two-Factor Authreferences/features/two-factor.md
Captchareferences/features/captcha.md
Password Breachreferences/features/password-breach.md
Rate Limitingreferences/features/rate-limiting.md
KV Cachereferences/features/kv-cache.md
Multi-Sessionreferences/features/multi-session.md
Username Authreferences/features/username.md
Organization/Teamsreferences/features/organization.md
API Keysreferences/features/api-key.md

Core Schema and Endpoints

Generate the following core auth using the schema and endpoint specs below.

Adapt everything to the user's language/framework idioms:

  • Naming: email_verified (snake_case) in Python/Go/Rust, emailVerified (camelCase) in JS/TS, EmailVerified (PascalCase) in C#
  • Types: use the language's native types (e.g. std::string in C++, String in Rust/Java, string in Go/TS)
  • IDs: use idiomatic generation — uuid.New() (Go), Uuid::new_v4() (Rust), crypto.randomUUID() (JS), uuid4() (Python), boost::uuids::random_generator() (C++), etc.
  • Password hashing: use the idiomatic library — bcrypt (Go/JS/Python), argon2 (Rust), libsodium (C/C++), etc.
  • Error handling: use the language's conventions (Result types in Rust, error returns in Go, exceptions in Python/Java, etc.)
  • File structure: follow the project's existing layout and conventions

Schema

Create these tables/models:

User

FieldTypeConstraints
idstringprimary key
emailstringunique, not null
namestringnullable
emailVerifiedbooleandefault false
createdAtdatetimedefault now
updatedAtdatetimeauto-update

Session

FieldTypeConstraints
idstringprimary key
userIdstringforeign key -> User, not null
tokenstringunique, not null
expiresAtdatetimenot null
createdAtdatetimedefault now

Account

FieldTypeConstraints
idstringprimary key
userIdstringforeign key -> User, not null
providerIdstringnot null (e.g. "credential")
passwordHashstringnullable
createdAtdatetimedefault now
updatedAtdatetimeauto-update

Endpoints

POST /api/auth/sign-up

  • Body: {email, password, name?}
  • Validate email format and password length (min 8 chars)
  • Hash password with a strong algorithm (bcrypt, argon2, or scrypt — use whichever is idiomatic for the language)
  • Create User + Account (providerId: "credential") + Session
  • Return session token and user (without password)
  • Email enumeration protection: If the email already exists, return the same 200 OK status and same response shape as a successful sign-up — do not return 409 or any error that reveals the email is taken. The response should be indistinguishable from a real sign-up. Implementation: attempt the insert, catch the unique constraint violation, hash the password anyway (to keep timing consistent), and return a fake success with a dummy user ID and token (that won't actually work as a session). This prevents attackers from discovering which emails are registered via the sign-up endpoint.

POST /api/auth/sign-in

  • Body: {email, password}
  • Look up user by email, verify password hash
  • Create new Session
  • Return session token and user (without password)
  • Return 401 on invalid credentials (generic message, no user enumeration)

GET /api/auth/session

  • Read session token from Authorization header (Bearer) or cookie
  • Look up session, verify not expired
  • Return user info if valid, 401 if not

POST /api/auth/sign-out

  • Read session token
  • Delete session from database
  • Return 200

Implementation Rules

  • Write all auth code by hand. Do NOT use auth libraries (better-auth, next-auth, Auth.js, lucia, passport, etc.). The only external dependencies allowed are: the web framework itself, the database/ORM layer, and a password hashing library (bcrypt, argon2, scrypt). Everything else — session management, token generation, route handlers — must be written directly. Keep it minimal.
  • Use crypto-random IDs for all primary keys and session tokens — use the idiomatic method for the language (crypto.randomUUID(), uuid.New(), Uuid::new_v4(), secrets.token_hex(), etc.)
  • Hash passwords with a strong algorithm — use what's standard for the ecosystem (bcrypt, argon2, scrypt, libsodium, etc.)
  • Never log or expose password hashes
  • Use constant-time comparison for password verification (the hashing library handles this)
  • Set session expiry to 7 days by default
  • Return generic "Invalid credentials" on sign-in failure — do not reveal whether the email exists
  • Prevent email enumeration on sign-up: When a duplicate email is submitted, return the same status code and response shape as a successful sign-up. Always hash the password (even for duplicates) to prevent timing-based detection. Return a plausible but non-functional fake token and user ID so the response is indistinguishable from a real sign-up.
  • Follow the project's existing code style, file structure, and patterns
  • If the language has a strong type system (Rust, Go, C++, etc.), define proper types/structs for request/response bodies — do not use untyped maps

Step 6: Run the Migration

After generating all code, run the database migration automatically so the user doesn't hit "table does not exist" errors. Use the project's existing database driver/connection to execute the migration SQL.

For JS/TS projects using @neondatabase/serverless, the tagged-template sql function cannot run plain SQL strings. Use sql.query(statement) instead when executing migration statements programmatically.

Common Pitfalls

Before generating code, read all files in references/pitfalls/ and follow their rules strictly. These are real bugs encountered in production.

PitfallReference file
API routes must catch DB errorsreferences/pitfalls/api-error-handling.md
Sign-up catch must not re-throwreferences/pitfalls/signup-rethrow.md
Auth helpers must not throwreferences/pitfalls/auth-helpers-no-throw.md
Client must handle non-JSONreferences/pitfalls/client-json-parsing.md
OAuth redirect must not use request.urlreferences/pitfalls/oauth-redirect-request-url.md
API key hash/gen must not be duplicatedreferences/pitfalls/api-key-shared-utils.md

Reference Implementations

Full working examples are in the references/ directory alongside this skill. Use the matching reference as a starting point and adapt to the user's specific setup:

FileStack
nextjs-drizzle.tsNext.js App Router + Drizzle + PostgreSQL
express-prisma.tsExpress + Prisma + PostgreSQL
go-chi.goGo + Chi + database/sql + PostgreSQL
fastapi-sqlalchemy.pyFastAPI + SQLAlchemy + PostgreSQL
axum-sqlx.rsRust + Axum + sqlx + PostgreSQL
spring-boot.ktKotlin + Spring Boot + JPA + PostgreSQL

If the user's stack doesn't match any reference, use the closest one as a structural guide and adapt idioms accordingly.

平台分布

Codex

37%
按下载量换算26

Claude

29.88%
按下载量换算21

Cursor

16.43%
按下载量换算12

Gemini CLI

9.89%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills