/be:field-encryptionfrom Backend Skills
Encrypting individual sensitive fields before they reach the data store — the threat model, encrypt versus hash versus blind index, AES-256-GCM with a fresh nonce and a versioned format, context bound as associated data, one key per store and per purpose, envelope encryption with a KMS when it's worth it, the hydrate boundary and an opt-in reveal, rotation with old keys kept for backups, and crypto-shredding. Use when storing a secret a user must read back, or changing how encrypted fields are keyed.
Ships in Backend Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Some fields must be readable again but would hurt if a copy of the database leaked — a passcode the owner shares, a payout account number, a third-party credential held on someone's behalf. They're encrypted in the service layer with AES-256-GCM before the write, so the store, its backups, its exports and its logs hold only ciphertext, and plaintext exists only between one encrypt on the way in and one decrypt on the way out.
Before applying this skill, read the project's root AGENTS.md, the AGENTS.md closest to the files in question, and any doc they link for this skill's topic. Names, values and choices — budgets, tiers, tokens, voice, paths — come from those files, never from this skill.
Write this down in the project's docs, or someone will assume it buys more:
rate-limiting).auth), a token (SHA-256 of a random value is enough), a low-entropy identifier kept for dedupe (an HMAC with its own key, since a plain hash of a small space is brute-forced).crypto), never a hand-rolled mode. GCM is authenticated: a tampered byte or the wrong key fails the tag instead of returning garbage.v1:<nonce>:<tag>:<ciphertext>. The version names the key and algorithm, so old and new ciphertext coexist during a rotation and decrypt picks the right key.env), so a malformed key fails the deploy, not the first read.authTagLength: 16 to the decipher, because Node still accepts a shorter tag with only a warning, which makes forging one easier.null passes through both ways, so optional fields stay optional.The full functions, with associated data and a key per version, are in references/example.md.
openssl rand -hex 32) and write it to the secret manager with printf, not echo, which adds a newline the manager stores. Read it back and compare.string | null; routes, contracts and clients never see v1:….schemas-and-contracts).{ ...existing, ...writes } hands the caller the ciphertext it just wrote. Return the plaintext the caller sent instead. The symptom is v1:a3f0… on screen after an edit that a refresh fixes.timingSafeEqual), behind a rate limit and lockout that fail closed (rate-limiting).On a suspected leak, when someone with access leaves, before the nonce limit, and on a set period otherwise (OWASP, NIST SP 800-57):
v2.v2:.v1: value, decrypt with the old key, and write it as v2: in a transaction that checks the value is unchanged, so a concurrent edit isn't overwritten by the old value re-encrypted.v1: — but keep it archived as long as any backup holds v1: data, or restoring the backup restores data nobody can read (firestore keeps backups for weeks).The code for every step exists before the first rotation is needed, so a leak is answered in hours (env for the overlap between secrets).
Each encrypted field gets a round-trip test: write it, read the raw document and see v1:…, hydrate and get the plaintext back. A ciphertext moved to another record, a changed byte and a wrong key each fail to decrypt. The test setup seeds a fixed test key (testing).
Secrets, the env guard and rotation overlap env · password hashing and sign-in auth · verify routes and lockouts rate-limiting · projections and list shapes schemas-and-contracts · the store and its backups firestore · where the service sits api-architecture · server threats backend-security · test keys testing.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub timonwa/engineering-skills --plugin be22 skills in this plugin
/access-controlAccess control for a Next.js API on Firebase — roles, relationships and attributes (RBAC, ReBAC, ABAC) behind permission verbs and one pure can(); guards as the only gate, 404 before 403; tenant scoping; invitations; escalation limits; two-person approval and access reviews; stale claims; API-key scopes; share links and passcodes; where plan and flag checks sit; UI gates that only hide; and tests. Use when adding a permission, role, guarded route, API key, share link, or a control only some people see./access-control-auditManually invoked. Access-control audit — guards on every route and Server Action (BFLA), 404 before 403 and tenant scoping (BOLA), allowlisted writes and projected reads (BOPLA), verbs never role names, roles that add up, escalation and invitations, claims and revocation, sessions and sign-in, API keys and share links, the plan and flag order, UI gates, data rules and the tests. Verifies each finding and writes a prioritised report./api-architectureHow an API route is built in a Next.js API — the fixed order of rate limit, authorise, validate, delegate, audit, respond; thin routes over services; the response envelope and typed errors; caching headers; concurrent edits; long-running work; cursor pagination and allowlisted sorts; resource paths, versions, deprecation and state-transition sub-routes; and what every new route ships with. Cron, webhooks and audit logs are references. Use when adding, changing or reviewing a route handler or the API layer's structure.Other plugins' skills for the same job