Chuyển đến nội dung
Skillpedia
Nghiên cứu5.5k · #14842

qmd

Skill này làm gì

Skill này dạy agent cách tìm trong kho ghi chú cá nhân bằng QMD, một công cụ tìm kiếm theo ngữ nghĩa. Skill dùng để tìm các quyết định, cuộc họp và người đã được ghi lại trong quá khứ mà không phải đọc từng file.

Khi nào nên dùng

  • ✓Khi người dùng hỏi về một quyết định, sự cố, cuộc họp hoặc người đã được ghi trong ghi chú trước đây.
  • ✓Khi một agent cần tìm các ghi chú liên quan trước khi đọc toàn bộ file.
  • ✓Khi người dùng hỏi kho ghi chú của họ nói gì về một chủ đề.

Liên kết skill

https://github.com/breferrari/obsidian-mind/blob/main/.claude/skills/qmd/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/breferrari/obsidian-mind/blob/main/.claude/skills/qmd/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Quý trước chúng ta đã quyết định gì về thay đổi giá? Tìm trong kho ghi chú của tôi giúp.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent dùng các công cụ tìm kiếm QMD trước khi chúng có sẵn, rồi đến phiên bản dòng lệnh, và chỉ đọc file trực tiếp như phương án cuối cùng. Agent trả về các đoạn liên quan mà không đọc toàn bộ file.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

QMD — Vault Semantic Search

Before reading vault files directly, search with QMD first. It returns relevant snippets without burning context on full file reads.

Tool Surfaces — Preference Order

Pick the highest surface available and stop. All three read the same SQLite store (see Named Index), so they return the same results; the choice is about interface ergonomics and context cost.

  1. MCP tools (preferred when registered) — mcp__qmd__query, mcp__qmd__get, mcp__qmd__multi_get, mcp__qmd__status. If these appear in your tool menu, the MCP server is live and pre-scoped to this vault. Call them directly — no --index argument needed, no shell involved, typed arguments. This is the intended path during a session.
  2. CLI fallback — qmd --index <name> query|search|vsearch|get|multi-get. Use when the MCP server isn't registered (older vault clones, Windows install drift, disabled in .mcp.json), or for one-off shell checks outside a session. Always pass --index <name>.
  3. Grep / Glob / Read — last resort, only when QMD is not installed at all. These burn context on full file reads and don't rank by relevance.

Never fall through surfaces without cause — if MCP is registered, calling the CLI in a Bash tool is just a slower path to the same result.

Named Index (This Vault)

This vault uses a named QMD index so queries, updates, and context strings stay scoped to this vault — not blended with any other vault that shares the machine. Every QMD command in this document passes --index <name>.

The name resolves the same way on all three surfaces (CLI, MCP, SessionStart hook), so they always point at the same SQLite store:

  1. qmd_index in vault-manifest.json, when set — an explicit pin.
  2. Otherwise the vault folder name, slugified. The template ships qmd_index empty so every install gets its own store without being asked a question.

Pin the field if you want a name that survives renaming the vault folder, or want to keep a store you already built.

Read the resolved name before running commands rather than assuming either branch:

INDEX=$(node -e '
  const ok = (s) => typeof s === "string" && /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(s);
  const m = JSON.parse(require("fs").readFileSync("vault-manifest.json", "utf8"));
  if (m.qmd_index && !ok(m.qmd_index)) {
    process.stderr.write("qmd_index is set to an invalid name: " + JSON.stringify(m.qmd_index) + "\n");
    process.exit(1);
  }
  const slug = require("path").basename(process.cwd()).normalize("NFKD").toLowerCase()
    .replace(/[^a-z0-9._-]+/g, "-").replace(/-{2,}/g, "-").replace(/^[^a-z0-9]+|[-._]+$/g, "");
  const name = [m.qmd_index, slug, m.template].find(ok);
  if (!name) { process.stderr.write("no usable qmd index name — set qmd_index in vault-manifest.json\n"); process.exit(1); }
  process.stdout.write(name);
') || exit 1
qmd --index "$INDEX" query "..."

The value is used as both a CLI argument and a filesystem path (~/.cache/qmd/<name>.sqlite), so an invalid pin must fail here rather than propagate — hence the explicit check instead of m.qmd_index || slug.

In-session, substitute the resolved value directly in your commands — it is stable across the vault's lifetime unless the folder is renamed.

Commands

Each operation lists the MCP call first, then the CLI equivalent. Prefer MCP when available.

Search (pick one per query)

  • Hybrid (best quality) — mcp__qmd__query with searches=[{type:"lex", query:"..."}, {type:"vec", query:"..."}] and an intent arg. CLI: qmd --index <name> query "..." --json -n 10. Use for complex or conceptual queries.
  • Keyword (fast BM25) — mcp__qmd__query with searches=[{type:"lex", query:"..."}]. CLI: qmd --index <name> search "..." --json -n 10. Use for exact terms, names, ticket numbers, dates.
  • Semantic only — mcp__qmd__query with searches=[{type:"vec", query:"..."}]. CLI: qmd --index <name> vsearch "..." --json -n 5. Use for exploratory queries where you don't know the exact words.

Retrieve

  • By path — mcp__qmd__get with path arg. CLI: qmd --index <name> get "path/to/file.md".
  • By docid — mcp__qmd__get with #abc123 syntax. CLI: qmd --index <name> get "#docid".
  • Batch by glob — mcp__qmd__multi_get with pattern arg. CLI: qmd --index <name> multi-get "org/people/*.md" --json -l 40.

Index Management (CLI only — MCP exposes read surfaces)

  • `qmd --index <name> up
Câu hỏi thường gặp

Vì sao tìm kiếm trước khi đọc file?

Skill nói tìm kiếm trả về các đoạn liên quan mà không tốn ngữ cảnh cho việc đọc toàn bộ file.

Nếu QMD chưa được cài thì sao?

Skill nói quay về các công cụ tìm file, chậm hơn và không xếp hạng theo độ liên quan.

Thứ tự công cụ nào được ưu tiên?

Các công cụ QMD trước, rồi dòng lệnh, sau đó là grep, glob và đọc file.

Chi tiết

Mô tả gốc của tác giả

Search the vault using QMD semantic search. Use PROACTIVELY before reading files. Preference order: (1) MCP tools — mcp__qmd__query, mcp__qmd__get, mcp__qmd__multi_get, mcp__qmd__status — if they appear in your tool menu, use them first; (2) CLI `qmd --index <name> ...` as fallback; (3) Grep/Glob only when QMD is not installed. Trigger proactively for past decisions, incidents, people, meetings, architecture, patterns, or any vault content — and after creating/editing notes to check for duplicates and related content.

repo: breferrari/obsidian-mind

Độ phổ biến

Sao GitHub
5.5k
Vị trí xếp hạng
#14842
Giấy phép
MIT
Cập nhật
17/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự