laws: Skill for Claude Code

.agents/skills/x-prepare-system/SKILL.md

x-prepare-system is a skill for Claude Code, Codex from Totopolis/laws. It costs 59 tokens per session (1,765 once invoked), scanned A, original, BSD-2-Clause.

A setup tool for an offline search system covering Russian codes and laws. It creates the Python environment, downloads the required language model, and checks that the search pipeline works.

In plain words
What is it for?
Preparing a new machine to search the repository’s legal texts and checking the search and MCP components.
Why use it?
It removes the manual work of installing dependencies, downloading models, and diagnosing an incomplete setup.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents); $skill-name invocation.

This is Totopolis/laws's own configuration. It tells Claude Code and Codex how to work on laws itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything laws configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Totopolis/laws. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Totopolis/laws/main/.agents/skills/x-prepare-system/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Totopolis/laws

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 x-prepare-system

README.md
[![agentmods](https://agentmods.dev/badge/skills/totopolis/laws/x-prepare-system/github.svg)](https://agentmods.dev/skills/totopolis/laws/x-prepare-system)
Your own site
<a href="https://agentmods.dev/skills/totopolis/laws/x-prepare-system"><img src="https://agentmods.dev/badge/skills/totopolis/laws/x-prepare-system/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 x-prepare-system

Your own site · 80×15
<a href="https://agentmods.dev/skills/totopolis/laws/x-prepare-system"><img src="https://agentmods.dev/badge/skills/totopolis/laws/x-prepare-system.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,765 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.00059 $0.01765
Opus 5.5 $0.00024 $0.00706
Sonnet 5.5 $0.00012 $0.00353
Haiku 4.5 $0.00006 $0.00177

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

Security

Grade A, and why

x-prepare-system 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 24d 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.

.agents/skills/x-prepare-system/SKILL.md · 129 lines

How it starts

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

Подготовка системы поиска по кодексам

Скилл приводит репозиторий в состояние «поиск работает»: ставит зависимости, качает модель и проверяет всю цепочку целиком — от импорта библиотек до вызова MCP-инструмента по протоколу. Вся механика в src/laws_mcp/setup_check.py; задача скилла — запустить её с нужными флагами, правильно понять, что именно не сошлось, и не начать чинить лишнее.

Скилл работает в репозитории с кодексами и ничего в нём не удаляет: только ставит зависимости, качает модели и проверяет.

Что должно быть на машине

Что Размер Откуда берётся
.venv/ с рантайм-зависимостями ~200 МБ этот скилл
models/qwen3-emb-onnx/ — эмбеддер fp32 2,3 ГБ этот скилл (Hugging Face)
models/bge-reranker-onnx/ — реранкер int8 544 МБ этот скилл (необязателен)
data/ — тексты кодексов по статьям 80 МБ уже в репозитории
index/ — векторный индекс 68 МБ уже в репозитории

Модели в репозиторий не входят (models/ в .gitignore) — их качает этот скилл. Тексты и индекс, наоборот, поставляются готовыми: пересчитывать их здесь нечем и незачем. Видеокарта не нужна — поиск считается на процессоре.

Шаг 1 — окружение

Проверь, что venv есть и это именно он:

ls .venv/Scripts/python.exe    # Windows

Если venv нет — создай (нужен Python 3.11+):

python -m venv .venv

Дальше все команды — через .venv/Scripts/python.exe, не через системный python.

Шаг 2 — проверить, что уже есть

Сначала прогон без установки: он ничего не меняет и показывает полную картину.

PYTHONPATH=src PYTHONIOENCODING=utf-8 .venv/Scripts/python.exe -m laws_mcp.setup_check

Проверки идут по порядку зависимости, и первые три — блокирующие: если не сошлись зависимости, модель или данные, остальное не запускается, потому что бессмысленно. Читай первую строку [нет], а не последнюю: она и есть причина.

Шаг 3 — доустановить недостающее

PYTHONPATH=src PYTHONIOENCODING=utf-8 .venv/Scripts/python.exe -m laws_mcp.setup_check --install

Read the full file on GitHub · 129 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. 24d ago Changed · +1 lines · +59 tokens per session 5464b3fdaeb7
  2. 2mo ago First seen · 128 lines · 0 tokens per session scan A 9795f72155f4

Subscribe to this mod's changes

x-prepare-system is a skill published in the GitHub repository Totopolis/laws (0 stars, last pushed 25d ago), licensed BSD-2-Clause. It adds 59 tokens to every session and 1,765 once invoked, about $0.0002 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

x-prepare-system compared with skills from other repositories

x-prepare-system next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
x-prepare-systemTotopolis/lawsSkill025d agoBSD-2-ClauseA59Claude Code, Codex
contract-reviewerrohasnagpal/legal-ai-skillsSkill20127d agoMITA187Claude Code, Codex
contract-drafterrohasnagpal/legal-ai-skillsSkill20127d agoMITA192Claude Code, Codex
clause-comparatorrohasnagpal/legal-ai-skillsSkill20127d agoMITA146Claude Code, Codex
indemnity-liability-analystrohasnagpal/legal-ai-skillsSkill20127d agoMITA134Claude Code, Codex
investment-and-shareholder-agreement-reviewerrohasnagpal/legal-ai-skillsSkill20127d agoMITA207Claude Code, Codex
legal-opinion-drafterrohasnagpal/legal-ai-skillsSkill20127d agoMITA187Claude Code, Codex