Skip to content
Skills Library
Programming · Writing

swift-docc-comments

/swift-docc-comments

Use when writing or enhancing Swift documentation comments for DocC generation, adding inline doc comments to Swift source files, or when user asks for API documentation

Licence
MIT
Last repository change
21.06.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 21.06.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when writing or enhancing Swift documentation comments for DocC generation, adding inline doc comments to Swift source files, or when user asks for API documentation

Original author description

Use when writing or enhancing Swift documentation comments for DocC generation, adding inline doc comments to Swift source files, or when user asks for API documentation

How it works

  1. Overview
  2. Structure
  3. Quick Reference
  4. Correct Format
  5. Common Mistakes
  6. Red Flags
  7. Generate Documentation
Original SKILL.md headings · 78 lines, 312 words
SKILL.md preview
---
name: swift-docc-comments
description: Use when writing or enhancing Swift documentation comments for DocC generation, adding inline doc comments to Swift source files, or when user asks for API documentation
allowed-tools: Read, Grep, Glob
---

# Swift DocC Inline Comments

## Overview

Swift DocC inline comments follow a specific structure. Section headers like `## Overview` and `## Topics` belong in `.docc` catalog files, NOT in inline source comments.

## Structure

````
/// Summary (first paragraph - one sentence)
///
/// Discussion paragraphs (no header needed)
///
/// ```swift
/// // Code example
/// ```
///
/// - Parameter name: Description
/// - Returns: Description
/// - Throws: Description
/// - Note: Additional info
````

## Quick Reference

| Element       | Format                | Location                  |
| ------------- | --------------------- | ------------------------- |
| Summary       | First paragraph       | Inline                    |
| Discussion    | Subsequent paragraphs | Inline                    |
| Code examples | Triple backticks      | Inline, before parameters |
| `## Overview` | Section header        | `.docc` catalog ONLY      |
| `## Topics`   | Section header        | `.docc` catalog ONLY      |
| Symbol links  | ` ``SymbolName`` `    | Both                      |

## Correct Format

````swift
/// Brief summary in one sentence.
///
/// Extended discussion explaining behavior, use cases,
/// or important details. No header needed.
///
/// ```swift
/// let example = MyType()
/// example.doSomething()
/// ```
///
/// - Parameter value: What this parameter does.
/// - Returns: What gets returned.
/// - Note: Default value is `.default`.
func method(value: Int) -> String
````

## Common Mistakes

| Wrong                  | Correct                     |
| ---------------------- | --------------------------- |
| `/// ## Overview`      | Just write paragraphs       |
| `/// ## Topics`        | Use `.docc` catalog file    |
| `/// ## Example`       | Just use code block         |
| Parameters before code | Code block, then parameters |

## Red Flags

These indicate wrong format:

- `## Overview` in `///` comments
- `## Topics` in `///` comments
- `## Example` before code blocks
- `- Parameter:` appearing before code examples

## Generate Documentation

```bash
swift package generate-documentation
```

Versions

The database has no other skills named swift-docc-comments.

Database snapshot: 13.11.2026 · package version b1ef8a0fe920 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100swift-docc-github-pages
    Use when setting up DocC documentation for a Swift package, deploying to GitHub Pages, or encountering "no such module 'UIKit'" during doc generation
  • 100swift-comments-that-matter
    Review and write Swift comments and DocC symbol documentation. Use to preserve API contracts, explain non-obvious intent or lifecycle constraints, and remove redundant implementation commentary. Applies to comment-focused work, not general Swift refactoring or concurrency migrations.
  • 90author-swift-docc-docs
    Author and review DocC content in Swift components, including symbol comments, articles, extension files, landing pages, topic groups, and light tutorial-aware review. Use when the user wants help writing or reviewing DocC content, checking DocC structure or content correctness,…
  • 100sosumi
    Fetches Apple documentation as Markdown via Sosumi. Use for Apple API reference, Human Interface Guidelines, WWDC transcripts, and external Swift-DocC pages.
  • 95sosumi
    Fetches Apple documentation as Markdown via Sosumi. Use for Apple API reference, Human Interface Guidelines, WWDC transcripts, and external Swift-DocC pages.
  • 86swift
    Always use when creating and editing Swift files (*.swift)

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.