Skip to content

docs: add agent-executable v1→v2 migration guide#116

Merged
YusukeHirao merged 3 commits into
devfrom
docs/v1-to-v2-migration-guide
Jun 12, 2026
Merged

docs: add agent-executable v1→v2 migration guide#116
YusukeHirao merged 3 commits into
devfrom
docs/v1-to-v2-migration-guide

Conversation

@YusukeHirao

Copy link
Copy Markdown
Member

Summary

MIGRATION.md を新規追加。v1 から v2.x(現状 alpha 系列で累積された breaking change)への移行を、AI エージェントがそのまま実行できる「mechanical recipe」として整理。

Structure

AI SDK 5 の migration guide の構造を参考に、エージェント実行に最適化:

  • 各セクションは独立した変換 (top-to-bottom で適用、Before パターンが無いセクションは skip 可)
  • Before/After は diff ブロックで隣接、間に散文を挟まない
  • 削除は必ず代替を併記
  • find/replace ヒントを明示
  • 末尾に planner 用チェックリスト とアシスタント verification コマンドを配置

Coverage (15 セクション)

  1. パッケージバージョン bump
  2. Compiler 定数 → curried factory (pageCompilercreatePageCompiler())
  3. `Config.compilers` array → callback `(def) => [...]`
  4. `createCompileHooks` の curry 化
  5. `afterSerialize`/`beforeSerialize` → `manipulateDOM` transform
  6. DOM 型: lib.dom → linkedom (`DomElement`/`DomWindow`/`ManipulateDOMHookContext`)
  7. `manipulateDOM({ host })` / `domSerialize({ url })` 削除 → `ctx.getHref`/`ctx.baseURL`
  8. Generic `` の伝播
  9. `kamado/features` モジュール削除
  10. `filter` 系のリネーム + 戻り値 `NavNode` → `boolean`
  11. Prettier `parseError` → pipeline-level `formatOptions.parseError`
  12. `kamado/files` の re-export 形状変更
  13. 追加 API (移行不要): `defineConfig`, `outputPathField`, `outputPathConflict`, `devServer.proxy`, `--incremental`, `--skip-unchanged`, `ctx.getHref`
  14. Verification コマンド
  15. Rollback 手順

Test plan

  • `yarn lint` (prettier / textlint / cspell) クリーン
  • サードパーティ AI エージェント (Claude Code / Cursor / Aider 等) に `MIGRATION.md` を渡して v1 サンプル config を実際に変換させる動作確認 (post-merge で実機検証推奨)
  • v1 サンプルの `kamado.config.ts` に適用して `yarn build` 成功確認 (実プロジェクト側で実施)

Notes

  • v2 リリース時にはこの guide を README から先頭でリンクする想定
  • `MIGRATION.ja.md` の日本語版は需要があれば別 PR で追加
  • v2 の alpha バージョン番号は `alpha.17` を仮置き — 実 release 時に最新タグへ書き換えが必要 (README の `bump package versions` セクションに注記済み)

🤖 Generated with Claude Code

MIGRATION.md walks an AI agent (or a careful human) through every
breaking change accumulated in v2.x — currently spread across
`v2.0.0-alpha.0` to `v2.0.0-alpha.17` — as a top-to-bottom sequence
of self-contained transformations.

Structure follows the AI SDK 5 migration-guide conventions: each
section labels the breaking change, shows before/after blocks with no
intervening prose, and gives explicit find/replace targets. Removals
always pair with an alternative. A final checklist gives an agent's
planner a concrete TODO sequence.

Sections cover compiler-constant → curried factory, `compilers:` array
→ callback, `createCompileHooks` curry, `afterSerialize`/`beforeSerialize`
→ `manipulateDOM` transform, lib.dom → linkedom DOM types,
removed `host`/`url` options, generic `<M extends MetaData>`,
removed `kamado/features` module, the `filter` family of renames,
`PrettierOptions.parseError` → pipeline `formatOptions.parseError`,
`kamado/files` re-export shape, additive features that need no
migration, verification commands, and rollback notes.
@YusukeHirao YusukeHirao requested a review from yusasa16 as a code owner June 12, 2026 07:08
… MIGRATION.md

Every section that introduces a non-obvious shape change now carries a
short "Why" paragraph: an agent following the recipe top-to-bottom no
longer has to guess whether `createPageCompiler()(opts)` is a typo, why
the v1 DOM hook slots disappeared, or why URL resolution moved into a
helper. The intent is to head off "is this really right?" questions
mid-migration without inflating the recipe with prose.

Sections touched: 2 (curry rationale + future-unwind note), 4 (cross-
reference to 2), 5 (composable transform pipeline), 6 (linkedom
benchmarks + spec-noncompliance caveat), 7 (URL reflection trade-off
and security side effect), 8 (curry-vs-generic linkage), 9 (already-
deprecated module finally removed), 10 (filter ambiguity, mutation
separated from filtering), 11 (uniform per-transform error policy).
The guide is the document v1 users will read once v2.0.0 ships, so
internal sequencing — which alpha number introduced what, "pin
because alpha", `npm view dist-tags` discovery — is noise. Simplify
section 1 to a `^2.0.0` range and remove the alpha caveat at the top
and the "(alpha.16)" tag from section 11.
@YusukeHirao YusukeHirao merged commit 54a4d05 into dev Jun 12, 2026
1 check passed
@YusukeHirao YusukeHirao deleted the docs/v1-to-v2-migration-guide branch June 12, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant