From 93d9df95532476c5bfb2caead6e62dd97628f3bf Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 30 Jun 2025 17:58:28 +0000 Subject: [PATCH] Revert default mode to "code" and add first-time user mode logic Co-authored-by: matt --- default-mode-change-summary.md | 52 ------------------------------- src/core/webview/ClineProvider.ts | 8 +++-- src/shared/modes.ts | 2 +- 3 files changed, 6 insertions(+), 56 deletions(-) delete mode 100644 default-mode-change-summary.md diff --git a/default-mode-change-summary.md b/default-mode-change-summary.md deleted file mode 100644 index 2e4284057d..0000000000 --- a/default-mode-change-summary.md +++ /dev/null @@ -1,52 +0,0 @@ -# Default Mode Change Summary - -## Request - -Change the default mode from "Code" to "Architect" for new users installing the app for the first time. - -## Current Status: ✅ COMPLETED - -The change has already been successfully implemented in the codebase. - -## Implementation Details - -### Key File: `src/shared/modes.ts` - -- **Line 124**: `export const defaultModeSlug = "architect"` -- This setting controls the default mode for new users - -### Available Modes - -The system supports the following modes (in order): - -1. **code** - 💻 Code: Write, modify, and refactor code -2. **architect** - 🏗️ Architect: Plan and design before implementation (**DEFAULT**) -3. **ask** - ❓ Ask: Get answers and explanations -4. **debug** - 🪲 Debug: Diagnose and fix software issues -5. **orchestrator** - 🪃 Orchestrator: Coordinate tasks across multiple modes - -### Architect Mode Configuration - -- **Role**: Experienced technical leader who is inquisitive and an excellent planner -- **Purpose**: Gather information and create detailed plans for accomplishing tasks -- **Tools**: Read files, edit markdown files only, browser access, MCP tools -- **Workflow**: Information gathering → Planning → User approval → Implementation in other modes - -## Verification - -- ✅ `defaultModeSlug` is set to "architect" in `src/shared/modes.ts` -- ✅ "architect" is a valid mode slug in the modes array -- ✅ All references to `defaultModeSlug` throughout the codebase will use "architect" -- ✅ Build completes successfully with no errors -- ✅ Test mocks are isolated and don't affect the actual default behavior - -## Impact - -New users installing the app will now start in **Architect mode** instead of Code mode, encouraging them to: - -1. Gather context about their tasks -2. Ask clarifying questions -3. Create detailed implementation plans -4. Get user approval before switching to implementation modes - -This change promotes better planning and reduces the likelihood of rushing into implementation without proper understanding of requirements. diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 51cb9a275b..bddd229139 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -1418,8 +1418,10 @@ export class ClineProvider const mergedAllowedCommands = this.mergeAllowedCommands(allowedCommands) const cwd = this.cwd - // Check if there's a system prompt override for the current mode - const currentMode = mode ?? defaultModeSlug + // Determine the appropriate mode: for first-time users (who haven't opened mode selector), + // default to "architect" mode, otherwise use the stored mode or fallback to defaultModeSlug + const hasOpenedModeSelector = this.getGlobalState("hasOpenedModeSelector") ?? false + const currentMode = mode ?? (hasOpenedModeSelector ? defaultModeSlug : "architect") const hasSystemPromptOverride = await this.hasFileBasedSystemPromptOverride(currentMode) return { @@ -1479,7 +1481,7 @@ export class ClineProvider currentApiConfigName: currentApiConfigName ?? "default", listApiConfigMeta: listApiConfigMeta ?? [], pinnedApiConfigs: pinnedApiConfigs ?? {}, - mode: mode ?? defaultModeSlug, + mode: currentMode, customModePrompts: customModePrompts ?? {}, customSupportPrompts: customSupportPrompts ?? {}, enhancementApiConfigId, diff --git a/src/shared/modes.ts b/src/shared/modes.ts index 897d09d4db..a672a31ac5 100644 --- a/src/shared/modes.ts +++ b/src/shared/modes.ts @@ -122,7 +122,7 @@ export const modes: readonly ModeConfig[] = [ ] as const // Export the default mode slug -export const defaultModeSlug = "architect" +export const defaultModeSlug = "code" // Helper functions export function getModeBySlug(slug: string, customModes?: ModeConfig[]): ModeConfig | undefined {