agentleFS
TiagoGranelliTiagoGranelli/slopproof/.agents/skills/auth-change/SKILL.md

auth-change

Skill2 starsChanged 21 days agoMITView on GitHub

Change accounts and authentication in this repo (Better Auth). Use when adding an account action such as changing a name, email or password, when changing the Better Auth config (plugins, user fields, rate-limit storage), or when creating users.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. berntpopp/genefoundry-router★ 6same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository10 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read src/server/AGENTS.md first: it lists the Better Auth rules this code depends on.

    line 8

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Auth change

Read src/server/AGENTS.md first: it lists the Better Auth rules this code depends on.

New account action

The browser reaches Better Auth only through server functions; which surface an operation belongs on is ADR 0013. An account action is:

  1. A server function in src/lib/auth.functions.ts that validates its input with Effect Schema (.validator(Schema.toStandardSchemaV1(...)); a lint rule rejects any other validator) and calls callAuthEndpoint. Its schema lives in src/lib/account-input.ts, where the forms reuse it; a string that reaches Postgres (a name, an email, a token) starts its checks with isFreeOfNul.
  2. Its METHOD /path in EXPOSED in src/server/http/auth-endpoints.ts. Not in HTTP_ENDPOINTS, which /api/auth/* answers from outside.
  3. A hook in src/features/auth/api/ built on useAuthMutation (auth-action.ts), as change-password.ts.
  4. Any new Better Auth error code in BETTER_AUTH_CODES (src/server/http/auth-handler.ts), the closed set of AuthFailureCodes; pnpm typecheck then fails until src/features/auth/utils/describe-auth-failure.ts (in the 100% coverage gate) gives it a message.
  5. Mail goes through authMail (src/server/mail/); its text lives in auth-messages.ts.
  6. Tests: component tests through authFunction(name, answer) and authCalls(name), integration tests through callAuthFunction(name, ...) on a throwaway account (read tests/integration/AGENTS.md).

Auth config change

For plugins, user fields and rate-limit storage:

  1. Edit src/server/auth.ts, then src/server/db/schema/auth.ts by hand (timestamps stay timestamptz), then follow the database-change skill.
  2. pnpm auth:check (Better Auth's auth check schema, also run by pnpm check) fails until every table, column, nullability and default the configuration writes exists.
  3. To see what Better Auth would generate, run pnpm exec auth generate --config src/server/auth.ts --output /tmp/auth-schema.ts -y and port the difference by hand. Its output stays in /tmp; auth.ts is written by hand only.

Users

pnpm user:create <email> <name> creates a verified account; in production, the image's bundled copy does (node .output/create-user.mjs <email> <name>, docs/operations.md, "First account"). The password comes from CREATE_USER_PASSWORD, otherwise from stdin: a hidden prompt (asked twice) in a terminal, or the whole input of a pipe. Public sign-up is AUTH_SIGN_UP=closed by default (ADR 0003).

Done when

pnpm check and pnpm build && pnpm verify:app pass.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.