Skip to content
Agentmart
Submit a tool

kcontext-skill

使用 kso-context MCP 工具查询公司内部代码库文档与 API 上下文。触发词(满足其一):use kctx、kskillhub-kcontext、kcontext。用户消息包含任一则必须使用本 skill。

Skill by wang-zi-tao

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/wang-zi-tao-kcontext-skill

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

使用 kso-context MCP 工具查询公司内部代码库文档与 API 上下文。触发词(满足其一):use kctx、kskillhub-kcontext、kcontext。用户消息包含任一则必须使用本 skill。

Use cases: backend, agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/kcontext-skill

What's inside

Skill name
kcontext-skill
Description
使用 kso-context MCP 工具查询公司内部代码库文档与 API 上下文。触发词(满足其一):use kctx、kskillhub-kcontext、kcontext。用户消息包含任一则必须使用本 skill。
License
MIT
Instructions
140 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

---
name: kcontext-skill
description: 使用 kso-context MCP 工具查询公司内部代码库文档与 API 上下文。触发词(满足其一):use kctx、kskillhub-kcontext、kcontext。用户消息包含任一则必须使用本 skill。
---

# kso-context MCP Skill

## 触发方式

用户消息中包含以下**任一**关键词时激活本 skill,然后按下方工作流调用 MCP 工具完成请求:

| 关键词 | 说明 |
|--------|------|
| **`use kctx`** | 显式指令 |
| **`kskillhub-kcontext`** | MCP 服务标识名(配置、连接或排查时常出现) |
| **`kcontext`** | 产品/能力简称 |

以上与内部域名库触发规则并列;出现任一则**必须**走本 skill 的 MCP 工作流。

`kso-context` 是公司内部代码库的 AI 上下文引擎,索引了内部 GitLab 仓库,提供 4 个 MCP 工具。

## 工具速查

| 工具 | 用途 | 必填参数 |
|------|------|---------|
| `search-libraries` | 按名称/关键词搜索库,获取 `libraryId` | `query` |
| `discover-libraries` | 自然语言描述需求,跨库推荐最相关的库 | `query` |
| `get-library-context` | 查某库的具体 API / 代码片段 / 用法 | `libraryId`, `query` |
| `get-library-summary` | 获取某库的整体架构概览 | `libraryId` |

## 标准工作流

### 场景 A:已知库名,查具体用法
```
1. search-libraries(query="库名")        → 取 libraryId(仓库 URL)
2. get-library-context(libraryId, query) → 获取 API 与代码示例
```

### 场景 B:不知用哪个库,按需求找
```
1. discover-libraries(query="自然语言需求", language="go")  → 推荐候选库列表
2. get-library-summary(libraryId)                          → 快速了解架构
3. get-library-context(libraryId, query)                   → 深入查具体用法
```

### 场景 C:先建立整体认知再深入
```
1. search-libraries / discover-libraries  → 定位 libraryId
2. get-library-summary(libraryId)         → 整体架构 + 主要包
3. get-library-context(libraryId, query)  → 针对具体功能查文档
```

## 各工具详解

### `search-libraries`
- `query`:库名、路径片段或关键词,如 `xfx`、`o/xkit`、`router`
- 返回:JSON,含 `results[].url`(即 `libraryId`)、`name`、`description`、`snippet_count`

### `discover-libraries`
- `query`:自然语言目标,如 `distributed lock`、`HTTP retry with circuit breaker`
- `language`(可选):`go`、`python` 等
- 返回:JSON,最多 5 个候选,含 `score`、`reason`、`matched_packages`

### `get-library-context`
- `libraryId`:仓库 URL 或路径后缀(来自 search/discover 结果)
- `query`:想了解的具体内容
- `branch`(可选):指定分支
- `maxTokens`(可选):限制返回长度
- `snippetType`(可选):`code`(代码片段)或 `info`(说明文档)
- 返回:**纯文本**,可直接作为 prompt 上下文

### `get-library-summary`
- `libraryId`:仓库 URL 或名称
- `branch`(可选)
- 返回:**纯文本**,库的整体描述、架构与主要功能

## 典型示例

**用户问**:「xfx 框架怎么注册路由?」
```
search-libraries(query="xfx")
→ libraryId = "https://ksogit.kingsoft.net/o/xfx"

get-library-context(
  libraryId = "https://ksogit.kingsoft.net/o/xfx",
  query = "register route HTTP handler"
)
```

**用户问**:「有没有内部的分布式锁库?」
```
discover-libraries(
  query = "distributed lock redis",
  language = "go"
)
→ 返回候选库列表,挑选合适的 libraryId

get-library-summary(libraryId)
get-library-context(libraryId, query="how to use distributed lock")
```

## 处理返回结果的规则

### 规则 1:遇到 Deprecated 标识,停止推荐,反问用户

若返回内容中包含 `Deprecated`、`@Deprecated`、`废弃`、`deprecated` 等标识,**禁止直接使用该代码**,必须:

1. 告知用户:「该方法/库已被标记为废弃,不建议使用」
2. 尝试换不同的 `query` 重新查询是否有替代实现
3. 若仍找不到更好的方案,**主动反问用户**:

> 「该实现已被标记为 Deprecated,我暂未找到明确的替代方案。你是否知道应该用哪个库或方法来替代?」

### 规则 2:遇到多个同类实现,必须先让用户选择

若返回多个名称相近、功能相同但版本不同的实现(例如 `RedisLocker` 与 `RedisLockerV2`),**不得自行选择**,必须:

1. 列出所有候选实现及其差异
2. **明确反问用户**选择哪一个:

From wang-zi-tao/dotfiles, MIT.

More from wang-zi-tao/dotfiles

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Aug 21, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from wang-zi-tao

Cite this page

kcontext-skill. Agent Mart. https://agentmart.dev/skills/wang-zi-tao-kcontext-skill (last updated 2026-10-24)