360 Secure SkillHub
360 安全技能中心

open-ctx-index

通过 open_ctx_index MCP 工具或同名命令行把本地文件、目录按来源标签索引进 FTS5 知识库,可限制遍历深度、文件数与排除项;默认跳过依赖目录、构建产物、.git 和密钥文件,并报告索引结果与后续检索调用示例。

分类:知识
zademy
热度 0.00
最近更新 2026-10-28 05:09:39

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add zademy/opencode-context-mode/open-ctx-index
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
open-ctx-index
description
Store a file or directory for later retrieval by open_ctx_search. Trigger: /open-context-mode:open-ctx-index
user-invocable
true

Open Context Mode Index

Store local content in the FTS5 knowledge base so open_ctx_search can retrieve focused snippets later.

Instructions

  1. Prefer the open_ctx_index MCP tool when it is available.
  2. Ask for a path only when the user gave none and the project root is ambiguous.
  3. Pass path, never a large inline content. The bytes stay in the sandbox; the conversation never carries them.
  4. Give the source a descriptive label — that label is what open_ctx_search filters on. project:<dir> is the CLI default for directories.
open_ctx_index({
  path: ".",
  source: "project:my-app",
  maxDepth: 5,
  maxFiles: 200,
  exclude: ["node_modules", "dist", ".git", "coverage"]
})
  1. Fall back to the CLI when MCP tools are unavailable:
open-context-mode index . --source project:my-app --exclude node_modules --exclude dist
  1. Report the source label, the file/section count, and the matching search call:
open_ctx_search({ source: "project:my-app", queries: ["..."] })

Bounds

  • Leave node_modules, build output, .git, secrets and generated artifacts out.
  • For broad repos, confirm with the user before raising maxFiles past 500.