Xcode Coding Intelligence — Playground Action

Chat Prompt ✦ Curated & attributed Intro

Templated prompt for Xcode's 'usage example' action. It injects filename, full file contents, and the selected Swift symbol, then asks for a brief usage example tightly constrained to a single code block with no comments, no print statements, and no additional imports — suitable for direct insertion into a Swift playground.

What makes this prompt notable

  • Stacks four hard output constraints (single code block, no comments, no prints, no extra imports) to keep generated examples playground-pasteable
  • Targets a specific symbol via {{selected}} while still passing the full file for type/context awareness
  • Mirrors the shared Xcode context scaffold, differing only in the instruction and constraint list
50 words · 414 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}}
```

The user has asked:

Provide a brief example on how to use `{{selected}}`.

- Respond only with a single code block.
- Don't use comments. 
- Don't use print statements. 
- Don't import any additional modules.

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