OpenParable
Skip to content
← Back to skills

Grammar Design

Development

Grammar Design is an Agent Skill for development published in the a5c-ai/babysitter repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Expert skill for formal grammar design including disambiguation, precedence, and validation

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/a5c-ai/babysitter/blob/HEAD/library/specializations/programming-languages/skills/grammar-design/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/grammar-design, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Grammar Design Skill

Overview

Expert skill for formal grammar design including disambiguation, precedence, and validation.

Capabilities

  • Write EBNF/BNF grammar specifications
  • Design unambiguous grammars
  • Handle operator precedence and associativity
  • Analyze grammar conflicts
  • Design grammar for specific parser classes (LL, LR, PEG)
  • Document grammar with examples
  • Design syntax for common language constructs
  • Handle grammar evolution and backwards compatibility

Target Processes

  • language-grammar-design.js
  • lexer-implementation.js
  • parser-development.js

Dependencies

Parsing theory literature (Dragon Book, Parsing Techniques)

Usage Guidelines

  1. Notation: Use standard EBNF notation for grammar specifications
  2. Disambiguation: Make grammars unambiguous or document precedence rules
  3. Parser Class: Design grammar to fit target parser class (LL(k), LALR, PEG)
  4. Examples: Include examples for all grammar rules
  5. Evolution: Plan for backwards-compatible grammar evolution

Output Schema

{
  "type": "object",
  "properties": {
    "notation": {
      "type": "string",
      "enum": ["ebnf", "bnf", "peg", "antlr"]
    },
    "parserClass": {
      "type": "string",
      "enum": ["ll1", "llk", "lalr", "glr", "peg"]
    },
    "productionCount": { "type": "integer" },
    "conflicts": {
      "type": "array",
      "items": { "type": "string" }
    },
    "generatedFiles": {
      "type": "array",
      "items": { "type": "string" }
    }
  }
}