agentsclimarketplace

Run2 scala datetime handling

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

Robust temporal tokenization with Java 8 Time API and DateTimeFormatter.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill run2_scala-datetime-handling

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, 197 tokens by cl100k_base, as published. Nobody here has run it

Temporal Tokenization in Scala

Use java.time for all date/time operations.

Robust Formatting

Handle LocalDateTime, LocalDate, ZonedDateTime, and Instant.

import java.time.{LocalDate, LocalDateTime, ZonedDateTime, Instant}
import java.time.format.DateTimeFormatter

def formatTemporal(value: Any, fmtStr: Option[String]): String = {
  val isoFormat = DateTimeFormatter.ISO_LOCAL_DATE_TIME
  val dateFormat = DateTimeFormatter.ISO_LOCAL_DATE
  
  value match {
    case dt: LocalDateTime => 
      val fmt = fmtStr.map(DateTimeFormatter.ofPattern).getOrElse(isoFormat)
      dt.format(fmt)
    case d: LocalDate =>
      val fmt = fmtStr.map(DateTimeFormatter.ofPattern).getOrElse(dateFormat)
      d.format(fmt)
    case other => other.toString
  }
}

Pattern Matching on Any

Useful for implementing UniversalTokenizer's dispatch logic.

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.