Smithery Logo
MCPsSkillsDocsPricing
Login
Smithery Logo

Accelerating the Agent Economy

Resources

DocumentationPrivacy PolicySystem Status

Company

PricingAboutBlog

Connect

© 2026 Smithery. All rights reserved.

    mcclowes

    textmate-grammar

    mcclowes/textmate-grammar
    Coding
    3

    About

    SKILL.md

    Install

    Install via Skills CLI

    or add to your agent
    • Claude Code
      Claude Code
    • Codex
      Codex
    • OpenClaw
      OpenClaw
    • Cursor
      Cursor
    • Amp
      Amp
    • GitHub Copilot
      GitHub Copilot
    • Gemini CLI
      Gemini CLI
    • Kilo Code
      Kilo Code
    • Junie
      Junie
    • Replit
      Replit
    • Windsurf
      Windsurf
    • Cline
      Cline
    • Continue
      Continue
    • OpenCode
      OpenCode
    • OpenHands
      OpenHands
    • Roo Code
      Roo Code
    • Augment
      Augment
    • Goose
      Goose
    • Trae
      Trae
    • Zencoder
      Zencoder
    • Antigravity
      Antigravity
    ├─
    ├─
    └─

    About

    Use when authoring TextMate grammars for syntax highlighting - covers scopes, patterns, and language injection

    SKILL.md

    TextMate Grammar Authoring

    Quick Start

    {
      "scopeName": "source.lea",
      "patterns": [
        { "include": "#comments" },
        { "include": "#keywords" },
        { "include": "#strings" }
      ],
      "repository": {
        "comments": {
          "name": "comment.line.double-dash.lea",
          "match": "--.*$"
        }
      }
    }
    

    Core Concepts

    Scope Naming Convention

    comment.line          - Line comments
    comment.block         - Block comments
    keyword.control       - if, else, match, return
    keyword.operator      - +, -, *, /, />
    storage.type          - let, maybe, context
    entity.name.function  - Function names
    variable.other        - Variables
    string.quoted.double  - "strings"
    constant.numeric      - Numbers
    constant.language     - true, false
    

    Pattern Types

    Match Pattern

    {
      "name": "keyword.control.lea",
      "match": "\\b(if|else|match|return)\\b"
    }
    

    Begin/End Pattern

    {
      "name": "string.quoted.double.lea",
      "begin": "\"",
      "end": "\"",
      "patterns": [
        {
          "name": "constant.character.escape.lea",
          "match": "\\\\."
        }
      ]
    }
    

    Captures

    {
      "match": "\\b(let)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*=",
      "captures": {
        "1": { "name": "storage.type.lea" },
        "2": { "name": "entity.name.function.lea" }
      }
    }
    

    Lea-Specific Patterns

    Pipe Operators

    {
      "name": "keyword.operator.pipe.lea",
      "match": "/>|/>>>|\\\\>|</"
    }
    

    Decorators

    {
      "name": "entity.name.decorator.lea",
      "match": "#[a-zA-Z_][a-zA-Z0-9_]*"
    }
    

    Type Annotations

    {
      "match": "(::)\\s*([A-Z][a-zA-Z0-9]*)\\s*(:>)\\s*([A-Z][a-zA-Z0-9]*)",
      "captures": {
        "1": { "name": "keyword.operator.type.lea" },
        "2": { "name": "entity.name.type.lea" },
        "3": { "name": "keyword.operator.return-type.lea" },
        "4": { "name": "entity.name.type.lea" }
      }
    }
    

    Functions

    {
      "begin": "\\(",
      "end": "\\)\\s*(->)",
      "endCaptures": {
        "1": { "name": "storage.type.function.arrow.lea" }
      },
      "patterns": [
        { "include": "#parameters" }
      ]
    }
    

    Testing

    Use VSCode's "Developer: Inspect Editor Tokens and Scopes" command to verify tokenization.

    Reference Files

    • references/scopes.md - Complete scope naming guide
    • references/regex.md - Oniguruma regex reference
    Recommended Servers
    Vercel Grep
    Vercel Grep
    LILT
    LILT
    InfraNodus Knowledge Graphs & Text Analysis
    InfraNodus Knowledge Graphs & Text Analysis
    Repository
    mcclowes/lea
    Files