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/cli/file.py

View on GitHub
"""File operations command group."""
import typer
from typing import Optional
from . import State
from ..output import output_json

app = typer.Typer(help="File system operations (list, find, search)")


@app.command("list")
def list_dir(
    path: Optional[str] = typer.Option(None, "--path", "-p", help="Directory path (default: project root)"),
    recursive: bool = typer.Option(False, "--recursive", "-r", help="List recursively"),
):
    """List directory contents."""
    result = State.core.call_tool(
        "list_dir",
        relative_path=path if path is not None else ".",
        recursive=recursive,
    )
    output_json(result)


@app.command("find")
def find_file(
    pattern: str = typer.Argument(..., help="File pattern (glob syntax, e.g., '**/*.py')"),
):
    """Find files by pattern."""
    result = State.core.call_tool(
        "find_file",
        file_mask=pattern,
        relative_path=".",
    )
    output_json(result)


@app.command("search")
def search_pattern(
    pattern: str = typer.Argument(..., help="Search pattern (regex)"),
    path: Optional[str] = typer.Option(None, "--path", "-p", help="Restrict search to file/directory"),
):
    """Search for pattern in files."""
    result = State.core.call_tool(
        "search_for_pattern",
        substring_pattern=pattern,
        relative_path=path if path is not None else ".",
    )
    output_json(result)
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