skills/txt-refresh-against-sosumi/SKILL.md
Refresh time-sensitive Apple Text skill content against current Apple documentation via Sosumi. Walks the `references/latest-apis.md` companion file in each time-sensitive skill (txt-swiftui-texteditor, txt-writing-tools, txt-textkit2, txt-attribute-keys, txt-attributed-string), fetches the current API surface from sosumi.ai, and produces a diff report so a maintainer can review and commit. Use when a new iOS / Swift / Xcode point release ships, when the user asks to "refresh the skills against current docs", "sync against WWDC", "update the Apple text skills for the new SDK", "freshen latest-apis.md", or any maintenance trigger. Trigger after WWDC, after Xcode 26.x bumps, or whenever an agent author notices skill content drifting from the current API surface — even when 'maintenance' isn't named. Do NOT use for authoring new skills or rewriting existing ones — that's the job of the per-skill rewrite workflow described in AGENTS.md.
npx skillsauth add sitapix/apple-text txt-refresh-against-sosumiInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Authored against iOS 26.x / Swift 6.x / Xcode 26.x.
This is a maintenance skill. It produces a diff report against Apple's current documentation; a human maintainer reviews and commits the result. Do not push silent updates without review — Apple sometimes deprecates without changing signatures, and the diff alone won't catch semantic shifts.
The natural cadence is after Apple releases that touch the text stack:
Don't run this on every commit. The point is to capture deltas at meaningful platform boundaries; running too often produces noise and rebases against an in-flight beta cycle.
These five skills are time-sensitive enough to warrant a references/latest-apis.md companion. Any of them that lacks the file gets one created on the next run:
txt-swiftui-texteditor — iOS 26+ rich-text TextEditor; AttributedTextSelection, AttributedTextFormattingDefinition, AttributedTextValueConstraint, transformAttributes(in:body:), replaceSelection(_:withCharacters:), replaceSelection(_:with:), Font.Context, Font.resolve(in:)txt-writing-tools — UIWritingToolsCoordinator, WritingToolsBehavior, WritingToolsAllowedInputOptions, writingToolsIgnoredRangesIn, isWritingToolsActive, the willBegin/didEnd lifecycletxt-textkit2 — NSTextLayoutManager, NSTextContentManager, NSTextLayoutFragment, NSTextLineFragment, NSTextViewportLayoutController, fragment enumeration optionstxt-attribute-keys — NSAttributedString.Key catalog, value types, view-compatibility footnotestxt-attributed-string — AttributedString API surface, AttributeScope, AttributeContainer, MarkdownDecodableAttributedStringKey, CodableAttributedStringKey, scope composition rulesOther skills (txt-textkit1, txt-nstextstorage, txt-uitextinput, etc.) describe stable older APIs and don't carry latest-apis.md. They get reviewed during major releases as part of the broader audit, not via this skill.
The work is mechanical — fetch, diff, report — but each step has a gotcha. Apply in order.
For each in-scope skill, read its current references/latest-apis.md (or the SKILL.md if no sidecar exists yet). Capture every Apple API name, signature, and version annotation that appears as a normalized list. This is the baseline.
If a skill doesn't have references/latest-apis.md, create one with this template:
# Latest API surface — <skill-name>
Authored against iOS 26.x / Swift 6.x / Xcode 26.x. Last refreshed YYYY-MM-DD against Sosumi.
## <Subject group 1>
- `Type.method(arg1:arg2:)` — short description, since: iOS 26.0
- ...
## <Subject group 2>
...
## Signatures verified against Sosumi
| URL | Status | Last fetched |
|---|---|---|
| https://sosumi.ai/documentation/... | 200 | YYYY-MM-DD |
Static SKILL.md content stays as the mental model. latest-apis.md is the API-signature source of truth.
For each API in the baseline, fetch the corresponding Sosumi page. Two routes:
Sosumi:fetch_documentation with the API path. Returns clean Markdown.curl -fsSL https://sosumi.ai/documentation/<framework>/<api> and parse Markdown.Verify the URL resolves with HTTP 200 before treating its content as authoritative. A 404 means Apple removed or renamed the symbol — flag for review, don't silently delete from latest-apis.md.
If Sosumi itself is down (rare but possible), defer to xcrun mcpbridge's DocumentationSearch tool against on-machine Xcode-bundled docs. Note the source in the diff report so the reviewer knows which surface was canonical.
For each skill, write a per-skill report at /tmp/sosumi-refresh-<skill>-<date>.md containing:
# Refresh report: <skill-name> (YYYY-MM-DD)
## New APIs (added since last refresh)
- `Type.newMethod(...)` since iOS 26.x
- Sosumi: <url>
- Suggested home in latest-apis.md: <subject group>
## Deprecated / removed APIs
- `Type.oldMethod(...)` deprecated in iOS 26.x, removed in iOS 27.x
- Migration: see "Old patterns" section per AGENTS.md freshness contract
## Signature changes
- `Type.changedMethod(...)`
- Was: `(arg1: A, arg2: B) -> R`
- Now: `(arg1: A, arg2: B?, completion: ...) -> R`
- Source: <sosumi url>
## URL liveness
- <url>: 200
- <url>: 404 (was 200 last refresh — investigate)
## Suggested edits
[per-section guidance for the human reviewer]
Don't auto-apply. The report is for human review.
Once the maintainer reviews, apply edits:
latest-apis.md under the right subject group with since: iOS X.x.## Old patterns section per AGENTS.md freshness contract — never inline date conditionals like "if before iOS 26".latest-apis.md, then check whether SKILL.md references the old shape; update if so.latest-apis.md.Commit each skill's update as a separate commit so the history reads cleanly.
If a major release happened (iOS 27.x), update the Authored against iOS 26.x / Swift 6.x / Xcode 26.x. line in each refreshed skill's SKILL.md to the new versions. Don't update minor revs (26.3 → 26.4) — those would churn the line on every Xcode point release. Use major boundaries.
Spot the patterns that aren't pure additions:
latest-apis.md and add a note explaining when to use which form.AttributedString gaining Sendable). These don't show up as new API names but unlock new patterns. Flag in the report's "Suggested edits" section.Running on beta-day instead of after public release. Beta APIs churn and the report becomes noise. Wait until the SDK ships in a public Xcode update.
Treating Sosumi 404 as "API was removed." Sosumi sometimes lags Apple's renames or restructures by a day or two. Cross-check with xcrun mcpbridge or the live developer.apple.com page (in a browser, not via fetch) before assuming removal.
Auto-applying changes from the diff report. The whole point of producing a report is to give a maintainer a chance to spot semantic shifts that signature diffing misses. A method that gained a new parameter often has new behavior the diff alone won't reveal.
Forgetting to bump the freshness banner after a major release. A skill that says "Authored against iOS 26.x" when iOS 27 has shipped misleads downstream agents. Bumping is part of the procedure, not optional.
Updating SKILL.md instead of latest-apis.md. The static skill content is supposed to age slowly; it explains mental models, not signatures. Rapid-churn signatures live in the sidecar so the SKILL.md remains stable across point releases. If a SKILL.md update is genuinely warranted, that's a separate edit, not part of this refresh.
Writing the diff report straight into the repo. Reports are ephemeral. Write to /tmp/ (or a refresh-reports/ directory git-ignored at the repo root) so the repo doesn't accumulate stale audit trails.
txt-apple-docs — the documentation-pipe skill: how to invoke Sosumi MCP and xcrun mcpbridge from agentsAGENTS.md — repo-level authoring rules including the freshness contract that this skill operationalizesxcrun mcpbridge setup and tool referencetools
Integrate Writing Tools into UITextView, NSTextView, custom UITextInput views, or fully custom editors via UIWritingToolsCoordinator. Configure writingToolsBehavior and allowedWritingToolsResultOptions, declare protected ranges via writingToolsIgnoredRangesInEnclosingRange, gate edits with isWritingToolsActive, and pause syncing in willBegin/didEnd. Trigger on 'Apple Intelligence rewrite', 'AI summarize selection', 'compose with AI', 'why won't Writing Tools appear', or 'rewrite is breaking my code blocks' even without UIWritingToolsCoordinator named. Use when Writing Tools is missing from the menu, only the panel mode appears, rewrites corrupt code blocks, the inline animation isn't running, or a custom text engine needs to adopt UIWritingToolsCoordinator. Do NOT use for diagnosing general TextKit 1 fallback symptoms — see txt-fallback-triggers.
tools
Wrap UITextView (UIViewRepresentable) and NSTextView (NSViewRepresentable) inside SwiftUI without breaking editing. Covers binding sync, infinite-update-loop guards, cursor preservation across programmatic mutations, focus / first-responder bridging, auto-sizing strategies, environment value propagation, toolbar integration, and the iOS vs macOS scroll-view differences. Use when building or debugging a SwiftUI text-view wrapper, when cursor jumps after typing, when binding updates don't propagate, when @FocusState seems ignored, or when a wrapped editor won't size to its content. Do NOT use for picking which view class (txt-view-picker) or for which AttributedString attributes survive the SwiftUI boundary (txt-swiftui-interop).
tools
Configure TextKit 2 viewport-driven layout, NSTextLayoutFragment / NSTextLineFragment geometry, and rendering attributes vs storage attributes. Covers NSTextViewportLayoutController callbacks, layoutFragmentFrame vs renderingSurfaceBounds, line-fragment local coordinates, the extra trailing line fragment, exclusion paths that split a visual line, lineFragmentPadding vs container insets, font substitution via fixAttributes, and visible/overscroll/estimated regions. Use when working with custom layout fragments, debugging clipped diacritics or descenders, computing document coordinates from a line fragment, integrating with a custom scroll view, or when scroll-bar behavior under estimated heights is the visible problem. Do NOT use for symptom-driven debugging (txt-textkit-debug), the invalidation model (txt-layout-invalidation), or the TextKit 2 API surface in general (txt-textkit2).
development
Choose between SwiftUI Text/TextField/TextEditor, UIKit UITextView, and AppKit NSTextView. Capability comparison, tradeoffs, and decision criteria for read-only display vs single-line input vs multi-line editing vs rich attributed editing vs TextKit access. Use when the user asks "which text view should I use," "should I use TextField or TextEditor," "do I need UITextView for this," or describes a feature without naming a view class. Do NOT use for wrapping UITextView in SwiftUI — see txt-wrap-textview. Do NOT use for SwiftUI/TextKit attribute compatibility rules — see txt-swiftui-interop. Do NOT use for the iOS 26 SwiftUI TextEditor rich-text APIs themselves — see txt-swiftui-texteditor.