serena-code-editing

Modify source code via symbol-aware and regex-based operations through the Serena MCP server.

1|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/sachmata/serena-skills --skill serena-code-editing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: serena-code-editing
Source: https://github.com/sachmata/serena-skills/tree/main/skills/serena-code-editing
Command: npx skills add https://github.com/sachmata/serena-skills --skill serena-code-editing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates complex code modifications, ensuring accuracy and consistency across your codebase by leveraging symbol-aware and regex-based editing tools.

Core Features & Use Cases

  • Symbolic Editing: Safely rename symbols, replace entire function/class bodies, or insert code adjacent to existing symbols using Language Server Protocol (LSP) awareness.
  • File-Based Editing: Perform targeted text replacements within files using literal strings or powerful regular expressions.
  • Use Case: Refactor a widely used function by renaming it across the entire project, or update a configuration value in multiple files using a precise regex pattern.

Quick Start

Use the serena-code-editing skill to rename the symbol 'connect' to 'connectToDatabase' in the file 'src/server.ts'.

Frequently Asked Questions about serena-code-editing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rename a function or symbol across an entire codebase safely?

To rename a symbol safely across an entire codebase, symbol-aware editing uses Language Server Protocol (LSP) awareness to programmatically refactor and rename functions, classes, or variables with targeted accuracy.

What's the best way to replace a function body programmatically during refactoring?

The best way to replace a function body during refactoring is using symbol-aware operations that target the entire symbol body via LSP, ensuring precise code modification without affecting surrounding source code.

Can I insert code before or after a specific class or function in my project?

Yes, you can insert code before or after specific classes or functions by leveraging symbol-aware editing operations that utilize LSP to programmatically target and modify exact symbol locations in your source code.

How do I update configuration values in multiple files using a regex pattern?

To update configuration values across multiple files, apply regex-based text replacement to perform targeted string substitutions, allowing precise and programmatic code modifications throughout your project.

Do I need an active project in editing mode to perform code modifications?

Yes, an active project in editing mode is required to programmatically modify source code, as the LSP-based symbol operations and regex replacements depend on the active project context to ensure safe and accurate edits.