Skip to content

Dianel555/DSkills / skills/serena

serena

Verified

Semantic code understanding with IDE-like symbol operations. Use when: (1) Large codebase analysis (>50 files), (2) Symbol-level operations (find, rename, refactor), (3) Cross-file reference tracking, (4) Project memory and session persistence, (5) Multi-language semantic navigation. Triggers: "find symbol", "rename function", "find references", "symbol overview", "project memory". IMPORTANT: Prioritize Serena's symbolic tools over file-based grep/read for code exploration.

tools/paths.py

View on GitHub
"""Path resolution for Serena Tools configuration."""
import os
from pathlib import Path
from typing import Optional


class SerenaToolsPaths:
    """Manages configuration paths for Serena Tools wrapper."""

    def __init__(self):
        """Initialize path resolver."""
        pass

    def get_config_dir(self) -> Path:
        """Get configuration directory path.

        Returns ~/.serena or $SERENA_HOME if set.
        """
        serena_home = os.environ.get("SERENA_HOME")
        if serena_home:
            return Path(serena_home)
        return Path.home() / ".serena"

    def get_config_file_path(self) -> Path:
        """Get configuration file path.

        Returns <config_dir>/serena_config.yml
        """
        return self.get_config_dir() / "serena_config.yml"

    def ensure_config_exists(self) -> Path:
        """Ensure configuration file exists, creating it if necessary.

        Returns path to config file.
        """
        config_file = self.get_config_file_path()
        config_dir = config_file.parent

        # Create directory if it doesn't exist
        config_dir.mkdir(parents=True, exist_ok=True)

        # Create default config if file doesn't exist
        if not config_file.exists():
            default_config = """# Serena Tools Configuration
# This file is auto-generated on first run

projects: []
web_dashboard:
  enabled: true
  host: "127.0.0.1"
  port: 8765
log_level: "INFO"
"""
            config_file.write_text(default_config)

        return config_file
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall