agentsclimarketplace

Run2 scala json navigation

Skill cxcscmu/SkillLearnBench/skills/b2-self-feedback-gemini-3-flash-preview/python-scala-translation/run2_scala-json-navigation

Improved JSON path navigation using Circe cursors in Scala.From its SKILL.md

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

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

SKILL.md

1.0 KB, 223 tokens by cl100k_base, as published. Nobody here has run it

Circe JSON Navigation

io.circe.ACursor provides a robust way to navigate JSON structures.

Path Extraction

import io.circe.Json
import io.circe.syntax._

def navigatePath(json: Json, path: String): Option[Json] = {
  val parts = path.split('.')
  parts.foldLeft(Option(json.hcursor)) { (cursor, part) =>
    cursor.flatMap { c =>
      // Try treating part as object key
      val downField = c.downField(part)
      if (downField.succeeded) Some(downField)
      else {
        // Try treating part as array index
        Try(part.toInt).toOption.flatMap { idx =>
          val downN = c.downN(idx)
          if (downN.succeeded) Some(downN) else None
        }
      }
    }
  }.flatMap(_.focus)
}

JSON Tokenization

  • Use noSpaces for compact token.
  • Use spaces2 for pretty token.
  • Circe natively handles recursive Json objects.

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.