Skip to content

feat: edit_plan — multi-file edit planning#39

Merged
kienbui1995 merged 1 commit intomainfrom
feat/edit-plan
Apr 12, 2026
Merged

feat: edit_plan — multi-file edit planning#39
kienbui1995 merged 1 commit intomainfrom
feat/edit-plan

Conversation

@kienbui1995
Copy link
Copy Markdown
Owner

@kienbui1995 kienbui1995 commented Apr 12, 2026

Multi-file edit planning tool. Agent presents plan before executing changes to 2+ files. 192 tests pass.

Summary by CodeRabbit

New Features

  • Added codebase_search tool to search symbols and files by keyword before reading
  • Added edit_plan tool to present multi-file edit plans for review before applying changes across multiple files
  • Enhanced system prompt with usage guidelines for improved code editing workflows

New tool: edit_plan
- Agent presents structured plan before modifying multiple files
- Shows: title, file list, action (create/edit/delete), description per step
- Runs sequentially so user sees plan before agent continues
- Agent then executes each step with edit_file/write_file/batch_edit

System prompt updated:
- Documents edit_plan, codebase_search tools
- Instructs agent to plan before multi-file changes

192 tests pass.
@kienbui1995 kienbui1995 merged commit 510f409 into main Apr 12, 2026
3 of 4 checks passed
@kienbui1995 kienbui1995 deleted the feat/edit-plan branch April 12, 2026 15:03
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 43eddc3a-fae7-4101-9c3e-599ce9ece285

📥 Commits

Reviewing files that changed from the base of the PR and between 91a5b7b and 8d6dda2.

📒 Files selected for processing (4)
  • mc/crates/mc-cli/src/main.rs
  • mc/crates/mc-core/src/runtime.rs
  • mc/crates/mc-tools/src/registry.rs
  • mc/crates/mc-tools/src/spec.rs

📝 Walkthrough

Walkthrough

A new edit_plan tool is introduced across the codebase to enable multi-file edit planning. The tool is integrated into the system prompt, tool registry, runtime dispatch logic, and tool specifications with JSON-based schema for structured edit steps.

Changes

Cohort / File(s) Summary
System Prompt & CLI
mc/crates/mc-cli/src/main.rs
Extended build_system_prompt with two new tool definitions: codebase_search (for pre-read symbol/file lookup) and edit_plan (for multi-file change planning), along with corresponding usage guidelines.
Tool Runtime Dispatch
mc/crates/mc-core/src/runtime.rs
Classified edit_plan as a sequential tool; added dispatch handler that parses JSON input expecting a steps array (with optional title), formats and returns a plan summary with confirmation prompt, or returns error if steps is missing/invalid.
Tool Specification & Registry
mc/crates/mc-tools/src/spec.rs, mc/crates/mc-tools/src/registry.rs
Added new edit_plan tool specification with JSON schema requiring title (optional) and steps array (each step with required file, action enum, and description); updated registry test assertion to expect 28 tools (increased from 27).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through code so bright,
With plans to edit left and right!
Now steps align with file and deed,
Multi-tool changes, all we need!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/edit-plan

Comment @coderabbitai help to get the list of available commands and usage tips.

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