{
  "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"
    }
  ]
}