feat: v2.4.4 Phase 1 — add --apply-plan for merge-plan.json dry-run#14
Merged
Conversation
Add `--apply-plan <path>` CLI flag that reads a merge-plan.json (generated by --merge-twice --execute) and outputs a dry-run summary of merge/skip/ignore counts without modifying any files. Why phased: - Phase 1: schema validation + dry-run summary only (this PR) - Phase 2 (v2.4.5+): actual merge logic with file append/delete/commit This locks the JSON schema and validation so Phase 2 can build safely on top without re-architecting validation/parsing. Changes: - skill-loop.js: +doApplyPlan / +validatePlanSchema / +--apply-plan parser - README.md / README.ja.md: +v2.4.4 Phase 1 section with usage examples - test/skill-loop.test.mjs: +9 tests for --apply-plan, +Nit-1 (T14 length assert), +Nit-2 (--json --execute --jaccard-min 3-flag combo) - test/fixtures/: +3 sample-plan-*.json fixtures - package.json: version 2.4.3 -> 2.4.4 Validation rejects 'TBD' as action (forces manual review). exit 1 on missing fields, invalid JSON, or file not found. Tests: 107/107 PASS (existing 95 + new 12) Refs: feature/v2.4.4-phase1-apply-plan Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v2.4.4 Phase 1 として
--apply-plan <path>フラグを追加。--merge-twice --executeが生成したmerge-plan.jsonを読み取り、各 candidate のaction('merge' / 'skip' / 'ignore') を集計して dry-run サマリを出力する。ファイル変更は一切しない。なぜ段階導入か
Phase 1 で JSON スキーマとバリデーションを確定させることで、Phase 2 で実マージロジックを安全に積み上げる。破壊操作 CLI の段階導入パターン(第210回 dev-lessons 教訓 `[cli-design][destructive-ops][lesson-skill-loop]`)に従う。
変更内容
バリデーション規則
Test Plan
Refs
🤖 Generated with Claude Code