Enforces PermDock permissions in database queries and Postgres row-level security. Use when listing rows with permdock.where() and filter(), compiling conditions with toWhere from permdock/drizzle, permdock/prisma or permdock/kysely, guarding Convex functions with permdock/convex, generating or verifying RLS with permdock rls generate, verify or migrate, modelling folders, sub-teams or reporting lines with parent and relation() through a RelationSource, prefetchRelations or whoCan, or proving query and database parity with testOrmParity and testRlsParity. Also for doctor PD027, PD028, PD031 and PD032.
Ships in PermDock. 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.
The same portable conditions decide can() in memory, narrow list queries through where(), and compile to Postgres RLS. Keep them portable and prove the three agree (conditions, RLS). Set up the policy and factory first with the permdock-wire skill (npx skills add ScaleDockHQ/PermDock --skill permdock-wire); named scopes and memberships come from the permdock-tenancy skill.
where conditions with the portable operators; a closure is for checks they cannot express, and it is filtered in memory, never in SQL or RLS.where() before the query and filter() after it. One row is loaded and checked with assert or the adapter's protect.service_role, and a request runs as authenticated or anon.context. A condition the database must enforce compares a server-set principal.claims.* value, never user_metadata.relation-unavailable when the relation source is missing or unloaded.permdock.where(permission) with the ORM's toWhere, then run filter and pick on the rows. -> references/queries-and-rls.md
✓ A user with no grant gets an empty list, and the query compiles without non-portable-condition.parent, declare the relations principals hold, add restricted where rows must not inherit, and grant with relation(resource, name, { through: 'parent' }). Pass a RelationSource as relations and call prefetchRelations before can / filter when it is async. Use whoCan for share dialogs. -> references/relationships.md
✓ permdock doctor --only graph is clean, and a viewer of a parent folder can read a child document.permdock rls generate from the policy, or keep SQL as the authority with sqlFunction twins and rls.functions, or move hand-written helpers with permdock rls migrate. -> references/queries-and-rls.md
✓ permdock rls generate --check passes in CI.permdock rls verify with fixtures, --tree for graph grants, and --introspect against a deployed database.
✓ Every verify run exits 0.testOrmParity(policy, scenarios, { run, id }) for each list endpoint and testRlsParity(policy, options) for RLS tables, from permdock/testing (testing adapter). Run testRelationSource on a custom RelationSource.
✓ The query and the database return exactly the rows filter() keeps.eq, in, memberOf, sqlFunction, …); rewrite those as JSON conditions.where on a resource with a matching relation uses relation() instead.opaque RLS grant wraps a named helper; use sqlFunction with a twin and map it in rls.functions. A set-returning helper uses set: { column } and a declared resource column (PD086).context.* (PD027); on Supabase, supabase.hook.attrs lists only server-owned values (PD028).testOrmParity run, every RLS table an testRlsParity or rls verify --db-url-stdin run, and a custom RelationSource passes testRelationSource.toWhere per ORM, checkRow, withSubject, Convex, rls generate / import / verify / migrate flags and config, field views, SQL as the authority.parent, relation kinds, restricted, links, relation(..., { through }), RelationSource, prefetchRelations, whoCan, the closure table and --tree.permdock rls, Postgres RLS.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/permdock:permdock-datafrom PermDock
npx claudepluginhub scaledockhq/permdock --plugin permdock8 skills in this plugin
/permdockExplains how PermDock decides and routes to the right PermDock skill. Use first for any work with permdock, typed permissions, roles or access control in a TypeScript app, when a check is denied and the reason is unclear, when reading a Decision, denial reason or doctor code, when looking up current PermDock identifiers through the docs MCP, or when choosing between the permdock-wire, permdock-audit, permdock-agents, permdock-approvals, permdock-tenancy, permdock-data and permdock-credentials skills./permdock-agentsGuards AI agent tool calls, automations and chat commands with PermDock operations, subjects, actors and delegation. Use when declaring defineOperations, wiring operations in permdock/agent, permdock/ai-sdk, permdock/claude-agent, permdock/openai, permdock/eve or permdock/mcp, gating models or filtering tool results, running published automations with permdock/workflow or permdock/workflow-sdk, protecting chat commands and approval buttons with permdock/chat or permdock/chat-sdk, separating the user (principal) from the agent (actor), declaring a delegation option or policy delegations, publishing an A2A Agent Card with permdock/a2a, registering WebMCP tools with permdock/webmcp, verifying Web Bot Auth signers as actors, or when agent calls are denied with no-delegation or not-delegated./permdock-approvalsRequires human approval on PermDock grants, notifies approvers and resumes the approved call. Use when adding approval to a destructive or money-moving action (delete, publish, pay, refund, transfer), choosing approvers with approval by, user(), relation(), manager(), mode confirm or authorize, quorum, ttl, escalation, staleOn or approvalFingerprint, ordering approvers with combine and stages, covering an approver with an ApprovalDelegation, loading approval rules as data with an ApprovalPolicySource, separating preparer and approver with exclusiveWith, labelling operations with risk and effects meta, mounting approvalsHandler with an ApprovalStore, sending approval emails (approvalEmail) or chat cards (approvalCard, approvalActions) from approvalPrompt, parking a background run on an ApprovalWaiter (pollingApprovalWaiter, workflowSdkWaiter), resuming with the PermDock-Approval header, mapping approval-required to an agent runtime, MCP elicitation or AG-UI interrupt, or fixing doctor PD017, PD018 or PD024./permdock-auditReviews an existing PermDock setup or a pull request that changes it. Use when auditing permissions, reviewing a PR that touches permissions.ts, policy.ts or an adapter guard, finding ungranted or unused leaves, missing human approvals on agent tools, closures that should be portable, validate never, untested grants, or mapping an app to OWASP ASI02 and ASI03. Use whenever the user asks to audit, review or harden PermDock./permdock-credentialsResolves PermDock subjects from access tokens, API keys and share links. Use when verifying OAuth or OIDC access tokens with subjectFromJwt or an introspection response with subjectFromIntrospection, issuing personal access tokens, API keys, service accounts or feed keys with decideCredential and resolving them with subjectFromApiKey, setting tenant key rules (maxTtl, kinds, allowNoExpiry) in a SettingsSource, minting guest or share links with signCapability and resolving them with subjectFromCapability, serving a link through RLS with exchangeCapability, or fixing doctor PD029 and on('auth') causes such as invalid-chain./permdock-tenancyModels tenants, memberships, contacts and support sessions in PermDock. Use when declaring named scopes (organizations, workspaces, customers inside an organization), loading memberships through a MembershipSource, putting a role on one scope, keeping an owner per organization with min, max or transferOnly, controlling who hands out which role with assigns and for, checking a membership change with decideRoleChange, letting tenant admins define custom roles with customRoles and validateCustomRole, giving external customer contacts portal access as kind contact principals found through a PrincipalSource and principalByIdentity, letting support staff view the app as a customer with decideSupportSession, signSupportSession and subjectFromSupportSession, or fixing doctor PD023, PD025 or PD026 and denials such as tenant-mismatch, last-holder, not-assignable-by or reason-required.