-
+ {/* Description section */}
+
+
+
{t("prompts:description.title")}
+ {!findModeBySlug(visualMode, customModes) && (
+
+
+
+ )}
+
+
+ {t("prompts:description.description")}
+
+
{
+ const customMode = findModeBySlug(visualMode, customModes)
+ const prompt = customModePrompts?.[visualMode] as PromptComponent
+ return customMode?.description ?? prompt?.description ?? getDescription(visualMode)
+ })()}
+ onChange={(e) => {
+ const value =
+ (e as unknown as CustomEvent)?.detail?.target?.value ??
+ ((e as any).target as HTMLTextAreaElement).value
+ const customMode = findModeBySlug(visualMode, customModes)
+ if (customMode) {
+ // For custom modes, update the JSON file
+ updateCustomMode(visualMode, {
+ ...customMode,
+ description: value.trim() || undefined,
+ source: customMode.source || "global",
+ })
+ } else {
+ // For built-in modes, update the prompts
+ updateAgentPrompt(visualMode, {
+ description: value.trim() || undefined,
+ })
+ }
+ }}
+ className="w-full"
+ data-testid={`${getCurrentMode()?.slug || "code"}-description-textfield`}
+ />
+
- {isSystemPromptDisclosureOpen && (
-
- {/* Override System Prompt Section */}
-
-
- Override System Prompt
-
-
-
{
- const currentMode = getCurrentMode()
- if (!currentMode) return
+ {/* When to Use section */}
+
+
+
{t("prompts:whenToUse.title")}
+ {!findModeBySlug(visualMode, customModes) && (
+
+
+
+ )}
+
+
+ {t("prompts:whenToUse.description")}
+
+
{
+ const customMode = findModeBySlug(visualMode, customModes)
+ const prompt = customModePrompts?.[visualMode] as PromptComponent
+ return customMode?.whenToUse ?? prompt?.whenToUse ?? getWhenToUse(visualMode)
+ })()}
+ onChange={(e) => {
+ const value =
+ (e as unknown as CustomEvent)?.detail?.target?.value ??
+ ((e as any).target as HTMLTextAreaElement).value
+ const customMode = findModeBySlug(visualMode, customModes)
+ if (customMode) {
+ // For custom modes, update the JSON file
+ updateCustomMode(visualMode, {
+ ...customMode,
+ whenToUse: value.trim() || undefined,
+ source: customMode.source || "global",
+ })
+ } else {
+ // For built-in modes, update the prompts
+ updateAgentPrompt(visualMode, {
+ whenToUse: value.trim() || undefined,
+ })
+ }
+ }}
+ className="w-full"
+ rows={4}
+ data-testid={`${getCurrentMode()?.slug || "code"}-when-to-use-textarea`}
+ />
+
- vscode.postMessage({
- type: "openFile",
- text: `./.roo/system-prompt-${currentMode.slug}`,
- values: {
- create: true,
- content: "",
- },
- })
- }}
- />
- ),
- "1": (
-
- ),
- "2": ,
- }}
- />
-
-
-
+ {/* Mode settings */}
+ <>
+ {/* Show tools for all modes */}
+
+
+
{t("prompts:tools.title")}
+ {findModeBySlug(visualMode, customModes) && (
+
+
+
)}
-
+ {!findModeBySlug(visualMode, customModes) && (
+
+ {t("prompts:tools.builtInModesText")}
+
+ )}
+ {isToolsEditMode && findModeBySlug(visualMode, customModes) ? (
+
+ {availableGroups.map((group) => {
+ const currentMode = getCurrentMode()
+ const isCustomMode = findModeBySlug(visualMode, customModes)
+ const customMode = isCustomMode
+ const isGroupEnabled = isCustomMode
+ ? customMode?.groups?.some((g) => getGroupName(g) === group)
+ : currentMode?.groups?.some((g) => getGroupName(g) === group)
-
-
{t("prompts:globalCustomInstructions.title")}
-
-
-
-
-
-
-
{
- const value =
- (e as unknown as CustomEvent)?.detail?.target?.value ??
- ((e as any).target as HTMLTextAreaElement).value
- setCustomInstructions(value ?? undefined)
- vscode.postMessage({
- type: "customInstructions",
- text: value ?? undefined,
- })
- }}
- rows={4}
- className="w-full"
- data-testid="global-custom-instructions-textarea"
- />
-
-
- vscode.postMessage({
- type: "openFile",
- text: "./.roo/rules/rules.md",
- values: {
- create: true,
- content: "",
- },
- })
- }
- />
- ),
- "0": (
-
+ {t(`prompts:tools.toolNames.${group}`)}
+ {group === "edit" && (
+
+ {t("prompts:tools.allowedFiles")}{" "}
+ {(() => {
+ const currentMode = getCurrentMode()
+ const editGroup = currentMode?.groups?.find(
+ (g) =>
+ Array.isArray(g) && g[0] === "edit" && g[1]?.fileRegex,
+ )
+ if (!Array.isArray(editGroup)) return t("prompts:allFiles")
+ return editGroup[1].description || `/${editGroup[1].fileRegex}/`
+ })()}
+
)}
- style={{ display: "inline" }}
- aria-label="Learn about setting up global custom instructions"
- />
- ),
- }}
- />
-
+
+ )
+ })}
+
+ ) : (
+
+ {(() => {
+ const currentMode = getCurrentMode()
+ const enabledGroups = currentMode?.groups || []
+
+ // If there are no enabled groups, display translated "None"
+ if (enabledGroups.length === 0) {
+ return t("prompts:tools.noTools")
+ }
+
+ return enabledGroups
+ .map((group) => {
+ const groupName = getGroupName(group)
+ const displayName = t(`prompts:tools.toolNames.${groupName}`)
+ if (Array.isArray(group) && group[1]?.fileRegex) {
+ const description = group[1].description || `/${group[1].fileRegex}/`
+ return `${displayName} (${description})`
+ }
+ return displayName
+ })
+ .join(", ")
+ })()}
+
+ )}
-
+ >
+
+ {/* Role definition for both built-in and custom modes */}
+
+
+
{t("prompts:customInstructions.title")}
+ {!findModeBySlug(visualMode, customModes) && (
+
+
+
+ )}
+
+
+ {t("prompts:customInstructions.description", {
+ modeName: getCurrentMode()?.name || "Code",
+ })}
+
+
{
+ const customMode = findModeBySlug(visualMode, customModes)
+ const prompt = customModePrompts?.[visualMode] as PromptComponent
+ return (
+ customMode?.customInstructions ??
+ prompt?.customInstructions ??
+ getCustomInstructions(visualMode, customModes)
+ )
+ })()}
+ onChange={(e) => {
+ const value =
+ (e as unknown as CustomEvent)?.detail?.target?.value ??
+ ((e as any).target as HTMLTextAreaElement).value
+ const customMode = findModeBySlug(visualMode, customModes)
+ if (customMode) {
+ // For custom modes, update the JSON file
+ updateCustomMode(visualMode, {
+ ...customMode,
+ // Preserve empty string; only treat null/undefined as unset
+ customInstructions: value ?? undefined,
+ source: customMode.source || "global",
+ })
+ } else {
+ // For built-in modes, update the prompts
+ const existingPrompt = customModePrompts?.[visualMode] as PromptComponent
+ updateAgentPrompt(visualMode, {
+ ...existingPrompt,
+ customInstructions: value.trim() || undefined,
+ })
+ }
+ }}
+ rows={10}
+ className="w-full"
+ data-testid={`${getCurrentMode()?.slug || "code"}-custom-instructions-textarea`}
+ />
+
+ {
+ const currentMode = getCurrentMode()
+ if (!currentMode) return
+
+ // Open or create an empty file
+ vscode.postMessage({
+ type: "openFile",
+ text: `./.roo/rules-${currentMode.slug}/rules.md`,
+ values: {
+ create: true,
+ content: "",
+ },
+ })
+ }}
+ />
+ ),
+ "0": (
+
+ ),
+ }}
+ />
+
+
+
+
+
+
+
+
+
+
+
+ {/* Advanced Features Disclosure */}
+
+
+
+ {isSystemPromptDisclosureOpen && (
+
+ {/* Override System Prompt Section */}
+
+
+ Override System Prompt
+
+
+ {
+ const currentMode = getCurrentMode()
+ if (!currentMode) return
+
+ vscode.postMessage({
+ type: "openFile",
+ text: `./.roo/system-prompt-${currentMode.slug}`,
+ values: {
+ create: true,
+ content: "",
+ },
+ })
+ }}
+ />
+ ),
+ "1": (
+
+ ),
+ "2": ,
+ }}
+ />
+
+
+
+ )}
+
+
+
+
+
{t("prompts:globalCustomInstructions.title")}
+
+
+
+
+
+
+
{
+ const value =
+ (e as unknown as CustomEvent)?.detail?.target?.value ??
+ ((e as any).target as HTMLTextAreaElement).value
+ setCustomInstructions(value ?? undefined)
+ vscode.postMessage({
+ type: "customInstructions",
+ text: value ?? undefined,
+ })
+ }}
+ rows={4}
+ className="w-full"
+ data-testid="global-custom-instructions-textarea"
+ />
+
+
+ vscode.postMessage({
+ type: "openFile",
+ text: "./.roo/rules/rules.md",
+ values: {
+ create: true,
+ content: "",
+ },
+ })
+ }
+ />
+ ),
+ "0": (
+
+ ),
+ }}
+ />
+
+
{isCreateModeDialogOpen && (