bayes-platform: Skill for Claude Code

.claude/skills/check-permission-matrix/SKILL.md

check-permission-matrix is a skill for Claude Code from bayesimpact/bayes-platform. It costs 46 tokens per session (342 once invoked), scanned A, original, MIT.

A documentation audit that compares an RBAC permission matrix with the roles and permissions defined in code. RBAC, or role-based access control, gives users permissions according to their roles.

In plain words
What is it for?
Use it to check roles, permissions, grants, and global permissions, and to report every mismatch between the code and the Markdown document.
Why use it?
It finds cases where the documentation says users can or cannot do something different from the application. This prevents the permission guide from becoming an unreliable source of information.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is bayesimpact/bayes-platform's own configuration. It tells Claude Code how to work on bayes-platform itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything bayes-platform configures →

Reuse

Borrowing it

Nothing to install: this file belongs to bayesimpact/bayes-platform. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/bayesimpact/bayes-platform/main/.claude/skills/check-permission-matrix/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/bayesimpact/bayes-platform

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for check-permission-matrix

README.md
[![agentmods](https://agentmods.dev/badge/skills/bayesimpact/bayes-platform/check-permission-matrix/github.svg)](https://agentmods.dev/skills/bayesimpact/bayes-platform/check-permission-matrix)
Your own site
<a href="https://agentmods.dev/skills/bayesimpact/bayes-platform/check-permission-matrix"><img src="https://agentmods.dev/badge/skills/bayesimpact/bayes-platform/check-permission-matrix/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for check-permission-matrix

Your own site · 80×15
<a href="https://agentmods.dev/skills/bayesimpact/bayes-platform/check-permission-matrix"><img src="https://agentmods.dev/badge/skills/bayesimpact/bayes-platform/check-permission-matrix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 342 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.00342
Opus 5 $0.00023 $0.00171
Sonnet 5 $0.00009 $0.00068
Haiku 4.5 $0.00005 $0.00034

Measured 2d ago against content hash 59ca389c9751, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-16, from the pricing page.

Security

Grade A, and why

check-permission-matrix scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/check-permission-matrix/SKILL.md · 28 lines

What it actually says

Verify that docs/rbac-permission-matrix.md is an exact mirror of the RBAC catalog in code.

Steps

  1. Read the two code sources of truth:

    • apps/api/src/domains/rbac/rbac.constants.ts — extract every role key and its granted permissions from ORGANIZATION_ROLE_PERMISSIONS, PROJECT_ROLE_PERMISSIONS, and AGENT_ROLE_PERMISSIONS (resolve permission constants such as TRACE_READ_PERMISSION to their string values).
    • packages/api-contracts/src/rbac/permissions.ts — extract every member of the GlobalPermission union.
  2. Read docs/rbac-permission-matrix.md and parse each table into (permission, role) → granted/not-granted pairs.

  3. Compare both directions and collect mismatches:

    • Role in code but missing from the doc (or the reverse)
    • Permission granted in code but unchecked/missing in the doc (or the reverse)
    • GlobalPermission union member absent from the "Global roles" table
  4. Report the results:

Mismatches

For each mismatch show the role, the permission, what the code says, and what the doc says.

Summary

"N roles and M grants checked, X mismatches found." If everything matches, say the matrix is up to date. If there are mismatches, propose the exact doc edits to fix them.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 28 lines · 46 tokens per session scan A 59ca389c9751

Subscribe to this mod's changes

check-permission-matrix is a skill published in the GitHub repository bayesimpact/bayes-platform (18 stars, last pushed yesterday), licensed MIT. It adds 46 tokens to every session and 342 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-14.