legacy-plan
Use when running Step 3 of legacy refactoring protocol — generates PLAN.md for module migration. Two phases — skeleton (3 sections only) and finalize (full plan from green tests). Triggers on '/legacy-plan <module> --phase=skeleton', '/legacy-plan <module> --phase=finalize', or when user asks to 'написати скелет плану', 'дописати план з тестів'.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 15
- Forks
- 13
01 前言 Front Matter
- name
- legacy-plan
- description
- Use when running Step 3 of legacy refactoring protocol — generates PLAN.md for module migration. Two phases — skeleton (3 sections only) and finalize (full plan from green tests). Triggers on '/legacy-plan <module> --phase=skeleton', '/legacy-plan <module> --phase=finalize', or when user asks to 'написати скелет плану', 'дописати план з тестів'.
- allowed-tools
- Read, Write, Bash
- argument-hint
- <module-name> --phase=skeleton|finalize
- disable-model-invocation
- false
03 SKILL.md 正文
legacy-plan — Step 3.1 (skeleton) і 3.3 (finalize)
Один skill з двома фазами. Між ними — /legacy-tests (окремий skill). Skeleton має тільки те, що Step 3 знає до тестів. Finalize заповнюється з зелених тестів, не зі здогадок.
Аргументи
<module-name>— імʼя нового модуля--phase=skeleton— фаза 3.1 (5-10 хв у Plan mode)--phase=finalize— фаза 3.3 (після зелених тестів)
Phase 1: skeleton
Inputs
SPIKE.md(з Step 1)LEGACY/<module>.md(з Step 2.1)CRITIC.md(з Step 2.2)
Output: PLAN.md з 3 заповненими + 3 порожніми секціями
# PLAN — <module-name>
## 1. Чому цей модуль ✅ (з SPIKE.md)
- module: <module-name>
- критерії: churn=<X>, debt=<Y>, isolation=<Z>, spike verdict=<YES/RISKY>
- скільки часу: <1-2 тижні>
## 2. Що будуємо ✅
internal/<module-name>/
├── domain/ <list of entities + sentinel errors>
├── app/ <list of UseCases>
├── infra/ <list of Adapters>
└── ports/ handler.py · dto.py · errors.py
Public interface (без змін, з LEGACY/<module>.md секція 1):
- <signature>
- <signature>
## 3. Що НЕ чіпаємо у цьому циклі ✅ (з CRITIC.md "невизначені" + LEGACY секція 5)
- <item> — причина: <hypothesis>, окремий цикл
- <item> — причина: <hypothesis>
## 4. Поведінка яку зберігаємо
TBD — заповнюється у --phase=finalize з зелених тестів
## 5. Шматки міграції
TBD — заповнюється у --phase=finalize з блоків параметризованих тестів
## 6. Відкат
TBD — заповнюється у --phase=finalize
Phase 2: finalize
Inputs
PLAN.mdskeleton (з Phase 1)tests/<module>/{contract,characterization,architecture}/(з/legacy-tests)- Результат
pytest tests/<module>(має бути зелений)
Output: PLAN.md повний
Доповнює секції 4-6:
## 4. Поведінка яку зберігаємо ✅ (з зелених тестів)
- 1 параметризований кейс = 1 пункт
- ...
## 5. Шматки міграції ✅
- [ ] Register · 1 коміт · domain.User + RegisterUseCase + UsersRepo.Insert + EmailSender.SendWelcome
- [ ] VerifyEmail · 1 коміт · ...
- [ ] ResetPassword · 1 коміт · ...
(або інша стратегія chunking — див. лекцію 4.9 секція Step 4)
## 6. Відкат ✅
- Register cutover зламається → `git revert <hash>` + один рядок у server.py
- VerifyEmail зламається → теж
- ResetPassword зламається → теж
Acceptance criteria
Skeleton
- 3 заповнені + 3 порожні секції
- Секція 3 («Що не чіпаємо») має ≥2 пункти з причиною
- Секція 2 має повний public interface
Finalize
- Усі 6 секцій заповнені
- «Поведінка» = 1-в-1 з зелених тестів (кожен parametrize-кейс окремий пункт)
- «Шматки міграції» — checklist
- [ ]для кожного use case - pytest зелений перед finalize (skill попереджає, якщо ні)
Examples
/legacy-plan account --phase=skeleton
/legacy-tests account
pytest tests/account/
/legacy-plan account --phase=finalize
Anti-patterns
- Не заповнюй «Поведінка» зі здогадок — тільки з зелених тестів. Помилка тут стає silent — рефакторинг проходить, але «зберігає» поведінку, якої немає.
- Не пропускай skeleton перед тестами — без скелета тести генеруються «на все», розпухають у 50+ кейсів і втрачають фокус.
- Не міксуй «Що не чіпаємо» зі справжніми bugs — bugs у «Що не чіпаємо» з позначкою
known bug, fix after cutover. Не «правь план щоб виглядав красивіше за тести».
04 同仓库更多 Skills
release
Run the whole local release pipeline in order, stopping at each human gate. Triggers on "run the release", "prepare a release", "/release", "зроби реліз", "підготуй реліз". Drives the four stages back to back — bump-version → curate-changelog → release-notes → check-docs-drift — pausing after each so the human reviews the diff before the next stage. Prepares everything in the working tree; never tags, commits, or pushes. The tag push (which fires CI) stays the human's action.
release-notes
Draft partner-facing release notes from the same commits as the changelog. Triggers on "draft release notes", "release notes for the next version", "/release-notes", "нотатки релізу", "release notes партнеру". Same input as curate-changelog, different audience and tone: a short, benefit-first narrative for a user or partner — "what's new for you" — not a categorized engineer's list. Keeps only changes a user actually notices; drops internal refactors and tooling. Prints the notes to the chat to seed a GitHub Release description or a partner announcement. Writes no file.
curate-changelog
Curate the [Unreleased] section of docs/CHANGELOG.md from git history. Triggers on "curate the changelog", "update the changelog", "/curate-changelog", "онови changelog", "курування журналу". Reads git log since the last tag, FILTERS out what a reader never feels (test/ci/chore/merge), GROUPS commits about one feature into one bullet, and REWRITES technical subjects into plain language under the six Keep a Changelog categories (Added/Changed/Deprecated/ Removed/Fixed/Security). The result must have FEWER lines than the raw log — that is the proof of curation, not a dump. Leaves the edit in the working tree; never commits or pushes.
codify-rule
Turn a repeated mistake into a durable, path-scoped rule in .claude/rules/. Triggers on "codify this rule", "make a rule so this doesn't happen again", "/codify-rule", "закодифікуй правило", "петля помилка-правило". Use only when the same mistake showed up TWICE (twice = a pattern, once = noise). Names the wrong shape and the right shape with one short example of each, scopes the rule to the paths that matter, and leaves the edit in the working tree so the next agent on this repo inherits the fix. Edits only .claude/rules/; never commits or pushes.
check-docs-drift
Find and fix where docs/api.md fell behind the code. Triggers on "check for doc drift", "is the API doc up to date", "/check-docs-drift", "перевір дрейф документації", "docs drift". Runs the deterministic scripts/check-docs-drift.py (parses the public NoteBook methods with ast, compares to what docs/api.md documents — NO LLM finds the gap), reports the drift, and PROPOSES the doc edit that closes it. The gap is found by parsing; the agent writes the missing documentation in the doc's existing style. Edits only docs/; never commits or pushes.
bump-version
Decide and apply the next semver for a release. Triggers on "bump the version", "what version is next", "/bump-version", "простав версію", "яка наступна версія". Reads the next number from the deterministic scripts/next-version.sh (NEVER guesses it), explains in plain language WHICH part moved and why (e.g. "MINOR, because a feat landed: filter notes by tag"), edits the version line in pyproject.toml, and proposes the matching `git tag vX.Y.Z`. The number is decided by a rule; the agent explains and applies — the human confirms the tag. Never pushes a tag itself.