Agent Skills
› mksglu/context-mode
› ctx-index
ctx-index
GitHub将本地文件或目录索引至持久化知识库,以便后续通过搜索获取精准片段,避免重复读取原始文件。支持MCP工具或CLI调用,并包含安全排除规则。
Trigger Scenarios
用户需要对本地项目进行内容索引以便后续检索
/context-mode:ctx-index
Install
npx skills add mksglu/context-mode --skill ctx-index -g -y
SKILL.md
Frontmatter
{
"name": "ctx-index",
"description": "Index a local file or directory into context-mode's persistent FTS5 knowledge base\nso future ctx_search calls can retrieve focused snippets without rereading raw files.\nTrigger: \/context-mode:ctx-index\n",
"user-invocable": true
}
Context Mode Index
Index local project content for later search.
Instructions
- Prefer the
ctx_indexMCP tool when it is available. - Ask for a path only if the user did not provide one and the current project root is ambiguous.
- Use
path, not large inlinecontent, so file bytes do not enter the conversation. - For repository indexing, pass conservative bounds and a clear source label:
ctx_index({
path: ".",
source: "project:<name>",
maxDepth: 5,
maxFiles: 200
})
- If MCP tools are unavailable, fall back to the CLI:
context-mode index . --source project:<name>
- Report the indexed source label, file count or section count, and the matching search command:
ctx_search({ source: "project:<name>", queries: ["..."] })
Safety
- Do not index dependency directories, build outputs, secrets, or generated artifacts.
- Prefer
--excludeorexcludefor project-specific noisy paths. - For broad repos, ask the user before raising
maxFilesabove 500.
Version History
- 6aad62f Current 2026-07-24 17:38


