Workflows
This page is the AI coding agent + AuthRight path. Common patterns use design user-intent commands (colon product names). In Cursor type hyphen forms (/auth-scan); in Claude Code type colon forms (/auth:scan); in Codex type $authright-scan. Greenfield and brownfield are paths, not slash commands.
Complete harness = offline engine + coding-agent host. Delivered skills in Cursor / Claude Code / Codex are that host (LLM judgment). Public terminal authright change --analyze does not call an LLM — it validates host-authored judgment (iam-shaped.yaml, semantic/alignment.yaml, semantic/projection.yaml, …) and fails with judgment_required when that pack is missing. Keyword fallback is not a supported plan. Do not run bare terminal authright scan / explore / change -- as the human happy path when you need model judgment.
/auth:explore and /auth:change are two commands — pick one (prefer change on first loop). Both start from an IAM Brief and an accepted slice. Explore is HITL (Agenda native HITL; recommended labeled not defaulted). Change is auto-plan (full plan of resolved/unresolved, batch overrides, confirm → ready → request-match → export). Must Decide items come from the same accepted Brief slice on both paths — explore and change differ in how they present those items, not in which must items exist for that slice. Thin delta and SP-only analogue stay thin; copy-class analogue inventories open bound lifecycle must work on both. Either command may be used on greenfield or brownfield. Later record flags are follow-up the skill drives on the Auth Change either command created.
Chat skills /auth:explore, /auth:change, and /auth:doctor run their loop when the opening text matches that command or the invoke has no extra text. A mismatched opening line is answered in chat and does not create an Auth Change. The agent may hint the other of those two commands; it must not auto-switch slash/skill. Later questions in an already-started change are digression — do not abandon that change. This gate does not apply to /auth:to-openspec or /auth:to-plan.
After a Decide-job match on explore or change, coding-agent hosts also refuse self-contradictory IAM asks before Decide: when the same ask asserts mutually exclusive schemes without resolution (for example only stateless JWT and only server sessions), or both keeps current IAM and fully replaces it without stating which wins, the host analyzes the conflict in chat, asks you to restate a coherent requirement, and does not enter Decide intake for that ask. Underspecified-but-consistent asks still proceed. There is no contradiction slash intent.
Happy path (greenfield) — /auth:explore
Use this when you want interactive option walking: new product, no identity estate yet, or the approach is not locked. /auth:explore asks the host to write an IAM Brief and accept a slice before allocating AUTH-YYYY-NNNN and must not mark decisions accepted from slice-accept alone. After a slice is accepted_for_lock, Decide continues in the same session. /auth:to-openspec and /auth:to-plan intercept unfinished work instead of bouncing away when a gap is already actionable.
init → /auth:explore → (optional /auth:scan on intake) →
Brief + slice accept (native HITL when unbounded) → Decide in the same chat
(--analyze, Agenda next HITL, summary) →
--ready → request-match → confirm → detect OpenSpec →
/auth:to-openspec (OpenSpec apply + implement) | Plan mode + /auth:to-plan → /auth:review| Step | In the coding agent | Why |
|---|---|---|
| Setup | authright init (terminal once) | .authright/ + agent files for the host you pick |
| Open work | /auth:explore <intent> | Brief first (phase: slice, no AUTH- id until accepted_for_lock); then create/resume DRAFT. Intake may scan when context is missing or stale |
| Discover (optional) | /auth:scan | If a repo exists and context is empty/sparse — use chat, not bare terminal scan |
| Clarify | Present slice-accept when aperture is unbounded (Brief slice ids). Recommended ≠ selected. Do not start Decide until a slice is accepted_for_lock. Cancelled-empty does not start Decide. | Host judgment; bounded single slice skips the scope interview |
| Analyze | Skill drives offline --analyze after host writes judgment | Offline projection from host judgment + advisory decision-graph.yaml (ranking is not a Decision Lock). Host must already have written iam-shaped.yaml + alignment (binary does not call an LLM) |
| Inspect | Ask the agent / skill for change status | Status on the Auth Change record |
| Decide | Map slice picks; Agenda next HITL; fill analysis.md; edit decisions.yaml + contract.md | Accept decisions and fill the contract. Declared decision variables are projected offline; the host model writes alignment and wording. Related offers are not must slots and not Decision Gaps |
| Summary | Host-LLM, user-friendly | Architecture / technology / engineering strategy; still-pending items called out — not a YAML dump |
| Lock | Confirm in chat (skill runs --ready) | Requires non-placeholder contract.md Verification and answered/deferred dependents such as recovery_proof when account_recovery=self_service. Records LOCKED graph nodes, projects AuthRight Design, then DECIDED |
| Request match | /auth:request-match | Show where the locked plan still matches what you asked, and where it does not. Export waits until this check passes |
| Handoff | pick /auth:to-openspec or /auth:to-plan | Two handoff commands—pick one. If Decide is unfinished, finish that first; else OpenSpec (OpenSpec tool required) or Plan mode + to-plan |
| Check | /auth:review | Write semantic.md first, then mechanical verify |
Happy path (greenfield) — /auth:change
init → /auth:change → (optional scan on intake) →
Brief + slice accept → allocate → --analyze →
host applicability (closed / applies / negated / mismatched) → re-cascade →
auto-plan.yaml (resolved + unresolved) → NL → --set (batch) →
--confirm-plan → --ready → request-match →
detect OpenSpec → /auth:to-openspec | Plan mode + /auth:to-plan → /auth:review| Step | In the coding agent | Why |
|---|---|---|
| Open work | /auth:change <intent> | Host writes Brief; allocate/resume after accepted_for_lock; ambiguity lands as plan unresolved |
| Analyze + plan | Skill drives --analyze; host writes applicability.yaml; re-cascade / plan in chat | Offline engine maps applicability closed (situation_closed) and other allowed auto-fills; scan Domain Snapshot is feedstock, not a lock |
| Override | Answer open slots in chat (skill may --set); optional Related Enable | Batch assignments / Enable; recompute; confirmation resets to pending |
| Confirm | Confirm plan in chat (skill may --confirm-plan) | Only when unresolved is empty; remaining related offers do not block; host must not auto-confirm solely because cascade cleared |
| Lock → request-match → export | confirm → /auth:request-match → /auth:to-openspec | /auth:to-plan | Order is fixed; do not ready without confirm; do not skip request-match |
Happy path (brownfield)
Scan first so the chosen command is anchored in current context and the IAM Domain Snapshot. Then pick /auth:explore or /auth:change.
init → /auth:scan → pick /auth:explore or /auth:change →
on that Auth Change record: --analyze
(explore: Agenda HITL | change: plan / --set / --confirm-plan) →
--ready → request-match → /auth:to-openspec | Plan mode + /auth:to-plan → /auth:review| Step | In the coding agent | Why |
|---|---|---|
| Setup | authright init (terminal once) | .authright/ + agent files |
| Discover | /auth:scan | IAM Domain Snapshot + discovery classes (observe-only; a finding is not a Gap). Use chat—not bare terminal scan—for the LLM path |
| Pick explore | /auth:explore | Recommend-and-choose native HITL; recommended ≠ selected; applicability closed must not silent-answer HITL |
| Pick change | /auth:change | Auto-plan; situation closure (closed) and other allowed auto-fills map into plan; unresolved listed together |
| Inspect | Ask the agent for change status | Status (and plan) on the Auth Change record |
| Lock | Confirm in chat | After explore chooses cleared, or after change plan confirmed |
| Request match | /auth:request-match | After ready, before export. Export waits until this check passes |
| Handoff | /auth:to-openspec or /auth:to-plan | Stops if Decide is unfinished or request-match has not passed |
| Check | /auth:review | Write semantic.md first, then mechanical verify |
Document
Use /auth:doc (Cursor /auth-doc, Codex $authright-doc) when you want a readable write-up of decisions already on disk—approach, identity model, runtime behavior, risks you deferred, and checks to run when those are locked. Output goes under .authright/docs/ (or a change’s docs/ folder if you name an id). It does not change decisions, Design, or your app. There is no authright doc in the terminal.
Diagnose
Use /auth:doctor (Cursor /auth-doctor, Codex $authright-doctor) when you want to know what’s risky in the current code—missing login, open APIs, weak permissions, secrets or debug tools exposed. Prefer a prior /auth:scan. The report you should open is .authright/diagnosis/report.md: APIs and UI routes with file pointers, how someone could abuse them, and what data is at stake. Extra machine notes under .authright/findings/ are helpers, not the main report.
Doctor looks at your app source, not AuthRight’s own files under .authright/ (except writing the report). It is not /auth:doc, does not lock decisions, and does not patch code—follow up with explore or change when you’re ready to design a fix.
User Lifecycle & Assurance
When the request commits lifecycle / CIAM / integration concepts (sign-up, forgot-password, MFA manage, profile, linking, session revoke, provisioning, trusted-device, account closure, staged offboarding, guest checkout / pre-registration, device claim/reclaim, parental/family account, identity proofing, step-up, adaptive risk, organization tenancy, end-user consent, identity brokering), Decide asks the matching closed slots. They do not open on every IAM-shaped change. Staged offboarding (phased disable / transfer / archive) is distinct from end-user AccountClosure (close/delete account) — inventory leaver asks against StagedOffboarding, not close-account alone. GuestSubject (guest checkout / pre-registration) is distinct from AnonymousSubject (not-enforced anonymous principal). Analogue “login like Google”: inventory `social-rp` + concrete social IdPs (not only `authentication_method.social`). Cookie-flag-only deltas (Secure/HttpOnly/SameSite) bind SessionCookieHardening without forcing a full BFF SP pattern re-lock when IdP/client changes are non_goals. DSAR export (IdentityDsarExport) is a subject-data export path and is distinct from IdentityErasure (admin/compliance demonstrable erase) and from AccountClosure self-serve close-account. Erase workflows MUST kill sessions/refresh tokens (AccessRevocation) and MAY retain statutory authz evidence under AuditRetention (distinct from DevicePosture and from DSAR export). JWT audience claim validation (JwtAudienceValidation) is distinct from RFC 8707 ResourceIndicator. Mobile OIDC must call out SecureTokenStorage (Keychain/Keystore), not cookie hardening alone. Agent non-human identity is distinct from SPIFFE/SVID issuance; agent-on-call attribution is not generic Audit alone. Login a11y / CSS / dark-mode skins are out of Decide (non_goals). CRM KYC vendor flows stay adjacent unless the ask carves IAM step-up / IdentityProofing — see FAQ. Authentication methods include passkey, magic link, TOTP, social, push, and email OTP when seeded — not only password and mobile OTP. Integration Briefs bind authority IdPs (PingAM, SiteMinder, Keycloak, ForgeRock, Entra ID, Auth0, Okta, …) and social IdPs (GitHub, Google, Apple, Facebook, LinkedIn, Microsoft Account). Brownfield JAAS inventories may also bind tech.jaas-login-module, tech.pingam-webagent, NotEnforcedUrlPolicy, and AnonymousSubject when those catalog ids exist. SiteMinder + PingAM coexistence typically maps to SP multi-idp rather than collapsing SiteMinder into generic Session alone. Identity brokering is distinct from AccountLinking and from SP social-rp. Vendor overlays supply Capability names plus optional concept/IdP hints — not Decide locks. Dependent slots (login_identifier, recovery_proof, external_idp_set) follow option-gated cascade. No /auth:signup, /auth:devices, /auth:broker, /auth:siteminder, or /auth:webagent intents — see Concepts.
What not to do
- Don't invent
/auth:greenfield//auth:brownfield//auth:engineeringslash commands - Don't invent
/auth:signup//auth:profile//auth:devices//auth:broker//auth:siteminder//auth:webagentslash commands for lifecycle or brownfield agent coverage - Don't ask engineering mode (Keep vs Centralize) during
/auth:scan— style defaults to silentkeep_styleat--ready - Don't invent user NFRs when
request.mdis silent — baseline Implementer Engineering NFRs still export; UI/frontend themes use OpenSpec WHEN (honor WHEN; do not strip gates solely because scan found no UI surface) - Don't treat
/auth:to-openspecor/auth:to-planas user-intents equal to scan/explore/change/request-match/review/doctor - Don't invent
/auth:planas a Decide intent — Plan mode is a host UI mode; handoff is/auth:to-plan - Don't treat
/auth:docas changing your app or locking decisions—it only writes a summary document - Don't confuse
/auth:doctorwith/auth:doc—doctor reviews code risks; doc summarizes decisions - Don't expect doctor to redesign IAM or edit source—use explore or change next
- Don't bounce from handoff skills to explore/change when a gap is already actionable
- Don't run
/auth:to-planoutside Plan mode (skill interrupts); don't expectto-openspecwithout OpenSpec CLI - Don't auto-run
/auth:doctorjust because someone asked about risks in chat (hint after answering is fine) - Don't use Agenda
nextas the primary UX on/auth:changeauto-plan - Don't type product slash commands in the terminal—How commands work
Scan (or empty) then /auth:to-openspec with nothing in flight: hint /auth:explore or /auth:change. Export waits for an explicit continue confirm when nothing is pending — --ready is not silent.
Related
Existing projects
AuthRight is built for brownfield IAM: mixed IdPs, legacy sessions, partial OIDC, framework security that grew over years. You do not document the entire identity estate before the first useful change.
Examples
Short recipes for the AI coding agent + AuthRight path. Assume Installation and authright init are done. Type the host form in chat—not the terminal—for scan, Decide, handoff, and review. Bare authright scan / authright change --… in the shell are offline twins (no LLM). See How commands work.