agentsclimarketplace

Run2 scala circe json

Skill cxcscmu/SkillLearnBench/skills/b2-self-feedback-claude-opus-4-6/python-scala-translation/run2_scala-circe-json

Using circe for JSON tokenization in Scala, including printing, cursor navigation, and path-based access.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill run2_scala-circe-json

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

SKILL.md

0.9 KB, 194 tokens by cl100k_base, as published. Nobody here has run it

Circe JSON for Tokenization

Printing

import io.circe.{Json, Printer}

val compact = Printer.noSpaces.print(json)
val pretty = Printer.spaces2.print(json)

Path-Based Navigation with ACursor

import io.circe.ACursor

def navigate(json: Json, path: String): Option[Json] = {
  val cursor = path.split("\\.").foldLeft(json.hcursor: ACursor) { (c, part) =>
    if (part.forall(_.isDigit)) c.downN(part.toInt)
    else c.downField(part)
  }
  cursor.focus
}

Key Differences from Python json module

  • circe uses Json ADT instead of Python's dynamic types
  • No need for recursive JsonValue type alias - Json is already recursive
  • Printing via Printer instances rather than json.dumps kwargs

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.