x-dev-rag-call

x-dev-rag-call is a skill for Claude Code from KtKID/x-dev-pipeline. It costs 115 tokens per session (1,154 once invoked), scanned A, original, MIT.

A local semantic search tool that finds relevant passages in specified Markdown or text files. It uses an embedding model, which represents meaning as numbers, to return the closest passages for a question or plan.

In plain words
What is it for?
Use it to retrieve relevant advice from a specification, investigation, failure description, plan, or local knowledge collection, including the highest-ranking matching passages.
Why use it?
It helps an agent find related project knowledge without reading every file or relying only on exact keyword matches. The search stays within the file or directory provided by the caller.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the x-dev-pipeline plugin — 22 skills shipped together

Good fit Use it to retrieve relevant advice from a specification, investigation, failure description, plan, or local knowledge collection, including the highest-ranking matching passages.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ktkid/x-dev-pipeline/x-dev-rag-call
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 KtKID/x-dev-pipeline --skill x-dev-rag-call
Clone the repo
git clone --depth 1 https://github.com/KtKID/x-dev-pipeline

Made for: Claude Code.

Or install x-dev-pipeline, the plugin that ships this one along with the rest of its 22 skills.

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-dev-rag-call

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/ktkid/x-dev-pipeline/x-dev-rag-call"><img src="https://agentmods.dev/badge/skills/ktkid/x-dev-pipeline/x-dev-rag-call.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,154 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.00115 $0.01154
Opus 5 $0.00057 $0.00577
Sonnet 5 $0.00023 $0.00231
Haiku 4.5 $0.00012 $0.00115

Measured yesterday against content hash be445e6cf627, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

x-dev-rag-call 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 yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/rag_retrieve.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

evals/x-pipeline-efficiency-workspace/iteration-7/skills/x-dev-rag-call/SKILL.md · 127 lines

How it starts

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

x-dev-rag-call

把“LLM 理解任务”和“Python 确定性检索”连接成一条最小 RAG 召回链路。

输入

调用需要三项信息:

  1. source:调用方明确指定的 .md.txt 文件或包含这些文件的目录。
  2. key_content:需求、Spec、问题或计划中的关键内容。
  3. top_n:需要返回的数量,默认 1

路径在当前上下文中唯一明确时直接使用。路径存在多个候选或尚未给出时,请调用方明确指定。保持路径边界,避免自行扩展到其他知识目录。

职责

LLM 负责:

  • 阅读任务输入。
  • 提炼语义完整的检索内容。
  • 调用检索脚本。
  • 使用脚本返回的原文完成当前分析。

Python 脚本负责:

  • 读取指定路径中的纯文本。
  • 按 Markdown 二级及更深标题或纯文本段落切分内容。
  • 实时计算查询向量和文本向量。
  • 计算相似度并返回 TopN。

纯文本是知识事实源。每次调用实时计算向量;第一版保持零索引文件、零向量数据库和零 LLM 精排。

执行流程

1. 提炼关键内容

从输入中提炼一段适合语义检索的 key_content。保留:

  • 功能或领域名词。
  • 模块、对象和关键动作。
  • 状态、时序和约束。
  • 已知或担心的失败机制。

优先写成一至三句语义完整的短文本。仅有关键词时,用逗号连接。Spec 风险召回可使用:

功能关键词:<模块、状态、动作>
Risk:<具体失败机制>

2. 调用本地召回脚本

运行:

uv run --offline --isolated \
  --python /opt/homebrew/Caskroom/miniforge/base/bin/python3 \
  --with "sentence-transformers>=2.7.0" \
  --with "transformers>=4.51.0,<5" \
  python <skill-dir>/scripts/rag_retrieve.py \
  --source "<指定文件或目录>" \
  --query "<key_content>" \
  --top-n <N> \
  --model "/Volumes/machub_app/proj/x-dev-pipeline/skills/x-pipeline-efficiency-workspace/iteration-7/models/Qwen3-Embedding-0.6B" \
  --json

当前工作区模型位于 /Volumes/machub_app/proj/x-dev-pipeline/skills/x-pipeline-efficiency-workspace/iteration-7/models/Qwen3-Embedding-0.6B。调用方明确指定另一个本地模型时替换:

--model "<本地模型路径>"

命令复用当前仓库已有的 uv 离线缓存环境。脚本使用本地文件加载模型;查询向量使用 Qwen 的 query 提示模板,文档向量使用普通文档编码,两侧向量均归一化。

3. 使用召回结果

成功输出:

{
  "matches": [
    {
      "id": "AR-001",
      "source": "/absolute/path/risk-mistakes.md",
      "text": "## AR-001\n..."
    }
  ]
}

直接使用 matches[].text 完成当前任务。脚本已经返回原文,因此无需按 ID 再次读取文件。TopN 大于 1 时,同时处理本次返回的全部结果。

当前任务需要适用性判断时,由 LLM 说明每条命中如何影响分析。当前任务只验证召回链路时,成功返回一条完整原文即可。

4. 处理失败

脚本失败时读取:

{
  "error": "ERROR_CODE",
  "message": "具体原因"
}

路径、语料或参数问题先修正输入。本地模型或依赖问题原样报告,保留实际退出码。召回失败时停止依赖召回结果的后续判断。

返回

向调用方返回:

  • source
  • 实际 key_content
  • top_n
  • CLI 退出码和召回数量。
  • 每条命中的 idsource 和完整 text
  • 召回内容在当前任务中的用途。

保持脚本原始命中顺序。输出省略相似度分数,因为 TopN 顺序已经表达本轮排序结果。

Read the full file on GitHub · 127 lines

Files

What ships with it

4 files 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.

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. yesterday First seen · 127 lines · 115 tokens per session scan A be445e6cf627

Subscribe to this mod's changes

x-dev-rag-call is a skill published in the GitHub repository KtKID/x-dev-pipeline (12 stars, last pushed yesterday), licensed MIT. It adds 115 tokens to every session and 1,154 once invoked, about $0.0006 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-09-09.