Claude-skill-registry libpolicy

install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/libpolicy" ~/.claude/skills/majiayu000-claude-skill-registry-libpolicy && rm -rf "$T"
manifest: skills/data/libpolicy/SKILL.md
source content

libpolicy Skill

When to Use

  • Implementing access control for resources
  • Evaluating authorization policies
  • Managing permissions in multi-tenant systems
  • Building role-based access control (RBAC)

Key Concepts

PolicyIndex: Stores policies and evaluates access requests against them.

Policy evaluation: Determines if an actor can perform an action on a resource based on defined policies.

Usage Patterns

Pattern 1: Evaluate access

import { createPolicyIndex } from "@copilot-ld/libpolicy";

const index = await createPolicyIndex(storage);
const allowed = await index.evaluate({
  actor: "user:123",
  resource: "document:456",
  action: "read",
});

Pattern 2: Load policies

const index = await createPolicyIndex(storage);
await index.load("policies/"); // Load from directory

Integration

Used by ResourceIndex for access control. Policies stored in data/policies/.