home / skills / nonameplum / agent-skills / swift-docc-documentation

swift-docc-documentation skill

/swift-docc-documentation

This skill helps you generate, structure, and format Swift DocC documentation and tutorials from code comments and articles.

npx playbooks add skill nonameplum/agent-skills --skill swift-docc-documentation

Review the files below or copy the command above to add this skill to your agents.

Files (114)
SKILL.md
4.0 KB
---
name: swift-docc
description: Official Swift DocC documentation markup and syntax reference
---

# docc

Produce rich API reference documentation and interactive tutorials for your Swift framework or package.

## Documentation Structure

### Essentials

- **Documenting a Swift Framework or Package** ([documenting-a-swift-framework-or-package.md](documenting-a-swift-framework-or-package.md)): Create developer documentation from in-source comments, add articles with code snippets,

### Documentation Content

- **Writing Symbol Documentation in Your Source Files** ([writing-symbol-documentation-in-your-source-files.md](writing-symbol-documentation-in-your-source-files.md)): Add reference documentation to your symbols that explains how to use them.
- **Adding Supplemental Content to a Documentation Catalog** ([adding-supplemental-content-to-a-documentation-catalog.md](adding-supplemental-content-to-a-documentation-catalog.md)): Include articles and extension files to extend your source documentation comments or provide supporting conceptual content.
- **Linking to Symbols and Other Content** ([linking-to-symbols-and-other-content.md](linking-to-symbols-and-other-content.md)): Facilitate navigation between pages using links.
- **Adding Code Snippets to your Content** ([adding-code-snippets-to-your-content.md](adding-code-snippets-to-your-content.md)): Create and include code snippets to illustrate and provide examples of how to use your API.
- **Documenting API with Different Language Representations** ([Documenting API with different language representations/documenting-api-with-different-language-representations.md](Documenting API with different language representations/documenting-api-with-different-language-representations.md)): Create documentation for API that's callable from more than one source language.

### Structure and Formatting

- **Formatting Your Documentation Content** ([formatting-your-documentation-content.md](formatting-your-documentation-content.md)): Enhance your content's presentation with special formatting and styling for text and lists.
- **Adding Tables of Data** ([adding-tables-of-data.md](adding-tables-of-data.md)): Arrange information into rows and columns.
- **Other Formatting Options** ([other-formatting-options.md](other-formatting-options.md)): Improve the presentation and structure of your content by incorporating special page elements.
- **Adding Images to Your Content** ([adding-images.md](adding-images.md)): Elevate your content's visual appeal by adding images.
- **Adding Structure to Your Documentation Pages** ([adding-structure-to-your-documentation-pages.md](adding-structure-to-your-documentation-pages.md)): Make symbols easier to find by arranging them into groups and collections.
- **Customizing the Appearance of Your Documentation Pages** ([customizing-the-appearance-of-your-documentation-pages.md](customizing-the-appearance-of-your-documentation-pages.md)): Customize the look and feel of your documentation webpages.

### Distribution

- **Distributing Documentation to Other Developers** ([distributing-documentation-to-other-developers.md](distributing-documentation-to-other-developers.md)): Share your documentation by hosting it on a web server.

### Documentation Types

- **API Documentation** ([Reference Syntax/API Reference Syntax/api-reference-syntax.md](Reference Syntax/API Reference Syntax/api-reference-syntax.md)): Teach your APIs through reference documentation you create from code comments and extension files, or create detailed articles and conceptual guides.
- **Interactive Tutorials** ([Reference Syntax/Tutorials Syntax/tutorial-syntax.md](Reference Syntax/Tutorials Syntax/tutorial-syntax.md)): Teach developers your Swift APIs through step-by-step, interactive content.

### Shared Syntax


## Usage Notes

- Documentation is organized progressively from getting started to advanced topics
- Start with the Introduction or Getting Started section
- Consult specific guides for detailed information

## License & Attribution

This skill contains content converted from DocC documentation format.

Overview

This skill is an authoritative reference for Swift DocC markup and syntax, packaged to help authors create rich API reference pages and interactive tutorials. It condenses the essentials of writing symbol documentation, adding supplemental articles, and formatting content for publication. Use it to learn best practices for linking symbols, embedding code snippets, and organizing documentation structure for Swift frameworks and packages.

How this skill works

The skill inspects DocC concepts and examples across core topics: symbol documentation, supplemental content, linking, snippets, formatting, and distribution. It explains how to annotate Swift source comments, add articles and extension files, structure pages into groups, and convert content into web-hostable documentation. Practical guidance covers API reference syntax, tutorial syntax, and multi-language representations when exposing APIs to other languages.

When to use it

  • Creating or improving in-source Swift symbol documentation for a framework or package
  • Building interactive tutorials that teach API usage step-by-step
  • Adding supplemental articles or extension files to expand reference content
  • Formatting pages with tables, images, and special elements for clarity
  • Organizing symbols into groups and collections for easier navigation

Best practices

  • Start with an introduction or getting-started article to orient readers
  • Document public symbols in source comments and augment with extension files for examples
  • Use explicit links between symbols and pages to improve discoverability
  • Include runnable code snippets and language variants when applicable
  • Structure pages into collections and groups to keep the catalog navigable

Example use cases

  • Converting a Swift package's inline comments into a full API reference site
  • Authoring an interactive tutorial that walks users through a common integration flow
  • Adding conceptual articles that explain design patterns used by the framework
  • Creating multi-language examples so the same API is documented for Swift and Objective-C callers
  • Customizing documentation appearance and adding images or data tables for clarity

FAQ

Do I need to write all documentation inside source files?

No. DocC supports in-source symbol comments plus supplemental articles and extension files. Use source comments for reference and supplemental content for longer conceptual guides or tutorials.

Can I include runnable code snippets and multiple language variants?

Yes. The syntax supports embedding executable code snippets and providing language-specific representations for APIs callable from other languages.