Логотип Refactor

Refactor

Организация
greenfield-inc
refactor

Этап рефакторинга после создания PR. Определяет масштаб diff относительно удалённой ветки по умолчанию, запускает refactor-simple (а при крупных изменениях — и refactor-deep) как новых субагентов, работающих независимо друг от друга, объединяет их планы по правилам максимальной критичности, показывает сводный отчёт и передаёт его в refactor-apply, только если пользователь попросит. Используйте после открытия PR или когда пользователь просит отрефакторить или привести ветку в порядок.

Add to TypingMind

Обзор

Издательgreenfield-inc
РепозиторийPane
Название навыкаrefactor
Звёзды
529
Форки
227
Файлы в комплекте
1
Ссылки
  • Инструкции в формате Markdown

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

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

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

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

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

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

    Издатель навыка на GitHub — greenfield-inc. Перед установкой изучите исходные материалы.

Установка

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

1

Установка в TypingMind

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Refactor

One command for the post-PR quality pass. It sizes the change, runs the right analyses independently, merges once, stops for the user, then applies. It is a manual post-PR quality pass. It changes the head, so run it before QA when QA evidence must be current-head evidence.

Why the analyses run blind

Two analyses that see each other's findings converge into one opinion. Run independently, refactor-simple and refactor-deep overlap on about half their findings, the other half is complementary, and the severe correctness findings tend to come from one of them alone. So each analysis runs in a fresh subagent with no access to the other's output, and the merge happens exactly once, here, after both are done. Repeated runs on the same diff converge on the same findings, and averaging them has demoted real Criticals; one run per analysis is the rule.

Process

1. Size the change

Resolve the PR/current branch's relevant remote and that remote's default branch before running these commands. If either is ambiguous or unavailable, report the blocked comparison; do not guess a remote or silently review an empty diff. Record the resolved remote, base ref, and merge-base for helpers.

bash
# Resolve the relevant remote from the PR/current branch configuration first.
# Set REFACTOR_REMOTE to that verified name; do not assume origin.
git remote show "$REFACTOR_REMOTE"
# Resolve its actual default branch and set BASE to the verified remote ref.
# Fetch that branch explicitly if the ref is missing/stale, then verify it.
git rev-parse --verify "$BASE^{commit}"
git diff "$(git merge-base "$BASE" HEAD)" --numstat

Also enumerate non-ignored untracked files with git ls-files --others --exclude-standard -z. Treat these as added files: include their full contents and handwritten line counts in sizing and analysis, applying the same generated/vendor/lockfile exclusions. Pass this file inventory to every analyzer; plain git diff omits it. Do not stage files to inspect them.

Merge-base to working tree, so uncommitted work counts; the remote's real default branch, not an assumed main.

Exclude lockfiles, generated files, and vendored directories from the count. Under ~10 hand-written files and ~500 lines is small; above is large. --size overrides. State the size and the file count before fanning out.

2. Fan out, independently

Use one fresh subagent per refactoring assignment. refactor-simple, refactor-deep, and refactor-apply are skill modes, not separate agent types. The parent orchestrates dispatch; a leaf instance cannot spawn helpers and returns to the parent at those gates. Reuse one apply instance for authorized edits and fixes, while independent reviews get fresh instances.

Each analysis runs as a separate fresh-context subagent (the available native subagent API and configured roles, one per analysis, launched together when capacity permits). Each subagent invokes its skill and returns the absolute path of the plan it wrote. Pass the skill, worktree, and parent model/effort and no-archive requirements, without another reviewer’s findings.

  • small: refactor-simple only.
  • large: refactor-simple and refactor-deep, concurrently.

For a comprehensive review or a large change needing specialist coverage, use the specialist lenses. Selected scoped deep reviews replace the broad deep pass rather than duplicate it; retain the simple pass. Run applicable lenses in waves within capacity, not an unconditional all-at-once fanout. Pass an explicit read-only scope override and distinct output path to each instance. No reviewer publishes or edits code.

Each writes its own file under ./tmp/, and reads only its own.

3. Merge once

Read every plan and produce one merged report at ./tmp/refactor-merged-[timestamp].md. Rules, in priority order:

  1. Cluster findings that point at the same file/area and the same underlying issue, even if worded differently.
  2. Keep the maximum severity. A finding that is Critical in one plan and Warning in another is Critical. A reproduced defect keeps its reproduction.
  3. Sole-source findings are kept. Corroboration is not required; the independent runs are expected to disagree, and the disagreement is signal.
  4. Tag every item with its source ([S], [D], named specialist lenses, or their combination), so the reader can see who found what.
  5. Carry each plan's quality score as reported, plus the merged Critical/Warning/Info counts. The merged report has no combined score.
  6. Pre-existing-not-against-this-PR items stay in Info, unchanged.

Keep every item's file:line, fix, and auto-fixable flag from its source plan. The merged report is the same shape as the individual plans, so refactor-apply reads it unchanged.

4. Stop for the user

Run cold-read on the merged report first: a person reads it to decide what to change in their code. The cold-read may reorder, retitle, and clarify; severities, findings, and file:line stay as written. Then show it, Criticals in full, Warnings and Info summarised, with the auto-fixable and manual counts, and stop. This is the gate: nothing is applied until the user says so. --plan-only ends here.

Auto-fixable items are the safe class; still show them. Manual items always wait for the user's judgment on each.

5. Apply, then prove it

On the user's go, invoke refactor-apply on the merged report, auto-fixable first, then manual with the user. refactor-apply leaves its edits uncommitted; this step commits them as one scoped commit named for the plan and the round, so the adversary has an exact diff. Every repair is committed the same way before its review.

Then run the adversarial loop as one continuous chain, and report when it ends. Three review passes is the cap.

  1. Pass 1 reviews the apply commit. A fresh subagent reads that commit's diff alone (git diff <sha>~1..<sha>), briefed to prove it broke something: every claim in the apply report is a claim to falsify; a behaviour-preserving change must have preserved behaviour; a consolidation must keep every edge case a caller relied on. A test that claims to fix a defect runs on the parent (must fail) and the head (must pass); characterization tests for behaviour-preserving changes may pass on both. It returns CLEAN, or REGRESSION with file:line and a repro.
  2. On REGRESSION, the applier repairs, then two reviewers look. The repro goes back to the apply session, which knows the code; the repair is committed with the repro as a test proven failing on its parent. Then, in the same message: the reviewer who found the finding gets the repair as a follow-up in its own session, to re-run its repro and say whether that finding is closed; and a fresh subagent reads the repair commit's diff alone, briefed to break the repair itself, since a repair that changed code can break an adjacent case the first reviewer was primed to look past. The follow-up settles the finding; the fresh pass is the numbered pass and counts toward the cap.
  3. Pass 3 is the last. Reaching it means each repair fixed the reported inputs and broke the next; the repair before pass 3 is spec-driven: the applier writes the input class as a test table, or replaces the mechanism with a pure derivation, and stops rather than commits when the correct fix needs scope beyond the files at hand. Whatever pass 3 finds goes to the user with the plan.

A CLEAN pass advances. At the cap, advance anyway: the survivors are reported as open Criticals beside the delta, and the user decides. Then re-run the analyses (step 2, fresh subagents) once and show the delta: what closed, what remains, anything new.

On the first real run, two apply commits passed every check and their own new tests, and the adversary found a reproduced regression in each; the repairs then broke adjacent cases twice, with tests that passed trivially. The adversary told to falsify caught all of it.

Rules

  • Steps 1-4 modify no tracked files. Only step 5 edits code, and only after the user's explicit go.
  • Analyses run in fresh subagents, blind to each other; a plan stays out of every other analysis.
  • Merge means cluster and keep the maximum severity.
  • If a subagent fails or returns no plan, say so and merge what exists.
  • The adversarial loop runs in one chain. Waiting on a human between rounds turns ten minutes of agent work into hours; report at the end.
  • The reviewer who found a finding verifies its repair, in its own session; a fresh reviewer hunts what the repair introduced. Two questions, two readers.

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

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

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

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

Этап рефакторинга после создания PR. Определяет масштаб diff относительно удалённой ветки по умолчанию, запускает refactor-simple (а при крупных изменениях — и refactor-deep) как новых субагентов, работающих независимо друг от друга, объединяет их планы по правилам максимальной критичности, показывает сводный отчёт и передаёт его в refactor-apply, только если пользователь попросит. Используйте после открытия PR или когда пользователь просит отрефакторить или привести ветку в порядок.

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

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

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

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

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

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

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

С любым количеством. В TypingMind вы можете использовать Refactor с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

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

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

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

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

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

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

Все
Логотип openclaw

Openclaw Refactor Docs

openclaw
ОрганизацияПопулярный

Переработайте существующую страницу документации OpenClaw: сохраните подтверждённую источниками информацию, измените структуру и проверьте результат.

82.2K
391K
Инструкции
Открыть
Логотип openclaw

Openclaw Repair Sweep

openclaw
ОрганизацияПопулярный

Проводите кампании по исправлению выбранных проблем и PR в OpenClaw: координируйте исполнителей, устанавливайте первопричины и вносите исправления или закрывайте проверенные задачи в пределах запрошенных полномочий.

82.2K
391K
Файлы: 1
Открыть
Логотип openclaw

Openclaw Test Performance

openclaw
ОрганизацияПопулярный

Сравнивайте производительность, диагностируйте проблемы и оптимизируйте время выполнения тестов OpenClaw и набора тестов плагинов, узкие места при импорте, загрузку CPU и RSS, рост кучи и медленные пути покрытия кода.

82.2K
391K
Файлы: 1
Открыть
Логотип openclaw

Openclaw Testing

openclaw
ОрганизацияПопулярный

Выбирайте подходящие по масштабу тесты и проверки OpenClaw, диагностируйте сбои и направляйте вопросы, зависящие от окружения, и подтверждение релиза ответственным за них специалистам.

82.2K
391K
Файлы: 2
Открыть

Создайте своё рабочее пространство с ИИ прямо сейчас

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