From xcode-mcp
This skill should be used when the user asks to "generate documentation", "add DocC comments", "document this function", "document this class", "search apple documentation", "look up in apple docs", "search the apple developer docs", "how does [Apple API] work", "build the documentation", or any task involving DocC documentation generation or searching Apple's developer documentation through Xcode.
How this skill is triggered — by the user, by Claude, or both
Slash command
/xcode-mcp:xcode-docs-and-searchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use the Xcode MCP to generate DocC documentation for Swift symbols and search Apple's developer documentation. Both operations use Xcode's built-in intelligence and require the project to be open.
Use the Xcode MCP to generate DocC documentation for Swift symbols and search Apple's developer documentation. Both operations use Xcode's built-in intelligence and require the project to be open.
Search Apple's developer documentation through Xcode's integrated docs:
"Search Apple documentation for URLSession async await"
"Look up the SwiftData @Model macro in Apple docs"
"Find the Apple documentation for WidgetKit timeline"
"Search docs for AVFoundation capture session setup"
"How does NavigationStack work? Search Apple docs"
"Look up the documentation for withAnimation in SwiftUI"
Effective search strategies:
Fallback: When Xcode is not open, use WebFetch on https://developer.apple.com/documentation/ or the Apple JSON API:
https://developer.apple.com/tutorials/data/{framework}/{slug}.json
Xcode generates DocC-style comments (triple-slash ///) above Swift symbols:
"Generate documentation for the UserRepository class"
"Generate DocC comments for the fetchUser(id:) method"
"Document all public functions in NetworkManager.swift"
"Add DocC documentation to the ContentView struct"
Xcode will generate:
/// Summary line/// - Parameters: block with each parameter described/// - Returns: line if the function returns a value/// - Throws: line if the function throws"Generate DocC documentation for all public symbols in UserRepository.swift"
"Add documentation comments to all undocumented functions in the Models group"
After generating comments, build a DocC documentation catalog:
"Build documentation for the MyApp target"
"Build the DocC documentation and open it in the documentation viewer"
This produces a .doccarchive that can be viewed in Xcode's documentation window (Product → Build Documentation) and exported for hosting.
When writing or reviewing DocC comments manually:
/// A brief one-line summary.
///
/// Extended discussion can follow after a blank `///` line.
/// Supports **bold**, `code`, and [links](https://developer.apple.com).
///
/// ## Topics
///
/// ### Fetching Data
///
/// - ``fetchUser(id:)``
/// - ``fetchAllUsers()``
///
/// - Parameters:
/// - id: The unique identifier for the user to fetch.
/// - completion: Called when the fetch completes.
/// - Returns: The user with the matching ID, or nil if not found.
/// - Throws: `NetworkError.notFound` if the server returns 404.
/// - Note: This method caches results for 5 minutes.
/// - Important: Must be called from a non-main thread.
func fetchUser(id: String) async throws -> User?
Use Xcode's playground macro for exploring APIs interactively:
"Generate a playground to demonstrate the NetworkManager fetch workflow"
"Add a playground macro to test the UserRepository"
"Create a SwiftUI preview playground for ContentView with sample data"
Playgrounds generated via MCP appear in the file with #Preview or #Playground macros and render in Xcode's canvas. In Xcode's coding assistant, you can also generate playgrounds via the coding tools popover (click the coding intelligence icon in the source editor gutter → "Generate a Playground").
SymbolName ) to create cross-references that work in Xcode's documentation viewerProvides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub mattwag05/mw-plugins --plugin xcode-mcp