{
  "patterns": [
    {
      "id": "swp_visitor_pattern_example",
      "name": "Custom MarkupWalker visitor (e.g. citation extraction)",
      "category": "parsing",
      "description": "A concrete struct conforming to MarkupWalker can override per-node-type visit methods (e.g. visitLink) to extract specific data while traversing, calling descendInto(node) to continue the walk into children.",
      "source_reference": "Markdown module",
      "api_surface": "struct CitationExtractor: MarkupWalker { var citations: [String] = []; mutating func visitLink(_ link: Link) { if link.destination?.hasPrefix(\"csl:\") == true { citations.append(link.destination!) }; descendInto(link) } }",
      "source_doc": "style-swift-markdown/SKILL.md",
      "created_at": "2026-07-02 04:47:01",
      "cite_as": "https://subagentswift.com/api/patterns/swp_visitor_pattern_example"
    },
    {
      "id": "swp_document_parsing",
      "name": "Document(parsing:)",
      "category": "parsing",
      "description": "Entry point for parsing a markdown source string into a Document AST node, from the Markdown module.",
      "source_reference": "Markdown module",
      "api_surface": "let document = Document(parsing: source)",
      "source_doc": "style-swift-markdown/SKILL.md",
      "created_at": "2026-07-02 04:47:01",
      "cite_as": "https://subagentswift.com/api/patterns/swp_document_parsing"
    },
    {
      "id": "swp_ast_node_types",
      "name": "Markup AST node types",
      "category": "parsing",
      "description": "The full set of AST node types swift-markdown parses markdown into: Markup (root), Document, Heading, Paragraph, Text, Strong, Emphasis, CodeBlock, InlineCode, Link, Image, ListItem, OrderedList, UnorderedList, ThematicBreak, BlockQuote, HTMLBlock, SoftBreak, LineBreak, Table, TableHead, TableBody, TableRow, TableCell, Strikethrough, TaskListItem.",
      "source_reference": "Markdown module",
      "api_surface": null,
      "source_doc": "style-swift-markdown/SKILL.md",
      "created_at": "2026-07-02 04:47:01",
      "cite_as": "https://subagentswift.com/api/patterns/swp_ast_node_types"
    },
    {
      "id": "swp_markupwalker",
      "name": "MarkupWalker",
      "category": "parsing",
      "description": "A visitor-pattern protocol for read-only traversal of the parsed Markup AST, used e.g. to walk a Document after parsing.",
      "source_reference": "Markdown module",
      "api_surface": "var walker = MarkupWalker(); walker.visit(document)",
      "source_doc": "style-swift-markdown/SKILL.md",
      "created_at": "2026-07-02 04:47:01",
      "cite_as": "https://subagentswift.com/api/patterns/swp_markupwalker"
    },
    {
      "id": "swp_package",
      "name": "anthropics/swift-markdown package",
      "category": "parsing",
      "description": "Swift-native CommonMark parser and AST. A fork of swiftlang/swift-markdown maintained in the Anthropic GitHub org, added via Swift Package Manager.",
      "source_reference": "Package.swift",
      "api_surface": ".package(url: \"https://github.com/anthropics/swift-markdown.git\", from: \"0.5.0\")",
      "source_doc": "style-swift-markdown/SKILL.md",
      "created_at": "2026-07-02 04:47:01",
      "cite_as": "https://subagentswift.com/api/patterns/swp_package"
    },
    {
      "id": "swp_parity_oracle",
      "name": "swift-markdown as a parity oracle",
      "category": "parsing",
      "description": "style-markdown uses swift-markdown as a secondary conformance check, diffing remark output against swift-markdown output for the CommonMark+GFM subset both support, via scripts/swift-markdown-parity.sh.",
      "source_reference": "style-markdown skill (cross-reference)",
      "api_surface": "scripts/swift-markdown-parity.sh",
      "source_doc": "style-swift-markdown/SKILL.md",
      "created_at": "2026-07-02 04:47:01",
      "cite_as": "https://subagentswift.com/api/patterns/swp_parity_oracle"
    },
    {
      "id": "swp_citation_rendering",
      "name": "Citation footnote rendering",
      "category": "rendering",
      "description": "For mailbox-mcp envelopes displayed in iOS, citations of the form [^csl:id] are rendered as tappable superscript footnotes using MarkdownUI inline links.",
      "source_reference": "MarkdownUI module",
      "api_surface": "Markdown(\"Result from alignment team.[^csl:huntley2025ralph]\").markdownTheme(.anthropic)",
      "source_doc": "style-swift-markdown-ui/SKILL.md",
      "created_at": "2026-07-02 04:47:01",
      "cite_as": "https://subagentswift.com/api/patterns/swp_citation_rendering"
    },
    {
      "id": "swp_markdown_view",
      "name": "Markdown(_:) view",
      "category": "rendering",
      "description": "The core SwiftUI view type from MarkdownUI that renders a markdown string directly, used inside a normal SwiftUI view body.",
      "source_reference": "MarkdownUI module",
      "api_surface": "Markdown(content).markdownTheme(.gitHub)",
      "source_doc": "style-swift-markdown-ui/SKILL.md",
      "created_at": "2026-07-02 04:47:01",
      "cite_as": "https://subagentswift.com/api/patterns/swp_markdown_view"
    },
    {
      "id": "swp_markdowntheme",
      "name": "MarkdownTheme",
      "category": "rendering",
      "description": "The theming API for customizing how each markdown element renders — e.g. .text{} and .code{} builder methods that configure font, color, padding, and background per element type.",
      "source_reference": "MarkdownUI module",
      "api_surface": "extension MarkdownTheme { static let anthropic = MarkdownTheme().text { $0.label.font(.body) }.code { $0.label.font(.system(.body, design: .monospaced)).padding(8) } }",
      "source_doc": "style-swift-markdown-ui/SKILL.md",
      "created_at": "2026-07-02 04:47:01",
      "cite_as": "https://subagentswift.com/api/patterns/swp_markdowntheme"
    },
    {
      "id": "swp_platform_support",
      "name": "Platform support",
      "category": "rendering",
      "description": "swift-markdown-ui supports iOS 15+, macOS 12+, tvOS 15+, and watchOS 8+.",
      "source_reference": "Package.swift platform requirements",
      "api_surface": null,
      "source_doc": "style-swift-markdown-ui/SKILL.md",
      "created_at": "2026-07-02 04:47:01",
      "cite_as": "https://subagentswift.com/api/patterns/swp_platform_support"
    },
    {
      "id": "swp_supported_elements",
      "name": "Supported rendered elements",
      "category": "rendering",
      "description": "The full set of markdown elements swift-markdown-ui renders: headings (1-6), paragraphs, bold/italic/strikethrough, code blocks with syntax highlighting, inline code, links, images (remote + local), ordered and unordered lists, task lists, block quotes, tables, thematic breaks, and HTML blocks (limited support).",
      "source_reference": "MarkdownUI module",
      "api_surface": null,
      "source_doc": "style-swift-markdown-ui/SKILL.md",
      "created_at": "2026-07-02 04:47:01",
      "cite_as": "https://subagentswift.com/api/patterns/swp_supported_elements"
    },
    {
      "id": "swp_ui_package",
      "name": "anthropics/swift-markdown-ui package",
      "category": "rendering",
      "description": "Native SwiftUI markdown renderer. A fork of gonzalezreal/swift-markdown-ui maintained in the Anthropic GitHub org, added via Swift Package Manager.",
      "source_reference": "Package.swift",
      "api_surface": ".package(url: \"https://github.com/anthropics/swift-markdown-ui.git\", from: \"2.4.0\")",
      "source_doc": "style-swift-markdown-ui/SKILL.md",
      "created_at": "2026-07-02 04:47:01",
      "cite_as": "https://subagentswift.com/api/patterns/swp_ui_package"
    }
  ]
}