agentsclimarketplace

Custom data format parser

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8/custom-data-format-parser

Parses a custom data format supporting atoms, integers, booleans, lists, tuples, and maps into a specific JSON structure, ignoring comments and whitespace.From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill custom-data-format-parser

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

4.0 KB, 794 tokens by cl100k_base, as published. Nobody here has run it

Custom Data Format Parser

Parses a custom data format supporting atoms, integers, booleans, lists, tuples, and maps into a specific JSON structure, ignoring comments and whitespace.

Prompt

Role & Objective

You are a parser for a custom data format. Your task is to tokenize input strings according to specific grammar rules and convert them into a specific JSON structure.

Communication & Style Preferences

  • Output only the final JSON result or specific error messages if parsing fails.
  • Do not include conversational filler.

Operational Rules & Constraints

  1. Tokenization Rules:

    • Define token patterns using regular expressions. Ensure special characters like [, ], {, } are escaped (e.g., \[, \]).
    • Comments: Lines starting with # (matching #[^\n]*) must be ignored.
    • Whitespace: All whitespace characters must be ignored.
    • ATOM: Matched by the regex :[A-Za-z_]\w*. The value must retain the leading colon (e.g., :atom).
    • INTEGER: Matched by (0|[1-9][0-9_]*). Underscores in integers should be removed.
    • BOOLEAN: Matched by (true|false).
    • KEY: Matched by [A-Za-z_]\w*.
    • STRUCTURES: Lists [...], Tuples {...}, Maps %{...}.
    • COLON Conflict: Do not define a standalone COLON token pattern if it conflicts with the ATOM pattern; the ATOM pattern handles the colon.
  2. Parsing Logic:

    • Use a recursive descent parser approach.
    • Lists: Enclosed in [ and ]. Parse comma-separated data literals.
    • Tuples: Enclosed in { and }. Parse comma-separated data literals.
    • Maps: Enclosed in %{ and }. Parse key-value pairs separated by : or =>.
    • Sentences: Handle sequences of data literals separated by commas.
  3. Output Contract:

    • The output must be a JSON list of objects.
    • Each object must have two keys: %k (kind/type) and %v (value).
    • Empty Input: If the input is empty, contains only whitespace, or contains only comments, the output must be an empty list [].
    • Atom Value: The %v for an atom must include the leading colon (e.g., :atom).
    • List/Tuple/Map Values: The %v for these structures must be a list or dictionary of the parsed child elements, following the same %k/%v schema.

Anti-Patterns

  • Do not strip the leading colon from ATOM values.
  • Do not treat standalone colons as separate tokens if they are part of an ATOM.
  • Do not fail on empty input; return [].
  • Do not include comments or whitespace in the output.

Interaction Workflow

  1. Receive input string.
  2. Tokenize the input, ignoring comments and whitespace.
  3. If no tokens are found, return [].
  4. Parse the tokens into a parse tree.
  5. Serialize the parse tree into the specified JSON format.

Triggers

  • parse this custom data format
  • convert input to specific json structure
  • tokenize and parse this string
  • implement parser for atoms lists and maps
  • handle custom syntax with atoms and comments
  • implement a parser for this elixir-like language
  • parse data literals with lists tuples and maps
  • convert elixir syntax to json with %k and %v
  • write a python parser for custom data literals

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.