Логотип Refactoring Code

Refactoring Code

Организация
JetBrains
refactoring-code

Use when semantic refactoring is needed in Rider-supported solutions and projects, including .NET/C#, F#, VB, C++, Unity, Unreal Engine, XAML, Razor, and other GameDev or mixed-language projects. Trigger when edits must update declarations and usages across IDE-resolved references — rename symbols, move types or namespaces, safe-delete unused code, extract interface/base class/method, change signatures, or reorganize namespaces. Do not use for file-only moves, config keys, strings, comments, prose-only edits, generated output, or logic changes with unchanged names/signatures.

Обзор

ИздательJetBrains
Репозиторийskills
Название навыкаrefactoring-code
Звёзды
377
Форки
32
Встроенные файлы
9
Ссылки
  • Инструкции в формате Markdown

    Файл SKILL.md, который модель загружает по необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 9

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Опубликовано на GitHub: JetBrains. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Refactoring Code в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/JetBrains/skills/tree/main/refactoring-code
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Новый навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/JetBrains/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/refactoring-code .claude/skills/refactoring-code
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Refactoring Code в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Refactoring Code, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Refactoring Code не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими API-ключами.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Code Refactoring

Rider/ReSharper-driven semantic refactorings across solutions opened in Rider. Each tool resolves the target through the IDE's reference index and rewrites every affected site — language-aware usages such as nameof, XML-doc <see cref>, XAML x:Name, Razor, C++/Unreal references, and ordinary references that grep cannot resolve — instead of a grep + text replace.

Invoking a tool

Always call a refactoring tool through execute_tool — direct calls are not routed:

execute_tool(command="<tool> --arg value [--flag true]")

reference/tools.md lists every available tool; the linked reference/tools/<tool>.md gives the exact parameters, response shape, outcomes, and error kinds for the one tool you are about to call. Read only that one — do not pre-load the whole tree.

Shared rules

  1. Prefer the MCP tool. It resolves references semantically across the solution; a text edit cannot. On any error you cannot fix by adjusting the input, or when execute_tool is unavailable, fall back to a text-based edit.
  2. Trust the success signal. When a tool reports success, do not re-read the mutated files to verify. When a tool reports a count of touched/affected sites, a value of 1 for a type, method, property, field, or namespace is suspicious (declaration only, no callers) — surface it to the user.
  3. Do not retry blindly. Adjust the arguments (query, name, file path, namespace, member selection) between calls; a second identical call fails the same way.
  4. Argument hygiene. Parameter names are camelCase — hyphenated variants like --new-name are rejected. Pass real values or omit optional parameters entirely; never encode an omitted value with a placeholder such as "", "/", "__omit__", or a fake path. Treat file paths and identifiers as opaque: copy them from search_* / get_symbol_info output (solution-relative, / separators) rather than synthesizing them.
  5. Library / external symbols cannot be refactored — the change must be made upstream. Confirm with the user.

Preview before applying

When a tool offers an analysis-only mode — rename's --preview true (the older --dryRun is a deprecated alias) returns the blast radius in affects without mutating files — use it first for:

  • public / protected API changes;
  • targets with many call sites or cross-language references (XAML, Razor, C++/Unreal, <see cref>);
  • any change where the user signalled hesitation.

Audit affects, then re-issue without --preview to apply. Preview resolves the symbol and counts usages only — it does not run conflict analysis, so a clean preview can still come back with conflicts on apply. Which tools expose an analysis mode is documented per tool in the reference; a tool without one (e.g. a namespace move) applies directly and reports no blast-radius counts, so for a high-impact call narrate what you are about to change before issuing it.

Conflicts and ambiguity

Tools that rewrite or remove use sites (rename, safe-delete, the extract family) can refuse the operation and report conflicts; a symbol query can also match more than one candidate (ambiguous). Both come back in the tool's response — see its reference file for the exact fields. A non-empty conflicts list always means no files were touched.

Each conflict entry is {kind, file, context}: kind mirrors ReSharper's ConflictType (snake_case); context is the engine's localized description; file is the first occurrence's path, or null for a textual-only conflict or a clash with a compiled-only symbol.

KindMeaningAction
same_name_conflictNew name collides with an existing member in the same scope.Pick a different name and retry.
default_element_conflictGeneric element-level conflict without a more specific category.Read context; if it names a colliding member, treat like same_name_conflict, else escalate.
cannot_update_usage_conflictA call site can't be rewritten safely — downstream code would break.Escalate to user; do not auto-retry.
cannot_remove, cannot_delete_safely, cannot_inline_usage_conflict, will_be_removedEngine refuses to remove/delete/inline/rewrite a use site.Escalate to user; do not auto-retry.
not_accessibleThe symbol becomes invisible from one or more use sites after the change.Escalate to user — a visibility regression.
will_be_made_publicAccess widens as a side-effect (e.g. promoted from private).Narrate the trade-off to the user before retrying.
hierarchy_conflictOverride/implementation hierarchy clashes with the result.Escalate to user; cross-type effect.
text_only, default_conflict, invalidGeneric textual conflict the engine couldn't categorise structurally.Read context; decide from the message.

Escalate to the user (instead of auto-deciding) when there are more than 5 conflicts, or any entry is cannot_update_usage_conflict, cannot_remove, cannot_delete_safely, cannot_inline_usage_conflict, will_be_removed, not_accessible, or hierarchy_conflict. For a rename, also escalate when affects.callSites == 0 for a public/protected symbol — it usually means the query resolved to the wrong target.

For ambiguous matches, each candidate carries name, kind, fqn, file, and line. Re-issue with a more specific query — a fully qualified path like Namespace.Type.Method, or Type._field for a private member (bare short-name lookup prioritises type-level entries and misses private fields/methods). The candidate list is capped at 5; if you see 5, the query is too broad — narrow it rather than expecting the full set.

Known limitations

These hold across the toolset and are not reported in tool output:

  • String and comment occurrences of an old name or namespace are not updated. Fix them with a regular edit pass afterward.
  • XML-doc <see cref> references: a method rename rewrites <see cref="Type.Method(int, int)"/> to <see cref="NewName"/>, dropping the containing type and parameter list. Surface to the user after method renames and offer a separate edit pass.
  • Moving a type does not move its file — only the namespace declaration and references change. If the user also wants the file relocated to match, do that as a separate file operation.

Tool reference

reference/tools.md is the auto-generated index of every tool in the Rider refactoring toolset, each entry linking to its full parameter and response contract. It is regenerated from the live MCP descriptors, so it — not this file — is the source of truth for tool names, signatures, and response shapes. This skill carries only the workflow and judgment the contracts don't.

Встроенные файлы

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Refactoring Code?

Use when semantic refactoring is needed in Rider-supported solutions and projects, including .NET/C#, F#, VB, C++, Unity, Unreal Engine, XAML, Razor, and other GameDev or mixed-language projects. Trigger when edits must update declarations and usages across IDE-resolved references — rename symbols, move types or namespaces, safe-delete unused code, extract interface/base class/method, change signatures, or reorganize namespaces. Do not use for file-only moves, config keys, strings, comments, prose-only edits, generated output, or logic changes with unchanged names/signatures.

Зачем использовать Refactoring Code в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Refactoring Code — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Refactoring Code в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/JetBrains/skills/tree/main/refactoring-code. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Refactoring Code?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Refactoring Code?

С любым количеством. Если модель поддерживает навыки, вы можете использовать с ней Refactoring Code: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama и другие — всё в TypingMind с вашими собственными ключами API.

Бесплатен ли навык ИИ Refactoring Code?

Навык опубликован на GitHub автором JetBrains. Условия лицензии можно найти в репозитории. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это многоразовый набор инструкций, который объясняет модели ИИ, как выполнять конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты для вызова — код, который где-то выполняется и возвращает результат. Навык ИИ вместо этого даёт модели знания и порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇