Skip to main content

serena-pattern-editor

Pattern-based code editing using Serena tools - searches for patterns and applies bulk transformations

소스 정보

저장소
first-fluke/mimic
최근 소스 활동
2026년 1월 29일 13:27
감지된 SKILL.md 언어
영어
스타
3
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
serena-pattern-editor
description
Pattern-based code editing using Serena tools - searches for patterns and applies bulk transformations
trigger
auto
domain
tooling
tools
{"serena_search_for_pattern":true,"serena_replace_content":true,"serena_replace_symbol_body":true}
# Serena Pattern Editor Automated pattern-based editing for bulk code transformations and migrations. ## When to Apply - Migrating APIs or libraries - Updating deprecated patterns - Enforcing coding standards - Bulk refactoring operations ## Workflow ### Phase 1: Pattern Discovery 1. Use `serena_search_for_pattern` to find all occurrences 2. Analyze pattern variations 3. Identify edge cases ### Phase 2: Pattern Definition 1. Define precise regex pattern 2. Test on subset of matches 3. Refine pattern as needed ### Phase 3: Transformation 1. Use `serena_replace_content` with regex mode 2. Apply wildcards for large replacements 3. Verify each change ### Phase 4: Validation 1. Run tests 2. Check for compilation errors 3. Review changes in context ## Best Practices 1. Use regex mode with wildcards for efficiency 2. Test pattern on single file first 3. Use `allow_multiple_occurrences` carefully 4. Always verify after bulk changes ## Pattern Examples ### Migration Pattern ```regex // Old API oldFunction\((.*?)\) // New API newFunction($1, { option: true }) ``` ### Deprecation Pattern ```regex // Find deprecated usage @deprecated.*\n.*function // Replace with warning // TODO: Migrate to new API\n$0 ``` ## Safety Guidelines - Always preview changes before applying - Use version control for rollback - Run full test suite after changes - Document pattern changes ## Example Usage ```typescript // Migrate from old API to new API const workflow = [ 'serena_search_for_pattern("oldApi\\.call")', 'serena_replace_content("oldApi\\.call\\((.*?)\\)", "newApi.call($1)", "regex")', ]; ``` ## Context - Learned from repeated migration patterns - Optimized for large-scale transformations - Confidence: High (based on 5+ observed usages)
GitHub에서 보기