skills/oracle-idcs-org-provisioning/SKILL.md
Use when mapping IDCS claims to org membership after OAuth login succeeds. Covers mapProfileToUser, session.create.before, session.create.after hooks, MERGE INTO upserts, tenant-org mapping, and first-admin bootstrap. Keywords: IDCS groups, org_members, provisioning, session hooks, tenant map, MERGE INTO.
npx skillsauth add acedergren/agentic-tools oracle-idcs-org-provisioningInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use when login succeeds but tenant, role, or org membership still has to become real in Oracle.
mapProfileToUser)session.create.before when explicit allow-rules existorg_members in session.create.afterSELECT then INSERT into org_members — use atomic MERGE INTO or concurrent logins corrupt membershipbefore and expect them still available in after — use stash/peek/consume patterngroups claim is a provisioning bug — check scope config and IDCS app firstThese answer different questions:
before hook): can this user enter at all? Controlled by DB-configured allow-groups. Fail closed only when explicit allow-groups exist; fail open otherwise.after hook): which role do they get? Controlled by group→role mapping and env defaults.Mixing them produces false lockouts: a user passes the access gate but gets the wrong role because the gating logic short-circuited role resolution.
Always use this order — never skip a level for "simplicity":
org_membersChanging this order mid-deployment breaks re-login for users who were previously assigned via a higher-precedence rule.
Fresh installs have zero admin-group config. If an org has no admin yet, promote the first provisioned user to admin once. Without this gate, the system is unbootstrappable — no one can configure allow-groups because no one has admin rights.
Hooks run in separate request lifecycles. The claim set from mapProfileToUser is not available in session.create.after without explicit passing:
stash(sub, claims) in profile mappingpeek(sub) in before (read without clearing)consume(sub) in after (read and clear)Using a short-lived in-memory cache keyed by sub is the standard pattern. TTL of ~30s is sufficient.
| Situation | Decision |
|---|---|
| No groups claim | Check scope and IDCS app config before touching provisioning code |
| No explicit DB allow-groups | Fail open — no lockout |
| DB lookup or write fails | Fail open for login, log it — lockout must never be the default outcome |
| Org has no admin yet | Promote first provisioned user once |
# Preview group → role mapping
node scripts/preview-group-role-mapping.js "PortalAdmins,Developers"
# Preview org resolution
node scripts/verify-org-resolution.js --tenant sandbox --map "sandbox:org-123,prod:org-999" --default-org org-000
$ARGUMENTS: Optional provisioning focus
tenant-map — focus on tenant→org resolutionfirst-admin — focus on bootstrap logicdevelopment
--- name: api-audit description: "Use when auditing API routes for schema drift, missing auth, or validation gaps. Scans routes against shared TypeScript types to find mismatches, missing middleware, and undocumented endpoints. Read-only — produces a severity-grouped report. Keywords: audit routes, schema drift, auth gaps, missing validation, type mismatch, orphaned schemas. Triggers on "audit API routes" or "find schema drift"." --- # API Route & Type Audit Skill ## When to Use Load this skil
development
Use when drafting, translating, polishing, or reviewing Swedish text so it sounds natural, fluent, contemporary, and appropriate for its audience. Triggers include "write better Swedish", "make this sound natural in Swedish", "translate into Swedish", "polish this Swedish", "tech company Swedish", "contemporary Swedish words", "Swedish developer docs", and "avoid Anglicisms".
development
Use when working with shadcn-svelte components, TanStack Table in Svelte 5, or Tailwind v4.1. Covers non-obvious reactivity bugs, library selection trade-offs, and migration pitfalls not in the official docs. Keywords: shadcn-svelte, TanStack Table, Tailwind v4.1, Svelte 5 runes, bits-ui, superforms, data table, svelte-check.
development
Use when setting up Better Auth with Oracle IDCS/OCI IAM, configuring OIDC callback URLs, trusted origins, provider bootstrap order, or sharing an auth model between Fastify and Next.js. Entry point for the full auth foundation — routes to bridge or provisioning skills when narrowed. Keywords: Oracle IDCS, OCI IAM, Better Auth, OIDC, Fastify auth, Next.js auth, callback URL, trusted origins, provider bootstrap.