client-ids
Skill627 starsChanged 8 days agoMITView on GitHub
Handle device, user and Datadog identifiers through the redacted `DeviceId`, `UserId` and `DatadogId` classes of `@domain/entity-client-identity`, reading a raw value only through an export method allowlisted in `export-rules.json`. Use when reading, storing or sending a device id, user id or Datadog id, adding an `export*For*()` method or a new id class, editing `domain/entity/client-identity/**`, or when the `check-export-rules` CI target fails.
In this repository70 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- analyticsSkill
- batch-feature-devSkill
- ci-runnersSkill
- ci-workflow-refsSkill
- cleanupSkill
- cloud-sync-moduleSkill
- codeownershipSkill
- coin-families-contractSkill
- coin-modulesSkill
- commentsSkill
- configurationSkill
- console-logSkill
- create-changesetSkill
- create-prSkill
- data-layer-advancedSkill
- debug-rn-native-crashSkill
- dependency-patchesSkill
- detect-data-leaksSkill
- device-intent-executorSkill
- devtools-import-boundarySkill
- dialogs-sliceSkill
- docs-migrateSkill
- docs-update-or-createSkill
- domain-dataSkill
- e2e-desktop-add-or-updateSkill
- e2e-desktop-onboardSkill
- e2e-earnSkill
- e2e-mobile-add-or-updateSkill
- e2e-mobile-onboardSkill
- e2e-swapSkill
- errorsSkill
- feature-devSkill
- fix-ciSkill
- flow-packageSkill
- get-pr-commentsSkill
- git-conventionsSkill
- i18n-keysSkill
- impacting-prsSkill
- knip-migrationSkill
- ldls-nativeSkill
- ldls-webSkill
- ledger-wallet-cliSkill
- legacy-migrationSkill
- mvvm-architectureSkill
- new-packageSkill
- package-public-apiSkill
- pnpm-resolutionSkill
- prefer-set-hasSkill
- pre-reviewSkill
- react-generalSkill
- rebuild-to-fix-lib-import-errorsSkill
- remove-feature-flagSkill
- run-buildsSkill
- run-e2e-ciSkill
- runner-imagesSkill
- run-testsSkill
- slack-pr-messageSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 3 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Never: use raw string IDs for devices, users, or analytics.
- Very specific: line 13
Always: use DeviceId, UserId, or DatadogId classes from @domain/entity-client-identity.
- Very specific: line 15
Every export method must be allowlisted in domain/entity/client-identity/export-rules.json.
- Distinctive: line 32
Never: create raw string IDs for devices, users, or analytics
- Very specific: line 44
Every ID usage must be explicitly declared through a dedicated export method (e.g., exportUserIdForSomethingSomething())
- Very specific: line 53
Add a new export method on the class (e.g., exportUserIdForSomethingSomething())
- Very specific: line 54
Add your file to domain/entity/client-identity/export-rules.json:
- Distinctive: line 64
Use the method only from the allowlisted file (at the system boundary)
- Very specific: line 68
Create a new class in domain/entity/client-identity/src/ids/ (e.g., NewId.ts)
- Very specific: line 69
Follow the pattern from DeviceId.ts: Symbol storage, redacted toString/toJSON, export methods
- Very specific: line 70
Add export methods with allowlist rules in export-rules.json
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Client Identity Domain (@domain/entity-client-identity)
Privacy & Security
Sensitive identifiers (DeviceId, UserId, DatadogId) must always use the domain entity package:
- Never use raw string IDs for devices, users, or analytics.
- Always use
DeviceId,UserId, orDatadogIdclasses from@domain/entity-client-identity. - ID values are only accessible through explicit export methods (e.g.,
exportUserIdForSomething()). - Every export method must be allowlisted in
domain/entity/client-identity/export-rules.json. - Export IDs only at system boundaries (API calls, persistence) — never in the middle of processing.
toString()andtoJSON()return[DeviceId:REDACTED]by design.
Package layout
| Package | Location | What it contains |
@domain/entity-client-identity | domain/entity/client-identity/ | DeviceId, UserId, DatadogId classes + Redux slice, selectors, persistence |
@domain/api-push-devices | domain/api/push-devices/ | RTK Query mutation + Redux sync middleware |
Core Principles
1. All ID Usage Must Go Through This Package
- Never create raw string IDs for devices, users, or analytics
- Always use
DeviceId,UserId, orDatadogIdclasses from@domain/entity-client-identity - IDs are protected by Symbols and automatically redacted in logs/JSON
2. Privacy Protection
- IDs are stored in Symbol fields to prevent accidental access
toString()andtoJSON()return[DeviceId:REDACTED]by default- Actual ID values are only accessible through explicit export methods
3. Explicit Use Cases
- Every ID usage must be explicitly declared through a dedicated export method (e.g.,
exportUserIdForSomethingSomething()) - Export methods represent specific, documented use cases and can only be called from allowlisted files
- The
export-rules.jsonfile indomain/entity/client-identity/serves as a registry of all allowed use cases - The
check-export-rulestarget (scripts/check-export-rules.mjs) enforces the allowlist in CI
Usage Requirements
Using an existing ID for a new use case
- Add a new export method on the class (e.g.,
exportUserIdForSomethingSomething()) - Add your file to
domain/entity/client-identity/export-rules.json:{ "domain/entity/client-identity/src/ids/UserId.ts": { "exportUserIdForSomethingSomething": [ "your/new/file/path.ts" ] } } - Use the method only from the allowlisted file (at the system boundary)
Introducing a new kind of ID
- Create a new class in
domain/entity/client-identity/src/ids/(e.g.,NewId.ts) - Follow the pattern from
DeviceId.ts: Symbol storage, redacted toString/toJSON, export methods - Add export methods with allowlist rules in
export-rules.json
import { DeviceId } from "@domain/entity-client-identity";
// ✅ Correct: Use the domain entity
const deviceId = DeviceId.fromString("device-123");
// ❌ Wrong: Don't use raw strings
const deviceId = "device-123"; // BADDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

