serena-workflow
激活和使用 Serena MCP 工具集的最佳实践。在处理支持 Serena 的项目时使用此技能可确保正确的项目激活(包括 WSL 处理)并利用语义工具进行代码导航和编辑。
📖 中文导读:激活和使用 Serena MCP 工具集的最佳实践。在处理支持 Serena 的项目时使用此技能可确保正确的项目激活(包括 WSL 处理)并利用语义工具进行代码导航和编辑。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: serena-workflow description: Best practices for activating and utilizing the Serena MCP toolset. Use this skill when working in a Serena-enabled project to ensure correct project activation (including WSL handling) and to leverage semantic tools for code navigation and editing. metadata: short-description: Activate and use Serena MCP tools
Serena Workflow Guidelines
This skill outlines the standard procedure for working with Serena MCP tools, ensuring consistent project activation and efficient code manipulation.
1. Project Activation
Before performing any code operations, you must activate the Serena project.
WSL Environment Strategy
If you are operating in a WSL environment (paths starting with /home/...):
- Primary Method: Attempt activation using the UNC path format:
\\wsl$\Ubuntu<absolute_path>(e.g.,\\wsl$\Ubuntu\home\user\repo) - Fallback: Use the standard Linux path only if the UNC path activation fails.
Onboarding Check
Immediately after activation:
- Run
check_onboarding_performed. - If it returns
false, you MUST run theonboardingtool before proceeding with any other tasks.
2. Serena-First Workflow
Prioritize Serena's semantic capabilities over standard file operations for code-related tasks.
- Code Navigation: Use semantic search tools to find symbols and references instead of
greporfind. - Refactoring: Leverage Serena's automated refactoring tools for safe code changes.
- File Operations: Reserve standard shell commands for non-code files or simple, non-semantic text processing.