lexq-rules

lexq-rules is a skill for Claude Code, Codex from lexq-io/lexq-cli. It costs 73 tokens per session (4,152 once invoked), scanned A, original, Apache-2.0.

A guide to LexQ policy rules, where each rule checks conditions and runs actions when the incoming facts match. Rules are checked in priority order, with priority 1 checked first.

In plain words
What is it for?
Use it to create, edit, reorder, enable, or disable rules, and to define single-field or grouped conditions and their actions.
Why use it?
It explains how to structure conditions, combine them with logical operators such as AND, and control which matching rule takes precedence.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to create, edit, reorder, enable, or disable rules, and to define single-field or grouped conditions and their actions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lexq-io/lexq-cli/lexq-rules
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 lexq-io/lexq-cli --skill lexq-rules
Clone the repo
git clone --depth 1 https://github.com/lexq-io/lexq-cli

Made for: Claude Code, Codex.

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 lexq-rules

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/lexq-io/lexq-cli/lexq-rules"><img src="https://agentmods.dev/badge/skills/lexq-io/lexq-cli/lexq-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,152 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.00073 $0.04152
Opus 5.5 $0.00029 $0.01661
Sonnet 5.5 $0.00015 $0.00830
Haiku 4.5 $0.00007 $0.00415

Measured 5d ago against content hash 599b0f94b518, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

lexq-rules 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 5d 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.

skills/lexq-rules/SKILL.md · 454 lines

How it starts

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

LexQ CLI — Policy Rules

Prerequisite: Read lexq-shared/SKILL.md first.

Overview

A Policy Rule is a condition → actions pair within a version. Rules are evaluated in priority order — lower number wins, and priorities are 1-based (1 is highest). When a rule's condition matches the input facts, its actions fire.

priority is assigned by the server, not by you. New rules are appended last. Use lexq rules reorder to change the order.

Rule Structure

{
  "name": "VIP 10% Discount",
  "condition": {
    ...
  },
  "actions": [
    ...
  ],
  "mutexGroup": null,
  "mutexMode": "NONE",
  "mutexStrategy": "HIGHEST_PRIORITY",
  "mutexLimit": null,
  "isEnabled": true
}

Condition Syntax

Conditions use a tree structure with two node types: SINGLE and GROUP.

SINGLE Condition

{
  "type": "SINGLE",
  "field": "paymentAmount",
  "operator": "GREATER_THAN_OR_EQUAL",
  "value": 100000,
  "valueType": "NUMBER"
}

GROUP Condition (logical combinator)

{
  "type": "GROUP",
  "operator": "AND",
  "children": [
    {
      "type": "SINGLE",
      "field": "customerTier",
      "operator": "EQUALS",
      "value": "VIP",
      "valueType": "STRING"
    },
    {
      "type": "SINGLE",
      "field": "paymentAmount",
      "operator": "GREATER_THAN",
      "value": 50000,
      "valueType": "NUMBER"
    }
  ]
}

Operators

Operators are constrained by the left fact's type. Using one outside its type is rejected by the server — check lexq facts list before choosing.

Fact type Allowed operators
STRING EQUALS, NOT_EQUALS, CONTAINS, IN, NOT_IN
NUMBER EQUALS, NOT_EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, IN, NOT_IN
BOOLEAN EQUALS, NOT_EQUALS
LIST_STRING / LIST_NUMBER HAS_ANY, HAS_ALL, HAS_NONE

Read the full file on GitHub · 454 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. 5d ago Changed · -2 lines 599b0f94b518
  2. 7d ago Changed · +1 lines 1f0f7eaa3c22
  3. 19d ago Changed · +19 lines a4c9b0a07c3b
  4. 20d ago Changed · +5 lines · +73 tokens per session edecc27483e3
  5. 1mo ago Changed · +4 lines af2cc7c4efa3
  6. 1mo ago Changed · +7 lines e167ba22d6d8
  7. 3mo ago First seen · 420 lines · 0 tokens per session scan A 3f7c96eb96ef

Subscribe to this mod's changes

lexq-rules is a skill published in the GitHub repository lexq-io/lexq-cli (1 stars, last pushed today), licensed Apache-2.0. It adds 73 tokens to every session and 4,152 once invoked, about $0.0003 per session on Opus 5.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

lexq-rules compared with skills from other repositories

lexq-rules next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
lexq-ruleslexq-io/lexq-cliSkill1todayApache-2.0A73Claude Code, Codex
fda-databasesynthetic-sciences/openscienceSkill4.5k2d agoApache-2.0A43Claude Code, Codex
uspto-databasesynthetic-sciences/openscienceSkill4.5k2d agoApache-2.0A40Claude Code, Codex
atmos-aws-compliancecloudposse/atmosSkill1.4ktodayApache-2.0A42Claude Code
x-scorecardx-cmd/x-cmdSkill4.8k7d agoApache-2.0A57Claude Code, Codex
open-weightsericrisco/rsc-harnessSkill6916d agoMITA146Claude Code, Codex
hiringericrisco/rsc-harnessSkill6916d agoMITA82Claude Code, Codex