document-swift
БесплатноБез исполняемых скриптовНе проверенWrite and maintain high-quality Swift DocC documentation for the TMDb package, following its established `///` conventions. Use when adding or changing any…
от adamayoung★ 182 звезды на GitHubОб этом скилле
Document Swift (DocC conventions)
The canonical guide for documenting public API in the TMDb Swift package. Apply
these conventions inline, in the same step you write the declaration — a
public symbol without a /// comment is not finished (CLAUDE.md requires it,
and make build-docs runs warnings-as-errors, so a miss breaks the build). For
documenting many files at once, the documentation-writer agent follows these
same rules in an isolated context.
Scope
- Document only
publicdeclarations — skipinternal,private,fileprivate,package. - Document every public declaration — no "self-explanatory" exceptions:
protocols, classes, structs, enums (and cases where meaning isn't obvious),
actors, typealiases, models, stored/computed properties, initializers, methods,
subscripts. Custom
init(from:)/encode(to:)in apublic extensionneed comments too (a common miss). - Use
///style — never/** */. - 100-character line length; wrap continuation lines indented to align with the text above.
Summary patterns
The first /// line after the opening blank /// is the summary. Match the
project's house style by declaration kind:
- Method — verb phrase: "Returns the primary information about a movie." (not "Gets a movie.")
- Property — noun phrase: "Movie identifier." (not "The ID of the movie.")
- Type (struct/class) — "A model representing a [noun]."
- Protocol — "Provides an interface for [verb]-ing [noun] from TMDb."
- Enum — "A model representing a [noun]."; cases use concise noun phrases/adjectives.
- Initializer — "Creates a [type description] object."
Be concise. Extra detail goes in later paragraphs only when it adds something the signature doesn't.
Structure of a doc comment
Opening ///, summary, blank ///, then sections in this order, each separated
by a blank /// line: API link → Precondition → Parameters → Throws →
Returns. No trailing whitespace on blank /// lines.
- TMDb API link — every service protocol method includes, right after the
summary:
/// [TMDb API - <Category>: <Endpoint>](https://developer.themoviedb.org/reference/<slug>) - Parameters —
- Parameter name:(singular) for exactly one parameter;- Parameters:with an indented list for two or more. - Precondition — methods with a
pageparameter add a/// - Precondition:line — e.g.pagecan be between1and1000. - Throws — service methods use
/// - Throws: TMDb error ``TMDbError``.; forDecodableinits, list the specificDecodingErrorcases. - Returns — describe what comes back, e.g. "Matching review."
Standard parameter descriptions (reuse verbatim)
language: "ISO 639-1 language code to display results in. Defaults to the client's configured default language."country: "ISO 3166-1 country code."page: "The page of results to return."idparameters: "The identifier of the [entity]."session: "The user's TMDb session."
Cross-references
- Types: double backticks —
TMDbError. - Articles/guides:
<doc:/TMDb/ArticleName>. - Image paths: any
URL?property representing an image path —posterPath,backdropPath,profilePath,logoPath,stillPath— must add, on its own paragraph: "To generate a full URL see doc:/TMDb/GeneratingImageURLs."
Canonical examples
Service method, multiple parameters (note Precondition + plural Parameters):
///
/// Returns the user reviews for a movie.
///
/// [TMDb API - Movies: Reviews](https://developer.themoviedb.org/reference/movie-reviews)
///
/// - Precondition: `page` can be between `1` and `1000`.
///
/// - Parameters:
/// - movieID: The identifier of the movie.
/// - page: The page of results to return.
/// - language: ISO 639-1 language code to display results in.
/// Defaults to the client's configured default language.
///
/// - Throws: TMDb error ``TMDbError``.
///
/// - Returns: Reviews for the matching movie as a pageable list.
///
func reviews(
forMovie movieID: Movie.ID,
page: Int?,
language: String?
) async throws -> ReviewPageableList
Service method, single parameter (singular Parameter):
///
/// Returns a review's details.
///
/// [TMDb API - Reviews: Details](https://developer.themoviedb.org/reference/review-details)
///
/// - Parameter id: The identifier of the review.
///
/// - Throws: TMDb error ``TMDbError``.
///
/// - Returns: Matching review.
///
func details(forReview id: Review.ID) async throws -> Review
Model struct with an image path and a matching initializer:
///
/// A model representing a movie.
///
public struct MovieListItem: Identifiable, Codable, Equatable, Hashable, Sendable {
///
/// Movie identifier.
///
public let id: Int
///
/// Movie poster path.
///
/// To generate a full URL see <doc:/TMDb/GeneratingImageURLs>.
///
public let posterPa
Установить document-swift в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл document-swift?
Write and maintain high-quality Swift DocC documentation for the TMDb package, following its established `///` conventions. Use when adding or changing any public declaration (protocol, class, struct, enum, actor, model, property, initializer, method, typealias) and when keeping the DocC catalog in sync. This is the single source of truth for the project's documentation style — applied inline as you write, and followed by the `documentation-writer` agent for bulk sweeps.
Как установить скилл document-swift?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл document-swift запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic