attributed-string

Installation
SKILL.md

AttributedString

Type-safe, value-semantic styled text on Apple platforms (Foundation, iOS 15+). The deep API reference — creation, every attribute scope, Markdown, custom attributes, AttributeContainer, runs, character/unicode views, Codable, SwiftUI Text, the iOS 26 rich-text TextEditor, and NSAttributedString conversion — lives in references/guide.md. This file is the decision and discipline layer: read it first, open the guide for specifics. For surrounding SwiftUI work (layout, state, view composition), use swiftui-pro.

Dials

Set these explicitly at the start; they change what "correct" means.

  1. RENDERER — swiftui (default; SwiftUI Text/TextEditor, use .swiftUI scope attributes: Color, Font) · uikit (UILabel/UITextView via NSAttributedString, use .uiKit scope: UIColor, UIFont, NSParagraphStyle). The scope you author must match the renderer or attributes silently drop.
  2. SOURCE — programmatic (build runs in code via attributes/AttributeContainer) · markdown (parse with init(markdown:options:) — pick the interpretedSyntax deliberately) · editable (iOS 26 TextEditor(text: $attributedString) for user-authored rich text).
  3. CUSTOM_ATTRS — none (system scopes only) · custom (your own AttributedStringKey + AttributeScope; needed for domain data, Codable round-trips, and ^[text](attr:) Markdown).

When to use

Building or reviewing any styled-text value: a Text with mixed styling, Markdown rendered in-app, a rich-text editor, attributed labels, or persisted styled content. If the work is general SwiftUI (layout, navigation, state) with no attributed text, use swiftui-pro instead.

Core rules

Installs
1
GitHub Stars
1
First Seen
Jun 18, 2026
attributed-string — moritztucher/swift-agent-skills