apply
Set chaff up in the folder: chaff.yaml for the chosen genre, today's findings shelved in .chaff-baseline.json, and, when asked, a…
Limit sign-in to the company's email domain, twice: in blocking functions and in the rules.
$ npx -y skills add receptron/mulmoterminal --skill domain-restriction --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/domain-restrictionContext preview
The summary Claude sees to decide when to auto-load this skill.
Limit sign-in to the company's email domain, twice: in blocking functions and in the rules.
name: blueprint-internal-domain-restriction description: "Limit sign-in to the company's email domain, twice: in blocking functions and in the rules."
0. Blocking functions need the projects upgraded to **Firebase Authentication with Identity Platform**. Run `sh <usecase pack>/checks/identity-platform.sh dev prod` (with `BLUEPRINT_BASE` / `BLUEPRINT_USECASE` set to the two pack paths): it reads each project and names only the ones not upgraded yet. Ask the user only if it fails, giving them exactly the URLs it printed — the upgrade is free at this size, but it is a click only they can make. 1. In `functions/`, add `beforeUserCreated` and `beforeUserSignedIn` (from `firebase-functions/v2/identity`). Both throw `HttpsError("permission-denied")` unless `event.data.email` ends with `@<domain>` AND `event.data.emailVerified` is true. Compare lower-cased. 2. If the spec says Google Workspace, also pass `hd: <domain>` to the Google provider. That is a hint to the account picker, not a check — the functions are the check. 3. Copy `infra/firestore.rules` from the internal pack into the project, filling `{{DOMAIN_REGEX}}` with the domain in lower case with its dots escaped. First check the domain is only DNS labels (`^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$` after lower-casing); anything else — a `*`, a `|`, a space — could widen the rule, so ask instead of escaping it. Keep every collection already opened by the data-rules step. 4. A refused sign-in gets its own screen, not an error code. The blocking functions' refusal reaches the client as `auth/internal-error` whose message carries the `HttpsError` (look for `permission-denied` / `BLOCKING_FUNCTION_ERROR_RESPONSE`), so classify the error in a pure function of its own file (refused-by-domain / cancelled / popup-blocked / other) with a unit test for each kind. The refusal screen says in plain words that only `@<domain>` accounts can use this app, names the account that was refused when the error carries it, and offers a button that opens the account chooser again (`prompt: "select_account"`). Other failures say what happened in words; the raw code may follow in small text, never on its own. 5. Write `test/blueprint/domain.spec.ts`: a verified member of the domain is let in, also with an upper-case address; another domain, an unverified address, and look-alikes (`example.co.jp.evil.com`, `evilexample.co.jp`, `@example.co.jp` with nothing before the `@`) are all refused.
The emulator proves the code, not the real projects: the functions only run once they are deployed AND registered as blocking functions. The `verify-dev` and `production-auth` steps check that on each project.
Done when the check passes: `emulator-test.sh domain`.
user approved exactly that.
Run multiple coding-agent sessions in parallel — and see which one needs you. A browser terminal for parallel AI coding agents: several sessions side by side, each in its own cell, with the one that needs you marked in colour.
Set chaff up in the folder: chaff.yaml for the chosen genre, today's findings shelved in .chaff-baseline.json, and, when asked, a…
Measure what chaff reports on the named documents today, as the kind the person chose, and propose the setup — changing nothing…
Answer each question from the named documents only, quoting where the answer is written, or saying plainly that the documents do…
Add the approved answers to FAQ.md when the person chose to keep them, after what it already holds; change nothing otherwise.
Build the spec's operations as the Worker's API, with validation and tests.