[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M735KVRPBVD1GAT5D508TKDK":3,"skill-same:01M735KVRPBVD1GAT5D508TKDK":105},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":14,"repositoryHtmlUrl":32,"repositoryHomepageUrl":6,"ownerHtmlUrl":33,"ownerBlogUrl":34,"ownerDescription":35,"updatedAt":36,"install":37,"resources":50},"01M735KVRPBVD1GAT5D508TKDK","react-webapp",null,"How to build a React SPA on the platform — project layout, the build-verify command, and this stack's constraints and pitfalls. Apply when a component's `type` is `web-application`.","wso2\u002Flabs-agentic-engineer","wso2","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F533043?v=4","01M6CDAFS40T9Y86DYXWE0NJES","WSO2","01M735EE4N2PP2ZR56AX7DNPNP",24,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: react-webapp\ndescription: \"How to build a React SPA on the platform — project layout, the build-verify command, and this stack's constraints and pitfalls. Apply when a component's `type` is `web-application`.\"\nmetadata:\n  aep:\n    kind: org\n    audience: [coding]\n---\n\n# React Webapp\n\nA web-app on this platform: a Vite + TS SPA built to static files, served by\nstock `nginx:alpine`. The image is **byte-identical across every environment**.\nPer-env values the **browser** needs (OIDC config, flags) arrive at request time\nin `window._env_`, never at build time. Sibling API addresses are **not**\nbrowser config — they are pod env for nginx.\n\n## Development flow\n\n1. **Scaffold** per Layout, including the nginx drop-in copy in step 1 of Layout.\n   Read [mock-mode.md](references\u002Fmock-mode.md) and include its dependencies in\n   `package.json`, then install **once** with the complete dependency set — npm\n   can only satisfy a peer set it sees all at once, and a package added to an\n   already-resolved tree costs a second full resolve at best. With a design\n   system, its own Setup step IS that install (it writes the manifest and runs\n   `npm install` itself); without one, `npm install`.\n2. **Prepare shared interfaces** — write `src\u002Fenv.ts`, generate `src\u002Fgenerated\u002F`\n   from each dependency's OpenAPI contract, and write `src\u002Fapi.ts` with a\n   **same-origin** `baseUrl`. With auth, copy `thunder-authentication`'s\n   `assets\u002Fapp\u002F` tree (one `cp -r`, which lays down `src\u002Fauthz\u002F` and\n   `mock\u002Fauthz\u002F`), set the `USER_AUTH_` prefix in `src\u002Fauthz\u002Fsession.ts` (mock\n   mode substitutes that module), and run `npm run gen` once so the three\n   generated tables exist for the type-check.\n3. **Implement pages** — follow Constraints, and check `src\u002Fapi.ts` against the\n   **first** page with `npx tsc --noEmit` before writing the rest: that pair proves\n   how the generated client types, and every later page repeats the pattern.\n   The prototype (`specs\u002Fdesign\u002Fcomponents\u002F\u003Cname>\u002Fprototype.json` and\n   `prototype.tsx`) is the screen contract. Before the first page, read\n   `${AEP_SKILLS_DIR:-.claude\u002Fskills}\u002Fprototype\u002Freferences\u002Fimplementing.md`.\n4. **Mock mode** — author `mock\u002F` per `references\u002Fmock-mode.md`, including the four\n   wiring files in its §2. It stands the same app up with no cluster, no sibling\n   service and no IDP behind it — with the API gateway's own refusals modelled\n   from `openapi.yaml`, so a role that cannot reach a screen fails here the way\n   it fails in a cell. The build eliminates all of it as dead code.\n5. **Verify** — from the app path:\n   ```bash\n   npm install                   # regenerates package-lock.json\n   # ← the design system's check goes here (see below)\n   npm run gen                   # with auth: so the standalone tsc below reads a\n                                 # fresh table (`npm run build` re-runs it)\n   npx tsc --noEmit              # type-check without emitting\n   npm run build                 # actually build\n   ! grep -rq mockServiceWorker dist\u002F # the bundle carries no mock — step 4\n   git status --porcelain --ignored=matching -- . \\\n     | grep '^!!' | grep -vE 'node_modules|dist'   # ← output MUST be empty\n   ```\n   Commit the `package-lock.json` this produces. Never commit `node_modules\u002F`.\n\n   **The last line is not a formality.** Every step above it reads your working\n   tree; the cluster builds the *committed* tree of this folder alone. A build\n   input that git ignores is present for all four checks and absent from the\n   image, and git will not tell you: `git add \u003Capp-path>` skips an ignored file\n   **silently, exit 0**, and leaves `git status` clean. `src\u002Fgenerated\u002F` is the\n   one that bites, because the repo-root `.gitignore` is shared with backend\n   components that legitimately ignore a `generated\u002F` directory — an unanchored\n   pattern there reaches down into this app. `--ignored=matching` is what makes\n   those paths visible; `node_modules` and `dist` are the only two the builder\n   stage makes for itself, which is why they are the only two filtered out.\n   A `!!` line naming anything else means the image will not carry that file.\n   Fix the pattern (anchor it in the repo-root `.gitignore`), never `git add -f`.\n\n   **The design-system skill contributes one step to this sequence**, and it is\n   mandatory: run the command its own Verify section names, after `npm install`\n   and before the type-check, and treat a non-zero exit exactly like a failing\n   build. That slot exists because a design system's own wiring — a missing\n   build plugin, an unimported theme, a peer-dependency mismatch — is the one\n   class of fault `tsc` and `vite build` cannot see: it type-checks and builds\n   perfectly clean, then renders an unstyled page in the cluster. If the pinned\n   design-system skill names no such command, the sequence is just the five\n   above.\n\n   The `build` script is `tsc --noEmit && vite build` — **not** `tsc -b`, which\n   needs a composite project: a `tsconfig.json` that `references` a\n   `tsconfig.node.json` setting `noEmit` fails with `TS6310: Referenced project\n   may not disable emit`, and unwinding that costs more than it buys.\n\n   **With an auth dependency `build` gains a `gen` step in front:**\n   `npm run gen && tsc --noEmit && vite build`, where `gen` regenerates the\n   authorization tables (`src\u002Fauthz\u002Froles.gen.ts`, `src\u002Fauthz\u002Foperations.gen.ts`,\n   `mock\u002Fauthz\u002Froles.gen.ts`) from the permission catalog and the contracts.\n   It is not optional and it must come BEFORE the type-check — a stale\n   generated union type-checks perfectly green while the app gates on\n   operations the design no longer has (`thunder-authentication`).\n\n   Verification ends at exit 0. **Never run `npm audit` or `npm audit fix`** —\n   the advisories land on Vite's dev-only transitive dependencies, which never\n   reach a static bundle served by nginx, and `audit fix` bumps pinned\n   dependencies behind your back.\n5. **Walk** — `mock-verification`, another agent's dispatch. Your job ends at\n   a clean Verify with `mock\u002F` in place.\n6. **PR** — the lead's, once the walk has reported; an open `[ ]` line rides in\n   its body (the component contract's **Walks**).\n\n## Constraints\n\n**Runtime config, not build-time.** The platform mounts `\u002Fenv-config.js` into\nthe served root and it populates `window._env_`. You never generate or commit\nthat file. `import.meta.env.VITE_*`, `process.env.REACT_APP_*`,\n`NEXT_PUBLIC_*` and `.env` files are all build-time mechanisms the platform does\nnot use — reading one gets you `undefined` in production.\n\n**The key set is fixed.** It is hardcoded in platform code, so a key you invent\nis `undefined` at module load. Use these exact spellings:\n\n| Key | Set when | Meaning |\n|---|---|---|\n| `\u003CNAME>_URL` | `dependencies` include an `external`-kind entry `\u003Cname>` | URL of that **external** upstream (browser may call it). Not used for a sibling `component`-kind service. |\n| `\u003CDEP>_*` | this web-app declares an auth `platform-resource` dependency named `\u003Cdep>` | OIDC config — `\u003CDEP>_CLIENT_ID`, `\u003CDEP>_ISSUER`, `\u003CDEP>_JWKS_URL`, `\u003CDEP>_SCOPES` and **`\u003CDEP>_RESOURCE`** (the project's resource-server identifier, the RFC 8707 `resource` indicator the SPA must send or every `\u002Fapi` call 401s). `\u003CDEP>` = UPPER_SNAKE of the dependency name (`user-auth` → `USER_AUTH_*`) — owned by `thunder-authentication` |\n| `\u003CNAME>` (any) | you declared it in `workload.yaml` `configurations.env` | app-config default, per-env override possible |\n\nThere is **no** `API_BASE_URL` and **no** `\u003CUPSTREAM>_URL` in `window._env_` for\na sibling service. The sibling lives at **same-origin** `\u002Fapi` (extra siblings:\n`\u002Fapi\u002F\u003Ccomponent-name>\u002F`). Its addresses — `\u003CDEP>_GATEWAY_URL` and `\u003CDEP>_URL` —\nare **pod** env vars, never browser keys; only the nginx drop-in reads them (see\n**Same-origin API proxy** below).\n\n**Throw on a missing key, never default it.** No `?? \"\"`, no `|| ''`, for keys\nthis table says are set. A silent fallback hides a missing OIDC issuer. Do not\ndeclare sibling API URL keys on `Env` just to throw — they are not emitted.\n\n**Served at host root.** Each web-app gets its **own** gateway hostname, so the\nstock Vite default is correct: **do NOT set `base`**. Asset URLs, any react-router\n`basename`, and any OAuth `redirect_uri` are plain root paths (`\u002Fassets\u002F…`,\n`\u002Fcallback`). Services ARE path-routed, under `\u002F\u003Cproject>-\u003Ccomponent>-http` on a\nshared gateway — copying that prefix into `base` 404s every asset.\n\n**Same-origin API proxy, through the gateway.** Nginx reverse-proxies\n`location \u002Fapi\u002F` to the primary sibling. Two pod env vars address that sibling and\nthey are NOT interchangeable:\n\n| Pod env var | Reaches | Auth |\n|---|---|---|\n| `\u003CDEP>_GATEWAY_URL` | the API gateway's **runtime Service**, `…-gateway-runtime.\u003Cns>.svc.cluster.local:22893` — a cluster address, never the public vhost. Set by the platform for a sibling whose design declares `exposesAPI.auth`. Carries a **context path prefix**. | validates the bearer token, injects `X-User-*` from its claims |\n| `\u003CDEP>_URL` | the project Service, directly | none — nothing validates a token, nothing injects identity |\n\nThe asset **prefers `\u003CDEP>_GATEWAY_URL`** and falls back to `\u003CDEP>_URL`. That\norder is the whole point: browser traffic is untrusted, and this proxy is the one\nhop that would otherwise carry it into the project's trusted lane with no\nauthentication in between. Two rules follow, and the asset already obeys both —\nwhich is why you copy it rather than write it:\n\n- **Preserve the context prefix.** The gateway routes on it; a rewrite that\n  strips it 404s every call.\n- **Clear inbound identity.** Identity is the gateway's to assert\n  (`api-management`), and nothing a browser sends on this lane may stand in for\n  it. The asset clears six headers: **`x-jwt-assertion`** — the gateway-signed\n  statement the service actually believes, which on a public operation the\n  gateway overwrites with nothing — and the five unsigned `X-User-*`.\n\nCopy the assets in Layout; do not hand-write a different `proxy_pass`, do not add\n`\u002Foidc\u002F` (token endpoint stays cross-origin; `thunder-authentication`), do not\ncopy `apps\u002Fconsole\u002Fdocker-entrypoint.sh`. Keep the official `nginx:alpine`\n`ENTRYPOINT`. The image adds exactly the three asset files: `nginx.conf`, the\n`default.conf` template and `\u002Fdocker-entrypoint.d\u002F15-aep-api-proxy.sh`.\n\n**Auth.** If the component declares an auth `platform-resource` dependency, its\nsign-in, screen gating and API-client wiring are `thunder-authentication`'s:\ncopy that skill's `assets\u002Fapp\u002F` tree as one (`src\u002Fauthz\u002F`, `mock\u002Fauthz\u002F`,\n`scripts\u002Fgen-authz.mjs`), and reach the API through `apiFetch`\u002F`apiJson` rather\nthan attaching a bearer by hand. A screen is gated on the **operation it\nloads**, named once in `src\u002Fauthz\u002Fscreens.ts` and checked against the generated\n`src\u002Fauthz\u002Foperations.gen.ts`; nothing about screens is in `security.json`\n(`authorization-model`).\n\n**Never `exposesAPI`.** That toggle is for backends only; a web-app expresses\nauth through its auth dependency instead.\n\n**The UI comes from the organization's design system.** Every component, layout\nprimitive and style under `src\u002F` comes from the design-system skill pinned on\nthis component — no raw HTML styling, no second component or styling library.\nThe one carve-out is `thunder-authentication`'s copied assets: `src\u002Fauthz\u002Fgates.tsx`'s\n`Forbidden` and `NoAccess` ship as plain `\u003Cmain>\u002F\u003Csection>\u002F\u003Ch1>` so the file is\ncopied verbatim into any app, whatever design system it pins. Treat that markup\nas structure to restyle with the design system's components after copying, and\nkeep the words — they are prescribed.\nThat skill owns everything inside `src\u002F`; this skill owns the app around it.\nWhere the two appear to disagree — `base`, the `index.html` script tags, nginx,\n`window._env_` — **this skill wins**, because those are deployment facts, not\nstyle preferences. The data layer is untouched either way: `openapi-fetch` and\nthe committed `src\u002Fgenerated\u002F` client stay exactly as specified above.\n\n**Contract-first client, never hand-rolled shapes.** Every dependency has a\ncommitted OpenAPI contract: `specs\u002Fdesign\u002Fcomponents\u002F\u003Ccomponent-name>\u002Fopenapi.yaml`\nfor a `component`-kind dependency, or\n`specs\u002Fdesign\u002Fcomponents\u002F\u003Cthis-app>\u002Fdependencies\u002F\u003Cdep-name>.openapi.yaml` for an\n`external`-kind one — project-root paths, sibling to this app's own folder.\nGenerate types from it and call through `openapi-fetch`'s typed client (Layout);\ndon't hand-write request\u002Fresponse shapes. Commit `src\u002Fgenerated\u002F` — the\nper-component Docker build's context is this app's own folder alone.\n\n**An `ai-agent` dependency has no OpenAPI contract — it has one fixed chat\ncontract.** It is a sibling like any other: reached **same-origin**, never\nthrough a `window._env_` URL — an agent has no browser-visible `\u003CAGENT>_URL`\nany more than an API sibling does. If it is the primary dependency, call it at\n`\u002Fapi`; if it is an extra sibling, call it at `\u002Fapi\u002F\u003Cagent-component-name>\u002F`\n(Layout's nginx section covers wiring either into the drop-in). It is called\nwith the same bearer token as any sibling service, but there is nothing to\ngenerate from; hand-write this one small client against the shape every\nplatform agent speaks:\n\n```ts\n\u002F\u002F POST \u002Fapi\u002Fchat  (or \u002Fapi\u002F\u003Cagent-component-name>\u002Fchat for an extra sibling)\n\u002F\u002F in:  { conversationId?: string, message: string,\n\u002F\u002F        attachments?: [{ name: string, mediaType: string, data: string \u002F* base64 *\u002F }] }\n\u002F\u002F out: { conversationId: string, text: string, toolCalls: unknown[] }\n```\n\nThe agent keeps the conversation. Your state is exactly two things:\n\n- **`conversationId`** — from the first response; send it on every later\n  message. \"New conversation\" = drop it. Persist it in `sessionStorage` if the\n  conversation should survive a refresh.\n- **Your own transcript** — `{ role: \"user\" | \"assistant\", text: string }[]`,\n  built as you go: push the user's text when they send, push `response.text`\n  when the agent replies. That list is for RENDERING and is yours alone; the\n  agent never sees it and never returns one. No `messages` array crosses the\n  wire in either direction.\n\n**Files, only when the agent takes them.** If the agent's\n`specs\u002Fdesign\u002Fcomponents\u002F\u003Cagent>\u002Fagent.afm.md` declares `x-aep.attachments`,\ngive the chat an attach control and compile its `types`, `maxFiles` and\n`maxFileSizeMB` in as constants: the picker's `accept` is the types; count,\nper-file size and the 15 MB total are checked before sending, naming the file\nthat fails. Send each file base64 in `attachments`; `message` may be empty when\nfiles are present. Without the block, render no attach control. The agent keeps\nno files, so on a 400, 413 or 422 keep the files and their text in the composer\nfor a retry and show the agent's `error`.\n\nA `404` from `\u002Fchat` means the conversation is gone or was never yours — drop\nthe stored id, start fresh, and tell the user the previous conversation\nexpired. Do not retry the same id.\n\nA `422` whose body carries `guardrail` (`{ error, guardrail }`) means the\nplatform's AI gateway refused that message on policy — the agent is up. Say so\nin the user's terms with the agent's `error` as the reason (\"This message was\nblocked by a safety check: \u003Cerror>\"), keep their text in the composer to edit,\nand keep the conversation as it was: the blocked turn left nothing behind.\nReserve \"couldn't reach the assistant\" for a network failure or a 5xx.\n\n## Layout\n\n```\n\u003Capp-path>\u002F\n├── package.json\n├── tsconfig.json         # ONE file — no project references, no tsconfig.node.json\n├── vite.config.ts        # no `base` — served at host root\n├── index.html\n├── scripts\u002F\n│   └── gen-authz.mjs     # only with an auth dependency — copied verbatim, run by `npm run gen`\n├── src\u002F\n│   ├── main.tsx\n│   ├── App.tsx\n│   ├── env.ts            # typed window._env_ shim\n│   ├── generated\u002F        # openapi-typescript output, one file per dependency — commit, never hand-edit\n│   ├── api.ts            # openapi-fetch client(s), typed against generated\u002F\n│   ├── authz\u002F            # ┐ only with an auth dependency — thunder-authentication owns\n│   │   ├── session.ts    # │ the whole directory. session\u002Fcore\u002Fgates\u002Fclient arrive\n│   │   ├── core.ts       # │ verbatim with one `cp -r`; screens.ts is a pattern you\n│   │   ├── gates.tsx     # │ adapt; the two *.gen.ts are GENERATED and COMMITTED —\n│   │   ├── client.ts     # │ the per-component build context cannot see ..\u002Fspecs,\n│   │   ├── screens.ts    # │ so an uncommitted one fails the image build\n│   │   ├── roles.gen.ts  # │\n│   │   └── operations.gen.ts # ┘\n│   ├── shell\u002FAppShell.tsx # the app chrome — every gated screen renders inside it\n│   └── pages\u002F            # design-system components only, never raw HTML\n├── mock\u002F                 # mock mode — references\u002Fmock-mode.md (mock\u002Fauthz\u002F comes with the tree above)\n├── nginx\u002F\n│   ├── nginx.conf        # copied from the skill assets, unchanged\n│   ├── default.conf      # copied from the skill assets, then \u002Fapi locations kept\n│   └── 15-aep-api-proxy.sh\n├── Dockerfile\n├── .dockerignore         # what `COPY . .` leaves behind\n└── .gitignore            # `node_modules` and `dist` — both are made by a build\n                          #   and neither belongs in the project repo\n```\n\n**Copy the nginx assets first, and never run a project generator** — `npm create\nvite` and friends emit a different shape (project-referenced tsconfigs, starter\nCSS, sample SVGs) and all of it has to be undone before Verify passes. The tree\nabove IS the shape. From the App Path:\n\n```bash\nmkdir -p nginx\ncp \"$AEP_SKILLS_DIR\u002Freact-webapp\u002Fassets\u002Fnginx.conf\" nginx\u002Fnginx.conf\ncp \"$AEP_SKILLS_DIR\u002Freact-webapp\u002Fassets\u002Fnginx-default.conf\" nginx\u002Fdefault.conf\ncp \"$AEP_SKILLS_DIR\u002Freact-webapp\u002Fassets\u002F15-aep-api-proxy.sh\" nginx\u002F15-aep-api-proxy.sh\n```\n\nIf `$AEP_SKILLS_DIR` is unset, copy from `assets\u002F` next to this skill's `SKILL.md`\n(the BFF mirrors that directory to `.claude\u002Fskills\u002Freact-webapp\u002F`).\n\nThen in `nginx\u002F15-aep-api-proxy.sh` only: rename **both** variables so they name\nthe **primary** component-kind dependency in UPPER_SNAKE —\n`API_URL=\"${TODO_API_GATEWAY_URL:-}\"` and the fallback `\"${TODO_API_URL:-}\"`\n(`todo-api` → `TODO_API_GATEWAY_URL` \u002F `TODO_API_URL`). Rename both or the\nfallback silently wins and the app runs unauthenticated. Do not invent a second\nname, and do not delete the fallback — an unprotected sibling has no gateway\naddress.\n\n**Done when:** `nginx\u002Fdefault.conf` contains `location \u002Fapi\u002F`,\n`proxy_pass http:\u002F\u002F$api_backend`, the `__API_CONTEXT__` rewrite and **all six\n`proxy_set_header` clearing lines** — `x-jwt-assertion`, `X-User-Id`,\n`X-User-Name`, `X-User-Groups`, `X-User-Ou` and `X-User-Scopes`; the drop-in\nscript's two `API_URL=` lines use that\nprimary `\u003CDEP>_URL`; there is no `\u002Foidc\u002F` location.\n\n**Count the six.** This proxy is a lane into the service that the API gateway\ndoes not sit on. `x-jwt-assertion` is the line that matters most: it is what the\nservice verifies and believes, and on a public operation the gateway replaces\nnothing, so one that arrives here arrives intact. An app whose conf is missing a\nline looks correct in every other respect — which is why the check is a count,\nnot \"it looks like the asset\".\n\nExtra component-kind siblings: add one `location \u002Fapi\u002F\u003Ccomponent-name>\u002F` block\neach (same `proxy_pass` pattern, rewrite stripping that prefix) and a matching\n`sed` of `__\u003CNAME>_BACKEND__` from that sibling's `\u003CDEP>_URL`. Primary stays `\u002Fapi`.\n\n`index.html` — the `env-config.js` tag is **synchronous**, **root-absolute** and\ncomes BEFORE the bundle. No `async`, no `defer`, no `type=\"module\"` on it.\n\nThe leading `\u002F` is load-bearing: a relative `.\u002F` resolves against the current\nroute, so on any nested URL the catch-all returns `index.html` instead and the\napp never mounts.\n\n```html\n\u003Chead>\n  \u003Cscript src=\"\u002Fenv-config.js\">\u003C\u002Fscript>           \u003C!-- 1. synchronous, root-absolute -->\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Cdiv id=\"root\">\u003C\u002Fdiv>\n  \u003Cscript type=\"module\" src=\"\u002Fsrc\u002Fmain.tsx\">\u003C\u002Fscript>  \u003C!-- 2. the bundle -->\n\u003C\u002Fbody>\n```\n\n`src\u002Fenv.ts` — typed read, throwing if the file never loaded. Declare only keys\nfrom the table above that this app actually has (OIDC \u002F `configurations.env` \u002F\nexternal-kind URLs). Example with no browser API URL:\n\n```ts\ntype Env = {\n  \u002F\u002F Only if this SPA declares an auth dependency named `user-auth`. All four,\n  \u002F\u002F and RESOURCE is not optional: without it the token's `aud` is wrong and\n  \u002F\u002F every \u002Fapi call 401s while sign-in looks healthy. The dependency also emits\n  \u002F\u002F \u003CDEP>_JWKS_URL; it is NOT here, because the browser never validates a token\n  \u002F\u002F — the API gateway does — so no asset reads it.\n  \u002F\u002F USER_AUTH_CLIENT_ID: string;\n  \u002F\u002F USER_AUTH_ISSUER: string;\n  \u002F\u002F USER_AUTH_SCOPES: string;\n  \u002F\u002F USER_AUTH_RESOURCE: string;\n};\n\ndeclare global {\n  interface Window { _env_: Env }\n}\n\nif (!window._env_) {\n  throw new Error(\n    \"window._env_ not set — \u002Fenv-config.js failed to load. \" +\n    \"The platform mounts this file; if you see this locally, host \" +\n    \"\u002Fenv-config.js from your dev server.\",\n  );\n}\n\nexport const env: Env = window._env_;\n```\n\n`src\u002Fgenerated\u002F\u003Ccomponent-name>.ts` — one run per dependency, before writing\n`api.ts`:\n\n```bash\nnpx openapi-typescript ..\u002Fspecs\u002Fdesign\u002Fcomponents\u002F\u003Ccomponent-name>\u002Fopenapi.yaml \\\n  -o src\u002Fgenerated\u002F\u003Ccomponent-name>.ts\n```\n\n(`external`-kind dependency: point at\n`..\u002Fspecs\u002Fdesign\u002Fcomponents\u002F\u003Cthis-app>\u002Fdependencies\u002F\u003Cdep-name>.openapi.yaml`\ninstead.) Re-run and commit the diff whenever the upstream spec changes.\n\n`src\u002Fapi.ts` — **same-origin** `baseUrl`. OpenAPI paths stay as designed\n(`\u002Fhello`, `\u002Ftodos`); nginx strips `\u002Fapi` before proxying.\n\n```ts\nimport createClient from \"openapi-fetch\";\nimport type { paths } from \".\u002Fgenerated\u002Ftodo-api\";\n\nexport const todoApi = createClient\u003Cpaths>({ baseUrl: \"\u002Fapi\" });\n\n\u002F\u002F extra sibling:\n\u002F\u002F export const otherApi = createClient\u003Cpaths>({ baseUrl: \"\u002Fapi\u002Fother-api\u002F\" });\n```\n\n**Done when:** no `env.API_BASE_URL`, no `env.TODO_API_URL`, no\n`window._env_` key used as an API host.\n\n`Dockerfile` — multi-stage onto stock `nginx:alpine`. **Do not set `ENTRYPOINT`**\n— the image already runs `\u002Fdocker-entrypoint.sh`, which runs\n`\u002Fdocker-entrypoint.d\u002F*.sh` then execs `CMD`.\n\n```dockerfile\nFROM node:20-alpine AS builder\nWORKDIR \u002Fapp\nCOPY package*.json .\u002F\nRUN npm i\nCOPY . .\nRUN npm run build\n\nFROM nginx:alpine\nCOPY --from=builder \u002Fapp\u002Fdist \u002Fusr\u002Fshare\u002Fnginx\u002Fhtml\nCOPY nginx\u002Fnginx.conf \u002Fetc\u002Fnginx\u002Fnginx.conf\nCOPY nginx\u002Fdefault.conf \u002Fetc\u002Fnginx\u002Faep\u002Fdefault.conf\nCOPY nginx\u002F15-aep-api-proxy.sh \u002Fdocker-entrypoint.d\u002F15-aep-api-proxy.sh\nRUN chmod +x \u002Fdocker-entrypoint.d\u002F15-aep-api-proxy.sh \\\n && rm \u002Fetc\u002Fnginx\u002Fconf.d\u002Fdefault.conf\nUSER 101\nEXPOSE 9090\nCMD [\"nginx\", \"-g\", \"daemon off;\"]\n```\n\n**The container runs on a read-only root filesystem, as a non-root UID the\nplatform picks** — the cloud `web-application` type enforces both and mounts no\nwritable volume, so `\u002Ftmp` is read-only too. Every runtime write goes under\n`\u002Fdev\u002Fshm\u002Fnginx`, the tmpfs every pod has: the asset `nginx.conf` keeps nginx's\npid and temp files there, and the drop-in renders the conf there from the\nread-only template at `\u002Fetc\u002Fnginx\u002Faep\u002Fdefault.conf`. Keep every path you add\nunder `\u002Fdev\u002Fshm\u002Fnginx` too. A local deploy runs on a writable root, so it proves\nnothing here; the first cloud deploy is where a stray write crash-loops the pod.\n\n`.dockerignore` — beside it, so `COPY . .` uploads this app's sources rather than\na local `node_modules` and a stale `dist`, both of which the builder stage makes\nfor itself:\n\n```text\nnode_modules\ndist\n```\n\n`mock\u002F` stays in the context: `vite.config.ts` imports `mock\u002Fplugin`, so the\nproduction build needs the directory on disk even though it ships none of it.\n\n`.gitignore` — beside it, with the **same two lines**, because the flow above\nruns `npm install` and `npm run build` in this folder and the project repo has no\nignore rule of its own to catch what they leave. Without it `git add \u003Capp-path>`\nstages a whole `node_modules` and a `dist` that is stale the moment the design\nmoves. Keep the patterns to these two and do not write an unanchored\n`generated\u002F` — `src\u002Fgenerated\u002F` is committed on purpose, and ignoring it is the\n`TS2307` failure in Pitfalls.\n\n**Done when:** the Dockerfile COPYs `nginx.conf` to `\u002Fetc\u002Fnginx\u002Fnginx.conf`,\n`default.conf` to `\u002Fetc\u002Fnginx\u002Faep\u002Fdefault.conf` and the drop-in to\n`\u002Fdocker-entrypoint.d\u002F`, sets `USER 101`, and has no `ENTRYPOINT` line; and\n`.dockerignore` sits beside it.\n\n`workload.yaml` per the component contract. Consumer connection to the sibling:\n`visibility: project`, `envBindings.address: \u003CDEP_NAME>_URL` (pod, for nginx).\nAny default under `configurations.env` arrives as a `window._env_` entry.\n\n**Done when:** this app's dependency on the sibling is `visibility: project`\n(never `external`). The sibling *service's* own endpoint `visibility` is the\nbackend skill's to write, as `workload-and-wiring` gives a provider; leave it\nas written rather than trimming it because this SPA uses `\u002Fapi`.\n\n## Pitfalls\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| SPA throws on load: `window._env_ not set` | `\u002Fenv-config.js` failed to load. A `SyntaxError: Unexpected token '\u003C'` just before it means the tag is relative and the catch-all served `index.html`. Otherwise 404, or the `\u003Cscript>` was `defer`\u002F`async` | Root-absolute (`\u002Fenv-config.js`), synchronous, in `\u003Chead>` before the bundle. Verify on a nested route loaded directly, not clicked into. |\n| Pod exits 1 at start: `Read-only file system` from `sed`, `mkdir` or nginx (`\u002Fetc\u002Fnginx`, `\u002Ftmp`, `\u002Fvar\u002Fcache\u002Fnginx`, `\u002Fvar\u002Frun`) | A runtime write outside `\u002Fdev\u002Fshm\u002Fnginx` — the cloud root filesystem is read-only, `\u002Ftmp` included, and `chmod` cannot make it writable | Copy `nginx.conf`, `default.conf` and the drop-in from the assets and lay them out as the Dockerfile above does; put any path you add under `\u002Fdev\u002Fshm\u002Fnginx`. |\n| `nginx: [emerg] host not found in upstream \"…\"` at pod start | Literal `proxy_pass http:\u002F\u002Fhostname` (startup DNS) or leftover `\u002Foidc\u002F` block | Use the asset conf (`proxy_pass http:\u002F\u002F$api_backend`) and the drop-in; delete `\u002Foidc\u002F`. |\n| Browser CORS error calling the sibling API | `baseUrl` is the public gateway URL or `window._env_.API_BASE_URL` | `baseUrl: \"\u002Fapi\"`. |\n| `\u002Fapi` 502, SPA otherwise fine | API pod down, or drop-in left `TODO_API_URL` when the dep is named something else | Align both `API_URL=\"${…}\"` lines with the dependency name; 502 while the API is down is expected. |\n| `\u002Fapi` 502 on EVERY call, API pod healthy, the address is the public gateway vhost | nginx's `resolver` does not read `\u002Fetc\u002Fhosts`, so a `hostAliases` entry for the gateway vhost is invisible to it — and the `:19080` LoadBalancer routes strictly on that vhost anyway | `\u003CDEP>_GATEWAY_URL` must be the gateway **runtime Service** on `:22893` (`…-gw-gateway-gateway-runtime.\u003Corg>-\u003Cenv>.svc.cluster.local:22893`), whose router host is `*`. The platform sets it; do not override it with a vhost. |\n| `\u002Fapi` 400 `no header value found for 'x-user-id'` | The proxy took the direct-Service lane, so nothing injected identity | Check the pod log line `aep-api-proxy: \u002Fapi -> … [lane]`. `direct Service` means `\u003CDEP>_GATEWAY_URL` was unset: the provider's design has no `exposesAPI.auth`, or the drop-in names the wrong variable. |\n| `\u002Fapi` 404 from the gateway | The rewrite dropped the context prefix | `nginx\u002Fdefault.conf` must rewrite to `__API_CONTEXT__\u002F$1`, not `\u002F$1`. |\n| `\u002Fapi` 503 through the gateway | The gateway authenticated but cannot reach the service | The provider endpoint's `workload.yaml` visibility is not the list `workload-and-wiring` gives a provider. |\n| Types in `src\u002Fgenerated\u002F*` don't match the live service | Upstream `openapi.yaml` changed since last generation | Re-run the `openapi-typescript` command and commit the diff. |\n| Docker build succeeds but ships stale\u002Fhand-written shapes, or fails `ENOENT ..\u002Fspecs\u002F...` | `src\u002Fgenerated\u002F` or one of the three `*.gen.ts` tables wasn't committed — the per-component build context is this app's folder alone | Generate and commit ALL of them before PR. `gen-authz.mjs` says on stdout that the specs are out of reach and that it is keeping the committed outputs when it falls back; with any output missing it exits 1 and the image build fails. |\n| The deployed bundle gates a screen on an operation the design dropped, or a newly added handle reaches nothing | A **stale bundle**: `build` ran without `gen`, or the generated tables were committed before the last design change | `build` is `npm run gen && tsc --noEmit && vite build`; re-run `gen` and commit the diff whenever `security.json` or an `openapi.yaml` changes. A stale generated union type-checks green. |\n| A role's own screen is hidden for it, or opens and its list call answers 401 | The role's grants lack the handle of the operation the screen **loads** — whole-string match, so `x:read-all` (`GET \u002Fx`) is not `x:read` (`GET \u002Fme\u002Fx`); or `loads` names the wrong reach for the screen | A design finding, not a code one: in mock mode the console line names the operation and the handle. Report the role, the screen and that handle. Never widen `loads`, a guard or a mock to hide it. |\n| Build red on `TS2307: Cannot find module '.\u002Fgenerated\u002F…'` (plus a burst of `TS7006` implicit-`any`) while `tsc --noEmit` is clean locally | `src\u002Fgenerated\u002F` is **git-ignored**, usually by an unanchored `generated\u002F` in the repo-root `.gitignore` written for a backend component. `git add` skipped it at exit 0 and `git status` stayed clean | `git check-ignore -v src\u002Fgenerated\u002F*` names the offending line. Anchor that pattern (`\u002Fonboarding-api\u002Fgenerated\u002F`), then re-add. The `TS7006` rows are downstream of the missing types and vanish with them. Never `git add -f`. |\n","# React Webapp\n\nA web-app on this platform: a Vite + TS SPA built to static files, served by\nstock `nginx:alpine`. The image is **byte-identical across every environment**.\nPer-env values the **browser** needs (OIDC config, flags) arrive at request time\nin `window._env_`, never at build time. Sibling API addresses are **not**\nbrowser config — they are pod env for nginx.\n\n## Development flow\n\n1. **Scaffold** per Layout, including the nginx drop-in copy in step 1 of Layout.\n   Read [mock-mode.md](references\u002Fmock-mode.md) and include its dependencies in\n   `package.json`, then install **once** with the complete dependency set — npm\n   can only satisfy a peer set it sees all at once, and a package added to an\n   already-resolved tree costs a second full resolve at best. With a design\n   system, its own Setup step IS that install (it writes the manifest and runs\n   `npm install` itself); without one, `npm install`.\n2. **Prepare shared interfaces** — write `src\u002Fenv.ts`, generate `src\u002Fgenerated\u002F`\n   from each dependency's OpenAPI contract, and write `src\u002Fapi.ts` with a\n   **same-origin** `baseUrl`. With auth, copy `thunder-authentication`'s\n   `assets\u002Fapp\u002F` tree (one `cp -r`, which lays down `src\u002Fauthz\u002F` and\n   `mock\u002Fauthz\u002F`), set the `USER_AUTH_` prefix in `src\u002Fauthz\u002Fsession.ts` (mock\n   mode substitutes that module), and run `npm run gen` once so the three\n   generated tables exist for the type-check.\n3. **Implement pages** — follow Constraints, and check `src\u002Fapi.ts` against the\n   **first** page with `npx tsc --noEmit` before writing the rest: that pair proves\n   how the generated client types, and every later page repeats the pattern.\n   The prototype (`specs\u002Fdesign\u002Fcomponents\u002F\u003Cname>\u002Fprototype.json` and\n   `prototype.tsx`) is the screen contract. Before the first page, read\n   `${AEP_SKILLS_DIR:-.claude\u002Fskills}\u002Fprototype\u002Freferences\u002Fimplementing.md`.\n4. **Mock mode** — author `mock\u002F` per `references\u002Fmock-mode.md`, including the four\n   wiring files in its §2. It stands the same app up with no cluster, no sibling\n   service and no IDP behind it — with the API gateway's own refusals modelled\n   from `openapi.yaml`, so a role that cannot reach a screen fails here the way\n   it fails in a cell. The build eliminates all of it as dead code.\n5. **Verify** — from the app path:\n   ```bash\n   npm install                   # regenerates package-lock.json\n   # ← the design system's check goes here (see below)\n   npm run gen                   # with auth: so the standalone tsc below reads a\n                                 # fresh table (`npm run build` re-runs it)\n   npx tsc --noEmit              # type-check without emitting\n   npm run build                 # actually build\n   ! grep -rq mockServiceWorker dist\u002F # the bundle carries no mock — step 4\n   git status --porcelain --ignored=matching -- . \\\n     | grep '^!!' | grep -vE 'node_modules|dist'   # ← output MUST be empty\n   ```\n   Commit the `package-lock.json` this produces. Never commit `node_modules\u002F`.\n\n   **The last line is not a formality.** Every step above it reads your working\n   tree; the cluster builds the *committed* tree of this folder alone. A build\n   input that git ignores is present for all four checks and absent from the\n   image, and git will not tell you: `git add \u003Capp-path>` skips an ignored file\n   **silently, exit 0**, and leaves `git status` clean. `src\u002Fgenerated\u002F` is the\n   one that bites, because the repo-root `.gitignore` is shared with backend\n   components that legitimately ignore a `generated\u002F` directory — an unanchored\n   pattern there reaches down into this app. `--ignored=matching` is what makes\n   those paths visible; `node_modules` and `dist` are the only two the builder\n   stage makes for itself, which is why they are the only two filtered out.\n   A `!!` line naming anything else means the image will not carry that file.\n   Fix the pattern (anchor it in the repo-root `.gitignore`), never `git add -f`.\n\n   **The design-system skill contributes one step to this sequence**, and it is\n   mandatory: run the command its own Verify section names, after `npm install`\n   and before the type-check, and treat a non-zero exit exactly like a failing\n   build. That slot exists because a design system's own wiring — a missing\n   build plugin, an unimported theme, a peer-dependency mismatch — is the one\n   class of fault `tsc` and `vite build` cannot see: it type-checks and builds\n   perfectly clean, then renders an unstyled page in the cluster. If the pinned\n   design-system skill names no such command, the sequence is just the five\n   above.\n\n   The `build` script is `tsc --noEmit && vite build` — **not** `tsc -b`, which\n   needs a composite project: a `tsconfig.json` that `references` a\n   `tsconfig.node.json` setting `noEmit` fails with `TS6310: Referenced project\n   may not disable emit`, and unwinding that costs more than it buys.\n\n   **With an auth dependency `build` gains a `gen` step in front:**\n   `npm run gen && tsc --noEmit && vite build`, where `gen` regenerates the\n   authorization tables (`src\u002Fauthz\u002Froles.gen.ts`, `src\u002Fauthz\u002Foperations.gen.ts`,\n   `mock\u002Fauthz\u002Froles.gen.ts`) from the permission catalog and the contracts.\n   It is not optional and it must come BEFORE the type-check — a stale\n   generated union type-checks perfectly green while the app gates on\n   operations the design no longer has (`thunder-authentication`).\n\n   Verification ends at exit 0. **Never run `npm audit` or `npm audit fix`** —\n   the advisories land on Vite's dev-only transitive dependencies, which never\n   reach a static bundle served by nginx, and `audit fix` bumps pinned\n   dependencies behind your back.\n5. **Walk** — `mock-verification`, another agent's dispatch. Your job ends at\n   a clean Verify with `mock\u002F` in place.\n6. **PR** — the lead's, once the walk has reported; an open `[ ]` line rides in\n   its body (the component contract's **Walks**).\n\n## Constraints\n\n**Runtime config, not build-time.** The platform mounts `\u002Fenv-config.js` into\nthe served root and it populates `window._env_`. You never generate or commit\nthat file. `import.meta.env.VITE_*`, `process.env.REACT_APP_*`,\n`NEXT_PUBLIC_*` and `.env` files are all build-time mechanisms the platform does\nnot use — reading one gets you `undefined` in production.\n\n**The key set is fixed.** It is hardcoded in platform code, so a key you invent\nis `undefined` at module load. Use these exact spellings:\n\n| Key | Set when | Meaning |\n|---|---|---|\n| `\u003CNAME>_URL` | `dependencies` include an `external`-kind entry `\u003Cname>` | URL of that **external** upstream (browser may call it). Not used for a sibling `component`-kind service. |\n| `\u003CDEP>_*` | this web-app declares an auth `platform-resource` dependency named `\u003Cdep>` | OIDC config — `\u003CDEP>_CLIENT_ID`, `\u003CDEP>_ISSUER`, `\u003CDEP>_JWKS_URL`, `\u003CDEP>_SCOPES` and **`\u003CDEP>_RESOURCE`** (the project's resource-server identifier, the RFC 8707 `resource` indicator the SPA must send or every `\u002Fapi` call 401s). `\u003CDEP>` = UPPER_SNAKE of the dependency name (`user-auth` → `USER_AUTH_*`) — owned by `thunder-authentication` |\n| `\u003CNAME>` (any) | you declared it in `workload.yaml` `configurations.env` | app-config default, per-env override possible |\n\nThere is **no** `API_BASE_URL` and **no** `\u003CUPSTREAM>_URL` in `window._env_` for\na sibling service. The sibling lives at **same-origin** `\u002Fapi` (extra siblings:\n`\u002Fapi\u002F\u003Ccomponent-name>\u002F`). Its addresses — `\u003CDEP>_GATEWAY_URL` and `\u003CDEP>_URL` —\nare **pod** env vars, never browser keys; only the nginx drop-in reads them (see\n**Same-origin API proxy** below).\n\n**Throw on a missing key, never default it.** No `?? \"\"`, no `|| ''`, for keys\nthis table says are set. A silent fallback hides a missing OIDC issuer. Do not\ndeclare sibling API URL keys on `Env` just to throw — they are not emitted.\n\n**Served at host root.** Each web-app gets its **own** gateway hostname, so the\nstock Vite default is correct: **do NOT set `base`**. Asset URLs, any react-router\n`basename`, and any OAuth `redirect_uri` are plain root paths (`\u002Fassets\u002F…`,\n`\u002Fcallback`). Services ARE path-routed, under `\u002F\u003Cproject>-\u003Ccomponent>-http` on a\nshared gateway — copying that prefix into `base` 404s every asset.\n\n**Same-origin API proxy, through the gateway.** Nginx reverse-proxies\n`location \u002Fapi\u002F` to the primary sibling. Two pod env vars address that sibling and\nthey are NOT interchangeable:\n\n| Pod env var | Reaches | Auth |\n|---|---|---|\n| `\u003CDEP>_GATEWAY_URL` | the API gateway's **runtime Service**, `…-gateway-runtime.\u003Cns>.svc.cluster.local:22893` — a cluster address, never the public vhost. Set by the platform for a sibling whose design declares `exposesAPI.auth`. Carries a **context path prefix**. | validates the bearer token, injects `X-User-*` from its claims |\n| `\u003CDEP>_URL` | the project Service, directly | none — nothing validates a token, nothing injects identity |\n\nThe asset **prefers `\u003CDEP>_GATEWAY_URL`** and falls back to `\u003CDEP>_URL`. That\norder is the whole point: browser traffic is untrusted, and this proxy is the one\nhop that would otherwise carry it into the project's trusted lane with no\nauthentication in between. Two rules follow, and the asset already obeys both —\nwhich is why you copy it rather than write it:\n\n- **Preserve the context prefix.** The gateway routes on it; a rewrite that\n  strips it 404s every call.\n- **Clear inbound identity.** Identity is the gateway's to assert\n  (`api-management`), and nothing a browser sends on this lane may stand in for\n  it. The asset clears six headers: **`x-jwt-assertion`** — the gateway-signed\n  statement the service actually believes, which on a public operation the\n  gateway overwrites with nothing — and the five unsigned `X-User-*`.\n\nCopy the assets in Layout; do not hand-write a different `proxy_pass`, do not add\n`\u002Foidc\u002F` (token endpoint stays cross-origin; `thunder-authentication`), do not\ncopy `apps\u002Fconsole\u002Fdocker-entrypoint.sh`. Keep the official `nginx:alpine`\n`ENTRYPOINT`. The image adds exactly the three asset files: `nginx.conf`, the\n`default.conf` template and `\u002Fdocker-entrypoint.d\u002F15-aep-api-proxy.sh`.\n\n**Auth.** If the component declares an auth `platform-resource` dependency, its\nsign-in, screen gating and API-client wiring are `thunder-authentication`'s:\ncopy that skill's `assets\u002Fapp\u002F` tree as one (`src\u002Fauthz\u002F`, `mock\u002Fauthz\u002F`,\n`scripts\u002Fgen-authz.mjs`), and reach the API through `apiFetch`\u002F`apiJson` rather\nthan attaching a bearer by hand. A screen is gated on the **operation it\nloads**, named once in `src\u002Fauthz\u002Fscreens.ts` and checked against the generated\n`src\u002Fauthz\u002Foperations.gen.ts`; nothing about screens is in `security.json`\n(`authorization-model`).\n\n**Never `exposesAPI`.** That toggle is for backends only; a web-app expresses\nauth through its auth dependency instead.\n\n**The UI comes from the organization's design system.** Every component, layout\nprimitive and style under `src\u002F` comes from the design-system skill pinned on\nthis component — no raw HTML styling, no second component or styling library.\nThe one carve-out is `thunder-authentication`'s copied assets: `src\u002Fauthz\u002Fgates.tsx`'s\n`Forbidden` and `NoAccess` ship as plain `\u003Cmain>\u002F\u003Csection>\u002F\u003Ch1>` so the file is\ncopied verbatim into any app, whatever design system it pins. Treat that markup\nas structure to restyle with the design system's components after copying, and\nkeep the words — they are prescribed.\nThat skill owns everything inside `src\u002F`; this skill owns the app around it.\nWhere the two appear to disagree — `base`, the `index.html` script tags, nginx,\n`window._env_` — **this skill wins**, because those are deployment facts, not\nstyle preferences. The data layer is untouched either way: `openapi-fetch` and\nthe committed `src\u002Fgenerated\u002F` client stay exactly as specified above.\n\n**Contract-first client, never hand-rolled shapes.** Every dependency has a\ncommitted OpenAPI contract: `specs\u002Fdesign\u002Fcomponents\u002F\u003Ccomponent-name>\u002Fopenapi.yaml`\nfor a `component`-kind dependency, or\n`specs\u002Fdesign\u002Fcomponents\u002F\u003Cthis-app>\u002Fdependencies\u002F\u003Cdep-name>.openapi.yaml` for an\n`external`-kind one — project-root paths, sibling to this app's own folder.\nGenerate types from it and call through `openapi-fetch`'s typed client (Layout);\ndon't hand-write request\u002Fresponse shapes. Commit `src\u002Fgenerated\u002F` — the\nper-component Docker build's context is this app's own folder alone.\n\n**An `ai-agent` dependency has no OpenAPI contract — it has one fixed chat\ncontract.** It is a sibling like any other: reached **same-origin**, never\nthrough a `window._env_` URL — an agent has no browser-visible `\u003CAGENT>_URL`\nany more than an API sibling does. If it is the primary dependency, call it at\n`\u002Fapi`; if it is an extra sibling, call it at `\u002Fapi\u002F\u003Cagent-component-name>\u002F`\n(Layout's nginx section covers wiring either into the drop-in). It is called\nwith the same bearer token as any sibling service, but there is nothing to\ngenerate from; hand-write this one small client against the shape every\nplatform agent speaks:\n\n```ts\n\u002F\u002F POST \u002Fapi\u002Fchat  (or \u002Fapi\u002F\u003Cagent-component-name>\u002Fchat for an extra sibling)\n\u002F\u002F in:  { conversationId?: string, message: string,\n\u002F\u002F        attachments?: [{ name: string, mediaType: string, data: string \u002F* base64 *\u002F }] }\n\u002F\u002F out: { conversationId: string, text: string, toolCalls: unknown[] }\n```\n\nThe agent keeps the conversation. Your state is exactly two things:\n\n- **`conversationId`** — from the first response; send it on every later\n  message. \"New conversation\" = drop it. Persist it in `sessionStorage` if the\n  conversation should survive a refresh.\n- **Your own transcript** — `{ role: \"user\" | \"assistant\", text: string }[]`,\n  built as you go: push the user's text when they send, push `response.text`\n  when the agent replies. That list is for RENDERING and is yours alone; the\n  agent never sees it and never returns one. No `messages` array crosses the\n  wire in either direction.\n\n**Files, only when the agent takes them.** If the agent's\n`specs\u002Fdesign\u002Fcomponents\u002F\u003Cagent>\u002Fagent.afm.md` declares `x-aep.attachments`,\ngive the chat an attach control and compile its `types`, `maxFiles` and\n`maxFileSizeMB` in as constants: the picker's `accept` is the types; count,\nper-file size and the 15 MB total are checked before sending, naming the file\nthat fails. Send each file base64 in `attachments`; `message` may be empty when\nfiles are present. Without the block, render no attach control. The agent keeps\nno files, so on a 400, 413 or 422 keep the files and their text in the composer\nfor a retry and show the agent's `error`.\n\nA `404` from `\u002Fchat` means the conversation is gone or was never yours — drop\nthe stored id, start fresh, and tell the user the previous conversation\nexpired. Do not retry the same id.\n\nA `422` whose body carries `guardrail` (`{ error, guardrail }`) means the\nplatform's AI gateway refused that message on policy — the agent is up. Say so\nin the user's terms with the agent's `error` as the reason (\"This message was\nblocked by a safety check: \u003Cerror>\"), keep their text in the composer to edit,\nand keep the conversation as it was: the blocked turn left nothing behind.\nReserve \"couldn't reach the assistant\" for a network failure or a 5xx.\n\n## Layout\n\n```\n\u003Capp-path>\u002F\n├── package.json\n├── tsconfig.json         # ONE file — no project references, no tsconfig.node.json\n├── vite.config.ts        # no `base` — served at host root\n├── index.html\n├── scripts\u002F\n│   └── gen-authz.mjs     # only with an auth dependency — copied verbatim, run by `npm run gen`\n├── src\u002F\n│   ├── main.tsx\n│   ├── App.tsx\n│   ├── env.ts            # typed window._env_ shim\n│   ├── generated\u002F        # openapi-typescript output, one file per dependency — commit, never hand-edit\n│   ├── api.ts            # openapi-fetch client(s), typed against generated\u002F\n│   ├── authz\u002F            # ┐ only with an auth dependency — thunder-authentication owns\n│   │   ├── session.ts    # │ the whole directory. session\u002Fcore\u002Fgates\u002Fclient arrive\n│   │   ├── core.ts       # │ verbatim with one `cp -r`; screens.ts is a pattern you\n│   │   ├── gates.tsx     # │ adapt; the two *.gen.ts are GENERATED and COMMITTED —\n│   │   ├── client.ts     # │ the per-component build context cannot see ..\u002Fspecs,\n│   │   ├── screens.ts    # │ so an uncommitted one fails the image build\n│   │   ├── roles.gen.ts  # │\n│   │   └── operations.gen.ts # ┘\n│   ├── shell\u002FAppShell.tsx # the app chrome — every gated screen renders inside it\n│   └── pages\u002F            # design-system components only, never raw HTML\n├── mock\u002F                 # mock mode — references\u002Fmock-mode.md (mock\u002Fauthz\u002F comes with the tree above)\n├── nginx\u002F\n│   ├── nginx.conf        # copied from the skill assets, unchanged\n│   ├── default.conf      # copied from the skill assets, then \u002Fapi locations kept\n│   └── 15-aep-api-proxy.sh\n├── Dockerfile\n├── .dockerignore         # what `COPY . .` leaves behind\n└── .gitignore            # `node_modules` and `dist` — both are made by a build\n                          #   and neither belongs in the project repo\n```\n\n**Copy the nginx assets first, and never run a project generator** — `npm create\nvite` and friends emit a different shape (project-referenced tsconfigs, starter\nCSS, sample SVGs) and all of it has to be undone before Verify passes. The tree\nabove IS the shape. From the App Path:\n\n```bash\nmkdir -p nginx\ncp \"$AEP_SKILLS_DIR\u002Freact-webapp\u002Fassets\u002Fnginx.conf\" nginx\u002Fnginx.conf\ncp \"$AEP_SKILLS_DIR\u002Freact-webapp\u002Fassets\u002Fnginx-default.conf\" nginx\u002Fdefault.conf\ncp \"$AEP_SKILLS_DIR\u002Freact-webapp\u002Fassets\u002F15-aep-api-proxy.sh\" nginx\u002F15-aep-api-proxy.sh\n```\n\nIf `$AEP_SKILLS_DIR` is unset, copy from `assets\u002F` next to this skill's `SKILL.md`\n(the BFF mirrors that directory to `.claude\u002Fskills\u002Freact-webapp\u002F`).\n\nThen in `nginx\u002F15-aep-api-proxy.sh` only: rename **both** variables so they name\nthe **primary** component-kind dependency in UPPER_SNAKE —\n`API_URL=\"${TODO_API_GATEWAY_URL:-}\"` and the fallback `\"${TODO_API_URL:-}\"`\n(`todo-api` → `TODO_API_GATEWAY_URL` \u002F `TODO_API_URL`). Rename both or the\nfallback silently wins and the app runs unauthenticated. Do not invent a second\nname, and do not delete the fallback — an unprotected sibling has no gateway\naddress.\n\n**Done when:** `nginx\u002Fdefault.conf` contains `location \u002Fapi\u002F`,\n`proxy_pass http:\u002F\u002F$api_backend`, the `__API_CONTEXT__` rewrite and **all six\n`proxy_set_header` clearing lines** — `x-jwt-assertion`, `X-User-Id`,\n`X-User-Name`, `X-User-Groups`, `X-User-Ou` and `X-User-Scopes`; the drop-in\nscript's two `API_URL=` lines use that\nprimary `\u003CDEP>_URL`; there is no `\u002Foidc\u002F` location.\n\n**Count the six.** This proxy is a lane into the service that the API gateway\ndoes not sit on. `x-jwt-assertion` is the line that matters most: it is what the\nservice verifies and believes, and on a public operation the gateway replaces\nnothing, so one that arrives here arrives intact. An app whose conf is missing a\nline looks correct in every other respect — which is why the check is a count,\nnot \"it looks like the asset\".\n\nExtra component-kind siblings: add one `location \u002Fapi\u002F\u003Ccomponent-name>\u002F` block\neach (same `proxy_pass` pattern, rewrite stripping that prefix) and a matching\n`sed` of `__\u003CNAME>_BACKEND__` from that sibling's `\u003CDEP>_URL`. Primary stays `\u002Fapi`.\n\n`index.html` — the `env-config.js` tag is **synchronous**, **root-absolute** and\ncomes BEFORE the bundle. No `async`, no `defer`, no `type=\"module\"` on it.\n\nThe leading `\u002F` is load-bearing: a relative `.\u002F` resolves against the current\nroute, so on any nested URL the catch-all returns `index.html` instead and the\napp never mounts.\n\n```html\n\u003Chead>\n  \u003Cscript src=\"\u002Fenv-config.js\">\u003C\u002Fscript>           \u003C!-- 1. synchronous, root-absolute -->\n\u003C\u002Fhead>\n\u003Cbody>\n  \u003Cdiv id=\"root\">\u003C\u002Fdiv>\n  \u003Cscript type=\"module\" src=\"\u002Fsrc\u002Fmain.tsx\">\u003C\u002Fscript>  \u003C!-- 2. the bundle -->\n\u003C\u002Fbody>\n```\n\n`src\u002Fenv.ts` — typed read, throwing if the file never loaded. Declare only keys\nfrom the table above that this app actually has (OIDC \u002F `configurations.env` \u002F\nexternal-kind URLs). Example with no browser API URL:\n\n```ts\ntype Env = {\n  \u002F\u002F Only if this SPA declares an auth dependency named `user-auth`. All four,\n  \u002F\u002F and RESOURCE is not optional: without it the token's `aud` is wrong and\n  \u002F\u002F every \u002Fapi call 401s while sign-in looks healthy. The dependency also emits\n  \u002F\u002F \u003CDEP>_JWKS_URL; it is NOT here, because the browser never validates a token\n  \u002F\u002F — the API gateway does — so no asset reads it.\n  \u002F\u002F USER_AUTH_CLIENT_ID: string;\n  \u002F\u002F USER_AUTH_ISSUER: string;\n  \u002F\u002F USER_AUTH_SCOPES: string;\n  \u002F\u002F USER_AUTH_RESOURCE: string;\n};\n\ndeclare global {\n  interface Window { _env_: Env }\n}\n\nif (!window._env_) {\n  throw new Error(\n    \"window._env_ not set — \u002Fenv-config.js failed to load. \" +\n    \"The platform mounts this file; if you see this locally, host \" +\n    \"\u002Fenv-config.js from your dev server.\",\n  );\n}\n\nexport const env: Env = window._env_;\n```\n\n`src\u002Fgenerated\u002F\u003Ccomponent-name>.ts` — one run per dependency, before writing\n`api.ts`:\n\n```bash\nnpx openapi-typescript ..\u002Fspecs\u002Fdesign\u002Fcomponents\u002F\u003Ccomponent-name>\u002Fopenapi.yaml \\\n  -o src\u002Fgenerated\u002F\u003Ccomponent-name>.ts\n```\n\n(`external`-kind dependency: point at\n`..\u002Fspecs\u002Fdesign\u002Fcomponents\u002F\u003Cthis-app>\u002Fdependencies\u002F\u003Cdep-name>.openapi.yaml`\ninstead.) Re-run and commit the diff whenever the upstream spec changes.\n\n`src\u002Fapi.ts` — **same-origin** `baseUrl`. OpenAPI paths stay as designed\n(`\u002Fhello`, `\u002Ftodos`); nginx strips `\u002Fapi` before proxying.\n\n```ts\nimport createClient from \"openapi-fetch\";\nimport type { paths } from \".\u002Fgenerated\u002Ftodo-api\";\n\nexport const todoApi = createClient\u003Cpaths>({ baseUrl: \"\u002Fapi\" });\n\n\u002F\u002F extra sibling:\n\u002F\u002F export const otherApi = createClient\u003Cpaths>({ baseUrl: \"\u002Fapi\u002Fother-api\u002F\" });\n```\n\n**Done when:** no `env.API_BASE_URL`, no `env.TODO_API_URL`, no\n`window._env_` key used as an API host.\n\n`Dockerfile` — multi-stage onto stock `nginx:alpine`. **Do not set `ENTRYPOINT`**\n— the image already runs `\u002Fdocker-entrypoint.sh`, which runs\n`\u002Fdocker-entrypoint.d\u002F*.sh` then execs `CMD`.\n\n```dockerfile\nFROM node:20-alpine AS builder\nWORKDIR \u002Fapp\nCOPY package*.json .\u002F\nRUN npm i\nCOPY . .\nRUN npm run build\n\nFROM nginx:alpine\nCOPY --from=builder \u002Fapp\u002Fdist \u002Fusr\u002Fshare\u002Fnginx\u002Fhtml\nCOPY nginx\u002Fnginx.conf \u002Fetc\u002Fnginx\u002Fnginx.conf\nCOPY nginx\u002Fdefault.conf \u002Fetc\u002Fnginx\u002Faep\u002Fdefault.conf\nCOPY nginx\u002F15-aep-api-proxy.sh \u002Fdocker-entrypoint.d\u002F15-aep-api-proxy.sh\nRUN chmod +x \u002Fdocker-entrypoint.d\u002F15-aep-api-proxy.sh \\\n && rm \u002Fetc\u002Fnginx\u002Fconf.d\u002Fdefault.conf\nUSER 101\nEXPOSE 9090\nCMD [\"nginx\", \"-g\", \"daemon off;\"]\n```\n\n**The container runs on a read-only root filesystem, as a non-root UID the\nplatform picks** — the cloud `web-application` type enforces both and mounts no\nwritable volume, so `\u002Ftmp` is read-only too. Every runtime write goes under\n`\u002Fdev\u002Fshm\u002Fnginx`, the tmpfs every pod has: the asset `nginx.conf` keeps nginx's\npid and temp files there, and the drop-in renders the conf there from the\nread-only template at `\u002Fetc\u002Fnginx\u002Faep\u002Fdefault.conf`. Keep every path you add\nunder `\u002Fdev\u002Fshm\u002Fnginx` too. A local deploy runs on a writable root, so it proves\nnothing here; the first cloud deploy is where a stray write crash-loops the pod.\n\n`.dockerignore` — beside it, so `COPY . .` uploads this app's sources rather than\na local `node_modules` and a stale `dist`, both of which the builder stage makes\nfor itself:\n\n```text\nnode_modules\ndist\n```\n\n`mock\u002F` stays in the context: `vite.config.ts` imports `mock\u002Fplugin`, so the\nproduction build needs the directory on disk even though it ships none of it.\n\n`.gitignore` — beside it, with the **same two lines**, because the flow above\nruns `npm install` and `npm run build` in this folder and the project repo has no\nignore rule of its own to catch what they leave. Without it `git add \u003Capp-path>`\nstages a whole `node_modules` and a `dist` that is stale the moment the design\nmoves. Keep the patterns to these two and do not write an unanchored\n`generated\u002F` — `src\u002Fgenerated\u002F` is committed on purpose, and ignoring it is the\n`TS2307` failure in Pitfalls.\n\n**Done when:** the Dockerfile COPYs `nginx.conf` to `\u002Fetc\u002Fnginx\u002Fnginx.conf`,\n`default.conf` to `\u002Fetc\u002Fnginx\u002Faep\u002Fdefault.conf` and the drop-in to\n`\u002Fdocker-entrypoint.d\u002F`, sets `USER 101`, and has no `ENTRYPOINT` line; and\n`.dockerignore` sits beside it.\n\n`workload.yaml` per the component contract. Consumer connection to the sibling:\n`visibility: project`, `envBindings.address: \u003CDEP_NAME>_URL` (pod, for nginx).\nAny default under `configurations.env` arrives as a `window._env_` entry.\n\n**Done when:** this app's dependency on the sibling is `visibility: project`\n(never `external`). The sibling *service's* own endpoint `visibility` is the\nbackend skill's to write, as `workload-and-wiring` gives a provider; leave it\nas written rather than trimming it because this SPA uses `\u002Fapi`.\n\n## Pitfalls\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| SPA throws on load: `window._env_ not set` | `\u002Fenv-config.js` failed to load. A `SyntaxError: Unexpected token '\u003C'` just before it means the tag is relative and the catch-all served `index.html`. Otherwise 404, or the `\u003Cscript>` was `defer`\u002F`async` | Root-absolute (`\u002Fenv-config.js`), synchronous, in `\u003Chead>` before the bundle. Verify on a nested route loaded directly, not clicked into. |\n| Pod exits 1 at start: `Read-only file system` from `sed`, `mkdir` or nginx (`\u002Fetc\u002Fnginx`, `\u002Ftmp`, `\u002Fvar\u002Fcache\u002Fnginx`, `\u002Fvar\u002Frun`) | A runtime write outside `\u002Fdev\u002Fshm\u002Fnginx` — the cloud root filesystem is read-only, `\u002Ftmp` included, and `chmod` cannot make it writable | Copy `nginx.conf`, `default.conf` and the drop-in from the assets and lay them out as the Dockerfile above does; put any path you add under `\u002Fdev\u002Fshm\u002Fnginx`. |\n| `nginx: [emerg] host not found in upstream \"…\"` at pod start | Literal `proxy_pass http:\u002F\u002Fhostname` (startup DNS) or leftover `\u002Foidc\u002F` block | Use the asset conf (`proxy_pass http:\u002F\u002F$api_backend`) and the drop-in; delete `\u002Foidc\u002F`. |\n| Browser CORS error calling the sibling API | `baseUrl` is the public gateway URL or `window._env_.API_BASE_URL` | `baseUrl: \"\u002Fapi\"`. |\n| `\u002Fapi` 502, SPA otherwise fine | API pod down, or drop-in left `TODO_API_URL` when the dep is named something else | Align both `API_URL=\"${…}\"` lines with the dependency name; 502 while the API is down is expected. |\n| `\u002Fapi` 502 on EVERY call, API pod healthy, the address is the public gateway vhost | nginx's `resolver` does not read `\u002Fetc\u002Fhosts`, so a `hostAliases` entry for the gateway vhost is invisible to it — and the `:19080` LoadBalancer routes strictly on that vhost anyway | `\u003CDEP>_GATEWAY_URL` must be the gateway **runtime Service** on `:22893` (`…-gw-gateway-gateway-runtime.\u003Corg>-\u003Cenv>.svc.cluster.local:22893`), whose router host is `*`. The platform sets it; do not override it with a vhost. |\n| `\u002Fapi` 400 `no header value found for 'x-user-id'` | The proxy took the direct-Service lane, so nothing injected identity | Check the pod log line `aep-api-proxy: \u002Fapi -> … [lane]`. `direct Service` means `\u003CDEP>_GATEWAY_URL` was unset: the provider's design has no `exposesAPI.auth`, or the drop-in names the wrong variable. |\n| `\u002Fapi` 404 from the gateway | The rewrite dropped the context prefix | `nginx\u002Fdefault.conf` must rewrite to `__API_CONTEXT__\u002F$1`, not `\u002F$1`. |\n| `\u002Fapi` 503 through the gateway | The gateway authenticated but cannot reach the service | The provider endpoint's `workload.yaml` visibility is not the list `workload-and-wiring` gives a provider. |\n| Types in `src\u002Fgenerated\u002F*` don't match the live service | Upstream `openapi.yaml` changed since last generation | Re-run the `openapi-typescript` command and commit the diff. |\n| Docker build succeeds but ships stale\u002Fhand-written shapes, or fails `ENOENT ..\u002Fspecs\u002F...` | `src\u002Fgenerated\u002F` or one of the three `*.gen.ts` tables wasn't committed — the per-component build context is this app's folder alone | Generate and commit ALL of them before PR. `gen-authz.mjs` says on stdout that the specs are out of reach and that it is keeping the committed outputs when it falls back; with any output missing it exits 1 and the image build fails. |\n| The deployed bundle gates a screen on an operation the design dropped, or a newly added handle reaches nothing | A **stale bundle**: `build` ran without `gen`, or the generated tables were committed before the last design change | `build` is `npm run gen && tsc --noEmit && vite build`; re-run `gen` and commit the diff whenever `security.json` or an `openapi.yaml` changes. A stale generated union type-checks green. |\n| A role's own screen is hidden for it, or opens and its list call answers 401 | The role's grants lack the handle of the operation the screen **loads** — whole-string match, so `x:read-all` (`GET \u002Fx`) is not `x:read` (`GET \u002Fme\u002Fx`); or `loads` names the wrong reach for the screen | A design finding, not a code one: in mock mode the console line names the operation and the handle. Report the role, the screen and that handle. Never widen `loads`, a guard or a mock to hide it. |\n| Build red on `TS2307: Cannot find module '.\u002Fgenerated\u002F…'` (plus a burst of `TS7006` implicit-`any`) while `tsc --noEmit` is clean locally | `src\u002Fgenerated\u002F` is **git-ignored**, usually by an unanchored `generated\u002F` in the repo-root `.gitignore` written for a backend component. `git add` skipped it at exit 0 and `git status` stayed clean | `git check-ignore -v src\u002Fgenerated\u002F*` names the offending line. Anchor that pattern (`\u002Fonboarding-api\u002Fgenerated\u002F`), then re-add. The `TS7006` rows are downstream of the missing types and vanish with them. Never `git add -f`. |\n",{"name":5,"metadata":24,"description":7},{"aep":25},{"kind":26,"audience":27},"org",[28],"coding","main","e3b5fc8668f26761380b2d4965719f2d8f2eb246","skills\u002Freact-webapp","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer","https:\u002F\u002Fgithub.com\u002Fwso2","https:\u002F\u002Fwso2.com","Welcome to the WSO2 source code! For info on working with the WSO2 repositories and contributing code, click the link below.","2026-11-11 15:36:27",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add wso2\u002Flabs-agentic-engineer --skill react-webapp",{"tool":43,"command":44},"bunx","bunx skills add wso2\u002Flabs-agentic-engineer --skill react-webapp",{"tool":46,"command":47},"pnpm","pnpm dlx skills add wso2\u002Flabs-agentic-engineer --skill react-webapp","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002FSKILL.md",true,[51,57,61,65,69,73,77,81,87,91,95,99],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"assets\u002F__tests__\u002Fmock-wired.cases.mjs","SCRIPT","脚本",11348,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002Fassets\u002F__tests__\u002Fmock-wired.cases.mjs",{"path":58,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":59,"sourceHtmlUrl":60},"assets\u002F__tests__\u002Fmock-wired.test.mjs",2048,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002Fassets\u002F__tests__\u002Fmock-wired.test.mjs",{"path":62,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":63,"sourceHtmlUrl":64},"assets\u002F15-aep-api-proxy.sh",3234,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002Fassets\u002F15-aep-api-proxy.sh",{"path":66,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":67,"sourceHtmlUrl":68},"assets\u002Fmock-badge.ts",5857,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002Fassets\u002Fmock-badge.ts",{"path":70,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":71,"sourceHtmlUrl":72},"assets\u002Fmock-browser.ts",3235,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002Fassets\u002Fmock-browser.ts",{"path":74,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":75,"sourceHtmlUrl":76},"assets\u002Fmock-plugin.ts",11959,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002Fassets\u002Fmock-plugin.ts",{"path":78,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":79,"sourceHtmlUrl":80},"assets\u002Fmock-wired.ts",12731,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002Fassets\u002Fmock-wired.ts",{"path":82,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":85,"sourceHtmlUrl":86},"assets\u002Fnginx-default.conf","ASSET","资产文件",2698,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002Fassets\u002Fnginx-default.conf",{"path":88,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":89,"sourceHtmlUrl":90},"assets\u002Fnginx-default.conf.test.mjs",2765,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002Fassets\u002Fnginx-default.conf.test.mjs",{"path":92,"resourceType":83,"resourceTypeDesc":84,"sizeBytes":93,"sourceHtmlUrl":94},"assets\u002Fnginx.conf",1009,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002Fassets\u002Fnginx.conf",{"path":96,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":97,"sourceHtmlUrl":98},"assets\u002Fnginx.conf.test.mjs",2804,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002Fassets\u002Fnginx.conf.test.mjs",{"path":100,"resourceType":101,"resourceTypeDesc":102,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Fmock-mode.md","REFERENCE","参考文档",28203,"https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Freact-webapp\u002Freferences\u002Fmock-mode.md",[106,113,120,127,134,141],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M735MP9NFFRPS260G9D16JQX","validation-task","Load when working a VALIDATION task dispatched by WSO2 Labs Agentic Engineer — judging a deployed version against its acceptance criteria.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fvalidation-task\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":19},"01M735MJ8ZMRZR20A57TMF7R9Q","thunder-authentication","Apply when a component sits on the project's sign-in — a SPA whose users authenticate through the auth platform-resource dependency, or a protected backend those signed-in users call.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fthunder-authentication\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":19},"01M735MFQMY8DY1EM7JKS784D3","task-planning","Use when planning a version's build from a design — the plan turn that writes the build's checklist with planBuild, one item per feature the version carries in build order, after a Foundation item when the version needs one.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Ftask-planning\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":19},"01M735MCJQ4EVH7G4ZFMC682Y4","start","Use when kicking off a project from its idea — the product pass that agrees the feature list and writes the product page, the product-wide page and a stub per feature — or re-running \u002Fstart on a project that already has requirements.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fstart\u002FSKILL.md",[],[],{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":19},"01M735M9R050KT3H34PVXN2MKK","security-design","Write specs\u002Fdesign\u002Fsecurity.json when a design has sign-in, permissions, roles or test users — the permission catalog every API operation is gated on.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fsecurity-design\u002FSKILL.md",[],[],{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":19},"01M735M60CTW4S7XMS6XCX9A7Y","resolve-dependency","Use for taking one external dependency from open to resolved — `\u002Fresolve-dependency \u003Cname> [answer]` names it and may carry the provider the user chose; `\u002Fresolve-dependencies` walks every open one in turn. Ask which provider (their suggestions as options; never choose for them), get its interface on disk (found, uploaded from the card, or assumed under the authorization the card records), then derive the config keys.","https:\u002F\u002Fgithub.com\u002Fwso2\u002Flabs-agentic-engineer\u002Fblob\u002Fmain\u002Fskills\u002Fresolve-dependency\u002FSKILL.md",[],[]]