Serena MCP expert for efficient code editing and analysis. Use when starting projects, editing code, or refactoring. Prioritize symbol-based operations over full-file reads.
Navigates and edits code using LSP symbols for efficient project-wide changes.
npx claudepluginhub kkhys/claude-code-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Serena is an MCP server for efficient code navigation and editing through LSP-based symbol operations.
.serena directory doesn't existthink_about_task_adherence() before editingreplace_content with regex mode and wildcards.serena from parent directory (cp -r ../.serena .serena)ls -la .serena
# If not exists
mcp__serena__activate_project(project=".")
mcp__serena__check_onboarding_performed()
mcp__serena__onboarding() # If not performed
mcp__serena__get_symbols_overview(
relative_path="src/file.ts",
depth=0 # 0=top-level only, 1=includes direct children
)
# Search by name path pattern
mcp__serena__find_symbol(
name_path_pattern="ClassName/methodName", # Relative path
name_path_pattern="/ClassName/methodName", # Absolute path (exact match)
name_path_pattern="methodName", # Simple name
relative_path="src/", # Restrict search scope
include_body=True, # Include source code
depth=1, # Include children
substring_matching=True # Substring search
)
mcp__serena__find_referencing_symbols(
name_path="functionName",
relative_path="src/file.ts" # File specification required
)
mcp__serena__search_for_pattern(
substring_pattern="TODO|FIXME", # Regex pattern
relative_path="src/", # Search scope
paths_include_glob="*.ts", # Include files
paths_exclude_glob="*test*", # Exclude files
restrict_search_to_code_files=True, # Code files only
context_lines_before=2, # Context lines
context_lines_after=2
)
mcp__serena__replace_symbol_body(
name_path="methodName",
relative_path="src/file.ts",
body="function methodName() { ... }" # Include signature, exclude docstring/imports
)
mcp__serena__replace_content(
relative_path="src/file.ts",
needle="beginning.*?end", # Regex recommended
repl="new content",
mode="regex", # "literal" or "regex"
allow_multiple_occurrences=False
)
# Add import statements
mcp__serena__insert_before_symbol(
name_path="firstSymbol",
relative_path="src/file.ts",
body="import { X } from 'y';\n"
)
# Add new method
mcp__serena__insert_after_symbol(
name_path="lastMethod",
relative_path="src/file.ts",
body="\n newMethod() { ... }"
)
mcp__serena__rename_symbol(
name_path="oldName",
relative_path="src/file.ts",
new_name="newName" # Changes across entire codebase
)
# List directory
mcp__serena__list_dir(relative_path="src/", recursive=True)
# Find files
mcp__serena__find_file(file_mask="*.test.ts", relative_path="src/")
# Read file (only when symbol operations are not possible)
mcp__serena__read_file(
relative_path="config.json",
start_line=0,
end_line=50
)
# Create/overwrite file
mcp__serena__create_text_file(
relative_path="src/new-file.ts",
content="// content"
)
# List memories
mcp__serena__list_memories()
# Read memory
mcp__serena__read_memory(memory_file_name="architecture.md")
# Write memory
mcp__serena__write_memory(
memory_file_name="decisions.md",
content="# Design Decisions\n..."
)
# Edit memory
mcp__serena__edit_memory(
memory_file_name="decisions.md",
needle="old text",
repl="new text",
mode="literal" # or "regex"
)
# Delete memory
mcp__serena__delete_memory(memory_file_name="outdated.md")
# Call after gathering information
mcp__serena__think_about_collected_information()
# Call before code changes (required)
mcp__serena__think_about_task_adherence()
# Call when task is complete
mcp__serena__think_about_whether_you_are_done()
# Execute shell command
mcp__serena__execute_shell_command(
command="npm run build",
cwd=None # None = project root
)
# Get current configuration
mcp__serena__get_current_config()
# Switch modes
mcp__serena__switch_modes(modes=["editing", "interactive"])
For include_kinds/exclude_kinds parameters:
| Value | Kind | Value | Kind |
|---|---|---|---|
| 1 | file | 14 | constant |
| 2 | module | 15 | string |
| 3 | namespace | 16 | number |
| 4 | package | 17 | boolean |
| 5 | class | 18 | array |
| 6 | method | 19 | object |
| 7 | property | 20 | key |
| 8 | field | 21 | null |
| 9 | constructor | 22 | enum member |
| 10 | enum | 23 | struct |
| 11 | interface | 24 | event |
| 12 | function | 25 | operator |
| 13 | variable | 26 | type parameter |
Official documentation: https://oraios.github.io/serena/_sources/02-usage/050_configuration.md
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.