Skip to content

dpearson2699/swift-ios-skills / skills/natural-language

natural-language

Verified

Tokenize, tag, and analyze natural language text using Apple's NaturalLanguage framework and translate between languages with the Translation framework. Use when adding language identification, sentiment analysis, named entity recognition, part-of-speech tagging, text embeddings, or in-app translation to iOS/macOS/visionOS apps.

FileKindSize
SKILL.mdskill md13.8 KB
evals/evals.jsonconfig4.3 KB
references/translation-patterns.mdmarkdown9.5 KB

evals/evals.json

View on GitHub
{
  "skill_name": "natural-language",
  "evals": [
    {
      "id": 0,
      "name": "text-analysis-pipeline",
      "prompt": "I'm adding an iOS 26 inbox feature that detects the message language, tokenizes words, extracts people and organizations, computes a sentiment score, and finds semantically similar keywords for search suggestions. Sketch the NaturalLanguage implementation and review checklist.",
      "expected_output": "A NaturalLanguage implementation outline that uses NLTokenizer, NLLanguageRecognizer, NLTagger, and NLEmbedding accurately, handles language/support limits, and avoids thread-safety and per-token tagger mistakes.",
      "files": [],
      "expectations": [
        "Uses NLTokenizer with the correct token unit and keeps tokenizer/tagger instances confined to one thread or dispatch queue at a time.",
        "Uses NLLanguageRecognizer with languageConstraints or languageHints when text is short or expected languages are known.",
        "Uses NLTagger with .nameType, .sentimentScore, and appropriate options such as .omitWhitespace, .omitPunctuation, and .joinNames.",
        "Treats sentiment and tags as optional and handles unsupported languages or missing tag schemes instead of force-unwrapping.",
        "Checks NLEmbedding word or sentence embedding availability and does not assume embeddings exist for every language."
      ]
    },
    {
      "id": 1,
      "name": "translation-availability-review",
      "prompt": "Review this SwiftUI translation plan: use the system translation popover on iOS 17.4, use TranslationSession and .translationTask for programmatic batch translation on the same deployment target, prefer .highFidelity because it can use a server, and ignore errors because the framework downloads languages automatically.",
      "expected_output": "A correction-focused Translation framework review that splits API availability, keeps translation on-device, handles language availability and throwing APIs, and explains SwiftUI and direct-session usage safely.",
      "files": [],
      "expectations": [
        "Separates translationPresentation availability from TranslationSession, translationTask, LanguageAvailability, and batch translation availability.",
        "Corrects highFidelity/lowLatency guidance without claiming TranslationSession sends content to a server.",
        "Uses LanguageAvailability status checks and handles .installed, .supported, and .unsupported.",
        "Wraps TranslationSession throwing calls such as translate, translations(from:), and prepareTranslation in error handling.",
        "Explains that direct TranslationSession(installedSource:target:) outside SwiftUI requires installed languages, while SwiftUI translationTask can request downloads."
      ]
    },
    {
      "id": 2,
      "name": "sibling-boundary-routing",
      "prompt": "I have one feature request: scan text from a receipt image, transcribe a spoken note, tokenize and identify the language of the resulting text, detect names and sentiment, find semantically similar keywords with embeddings, maybe add a custom text classifier/tagger, translate a summary to Spanish, localize UI strings with String Catalogs (.xcstrings), plurals, RTL, date and currency formatting, and maybe use Apple Intelligence to generate the summary. Which parts belong in the NaturalLanguage skill and which should be handed to sibling skills?",
      "expected_output": "A boundary-aware routing answer that keeps NaturalLanguage/Translation responsible for text analysis and translation, and routes OCR, speech transcription, localization, and generative summarization to the appropriate sibling skills.",
      "files": [],
      "expectations": [
        "Keeps tokenization, language identification, named entity recognition, sentiment analysis, embeddings, and in-app translation in the natural-language scope.",
        "Routes receipt-image OCR to the Vision framework skill rather than treating NaturalLanguage as OCR.",
        "Routes spoken-note transcription to the Speech framework skill rather than treating NaturalLanguage as speech recognition.",
        "Routes UI strings, String Catalogs, pluralization, and locale-aware formatting to the iOS localization skill.",
        "Routes Apple Intelligence or generative summarization to the on-device AI skill rather than presenting NaturalLanguage as a generative LLM framework."
      ]
    }
  ]
}
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall