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
/plugin marketplace add johnrogers/claude-swift-engineering
/plugin install swift-engineering@claude-swift-engineeringWhat 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.mdfor 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.mdfollowing 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-engineering2Manually: put the files in place
.claude/agents/swift-documenter.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/swift-documenter.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/swift-documenter.mdCursor also reads .claude/agents/
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