x-prepare-system

x-prepare-system is a skill for Claude Code from Totopolis/laws. It costs 134 tokens per session (1,835 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 Code

Written for Claude Code: installed under .claude/.

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 skills/totopolis/laws/x-prepare-system
Any agent
npx skills add Totopolis/laws --skill x-prepare-system
Clone the repo
git clone --depth 1 https://github.com/Totopolis/laws

Made for: Claude Code.

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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 134 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,835 The whole file, excluding the scripts and references it only reads on demand.
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.1 $0.00134 $0.01835
Opus 5 $0.00067 $0.00918
Sonnet 5 $0.00027 $0.00367
Haiku 4.5 $0.00013 $0.00184

Measured 5d ago against content hash 9795f72155f4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 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.

.claude/skills/x-prepare-system/SKILL.md · 128 lines

How it starts

The opening of the file, as written. The whole thing — 128 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 · 128 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 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 8d ago), licensed BSD-2-Clause. It adds 134 tokens to every session and 1,835 once invoked, about $0.0007 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

specification-writing

Write the full patent specification from claims and invention disclosure. Use when user says "撰写说明书", "write specification", "写说明书", "patent description", or wants to draft the complete patent specification.

wanshuiyin/Auto-claude-code-research-in-sleep · 49 tokens

regulatory-research-fallback

Fallback workflow for regulatory research when web extraction tools fail on government PDFs.

HKUDS/OpenSpace · 20 tokens

x-scorecard

OpenSSF Scorecard for assessing open source project security. Check security best practices and compliance. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.

x-cmd/x-cmd · 57 tokens

memstack-business-gdpr

Use this skill when the user says 'GDPR', 'data protection', 'privacy compliance', 'DPA', 'DSAR', 'data subject request', 'cookie consent', 'privacy audit', 'CCPA', or asks 'do I need GDPR for this repo'. Scans the repository to detect what personal data is collected, classifies sensitivity, determines whether GDPR…

cwinvestments/memstack · 121 tokens

gesellschaftsrechtliche-satzungen-agb

Für Gesellschaftsrechtliche Satzungen AGB Abgrenzung: ordnet Norm, Beweislast und Gegenargument; Ergebnis: Prüfprodukt mit Risiko und nächstem Schritt. Fachgebiet: AGB-Recht-Prüfer. Route: gesellschaftsrechtliche-satzungen-agb.

Klotzkette/claude-fuer-deutsches-recht · 69 tokens

nda-review

Use when the user uploads or pastes a non-disclosure agreement and asks for review, redline, risk assessment, or a recommendation on whether to sign. Identifies missing standard protections, one-sided or unusual provisions, and operational issues; produces a structured report with severity ratings and citations to…

LegalQuants/lq-ai · 79 tokens