К основному содержанию
команда официальный · Anthropic

modernize — команда для Claude Code: что делает и как установить

Команда ведёт модернизацию старого кода: выясняет цель, фиксирует ограничения и задаёт первый шаг. Подходит для перехода на новую версию или технологию.

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin install code-modernization@claude-plugins-official
Открыть на GitHub

Что делает modernize

modernize открывает guided modernization в Claude Code. Команда определяет, где лежит система, кратко описывает найденный код, спрашивает о цели и ограничениях, а затем записывает ответы в analysis/$system/INTENT.md. Для исходников можно указать --source <path>.

После этого команда показывает порядок работы: preflight, assess, map, extract-rules, review, brief, затем один из путей uplift, transform или reimagine, а в конце verify и harden. Для режима «понять систему» процесс останавливается после brief. Если выбран headless run, ответы берутся по умолчанию и сохраняются как открытые пункты.

Команда использует AskUserQuestion и допускает до двух коротких этапов вопросов. Это повод проверить сценарий заранее: без этого инструмента запуск выбирает значения по умолчанию, а не спрашивает человека.

Какие задачи решает

  • найти исходный код старой системы
  • зафиксировать цель перехода и ограничения
  • составить порядок этапов модернизации
  • записать решения в INTENT.md
  • запустить первый шаг с готовыми аргументами

Примеры запросов агенту

  • Запусти /code-modernization:modernize billing --source /work/billing и начни модернизацию.
  • Помоги перенести систему на новую версию Java, сохранив поведение и работу старой системы.
  • Сначала разберись, что делает код в legacy/billing, а затем подготовь план следующих шагов.

Как установить modernize

1Через маркетплейс плагинов

/plugin install code-modernization@claude-plugins-official

2Вручную: положить файлы

.claude/commands/modernize.md

Вызов — /modernize. Для всех проектов — ~/.claude/commands/

Из того же набора123

Весь набор →
conversation-analyzer Субагент находит в истории диалога ошибки Claude Code и раздражение пользователя, чтобы превратить проблемные действия в блокирующие или предупреждающие хуки. ★ 44 635звёзд репо maker-setup Команда подключает Cardputer-Adv к рабочему процессу Code-with-Claude: скачивает репозиторий, прошивает устройство и ставит приложения Claude Buddy. ★ 44 635звёзд репо commit-push-pr Автоматически переключает ветку с main, делает коммит изменений, отправляет их на origin и оформляет pull request через GitHub CLI. ★ 44 635звёзд репо clean_gone Находит локальные Git-ветки со статусом [gone], удаляет связанные worktree и сами ветки. Пригодится после удаления веток на удалённом репозитории. ★ 44 635звёзд репо modernize-uplift Обновляет проект на новую версию рантайма в том же стеке без переписывания логики. Проверяет поведение через параллельный прогон тестов. ★ 44 635звёзд репо modernize-review modernize-review опрашивает человека по спорным бизнес-правилам legacy-системы и сохраняет вердикты в JSON. Это нужно, чтобы планы миграции опирались на реальные требования бизнеса. ★ 44 635звёзд репо modernize-reimagine Слэш-команда плагина code-modernization: пересобирает легаси-систему на новой архитектуре по извлечённым требованиям, с двумя точками согласования. ★ 44 635звёзд репо modernize-map Строит интерактивную карту зависимостей, потоков данных и точек входа устаревшей системы. Помогает изучить связи между модулями перед рефакторингом или модернизацией. ★ 44 635звёзд репо

Похожие

golang-modernize samber Скилл обновляет Go-код до актуальных идиом языка, стандартной библиотеки и инструментов. Пригодится при ревью старых паттернов, апгрейде версии Go или обновлении CI. CX Codex +1 40 300установок documenting-legacy-codebases riekelt Скилл восстанавливает документацию по коду, когда старые доки устарели или врут. Сначала инвентаризация системы, потом текст. CX Codex +1 17 900установок working-with-legacy-code wondelai Скилл для работы с кодом без тестов: помогает поставить классы под тесты, зафиксировать текущее поведение и менять код шаг за шагом. CX Codex +1 3 300установок remove-technical-debt wondelai Пошагово устраняет технический долг в старом коде без полного переписывания. Помогает безопасно менять запутанную кодовую базу, создавая тесты и фиксируя план в папке docs/. CX Codex +1 2 300установок doc-and-modernize официальный github Анализирует локальный репозиторий, собирает архитектурный документ со ссылками на файлы и формирует пошаговый план миграции устаревшего стека. 108установок spec-miner https://github.com/Jeffallan Скилл для реверс-инжиниринга кодовых баз. Извлекает спецификации из существующего кода, строит схемы зависимостей и создаёт документацию для наследованных проектов и систем без документов. CX Codex +1 4 400установок

Рядом в теме «Настройка агента: память, контекст, субагенты»

Все слэш-команды по теме «Настройка агента: память, контекст, субагенты» →

Вопросы о modernize

Как установить modernize в Claude Code?

Выполните /plugin install code-modernization@claude-plugins-official и добавьте файл команды по пути .claude/commands/modernize.md.

Что делает modernize?

Команда находит исходники, выясняет цель модернизации, записывает намерение в analysis/$system/INTENT.md и показывает последовательность следующих команд.

Что произойдёт при headless run?

Вопросы через AskUserQuestion не показываются: команда выбирает значения по умолчанию, записывает их как открытые пункты и продолжает с точной следующей командой.

Исходный текст

modernize.md · Apache-2.0
---
description: Start here — say what you want done with your code and get the plan and the first step
argument-hint: [system] [--source <path>]
arguments: system
---

You are the front door of a guided modernization. The person may know nothing about modernization: ask
little, explain in plain words, and always end on one exact command to run next.

## 1 — Find where things stand

- If `$system` was given, use it. Otherwise look at `analysis/` and `legacy/`: one system means use it, several means
  ask which (pop-up), none means ask where the code is (step 2).
- If `analysis/$system/` already has files, this is a return visit: do what
  `/code-modernization:modernize-status $system` does (where they are, what is stale) in five lines, and end on the exact
  next command. Stop there.

## 2 — Find the code

The code is `legacy/$system` (a copy, or a symlink to where it really lives). If it is not there yet, ask where it is
(this folder, another folder, or a git URL: clone into `legacy/<name>` after they agree). If `$ARGUMENTS` has
`--source <path>`, use that path. Pick a short name for it (letters, digits, `-` and `_`) if none was given. Say in one
line what you found there (languages and rough size: `scc` or a quick file count is enough).

## 3 — Ask what they want (two short pop-ups at most)

Use the AskUserQuestion tool, never chat text; without it (a headless run) pick the defaults and record them as open
items. A pop-up allows at most four options per question, and the person can always type their own answer.

**Pop-up 1, two questions:**

1. **What do you want to do with it?** *Move to a newer version of the same technology* (for example .NET Framework to
   .NET 8, Java 8 to 17, Python 2 to 3), *Rewrite it in a different technology, one piece at a time, while the old system
   keeps running*, *Rebuild it from scratch on a new architecture*, *Understand it first: map it and list what it does*
   (also the right choice when they are not sure: the assessment then recommends one of the other three).
2. **What must stay true?** Pick any: *The old system keeps running during the move*, *Behavior must match exactly,
   including known quirks*, *Fix known bugs as we go*, *A security review comes first*. Choosing none means nothing
   special.

**Pop-up 2, one question, only after the first answer and never for "understand it first":** *What should it become?*
Tailor it to what you found in step 2: for a version move, the newest supported versions of the code's stack ("Java
21", "Java 17"); for a rewrite, two or three common target technologies for this kind of code; for a rebuild, the
architecture options that fit (a REST API with a separate front end, a few services, a modular monolith). The person
can type any other target.

## 4 — Write it down once

Write `analysis/$system/INTENT.md`: the goal (uplift, transform, reimagine or understand), from and to (or the target
and vision), what must stay true, and today's date, with their answers word for word. Later commands read it so nobody
is asked twice: `brief` takes its target stack from it and never overrides it with a guess.

## 5 — Show the road

In at most eight lines, tailored to their goal, list the commands they will run in order (`preflight`, `assess`, `map`,
`extract-rules`, `review` when rules are flagged for a person, `brief`, then `uplift`, `transform` or `reimagine`, then `verify` and `harden`), one line each on what they get
and where a person decides. For "understand it first" stop after `brief`. For "not sure", run `preflight` and `assess`
first and let the assessment's recommended pattern pick the road. Name the places a person decides (the preflight answers, the rules that look wrong, approving the brief, accepting each difference the proof finds, signing the proof, applying the security patch) so nothing surprises them. If they chose *A security review comes first*, put `harden` right after `assess`, before any build.

## 6 — First step

Give the exact command with everything filled in, for example
`/code-modernization:modernize-preflight billing "Java 17" --source /work/billing`, and ask "Shall I start it?". On yes, or in a
headless run, read `${CLAUDE_PLUGIN_ROOT}/commands/modernize-preflight.md` and carry it out with those arguments as if they had
typed it. After it finishes, name the next command.

© Anthropic · Apache-2.0 · anthropics/claude-plugins-official

Смотрите также

Спонсоры проекта

Компании, которые помогают держать аналитику открытой