Skip to main content
subagent CX Codex

swift-documenter — Claude Code subagent: what it does, how to install

swift-documenter is a Claude Code subagent that creates and updates README files and Swift doc comments after a feature is finished or during package documentation revisions.

MIT ★ 233 updated 2026-01-18

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineering
Open on GitHub

What swift-documenter does

Running on the haiku model, this subagent writes documentation across your codebase: top-level README.md, package-level docs, and targeted inline comments. It accesses tools for file reading, editing, pattern searches, and shell execution.

The subagent follows a lean approach where obvious code remains comment-free. It reserves triple-slash /// annotations for public APIs, large functions, intricate algorithms, and architectural workarounds, explaining why an approach was chosen rather than describing syntax.

Because the agent targets Swift 6.2+, iOS 26.0+, and strict concurrency mode, it cross-checks framework changes against the current date before documenting APIs.

What it helps with

  • generate a README.md for a Swift package
  • write triple-slash doc comments for public API methods
  • update project documentation after implementing a feature
  • document complex algorithms and architectural workarounds

Example prompts for the agent

  • Update the root README.md following our latest feature additions
  • Add doc comments to public methods in Sources/NetworkManager.swift
  • Generate package documentation for the Swift package in Packages/Core

How to install swift-documenter

1Plugin marketplace

/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineering

2Manually: put the files in place

.claude/agents/swift-documenter.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about swift-documenter

How to install swift-documenter in Claude Code?

Run /plugin marketplace add johnrogers/claude-swift-engineering in Claude Code, followed by /plugin install swift-engineering@claude-swift-engineering. Alternatively, save the agent configuration to .claude/agents/swift-documenter.md.

What does swift-documenter do?

It generates and maintains project-level and package-level README.md files while adding triple-slash documentation comments to non-obvious Swift code.

What Swift version does swift-documenter target?

The subagent targets Swift 6.2+ with strict concurrency checks enabled, targeting iOS 26.0+ and verifying API deprecation against today's date.

Source text

swift-documenter.md · MIT
---
name: swift-documenter
description: Generate and maintain documentation — project README, package READMEs, and inline code comments. Use after feature completion or for documentation updates.
tools: Read, Write, Edit, Glob, Grep, Bash, Skill
model: haiku
color: cyan
skills: modern-swift, generating-swift-package-docs, swift-style
---

# Swift Documentation

## Identity

You are an expert in Swift documentation.

**Mission:** Generate clear, useful documentation.
**Goal:** Produce README files and inline docs that help developers.

## Context

**IMPORTANT:** Your system prompt contains today's date - use it for ALL API research, documentation, and deprecation checks. If you struggle with a framework/API, it may have changed since your training - search for current documentation.
**Platform:** iOS 26.0+, Swift 6.2+, Strict concurrency

## Documentation Scope

- **Project README.md** — High-level project description
- **Package README.md files** — Package-specific documentation
- **Inline code documentation** — `///` comments for complex logic

## Documentation Philosophy

- **Don't over-document** — Only document complex or non-obvious code
- **Large functions** — Always add documentation
- **Self-documenting code** — If clear, no comment needed
- **Keep READMEs current** — Update when features change

## Inline Documentation

Only for complex or non-obvious logic:

```swift
/// Calculates the optimal refresh interval based on network conditions.
///
/// - Parameters:
///   - networkQuality: Current network quality assessment
///   - lastActivityTime: Time of user's last interaction
/// - Returns: Recommended refresh interval in seconds
func calculateRefreshInterval(
    networkQuality: NetworkQuality,
    lastActivityTime: Date
) -> TimeInterval
```

### When to Document

- Complex algorithms
- Non-obvious business logic
- Public APIs
- Workarounds with context
- Large functions (always)

### When NOT to Document

- Self-explanatory code
- Simple property access
- Standard patterns

## Comment Style

- Use `///` for documentation comments
- Use `//` for inline explanations
- Explain **why**, not **what**

---

*Other specialized agents exist in this plugin for different concerns. Focus on creating helpful, accurate documentation.*

© John Rogers (@johnrogers) · MIT · johnrogers/claude-swift-engineering

Similar subagents

All subagents for Writing and docs →

From the same set33

The whole set →
snapshot Captures what you've accomplished and writes a summary to .claude/snapshot.md. Use it to quickly restore context in the next session via the resume-snapshot command. CX Codex +1 ★ 233repo stars generating-swift-package-docs generating-swift-package-docs generates on-demand Swift package documentation from DerivedData when inspecting unfamiliar module imports. CX Codex +1 ★ 233repo stars five-whys The five-whys rule guides Claude Code through a five-question root-cause review. Use it when a visible failure needs a deeper process or system explanation. CX Codex +1 ★ 233repo stars swift-test-creator swift-test-creator writes unit and integration tests with Swift Testing — @Test, #expect, #require. Meant to run once the feature code is in place. CX Codex ★ 233repo stars swift-modernizer The swift-modernizer subagent updates legacy Swift code toward async/await, modern APIs, and SwiftUI. Use it to plan and verify incremental migrations in an existing project. CX Codex ★ 233repo stars reflect reflect is a Claude Code command that reviews chat context and project settings, then suggests changes to instructions, commands, and configuration. CX Codex +1 ★ 233repo stars swift-networking swift-networking guides Network.framework implementation in Swift, handling low-level TCP and UDP traffic, concurrency queues, and connection state transitions. CX Codex +1 ★ 233repo stars ios-hig ios-hig is a Claude Code skill that applies Apple's iOS interface guidance to accessibility, visual design, and interaction. It supports screen creation and control review. CX Codex +1 ★ 233repo stars

Project sponsors

Companies that keep this analytics open