Ctx Index

mksglu/context-mode/skills/ctx-index

作者 mksglua6c43765d26b無授權條款25K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫今天更新

Index a local file or directory into context-mode's persistent FTS5 knowledge base so future ctx_search calls can retrieve focused snippets without rereading raw files. Trigger: /context-mode:ctx-index

僅含說明AI & Agents
AI 產生的概覽

將本機檔案或目錄索引到持久化的 FTS5 知識庫,讓後續搜尋能取回聚焦的片段。

功能
此技能會將本機專案內容索引到 context-mode 的持久化 FTS5 知識庫,讓日後的 ctx_search 呼叫不必重新讀取原始檔案,就能取回聚焦的片段。它優先使用 ctx_index MCP 工具,無法使用時退回 context-mode CLI 指令,並回報已索引的來源標籤、檔案數或區段數,以及對應的搜尋指令。它建議傳入路徑而非大量內嵌內容,並在索引儲存庫時採用保守的範圍與排除條件。
適用情境
當你希望讓本機檔案或專案目錄可供日後檢索,而不是重新讀取原始檔案時使用。它適合需要設定來源標籤、深度與檔案數上限的儲存庫索引,以及需要排除雜訊路徑、相依目錄、建置產物或機密資料的情況。
執行需求
需要 ctx_index MCP 工具,或作為備援的 context-mode CLI。它不附帶指令碼,僅有指示內容。

Context Mode Index

Index local project content for later search.

Instructions

  1. Prefer the ctx_index MCP tool when it is available.
  2. Ask for a path only if the user did not provide one and the current project root is ambiguous.
  3. Use path, not large inline content, so file bytes do not enter the conversation.
  4. For repository indexing, pass conservative bounds and a clear source label:
javascript
ctx_index({  path: ".",  source: "project:<name>",  maxDepth: 5,  maxFiles: 200})
  1. If MCP tools are unavailable, fall back to the CLI:
bash
context-mode index . --source project:<name>
  1. Report the indexed source label, file count or section count, and the matching search command:
javascript
ctx_search({ source: "project:<name>", queries: ["..."] })

Safety

  • Do not index dependency directories, build outputs, secrets, or generated artifacts.
  • Prefer --exclude or exclude for project-specific noisy paths.
  • For broad repos, ask the user before raising maxFiles above 500.

來源與署名

來源:mksglu/context-mode位於skills/ctx-index提交a6c4376

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架