Xcode Coding Intelligence — Document Action

Chat Prompt ✦ Curated & attributed Intro

A short templated user-message prompt for Xcode's documentation generation action. It interpolates the current filename, full file contents, and the user's selected Swift code, then instructs the model to produce documentation for the selection, constrained to a single code block containing only documentation comments.

What makes this prompt notable

  • Uses {{filename}}, {{filecontent}}, and {{selected_code}} placeholders to provide both surrounding file context and the selected snippet
  • Constrains output to a single code block with only documentation comments and no other Swift code
  • Tags the embedded file with a swift:{{filename}} fenced-code language hint to convey language and path
50 words · 374 chars
The user is curently inside this file: {{filename}}
The contents are below:
```swift:{{filename}}
{{filecontent}}
```

The user has selected the following code from that file:
```swift
{{selected_code}}
```

The user has asked:

Provide documentation for `{{selected_code}}`.

- Respond with a single code block.
- Only include documentation comments. No other Swift code.

Discussion (0)

Sign in to join the discussion.
Related

More in IDE & Coding Assistants

VSCode Agent
agent prompt

VSCode Agent (GitHub Copilot) — GPT-5 Agent Prompt

The most elaborate Copilot VS Code agent prompt, for GPT-5. It combines the Copilot identity and refusals with a detailed communication-style guide, m…

role definition tool-use protocol structured diff format specification
239 5.6k 3.7k words
KI
Kiro
system prompt

Kiro — Intent Mode Classifier

A lightweight intent-classification prompt that routes a user message into chat/do/spec modes and returns a JSON object of confidence scores summing t…

classification rubric constraint setting few-shot
226 5.3k 600 words
CU
Cursor
agent prompt

Cursor — Agent Prompt v1.0 (Claude Sonnet 4)

An earlier, leaner Cursor agent prompt (Claude Sonnet 4) focused on tool-calling rules, aggressive parallel tool execution, search-and-reading bias to…

role definition tool-use protocol parallel tool-call maximization
225 7.3k 1.5k words