parser-engineer

Parse Plank source files into error-resilient concrete syntax trees.

64|21|Updated Nov 19, 2025
One-click install
npx skills add https://github.com/plankevm/plank-monorepo --skill parser-engineer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: parser-engineer
Source: https://github.com/plankevm/plank-monorepo/tree/main/plankc/.claude/skills/parser-engineer
Command: npx skills add https://github.com/plankevm/plank-monorepo --skill parser-engineer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides concrete guidance and patterns to develop an LSP-quality, error-resilient parser for the Plank language, ensuring the parser never crashes and always represents all input (including malformed code) in the CST for downstream tooling and diagnostics.

Core Features & Use Cases

  • Error resilience: Consume all input, wrap unexpected tokens in error nodes, emit diagnostics, and continue parsing to maximize recovered structure.
  • CST-first representation: Design nodes and node-child relationships so semantics are inferable from the tree structure without ad-hoc token inspection.
  • Practical parsing patterns: Use guard checks, iterative loops for variable-length constructs, precise expected-token tracking, and explicit node allocation/close lifecycle compatible with LSP and testing.
  • Testing and tooling: Snapshot-style CST tests, dedicated error recovery tests, and conventions for statement/expression parsing modes to ensure predictable behavior.

Quick Start

Ask the parser-engineer skill to analyze frontend/parser/src/parser.rs and report parse errors, emitted diagnostics with expected-token sets, and a high-level summary of the produced CST structure.

Frequently Asked Questions about parser-engineer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an error-resilient parser that doesn't crash on malformed tokens?

To build an error-resilient parser, consume all input including malformed tokens by wrapping unexpected fragments as error nodes within the concrete syntax tree. This ensures the parser never crashes and continues emitting diagnostics for downstream tooling.

What is CST-first parsing and how does it support LSP-grade tooling?

CST-first parsing designs node-child relationships so semantics are inferable directly from the tree structure without ad-hoc token inspection. This complete concrete syntax tree representation provides the structured foundation required for LSP-grade tooling and diagnostics.

How do I add new syntax constructs to a parser while tracking expected token sets?

Add syntax constructs using guard checks, iterative loops for variable-length constructs, and precise expected-token tracking. Explicitly manage node allocation and close lifecycle operations to emit accurate diagnostics when parsing fails.

How do I test parser error recovery and concrete syntax tree output?

Test error recovery using dedicated error recovery tests alongside snapshot-style CST tests. These validate that malformed input is correctly wrapped in error nodes and that the overall tree structure remains predictable.

Why does my parser drop input instead of representing unexpected fragments as error nodes?

A parser drops input when it lacks proper error recovery patterns to consume all input. You must wrap unexpected fragments as error nodes and continue parsing to maximize recovered structure within the concrete syntax tree.

Can I use parser-engineer for debugging tokenization in a Rust frontend crate?

Yes, you can use it to debug tokenization in a Rust frontend parser crate. It provides concrete guidance for frontend parser workflows including fixing parse errors and improving error recovery.