rai-pyrel

rai-pyrel is a skill for Claude Code from RelationalAI/rai-agent-skills. It costs 171 tokens per session (9,272 once invoked), scanned A, original, Apache-2.0.

A programming language and set of query patterns for defining connected business data, its relationships, derived rules, and searches.

In plain words
What is it for?
It is for writing or reviewing data models, loading data, creating validation and classification rules, querying connected records, and exporting results.
Why use it?
It gives developers a consistent way to represent concepts and relationships, express business logic, and retrieve filtered, joined, aggregated, or ranked results.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the rai plugin — 12 skills shipped together

Good fit It is for writing or reviewing data models, loading data, creating validation and classification rules, querying connected records, and exporting results.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/relationalai/rai-agent-skills/rai-pyrel
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.

Any agent
npx skills add RelationalAI/rai-agent-skills --skill rai-pyrel
Clone the repo
git clone --depth 1 https://github.com/RelationalAI/rai-agent-skills

Made for: Claude Code.

Or install rai, the plugin that ships this one along with the rest of its 12 skills.

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 rai-pyrel

README.md
[![agentmods](https://agentmods.dev/badge/skills/relationalai/rai-agent-skills/rai-pyrel/github.svg)](https://agentmods.dev/skills/relationalai/rai-agent-skills/rai-pyrel)
Your own site
<a href="https://agentmods.dev/skills/relationalai/rai-agent-skills/rai-pyrel"><img src="https://agentmods.dev/badge/skills/relationalai/rai-agent-skills/rai-pyrel/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 rai-pyrel

Your own site · 80×15
<a href="https://agentmods.dev/skills/relationalai/rai-agent-skills/rai-pyrel"><img src="https://agentmods.dev/badge/skills/relationalai/rai-agent-skills/rai-pyrel.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 171 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 9,272 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.00171 $0.09272
Opus 5 $0.00086 $0.04636
Sonnet 5 $0.00034 $0.01854
Haiku 4.5 $0.00017 $0.00927

Measured 11d ago against content hash 19d06999f299, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

rai-pyrel 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 11d ago.

The scan reads SKILL.md. This mod also ships 15 executable files (examples/aggregation_queries.py, examples/alerting_rule.py, examples/classification_rule.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/rai/skills/rai-pyrel/SKILL.md · 443 lines

How it starts

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

PyRel

Summary

What: The PyRel v1 language surface — types, concepts, properties, relationships, data loading, expressions, derived-property business rules, and query construction.

When to use:

  • Writing or reviewing any PyRel model code; looking up imports, types, or declaration patterns
  • Translating a business rule to PyRel ("flag high-value customers", tiers, segments, scores) — see Rules Authoring
  • Querying: select, filter, join, aggregate, rank, export — see Querying
  • Debugging syntax errors, FDError, Unground Variables, or empty/unexpected results

When NOT to use: reasoner-specific tasks route to their reasoner skill — it owns the patterns and pitfalls:

  • Ontology design decisions (concept vs property, identity, data mapping, enrichment) — see rai-ontology
  • Optimization formulation (decision variables, constraints, objectives) — see rai-prescriptive-problem
  • Graph analysis (centrality, community, reachability, paths) — see rai-graph-analysis
  • GNN modeling and training — see rai-predictive-modeling, rai-predictive-training
  • Reasoner routing and question discovery — see rai-discovery; connection/config — see rai-setup

Overview: Modeling declares the surface (concepts, properties, relationships); Definitions bake business logic into the model; Rules Authoring is the workflow for deriving new properties from natural-language rules; Querying reads it all back. Most logic belongs in definitions — queries should be simple reads over what definitions computed.


Quick Reference

from relationalai.semantics import (
    Model, Float, Integer, String, Date, DateTime, distinct,
)
from relationalai.semantics import Number            # always Number.size(p,s), never bare
from relationalai.semantics.std import aggregates as aggs
from relationalai.semantics.std.aggregates import rank, desc, asc, top, bottom
from relationalai.semantics.std import strings, math, numbers

model = Model("my_model")
Product = model.Concept("Product", identify_by={"id": Integer})
Product.cost = model.Property(f"{Product} has {Float:cost}")            # many-to-one
Product.supplier = model.Property(f"{Product} supplied by {Supplier:supplier}")  # functional FK
model.define(Product.new(model.data(df).to_schema()))                   # load data
result = model.where(Product.cost > 10).select(Product.id, Product.cost).to_df()
print(Product.cost > 10)      # readable repr — verify structure before querying
Product.cost.inspect()        # executes, prints DataFrame

Read the full file on GitHub · 443 lines

Files

What ships with it

33 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 11d ago First seen · 443 lines · 171 tokens per session scan A 19d06999f299

Subscribe to this mod's changes

rai-pyrel is a skill published in the GitHub repository RelationalAI/rai-agent-skills (4 stars, last pushed yesterday), licensed Apache-2.0. It adds 171 tokens to every session and 9,272 once invoked, about $0.0009 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.

Related

Other skills, from other repositories

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens

azure-resource-manager-postgresql-dotnet

Azure PostgreSQL Flexible Server SDK for .NET. Database management for PostgreSQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "PostgreSQL", "PostgreSqlFlexibleServer", "PostgreSQL Flexible Server", "Azure Database for…

microsoft/skills · 97 tokens

azure-cosmos-java

Azure Cosmos DB SDK for Java. NoSQL database operations with global distribution, multi-model support, and reactive patterns. Triggers: "CosmosClient java", "CosmosAsyncClient", "cosmos database java", "cosmosdb java", "document database java".

microsoft/skills · 59 tokens

azure-data-tables-java

Build table storage applications with Azure Tables SDK for Java. Use when working with Azure Table Storage or Cosmos DB Table API for NoSQL key-value data, schemaless storage, or structured data at scale.

microsoft/skills · 47 tokens

efcore-patterns

Entity Framework Core best practices including NoTracking by default, query splitting for navigation collections, migration management, dedicated migration services, and common pitfalls to avoid.

Aaronontheweb/dotnet-skills · 35 tokens

kotlin-exposed-patterns

JetBrains Exposed ORM patterns including DSL queries, DAO pattern, transactions, HikariCP connection pooling, Flyway migrations, and repository pattern.

hashgraph-online/awesome-codex-plugins · 36 tokens