[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BZTVYBMHPHXMBZ2SPTBN6B":3,"skill-same:01M7BZTVYBMHPHXMBZ2SPTBN6B":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7BZTVYBMHPHXMBZ2SPTBN6B","python-scala-idioms",null,"Guide for writing idiomatic Scala when translating from Python. Teaches the API-shape ↔ idiomatic axis — how to read the task statement to pick which pole applies — plus the operation rules for each pole.","linyouxue\u002Fskill-repair-benchmark","linyouxue","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F216151464?v=4","01M7BJEVCXKD74KH6FG9CBVSQB","林宥学","01M7BJEVE02NP217V93BKZFC0J",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fevaluation\u002Fresults\u002FSkillGrad\u002Fopus47_clean_20261016_partial14\u002Ftasks\u002Fpython-scala-translation\u002Frepaired_skill\u002Fpython-scala-idioms\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: python-scala-idioms\ndescription: Guide for writing idiomatic Scala when translating from Python. Teaches the API-shape ↔ idiomatic axis — how to read the task statement to pick which pole applies — plus the operation rules for each pole.\n---\n\n# Python to Idiomatic Scala Translation\n\n## Pick the API-shape ↔ idiomatic axis from the task statement\n\nTranslation tasks live on an axis with two poles that pull in opposite\ndirections. Pick BEFORE writing Scala — neither pole is correct by default.\n\n- **Pole (a) — Preserve the Python public API shape.** The evaluator calls\n  the Scala using Python names, Python-accepted argument types, and expects\n  Python return types verbatim. It also **reads string values back out of\n  maps and enums using the Python spellings**. Use overloads or `Any`+match\n  for unions, keep `snake_case` on keyword constructor params, do not wrap\n  return values in `Try`\u002F`Either`, do not force wrapper ADTs on callers,\n  keep Python enum member names verbatim (`STRING` stays `STRING`), keep\n  string-literal metadata keys and type tags verbatim (`\"original_type\"`\n  stays `\"original_type\"`), do not add methods or metadata keys not in\n  the Python source.\n- **Pole (b) — Idiomatic Scala for a \"proficient Scala developer\".** The\n  grader penalizes word-to-word translations. Use bounded generics \u002F sealed\n  ADTs \u002F type classes for TypeVars, `Try`\u002F`Either` for errors, persistent\n  immutable builders, `UpperCamelCase` enum members, locale-safe formatting.\n\n| Grep the task for … | Pole |\n|---|---|\n| \"same classes\u002Ffunctions as the Python source\", \"must have all classes and functions in the python code\", \"do the same thing\", named public APIs (methods\u002Fclasses) listed verbatim, \"preserve the Python public API\", \"same signatures\", an evaluator snippet with raw Python types, `snake_case` kwargs | **(a)** |\n| \"proficient Scala developer\", \"idiomatic Scala\", \"should not be a word-to-word translation\", \"proper abstractions for representing data\", \"handle errors naturally in Scala\", \"use the Scala type system\", \"immutable\" | **(b)** |\n| Both sets of phrases present | **mixed** — pole (a) at the public boundary, pole (b) in internals |\n\n### Required artifact — write before any Scala\n\nWrite these four lines at the top of your plan. If any line is empty,\nre-read the task statement before continuing:\n\n```\nNamed public APIs (verbatim from the task): \u003Clist>\nSignal phrase (verbatim quote from the task): \"\u003Cquote>\"\nChosen pole: (a) | (b) | mixed\nRaw-type evaluator call sites (derived from the named APIs, using ONLY\nPython-shaped types — no wrapper ADTs, no `.get` on `Try`, no `.right.get`\non `Either`, no translator-defined helpers):\n  \u003C2-3 call sites, e.g. `new StringTokenizer().tokenize(\"hello\"): Token`,\n   `TokenType.STRING: TokenType`, `token.withMetadata(Map(\"k\" -> v)): Token`>\n```\n\nThe ambient tone of these skill files leads toward pole (b) (\"idiomatic\nScala\", \"proficient developer\"). If the task names public APIs verbatim\nAND asks to \"do the same thing\" \u002F \"same classes\u002Ffunctions\" \u002F \"must have\nall classes and functions\", that is a pole-(a) signal that **overrides\nthe ambient tone**. The axis is not pinned by what feels Scala-idiomatic;\nit is pinned by signal phrases.\n\nIf signals are absent either way: default to pole (a) when the task shows\nan evaluator call site with raw Python types or lists public API names;\notherwise default to pole (b).\n\nRead `references\u002Ftask-statement-axis-calibration.md` for the required-\nartifact template, the full signal-phrase list, the mixed-case tactic,\nand worked pole-(a) \u002F pole-(b) decision examples. Skip when the four\nrequired-artifact lines above are all filled and the pole is unambiguous.\n\n## Translation workflow (do this before writing any Scala)\n\n0. **Pre-flight gate.** Confirm your plan contains all four of the\n   required-artifact lines above (Named APIs, Signal phrase, Chosen pole,\n   Raw-type call sites) BEFORE moving to step 1. If `Chosen pole:` is\n   absent or any raw-type call site uses a translator-defined wrapper\n   (`StrOrBytes.Str(...)`, `.get` on `Try`, `.right.get` on `Either`),\n   STOP — re-read `references\u002Ftask-statement-axis-calibration.md` and\n   fill the artifact. Do not emit Scala while the gate is open.\n1. **Read the Python source end to end, then enumerate every public\n   symbol from the file itself.** Confirm the last line read is EOF, not\n   a tool clip; continue with ranged reads (`sed -n`, `tail`) if clipped.\n   Then build the required-symbol checklist from the **Python source\n   file**, not from the task statement's example list:\n\n   ```bash\n   # Enumerate every public top-level symbol in the Python source\n   grep -nE '^class |^def |^[A-Z_][A-Z_0-9]* = ' \u003Cpython-file>\n   ```\n\n   The task statement's class\u002Ffunction list is **non-exhaustive by\n   default**. Open-ended wording (\"all classes\", \"every function\",\n   \"i.e. X, Y, Z\", \"e.g. X, Y, Z\", a bare parenthesized list) means\n   every public symbol in the Python file is required, with the quoted\n   list as examples. Only closed-list wording (\"only the following\n   classes\", \"exactly these\", \"limited to\") scopes the required set to a\n   subset. When the task's list and the Python file disagree, trust the\n   Python file.\n\n   Read `references\u002Fenumerate-python-symbols.md` when the task statement\n   contains a parenthesized or inline class\u002Ffunction list, or when you\n   are tempted to drop a Python class because it is not named in the\n   task. Skip when the task explicitly uses closed-list wording and the\n   closed set is tiny (≤ 3 symbols).\n2. **Record each symbol's signature AND each observable output value.**\n   For every entry in the checklist from step 1, record exact name\n   (preserve underscores), accepted argument types (including\n   union-typed params), **return type**, defaults, and (for enums)\n   **member identifiers verbatim** AND **`.value` strings verbatim**.\n   Then — on pole (a) or mixed — **run the Python module** on 3–5\n   representative inputs covering each `tokenize` overload \u002F enum\n   member \u002F metadata-writing path and paste the raw stdout under a\n   `# python recorded:` block in your plan. This becomes the source of\n   truth for every string literal, metadata key, and enum identifier the\n   Scala must produce.\n\n   ```bash\n   # Record Python's actual outputs — strings the evaluator will read back\n   python3 -c \"\n   from \u003Cmodule> import \u003CPublicClass>, \u003CPublicEnum>\n   for m in \u003CPublicEnum>: print(f'{m.name=} {m.value=!r}')\n   t = \u003CPublicClass>().\u003Cprimary_method>(\u003Crepresentative input>)\n   print(f'metadata={t.metadata!r}')\n   \"\n   ```\n\n   Read `references\u002Fexecute-python-for-ground-truth.md` when the Python\n   source stores string literals, enum members, or `type(x).__name__`\n   tags that evaluator code may read back. Skip when the Python source\n   writes no string literals and exposes no enum members, OR when the\n   axis step picked pole (b) with no mixed-case signals.\n3. **Verify against the task statement's criteria, not your own tests.**\n   Behavioural parity under hand-written tests is necessary but not\n   sufficient. Run the pole-specific checklist below:\n\n   - **Pole (a)**: (i) compile the raw-type call-site snippet from your\n     required artifact above. The snippet must exercise at least one API\n     per class in the Python source and use ONLY Python-shaped types —\n     no wrapper ADT, no `.get` on `Try`, no `.right.get` on `Either`, no\n     translator-defined helper imports. (ii) Every assertion in the\n     smoke test quotes a value from the `# python recorded:` block, not\n     a value invented while writing Scala. (iii) Diff every public\n     signature against the Python source: same method name, same\n     parameter names, same accepted types, **same return type (no\n     `Try` \u002F `Either` \u002F function wrapping)**, same `**kwargs`\u002Fenum\n     shape, **same enum member identifiers verbatim**, **same\n     dispatch shape (one entry vs overloads of the same name)**, **no\n     added public methods or metadata keys**, **no match arms on\n     `Some`\u002F`Success`\u002F`Right` for `Any`-dispatch methods**.\n   - **Pole (b)**: tick each non-functional criterion against a concrete\n     location in your Scala file: type-safety (no `extends .+\\[Any\\]`\n     where Python has a constrained TypeVar), error channel (no thrown\n     exceptions where `Try`\u002F`Either` fits), mutability (no `mutable.*` +\n     `var` in a public `*Builder`), enum\u002Ffield naming\n     (`UpperCamelCase` unless the task overrides), locale-safety (explicit\n     `Locale.ROOT` on numeric formatting).\n   - **Mixed**: run BOTH checklists — pole (b) on the internal\n     representation, pole (a) on the public boundary.\n\n   ```bash\n   # Fast pole-(a) scan — hits are candidate rewrites\n   grep -nE ': (Try|Either|Option)\\[|\\(String, Any\\)\\*|\\.getClass\\.getSimpleName|case (Some|Success|Right)\\b|\"[a-z]+[A-Z][a-zA-Z]*\" ->' Output.scala\n\n   # Fast pole-(b) scan\n   grep -nE '\\[Any\\]|throw new .*Exception|mutable\\.(ListBuffer|Map|Set)|\"%\\.[0-9]+f\"|case object [A-Z_]{2,}' Output.scala\n   ```\n\n   If any check fails: do not submit. Return to the corresponding section\n   below and apply the fix before re-running the check.\n\n   Read `references\u002Fverify-against-task-criteria.md` for the full\n   verification procedure, including a worked pole-(a) example that\n   derives the raw-type snippet from a task statement listing named APIs,\n   the §1.5 Python-output recording procedure, and the parallel pole-(b)\n   checklist with per-item remediations. Skip when the pole-specific\n   checklist above passes clean on first run AND (pole-a only) every\n   smoke-test assertion is traceable to a recorded Python value.\n\n## Preserve the Python public API shape (pole-a rules)\n\nApply when the axis step picked **pole (a)** or **mixed** (at the public\nboundary). Evaluator-visible divergences — not behavioral bugs — are the\ndominant failure mode on pole (a). All of the rules below share one\nmechanism: **the evaluator writes the Python identifier\u002Fshape AND reads\nthe Python string spelling; your Scala must accept and produce them\nunchanged**. The rules fall into two bands — identifiers (signatures,\nmember names) and values (string literals, dispatch shapes, added APIs).\n\n### Identifier-level rules\n\n- **Union-typed parameters (`A | B`)** → use method overloads or an\n  `Any`-typed parameter with internal pattern match. Do **not** force\n  the caller to wrap values in a sealed ADT.\n- **Runtime-dispatch classes stay as one class.** A Python class that\n  dispatches on `isinstance` under one class name becomes **one** Scala\n  class, not a parametric `Foo[A: Numeric]`.\n- **Return types verbatim.** If Python returns `T`, Scala returns `T` —\n  every wrapping form breaks pole (a): `Try[T]`, `Either[E, T]`,\n  `Option[T]` (when Python returns raw `T`), and **function-returning**\n  (`T => R` or `T => Either[E, R]` in place of `R`). If error-channel\n  idiomaticity is desired, add a parallel `methodTry` \u002F `methodEither`;\n  leave the primary `method: T` untouched.\n- **`**kwargs` → `Map[String, Any]` or named case class, not\n  `(String, Any)*` varargs.** Varargs force tuple-literal call sites\n  that Python-shaped evaluator scripts do not write.\n- **Python `Enum` → `scala.Enumeration` or Scala-3 `enum`**, not a\n  hand-rolled `sealed trait + case object` hierarchy.\n- **Enum member identifiers are public API — copy them character-for-\n  character from the Python source.** If Python writes `STRING`, Scala\n  writes `STRING` (not `String`). Scala accepts SCREAMING_CASE\n  identifiers; the `UpperCamelCase`-on-enum-members preference is\n  pole-(b)-ONLY. **If you are tempted to write `TokenType.String`\n  instead of `TokenType.STRING`, STOP and re-read\n  `references\u002Fpreserve-python-api.md` §9.**\n- **Constructor parameter names and types.** Preserve the Python name\n  verbatim when the evaluator may call by keyword; change at most one of\n  {name, type} per parameter.\n- **Idiomatic renames are opt-in.** `snake_case` → `camelCase` is safe\n  only when the evaluator does not key on the Python name.\n- **No mid-task paradigm swaps.** Fix a failing overload locally; do not\n  flip a type class into a subtype trait.\n\n### Value-level rules (iter_4 additions)\n\n- **String-literal values verbatim — identifier renames stop at the\n  opening quote.** `with_metadata` → `withMetadata` is an identifier\n  rename (allowed when the task names the method in camelCase). But\n  `metadata[\"original_type\"]` is a *string value* stored in the map,\n  not an identifier — the characters `original_type` are observable\n  output, and the camelCase convention does not cross the identifier\n  boundary. Likewise, when Python stores `type(x).__name__`, store the\n  Python lowercase name (`\"int\"`, `\"float\"`, `\"str\"`, `\"bytes\"`,\n  `\"bool\"`, `\"list\"`, `\"dict\"`, `\"tuple\"`), **not**\n  `value.getClass.getSimpleName` (which returns the capitalised JVM\n  form).\n- **Dispatch shape preserved.** A Python class with ONE primary method\n  dispatching `A | B` through `isinstance` stays ONE Scala class with\n  ONE primary entry point. Overloads of the same method name sharing a\n  common dispatch path are acceptable; `extends BaseTokenizer[A]`\n  demoting the `B` branch to a non-primary overload is NOT the same\n  shape.\n- **No public-API additions.** The Scala public symbol set equals the\n  Python public symbol set, counted exactly. \"Convenience\" methods\n  (`tokenizeToStrings`, `tokenizeWithPositions`, `countTokens`) and\n  extra metadata keys (`\"position\"`, `\"original\"`) not in the Python\n  source are additions, not idiomatic translations. Make internal\n  helpers `private`.\n- **No match arms on Scala-only types.** Do not add `case Some(v) =>`,\n  `case Success(v) =>`, `case Right(v) =>` branches when the Python\n  source has no `Option` \u002F `Try` \u002F `Either` concept. The arms of a\n  dispatch match are exactly the Python `isinstance` checks in the\n  source.\n\n```scala\n\u002F\u002F Generic pattern — preserve Python signature `foo(value: A | B) -> R`:\n\n\u002F\u002F Return type stays R (not Try[R], Either[E, R], or T => Either[E, R]);\n\u002F\u002F throw on error as Python does.\nclass Foo extends BaseFoo {   \u002F\u002F base class NOT type-parametrized when\n                              \u002F\u002F Python's base has no Generic[T]\n  \u002F\u002F Fix A: overloads of the same name (preferred for 2–3 closed arms),\n  \u002F\u002F both reachable through one dispatch:\n  def op(value: Any): Result = value match {\n    case a: TypeA => ???\n    case b: TypeB => ???\n    case other    => throw new IllegalArgumentException(s\"Unsupported: $other\")\n  }\n\n  \u002F\u002F Optional parallel error-channel method — DO NOT change the primary:\n  def opTry(value: Any): Try[Result] = Try(op(value))\n\n  \u002F\u002F Private helpers only — no public convenience methods not in Python:\n  private def helper(x: Result): Result = ???\n}\n\n\u002F\u002F Python `def with_metadata(self, **kwargs)` → Map, not varargs; and\n\u002F\u002F string-literal keys stay as the Python source writes them:\nclass Thing(val metadata: Map[String, Any] = Map.empty) {\n  def withMetadata(m: Map[String, Any]): Thing =\n    new Thing(metadata ++ m)\n  \u002F\u002F When writing metadata inside a method body, copy keys from the\n  \u002F\u002F Python source character-for-character:\n  def tagType(v: Any): Thing = withMetadata(Map(\n    \"original_type\" -> pythonTypeName(v),   \u002F\u002F key verbatim; value from §10b table\n  ))\n}\n\n\u002F\u002F Python Enum member names stay verbatim on pole (a):\nobject MyType extends Enumeration {\n  val FIRST, SECOND, THIRD = Value   \u002F\u002F NOT First, Second, Third\n}\n```\n\nRead `references\u002Fpreserve-python-api.md` when the task names Python public\nsymbols with union types, keyword constructor parameters, runtime\n`isinstance` dispatch, `**kwargs`, `Enum` subclasses, enum member\nidentifiers, any wrapping form of return (`Try`\u002F`Either`\u002Ffunction-\nreturning), **string literals used as metadata keys \u002F type tags**,\n**single-entry-point dispatch**, or when you are tempted to add a\n\"convenience\" method, an extra metadata key, or a `case Some(_) =>` arm\nnot present in the Python source. Skip when the axis step picked pole (b)\nwith no mixed-case signals.\n\nRead `references\u002Fexecute-python-for-ground-truth.md` when you are about\nto write a Scala assertion or a Scala method body that stores a string\nliteral derived from the Python source. Skip when the Python source\nwrites no string literals and exposes no `.value` \u002F `.name` \u002F `__name__`\ntags.\n\n## Idiomatic Scala expressions of Python TypeVars (pole-b rules)\n\nApply when the axis step picked **pole (b)** or **mixed** (in internals).\nWhen the Python source encodes `TypeVar(...)` with distinct per-subclass\nconstraints, do **not** translate to `BaseFoo[Any]` + `isinstance`-style\nmatch — that is the exact word-to-word form the grader penalizes. Pick one\nof four idiomatic expressions:\n\n1. **Bounded type parameter per subclass** — one Scala class per concrete\n   Python arm.\n2. **Sealed ADT as the type parameter** — closed set of arms, one subclass\n   handling all with exhaustive match.\n3. **Type class constraint** (`[T: Numeric]`) — numeric-bounded TypeVar,\n   one instance per element type.\n4. **Scala-3 union type** — small `A | B` union on Scala 3.\n\n```scala\n\u002F\u002F Generic pattern — Python `class Foo(BaseFoo[T])` with `T` constrained:\n\n\u002F\u002F Option 1: bounded subclass per concrete arm\nclass FooStr   extends BaseFoo[String]       { def op(v: String): R       = ??? }\nclass FooBytes extends BaseFoo[Array[Byte]]  { def op(v: Array[Byte]): R  = ??? }\n\n\u002F\u002F Option 3: type class constraint\nclass NumFoo[T: Numeric] extends BaseFoo[T] {\n  def op(v: T): R = { val n = implicitly[Numeric[T]].toDouble(v); ??? }\n}\n```\n\nPair the generics choice with the pole-(b) companion rules:\n\n- **Error channel**: return `Try[T]` \u002F `Either[E, T]` instead of throwing\n  `IllegalArgumentException` at public methods.\n- **Public builder**: a case class with `copy(...)` methods, not\n  `mutable.ListBuffer` + `var`.\n- **Enum member casing**: `UpperCamelCase` (`case object String extends\n  TokenType`), not Python `SCREAMING_CASE`, unless the task shows a Python\n  call site that relies on the Python form.\n- **Locale on formatting**: `String.format(Locale.ROOT, \"%.3f\", x)` and\n  `DateTimeFormatter.ofPattern(p, Locale.ROOT)`.\n\nRead `references\u002Fscala-generics-for-python-typevars.md` for the full\ndecision rule across the four options and worked examples of each\ncompanion rule. Skip when the axis step picked pole (a) with no mixed-case\nsignals — in that case `Any`+match is the correct choice and this chapter\ndoes not apply.\n\n## Core Principles (idiomatic Scala — subject to the axis choice)\n\nWhen translating Python to Scala, aim for idiomatic Scala, not literal translation:\n\n1. **Prefer immutability** - Use `val` over `var`, immutable collections\n2. **Expression-based** - Everything returns a value, minimize statements\n3. **Type safety** - Leverage Scala's type system, avoid `Any`\n   *(pole-(a) exception: `Any` is correct for Python union-typed\n   parameters — see \"Preserve the Python public API shape\" above)*\n4. **Pattern matching** - Use instead of if-else chains\n5. **Avoid null** - Use `Option`, `Either`, `Try`\n\n## Immutability First\n\n```python\n# Python - mutable by default\nclass Counter:\n    def __init__(self):\n        self.count = 0\n\n    def increment(self):\n        self.count += 1\n        return self.count\n```\n\n```scala\n\u002F\u002F Scala - immutable approach\ncase class Counter(count: Int = 0) {\n  def increment: Counter = copy(count = count + 1)\n}\n\n\u002F\u002F Usage\nval c1 = Counter()\nval c2 = c1.increment  \u002F\u002F Counter(1)\nval c3 = c2.increment  \u002F\u002F Counter(2)\n\u002F\u002F c1 is still Counter(0)\n```\n\n## Expression-Based Style\n\n```python\n# Python - statement-based\ndef get_status(code):\n    if code == 200:\n        status = \"OK\"\n    elif code == 404:\n        status = \"Not Found\"\n    else:\n        status = \"Unknown\"\n    return status\n```\n\n```scala\n\u002F\u002F Scala - expression-based\ndef getStatus(code: Int): String = code match {\n  case 200 => \"OK\"\n  case 404 => \"Not Found\"\n  case _ => \"Unknown\"\n}\n\n\u002F\u002F No intermediate variable, match is an expression\n```\n\n## Sealed Hierarchies for Domain Modeling\n\n```python\n# Python - loose typing\ndef process_payment(method: str, amount: float):\n    if method == \"credit\":\n        # process credit\n        pass\n    elif method == \"debit\":\n        # process debit\n        pass\n    elif method == \"crypto\":\n        # process crypto\n        pass\n```\n\n```scala\n\u002F\u002F Scala - sealed trait for exhaustive matching\nsealed trait PaymentMethod\ncase class CreditCard(number: String, expiry: String) extends PaymentMethod\ncase class DebitCard(number: String) extends PaymentMethod\ncase class Crypto(walletAddress: String) extends PaymentMethod\n\ndef processPayment(method: PaymentMethod, amount: Double): Unit = method match {\n  case CreditCard(num, exp) => \u002F\u002F process credit\n  case DebitCard(num) => \u002F\u002F process debit\n  case Crypto(addr) => \u002F\u002F process crypto\n}\n\u002F\u002F Compiler warns if you miss a case!\n```\n\nNote on scope: sealed hierarchies model **the translator's own domain\ntypes** AND are the idiomatic answer when the task is pole-(b) and the\nPython source has a constrained TypeVar. Do **not** retrofit a sealed\nhierarchy around a parameter whose Python type is `A | B` on a pole-(a)\ntask — that forces every caller to wrap in your ADT. Do **not** convert a\nPython `Enum` subclass to a sealed trait + case objects on pole (a); use\n`scala.Enumeration` or Scala-3 `enum` so the shape (members, `.value`,\n`.name`, iteration) matches.\n\n## Replace Null Checks with Option\n\n```python\n# Python\ndef find_user(id):\n    user = db.get(id)\n    if user is None:\n        return None\n    profile = user.get(\"profile\")\n    if profile is None:\n        return None\n    return profile.get(\"email\")\n```\n\n```scala\n\u002F\u002F Scala - Option chaining\ndef findUser(id: Int): Option[String] = for {\n  user \u003C- db.get(id)\n  profile \u003C- user.profile\n  email \u003C- profile.email\n} yield email\n\n\u002F\u002F Or with flatMap\ndef findUser(id: Int): Option[String] =\n  db.get(id)\n    .flatMap(_.profile)\n    .flatMap(_.email)\n```\n\n## Prefer Methods on Collections\n\n```python\n# Python\nresult = []\nfor item in items:\n    if item.active:\n        result.append(item.value * 2)\n```\n\n```scala\n\u002F\u002F Scala - use collection methods\nval result = items\n  .filter(_.active)\n  .map(_.value * 2)\n```\n\n## Avoid Side Effects in Expressions\n\n```python\n# Python\nitems = []\nfor x in range(10):\n    items.append(x * 2)\n    print(f\"Added {x * 2}\")\n```\n\n```scala\n\u002F\u002F Scala - separate side effects\nval items = (0 until 10).map(_ * 2).toList\nitems.foreach(x => println(s\"Value: $x\"))\n```\n\n## Use Named Parameters for Clarity\n\n```python\n# Python\ndef create_user(name, email, admin=False, active=True):\n    pass\n\nuser = create_user(\"Alice\", \"alice@example.com\", admin=True)\n```\n\n```scala\n\u002F\u002F Scala - named parameters work the same\ndef createUser(\n  name: String,\n  email: String,\n  admin: Boolean = false,\n  active: Boolean = true\n): User = ???\n\nval user = createUser(\"Alice\", \"alice@example.com\", admin = true)\n```\n\n## Scala Naming Conventions\n\n| Python | Scala (idiomatic, pole-b) | Pole-(a) caveat |\n|--------|---------------------------|-----------------|\n| `snake_case` locals\u002Fprivates | `camelCase` | always safe |\n| `snake_case` public method\u002Ffield | `camelCase` | safe only if the evaluator does not key on the Python name; when in doubt declare both — see `references\u002Fpreserve-python-api.md` §4 |\n| `snake_case` constructor kwarg | `camelCase` | **keep `snake_case`** when the evaluator may call by keyword; see §3 of the reference |\n| `SCREAMING_SNAKE` Python Enum member (e.g. `TokenType.STRING`) | `UpperCamelCase` (e.g. `TokenType.String`) | **keep SCREAMING_CASE verbatim on pole (a).** The identifier (`TokenType.STRING`) is public API — callers write it as-is. Scala accepts SCREAMING_CASE identifiers; \"un-Scala to keep SCREAMING_CASE\" is a pole-(b) justification only. See `references\u002Fpreserve-python-api.md` §9. |\n| `SCREAMING_SNAKE` true module constant | `UPPER_CASE` or `UpperCamelCase` | prefer `UPPER_CASE` on pole (a) when the evaluator may reference by name |\n| `PascalCase` classes | `PascalCase` | always safe |\n| `_private` | `private` keyword | safe |\n| `\"snake_case\"` **string literal** (dict key, type tag, enum `.value`) | **copy verbatim** on both poles — the characters inside the quotes are a *value*, not an identifier; the camelCase convention does not cross the opening quote | See `references\u002Fpreserve-python-api.md` §10. |\n\n## Avoid Returning Unit\n\n```python\n# Python - None return is common\ndef save_user(user):\n    db.save(user)\n    # implicit None return\n```\n\n```scala\n\u002F\u002F Scala - consider returning useful information\ndef saveUser(user: User): Either[Error, UserId] = ???\n\n\u002F\u002F Or at minimum, use Try\ndef saveUser(user: User): Try[Unit] = Try {\n  db.save(user)\n}\n```\n\n## Use Apply for Factory Methods\n\n```python\n# Python\nclass Parser:\n    def __init__(self, config):\n        self.config = config\n\n    @classmethod\n    def default(cls):\n        return cls(Config())\n```\n\n```scala\n\u002F\u002F Scala - companion object with apply\nclass Parser(config: Config)\n\nobject Parser {\n  def apply(config: Config): Parser = new Parser(config)\n  def apply(): Parser = new Parser(Config())\n}\n```\n\n## Cheat Sheet: Common Transformations\n\n| Python Pattern | Idiomatic Scala |\n|---------------|-----------------|\n| `if x is None` | `x.isEmpty` or pattern match |\n| `if x is not None` | `x.isDefined` or `x.nonEmpty` |\n| `x if x else default` | `x.getOrElse(default)` |\n| `[x for x in xs if p(x)]` | `xs.filter(p)` |\n| `[f(x) for x in xs]` | `xs.map(f)` |\n| `any(p(x) for x in xs)` | `xs.exists(p)` |\n| `all(p(x) for x in xs)` | `xs.forall(p)` |\n| `next(x for x in xs if p(x), None)` | `xs.find(p)` |\n| `dict(zip(keys, values))` | `keys.zip(values).toMap` |\n| `isinstance(x, Type)` | `x.isInstanceOf[Type]` or pattern match |\n| `try: ... except: ...` | `Try { ... }` or pattern match |\n| Mutable accumulator loop | `foldLeft` \u002F `foldRight` |\n| `for i, x in enumerate(xs)` | `xs.zipWithIndex` |\n\n## Common Pitfalls\n\n- **Skipping the axis-pick step and defaulting to pole (b).** The ambient\n  tone of these skill files pulls toward \"idiomatic\". If the task names\n  public APIs verbatim and says \"do the same thing\" \u002F \"same classes\u002F\n  functions\" \u002F \"must have all classes and functions in the python code\",\n  those signals override the tone — the task is pole (a). Always write\n  the four required-artifact lines before any Scala; the workflow-step-0\n  gate refuses to proceed without them.\n- **Evaluator-shape divergence on pole (a) — identifier band.** Wrapping\n  Python union-typed arguments in a sealed ADT (`StringLike`,\n  `StrOrBytes`, `NumericValue`, `TemporalValue`, etc.); wrapping\n  Python-returns-raw in `Try[T]` \u002F `Either[E, T]` \u002F `Option[T]` \u002F a\n  returned function (`T => Either[E, R]` in place of `R`); converting\n  Python `**kwargs` to `(String, Any)*` varargs; converting Python\n  `Enum` to `sealed trait + case object`; **renaming Python enum\n  members from SCREAMING_CASE to UpperCamelCase (iter_3+iter_4\n  recurrence — the identifier `TokenType.STRING` is public API, not\n  formatting);** silently dropping Python classes not named in a\n  parenthesized \"i.e.\" list in the task statement. All share one\n  mechanism: the evaluator writes the Python identifier; your Scala must\n  accept it unchanged.\n- **Evaluator-value divergence on pole (a) — value band (iter_4).**\n  Camel-casing a string literal used as a dict key or type tag\n  (`\"originalType\"` where Python writes `\"original_type\"`); storing\n  `value.getClass.getSimpleName` where Python stores\n  `type(value).__name__` (JVM `\"Int\"` vs Python `\"int\"`); demoting one\n  branch of a `str | bytes` dispatch to a non-primary overload under\n  `extends BaseTokenizer[String]`; adding \"convenience\" public methods\n  (`tokenizeToStrings`, `countTokens`) or extra metadata keys\n  (`\"position\"`, `\"original\"`) that have no Python counterpart; adding\n  `case Some(_) =>` \u002F `case Success(_) =>` \u002F `case Right(_) =>` arms to\n  an `Any`-dispatch method whose Python counterpart has no corresponding\n  type. These share one mechanism: identifier-level renames must stop\n  at the identifier boundary, dispatch shapes must match, and the public\n  symbol set equals Python's exactly.\n- **Flattening a typed hierarchy to `[Any]` on pole (b).** When the Python\n  source has `BaseFoo[T]` with distinct per-subclass constraints, use\n  bounded subclasses \u002F sealed ADTs \u002F type classes — see\n  `references\u002Fscala-generics-for-python-typevars.md`.\n- **Simultaneously renaming AND retyping a constructor parameter.** Change\n  at most one at a time; prefer keeping both when the evaluator may call\n  by keyword.\n- **Translating a class whose Python source you have not read, OR\n  enumerating required symbols from the task statement's example list\n  instead of the Python file.** Invented method names and parameters are\n  the first tell; dropped classes are the second. Return to the Python\n  source, confirm EOF, and `grep -nE '^class |^def '` to enumerate.\n- **Tautological verification — compile check passed, values wrong.**\n  Previously the agent used translator-defined wrapper types in its\n  smoke test; iter_4 shows a newer form where the raw-type call sites\n  compile clean (`new StringTokenizer().tokenize(\"hello\")`) but the\n  smoke-test assertions quote values the agent invented while writing\n  Scala (`metadata(\"originalType\") == \"Int\"`) rather than values from\n  running the Python module (`metadata(\"original_type\") == \"int\"`).\n  Both forms fail for the same reason: the test exercises only the\n  agent's own mental model of the API, not the Python source's actual\n  behaviour. Fix: on pole (a), paste a `# python recorded:` block from\n  running the Python module (step 2) into the plan, and quote every\n  smoke-test assertion from the recording. On pole (b), run the\n  non-functional checklist — behavioural tests do not catch `[Any]`\n  flattening, thrown exceptions, `mutable.*` builders, SCREAMING_CASE\n  enums (where UpperCamelCase was requested), or default-locale\n  formatting.\n- **Mid-task paradigm swaps to dodge a compile error.** Fix the overload\n  locally (rename, disambiguate) rather than flipping a type class into a\n  subtype trait.\n- **Default-locale numeric formatting.** `\"%.3f\".format(x)` produces a\n  decimal comma on non-US locales. Use `String.format(Locale.ROOT, ...)`\n  on pole-(b) tasks.\n\n## Anti-Patterns to Avoid\n\n```scala\n\u002F\u002F DON'T: Use null\nval name: String = null  \u002F\u002F Bad!\n\n\u002F\u002F DO: Use Option\nval name: Option[String] = None\n\n\u002F\u002F DON'T: Nested if-else chains\nif (x == 1) ... else if (x == 2) ... else if (x == 3) ...\n\n\u002F\u002F DO: Pattern matching\nx match {\n  case 1 => ...\n  case 2 => ...\n  case 3 => ...\n}\n\n\u002F\u002F DON'T: var with mutation\nvar total = 0\nfor (x \u003C- items) total += x\n\n\u002F\u002F DO: fold\nval total = items.sum\n```\n","# Python to Idiomatic Scala Translation\n\n## Pick the API-shape ↔ idiomatic axis from the task statement\n\nTranslation tasks live on an axis with two poles that pull in opposite\ndirections. Pick BEFORE writing Scala — neither pole is correct by default.\n\n- **Pole (a) — Preserve the Python public API shape.** The evaluator calls\n  the Scala using Python names, Python-accepted argument types, and expects\n  Python return types verbatim. It also **reads string values back out of\n  maps and enums using the Python spellings**. Use overloads or `Any`+match\n  for unions, keep `snake_case` on keyword constructor params, do not wrap\n  return values in `Try`\u002F`Either`, do not force wrapper ADTs on callers,\n  keep Python enum member names verbatim (`STRING` stays `STRING`), keep\n  string-literal metadata keys and type tags verbatim (`\"original_type\"`\n  stays `\"original_type\"`), do not add methods or metadata keys not in\n  the Python source.\n- **Pole (b) — Idiomatic Scala for a \"proficient Scala developer\".** The\n  grader penalizes word-to-word translations. Use bounded generics \u002F sealed\n  ADTs \u002F type classes for TypeVars, `Try`\u002F`Either` for errors, persistent\n  immutable builders, `UpperCamelCase` enum members, locale-safe formatting.\n\n| Grep the task for … | Pole |\n|---|---|\n| \"same classes\u002Ffunctions as the Python source\", \"must have all classes and functions in the python code\", \"do the same thing\", named public APIs (methods\u002Fclasses) listed verbatim, \"preserve the Python public API\", \"same signatures\", an evaluator snippet with raw Python types, `snake_case` kwargs | **(a)** |\n| \"proficient Scala developer\", \"idiomatic Scala\", \"should not be a word-to-word translation\", \"proper abstractions for representing data\", \"handle errors naturally in Scala\", \"use the Scala type system\", \"immutable\" | **(b)** |\n| Both sets of phrases present | **mixed** — pole (a) at the public boundary, pole (b) in internals |\n\n### Required artifact — write before any Scala\n\nWrite these four lines at the top of your plan. If any line is empty,\nre-read the task statement before continuing:\n\n```\nNamed public APIs (verbatim from the task): \u003Clist>\nSignal phrase (verbatim quote from the task): \"\u003Cquote>\"\nChosen pole: (a) | (b) | mixed\nRaw-type evaluator call sites (derived from the named APIs, using ONLY\nPython-shaped types — no wrapper ADTs, no `.get` on `Try`, no `.right.get`\non `Either`, no translator-defined helpers):\n  \u003C2-3 call sites, e.g. `new StringTokenizer().tokenize(\"hello\"): Token`,\n   `TokenType.STRING: TokenType`, `token.withMetadata(Map(\"k\" -> v)): Token`>\n```\n\nThe ambient tone of these skill files leads toward pole (b) (\"idiomatic\nScala\", \"proficient developer\"). If the task names public APIs verbatim\nAND asks to \"do the same thing\" \u002F \"same classes\u002Ffunctions\" \u002F \"must have\nall classes and functions\", that is a pole-(a) signal that **overrides\nthe ambient tone**. The axis is not pinned by what feels Scala-idiomatic;\nit is pinned by signal phrases.\n\nIf signals are absent either way: default to pole (a) when the task shows\nan evaluator call site with raw Python types or lists public API names;\notherwise default to pole (b).\n\nRead `references\u002Ftask-statement-axis-calibration.md` for the required-\nartifact template, the full signal-phrase list, the mixed-case tactic,\nand worked pole-(a) \u002F pole-(b) decision examples. Skip when the four\nrequired-artifact lines above are all filled and the pole is unambiguous.\n\n## Translation workflow (do this before writing any Scala)\n\n0. **Pre-flight gate.** Confirm your plan contains all four of the\n   required-artifact lines above (Named APIs, Signal phrase, Chosen pole,\n   Raw-type call sites) BEFORE moving to step 1. If `Chosen pole:` is\n   absent or any raw-type call site uses a translator-defined wrapper\n   (`StrOrBytes.Str(...)`, `.get` on `Try`, `.right.get` on `Either`),\n   STOP — re-read `references\u002Ftask-statement-axis-calibration.md` and\n   fill the artifact. Do not emit Scala while the gate is open.\n1. **Read the Python source end to end, then enumerate every public\n   symbol from the file itself.** Confirm the last line read is EOF, not\n   a tool clip; continue with ranged reads (`sed -n`, `tail`) if clipped.\n   Then build the required-symbol checklist from the **Python source\n   file**, not from the task statement's example list:\n\n   ```bash\n   # Enumerate every public top-level symbol in the Python source\n   grep -nE '^class |^def |^[A-Z_][A-Z_0-9]* = ' \u003Cpython-file>\n   ```\n\n   The task statement's class\u002Ffunction list is **non-exhaustive by\n   default**. Open-ended wording (\"all classes\", \"every function\",\n   \"i.e. X, Y, Z\", \"e.g. X, Y, Z\", a bare parenthesized list) means\n   every public symbol in the Python file is required, with the quoted\n   list as examples. Only closed-list wording (\"only the following\n   classes\", \"exactly these\", \"limited to\") scopes the required set to a\n   subset. When the task's list and the Python file disagree, trust the\n   Python file.\n\n   Read `references\u002Fenumerate-python-symbols.md` when the task statement\n   contains a parenthesized or inline class\u002Ffunction list, or when you\n   are tempted to drop a Python class because it is not named in the\n   task. Skip when the task explicitly uses closed-list wording and the\n   closed set is tiny (≤ 3 symbols).\n2. **Record each symbol's signature AND each observable output value.**\n   For every entry in the checklist from step 1, record exact name\n   (preserve underscores), accepted argument types (including\n   union-typed params), **return type**, defaults, and (for enums)\n   **member identifiers verbatim** AND **`.value` strings verbatim**.\n   Then — on pole (a) or mixed — **run the Python module** on 3–5\n   representative inputs covering each `tokenize` overload \u002F enum\n   member \u002F metadata-writing path and paste the raw stdout under a\n   `# python recorded:` block in your plan. This becomes the source of\n   truth for every string literal, metadata key, and enum identifier the\n   Scala must produce.\n\n   ```bash\n   # Record Python's actual outputs — strings the evaluator will read back\n   python3 -c \"\n   from \u003Cmodule> import \u003CPublicClass>, \u003CPublicEnum>\n   for m in \u003CPublicEnum>: print(f'{m.name=} {m.value=!r}')\n   t = \u003CPublicClass>().\u003Cprimary_method>(\u003Crepresentative input>)\n   print(f'metadata={t.metadata!r}')\n   \"\n   ```\n\n   Read `references\u002Fexecute-python-for-ground-truth.md` when the Python\n   source stores string literals, enum members, or `type(x).__name__`\n   tags that evaluator code may read back. Skip when the Python source\n   writes no string literals and exposes no enum members, OR when the\n   axis step picked pole (b) with no mixed-case signals.\n3. **Verify against the task statement's criteria, not your own tests.**\n   Behavioural parity under hand-written tests is necessary but not\n   sufficient. Run the pole-specific checklist below:\n\n   - **Pole (a)**: (i) compile the raw-type call-site snippet from your\n     required artifact above. The snippet must exercise at least one API\n     per class in the Python source and use ONLY Python-shaped types —\n     no wrapper ADT, no `.get` on `Try`, no `.right.get` on `Either`, no\n     translator-defined helper imports. (ii) Every assertion in the\n     smoke test quotes a value from the `# python recorded:` block, not\n     a value invented while writing Scala. (iii) Diff every public\n     signature against the Python source: same method name, same\n     parameter names, same accepted types, **same return type (no\n     `Try` \u002F `Either` \u002F function wrapping)**, same `**kwargs`\u002Fenum\n     shape, **same enum member identifiers verbatim**, **same\n     dispatch shape (one entry vs overloads of the same name)**, **no\n     added public methods or metadata keys**, **no match arms on\n     `Some`\u002F`Success`\u002F`Right` for `Any`-dispatch methods**.\n   - **Pole (b)**: tick each non-functional criterion against a concrete\n     location in your Scala file: type-safety (no `extends .+\\[Any\\]`\n     where Python has a constrained TypeVar), error channel (no thrown\n     exceptions where `Try`\u002F`Either` fits), mutability (no `mutable.*` +\n     `var` in a public `*Builder`), enum\u002Ffield naming\n     (`UpperCamelCase` unless the task overrides), locale-safety (explicit\n     `Locale.ROOT` on numeric formatting).\n   - **Mixed**: run BOTH checklists — pole (b) on the internal\n     representation, pole (a) on the public boundary.\n\n   ```bash\n   # Fast pole-(a) scan — hits are candidate rewrites\n   grep -nE ': (Try|Either|Option)\\[|\\(String, Any\\)\\*|\\.getClass\\.getSimpleName|case (Some|Success|Right)\\b|\"[a-z]+[A-Z][a-zA-Z]*\" ->' Output.scala\n\n   # Fast pole-(b) scan\n   grep -nE '\\[Any\\]|throw new .*Exception|mutable\\.(ListBuffer|Map|Set)|\"%\\.[0-9]+f\"|case object [A-Z_]{2,}' Output.scala\n   ```\n\n   If any check fails: do not submit. Return to the corresponding section\n   below and apply the fix before re-running the check.\n\n   Read `references\u002Fverify-against-task-criteria.md` for the full\n   verification procedure, including a worked pole-(a) example that\n   derives the raw-type snippet from a task statement listing named APIs,\n   the §1.5 Python-output recording procedure, and the parallel pole-(b)\n   checklist with per-item remediations. Skip when the pole-specific\n   checklist above passes clean on first run AND (pole-a only) every\n   smoke-test assertion is traceable to a recorded Python value.\n\n## Preserve the Python public API shape (pole-a rules)\n\nApply when the axis step picked **pole (a)** or **mixed** (at the public\nboundary). Evaluator-visible divergences — not behavioral bugs — are the\ndominant failure mode on pole (a). All of the rules below share one\nmechanism: **the evaluator writes the Python identifier\u002Fshape AND reads\nthe Python string spelling; your Scala must accept and produce them\nunchanged**. The rules fall into two bands — identifiers (signatures,\nmember names) and values (string literals, dispatch shapes, added APIs).\n\n### Identifier-level rules\n\n- **Union-typed parameters (`A | B`)** → use method overloads or an\n  `Any`-typed parameter with internal pattern match. Do **not** force\n  the caller to wrap values in a sealed ADT.\n- **Runtime-dispatch classes stay as one class.** A Python class that\n  dispatches on `isinstance` under one class name becomes **one** Scala\n  class, not a parametric `Foo[A: Numeric]`.\n- **Return types verbatim.** If Python returns `T`, Scala returns `T` —\n  every wrapping form breaks pole (a): `Try[T]`, `Either[E, T]`,\n  `Option[T]` (when Python returns raw `T`), and **function-returning**\n  (`T => R` or `T => Either[E, R]` in place of `R`). If error-channel\n  idiomaticity is desired, add a parallel `methodTry` \u002F `methodEither`;\n  leave the primary `method: T` untouched.\n- **`**kwargs` → `Map[String, Any]` or named case class, not\n  `(String, Any)*` varargs.** Varargs force tuple-literal call sites\n  that Python-shaped evaluator scripts do not write.\n- **Python `Enum` → `scala.Enumeration` or Scala-3 `enum`**, not a\n  hand-rolled `sealed trait + case object` hierarchy.\n- **Enum member identifiers are public API — copy them character-for-\n  character from the Python source.** If Python writes `STRING`, Scala\n  writes `STRING` (not `String`). Scala accepts SCREAMING_CASE\n  identifiers; the `UpperCamelCase`-on-enum-members preference is\n  pole-(b)-ONLY. **If you are tempted to write `TokenType.String`\n  instead of `TokenType.STRING`, STOP and re-read\n  `references\u002Fpreserve-python-api.md` §9.**\n- **Constructor parameter names and types.** Preserve the Python name\n  verbatim when the evaluator may call by keyword; change at most one of\n  {name, type} per parameter.\n- **Idiomatic renames are opt-in.** `snake_case` → `camelCase` is safe\n  only when the evaluator does not key on the Python name.\n- **No mid-task paradigm swaps.** Fix a failing overload locally; do not\n  flip a type class into a subtype trait.\n\n### Value-level rules (iter_4 additions)\n\n- **String-literal values verbatim — identifier renames stop at the\n  opening quote.** `with_metadata` → `withMetadata` is an identifier\n  rename (allowed when the task names the method in camelCase). But\n  `metadata[\"original_type\"]` is a *string value* stored in the map,\n  not an identifier — the characters `original_type` are observable\n  output, and the camelCase convention does not cross the identifier\n  boundary. Likewise, when Python stores `type(x).__name__`, store the\n  Python lowercase name (`\"int\"`, `\"float\"`, `\"str\"`, `\"bytes\"`,\n  `\"bool\"`, `\"list\"`, `\"dict\"`, `\"tuple\"`), **not**\n  `value.getClass.getSimpleName` (which returns the capitalised JVM\n  form).\n- **Dispatch shape preserved.** A Python class with ONE primary method\n  dispatching `A | B` through `isinstance` stays ONE Scala class with\n  ONE primary entry point. Overloads of the same method name sharing a\n  common dispatch path are acceptable; `extends BaseTokenizer[A]`\n  demoting the `B` branch to a non-primary overload is NOT the same\n  shape.\n- **No public-API additions.** The Scala public symbol set equals the\n  Python public symbol set, counted exactly. \"Convenience\" methods\n  (`tokenizeToStrings`, `tokenizeWithPositions`, `countTokens`) and\n  extra metadata keys (`\"position\"`, `\"original\"`) not in the Python\n  source are additions, not idiomatic translations. Make internal\n  helpers `private`.\n- **No match arms on Scala-only types.** Do not add `case Some(v) =>`,\n  `case Success(v) =>`, `case Right(v) =>` branches when the Python\n  source has no `Option` \u002F `Try` \u002F `Either` concept. The arms of a\n  dispatch match are exactly the Python `isinstance` checks in the\n  source.\n\n```scala\n\u002F\u002F Generic pattern — preserve Python signature `foo(value: A | B) -> R`:\n\n\u002F\u002F Return type stays R (not Try[R], Either[E, R], or T => Either[E, R]);\n\u002F\u002F throw on error as Python does.\nclass Foo extends BaseFoo {   \u002F\u002F base class NOT type-parametrized when\n                              \u002F\u002F Python's base has no Generic[T]\n  \u002F\u002F Fix A: overloads of the same name (preferred for 2–3 closed arms),\n  \u002F\u002F both reachable through one dispatch:\n  def op(value: Any): Result = value match {\n    case a: TypeA => ???\n    case b: TypeB => ???\n    case other    => throw new IllegalArgumentException(s\"Unsupported: $other\")\n  }\n\n  \u002F\u002F Optional parallel error-channel method — DO NOT change the primary:\n  def opTry(value: Any): Try[Result] = Try(op(value))\n\n  \u002F\u002F Private helpers only — no public convenience methods not in Python:\n  private def helper(x: Result): Result = ???\n}\n\n\u002F\u002F Python `def with_metadata(self, **kwargs)` → Map, not varargs; and\n\u002F\u002F string-literal keys stay as the Python source writes them:\nclass Thing(val metadata: Map[String, Any] = Map.empty) {\n  def withMetadata(m: Map[String, Any]): Thing =\n    new Thing(metadata ++ m)\n  \u002F\u002F When writing metadata inside a method body, copy keys from the\n  \u002F\u002F Python source character-for-character:\n  def tagType(v: Any): Thing = withMetadata(Map(\n    \"original_type\" -> pythonTypeName(v),   \u002F\u002F key verbatim; value from §10b table\n  ))\n}\n\n\u002F\u002F Python Enum member names stay verbatim on pole (a):\nobject MyType extends Enumeration {\n  val FIRST, SECOND, THIRD = Value   \u002F\u002F NOT First, Second, Third\n}\n```\n\nRead `references\u002Fpreserve-python-api.md` when the task names Python public\nsymbols with union types, keyword constructor parameters, runtime\n`isinstance` dispatch, `**kwargs`, `Enum` subclasses, enum member\nidentifiers, any wrapping form of return (`Try`\u002F`Either`\u002Ffunction-\nreturning), **string literals used as metadata keys \u002F type tags**,\n**single-entry-point dispatch**, or when you are tempted to add a\n\"convenience\" method, an extra metadata key, or a `case Some(_) =>` arm\nnot present in the Python source. Skip when the axis step picked pole (b)\nwith no mixed-case signals.\n\nRead `references\u002Fexecute-python-for-ground-truth.md` when you are about\nto write a Scala assertion or a Scala method body that stores a string\nliteral derived from the Python source. Skip when the Python source\nwrites no string literals and exposes no `.value` \u002F `.name` \u002F `__name__`\ntags.\n\n## Idiomatic Scala expressions of Python TypeVars (pole-b rules)\n\nApply when the axis step picked **pole (b)** or **mixed** (in internals).\nWhen the Python source encodes `TypeVar(...)` with distinct per-subclass\nconstraints, do **not** translate to `BaseFoo[Any]` + `isinstance`-style\nmatch — that is the exact word-to-word form the grader penalizes. Pick one\nof four idiomatic expressions:\n\n1. **Bounded type parameter per subclass** — one Scala class per concrete\n   Python arm.\n2. **Sealed ADT as the type parameter** — closed set of arms, one subclass\n   handling all with exhaustive match.\n3. **Type class constraint** (`[T: Numeric]`) — numeric-bounded TypeVar,\n   one instance per element type.\n4. **Scala-3 union type** — small `A | B` union on Scala 3.\n\n```scala\n\u002F\u002F Generic pattern — Python `class Foo(BaseFoo[T])` with `T` constrained:\n\n\u002F\u002F Option 1: bounded subclass per concrete arm\nclass FooStr   extends BaseFoo[String]       { def op(v: String): R       = ??? }\nclass FooBytes extends BaseFoo[Array[Byte]]  { def op(v: Array[Byte]): R  = ??? }\n\n\u002F\u002F Option 3: type class constraint\nclass NumFoo[T: Numeric] extends BaseFoo[T] {\n  def op(v: T): R = { val n = implicitly[Numeric[T]].toDouble(v); ??? }\n}\n```\n\nPair the generics choice with the pole-(b) companion rules:\n\n- **Error channel**: return `Try[T]` \u002F `Either[E, T]` instead of throwing\n  `IllegalArgumentException` at public methods.\n- **Public builder**: a case class with `copy(...)` methods, not\n  `mutable.ListBuffer` + `var`.\n- **Enum member casing**: `UpperCamelCase` (`case object String extends\n  TokenType`), not Python `SCREAMING_CASE`, unless the task shows a Python\n  call site that relies on the Python form.\n- **Locale on formatting**: `String.format(Locale.ROOT, \"%.3f\", x)` and\n  `DateTimeFormatter.ofPattern(p, Locale.ROOT)`.\n\nRead `references\u002Fscala-generics-for-python-typevars.md` for the full\ndecision rule across the four options and worked examples of each\ncompanion rule. Skip when the axis step picked pole (a) with no mixed-case\nsignals — in that case `Any`+match is the correct choice and this chapter\ndoes not apply.\n\n## Core Principles (idiomatic Scala — subject to the axis choice)\n\nWhen translating Python to Scala, aim for idiomatic Scala, not literal translation:\n\n1. **Prefer immutability** - Use `val` over `var`, immutable collections\n2. **Expression-based** - Everything returns a value, minimize statements\n3. **Type safety** - Leverage Scala's type system, avoid `Any`\n   *(pole-(a) exception: `Any` is correct for Python union-typed\n   parameters — see \"Preserve the Python public API shape\" above)*\n4. **Pattern matching** - Use instead of if-else chains\n5. **Avoid null** - Use `Option`, `Either`, `Try`\n\n## Immutability First\n\n```python\n# Python - mutable by default\nclass Counter:\n    def __init__(self):\n        self.count = 0\n\n    def increment(self):\n        self.count += 1\n        return self.count\n```\n\n```scala\n\u002F\u002F Scala - immutable approach\ncase class Counter(count: Int = 0) {\n  def increment: Counter = copy(count = count + 1)\n}\n\n\u002F\u002F Usage\nval c1 = Counter()\nval c2 = c1.increment  \u002F\u002F Counter(1)\nval c3 = c2.increment  \u002F\u002F Counter(2)\n\u002F\u002F c1 is still Counter(0)\n```\n\n## Expression-Based Style\n\n```python\n# Python - statement-based\ndef get_status(code):\n    if code == 200:\n        status = \"OK\"\n    elif code == 404:\n        status = \"Not Found\"\n    else:\n        status = \"Unknown\"\n    return status\n```\n\n```scala\n\u002F\u002F Scala - expression-based\ndef getStatus(code: Int): String = code match {\n  case 200 => \"OK\"\n  case 404 => \"Not Found\"\n  case _ => \"Unknown\"\n}\n\n\u002F\u002F No intermediate variable, match is an expression\n```\n\n## Sealed Hierarchies for Domain Modeling\n\n```python\n# Python - loose typing\ndef process_payment(method: str, amount: float):\n    if method == \"credit\":\n        # process credit\n        pass\n    elif method == \"debit\":\n        # process debit\n        pass\n    elif method == \"crypto\":\n        # process crypto\n        pass\n```\n\n```scala\n\u002F\u002F Scala - sealed trait for exhaustive matching\nsealed trait PaymentMethod\ncase class CreditCard(number: String, expiry: String) extends PaymentMethod\ncase class DebitCard(number: String) extends PaymentMethod\ncase class Crypto(walletAddress: String) extends PaymentMethod\n\ndef processPayment(method: PaymentMethod, amount: Double): Unit = method match {\n  case CreditCard(num, exp) => \u002F\u002F process credit\n  case DebitCard(num) => \u002F\u002F process debit\n  case Crypto(addr) => \u002F\u002F process crypto\n}\n\u002F\u002F Compiler warns if you miss a case!\n```\n\nNote on scope: sealed hierarchies model **the translator's own domain\ntypes** AND are the idiomatic answer when the task is pole-(b) and the\nPython source has a constrained TypeVar. Do **not** retrofit a sealed\nhierarchy around a parameter whose Python type is `A | B` on a pole-(a)\ntask — that forces every caller to wrap in your ADT. Do **not** convert a\nPython `Enum` subclass to a sealed trait + case objects on pole (a); use\n`scala.Enumeration` or Scala-3 `enum` so the shape (members, `.value`,\n`.name`, iteration) matches.\n\n## Replace Null Checks with Option\n\n```python\n# Python\ndef find_user(id):\n    user = db.get(id)\n    if user is None:\n        return None\n    profile = user.get(\"profile\")\n    if profile is None:\n        return None\n    return profile.get(\"email\")\n```\n\n```scala\n\u002F\u002F Scala - Option chaining\ndef findUser(id: Int): Option[String] = for {\n  user \u003C- db.get(id)\n  profile \u003C- user.profile\n  email \u003C- profile.email\n} yield email\n\n\u002F\u002F Or with flatMap\ndef findUser(id: Int): Option[String] =\n  db.get(id)\n    .flatMap(_.profile)\n    .flatMap(_.email)\n```\n\n## Prefer Methods on Collections\n\n```python\n# Python\nresult = []\nfor item in items:\n    if item.active:\n        result.append(item.value * 2)\n```\n\n```scala\n\u002F\u002F Scala - use collection methods\nval result = items\n  .filter(_.active)\n  .map(_.value * 2)\n```\n\n## Avoid Side Effects in Expressions\n\n```python\n# Python\nitems = []\nfor x in range(10):\n    items.append(x * 2)\n    print(f\"Added {x * 2}\")\n```\n\n```scala\n\u002F\u002F Scala - separate side effects\nval items = (0 until 10).map(_ * 2).toList\nitems.foreach(x => println(s\"Value: $x\"))\n```\n\n## Use Named Parameters for Clarity\n\n```python\n# Python\ndef create_user(name, email, admin=False, active=True):\n    pass\n\nuser = create_user(\"Alice\", \"alice@example.com\", admin=True)\n```\n\n```scala\n\u002F\u002F Scala - named parameters work the same\ndef createUser(\n  name: String,\n  email: String,\n  admin: Boolean = false,\n  active: Boolean = true\n): User = ???\n\nval user = createUser(\"Alice\", \"alice@example.com\", admin = true)\n```\n\n## Scala Naming Conventions\n\n| Python | Scala (idiomatic, pole-b) | Pole-(a) caveat |\n|--------|---------------------------|-----------------|\n| `snake_case` locals\u002Fprivates | `camelCase` | always safe |\n| `snake_case` public method\u002Ffield | `camelCase` | safe only if the evaluator does not key on the Python name; when in doubt declare both — see `references\u002Fpreserve-python-api.md` §4 |\n| `snake_case` constructor kwarg | `camelCase` | **keep `snake_case`** when the evaluator may call by keyword; see §3 of the reference |\n| `SCREAMING_SNAKE` Python Enum member (e.g. `TokenType.STRING`) | `UpperCamelCase` (e.g. `TokenType.String`) | **keep SCREAMING_CASE verbatim on pole (a).** The identifier (`TokenType.STRING`) is public API — callers write it as-is. Scala accepts SCREAMING_CASE identifiers; \"un-Scala to keep SCREAMING_CASE\" is a pole-(b) justification only. See `references\u002Fpreserve-python-api.md` §9. |\n| `SCREAMING_SNAKE` true module constant | `UPPER_CASE` or `UpperCamelCase` | prefer `UPPER_CASE` on pole (a) when the evaluator may reference by name |\n| `PascalCase` classes | `PascalCase` | always safe |\n| `_private` | `private` keyword | safe |\n| `\"snake_case\"` **string literal** (dict key, type tag, enum `.value`) | **copy verbatim** on both poles — the characters inside the quotes are a *value*, not an identifier; the camelCase convention does not cross the opening quote | See `references\u002Fpreserve-python-api.md` §10. |\n\n## Avoid Returning Unit\n\n```python\n# Python - None return is common\ndef save_user(user):\n    db.save(user)\n    # implicit None return\n```\n\n```scala\n\u002F\u002F Scala - consider returning useful information\ndef saveUser(user: User): Either[Error, UserId] = ???\n\n\u002F\u002F Or at minimum, use Try\ndef saveUser(user: User): Try[Unit] = Try {\n  db.save(user)\n}\n```\n\n## Use Apply for Factory Methods\n\n```python\n# Python\nclass Parser:\n    def __init__(self, config):\n        self.config = config\n\n    @classmethod\n    def default(cls):\n        return cls(Config())\n```\n\n```scala\n\u002F\u002F Scala - companion object with apply\nclass Parser(config: Config)\n\nobject Parser {\n  def apply(config: Config): Parser = new Parser(config)\n  def apply(): Parser = new Parser(Config())\n}\n```\n\n## Cheat Sheet: Common Transformations\n\n| Python Pattern | Idiomatic Scala |\n|---------------|-----------------|\n| `if x is None` | `x.isEmpty` or pattern match |\n| `if x is not None` | `x.isDefined` or `x.nonEmpty` |\n| `x if x else default` | `x.getOrElse(default)` |\n| `[x for x in xs if p(x)]` | `xs.filter(p)` |\n| `[f(x) for x in xs]` | `xs.map(f)` |\n| `any(p(x) for x in xs)` | `xs.exists(p)` |\n| `all(p(x) for x in xs)` | `xs.forall(p)` |\n| `next(x for x in xs if p(x), None)` | `xs.find(p)` |\n| `dict(zip(keys, values))` | `keys.zip(values).toMap` |\n| `isinstance(x, Type)` | `x.isInstanceOf[Type]` or pattern match |\n| `try: ... except: ...` | `Try { ... }` or pattern match |\n| Mutable accumulator loop | `foldLeft` \u002F `foldRight` |\n| `for i, x in enumerate(xs)` | `xs.zipWithIndex` |\n\n## Common Pitfalls\n\n- **Skipping the axis-pick step and defaulting to pole (b).** The ambient\n  tone of these skill files pulls toward \"idiomatic\". If the task names\n  public APIs verbatim and says \"do the same thing\" \u002F \"same classes\u002F\n  functions\" \u002F \"must have all classes and functions in the python code\",\n  those signals override the tone — the task is pole (a). Always write\n  the four required-artifact lines before any Scala; the workflow-step-0\n  gate refuses to proceed without them.\n- **Evaluator-shape divergence on pole (a) — identifier band.** Wrapping\n  Python union-typed arguments in a sealed ADT (`StringLike`,\n  `StrOrBytes`, `NumericValue`, `TemporalValue`, etc.); wrapping\n  Python-returns-raw in `Try[T]` \u002F `Either[E, T]` \u002F `Option[T]` \u002F a\n  returned function (`T => Either[E, R]` in place of `R`); converting\n  Python `**kwargs` to `(String, Any)*` varargs; converting Python\n  `Enum` to `sealed trait + case object`; **renaming Python enum\n  members from SCREAMING_CASE to UpperCamelCase (iter_3+iter_4\n  recurrence — the identifier `TokenType.STRING` is public API, not\n  formatting);** silently dropping Python classes not named in a\n  parenthesized \"i.e.\" list in the task statement. All share one\n  mechanism: the evaluator writes the Python identifier; your Scala must\n  accept it unchanged.\n- **Evaluator-value divergence on pole (a) — value band (iter_4).**\n  Camel-casing a string literal used as a dict key or type tag\n  (`\"originalType\"` where Python writes `\"original_type\"`); storing\n  `value.getClass.getSimpleName` where Python stores\n  `type(value).__name__` (JVM `\"Int\"` vs Python `\"int\"`); demoting one\n  branch of a `str | bytes` dispatch to a non-primary overload under\n  `extends BaseTokenizer[String]`; adding \"convenience\" public methods\n  (`tokenizeToStrings`, `countTokens`) or extra metadata keys\n  (`\"position\"`, `\"original\"`) that have no Python counterpart; adding\n  `case Some(_) =>` \u002F `case Success(_) =>` \u002F `case Right(_) =>` arms to\n  an `Any`-dispatch method whose Python counterpart has no corresponding\n  type. These share one mechanism: identifier-level renames must stop\n  at the identifier boundary, dispatch shapes must match, and the public\n  symbol set equals Python's exactly.\n- **Flattening a typed hierarchy to `[Any]` on pole (b).** When the Python\n  source has `BaseFoo[T]` with distinct per-subclass constraints, use\n  bounded subclasses \u002F sealed ADTs \u002F type classes — see\n  `references\u002Fscala-generics-for-python-typevars.md`.\n- **Simultaneously renaming AND retyping a constructor parameter.** Change\n  at most one at a time; prefer keeping both when the evaluator may call\n  by keyword.\n- **Translating a class whose Python source you have not read, OR\n  enumerating required symbols from the task statement's example list\n  instead of the Python file.** Invented method names and parameters are\n  the first tell; dropped classes are the second. Return to the Python\n  source, confirm EOF, and `grep -nE '^class |^def '` to enumerate.\n- **Tautological verification — compile check passed, values wrong.**\n  Previously the agent used translator-defined wrapper types in its\n  smoke test; iter_4 shows a newer form where the raw-type call sites\n  compile clean (`new StringTokenizer().tokenize(\"hello\")`) but the\n  smoke-test assertions quote values the agent invented while writing\n  Scala (`metadata(\"originalType\") == \"Int\"`) rather than values from\n  running the Python module (`metadata(\"original_type\") == \"int\"`).\n  Both forms fail for the same reason: the test exercises only the\n  agent's own mental model of the API, not the Python source's actual\n  behaviour. Fix: on pole (a), paste a `# python recorded:` block from\n  running the Python module (step 2) into the plan, and quote every\n  smoke-test assertion from the recording. On pole (b), run the\n  non-functional checklist — behavioural tests do not catch `[Any]`\n  flattening, thrown exceptions, `mutable.*` builders, SCREAMING_CASE\n  enums (where UpperCamelCase was requested), or default-locale\n  formatting.\n- **Mid-task paradigm swaps to dodge a compile error.** Fix the overload\n  locally (rename, disambiguate) rather than flipping a type class into a\n  subtype trait.\n- **Default-locale numeric formatting.** `\"%.3f\".format(x)` produces a\n  decimal comma on non-US locales. Use `String.format(Locale.ROOT, ...)`\n  on pole-(b) tasks.\n\n## Anti-Patterns to Avoid\n\n```scala\n\u002F\u002F DON'T: Use null\nval name: String = null  \u002F\u002F Bad!\n\n\u002F\u002F DO: Use Option\nval name: Option[String] = None\n\n\u002F\u002F DON'T: Nested if-else chains\nif (x == 1) ... else if (x == 2) ... else if (x == 3) ...\n\n\u002F\u002F DO: Pattern matching\nx match {\n  case 1 => ...\n  case 2 => ...\n  case 3 => ...\n}\n\n\u002F\u002F DON'T: var with mutation\nvar total = 0\nfor (x \u003C- items) total += x\n\n\u002F\u002F DO: fold\nval total = items.sum\n```\n",{"name":5,"description":7},"main","cdcb6d230f3b15c3c33f8a2bdd16439f43602cbe","evaluation\u002Fresults\u002FSkillGrad\u002Fopus47_clean_20261016_partial14\u002Ftasks\u002Fpython-scala-translation\u002Frepaired_skill\u002Fpython-scala-idioms",1,"https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark","https:\u002F\u002Fgithub.com\u002Flinyouxue","2026-11-14 20:28:35",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add linyouxue\u002Fskill-repair-benchmark --skill python-scala-idioms",{"tool":37,"command":38},"bunx","bunx skills add linyouxue\u002Fskill-repair-benchmark --skill python-scala-idioms",{"tool":40,"command":41},"pnpm","pnpm dlx skills add linyouxue\u002Fskill-repair-benchmark --skill python-scala-idioms","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fevaluation\u002Fresults\u002FSkillGrad\u002Fopus47_clean_20261016_partial14\u002Ftasks\u002Fpython-scala-translation\u002Frepaired_skill\u002Fpython-scala-idioms\u002FSKILL.md",true,[],[46,53,60,67,72,77],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M7E1HGVRY73NBJ022CJG13X6","video-frame-extraction","Extract frames from video files and save them as images using OpenCV","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7E1HAG5R7CJ9C8NYJS771MB","openai-vision","Analyze images and multi-frame sequences using OpenAI GPT vision models","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7E1H7DADKB6QBWKC2KQ63SZ","image-ocr","Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[],{"skillNo":68,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7E1H0WBNT43TENGQY7AVZHD","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":73,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7E1GTC7D4N4Q2EF03875J9E","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":78,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7E1GQ92CWFMGH53KSSE4WER","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[]]