VSCode & Xcode Prompts
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The VSCode and Xcode prompts define the operational logic, behavioral constraints, and tool-interaction strategies for AI coding assistants integrated into modern Integrated Development Environments (IDEs). These prompts transform Large Language Models (LLMs) into agentic entities capable of autonomous research, code modification, and project verification within specific ecosystem constraints—such as Microsoft's VSCode and Apple's Xcode environments.
The scope of these prompts covers the entire software development lifecycle, including requirement extraction, context gathering via semantic search, implementation following strict style guidelines, and final verification through build and test tools. They serve as the "ground truth" for agent personality, ensuring a consistent professional tone while enforcing critical security and copyright guardrails. Sources: VSCode Agent/gpt-5-mini.txt, Xcode/System.txt
Agentic Architecture and Flow
The system operates on an "Agentic Workflow" where the AI continues to execute tasks until a user's query is completely resolved. The architecture is designed to minimize user interruption by prioritizing autonomous tool use over clarifying questions.
Operational Lifecycle
The following diagram illustrates the standard execution flow for an IDE agent when processing a user request:
This flow ensures that complex tasks are structured via checklists while simple queries remain low-latency.
Sources: VSCode Agent/gpt-5-mini.txt:13-35, Cursor Prompts/Agent Prompt 2025-09-03.txt:47-53
Parallel Tool Execution
Efficiency is achieved through the maximization of parallel tool calls. Read-only operations, such as codebase searches and file reads, are batched together to reduce sequential latency.
Parallelization is mandatory for independent work, but serialization is enforced for code edits to maintain file consistency.
Sources: Cursor Prompts/Agent CLI Prompt 2025-08-07.txt:90-112, Cursor Prompts/Agent Prompt 2025-09-03.txt:81-98
IDE-Specific Implementation Details
Xcode and Apple Ecosystem
The Xcode prompt specializes in Apple-centric development, enforcing the use of Swift, Objective-C, and Apple frameworks. It includes specific logic for identifying missing types and requesting them from the user through a unique ##SEARCH syntax.
| Feature | Requirement |
|---|---|
| Primary Language | Swift (preferred over all alternatives) |
| Concurrency | Swift Concurrency (async/await, actors) over Dispatch/Combine |
| Testing | Swift Testing framework (Macros-based) |
| File Revision | Must repeat entire file content (no eliding) |
Sources: Xcode/System.txt:8-40
VSCode and Microsoft Copilot
The VSCode agent, often identified as "GitHub Copilot," focuses on a broader range of languages but maintains strict Microsoft content and copyright policies. It emphasizes "Quality Gates" and an "Engineering Mindset" that includes outlining contracts and edge cases before implementation.
| Component | Description |
|---|---|
| Identity | Must respond as "GitHub Copilot" |
| Todo Tool | Mandatory manage_todo_list for multi-step tasks |
| Quality Gates | Build -> Lint/Typecheck -> Unit Tests -> Smoke Test |
| Context | Large meaningful chunks preferred over small sections |
Sources: VSCode Agent/gpt-5-mini.txt:1-10, VSCode Agent/gpt-5-mini.txt:60-75
Code Modification and Style
Agents must adhere to "Clean Code" principles, prioritizing high-verbosity and readability since code is intended for human review.
Patch and Edit Strategies
- Patches: In VSCode/Cursor,
apply_patchis the primary tool. Agents must re-read files if they have not been opened within the last five messages to ensure the patch context is valid. - Xcode Edits: Requires repeating the entire file without skips to ensure code integrity.
- Formatting: Use backticks for symbols and file paths. Use specific Markdown link syntax (e.g.,
symbolName) to allow users to navigate to definitions.
Style Constraints
- Naming: Functions must be verbs/verb-phrases; variables must be nouns. Avoid 1-2 character names.
- Comments: Explain "why" not "how." Never use inline comments; place them above code lines.
- Control Flow: Prioritize guard clauses and early returns to avoid deep nesting (limit to 2-3 levels).
Sources: Cursor Prompts/Agent CLI Prompt 2025-08-07.txt:130-175, VSCode Agent/gpt-5-mini.txt:128-150, Xcode/System.txt:71-75
Discovery and Verification
Agents utilize a hierarchy of search tools to understand the codebase. codebase_search (semantic search) is generally preferred for high-level intent, while grep is reserved for exact string matches.
| Tool Category | Preferred Tool | Usage Scenario |
|---|---|---|
| Exploration | codebase_search | Understanding "authentication flow" or "error handling" |
| Exact Match | grep / rg | Finding specific variable names or function calls |
| Verification | read_lints / build | Post-edit validation to ensure no errors were introduced |
Success Criteria
A task is only considered complete when it meets the "Green-before-done" criteria:
- Substantive changes are applied.
- Relevant builds and tests are executed automatically.
- Failures are iterated upon (up to three targeted fixes).
- A concise summary is provided, mapping requirements to status.
Sources: Cursor Prompts/Agent Prompt 2025-09-03.txt:71-80, VSCode Agent/gpt-5-mini.txt:83-95
Conclusion
The prompts for VSCode and Xcode represent a sophisticated set of instructions that enable AI agents to act as competent pair programmers. By enforcing structured task management, parallel tool utilization, and IDE-specific coding standards, these systems ensure that AI-generated code is not only functional but also integrates seamlessly into professional software projects. Their emphasis on autonomous verification and strict adherence to project conventions minimizes the "hand-back" of half-baked work, providing a complete end-to-end solution for the user.