Skip to content
Back to skills

Rag

ASecurity

P2P RAG — sources and retrieval for NotebookLM, Claude Projects, Cowork or any RAG backend, in four modes: prep (clean a document into RAG-ready Markdown), grounding (a prompt that answers only from the sources, per model), router (where to put the data and which scheme: naive, RAPTOR, LongRAG), notebook (the whole bundle). Call it with /p2p:rag [mode].

  • 21 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 15, 2026
ai-agentsdatabasebackend

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned October 15, 2026

npx -y skills add sanic732/P2P --skill rag --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rag?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rag
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sanic732-rag/badge)](https://www.skillsdirectory.com/skills/sanic732-rag)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "rag"
description: "P2P RAG — sources and retrieval for NotebookLM, Claude Projects, Cowork or any RAG backend, in four modes: prep (clean a document into RAG-ready Markdown), grounding (a prompt that answers only from the sources, per model), router (where to put the data and which scheme: naive, RAPTOR, LongRAG), notebook (the whole bundle). Call it with /p2p:rag [mode]."
argument-hint: "[prep|grounding|router|notebook] [naive|raptor|longrag] <material or task>"
metadata:
  source_id: "CMD_RAG_V9"
  version: "9.0"
  module_type: "command"
disable-model-invocation: true
---
P2P command `rag` — four modes of working with RAG sources. Running P2P is not required for it.

Paths: `${CLAUDE_PLUGIN_ROOT}` is the plugin root. If it reaches you unsubstituted, or the folder it names does not exist (some hosts name a folder that is not there), find the root by name — the folder that holds `skills/p2p/_preloader.md` — and read the paths below from there.

## Mode Selection
The first word of the arguments is the mode:

| Mode | What it does | Mode file |
|---|---|---|
| `prep` | document → clean Markdown for RAG: zones, chunk-boundary headings, frontmatter, `## TAGS`, anchors | `prep.md` |
| `grounding` | "answer only from sources, with citations" prompt in the syntax of the target model | `grounding.md` |
| `router` | where to upload (directly into chat, NotebookLM, Cowork) and which scheme to pick | `router.md` |
| `notebook` | the entire bundle: `_MASTER_PROMPT`, `_INDEX`, `_GLOSSARY`, zone files | `notebook.md` |

If no mode is specified, ask which one is needed: via a selection window (AskUserQuestion) if available, otherwise using this table as text. Do not guess the mode based on a single word of the query.

## Markup and Retrieval Scheme
The second word may specify the scheme: `naive` (direct attachment, up to ~50K tokens), `raptor` (summary tree, 20–500 documents), `longrag` (unit is a document, vector database). If not specified, it is selected by `router.md` based on corpus size; the `prep` and `notebook` modes mark up for the chosen scheme. For details on RAPTOR and LongRAG, see P2P module `${CLAUDE_PLUGIN_ROOT}/skills/p2p/rag.md`.

## Procedure
1. Read `${CLAUDE_PLUGIN_ROOT}/skills/rag/<mode>.md` in full and execute it for the material in the arguments.
2. Mode reference materials are located in `${CLAUDE_PLUGIN_ROOT}/skills/rag/reference/`; the path `reference/…` in the mode text points there. Open them when the mode instructs you to do so.
3. The model for grounding and router must come exclusively from the current P2P lineup (`live_specs.md` (attached by the user), MODEL_REGISTRY). If the model is not there, ask to attach an updated live_specs.md; do not answer about it from memory.

Files in this skill

  • SKILL.md2.7 KB
  • grounding.md2.4 KB
  • notebook.md2.4 KB
  • prep.md2.4 KB
  • reference/model_templates.md3.5 KB
  • reference/rag_metaprompt_standard.md34.6 KB
  • reference/rag_notebook_prompt.md21.1 KB
  • router.md2.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.