Skip to main content
skill CX Codex

rbac-policy-tester — Claude Code skill: what it does, how to install

rbac-policy-tester generates role permission matrices and automated authorization test suites to catch RBAC regressions in CI.

MIT 274 installs ★ 64 updated 2026-01-12

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add patricio0312rev/skills --skill rbac-policy-tester -a claude-code
Open on GitHub

What rbac-policy-tester does

The skill lays out a permission matrix mapping roles to actions like create, read, update, and delete across application resources. Using that matrix, the agent creates TypeScript test suites running API requests with role-specific authentication tokens.

It builds tests for allowed routes expecting HTTP 200 as well as forbidden actions asserting HTTP 403. Because the generated blueprint relies on request(app) and Bearer tokens, setups using attribute-based access control or custom session headers require manual adjustments. The included checklist keeps track of matrix definitions, role coverage, and CI gating.

What it helps with

  • generate a role-permission test matrix across resources
  • write positive and negative authorization tests in TypeScript
  • assert HTTP 403 responses for forbidden actions
  • add CI gating to prevent RBAC regressions

Example prompts for the agent

  • Generate an RBAC permission matrix and test suite for ADMIN, MANAGER, and GUEST roles
  • Write negative authorization tests returning 403 for unauthorized order updates
  • Create test coverage for role-based access across users and reports endpoints

How to install rbac-policy-tester

1Skills CLI (Vercel)

npx skills add patricio0312rev/skills --skill rbac-policy-tester -a claude-code

2Manually: put the files in place

~/.claude/skills/rbac-policy-tester/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/rbac-policy-tester/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about rbac-policy-tester

How do I install rbac-policy-tester in Claude Code?

Run npx skills add patricio0312rev/skills --skill rbac-policy-tester -a claude-code. Alternatively, place the skill file directly at ~/.claude/skills/rbac-policy-tester/SKILL.md.

What does rbac-policy-tester do?

It outlines a matrix of roles and permitted actions, then outputs an automated test suite verifying each endpoint. Permitted requests expect a 200 status, while forbidden operations are checked against a 403 status code.

How does it handle denied permissions?

For each role and resource, the skill determines actions excluded from the matrix and generates tests expecting HTTP 403. It also provides a checklist to verify coverage and CI integration.

Source text

SKILL.md · MIT
---
name: rbac-policy-tester
description: Creates comprehensive permission tests ensuring RBAC doesn't regress with test matrices, CI gating, and authorization coverage. Use for "RBAC testing", "permission tests", "authorization testing", or "access control tests".
---

# RBAC/Policy Tester

Comprehensive testing for role-based access control.

## Permission Test Matrix

```typescript
type Role = 'ADMIN' | 'MANAGER' | 'USER' | 'GUEST';
type Action = 'create' | 'read' | 'update' | 'delete';
type Resource = 'users' | 'orders' | 'reports';

const permissionMatrix: Record<Role, Record<Resource, Action[]>> = {
  ADMIN: {
    users: ['create', 'read', 'update', 'delete'],
    orders: ['create', 'read', 'update', 'delete'],
    reports: ['create', 'read', 'update', 'delete'],
  },
  MANAGER: {
    users: ['read', 'update'],
    orders: ['create', 'read', 'update'],
    reports: ['read', 'update'],
  },
  USER: {
    users: ['read'], // Only own profile
    orders: ['create', 'read'], // Only own orders
    reports: ['read'],
  },
  GUEST: {
    users: [],
    orders: [],
    reports: ['read'],
  },
};

describe('RBAC Tests', () => {
  Object.entries(permissionMatrix).forEach(([role, resources]) => {
    describe(\`Role: \${role}\`, () => {
      Object.entries(resources).forEach(([resource, actions]) => {
        actions.forEach(action => {
          it(\`should allow \${action} on \${resource}\`, async () => {
            const token = generateToken({ role });
            await request(app)
              .post(\`/api/\${resource}/\${action}\`)
              .set('Authorization', \`Bearer \${token}\`)
              .expect(200);
          });
        });

        // Test forbidden actions
        const allActions: Action[] = ['create', 'read', 'update', 'delete'];
        const forbidden = allActions.filter(a => !actions.includes(a));

        forbidden.forEach(action => {
          it(\`should deny \${action} on \${resource}\`, async () => {
            const token = generateToken({ role });
            await request(app)
              .post(\`/api/\${resource}/\${action}\`)
              .set('Authorization', \`Bearer \${token}\`)
              .expect(403);
          });
        });
      });
    });
  });
});
```

## Output Checklist

- [ ] Permission matrix defined
- [ ] Test suite for all roles
- [ ] Positive and negative tests
- [ ] CI gating enabled
- [ ] Coverage monitoring
      ENDFILE

© patricio0312rev · MIT · patricio0312rev/skills

Similar skills

All skills for Testing and QA →

From the same set148

The whole set →
design-to-component-translator The design-to-component-translator skill turns Figma specs into React components with design tokens, responsive rules, and interaction states for implementing designs in code. CX Codex +1 276installs secrets-env-manager secrets-env-manager validates environment variables in CI workflows, enforces secret masking, and catches leaked keys early. CX Codex +1 276installs evaluation-harness evaluation-harness — a skill for Claude Code and five other agent platforms that sets up repeatable LLM evaluation: golden datasets, scoring rubrics, pass/fail thresholds, and regression reports. CX Codex +1 275installs backend-latency-profiler-helper backend-latency-profiler-helper tracks down slow API endpoints, lists likely causes, and puts the fixes in priority order. CX Codex +1 275installs etl-sync-job-builder etl-sync-job-builder generates TypeScript ETL pipelines with incremental watermark tracking, idempotent batch upserts, and retry backoff logic. CX Codex +1 274installs structured-logging-standardizer structured-logging-standardizer sets up structured JSON logging with request correlation IDs using AsyncLocalStorage and pino. Keeps backend logs queryable and connected. CX Codex +1 273installs data-retention-archiving-planner data-retention-archiving-planner plans data retention policies, maps compliance requirements, and automates cold storage migration for databases. CX Codex +1 273installs reliability-strategy-builder reliability-strategy-builder builds a failure-handling plan for a service: circuit breaker, retries with backoff, fallback, bulkhead isolation and SLOs with error budgets. CX Codex +1 273installs

Project sponsors

Companies that keep this analytics open