.serena/memories/serena_repository_structure.md
Serena is a multi-language code assistant that combines two main components:
serena/
├── src/ # Main source code
│ ├── serena/ # Serena agent framework
│ ├── solidlsp/ # LSP wrapper library
│ └── interprompt/ # Multi-language prompt templates
├── test/ # Test suites
│ ├── serena/ # Serena agent tests
│ ├── solidlsp/ # Language server tests
│ └── resources/repos/ # Test repositories for each language
├── scripts/ # Build and utility scripts
├── resources/ # Static resources and configurations
├── pyproject.toml # Python project configuration
├── README.md # Project documentation
└── CHANGELOG.md # Version history
src/serena/)agent.py - Main SerenaAgent class that orchestrates everythingtools/ - MCP tools for file operations, symbols, memory, etc.
file_tools.py - File system operations (read, write, search)symbol_tools.py - Symbol-based code operations (find, edit)memory_tools.py - Knowledge persistence and retrievalconfig_tools.py - Project and mode managementworkflow_tools.py - Onboarding and meta-operationsconfig/ - Configuration management
serena_config.py - Main configuration classescontext_mode.py - Context and mode definitionsutil/ - Utility modulesmcp.py - MCP server implementationcli.py - Command-line interfacesrc/solidlsp/)ls.py - Main SolidLanguageServer classlanguage_servers/ - Language-specific implementations
csharp_language_server.py - C# (Microsoft.CodeAnalysis.LanguageServer)python_server.py - Python (Pyright)typescript_language_server.py - TypeScriptrust_analyzer.py - Rustgopls.py - Gols_config.py - Language server configurationls_types.py - LSP type definitionsls_utils.py - Utilities for working with LSP datasrc/interprompt/)test/solidlsp/)Each language has its own test directory:
test/solidlsp/
├── csharp/
│ └── test_csharp_basic.py
├── python/
│ └── test_python_basic.py
├── typescript/
│ └── test_typescript_basic.py
└── ...
test/resources/repos/)Contains minimal test projects for each language:
test/resources/repos/
├── csharp/test_repo/
│ ├── serena.sln
│ ├── TestProject.csproj
│ ├── Program.cs
│ └── Models/Person.cs
├── python/test_repo/
├── typescript/test_repo/
└── ...
test/conftest.py - Shared test fixtures and utilitiescreate_ls() function - Creates language server instances for testinglanguage_server fixture - Parametrized fixture for multi-language testspyproject.toml - Python dependencies, build config, and tool settings.serena/ directories - Project-specific Serena configuration and memoriesCLAUDE.md - Instructions for AI assistants working on the projectThe project uses modern Python tooling:
@pytest.mark.csharp)scripts/ directory