DSkills serena
install
source · Clone the upstream repo
git clone https://github.com/Dianel555/DSkills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/Dianel555/DSkills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/serena" ~/.claude/skills/dianel555-dskills-serena && rm -rf "$T"
manifest:
skills/serena/SKILL.mdsource content
Serena - Semantic Code Understanding
IDE-like semantic code operations via CLI. Provides symbol-level code navigation, editing, and project memory.
Prerequisites
pip install serena-agent typer pyyaml
Quick Start
First-time setup: Launch the Web Dashboard to initialize and register the project:
python -m tools dashboard serve --open-browser
This will:
- Initialize Serena configuration
- Register the current project in
~/.serena/serena_config.yml - Open the Web Dashboard for monitoring and configuration
Configuration: Edit
.env file in skills/serena/ directory:
SERENA_CONTEXT=claude-code SERENA_MODES=interactive,editing,onboarding SERENA_PROJECT=.
Usage
Basic Command Structure
python -m tools [GLOBAL OPTIONS] <command> [COMMAND OPTIONS]
Global Options (must be specified before the command):
- Project directory (default: current directory, env: SERENA_PROJECT)-p, --project PATH
- Execution context (auto-detected if not specified, env: SERENA_CONTEXT)-c, --context TEXT
- Operation modes (can be specified multiple times, env: SERENA_MODES)-m, --mode TEXT
Working with Different Projects
Important: When working with projects in different locations (especially cross-drive on Windows), use
--project:
# Correct: Use --project for different project locations python -m tools --project "/path/to/project" symbol find MyClass python -m tools --project "E:\MyProject" file search "pattern" # Incorrect: Don't use --path with absolute paths from different drives python -m tools file search "pattern" --path "E:\MyProject" # Will fail!
The
--path option in subcommands expects relative paths within the project. Always use --project to set the project root first.
Common Operations
# Dashboard python -m tools dashboard serve --open-browser python -m tools dashboard info # Symbol operations python -m tools symbol find MyClass --body python -m tools symbol overview src/main.py python -m tools symbol refs MyClass/method python -m tools symbol rename OldName NewName --path src/file.py # Memory operations python -m tools memory list python -m tools memory read project_overview python -m tools memory write api_notes --content "..." # File operations python -m tools file list --recursive python -m tools file find "**/*.py" python -m tools file search "TODO:.*" --path src # Extended tools python -m tools cmd run "git status" python -m tools config read config.json
Tool Routing Policy
Prefer Serena Over Built-in Tools
| Task | Avoid | Use Serena CLI |
|---|---|---|
| Find function | | |
| List file structure | | |
| Find usages | | |
| Edit function | tool | |
| Rename | Manual find/replace | |
When to Use Built-in Tools
- Simple text search (non-code patterns)
- Configuration files (JSON, YAML)
- Documentation files (Markdown)
Command Reference
Dashboard Commands
| Command | Description |
|---|---|
| Start Web Dashboard server |
| Show current configuration |
| List active and available tools |
| List active and available modes |
| List active and available contexts |
Symbol Commands
| Command | Description |
|---|---|
| Find symbols by name |
| List all symbols in file |
| Find symbol references |
| Replace symbol body |
| Insert after symbol |
| Insert before symbol |
| Rename symbol |
Memory Commands
| Command | Description |
|---|---|
| List all memories |
| Read memory content |
| Create/update memory |
| Edit memory |
| Delete memory |
File Commands
| Command | Description |
|---|---|
| List directory |
| Find files by glob pattern |
| Search for regex pattern |
Extended Commands
| Command | Description |
|---|---|
| Execute shell command |
| Execute script file |
| Read config file |
| Update config value |
Workflow Commands
| Command | Description |
|---|---|
| Run project onboarding |
| Check onboarding status |
| List available tools |
Workflow Examples
Phase 1: Exploration
python -m tools symbol overview src/main.py # Understand file structure python -m tools symbol find MyClass --depth 1 # Explore class members python -m tools symbol find MyClass/method --body # Get implementation details
Phase 2: Analysis
python -m tools symbol refs MyClass/method # Impact analysis python -m tools memory list # Check project knowledge python -m tools memory read architecture # Retrieve context
Phase 3: Modification
python -m tools symbol find target --body # Verify target python -m tools symbol replace target --path f --body "..." # Edit python -m tools symbol rename old new --path f # Refactor
Error Handling
All CLI output is JSON:
// Success {"result": <data>} // Error {"error": {"code": "ERROR_CODE", "message": "description"}}
| Error Code | Recovery |
|---|---|
| Check |
| Use |
| Check serena-agent installation |
| Check error message |
Anti-Patterns
| Prohibited | Correct |
|---|---|
| Read entire file to find function | |
| Grep for function calls | |
| Manual search-replace rename | |
| Skip impact analysis | before editing |