Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/rshankras/claude-code-apple-skills/attributed-stringnpx skills add rshankras/claude-code-apple-skills --skill attributed-stringgit clone --depth 1 https://github.com/rshankras/claude-code-apple-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/attributed-string)<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/attributed-string"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/attributed-string.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00037 | $0.02547 |
| Opus 5 | $0.00018 | $0.01273 |
| Sonnet 5 | $0.00007 | $0.00509 |
| Haiku 4.5 | $0.00004 | $0.00255 |
Grade A, and why
attributed-string scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 314 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AttributedString Patterns
Correct API shapes and patterns for Foundation's AttributedString. Covers creating styled text, applying attributes to ranges, text alignment, writing direction, line height control, text selection and editing, discontiguous substrings, and SwiftUI integration.
When This Skill Activates
Use this skill when the user:
- Asks about AttributedString creation or manipulation
- Wants to style text with fonts, colors, underlines, or other attributes
- Mentions text alignment, writing direction, or line height
- Asks about text selection or text editing with AttributedString
- Wants to work with DiscontiguousAttributedSubstring or RangeSet
- Mentions TextEditor with AttributedString in SwiftUI
- Asks about rich text formatting in Swift
- Wants to replace or modify text within an AttributedString
- Mentions paragraphStyle, textSelectionAffinity, or AttributedTextSelection
Decision Tree
What do you need with AttributedString?
|
+-- Create or style text
| |
| +-- Simple inline attributes (font, color)
| | --> Creating and Styling section
| |
| +-- Paragraph-level formatting (alignment, line height)
| --> Text Alignment and Formatting section
|
+-- Control text layout
| |
| +-- Writing direction (LTR / RTL)
| | --> Writing Direction and Line Height section
| |
| +-- Line spacing / height
| --> Writing Direction and Line Height section
|
+-- Edit or select text programmatically
| |
| +-- Replace selection with characters or AttributedString
| | --> Text Selection and Editing section
| |
| +-- Work with multiple non-contiguous ranges
| --> DiscontiguousAttributedSubstring section
|
+-- Display in SwiftUI
--> SwiftUI Integration section
API Availability
| API | Minimum Version | Notes |
|---|---|---|
AttributedString |
iOS 15 / macOS 12 | Swift-native replacement for NSAttributedString |
AttributedString.paragraphStyle |
iOS 15 / macOS 12 | Uses NSMutableParagraphStyle |
AttributedString.writingDirection |
iOS 26 / macOS 26 | New in 2025 |
AttributedString.LineHeight |
iOS 26 / macOS 26 | .exact(points:), .multiple(factor:), .loose |
AttributedString.alignment |
iOS 26 / macOS 26 | .left, .center, .right |
AttributedTextSelection |
iOS 26 / macOS 26 | Programmatic text selection |
replaceSelection(_:withCharacters:) |
iOS 26 / macOS 26 | Replace selection with plain characters |
replaceSelection(_:with:) |
iOS 26 / macOS 26 | Replace selection with AttributedString |
DiscontiguousAttributedSubstring |
iOS 26 / macOS 26 | Non-contiguous range selections |
AttributedString.utf8 |
iOS 26 / macOS 26 | UTF-8 code unit view |
TextEditor(text:selection:) with AttributedString |
iOS 26 / macOS 26 | SwiftUI rich text editing |
.textSelectionAffinity(_:) |
iOS 26 / macOS 26 | Control cursor affinity at line boundaries |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 314 lines · 37 tokens per session scan A 82c403a3ae62
attributed-string is a skill published in the GitHub repository rshankras/claude-code-apple-skills (696 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 2,547 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
aso-playbook
Beginner-friendly App Store Optimization guide covering keyword research, screenshot design, rating management, and A/B testing for iOS and Android. By @WeiYipei — practical ASO for indie developers and small teams.
spectra-apply
Implement or resume tasks from a Spectra change.
spectra-propose
Create a change proposal with all required artifacts.
troubleshoot-tcc
Diagnose and fix macOS TCC (Calendar/Reminders) permission issues for che-ical-mcp. Use when user reports calendar tools failing silently, "permission denied" errors, missing TCC dialog after reinstall/upgrade, or asks "為什麼 calendar 不能用". Walks through both TCC layers — the CheICalMCP binary's own grant AND the…
archive-event
Archive a meeting or event into Calendar from a narrative source — a meeting notice, an announcement, a message thread — deriving the time from the thread's authoritative correction, recording the source in the event notes, and labelling any value the source did not state. Use when the user hands over a notice…
spectra-audit
Audit changed code for security sharp edges — dangerous defaults, type confusion, and silent failures.