spec first language engineering

    1

    A specification-first workflow for AI agents building and changing programming languages, compilers, parsers, interpreters, type systems, and language tooling.

    $12

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    spec first language engineering

    Example session with this skill installed

    Add a language feature without breaking the language contract

    Add a new match expression feature to an existing programming language implementation.

    Before changing code

    • inspect the language specification and existing syntax/semantic rules;
    • identify the parser, AST, semantic analysis, and execution/code-generation paths involved;
    • establish the current baseline;
    • identify any pre-existing changes and preserve them.

    Define the feature contract before implementation, including valid syntax, invalid syntax, evaluation semantics, error behavior, and compatibility with existing programs.

    Implement the smallest complete change required.

    Do not redesign unrelated compiler components, rewrite working parser code, or introduce unrelated refactors.

    After implementation, verify the feature against the contract using focused positive and negative cases, existing regression tests, and the project's normal validation commands.

    Inspect the final change scope and report exactly what changed, what was verified, and any limitations.

    • Read your context and instructions
    • Compiled the spec first language

    Change Contract

    ** Feature
    **Add match expressions to an existing programming language.

    Required behavior
    
    • Valid match syntax must parse according to the language grammar.
    • Invalid forms must produce the language's normal syntax errors.
    • The AST must represent the new construct explicitly.
    • Semantic analysis must validate the construct according to the language's existing type/name rules.
    • Runtime or code-generation behavior must follow the defined evaluation semantics.
    • Existing language behavior must remain unchanged outside the feature.

    Protected scope

    • Existing syntax rules
    • Existing parser architecture
    • Existing AST conventions
    • Existing semantic-analysis behavior
    • Existing runtime/code-generation behavior unrelated to match
    • Pre-existing user changes

    Baseline

    Before editing, the agent should inspect:

    1. The language specification.
    2. Existing grammar/parser definitions.
    3. AST node definitions.
    4. Semantic-analysis or type-checking logic.
    5. Runtime or code-generation handling.
    6. Existing positive and negative tests.
    7. Repository status and current validation commands.

    Pre-existing changes are treated as protected and are not reset, stashed, overwritten, or silently incorporated into the feature.

    Implementation Plan

    The feature is implemented in the smallest complete sequence:

    1. Define the syntax and semantic contract.
    2. Extend the grammar/parser.
    3. Add the corresponding AST representation.
    4. Add semantic validation.
    5. Add runtime or code-generation behavior.
    6. Add focused positive and negative tests.
    7. Run the existing project validation.
    8. Inspect the final diff for unrelated changes.

    No unrelated refactor is required.

    Verification Evidence

    Syntax

    Verify valid match programs parse successfully.

    Negative syntax

    Verify malformed match expressions fail with the expected diagnostic behavior.

    Semantics

    Verify valid and invalid patterns, branches, names, and types according to the language specification.

    Execution

    Verify representative match expressions produce the expected result.

    Regression

    Run the project's existing test suite or equivalent validation and confirm unrelated language behavior remains intact.

    Scope

    Inspect the final diff and confirm that only files required for the feature changed.

    Final Report

    The agent should finish by reporting

    • Changed: the exact parser, AST, semantic, runtime/code-generation, and test changes made.
    • Verified: the exact commands and focused cases used for validation.
    • Scope: what was deliberately not changed.
    • Evidence: test/build/conformance results and final diff inspection.
    • Limitations: any behavior that could not be verified.
    • Recovery: how the change can be isolated or reverted through the repository's normal version-control workflow.

    The skill does not treat a successful compilation as proof of language correctness. The implementation is considered complete only when the specified behavior and its conformance evidence have been established.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Language engineering projects often fail when AI agents generate plausible code that silently breaks grammar rules, precedence, or type safety. This skill enforces a specification-first workflow to ensure every change to a compiler, interpreter, or parser is verified against explicit language contracts.

    What it does

    • Define language contracts by establishing behavior for accepted forms, rejected forms, and precedence before any code is edited.
    • Map implementation layers to identify exactly which components—from lexers and AST nodes to semantic analysis and code generation—require modification.
    • Generate executable examples that serve as the ground truth for positive, negative, and boundary cases.
    • Perform multi-layer verification including lexical, parsing, AST, and semantic checks to confirm the fix works across the entire pipeline.
    • Protect against regressions by testing interactions with nearby syntax, keywords, and existing control flow structures.

    How it works

    1. Establish the contract by identifying the source of truth, such as EBNF definitions or language specifications, and documenting the required behavior.
    2. Trace the impact across the implementation layers to find the smallest coherent set of changes needed.
    3. Draft conformance tests that turn the language rule into reproducible examples before modifying the codebase.
    4. Execute and verify the change using specific checks for diagnostics, AST invariants, and runtime behavior.

    Frameworks & tools

    This skill is tool-agnostic and works with any language engineering stack, including LLVM, Tree-sitter, ANTLR, Bison/Yacc, or custom hand-written recursive descent parsers and type checkers.

    Why this beats prompting it yourself

    Standard prompts often lead to "fix-and-check" loops where the agent fixes one syntax error only to break operator precedence or type inference elsewhere. This skill forces a rigorous engineering discipline that treats the language specification as the authoritative guide, preventing silent architectural drift and broken invariants.

    Use cases

    • Adding new syntax like a pipe operator or destructuring assignment while maintaining correct associativity.
    • Modifying type systems to support new narrowings, coercions, or inference rules without breaking existing code.
    • Refactoring parsers to improve error recovery or diagnostic messages for invalid inputs.
    • Porting compilers between intermediate representations while verifying semantic equivalence.

    Known limitations

    Does not replace formal verification tools, CI systems, or human design review. It cannot resolve ambiguities in a specification without user clarification.

    Requires an existing specification or authoritative reference. Cannot resolve specification ambiguities without user input. Does not replace formal verification or CI systems.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed today

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    File Scopes

    **

    This skill requires project file read/write access and terminal access to inspect language specifications, implement bounded language changes, run existing validation and conformance tests, and inspect the final change scope. It does not require external accounts, credentials, browser access, network access, environment variables, or third-party services.

    Listedtoday

    What's inside

    Frequently Asked Questions

    This skill solves the 'fragile fix' problem where AI agents break language grammar or precedence rules while attempting to add new features or fix bugs in a compiler. It enforces a rigorous, contract-driven workflow that ensures every change is verified against the language specification before implementation begins.

    The skill is tool-agnostic and designed to work with any major AI agent (such as Claude or GPT-4) and any language stack, including LLVM, ANTLR, Tree-sitter, or custom recursive descent parsers. It focuses on the engineering logic rather than specific programming language syntax.

    You will receive the specialized 'Spec First' system prompts, structured workflow templates for impact mapping, and a library of verification protocols designed to guide AI agents through complex language engineering tasks. These assets act as a roadmap for the agent to maintain architectural integrity.

    This skill is ideal for adding new syntax (like async/await or pattern matching), updating type-checking rules, refactoring AST nodes, or improving parser error diagnostics. It is particularly effective for any task where maintaining strict semantic invariants is critical.

    Setup is minimal; you simply provide the AI agent with the skill's core protocols and your current language specification (like an EBNF grammar). The skill then guides the agent to analyze your existing codebase and map out the necessary implementation layers.

    While the skill excels at identifying logical conflicts and enforcing grammar rules, it does not replace formal verification tools or human review for high-level architectural decisions. It also cannot automatically resolve inherent ambiguities in your language design without user input.