/luismc-project-setup:auth-setupfrom luismc-project-setup
Build or audit authentication per AUTHSPEC in a repo set up by tech-stack-setup. Use to add authentication, login, signup, sessions, passkeys, MFA or admin access, for an auth audit, or on /luismc-project-setup:auth-setup. Refuses a repo that tech-stack-setup has not set up.
Ships in luismc-project-setup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Builds authentication and authorization to AUTHSPEC, the binding
specification at the plugin's references/authspec.md. Its version is the
one on the spec's **Version:** line. It governs authentication flows, authorization, sessions, MFA and
step-up, account recovery, consent, data-subject rights, abuse prevention,
notifications, audit, and retention.
Read the spec before acting on it. It is long. This file does
not summarize it. Read the sections a step needs. Never generate against a
clause you have not read. Some AUTHSPEC requirements depend on their
rationale. R15.12 forbids soft-delete as an erasure mechanism. R16.4 forbids
personal data in audit metadata because audit records must survive erasure.
Code written from a paraphrase gets these wrong.
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/preflight.py" --require stack --for-skill auth-setup
If it exits non-zero, stop and report its message verbatim. Write nothing.
It checks for docs/architecture/stack-profile.md (or the old docs/specs/stack-profile.md), the track's root file (pnpm-workspace.yaml, go.work or go.mod, Cargo.toml, or a .sln), and a
packages/ or apps/ directory. tech-stack-setup produces these. The Stack
Profile is required: AUTHSPEC §2.1 resolves the technology stack by reading
it. Without it, this skill does not know the database, the runtime, the package
layout, or the language version.
This guard prevents a quiet, expensive failure. On an empty repository, an agent
invents a plausible structure, such as a src/auth/ here and an Express app
there. The user accepts it because it looks reasonable. The repository then has
two competing layouts. Undoing that costs far more than running the skills in
order.
Do not offer to set the stack up yourself. Tell the user to run
tech-stack-setup, and stop. That skill interviews for a dozen decisions. This
skill must not default them.
This setup follows section 13 of docs/guides/shared-self-hosted-runners.md.
§27.2 test gate yourself. Leave to the owner only what you cannot do (a key or secret for production, a provider setting in a web page). Give each an exact step and check it afterwards./luismc-project-setup:auth-setup in Mode 2 audits the implementation; the auth endpoints in apps/api accept sign-up and sign-in (example: call the sign-in route with the documented body); pnpm test runs the auth suites. Each with a one-line example.Follow AUTHSPEC §0.2. The steps below split its steps 3 to 5 into build
steps. Each step is a dependency of the next.
Resolve the stack. Read docs/architecture/stack-profile.md (else the old docs/specs/stack-profile.md) fully
(AUTHSPEC §2.1). Note the database, runtime, package manager, and the
AUTHSPEC version it claims. If it claims a version older than
references/, say so before generating. The difference is a finding.
Generating code for a newer version into a repo that declares an older
conformance makes the profile wrong without any warning.
Interview for the decisions the spec does not default. Do not guess any
of these. AUTHSPEC states them as choices, not as defaults:
§7.2 — password,
passkey, magic link / email OTP, social OIDC, enterprise SAML)§4.5 and §9.4 are
mandatory and non-negotiable: passkey-only, no password attribute of any
kind, ≥2 authenticators before enrollment completes§15.4, default 30 days, configurable 0–30)§23.2 allows a range§13)Build in this order. Follow "How to generate" below at every step.
| Step | What | Spec |
|---|---|---|
| 1 | The §4 entity tables as migrations in packages/db — every entity, with the [ENC] / [BIDX] / [HASH] classifications | §4, §5 |
| 2 | packages/auth: crypto (§5), sessions (§6), flows (§7), MFA and step-up (§8), recovery (§9) | §5–§9 |
| 3 | Authorization: the permission catalog declared in code (R4.13), the ownership predicate (R4.16) | §11 |
| 4 | The auth endpoints in apps/api per §19.4, each with its rate-limit bucket (§17.3) and explicit authorization declaration | §19, §17 |
| 5 | Admin plane, if step 2 said yes | §12 |
| 6 | Consent and legal-document versioning | §14 |
| 7 | Data-subject rights: export, rectification, erasure — including §15.4.1's per-entity disposition | §15 |
| 8 | Audit trail, hash-chained and append-only | §16 |
| 9 | Notifications, the §18.2 security_event.kind table | §18 |
| 10 | Retention jobs into the existing packages/jobs (§23.3) | §23 |
| 11 | The §27.2 test gate — every suite it names | §27 |
Do not weaken a MUST to make a step easier. If a requirement cannot be
met with the stack the profile declares, stop and say so. §0.1 defines only
MUST / MUST NOT, SHOULD, and MAY. A MUST you cannot satisfy is a
matter to raise with the user, not a judgement call to make silently.
Wire into what tech-stack-setup already built. Do not create parallel
structures:
packages/mail adapterpackages/jobsapps/api; your new routes must satisfy it, and it should fail as soon as
a route ships without a declarationUpdate the Stack Profile. Record the AUTHSPEC version now implemented,
plus every SHOULD not followed and every MUST waived, each with a named
approver (§0.1, §26.4). A profile that still claims no auth after this
skill has run is out of date.
Run Mode 2 against what you built and report the result, using the three parts of the setup pattern: Done, Left for you, What you can do now. Then say what remains: default UX pages for the user and admin apps are not part of this skill.
These rules govern how this skill writes the code. They were AUTHSPEC
R2.1 to R2.5 (D371); the spec keeps those IDs as removed rows.
AUTHSPEC
and the project's conventions conflict on style, the project wins. When they
conflict on a MUST of behaviour or security, AUTHSPEC wins, and you record
the conflict in the configuration reference. (was R2.1)§4 to the
engine's most precise native equivalent (§4.3). Do not fall back to a
generic string type when a precise type exists. (was R2.3)Preflight with --require stack --require auth, using the step 0 script path. If auth does not exist,
there is nothing to audit. Say it is absent and stop.
Work §27.4's coverage map, clause by clause. It is the spec's own
index of what must be demonstrable. Mark each clause conforms,
violates, absent, or not applicable with the reason. Cite file and
line for every violation.
Check the controls that fail silently when absent. When these are missing, nothing visibly breaks. The gap shows up only in an incident:
§4 entity has a §15.4.1 erasure disposition — an entity nobody
answered for is personal data that survives an erasure request§23.2 retention windows have a §23.3 job actually pruning them§19.4 route maps to a §17.3 rate-limit bucketR16.4) — the reason erasure and the
6-year retention obligation do not conflictR4.8)pending_verification and locked fail session validation at stage 7 of
§3.4 (R4.8, R4.8a)Report severity-ranked findings grouped by spec section, and do not edit while surveying. A check that repairs as it goes cannot show you what the repo looked like.
Then offer to fix, opt-in and never automatic. Most auth findings are not mechanical. A missing erasure disposition is a compliance decision, not a template. Offer only what is mechanical, list it explicitly, and re-run the check afterwards. A repair that was not re-verified is a claim.
tech-stack-setup, and it runs first.auth-ux-setup skill covers them. It will preflight with
--require stack --require auth, that is, on what this skill produces.AUTHSPEC. The spec is maintained in the dev-standards
repository, which gates every edit. A product never carries a copy of it
(STACKSPEC §16). It carries a Stack Profile that names the version it
conforms to.What SKILL.md sets; muted values are Claude Code's defaults
opusmediumnpx claudepluginhub luis-mc/dev-standards --plugin luismc-project-setup3 skills in this plugin
/claude-setupClaude setupApply the Claude Code config (statusline, settings, model split, rules, CLAUDE.md, the luismc plugins) to a project or ~/.claude/, then offer the dev-standards setups. Use to set up Claude, configure the statusline, fix Claude settings, add a CLAUDE.md, or on /luismc-project-setup:claude-setup./tech-stack-setupTech stack setup — a guided wizard, then a generatorPick a coherent tech stack and generate a repo that conforms to STACKSPEC, or audit a repo for drift. Use to start a new product, pick a stack, scaffold or bootstrap a conforming repo, set up the tech stack, check conformance, or on /luismc-project-setup:tech-stack-setup. Not for auth.Other plugins' skills for the same job