[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69A7PZF6APKKF31YPFXNS0Z":3,"skill-same:01M69A7PZF6APKKF31YPFXNS0Z":67},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":47,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M69A7PZF6APKKF31YPFXNS0Z","pilotswarm-portal-app-reg",null,"Use when bringing up a PilotSwarm portal stamp with `PORTAL_AUTH_PROVIDER=entra` and no existing `PORTAL_AUTH_ENTRA_CLIENT_ID`. Drives the Entra app-registration step (create app, configure redirect URIs, optionally define app roles + require assignment, capture tenant\u002Fclient IDs). Skip entirely for `PORTAL_AUTH_PROVIDER=none` or when a client ID is already supplied.","microsoft\u002FPilotSwarm","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69A6RNK492A5JSNBTXANKX5",16,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fpilotswarm-portal-app-reg\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"pilotswarm portal app reg","reg","app","when","auth","tenant","Existing","for","with","id","roles","define","registration","provider","up","use","configure","ids","create app","create","2026-11-10 10:12:30",false,"---\nname: pilotswarm-portal-app-reg\ndescription: \"Use when bringing up a PilotSwarm portal stamp with `PORTAL_AUTH_PROVIDER=entra` and no existing `PORTAL_AUTH_ENTRA_CLIENT_ID`. Drives the Entra app-registration step (create app, configure redirect URIs, optionally define app roles + require assignment, capture tenant\u002Fclient IDs). Skip entirely for `PORTAL_AUTH_PROVIDER=none` or when a client ID is already supplied.\"\n---\n\n## Select the execution path\n\nRead `.github\u002FDEPLOYMENT.md` first. The commands below are operator-managed\nenvironment recipes. For this repository’s managed environment, local Azure or\nKubernetes mutations are not permitted. Identity setup is a one-time admin\nprerequisite; ongoing changes\u002Freset\u002Fteardown need an authorized maintenance\nAction, which is not currently supplied. Do not run these recipes locally as\na fallback. Preserve the selected auth posture; VPN steps apply only to a\nVPN-enabled target.\n\n\n# pilotswarm-portal-app-reg\n\nDrives the Entra app-registration step for a PilotSwarm portal stamp.\n\nThis skill is **optional** — only invoke it when the user wants\n`PORTAL_AUTH_PROVIDER=entra` AND does not already have a\n`PORTAL_AUTH_ENTRA_CLIENT_ID` to plug in. For `PORTAL_AUTH_PROVIDER=none`\n(open sandbox), skip the whole skill.\n\n## When to use this skill\n\n| User signal | Use this skill? |\n|---|---|\n| \"set up entra auth for a new stamp\" \u002F \"I need a client id\" \u002F new stamp with no opinion on auth wiring | **YES — create new (default recommendation)** |\n| \"add a new stamp to the existing app\" \u002F mentions sharing a client id \u002F wants single SSO consent across stamps | YES — `-ExistingAppId` mode |\n| \"production stamp, lock down access\" \u002F \"only certain people should sign in\" \u002F smoke-testing the role-driven authz | YES — create new with `-CreateAppRoles` and assign users to the `admin` \u002F `user` roles |\n| \"skip auth\" \u002F \"open sandbox\" \u002F `PORTAL_AUTH_PROVIDER=none` | NO — skip entirely |\n| User already pasted a `PORTAL_AUTH_ENTRA_CLIENT_ID` | NO — that value flows straight through to deploy |\n\n**Default posture: one dedicated app per stamp.** Recommend the\ncreate-new path unless the user explicitly asks to share an existing\napp. Per-stamp apps keep redirect URI lists short, make environment\nteardown a single `az ad app delete`, and isolate consent \u002F revocation\nblast radius. The script auto-derives a friendly, env-specific display\nname (`\"PilotSwarm Portal - \u003CEnvName>\"`) from `-EnvName` — do not\noverride unless the user asks.\n\nThe deployer agent **must decide the auth posture before opening the\nnew-env defaults table**, because the value of\n`PORTAL_AUTH_ENTRA_CLIENT_ID` depends on the outcome.\n\n## Service Tree ID for new app registrations (no default)\n\n`Setup-PortalAuth.ps1` requires `-ServiceTreeId` when creating a new\napp. Microsoft tenant policy rejects app registrations without a valid\n`serviceManagementReference`. Adding a redirect URI to an existing app\ndoes not create an app and does not require this parameter.\n\nBefore creating a new app, ask the user for their Service Tree ID. If they don't\nhave one registered for their PilotSwarm deployment, stop and direct\nthem to register one — the tenant will reject `az ad app create`\notherwise. Do **not** invent a placeholder GUID.\n\n## Underlying tooling\n\n| Script | Path | Purpose |\n|---|---|---|\n| `Setup-PortalAuth.ps1` | `deploy\u002Fscripts\u002Fauth\u002F` | Opinionated wrapper that produces the exact SPA-shaped app reg the portal expects |\n| `Create3PApplication.ps1` | `deploy\u002Fscripts\u002Fauth\u002F` | Generic Azure AD app primitive (reference; not used by the wrapper) |\n| `README.md` | `deploy\u002Fscripts\u002Fauth\u002F` | Operator docs |\n\nThe wrapper bakes in:\n- `signInAudience: AzureADMyOrg`\n- `serviceManagementReference: \u003C-ServiceTreeId>` (operator-supplied)\n- SPA platform (no Web reply URLs)\n- `implicitGrantSettings`: id-token + access-token issuance ON\n- **No MS Graph \u002F API permissions** declared. The portal does NOT call\n  any downstream API at runtime — group\u002Frole claims ride on the token\n  itself. SPA requests only OIDC standard scopes (`openid`, `profile`)\n  at sign-in, which require no consent. Future downstream API access\n  (e.g. ADO via OBO) belongs on per-purpose worker apps with their own\n  admin consent — see `docs\u002Fproposals\u002Fportal-auth-provider-and-authz.md`.\n- `groups` optional claim on `idToken`, `accessToken`, `saml2Token` with Default formatting\n- Owner = signed-in user\n- Service principal created\n\nOptional (off by default, opt-in with switches):\n- `-CreateAppRoles` defines two app roles (`admin`, `user`) that the\n  portal's role-driven authorization engine reads from the access token\n  (see `packages\u002Fapp\u002Fweb\u002Fauth\u002Fauthz\u002Fengine.js`)\n- `-AssignmentRequired` sets `appRoleAssignmentRequired=true` on the\n  service principal so only users\u002Fgroups explicitly assigned to the app\n  can obtain a token.\n\n  ⚠️ **Caveat — leave OFF by default.** In tenants where user-consent\n  is restricted to verified-publisher apps (e.g. the Microsoft corporate\n  tenant), turning this on causes the first sign-in by every assigned\n  principal to trip an AADSTS90094 admin-consent prompt for the OIDC\n  scopes (`openid profile offline_access`) against Microsoft Graph,\n  even though this app declares no API permissions. The workaround is\n  a per-user \"dance\" (flip off, sign in once to accept user-consent for\n  Graph, flip back on) or a tenant admin pre-granting the OIDC scopes.\n  The recommended lockdown posture uses `-CreateAppRoles` plus role\n  assignments in Entra, while leaving `appRoleAssignmentRequired=false`.\n  The role assignment list **is** the allowlist — the engine's\n  deny-by-default behavior rejects any signed-in principal without an\n  admin\u002Fuser role claim. See the posture matrix below.\n\nThese bakes are NOT user-configurable — they are the contract the\nPilotSwarm portal depends on. The script's parameters only cover the\nthings that vary per invocation.\n\n## Discovery (run before showing the table)\n\n```bash\naz account show --query \"{tenant:tenantId, user:user.name, userObjectId:id}\" -o json\n```\n\n- `tenant` → user's current tenant (used as `PORTAL_AUTH_ENTRA_TENANT_ID`)\n- `user` → suggested display-name suffix and known to the operator\n- The wrapper itself derives the owner objectId via `az ad signed-in-user show`,\n  but surface the UPN so the user knows whose name will be on the app\n\nIf the user provided an `EnvName` (stamp name) and a bicep-output cache\nexists, also surface the resolved redirect URI:\n\n```bash\n# Path: deploy\u002Fenvs\u002F\u003Cenv>\u002Fbicep-outputs.cache.json\n# Look for: portalFqdn | afdEndpointHostname | portalUrl | PORTAL_FQDN\n```\n\n## Present the full input surface upfront\n\nShow every parameter in a single table — same UX contract as\n`pilotswarm-new-env-deploy`. Mark each value `(default)`, `(discovered)`,\n`(required)`, or `(suggested)`:\n\n```\nMode\n  mode                     create-new (default)        # create-new | add-redirect-to-existing\n\nIdentity\n  ServiceTreeId            \u003Crequired for create-new; omit for existing app>\n  DisplayName              \u003Csuggested: \"PilotSwarm Portal - ${EnvName}\">\n  Owner                    \u003Cdiscovered: ${userObjectId} (${user})>\n  SkipGroupsClaim          false (default)             # keep groups claim ON for PORTAL_AUTH_ENTRA_*_GROUPS\n\nRole-driven authz (recommended for prod stamps)\n  CreateAppRoles           false (default)             # add 'admin' + 'user' app roles\n  AssignmentRequired       false (default, recommended OFF — see caveat in \"Underlying tooling\" above)\n\nRedirect URI (mode=create-new only)\n  EnvName                  \u003Crequired-or-pick-one>\n  RedirectUri              \u003Cauto-discover from EnvName, OR ask user explicitly>\n                           # leave both empty to create app shell first, add URI later\n\nExisting app (mode=add-redirect-to-existing)\n  ExistingAppId            \u003Crequired for this mode>\n  RedirectUri              \u003Crequired for this mode>\n\nOutput\n  OutputFile               deploy\u002Fenvs\u002F${EnvName}\u002Fentra-app.json (default when EnvName given)\n```\n\nState the chosen mode explicitly to the user before invoking. Confirm\nbefore running — this WRITES to Entra and creates a permanent app reg.\n\n## Decide app-role posture before invoking\n\nThere are three meaningful postures for a portal stamp; pick one with\nthe user:\n\n| Posture | Switches | Who can sign in | Who gets the `admin` role | When to use |\n|---|---|---|---|---|\n| **Open** | neither (and `PORTAL_AUTHZ_DEFAULT_ROLE=user` in `.env`) | Any tenant user | Nobody — every signed-in user gets `user` | Short-lived test stamps; pure sandbox where the portal is intentionally open to the whole tenant |\n| **Roles** (recommended for prod) | `-CreateAppRoles`, plus role assignments in Entra | Any tenant user can hit sign-in, but the engine denies anyone without an `admin` or `user` role claim | Users assigned to the `admin` app role via `Set-PortalAuthAssignments.ps1` or Enterprise apps > Users and groups | Production stamps. The role assignment in Entra **is** the allowlist; the engine is **deny-by-default** for principals with no admin\u002Fuser role. No env-var allowlist needed. |\n| **Roles + `appRoleAssignmentRequired=true`** (advanced opt-in) | `-CreateAppRoles -AssignmentRequired` | Only users\u002Fgroups explicitly assigned to a role | Same as above | Same use cases as the previous row, but adds a second gate at the Entra level. Requires per-user admin or self consent for the OIDC scopes against Microsoft Graph the first time anyone signs in — in restricted tenants this trips AADSTS90094. Prefer the previous row unless you have tenant-admin support to pre-grant. |\n| **Legacy email allowlist** (no roles) | neither, plus populate `PORTAL_AUTHZ_ADMIN_GROUPS` \u002F `PORTAL_AUTHZ_USER_GROUPS` in the stamp's `.env` | Any tenant user can hit sign-in; the engine denies anyone whose email is not on the list | Users whose email matches `PORTAL_AUTHZ_ADMIN_GROUPS` | Stamps that don't want to do per-stamp Entra role assignments. The engine consults these allowlists only when the JWT carries no `roles[]` claim — combining them with `-CreateAppRoles` is redundant (the role-authoritative branch wins). |\n\n**Deny-by-default is now in the engine** (since v0.1.33). When\n`PORTAL_AUTHZ_DEFAULT_ROLE` is unset or set to `none`, a principal that\ncarries no admin\u002Fuser role claim and matches no email allowlist is\ndenied at the portal layer — even when `appRoleAssignmentRequired` is\noff. Set `PORTAL_AUTHZ_DEFAULT_ROLE=user` to restore the legacy \"any\ntenant user gets `user`\" open posture (only do this for sandbox stamps).\n\n**Pick one mechanism per stamp.** The engine's role-authoritative\nbranch (see `packages\u002Fapp\u002Fweb\u002Fauth\u002Fauthz\u002Fengine.js`) ignores\n`PORTAL_AUTHZ_ADMIN_GROUPS` \u002F `PORTAL_AUTHZ_USER_GROUPS` whenever the\nJWT carries any `roles[]` claim. So if you chose **Roles**, do NOT\nalso populate the email allowlists — they are bypassed and become a\nsecond source of truth the next operator has to reconcile. The\nallowlists are only meaningful in the **Legacy email allowlist**\nposture (no `-CreateAppRoles`).\n\n**Assignment is a separate step.** This skill creates the app + role\ndefinitions, but does not assign any principals to them. Immediately\nafter invoking `Setup-PortalAuth.ps1 -CreateAppRoles`, use the\n[`pilotswarm-portal-auth-assignments`](..\u002Fpilotswarm-portal-auth-assignments\u002FSKILL.md)\nskill to assign at least one admin (default: the deploying user).\nWithout that, every sign-in is denied at the portal layer because no\none has the `admin` or `user` role claim yet.\n\n## Invocation\n\nAlways invoke `pwsh` directly. Do not wrap through `npm` — there is no\nnpm wrapper for this script intentionally (keeps the deploy npm pipeline\nfocused on what's controlled by `.env`).\n\n**Shell compatibility:** the script runs identically on Windows, Linux,\nand macOS as long as PowerShell 7+ (`pwsh`) is installed. From the\ncalling shell's perspective the invocation is a single `pwsh -File ...`\ntoken followed by named parameters — bash and pwsh handle it the same\nway. Use `\\` for line continuation in bash, `` ` `` (backtick) in pwsh.\nThe script uses forward-slash path separators and cross-platform pwsh\nAPIs internally. See `deploy\u002Fscripts\u002Fauth\u002FREADME.md` for `pwsh` install\ncommands per OS.\n\n**Shell quoting pitfalls** (read before running ad-hoc pwsh from another\nshell):\n\n- Always invoke this wrapper with `-File`, never `-Command`. `-File`\n  takes a path + named params and is immune to outer-shell expansion.\n- If you must run an ad-hoc snippet (e.g. a quick version probe), the\n  outer shell — whether PowerShell, bash, or zsh — will try to expand\n  `$VAR` and backticks before pwsh ever sees them. Two safe forms:\n  - `pwsh -Version` (no script needed — preferred for version checks)\n  - `pwsh -NoProfile -Command '\u003Csingle-quoted script>'` (single quotes\n    suppress outer-shell expansion in both bash and PowerShell)\n- Do **not** use `pwsh -Command \"$PSVersionTable…\"` from a PowerShell\n  parent — the parent evaluates `$PSVersionTable` first and passes\n  garbage to the child. The same trap applies to bash with `\"$VAR\"`.\n- For multi-line scripts, prefer a real `.ps1` file invoked with\n  `-File`. Inline `-Command` is for one-liners only.\n\n### Create new for a stamp (default — recommended)\n\n```bash\npwsh -NoProfile -ExecutionPolicy Bypass -File deploy\u002Fscripts\u002Fauth\u002FSetup-PortalAuth.ps1 \\\n  -ServiceTreeId \u003Cyour-service-tree-id> \\\n  -EnvName \u003Cstamp-name>\n```\n\n`-EnvName` does double duty: it sets the display name to\n`\"PilotSwarm Portal - \u003Cstamp-name>\"` automatically and tells the script\nwhere to read\u002Fwrite per-stamp artifacts. Do **not** pass `-DisplayName`\nunless the user wants a non-standard name.\n\nThis auto-discovers the redirect URI from\n`deploy\u002Fenvs\u002F\u003Cstamp>\u002Fbicep-outputs.cache.json` and writes a JSON summary\nto `deploy\u002Fenvs\u002F\u003Cstamp>\u002Fentra-app.json`. **AFD + VPN stamps**\n(`VPN_GATEWAY_ENABLED=true` with `EDGE_MODE=afd`) get **two** redirect\nURIs registered automatically: the AFD endpoint (public path) and the\nportal `PORTAL_HOSTNAME` (VPN-private path, served by the AppGw\nlistener behind the Private DNS A record). If the bicep cache doesn't\nexist yet (you're running BEFORE first deploy), keep `-EnvName` for the\ndisplay name and per-stamp output path, and add `-RedirectUri` once you\nknow the AFD endpoint (or omit it entirely to create the app shell now\nand append the URI after bicep runs):\n\n```bash\npwsh -NoProfile -ExecutionPolicy Bypass -File deploy\u002Fscripts\u002Fauth\u002FSetup-PortalAuth.ps1 \\\n  -ServiceTreeId \u003Cyour-service-tree-id> \\\n  -EnvName \u003Cstamp-name> \\\n  -RedirectUri \"https:\u002F\u002F\u003Cpredicted-afd-fqdn>\"\n```\n\n### Create new for a production stamp (roles — recommended)\n\n```bash\npwsh -NoProfile -ExecutionPolicy Bypass -File deploy\u002Fscripts\u002Fauth\u002FSetup-PortalAuth.ps1 \\\n  -ServiceTreeId \u003Cyour-service-tree-id> \\\n  -EnvName \u003Cstamp-name> \\\n  -CreateAppRoles\n```\n\nAfter this completes the operator MUST assign at least one admin via\n`Set-PortalAuthAssignments.ps1 -EnvName \u003Cstamp-name> -AdminAssignments \u003Cupn>`\n(or Entra portal > Enterprise applications > `\"PilotSwarm Portal - \u003Cstamp-name>\"` > Users and groups).\n\nThe portal engine is deny-by-default (since v0.1.33). With role\nassignments in place, assigned users get `admin` \u002F `user` from the JWT\n`roles` claim. Any tenant user can still hit the sign-in page (since\n`appRoleAssignmentRequired=false`), but the engine rejects them when\nthey arrive without a role claim. Do **not** also populate\n`PORTAL_AUTHZ_ADMIN_GROUPS` here — when the JWT carries `roles[]`, the\nengine's role-authoritative branch ignores the email allowlists\nentirely.\n\n### Advanced: roles + `appRoleAssignmentRequired=true` (Entra-level lockdown)\n\n```bash\npwsh -NoProfile -ExecutionPolicy Bypass -File deploy\u002Fscripts\u002Fauth\u002FSetup-PortalAuth.ps1 \\\n  -ServiceTreeId \u003Cyour-service-tree-id> \\\n  -EnvName \u003Cstamp-name> \\\n  -CreateAppRoles \\\n  -AssignmentRequired\n```\n\nUse only when you have tenant-admin support to pre-grant the OIDC\nscopes for the app, OR you accept that each assigned principal will\nneed to do the one-time consent dance described in the caveat above.\n\n### Add a stamp to a shared existing app\n\n```bash\npwsh -NoProfile -ExecutionPolicy Bypass -File deploy\u002Fscripts\u002Fauth\u002FSetup-PortalAuth.ps1 \\\n  -ExistingAppId \u003CappId> \\\n  -EnvName \u003Cstamp-name>\n```\n\n## After the script runs\n\nThe script prints two lines the user must paste somewhere:\n\n```\nPORTAL_AUTH_ENTRA_TENANT_ID = \u003CtenantId>\nPORTAL_AUTH_ENTRA_CLIENT_ID = \u003Cnew-app-id>\n```\n\nFor a stamp using the npm `new-env` orchestrator, the operator paths are:\n1. **If you have NOT scaffolded the stamp yet**: hand the values to the\n   user before `new-env` runs so they go into the scaffolded `.env`\n   in the right place.\n2. **If you ALREADY scaffolded with `PORTAL_AUTH_PROVIDER=none`**: the\n   user edits `deploy\u002Fenvs\u002F\u003Cstamp>\u002F.env` to flip provider to `entra`\n   and paste the two values, then re-runs deploy from the manifests\n   step (`node deploy\u002Fscripts\u002Fdeploy.mjs portal \u003Cstamp> --steps manifests,rollout`).\n\nFor the legacy bash AKS flow (`scripts\u002Fdeploy-aks.sh` \u002F\n`scripts\u002Fdeploy-portal.sh`), paste the values into `.env.remote`\n(or wherever your live cluster reads portal config from) and re-run\n`.\u002Fscripts\u002Fdeploy-portal.sh`.\n\nThe wrapper itself NEVER edits `.env` files — the operator pastes the\nvalues explicitly so they surface visibly.\n\n## Admin consent\n\n**Not required.** The portal app registration declares **no API\npermissions**. The SPA requests only OIDC standard scopes (`openid`,\n`profile`) at sign-in, which require no user or admin consent. The\nportal's own-API token (`\u003CclientId>\u002F.default` acquired silently after\nlogin) is a token to the portal's own app, not to any external resource,\nso it also requires no consent.\n\nThis is deliberate: the portal does **not** call MS Graph or any other\ndownstream API at runtime. Group and role claims that drive\nauthorization are sourced from the ID token directly:\n\n- Group membership via the `groups` optional claim configured on the\n  app registration (the wrapper applies this).\n- Role membership via Entra app-role assignments (created with\n  `-CreateAppRoles`, assigned via `Set-PortalAuthAssignments.ps1`).\n\nIf a user is a member of 200+ groups, Entra emits the `_claim_names` \u002F\n`hasGroups` overage indicator instead of an inline `groups` claim. The\nportal does not resolve overage (would require Graph and admin\nconsent). Stamps with overage-prone users should use the roles posture\n(`-CreateAppRoles`) instead of group-based authz.\n\n## Role assignments (when -CreateAppRoles is used)\n\nAfter the script creates the `admin` and `user` app roles, principals\nmust still be assigned. The script does NOT do this — it only defines\nthe roles. Use the dedicated assignments script + skill:\n\n- `deploy\u002Fscripts\u002Fauth\u002FSet-PortalAuthAssignments.ps1` — idempotent\n  add\u002Fremove\u002Flist. See\n  `.github\u002Fskills\u002Fpilotswarm-portal-auth-assignments\u002FSKILL.md`.\n- Entra portal (\"Enterprise applications > \u003Capp> > Users and groups\")\n  still works if you'd rather click.\n\nIf `-AssignmentRequired` is set and no one is assigned, sign-in fails\nwith `AADSTS50105: The signed in user is not assigned to a role for the\napplication`. Assign the operator FIRST so they can finish setting up.\n\nIf `-AssignmentRequired` is NOT set (the recommended default), the\n**portal engine** still enforces deny-by-default: a signed-in\nprincipal with no admin\u002Fuser role claim sees a \"You are not authorized\nto access this portal\" page rather than the app. Assign at least one\napp-role admin via `Set-PortalAuthAssignments.ps1` before the first\nsign-in so someone can actually reach the portal.\n\n## What this skill will not do\n\n- Will not write to `.env` files (operator surfaces values explicitly)\n- Will not assign users to app roles — use `Set-PortalAuthAssignments.ps1`\n- Will not modify the npm `new-env` \u002F `deploy` pipelines — they\n  continue to consume `PORTAL_AUTH_ENTRA_CLIENT_ID` as plain input\n- Will not provision app registrations of non-portal shapes — for\n  worker daemons or APIs, use `Create3PApplication.ps1` directly or\n  write a new wrapper\n- Will not invent a Service Tree ID when creating an app — operator must supply\n\n## Constraints\n\n- `-ServiceTreeId` is **mandatory for app creation by tenant policy** — refuse\n  to invent a placeholder. It is not required when appending a redirect URI.\n- Never run the wrapper against a non-target tenant — the script will\n  succeed but the app will be useless to your portal\n- Never propose granting `Application.ReadWrite.All`,\n  `GroupMember.Read.All`, `User.Read`, or any other delegated\u002Fapp\n  scope on the portal app — the portal declares **no API permissions**\n  at runtime. Downstream API access (e.g. ADO via OBO) belongs on\n  per-purpose worker apps, not the portal app\n- Re-running the wrapper against a legacy app reg (created before this\n  shape was canonized) will normalize `requiredResourceAccess` to `[]`\n  by removing dead-weight `User.Read`. This is intentional — `User.Read`\n  was declared but never actually used at runtime. Legacy users with\n  existing consent records are unaffected; the portal's `.default`\n  scope on its own clientId continues to work\n- Single-tenant only by design. Multi-tenant or personal-MSA sign-in is\n  out of scope for the wrapper; use `Create3PApplication.ps1` if you\n  need a different shape\n","## Select the execution path\n\nRead `.github\u002FDEPLOYMENT.md` first. The commands below are operator-managed\nenvironment recipes. For this repository’s managed environment, local Azure or\nKubernetes mutations are not permitted. Identity setup is a one-time admin\nprerequisite; ongoing changes\u002Freset\u002Fteardown need an authorized maintenance\nAction, which is not currently supplied. Do not run these recipes locally as\na fallback. Preserve the selected auth posture; VPN steps apply only to a\nVPN-enabled target.\n\n\n# pilotswarm-portal-app-reg\n\nDrives the Entra app-registration step for a PilotSwarm portal stamp.\n\nThis skill is **optional** — only invoke it when the user wants\n`PORTAL_AUTH_PROVIDER=entra` AND does not already have a\n`PORTAL_AUTH_ENTRA_CLIENT_ID` to plug in. For `PORTAL_AUTH_PROVIDER=none`\n(open sandbox), skip the whole skill.\n\n## When to use this skill\n\n| User signal | Use this skill? |\n|---|---|\n| \"set up entra auth for a new stamp\" \u002F \"I need a client id\" \u002F new stamp with no opinion on auth wiring | **YES — create new (default recommendation)** |\n| \"add a new stamp to the existing app\" \u002F mentions sharing a client id \u002F wants single SSO consent across stamps | YES — `-ExistingAppId` mode |\n| \"production stamp, lock down access\" \u002F \"only certain people should sign in\" \u002F smoke-testing the role-driven authz | YES — create new with `-CreateAppRoles` and assign users to the `admin` \u002F `user` roles |\n| \"skip auth\" \u002F \"open sandbox\" \u002F `PORTAL_AUTH_PROVIDER=none` | NO — skip entirely |\n| User already pasted a `PORTAL_AUTH_ENTRA_CLIENT_ID` | NO — that value flows straight through to deploy |\n\n**Default posture: one dedicated app per stamp.** Recommend the\ncreate-new path unless the user explicitly asks to share an existing\napp. Per-stamp apps keep redirect URI lists short, make environment\nteardown a single `az ad app delete`, and isolate consent \u002F revocation\nblast radius. The script auto-derives a friendly, env-specific display\nname (`\"PilotSwarm Portal - \u003CEnvName>\"`) from `-EnvName` — do not\noverride unless the user asks.\n\nThe deployer agent **must decide the auth posture before opening the\nnew-env defaults table**, because the value of\n`PORTAL_AUTH_ENTRA_CLIENT_ID` depends on the outcome.\n\n## Service Tree ID for new app registrations (no default)\n\n`Setup-PortalAuth.ps1` requires `-ServiceTreeId` when creating a new\napp. Microsoft tenant policy rejects app registrations without a valid\n`serviceManagementReference`. Adding a redirect URI to an existing app\ndoes not create an app and does not require this parameter.\n\nBefore creating a new app, ask the user for their Service Tree ID. If they don't\nhave one registered for their PilotSwarm deployment, stop and direct\nthem to register one — the tenant will reject `az ad app create`\notherwise. Do **not** invent a placeholder GUID.\n\n## Underlying tooling\n\n| Script | Path | Purpose |\n|---|---|---|\n| `Setup-PortalAuth.ps1` | `deploy\u002Fscripts\u002Fauth\u002F` | Opinionated wrapper that produces the exact SPA-shaped app reg the portal expects |\n| `Create3PApplication.ps1` | `deploy\u002Fscripts\u002Fauth\u002F` | Generic Azure AD app primitive (reference; not used by the wrapper) |\n| `README.md` | `deploy\u002Fscripts\u002Fauth\u002F` | Operator docs |\n\nThe wrapper bakes in:\n- `signInAudience: AzureADMyOrg`\n- `serviceManagementReference: \u003C-ServiceTreeId>` (operator-supplied)\n- SPA platform (no Web reply URLs)\n- `implicitGrantSettings`: id-token + access-token issuance ON\n- **No MS Graph \u002F API permissions** declared. The portal does NOT call\n  any downstream API at runtime — group\u002Frole claims ride on the token\n  itself. SPA requests only OIDC standard scopes (`openid`, `profile`)\n  at sign-in, which require no consent. Future downstream API access\n  (e.g. ADO via OBO) belongs on per-purpose worker apps with their own\n  admin consent — see `docs\u002Fproposals\u002Fportal-auth-provider-and-authz.md`.\n- `groups` optional claim on `idToken`, `accessToken`, `saml2Token` with Default formatting\n- Owner = signed-in user\n- Service principal created\n\nOptional (off by default, opt-in with switches):\n- `-CreateAppRoles` defines two app roles (`admin`, `user`) that the\n  portal's role-driven authorization engine reads from the access token\n  (see `packages\u002Fapp\u002Fweb\u002Fauth\u002Fauthz\u002Fengine.js`)\n- `-AssignmentRequired` sets `appRoleAssignmentRequired=true` on the\n  service principal so only users\u002Fgroups explicitly assigned to the app\n  can obtain a token.\n\n  ⚠️ **Caveat — leave OFF by default.** In tenants where user-consent\n  is restricted to verified-publisher apps (e.g. the Microsoft corporate\n  tenant), turning this on causes the first sign-in by every assigned\n  principal to trip an AADSTS90094 admin-consent prompt for the OIDC\n  scopes (`openid profile offline_access`) against Microsoft Graph,\n  even though this app declares no API permissions. The workaround is\n  a per-user \"dance\" (flip off, sign in once to accept user-consent for\n  Graph, flip back on) or a tenant admin pre-granting the OIDC scopes.\n  The recommended lockdown posture uses `-CreateAppRoles` plus role\n  assignments in Entra, while leaving `appRoleAssignmentRequired=false`.\n  The role assignment list **is** the allowlist — the engine's\n  deny-by-default behavior rejects any signed-in principal without an\n  admin\u002Fuser role claim. See the posture matrix below.\n\nThese bakes are NOT user-configurable — they are the contract the\nPilotSwarm portal depends on. The script's parameters only cover the\nthings that vary per invocation.\n\n## Discovery (run before showing the table)\n\n```bash\naz account show --query \"{tenant:tenantId, user:user.name, userObjectId:id}\" -o json\n```\n\n- `tenant` → user's current tenant (used as `PORTAL_AUTH_ENTRA_TENANT_ID`)\n- `user` → suggested display-name suffix and known to the operator\n- The wrapper itself derives the owner objectId via `az ad signed-in-user show`,\n  but surface the UPN so the user knows whose name will be on the app\n\nIf the user provided an `EnvName` (stamp name) and a bicep-output cache\nexists, also surface the resolved redirect URI:\n\n```bash\n# Path: deploy\u002Fenvs\u002F\u003Cenv>\u002Fbicep-outputs.cache.json\n# Look for: portalFqdn | afdEndpointHostname | portalUrl | PORTAL_FQDN\n```\n\n## Present the full input surface upfront\n\nShow every parameter in a single table — same UX contract as\n`pilotswarm-new-env-deploy`. Mark each value `(default)`, `(discovered)`,\n`(required)`, or `(suggested)`:\n\n```\nMode\n  mode                     create-new (default)        # create-new | add-redirect-to-existing\n\nIdentity\n  ServiceTreeId            \u003Crequired for create-new; omit for existing app>\n  DisplayName              \u003Csuggested: \"PilotSwarm Portal - ${EnvName}\">\n  Owner                    \u003Cdiscovered: ${userObjectId} (${user})>\n  SkipGroupsClaim          false (default)             # keep groups claim ON for PORTAL_AUTH_ENTRA_*_GROUPS\n\nRole-driven authz (recommended for prod stamps)\n  CreateAppRoles           false (default)             # add 'admin' + 'user' app roles\n  AssignmentRequired       false (default, recommended OFF — see caveat in \"Underlying tooling\" above)\n\nRedirect URI (mode=create-new only)\n  EnvName                  \u003Crequired-or-pick-one>\n  RedirectUri              \u003Cauto-discover from EnvName, OR ask user explicitly>\n                           # leave both empty to create app shell first, add URI later\n\nExisting app (mode=add-redirect-to-existing)\n  ExistingAppId            \u003Crequired for this mode>\n  RedirectUri              \u003Crequired for this mode>\n\nOutput\n  OutputFile               deploy\u002Fenvs\u002F${EnvName}\u002Fentra-app.json (default when EnvName given)\n```\n\nState the chosen mode explicitly to the user before invoking. Confirm\nbefore running — this WRITES to Entra and creates a permanent app reg.\n\n## Decide app-role posture before invoking\n\nThere are three meaningful postures for a portal stamp; pick one with\nthe user:\n\n| Posture | Switches | Who can sign in | Who gets the `admin` role | When to use |\n|---|---|---|---|---|\n| **Open** | neither (and `PORTAL_AUTHZ_DEFAULT_ROLE=user` in `.env`) | Any tenant user | Nobody — every signed-in user gets `user` | Short-lived test stamps; pure sandbox where the portal is intentionally open to the whole tenant |\n| **Roles** (recommended for prod) | `-CreateAppRoles`, plus role assignments in Entra | Any tenant user can hit sign-in, but the engine denies anyone without an `admin` or `user` role claim | Users assigned to the `admin` app role via `Set-PortalAuthAssignments.ps1` or Enterprise apps > Users and groups | Production stamps. The role assignment in Entra **is** the allowlist; the engine is **deny-by-default** for principals with no admin\u002Fuser role. No env-var allowlist needed. |\n| **Roles + `appRoleAssignmentRequired=true`** (advanced opt-in) | `-CreateAppRoles -AssignmentRequired` | Only users\u002Fgroups explicitly assigned to a role | Same as above | Same use cases as the previous row, but adds a second gate at the Entra level. Requires per-user admin or self consent for the OIDC scopes against Microsoft Graph the first time anyone signs in — in restricted tenants this trips AADSTS90094. Prefer the previous row unless you have tenant-admin support to pre-grant. |\n| **Legacy email allowlist** (no roles) | neither, plus populate `PORTAL_AUTHZ_ADMIN_GROUPS` \u002F `PORTAL_AUTHZ_USER_GROUPS` in the stamp's `.env` | Any tenant user can hit sign-in; the engine denies anyone whose email is not on the list | Users whose email matches `PORTAL_AUTHZ_ADMIN_GROUPS` | Stamps that don't want to do per-stamp Entra role assignments. The engine consults these allowlists only when the JWT carries no `roles[]` claim — combining them with `-CreateAppRoles` is redundant (the role-authoritative branch wins). |\n\n**Deny-by-default is now in the engine** (since v0.1.33). When\n`PORTAL_AUTHZ_DEFAULT_ROLE` is unset or set to `none`, a principal that\ncarries no admin\u002Fuser role claim and matches no email allowlist is\ndenied at the portal layer — even when `appRoleAssignmentRequired` is\noff. Set `PORTAL_AUTHZ_DEFAULT_ROLE=user` to restore the legacy \"any\ntenant user gets `user`\" open posture (only do this for sandbox stamps).\n\n**Pick one mechanism per stamp.** The engine's role-authoritative\nbranch (see `packages\u002Fapp\u002Fweb\u002Fauth\u002Fauthz\u002Fengine.js`) ignores\n`PORTAL_AUTHZ_ADMIN_GROUPS` \u002F `PORTAL_AUTHZ_USER_GROUPS` whenever the\nJWT carries any `roles[]` claim. So if you chose **Roles**, do NOT\nalso populate the email allowlists — they are bypassed and become a\nsecond source of truth the next operator has to reconcile. The\nallowlists are only meaningful in the **Legacy email allowlist**\nposture (no `-CreateAppRoles`).\n\n**Assignment is a separate step.** This skill creates the app + role\ndefinitions, but does not assign any principals to them. Immediately\nafter invoking `Setup-PortalAuth.ps1 -CreateAppRoles`, use the\n[`pilotswarm-portal-auth-assignments`](..\u002Fpilotswarm-portal-auth-assignments\u002FSKILL.md)\nskill to assign at least one admin (default: the deploying user).\nWithout that, every sign-in is denied at the portal layer because no\none has the `admin` or `user` role claim yet.\n\n## Invocation\n\nAlways invoke `pwsh` directly. Do not wrap through `npm` — there is no\nnpm wrapper for this script intentionally (keeps the deploy npm pipeline\nfocused on what's controlled by `.env`).\n\n**Shell compatibility:** the script runs identically on Windows, Linux,\nand macOS as long as PowerShell 7+ (`pwsh`) is installed. From the\ncalling shell's perspective the invocation is a single `pwsh -File ...`\ntoken followed by named parameters — bash and pwsh handle it the same\nway. Use `\\` for line continuation in bash, `` ` `` (backtick) in pwsh.\nThe script uses forward-slash path separators and cross-platform pwsh\nAPIs internally. See `deploy\u002Fscripts\u002Fauth\u002FREADME.md` for `pwsh` install\ncommands per OS.\n\n**Shell quoting pitfalls** (read before running ad-hoc pwsh from another\nshell):\n\n- Always invoke this wrapper with `-File`, never `-Command`. `-File`\n  takes a path + named params and is immune to outer-shell expansion.\n- If you must run an ad-hoc snippet (e.g. a quick version probe), the\n  outer shell — whether PowerShell, bash, or zsh — will try to expand\n  `$VAR` and backticks before pwsh ever sees them. Two safe forms:\n  - `pwsh -Version` (no script needed — preferred for version checks)\n  - `pwsh -NoProfile -Command '\u003Csingle-quoted script>'` (single quotes\n    suppress outer-shell expansion in both bash and PowerShell)\n- Do **not** use `pwsh -Command \"$PSVersionTable…\"` from a PowerShell\n  parent — the parent evaluates `$PSVersionTable` first and passes\n  garbage to the child. The same trap applies to bash with `\"$VAR\"`.\n- For multi-line scripts, prefer a real `.ps1` file invoked with\n  `-File`. Inline `-Command` is for one-liners only.\n\n### Create new for a stamp (default — recommended)\n\n```bash\npwsh -NoProfile -ExecutionPolicy Bypass -File deploy\u002Fscripts\u002Fauth\u002FSetup-PortalAuth.ps1 \\\n  -ServiceTreeId \u003Cyour-service-tree-id> \\\n  -EnvName \u003Cstamp-name>\n```\n\n`-EnvName` does double duty: it sets the display name to\n`\"PilotSwarm Portal - \u003Cstamp-name>\"` automatically and tells the script\nwhere to read\u002Fwrite per-stamp artifacts. Do **not** pass `-DisplayName`\nunless the user wants a non-standard name.\n\nThis auto-discovers the redirect URI from\n`deploy\u002Fenvs\u002F\u003Cstamp>\u002Fbicep-outputs.cache.json` and writes a JSON summary\nto `deploy\u002Fenvs\u002F\u003Cstamp>\u002Fentra-app.json`. **AFD + VPN stamps**\n(`VPN_GATEWAY_ENABLED=true` with `EDGE_MODE=afd`) get **two** redirect\nURIs registered automatically: the AFD endpoint (public path) and the\nportal `PORTAL_HOSTNAME` (VPN-private path, served by the AppGw\nlistener behind the Private DNS A record). If the bicep cache doesn't\nexist yet (you're running BEFORE first deploy), keep `-EnvName` for the\ndisplay name and per-stamp output path, and add `-RedirectUri` once you\nknow the AFD endpoint (or omit it entirely to create the app shell now\nand append the URI after bicep runs):\n\n```bash\npwsh -NoProfile -ExecutionPolicy Bypass -File deploy\u002Fscripts\u002Fauth\u002FSetup-PortalAuth.ps1 \\\n  -ServiceTreeId \u003Cyour-service-tree-id> \\\n  -EnvName \u003Cstamp-name> \\\n  -RedirectUri \"https:\u002F\u002F\u003Cpredicted-afd-fqdn>\"\n```\n\n### Create new for a production stamp (roles — recommended)\n\n```bash\npwsh -NoProfile -ExecutionPolicy Bypass -File deploy\u002Fscripts\u002Fauth\u002FSetup-PortalAuth.ps1 \\\n  -ServiceTreeId \u003Cyour-service-tree-id> \\\n  -EnvName \u003Cstamp-name> \\\n  -CreateAppRoles\n```\n\nAfter this completes the operator MUST assign at least one admin via\n`Set-PortalAuthAssignments.ps1 -EnvName \u003Cstamp-name> -AdminAssignments \u003Cupn>`\n(or Entra portal > Enterprise applications > `\"PilotSwarm Portal - \u003Cstamp-name>\"` > Users and groups).\n\nThe portal engine is deny-by-default (since v0.1.33). With role\nassignments in place, assigned users get `admin` \u002F `user` from the JWT\n`roles` claim. Any tenant user can still hit the sign-in page (since\n`appRoleAssignmentRequired=false`), but the engine rejects them when\nthey arrive without a role claim. Do **not** also populate\n`PORTAL_AUTHZ_ADMIN_GROUPS` here — when the JWT carries `roles[]`, the\nengine's role-authoritative branch ignores the email allowlists\nentirely.\n\n### Advanced: roles + `appRoleAssignmentRequired=true` (Entra-level lockdown)\n\n```bash\npwsh -NoProfile -ExecutionPolicy Bypass -File deploy\u002Fscripts\u002Fauth\u002FSetup-PortalAuth.ps1 \\\n  -ServiceTreeId \u003Cyour-service-tree-id> \\\n  -EnvName \u003Cstamp-name> \\\n  -CreateAppRoles \\\n  -AssignmentRequired\n```\n\nUse only when you have tenant-admin support to pre-grant the OIDC\nscopes for the app, OR you accept that each assigned principal will\nneed to do the one-time consent dance described in the caveat above.\n\n### Add a stamp to a shared existing app\n\n```bash\npwsh -NoProfile -ExecutionPolicy Bypass -File deploy\u002Fscripts\u002Fauth\u002FSetup-PortalAuth.ps1 \\\n  -ExistingAppId \u003CappId> \\\n  -EnvName \u003Cstamp-name>\n```\n\n## After the script runs\n\nThe script prints two lines the user must paste somewhere:\n\n```\nPORTAL_AUTH_ENTRA_TENANT_ID = \u003CtenantId>\nPORTAL_AUTH_ENTRA_CLIENT_ID = \u003Cnew-app-id>\n```\n\nFor a stamp using the npm `new-env` orchestrator, the operator paths are:\n1. **If you have NOT scaffolded the stamp yet**: hand the values to the\n   user before `new-env` runs so they go into the scaffolded `.env`\n   in the right place.\n2. **If you ALREADY scaffolded with `PORTAL_AUTH_PROVIDER=none`**: the\n   user edits `deploy\u002Fenvs\u002F\u003Cstamp>\u002F.env` to flip provider to `entra`\n   and paste the two values, then re-runs deploy from the manifests\n   step (`node deploy\u002Fscripts\u002Fdeploy.mjs portal \u003Cstamp> --steps manifests,rollout`).\n\nFor the legacy bash AKS flow (`scripts\u002Fdeploy-aks.sh` \u002F\n`scripts\u002Fdeploy-portal.sh`), paste the values into `.env.remote`\n(or wherever your live cluster reads portal config from) and re-run\n`.\u002Fscripts\u002Fdeploy-portal.sh`.\n\nThe wrapper itself NEVER edits `.env` files — the operator pastes the\nvalues explicitly so they surface visibly.\n\n## Admin consent\n\n**Not required.** The portal app registration declares **no API\npermissions**. The SPA requests only OIDC standard scopes (`openid`,\n`profile`) at sign-in, which require no user or admin consent. The\nportal's own-API token (`\u003CclientId>\u002F.default` acquired silently after\nlogin) is a token to the portal's own app, not to any external resource,\nso it also requires no consent.\n\nThis is deliberate: the portal does **not** call MS Graph or any other\ndownstream API at runtime. Group and role claims that drive\nauthorization are sourced from the ID token directly:\n\n- Group membership via the `groups` optional claim configured on the\n  app registration (the wrapper applies this).\n- Role membership via Entra app-role assignments (created with\n  `-CreateAppRoles`, assigned via `Set-PortalAuthAssignments.ps1`).\n\nIf a user is a member of 200+ groups, Entra emits the `_claim_names` \u002F\n`hasGroups` overage indicator instead of an inline `groups` claim. The\nportal does not resolve overage (would require Graph and admin\nconsent). Stamps with overage-prone users should use the roles posture\n(`-CreateAppRoles`) instead of group-based authz.\n\n## Role assignments (when -CreateAppRoles is used)\n\nAfter the script creates the `admin` and `user` app roles, principals\nmust still be assigned. The script does NOT do this — it only defines\nthe roles. Use the dedicated assignments script + skill:\n\n- `deploy\u002Fscripts\u002Fauth\u002FSet-PortalAuthAssignments.ps1` — idempotent\n  add\u002Fremove\u002Flist. See\n  `.github\u002Fskills\u002Fpilotswarm-portal-auth-assignments\u002FSKILL.md`.\n- Entra portal (\"Enterprise applications > \u003Capp> > Users and groups\")\n  still works if you'd rather click.\n\nIf `-AssignmentRequired` is set and no one is assigned, sign-in fails\nwith `AADSTS50105: The signed in user is not assigned to a role for the\napplication`. Assign the operator FIRST so they can finish setting up.\n\nIf `-AssignmentRequired` is NOT set (the recommended default), the\n**portal engine** still enforces deny-by-default: a signed-in\nprincipal with no admin\u002Fuser role claim sees a \"You are not authorized\nto access this portal\" page rather than the app. Assign at least one\napp-role admin via `Set-PortalAuthAssignments.ps1` before the first\nsign-in so someone can actually reach the portal.\n\n## What this skill will not do\n\n- Will not write to `.env` files (operator surfaces values explicitly)\n- Will not assign users to app roles — use `Set-PortalAuthAssignments.ps1`\n- Will not modify the npm `new-env` \u002F `deploy` pipelines — they\n  continue to consume `PORTAL_AUTH_ENTRA_CLIENT_ID` as plain input\n- Will not provision app registrations of non-portal shapes — for\n  worker daemons or APIs, use `Create3PApplication.ps1` directly or\n  write a new wrapper\n- Will not invent a Service Tree ID when creating an app — operator must supply\n\n## Constraints\n\n- `-ServiceTreeId` is **mandatory for app creation by tenant policy** — refuse\n  to invent a placeholder. It is not required when appending a redirect URI.\n- Never run the wrapper against a non-target tenant — the script will\n  succeed but the app will be useless to your portal\n- Never propose granting `Application.ReadWrite.All`,\n  `GroupMember.Read.All`, `User.Read`, or any other delegated\u002Fapp\n  scope on the portal app — the portal declares **no API permissions**\n  at runtime. Downstream API access (e.g. ADO via OBO) belongs on\n  per-purpose worker apps, not the portal app\n- Re-running the wrapper against a legacy app reg (created before this\n  shape was canonized) will normalize `requiredResourceAccess` to `[]`\n  by removing dead-weight `User.Read`. This is intentional — `User.Read`\n  was declared but never actually used at runtime. Legacy users with\n  existing consent records are unaffected; the portal's `.default`\n  scope on its own clientId continues to work\n- Single-tenant only by design. Multi-tenant or personal-MSA sign-in is\n  out of scope for the wrapper; use `Create3PApplication.ps1` if you\n  need a different shape\n",{"name":5,"description":7},"main","cecafe1ca7a9f2778a6166abdd12f6165d99f777",".github\u002Fskills\u002Fpilotswarm-portal-app-reg",10,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-15 00:36:04",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add microsoft\u002FPilotSwarm --skill pilotswarm-portal-app-reg",{"tool":59,"command":60},"bunx","bunx skills add microsoft\u002FPilotSwarm --skill pilotswarm-portal-app-reg",{"tool":62,"command":63},"pnpm","pnpm dlx skills add microsoft\u002FPilotSwarm --skill pilotswarm-portal-app-reg","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Fpilotswarm-portal-app-reg\u002FSKILL.md",true,[],[68,76,83,90,97,104],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":75},"01M760N7TCZBTY635MYZQ8YAB0","workflow-testing","Load before you test a Workflow with mocked effects — the test, test_respond and test_advance operations, fixtures, interception ids, valid answers, the virtual clock, test evidence and what a test run does not prove.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Ftest-mode-skills\u002Fworkflow-testing\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":75},"01M760N4RKD6BMYPGHD490SNN2","workflow-tools","Every argument of the Workflow tools, testing a revision, package definitions and the refusals you can fix. Load when a Workflow tool's short description is not enough.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-tools\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":75},"01M760N1P2VTGVE6C4N5WF3FVR","workflow-reference","Field reference for Workflow YAML (root keys, every state type, bindings, outputs, runtime error codes), what the engine guarantees, and a review fan-out example. For design, call load_skill with name workflow-authoring.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-reference\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":75},"01M760MZ5CFSAX4FYMEXZJBGM2","workflow-patterns","Load when one Workflow must run different nodes in its branches at the same time (a different prompt or model for each branch), or loops back to a state (a polling loop). Named branches, the router pattern, examples that compile.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-patterns\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":75},"01M760MWKBDJFEECRFAF3BAVQ2","workflow-authoring","Load before you create, edit, publish or run a Workflow (pilotswarm.dev\u002Fv1) — choosing states, bounded graphs, bindings, typed contracts, agent and parallel states, the lifecycle and failure diagnosis.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002Fpackages\u002Fsdk\u002Fplugins\u002Fworkflow\u002Fskills\u002Fworkflow-authoring\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":75},"01M760MN4Y9199ARAY85DWD08X","tla-formal-validation","Required for any change to the core orchestrations (the durable session orchestration, session hydration and dehydration, and the Workflow controller and store). Teaches how to model the change in TLA+, update the existing models, run TLC with the repo runner, read the results, turn a counterexample into a fix and a regression test, and record the binding to the code.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FPilotSwarm\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftla-formal-validation\u002FSKILL.md",[],[]]