urule CLAUDE.md

urule CLAUDE.md is an instructions file for coding agents from urule-ai/urule. It costs 2,996 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for urule, an open-source coordination layer that connects services such as Keycloak, NATS, OpenFGA, OPA, Temporal, and PostgreSQL. They describe its architecture, tools, layout, and contribution rules.

In plain words
What is it for?
Use them when developing or reviewing urule services, shared packages, database schemas, events, authentication, tests, or the Next.js frontend.
Why use it?
They give a coding agent the project’s service boundaries, authentication flow, event rules, and technology choices before it changes code.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/urule-ai/urule/claude-md
Clone the repo
git clone --depth 1 https://github.com/urule-ai/urule

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 urule CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/urule-ai/urule/claude-md.svg)](https://agentmods.dev/instructions/urule-ai/urule/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/urule-ai/urule/claude-md"><img src="https://agentmods.dev/badge/instructions/urule-ai/urule/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,996 This file is loaded in full into every session.
When invoked 2,996 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.02996 $0.02996
Opus 5 $0.01498 $0.01498
Sonnet 5 $0.00599 $0.00599
Haiku 4.5 $0.00300 $0.00300

Measured 4d ago against content hash 19c078ca00d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

urule CLAUDE.md 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 4d 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.md · 290 lines

How it starts

The opening of the file, as written. The whole thing — 290 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Urule — AI Assistant Guide

Urule is the open-source coordination layer for AI agents. It composes open-source projects (Keycloak, NATS, OpenFGA, OPA, Temporal, PostgreSQL) into a cohesive platform and only builds the coordination glue. This file helps AI coding assistants understand the codebase and contribute effectively.

Architecture Principles

  1. Contract-first — Types and interfaces live in library packages (packages/). Services implement them.
  2. Schema-per-service — Each service owns its PostgreSQL schema. Never query another service's database.
  3. Event-driven — Mutations publish events to NATS. Consumers are idempotent.
  4. Services are glue — If a service exceeds ~2000 lines, it's doing too much.
  5. Auth flow — User → Keycloak JWT → service validates via @urule/auth-middleware → governance/authz checks.

Tech Stack

  • Language: TypeScript ESM ("type": "module", strict mode)
  • HTTP: Fastify 5
  • ORM: Drizzle ORM (PostgreSQL 16)
  • Events: NATS + JetStream
  • Tests: Vitest (unit), Playwright (E2E)
  • IDs: ULID via ulid package
  • Validation: Zod (request bodies)
  • Auth: @urule/auth-middleware (Keycloak JWKS)
  • Frontend: Next.js 14, React 18, Tailwind CSS, Zustand

Project Layout

packages/          — shared libraries (imported by services)
  spec/            — entity types, manifest schema, validators
  events/          — NATS event envelope, topics, AuditLogger
  authz/           — OpenFGA SDK wrapper
  auth-middleware/  — Fastify JWT plugin (Keycloak JWKS)

services/          — backend microservices
  registry/        — source of truth (orgs, workspaces, agents, runtimes, providers)
  packages/        — package install/upgrade/remove lifecycle
  packagehub/      — package discovery, search, metadata
  governance/      — OPA policy + OpenFGA authz gateway
  state/           — room presence, task ownership, widget state (NATS KV)

plugins/
  backstage/       — Backstage catalog sync

apps/
  office-ui/       — Next.js 14 frontend (Tailwind, Zustand, React Query)

infra/
  compose/         — Docker Compose files, SQL seeds, init scripts
  scripts/         — dev-setup, run-phase scripts
  e2e/             — backend E2E tests (phase1.test.mjs)

Read the full file on GitHub · 290 lines

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. 4d ago First seen · 290 lines · 2,996 tokens per session scan A 19c078ca00d1

Subscribe to this mod's changes

urule CLAUDE.md is an instructions file published in the GitHub repository urule-ai/urule (2 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 2,996 tokens to every session, about $0.0150 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-08-31.