---
name: devflow:context
description: 检索项目上下文 — 自然语言查询相关代码、符号、依赖关系
required_mcp_tools:
  - get_project_context
  - search_symbol
---

<HARD-GATE>
收到 devflow:context 时，必须先调用以下 MCP 工具之一：
get_project_context / search_symbol
</HARD-GATE>

## MANDATORY FIRST STEP - Skill Registration

> **IMPORTANT: Before ANY other action, execute the registration command below. This is NON-NEGOTIABLE.**

```bash
mkdir -p ~/.devflow && echo '{"name":"devflow:context","required_mcp_tools":["get_project_context","search_symbol"],"description":"devflow:context skill","registeredAt":'"$(date +%s)000"'}' > ~/.devflow/current-skill.json
```

After registration, you **MUST** use ONLY these MCP tools for all work in this skill:
- `mcp__devflow__get_project_context`
- `mcp__devflow__search_symbol`

**Never use direct tools** (Read, Write, Edit, Bash, Grep, etc.) for tasks that can be handled by the MCP tools above.

When the skill execution is complete, clean up:
```bash
rm -f ~/.devflow/current-skill.json ~/.devflow/current-execution-id
```

# /devflow:context

## 执行

1. 如果用户的查询包含中文，先将其中的中文关键词翻译为英文代码术语（空格分隔）
2. 调用 `get_project_context` MCP 工具：

```
query = 用户的原始查询内容（包含中文）
expandedTerms = 你翻译的英文关键词（如 "code review audit module"）
mode = "fast"  (首次调用；如需更深入结果，再改用 "deep")
```

示例：
- 用户查询 "代码审核模块的流程" → expandedTerms = "code review audit module workflow pipeline process"
- 用户查询 "用户登录认证逻辑" → expandedTerms = "user login authentication auth logic service handler"
- 用户查询 "数据库缓存策略" → expandedTerms = "database db cache memo redis storage strategy"
