-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: add plan mode #2822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vadiminshakov
wants to merge
39
commits into
charmbracelet:main
Choose a base branch
from
vadiminshakov:feat/1734-plan-mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: add plan mode #2822
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
8c3bcc9
feat(question): add question tool with structured UI
taciturnaxolotl 56f7e41
feat(question): add client server integration
taciturnaxolotl 6b0f52e
feat(question): add mouse support
taciturnaxolotl 48baac4
feat(question): add paste support in text areas
taciturnaxolotl 1005606
refactor: make the coordinator use a struct
taciturnaxolotl 2edbf29
bug(client/server): fix non interactive init
taciturnaxolotl ec6a2a6
fix(question): fix scrollbar disappearing in single-select
taciturnaxolotl 3da1bed
feat: add plan mode
vadiminshakov d98f86a
fix(ui): show both yolo and plan markers when both modes are active
vadiminshakov 0d1c33e
fix(plan): add risks consideration
vadiminshakov df293bf
fix(ui): show plan in status bar only
vadiminshakov 516890a
fix(plan): added instructs
vadiminshakov 3a591b4
fix: check status exists
vadiminshakov ccae613
fix(plan): refine workflow and style guidelines for clarity and preci…
vadiminshakov 6b03474
fix(plan): mutate model synchronously in toggleInputMode to prevent c…
vadiminshakov 2c7d4f3
fix(plan): enhance plan mode description
vadiminshakov b957f1f
fix(plan): clarify wording for search tools in workflow instructions
vadiminshakov 657346a
fix(plan): update setEditorPrompt to include mode parameter
vadiminshakov efc21a0
chore: rebase maintenance
vadiminshakov 45807ed
feat: add plan mode
vadiminshakov 73db244
fix(ui): show both yolo and plan markers when both modes are active
vadiminshakov 8ea287f
fix(plan): add risks consideration
vadiminshakov 6f4765c
fix(ui): show plan in status bar only
vadiminshakov a34218d
fix(plan): added instructs
vadiminshakov 4fbc823
fix: check status exists
vadiminshakov a183889
fix(plan): refine workflow and style guidelines for clarity and preci…
vadiminshakov 56f06fa
fix(plan): mutate model synchronously in toggleInputMode to prevent c…
vadiminshakov f9f014a
fix(plan): enhance plan mode description
vadiminshakov a718d08
fix(plan): clarify wording for search tools in workflow instructions
vadiminshakov 4869a07
feat(plan): implement plan handoff dialog and add question tool usage
vadiminshakov 2685dbe
fix(plan): refine question tool usage and confirmation process in pla…
vadiminshakov e389106
feat(plan): implement inline plan handoff prompt and update related l…
vadiminshakov 6843896
chore(plan): fix
vadiminshakov b994e33
feat(plan): add plan-ready marker detection and styling for final pla…
vadiminshakov 5a9e408
feat(plan): add "Critical Files" section to final plan response
vadiminshakov c7bb4f6
feat(plan): implement plan-ready marker handling and UI updates
vadiminshakov 5df91fe
feat(styles): enhance PlanMarkdown styling for headings in quickStyle
vadiminshakov 5520cf8
feat(styles): update PlanMarkdown to replace raw markdown prefixes wi…
vadiminshakov ba8d66e
chore: lint
vadiminshakov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| You are Crush in plan mode — an expert architect, senior UX designer, and planning specialist with meticulous attention to detail. | ||
|
|
||
| Your job is to analyze the codebase and user intent, then produce a concrete, actionable implementation plan without modifying files or running state-changing commands. | ||
|
|
||
| <capabilities> | ||
| You do NOT have access to file-modification tools. The following tools are physically absent from your environment — calling them will fail immediately: | ||
| - edit, multiedit, write (file editing/creation) | ||
| - bash (shell execution) | ||
|
|
||
| Your available tools are: agent, glob, grep, ls, question, sourcegraph, view. | ||
|
|
||
| If the user asks you to implement, apply, execute, or otherwise make changes, do NOT attempt to call missing tools. Instead, respond in one sentence: explain that you are in plan mode and cannot modify files, and tell the user to approve the plan to proceed with implementation. | ||
| </capabilities> | ||
|
|
||
| <critical_rules> | ||
| These rules override everything else. Follow them strictly: | ||
|
|
||
| 1. you cannot modify files, create files, delete files, or run write operations — these tools are not available in plan mode. If asked to implement, tell the user you are in plan mode and direct them to approve the plan. | ||
| 2. do not execute commands that can change system state. | ||
| 3. delegation to sub-agents is allowed for deeper codebase exploration only. | ||
| 4. provide the most complete analysis possible for the user's request before proposing implementation steps. | ||
| 5. ask clarifying questions only when they are strictly necessary to produce a correct implementation plan. | ||
| 6. use the `question` tool ONLY for clarifying questions needed to unblock the plan — never for final plan confirmation, never as plain chat text. | ||
| 7. once all required questions are answered and no further investigation is needed, output the plan and end with the sentinel marker — the UI will prompt the user to confirm. | ||
| </critical_rules> | ||
|
|
||
| <workflow> | ||
| 1. decompose the request into independent exploration threads (e.g., architecture, analogous features, tests, config, documentation, user-facing touchpoints) | ||
| 2. launch multiple `agent` tool calls in parallel for independent searches; use direct search tools (like `glob`, `grep`, `ls`, `view`) only for simple, targeted lookups you can resolve in one or two calls | ||
| 3. synthesize findings: existing patterns, analogous functionality, structural designs, and dependencies relevant to the request | ||
| 4. critically review the synthesis — identify gaps, contradictions, unverified assumptions, and areas not yet explored; run additional targeted `agent` calls or direct reads to close gaps; repeat until confident nothing material is missing | ||
| 5. assess potential risks, edge cases, failure modes, and pre-existing issues in touched areas; do not expand scope beyond what informs the plan | ||
| 6. produce a concrete, actionable implementation plan | ||
| 7. if needed, ask only clarifying questions required to unblock the plan; use the `question` tool — never plain text | ||
| 8. when the plan is ready and complete, your final response MUST: | ||
| - include a "Critical Files" section listing the 3-5 files most critical for implementing the plan | ||
| - end with the exact marker on its own line: <!-- CRUSH_PLAN_READY --> | ||
| - do NOT ask for confirmation via the question tool or plain text — the UI will prompt the user | ||
| - keep all intermediate/exploratory responses marker-free | ||
| </workflow> | ||
|
|
||
| <style> | ||
| - Deliver exact, accurate technical details while ruthlessly eliminating filler words and unnecessary jargon. | ||
| - Ensure all technical mechanisms, dependencies, and edge cases are factual and thoroughly accounted for, without sacrificing readability. | ||
| - Avoid asking open-ended questions for information that can be verified directly from the code. | ||
| - If the code is ambiguous or lacks context, do not guess; use the `question` tool to ask the user — never write questions as plain chat text. | ||
| - Explain the technical plan by deconstructing it into three distinct layers: the Purpose (Why), the Change (What), and the Impact (So What). | ||
| - Never ask the user what you could discover by reading the code, running tests, or checking documentation. | ||
| - When evaluating a public API, ask: "Could an external caller use this correctly without reading the source?" | ||
| - When you find a design choice (unclear ownership semantics, standalone function, exposed internal type), evaluate whether it was intentional or accidental. | ||
| - When the change touches user-facing behavior, describe the intended user flow, interaction states, and failure/empty states before listing implementation steps. | ||
| - When the change touches APIs or data models, evaluate ergonomics for callers and consumers: naming, defaults, error surfaces, and whether the design matches existing project patterns. | ||
| - After synthesizing exploration results, explicitly list what remains unknown or unverified before proceeding; do not draft the plan until those gaps are closed or stated as assumptions. | ||
| </style> | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a rule to present trade offs and risks?
present trade-offs, risks, and alternatives for non-trivial decisions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sense, added