context-store
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseContext Store Skill
Context Store Skill
What & When
是什么与何时使用
What: Commands for uploading, downloading, querying and deleting documents with metadata and tags through the Context Store server. Also linking to one another via relations.
When to use:
- Store important documents for retrieval in future sessions
- Build a knowledge base of project documentation
- Share architecture, API specs, or design documents across different work sessions
- Query documents by tags to find relevant information
Key Benefits:
- Cross-session persistence
- Tag-based organization with AND logic
- Simple JSON output
是什么:通过Context Store服务器进行文档上传、下载、查询、删除(附带元数据和标签)以及建立文档间关联的命令集。
适用场景:
- 存储重要文档以便在未来会话中检索
- 构建项目文档知识库
- 在不同工作会话间共享架构文档、API规范或设计文档
- 通过标签查询文档以找到相关信息
核心优势:
- 跨会话持久化存储
- 基于AND逻辑的标签分类
- 简洁的JSON输出
Quick Reference
快速参考
CRITICAL: Always use absolute paths - NEVER use :
cd重要提示:请始终使用绝对路径——切勿使用命令:
cddoc-push
- Upload Documents
doc-pushdoc-push
- 上传文档
doc-pushbash
uv run --script <skill-root>/commands/doc-push <file> [--tags TEXT] [--description TEXT]bash
uv run --script <skill-root>/commands/doc-push <file> [--tags TEXT] [--description TEXT]Example: uv run --script <skill-root>/commands/doc-push specs.md --tags "api,v2"
Example: uv run --script <skill-root>/commands/doc-push specs.md --tags "api,v2"
**Use when**: Store a document for future reference.**适用场景**:存储文档以供后续查阅。doc-query
- Search by Tags/Name
doc-querydoc-query
- 按标签/名称搜索
doc-querybash
uv run --script <skill-root>/commands/doc-query [--tags TEXT] [--name TEXT] [--include-relations]bash
uv run --script <skill-root>/commands/doc-query [--tags TEXT] [--name TEXT] [--include-relations]Example: uv run --script <skill-root>/commands/doc-query --tags "api,v2"
Example: uv run --script <skill-root>/commands/doc-query --tags "api,v2"
With relations: uv run --script <skill-root>/commands/doc-query --tags "api" --include-relations
With relations: uv run --script <skill-root>/commands/doc-query --tags "api" --include-relations
**Use when**: Find documents by tags (AND logic) or name patterns.
**Option**: `--include-relations` adds relations to each document in response.**适用场景**:通过标签(AND逻辑)或名称模式查找文档。
**可选参数**:`--include-relations`会在结果中添加文档间的关联信息。doc-search
- Semantic Search
doc-searchdoc-search
- 语义搜索
doc-searchbash
uv run --script <skill-root>/commands/doc-search "<query>" [--limit INT] [--include-relations]bash
uv run --script <skill-root>/commands/doc-search "<query>" [--limit INT] [--include-relations]Example: uv run --script <skill-root>/commands/doc-search "how to configure authentication"
Example: uv run --script <skill-root>/commands/doc-search "how to configure authentication"
With relations: uv run --script <skill-root>/commands/doc-search "auth" --include-relations
With relations: uv run --script <skill-root>/commands/doc-search "auth" --include-relations
**Use when**: Find documents by meaning using natural language queries.
**Note**: Requires semantic search enabled on server. Returns section offsets for partial reads.
**Option**: `--include-relations` adds relations to each result.**适用场景**:通过自然语言查询按文档语义查找相关内容。
**注意**:需要服务器启用语义搜索功能。返回结果包含用于部分读取的段落偏移量。
**可选参数**:`--include-relations`会在结果中添加文档间的关联信息。doc-info
- Get Document Metadata & Relations
doc-infodoc-info
- 获取文档元数据与关联信息
doc-infobash
uv run --script <skill-root>/commands/doc-info <document-id>bash
uv run --script <skill-root>/commands/doc-info <document-id>Example: uv run --script <skill-root>/commands/doc-info doc_abc123
Example: uv run --script <skill-root>/commands/doc-info doc_abc123
**Use when**: View metadata and relations for a specific document without downloading it.
**Output**: Includes `relations` field with parent/child/related document links.**适用场景**:无需下载文档即可查看特定文档的元数据和关联信息。
**输出**:包含`relations`字段,展示父文档/子文档/相关文档的链接。doc-read
- Read Text Documents
doc-readdoc-read
- 读取文本文档
doc-readbash
uv run --script <skill-root>/commands/doc-read <document-id> [--offset INT] [--limit INT]bash
uv run --script <skill-root>/commands/doc-read <document-id> [--offset INT] [--limit INT]Example: uv run --script <skill-root>/commands/doc-read doc_abc123
Example: uv run --script <skill-root>/commands/doc-read doc_abc123
Partial: uv run --script <skill-root>/commands/doc-read doc_abc123 --offset 2000 --limit 1000
Partial: uv run --script <skill-root>/commands/doc-read doc_abc123 --offset 2000 --limit 1000
**Use when**: Output text document content directly to stdout (text files only).
**Partial reads**: Use `--offset` and `--limit` to retrieve specific sections (useful with semantic search results).**适用场景**:将文本文档内容直接输出到标准输出(仅支持文本文件)。
**部分读取**:使用`--offset`和`--limit`参数检索特定段落(配合语义搜索结果使用非常实用)。doc-pull
- Download Documents
doc-pulldoc-pull
- 下载文档
doc-pullbash
uv run --script <skill-root>/commands/doc-pull <document-id> [-o PATH]bash
uv run --script <skill-root>/commands/doc-pull <document-id> [-o PATH]Example: uv run --script <skill-root>/commands/doc-pull doc_abc123 -o specs.md
Example: uv run --script <skill-root>/commands/doc-pull doc_abc123 -o specs.md
**Use when**: Retrieve a document by its ID.**适用场景**:通过文档ID检索并下载文档。doc-delete
- Remove Documents
doc-deletedoc-delete
- 删除文档
doc-deletebash
uv run --script <skill-root>/commands/doc-delete <document-id>bash
uv run --script <skill-root>/commands/doc-delete <document-id>Example: uv run --script <skill-root>/commands/doc-delete doc_abc123
Example: uv run --script <skill-root>/commands/doc-delete doc_abc123
**Use when**: Permanently remove a document.**适用场景**:永久删除文档。doc-link
- Manage Document Relations
doc-linkdoc-link
- 管理文档关联
doc-linkbash
uv run --script <skill-root>/commands/doc-link --types # List relation types
uv run --script <skill-root>/commands/doc-link --create <from> <to> [opts] # Create relation
uv run --script <skill-root>/commands/doc-link --update <id> --note "..." # Update note
uv run --script <skill-root>/commands/doc-link --remove <id> # Remove relationUse when: Link documents together in parent-child or peer relationships.
Options for --create:
- - Required:
--type(hierarchical) orparent-child(peer)related - - Note on edge from source to target (source's note about target)
--from-to-note - - Note on edge from target to source (target's note about source)
--to-from-note
bash
uv run --script <skill-root>/commands/doc-link --types # List relation types
uv run --script <skill-root>/commands/doc-link --create <from> <to> [opts] # Create relation
uv run --script <skill-root>/commands/doc-link --update <id> --note "..." # Update note
uv run --script <skill-root>/commands/doc-link --remove <id> # Remove relation适用场景:建立文档间的父子关系或同级关系。
--create参数选项:
- - 必填:
--type(层级归属)或parent-child(同级关联)related - - 源文档到目标文档的关联备注(源文档对目标文档的说明)
--from-to-note - - 目标文档到源文档的关联备注(目标文档对源文档的说明)
--to-from-note
Typical Workflows
典型工作流
Store and Retrieve
存储与检索
bash
undefinedbash
undefinedUpload with tags
Upload with tags
uv run --script <skill-root>/commands/doc-push specs.md --tags "api,v2"
uv run --script <skill-root>/commands/doc-push specs.md --tags "api,v2"
Find it later
Find it later
uv run --script <skill-root>/commands/doc-query --tags "api,v2"
uv run --script <skill-root>/commands/doc-query --tags "api,v2"
Download it
Download it
uv run --script <skill-root>/commands/doc-pull doc_abc123
undefineduv run --script <skill-root>/commands/doc-pull doc_abc123
undefinedBuild Knowledge Base
构建知识库
bash
undefinedbash
undefinedUpload multiple documents with consistent tags
Upload multiple documents with consistent tags
uv run --script <skill-root>/commands/doc-push architecture.md --tags "design,mvp"
uv run --script <skill-root>/commands/doc-push api-spec.md --tags "api,mvp"
uv run --script <skill-root>/commands/doc-push architecture.md --tags "design,mvp"
uv run --script <skill-root>/commands/doc-push api-spec.md --tags "api,mvp"
Query by project phase
Query by project phase
uv run --script <skill-root>/commands/doc-query --tags "mvp"
undefineduv run --script <skill-root>/commands/doc-query --tags "mvp"
undefinedSemantic Search + Partial Read
语义搜索+部分读取
bash
undefinedbash
undefinedSearch by meaning
Search by meaning
uv run --script <skill-root>/commands/doc-search "how to authenticate users"
uv run --script <skill-root>/commands/doc-search "how to authenticate users"
Returns: {"results": [{"document_id": "doc_abc", "sections": [{"offset": 2000, "limit": 1000}]}]}
Returns: {"results": [{"document_id": "doc_abc", "sections": [{"offset": 2000, "limit": 1000}]}]}
Read only the relevant section
Read only the relevant section
uv run --script <skill-root>/commands/doc-read doc_abc --offset 2000 --limit 1000
undefineduv run --script <skill-root>/commands/doc-read doc_abc --offset 2000 --limit 1000
undefinedLink Related Documents
关联相关文档
bash
undefinedbash
undefinedGet relation types
Get relation types
uv run --script <skill-root>/commands/doc-link --types
uv run --script <skill-root>/commands/doc-link --types
Create a sequential relationship
Create a sequential relationship
uv run --script <skill-root>/commands/doc-link --create doc_design doc_implementation --type predecessor-successor --from-to-note "Design doc" --to-from-note "Implementation plan"
uv run --script <skill-root>/commands/doc-link --create doc_design doc_implementation --type predecessor-successor --from-to-note "Design doc" --to-from-note "Implementation plan"
Create hierarchical relationship (parent owns children)
Create hierarchical relationship (parent owns children)
uv run --script <skill-root>/commands/doc-link --create doc_architecture doc_api --type parent-child --from-to-note "API spec"
uv run --script <skill-root>/commands/doc-link --create doc_architecture doc_api --type parent-child --from-to-note "API spec"
Create peer relationship
Create peer relationship
uv run --script <skill-root>/commands/doc-link --create doc_api doc_models --type related --from-to-note "Data models"
uv run --script <skill-root>/commands/doc-link --create doc_api doc_models --type related --from-to-note "Data models"
View document with its relations
View document with its relations
uv run --script <skill-root>/commands/doc-info doc_architecture
---uv run --script <skill-root>/commands/doc-info doc_architecture
---Key Concepts
核心概念
Tag AND Logic
标签AND逻辑
IMPORTANT: Multiple tags means ALL must match:
- → Document must have BOTH tags
--tags "python,api" - → Document must have ALL THREE tags
--tags "v2,design,spec"
重要提示:多个标签表示必须同时匹配所有标签:
- → 文档必须同时包含这两个标签
--tags "python,api" - → 文档必须同时包含这三个标签
--tags "v2,design,spec"
Output Format
输出格式
All commands output JSON. Save document IDs from upload for later retrieval/deletion.
所有命令均输出JSON格式。请保存上传文档时返回的文档ID,以便后续检索或删除。
Document Relations
文档关联
Relation Types:
- parent-child: Hierarchical ownership. Deleting parent cascades to children.
- related: Peer relationship. No cascade delete.
Bidirectional: Relations are stored from both perspectives. Creating a parent-child link adds:
- relation on the parent document
parent - relation on the child document
child
关联类型:
- parent-child:层级归属关系。删除父文档会同时删除其子文档。
- related:同级关联关系。删除文档不会影响关联的同级文档。
双向存储:关联关系会从两个方向存储。创建父子关联会同时添加:
- 父文档中的关联
parent - 子文档中的关联
child
Notes for AI Assistants
AI助手注意事项
- Tag AND logic - Multiple tags = ALL must match
- Save document IDs - From upload output for future operations
- Check server running - Handle connection errors gracefully
- Parse JSON output - All commands return JSON
- Tags are lowercase - Use consistent tag naming (not
python)Python - Relations in doc-info - Use to see document relations without a separate call
doc-info - Relation IDs - Save relation IDs from create output for update/remove operations
- Cascade delete - Deleting a parent document also deletes its children
- 标签AND逻辑 - 多个标签表示必须同时匹配所有标签
- 保存文档ID - 保存上传输出中的文档ID以便后续操作
- 检查服务器状态 - 优雅处理连接错误
- 解析JSON输出 - 所有命令均返回JSON格式
- 标签小写 - 使用统一的小写标签命名(如而非
python)Python - 通过doc-info查看关联 - 使用命令查看文档关联,无需单独调用其他命令
doc-info - 保存关联ID - 保存创建关联时输出的关联ID以便后续更新或删除
- 级联删除 - 删除父文档会同时删除其子文档
Quick Decision Tree
快速决策树
Store document? →
doc-push <file> --tags "tag1,tag2"Find by tags? → (AND logic, add for links)
doc-query --tags "tag1,tag2"--include-relationsFind by meaning? → (add for links)
doc-search "your question"--include-relationsCheck metadata? → (metadata + relations)
doc-info <doc-id>Read text file? → (text files to stdout)
doc-read <doc-id>Read section? → (partial read)
doc-read <doc-id> --offset 2000 --limit 1000Download document? → (ID from query)
doc-pull <doc-id>Remove document? → (permanent)
doc-delete <doc-id>List all? → (no args)
doc-queryLink documents? →
doc-link --create <from> <to> --type parent-childList relation types? →
doc-link --typesUpdate link note? →
doc-link --update <id> --note "text"Remove link? → (removes both directions)
doc-link --remove <id>需要存储文档? →
doc-push <file> --tags "tag1,tag2"需要按标签查找? → (AND逻辑,添加查看关联)
doc-query --tags "tag1,tag2"--include-relations需要按语义查找? → (添加查看关联)
doc-search "你的问题"--include-relations需要查看元数据? → (包含元数据和关联信息)
doc-info <doc-id>需要读取文本文件? → (将文本文件输出到标准输出)
doc-read <doc-id>需要读取特定段落? → (部分读取)
doc-read <doc-id> --offset 2000 --limit 1000需要下载文档? → (文档ID来自查询结果)
doc-pull <doc-id>需要删除文档? → (永久删除)
doc-delete <doc-id>需要列出所有文档? → (不带任何参数)
doc-query需要关联文档? →
doc-link --create <from> <to> --type parent-child需要查看关联类型? →
doc-link --types需要更新关联备注? →
doc-link --update <id> --note "文本内容"需要删除关联? → (同时删除双向关联)
doc-link --remove <id>Additional Resources
额外资源
- Detailed Command Reference: See
references/COMMANDS.md - Configuration Options: See
references/CONFIGURATION.md - Error Handling: See
references/TROUBLESHOOTING.md
- 详细命令参考:查看
references/COMMANDS.md - 配置选项:查看
references/CONFIGURATION.md - 错误处理:查看
references/TROUBLESHOOTING.md