Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit d876abc

Browse files
committed
refactor: replace fetch_instructions tool with built-in skills
- Add built-in skills (create-mcp-server, create-mode) following slash commands pattern - Update SkillsManager to merge built-in skills with user skills - Remove FetchInstructionsTool and related infrastructure - Remove enableMcpServerCreation setting and UI checkbox - Remove auto-approval logic for fetchInstructions - Update system prompt sections to remove fetch_instructions references Built-in skills are now available through the skills system with override precedence: project > global > built-in
1 parent 6eb3d5d commit d876abc

33 files changed

Lines changed: 172 additions & 421 deletions

packages/types/src/global-settings.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ export const globalSettingsSchema = z.object({
174174
telemetrySetting: telemetrySettingsSchema.optional(),
175175

176176
mcpEnabled: z.boolean().optional(),
177-
enableMcpServerCreation: z.boolean().optional(),
178177

179178
mode: z.string().optional(),
180179
modeApiConfigs: z.record(z.string(), z.string()).optional(),

packages/types/src/tool.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export const toolNames = [
3232
"attempt_completion",
3333
"switch_mode",
3434
"new_task",
35-
"fetch_instructions",
3635
"codebase_search",
3736
"update_todo_list",
3837
"run_slash_command",

packages/types/src/vscode-extension-host.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ export type ExtensionState = Pick<
365365
experiments: Experiments // Map of experiment IDs to their enabled state
366366

367367
mcpEnabled: boolean
368-
enableMcpServerCreation: boolean
369368

370369
mode: string
371370
customModes: ModeConfig[]
@@ -505,7 +504,6 @@ export interface WebviewMessage {
505504
| "deleteMessageConfirm"
506505
| "submitEditedMessage"
507506
| "editMessageConfirm"
508-
| "enableMcpServerCreation"
509507
| "remoteControlEnabled"
510508
| "taskSyncEnabled"
511509
| "searchCommits"
@@ -786,7 +784,6 @@ export interface ClineSayTool {
786784
| "newFileCreated"
787785
| "codebaseSearch"
788786
| "readFile"
789-
| "fetchInstructions"
790787
| "listFilesTopLevel"
791788
| "listFilesRecursive"
792789
| "searchFiles"

src/core/assistant-message/NativeToolCallParser.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -449,14 +449,6 @@ export class NativeToolCallParser {
449449
}
450450
break
451451

452-
case "fetch_instructions":
453-
if (partialArgs.task !== undefined) {
454-
nativeArgs = {
455-
task: partialArgs.task,
456-
}
457-
}
458-
break
459-
460452
case "generate_image":
461453
if (partialArgs.prompt !== undefined || partialArgs.path !== undefined) {
462454
nativeArgs = {
@@ -736,14 +728,6 @@ export class NativeToolCallParser {
736728
}
737729
break
738730

739-
case "fetch_instructions":
740-
if (args.task !== undefined) {
741-
nativeArgs = {
742-
task: args.task,
743-
} as NativeArgsFor<TName>
744-
}
745-
break
746-
747731
case "generate_image":
748732
if (args.prompt !== undefined && args.path !== undefined) {
749733
nativeArgs = {

src/core/assistant-message/presentAssistantMessage.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { experiments, EXPERIMENT_IDS } from "../../shared/experiments"
1515
import { AskIgnoredError } from "../task/AskIgnoredError"
1616
import { Task } from "../task/Task"
1717

18-
import { fetchInstructionsTool } from "../tools/FetchInstructionsTool"
1918
import { listFilesTool } from "../tools/ListFilesTool"
2019
import { readFileTool } from "../tools/ReadFileTool"
2120
import { writeToFileTool } from "../tools/WriteToFileTool"
@@ -364,8 +363,6 @@ export async function presentAssistantMessage(cline: Task) {
364363
return readFileTool.getReadFileToolDescription(block.name, block.nativeArgs)
365364
}
366365
return readFileTool.getReadFileToolDescription(block.name, block.params)
367-
case "fetch_instructions":
368-
return `[${block.name} for '${block.params.task}']`
369366
case "write_to_file":
370367
return `[${block.name} for '${block.params.path}']`
371368
case "apply_diff":
@@ -809,13 +806,6 @@ export async function presentAssistantMessage(cline: Task) {
809806
pushToolResult,
810807
})
811808
break
812-
case "fetch_instructions":
813-
await fetchInstructionsTool.handle(cline, block as ToolUse<"fetch_instructions">, {
814-
askApproval,
815-
handleError,
816-
pushToolResult,
817-
})
818-
break
819809
case "list_files":
820810
await listFilesTool.handle(cline, block as ToolUse<"list_files">, {
821811
askApproval,
@@ -1090,7 +1080,6 @@ function containsXmlToolMarkup(text: string): boolean {
10901080
"codebase_search",
10911081
"edit_file",
10921082
"execute_command",
1093-
"fetch_instructions",
10941083
"generate_image",
10951084
"list_files",
10961085
"new_task",

src/core/auto-approval/index.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,6 @@ export async function checkAutoApproval({
151151
return { decision: "approve" }
152152
}
153153

154-
if (tool?.tool === "fetchInstructions") {
155-
if (tool.content === "create_mode") {
156-
return state.alwaysAllowModeSwitch === true ? { decision: "approve" } : { decision: "ask" }
157-
}
158-
159-
if (tool.content === "create_mcp_server") {
160-
return state.alwaysAllowMcp === true ? { decision: "approve" } : { decision: "ask" }
161-
}
162-
}
163-
164154
if (tool?.tool === "switchMode") {
165155
return state.alwaysAllowModeSwitch === true ? { decision: "approve" } : { decision: "ask" }
166156
}

src/core/prompts/__tests__/__snapshots__/add-custom-instructions/mcp-server-creation-enabled.snap

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/__snapshots__/system-prompt/with-mcp-hub-provided.snap

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/prompts/__tests__/add-custom-instructions.spec.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ describe("addCustomInstructions", () => {
212212
undefined, // globalCustomInstructions
213213
undefined, // diffEnabled
214214
undefined, // experiments
215-
true, // enableMcpServerCreation
216215
undefined, // language
217216
undefined, // rooIgnoreInstructions
218217
undefined, // partialReadsEnabled
@@ -235,7 +234,6 @@ describe("addCustomInstructions", () => {
235234
undefined, // globalCustomInstructions
236235
undefined, // diffEnabled
237236
undefined, // experiments
238-
true, // enableMcpServerCreation
239237
undefined, // language
240238
undefined, // rooIgnoreInstructions
241239
undefined, // partialReadsEnabled
@@ -244,7 +242,7 @@ describe("addCustomInstructions", () => {
244242
expect(prompt).toMatchFileSnapshot("./__snapshots__/add-custom-instructions/ask-mode-prompt.snap")
245243
})
246244

247-
it("should include MCP server creation info when enabled", async () => {
245+
it("should include MCP server info when enabled", async () => {
248246
const mockMcpHub = createMockMcpHub(true)
249247

250248
const prompt = await SYSTEM_PROMPT(
@@ -260,13 +258,14 @@ describe("addCustomInstructions", () => {
260258
undefined, // globalCustomInstructions
261259
undefined, // diffEnabled
262260
undefined, // experiments
263-
true, // enableMcpServerCreation
264261
undefined, // language
265262
undefined, // rooIgnoreInstructions
266263
undefined, // partialReadsEnabled
267264
)
268265

269-
expect(prompt).toContain("Creating an MCP Server")
266+
// MCP server section should be present with connected servers info
267+
expect(prompt).toContain("MCP SERVERS")
268+
expect(prompt).toContain("Connected MCP Servers")
270269
expect(prompt).toMatchFileSnapshot("./__snapshots__/add-custom-instructions/mcp-server-creation-enabled.snap")
271270
})
272271

@@ -286,7 +285,6 @@ describe("addCustomInstructions", () => {
286285
undefined, // globalCustomInstructions
287286
undefined, // diffEnabled
288287
undefined, // experiments
289-
false, // enableMcpServerCreation
290288
undefined, // language
291289
undefined, // rooIgnoreInstructions
292290
undefined, // partialReadsEnabled
@@ -310,7 +308,6 @@ describe("addCustomInstructions", () => {
310308
undefined, // globalCustomInstructions
311309
undefined, // diffEnabled
312310
undefined, // experiments
313-
true, // enableMcpServerCreation
314311
undefined, // language
315312
undefined, // rooIgnoreInstructions
316313
true, // partialReadsEnabled

src/core/prompts/__tests__/custom-system-prompt.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ describe("File-Based Custom System Prompt", () => {
106106
undefined, // globalCustomInstructions
107107
undefined, // diffEnabled
108108
undefined, // experiments
109-
true, // enableMcpServerCreation
110109
undefined, // language
111110
undefined, // rooIgnoreInstructions
112111
undefined, // partialReadsEnabled
@@ -144,7 +143,6 @@ describe("File-Based Custom System Prompt", () => {
144143
undefined, // globalCustomInstructions
145144
undefined, // diffEnabled
146145
undefined, // experiments
147-
true, // enableMcpServerCreation
148146
undefined, // language
149147
undefined, // rooIgnoreInstructions
150148
undefined, // partialReadsEnabled
@@ -190,7 +188,6 @@ describe("File-Based Custom System Prompt", () => {
190188
undefined, // globalCustomInstructions
191189
undefined, // diffEnabled
192190
undefined, // experiments
193-
true, // enableMcpServerCreation
194191
undefined, // language
195192
undefined, // rooIgnoreInstructions
196193
undefined, // partialReadsEnabled

0 commit comments

Comments
 (0)