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.
npx skills add sanic732/P2P-4PDA-edition --skill rag-prepgit clone --depth 1 https://github.com/sanic732/P2P-4PDA-editionWrote 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.
[](https://agentmods.dev/skills/sanic732/p2p-4pda-edition/rag-prep)<a href="https://agentmods.dev/skills/sanic732/p2p-4pda-edition/rag-prep"><img src="https://agentmods.dev/badge/skills/sanic732/p2p-4pda-edition/rag-prep/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.
<a href="https://agentmods.dev/skills/sanic732/p2p-4pda-edition/rag-prep"><img src="https://agentmods.dev/badge/skills/sanic732/p2p-4pda-edition/rag-prep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00168 | $0.00967 |
| Opus 5 | $0.00084 | $0.00483 |
| Sonnet 5 | $0.00034 | $0.00193 |
| Haiku 4.5 | $0.00017 | $0.00097 |
Grade A, and why
rag-prep 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 9d 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.
How it starts
The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.
rag-prep — подготовка источника под RAG
Превращает сырой/длинный документ в источник, который RAG-движок хорошо режет на чанки и точно извлекает. Это «предварительное редактирование» перед загрузкой в NotebookLM / Claude Project / Cowork.
Когда применять / НЕ применять
Применять: перед загрузкой материала в RAG-источник; чистка «простыни»;
структурирование под retrieval. НЕ применять: нужно задать запрос к уже
готовой базе (→ rag-grounding); выбрать инструмент/стратегию (→ rag-router).
Принцип
Качество ответа RAG = качество попавших в контекст чанков. Значит каждый чанк должен быть самодостаточным и точно именованным. Правило: один файл = одна семантическая зона, один параграф = одна концепция, один тег = один сигнал.
Что делает (по шагам)
- Структура. Режет текст на разделы по Markdown-заголовкам (
#,##) — это естественные границы чанков. Никакого «полотна» без заголовков. - Чанк-безопасность. Логические блоки (
IF … THEN, определение+пояснение) держит целиком в одном разделе. Где нужно — закладывает overlap-формулировки на границах. - Frontmatter в шапку файла:
source_id,tags, при необходимостиdepends_on(граф связей). - Якоря и теги. Стабильные
#IDна ключевых блоках (для точного lookup) +## TAGS: …в конце (тематическая выборка). - Чистка и дедуп. Убирает шум/повторы; дубли заменяет ссылкой, а не копией.
- Дробление. Если файл несёт несколько зон — предлагает разбить на отдельные
файлы (одна зона = один файл) и даёт строку для
_INDEX.md.
Полный стандарт разметки (frontmatter, rag_zone, rag_anchor, дедуп, граф
зависимостей) — в reference/rag_metaprompt_standard.md; открывать при сложной
многофайловой структуре.
Важно (анти-мифы)
- Большое окно (1M) не отменяет структуру: retrieval-качество ≠ размер окна.
- Символьный тег
[A-P_RULES]в dense-поиске «растворяется» — для надёжного lookup дублируй ID в frontmatter/метаданных и рассчитывай на гибридный поиск.
What ships with it
1 file 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.
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.
- 9d ago First seen · 63 lines · 168 tokens per session scan A cc36f6227aa0
rag-prep is a skill published in the GitHub repository sanic732/P2P-4PDA-edition (17 stars, last pushed 22d ago), licensed MIT. It adds 168 tokens to every session and 967 once invoked, about $0.0008 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-30.
Other skills, from other repositories
RAG Chunking Strategy Advisor
Given a document type and retrieval goal, recommends the optimal chunking strategy for a RAG pipeline to minimize retrieval failures.
markitdown
Convert heterogeneous documents and selected URIs to Markdown with Microsoft MarkItDown for text analysis, search, and LLM/RAG ingestion. Covers safe local conversion, streams, Office/PDF/data formats, batch workflows, plugins, vision OCR, Azure extraction, and the official MCP server.
llamaindex
Data framework for building LLM applications with RAG. Specializes in document ingestion (300+ connectors), indexing, and querying. Features vector indices, query engines, agents, and multi-modal support. Use for document Q&A, chatbots, knowledge retrieval, or building RAG pipelines. Best for data-centric LLM…
azure-ai
Use for Azure AI: Search, Speech, OpenAI, Document Intelligence. Helps with search, vector/hybrid search, speech-to-text, text-to-speech, transcription, OCR. WHEN: AI Search, query search, vector search, hybrid search, semantic search, speech-to-text, text-to-speech, transcribe, OCR, convert text to speech.
kb-retriever
A retrieval and question-answering assistant for a local folder of documents, including Markdown, text, PDFs, and spreadsheets.
bailian-kb
A command-line manager for Alibaba Cloud Bailian knowledge bases, which are collections of documents prepared for search and question answering. It handles the stored documents, search services, text chunks, and data-centre files rather than everyday searches.