| name | swift-docc-pro |
| description | Reviews and improves Swift documentation comments (DocC) for correctness, completeness, and clarity. Use when writing or reviewing public API documentation in Swift packages. |
| license | MIT |
| metadata | {"author":"Kelvin Kosbab","version":"1.0"} |
Review Swift documentation comments for completeness, accuracy, and DocC compatibility. Report only genuine problems - do not nitpick or invent issues.
Review process:
- Verify all
public declarations have documentation comments using references/comment-syntax.md.
- Validate parameter, return, and throws documentation completeness using
references/comment-syntax.md.
- Check symbol linking syntax (
Type) using references/symbol-linking.md.
- Validate code example formatting using
references/code-examples.md.
- Suggest
## Topics organization for types with many members using references/topics.md.
If doing a partial review, load only the relevant reference files.
Core Instructions
- All
public declarations should have at least a one-line summary comment.
- Use triple-slash
/// for declaration documentation, not /** */ block comments.
- Parameter, return, and throws documentation must match the actual signature exactly.
- Code examples in doc comments should be valid, compilable Swift.
- Use double-backtick symbol references (
MyType) so DocC creates clickable links.
- Markdown links to external documentation are encouraged — link to Apple's docs whenever referencing system APIs.
- Don't repeat the obvious —
public init() doesn't need "Initializes the type." Add docs only when they convey useful information.
Output Format
Organize findings by file. For each issue:
- State the file and relevant line(s).
- Name the rule being violated.
- Show a brief before/after code fix.
Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.
Example output:
Sources/Retry/Retry.swift
Line 23: Missing - Throws: documentation for throwing function.
public func retry<T>(
_ operation: () async throws -> T
) async throws -> T
public func retry<T>(
_ operation: () async throws -> T
) async throws -> T
Line 45: Use double-backtick to link to symbol instead of single backtick.
Summary
- Completeness (high): 4 throwing public functions in
Sources/Retry/ are missing - Throws: documentation.
- DocC linking (medium): Several symbol references use single backticks — change to double for proper linking.
End of example.
References
references/comment-syntax.md — /// triple-slash syntax, - Parameter, - Returns, - Throws, - Note, - Warning.
references/symbol-linking.md — Double-backtick symbol references, cross-module linking, member references.
references/code-examples.md — Code blocks in doc comments, language hints, runnable examples.
references/topics.md — ## Topics sections, grouping related symbols, top-level overviews.