Revert default mode to "code" and add first-time user mode logic

Co-authored-by: matt <matt@roocode.com>
This commit is contained in:
Cursor Agent 2025-06-30 17:58:28 +00:00
parent db761874c0
commit 93d9df9553
3 changed files with 6 additions and 56 deletions

View file

@ -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.

View file

@ -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,

View file

@ -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 {