[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C00D5Y99DP4WKES2M4RNYF":3,"skill-same:01M7C00D5Y99DP4WKES2M4RNYF":46},{"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":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":31,"install":32,"resources":45},"01M7C00D5Y99DP4WKES2M4RNYF","python-scala-api-compile-guardrails",null,"Guardrails to prevent Scala 2.13 compile\u002FAPI-surface failures when translating a Python module into a single Scala file.","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\u002FSkillHone\u002Fevaluator_runs\u002Fskillhone-v2\u002Fpython-scala-translation-skillhone-v2-vllm-verifier900-20260922T024153Z\u002Finputs\u002Fskills\u002Fskills\u002Fpython-scala-api-compile-guardrails\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: python-scala-api-compile-guardrails\nversion: 0.1.0\ndescription: Guardrails to prevent Scala 2.13 compile\u002FAPI-surface failures when translating a Python module into a single Scala file.\n---\n\n# Python → Scala: API-surface + Scala 2.13 compile guardrails\n\nThis skill adds **mechanical guardrails** on top of a translation playbook. It targets a common failure mode: producing a Scala file that *looks right* but **does not compile** or **misses required public symbols** (classes\u002Ffunctions), leading to a 0\u002F1 outcome even when execution otherwise “seems OK”.\n\nUse this when a task requires:\n\n- translating one Python module into one Scala 2.13 file, and\n- preserving a **named API surface** (a list of classes\u002Ffunctions that must exist).\n\n## 1) Build an explicit “required symbol list”\n\nBefore writing Scala, copy the prompt’s required public names into a checklist.\n\nExample (structure only):\n\n- ADTs \u002F enums: `TokenType`\n- data classes: `Token`\n- base traits\u002Fabstract classes: `BaseTokenizer`\n- concrete classes: `StringTokenizer`, `NumericTokenizer`, ...\n- builders\u002Fconfig: `TokenizerBuilder`\n- functions\u002Fhelpers: `tokenize`, `tokenizeBatch`, `toToken`, `withMetadata`\n\nDuring implementation, keep this list visible and **strike items only when the Scala code contains the exact identifiers**.\n\n## 2) Prefer a “single-file module layout” that compiles cleanly\n\nA Scala 2.13 single file is easiest to keep correct with this layout:\n\n```scala\n\u002F\u002F Imports\n\n\u002F\u002F === Public model (sealed traits, case classes) ===\n\n\u002F\u002F === Public tokenizer API types ===\n\n\u002F\u002F === Implementations (final classes) ===\n\n\u002F\u002F === Companion objects \u002F top-level functions ===\n```\n\nGuardrail rules:\n\n- Put all **public** types at top-level (not nested inside unrelated classes).\n- Implement “top-level functions” as methods on a single `object` (Scala has no Python-style module functions).\n- Avoid Scala 3 features: `enum`, `given`, `extension`, `using`, opaque types.\n- Avoid placeholders (`???`) and unused abstract members.\n\n## 3) Translation patterns that reduce compile errors\n\n### 3.1 Optional fields and defaults\n\nPython often omits fields or uses `None`. In Scala, prefer `Option` with defaults:\n\n```scala\nfinal case class Token(\n  tokenType: TokenType,\n  value: String,\n  start: Option[Int] = None,\n  end: Option[Int] = None,\n  metadata: Map[String, String] = Map.empty\n)\n```\n\n### 3.2 One place for helpers (avoid name drift)\n\nIf the prompt requires helper names (e.g., `withMetadata`, `toToken`), define them *once* in a stable location:\n\n- `withMetadata`:\n  - either as a `Token` method (preferred for readability), and\u002For\n  - as a protected helper on `BaseTokenizer` if tokenizers must attach metadata.\n\n- `toToken`:\n  - implement as a function in an `object` so call sites are consistent.\n\n### 3.3 Error handling\n\nWhen translating parsing code:\n\n- use `Try(x).toOption` for “best effort” parsing;\n- use `Either[String, A]` when the caller needs to know failure reasons;\n- avoid throwing unless Python code truly fails fast.\n\nKeep the choice consistent across tokenizers.\n\n## 4) Static “compile hygiene” scan (when `scalac` isn’t available)\n\nWhen the environment doesn’t provide Scala tooling, do a manual scan that catches most failures:\n\n- Every `{` has a matching `}` (watch nested objects\u002Fcompanions).\n- No `???`, `null`, or unimplemented abstract methods.\n- Every referenced type is imported or fully qualified.\n- No use of Scala 3-only syntax.\n- Public identifiers exactly match the required symbol list (case-sensitive).\n\n## 5) Add a lightweight, local symbol check (recommended)\n\nA frequent 0\u002F1 failure is simply **missing one required identifier** or putting it in the wrong place (e.g., nesting a public class inside an object).\n\nIf you can run basic shell tools, add a quick *pre-submit* check that the Scala file contains the required names.\n\nExample (structure only — adapt the symbol list to your prompt):\n\n```bash\nSCALA_FILE=\u002Froot\u002FTokenizer.scala\nfor sym in TokenType Token BaseTokenizer StringTokenizer NumericTokenizer TemporalTokenizer UniversalTokenizer WhitespaceTokenizer TokenizerBuilder tokenize tokenizeBatch toToken withMetadata; do\n  grep -q \"\\b${sym}\\b\" \"$SCALA_FILE\" || { echo \"Missing symbol: $sym\"; exit 1; }\ndone\n```\n\nNotes:\n- This is **not** a compiler; it only catches missing\u002Ftypoed identifiers.\n- Prefer to search for *definitions* when possible (e.g., `final class StringTokenizer`, `sealed trait TokenType`).\n\n## 6) Done criteria\n\nYou are done when:\n\n1. The required symbol list is fully satisfied in Scala, and\n2. the file contains no placeholders, and\n3. the code reads as idiomatic Scala 2.13 with `Option`\u002F`Try`\u002F`Either` used intentionally.\n","# Python → Scala: API-surface + Scala 2.13 compile guardrails\n\nThis skill adds **mechanical guardrails** on top of a translation playbook. It targets a common failure mode: producing a Scala file that *looks right* but **does not compile** or **misses required public symbols** (classes\u002Ffunctions), leading to a 0\u002F1 outcome even when execution otherwise “seems OK”.\n\nUse this when a task requires:\n\n- translating one Python module into one Scala 2.13 file, and\n- preserving a **named API surface** (a list of classes\u002Ffunctions that must exist).\n\n## 1) Build an explicit “required symbol list”\n\nBefore writing Scala, copy the prompt’s required public names into a checklist.\n\nExample (structure only):\n\n- ADTs \u002F enums: `TokenType`\n- data classes: `Token`\n- base traits\u002Fabstract classes: `BaseTokenizer`\n- concrete classes: `StringTokenizer`, `NumericTokenizer`, ...\n- builders\u002Fconfig: `TokenizerBuilder`\n- functions\u002Fhelpers: `tokenize`, `tokenizeBatch`, `toToken`, `withMetadata`\n\nDuring implementation, keep this list visible and **strike items only when the Scala code contains the exact identifiers**.\n\n## 2) Prefer a “single-file module layout” that compiles cleanly\n\nA Scala 2.13 single file is easiest to keep correct with this layout:\n\n```scala\n\u002F\u002F Imports\n\n\u002F\u002F === Public model (sealed traits, case classes) ===\n\n\u002F\u002F === Public tokenizer API types ===\n\n\u002F\u002F === Implementations (final classes) ===\n\n\u002F\u002F === Companion objects \u002F top-level functions ===\n```\n\nGuardrail rules:\n\n- Put all **public** types at top-level (not nested inside unrelated classes).\n- Implement “top-level functions” as methods on a single `object` (Scala has no Python-style module functions).\n- Avoid Scala 3 features: `enum`, `given`, `extension`, `using`, opaque types.\n- Avoid placeholders (`???`) and unused abstract members.\n\n## 3) Translation patterns that reduce compile errors\n\n### 3.1 Optional fields and defaults\n\nPython often omits fields or uses `None`. In Scala, prefer `Option` with defaults:\n\n```scala\nfinal case class Token(\n  tokenType: TokenType,\n  value: String,\n  start: Option[Int] = None,\n  end: Option[Int] = None,\n  metadata: Map[String, String] = Map.empty\n)\n```\n\n### 3.2 One place for helpers (avoid name drift)\n\nIf the prompt requires helper names (e.g., `withMetadata`, `toToken`), define them *once* in a stable location:\n\n- `withMetadata`:\n  - either as a `Token` method (preferred for readability), and\u002For\n  - as a protected helper on `BaseTokenizer` if tokenizers must attach metadata.\n\n- `toToken`:\n  - implement as a function in an `object` so call sites are consistent.\n\n### 3.3 Error handling\n\nWhen translating parsing code:\n\n- use `Try(x).toOption` for “best effort” parsing;\n- use `Either[String, A]` when the caller needs to know failure reasons;\n- avoid throwing unless Python code truly fails fast.\n\nKeep the choice consistent across tokenizers.\n\n## 4) Static “compile hygiene” scan (when `scalac` isn’t available)\n\nWhen the environment doesn’t provide Scala tooling, do a manual scan that catches most failures:\n\n- Every `{` has a matching `}` (watch nested objects\u002Fcompanions).\n- No `???`, `null`, or unimplemented abstract methods.\n- Every referenced type is imported or fully qualified.\n- No use of Scala 3-only syntax.\n- Public identifiers exactly match the required symbol list (case-sensitive).\n\n## 5) Add a lightweight, local symbol check (recommended)\n\nA frequent 0\u002F1 failure is simply **missing one required identifier** or putting it in the wrong place (e.g., nesting a public class inside an object).\n\nIf you can run basic shell tools, add a quick *pre-submit* check that the Scala file contains the required names.\n\nExample (structure only — adapt the symbol list to your prompt):\n\n```bash\nSCALA_FILE=\u002Froot\u002FTokenizer.scala\nfor sym in TokenType Token BaseTokenizer StringTokenizer NumericTokenizer TemporalTokenizer UniversalTokenizer WhitespaceTokenizer TokenizerBuilder tokenize tokenizeBatch toToken withMetadata; do\n  grep -q \"\\b${sym}\\b\" \"$SCALA_FILE\" || { echo \"Missing symbol: $sym\"; exit 1; }\ndone\n```\n\nNotes:\n- This is **not** a compiler; it only catches missing\u002Ftypoed identifiers.\n- Prefer to search for *definitions* when possible (e.g., `final class StringTokenizer`, `sealed trait TokenType`).\n\n## 6) Done criteria\n\nYou are done when:\n\n1. The required symbol list is fully satisfied in Scala, and\n2. the file contains no placeholders, and\n3. the code reads as idiomatic Scala 2.13 with `Option`\u002F`Try`\u002F`Either` used intentionally.\n",{"name":5,"version":24,"description":7},"0.1.0","main","cdcb6d230f3b15c3c33f8a2bdd16439f43602cbe","evaluation\u002Fresults\u002FSkillHone\u002Fevaluator_runs\u002Fskillhone-v2\u002Fpython-scala-translation-skillhone-v2-vllm-verifier900-20260922T024153Z\u002Finputs\u002Fskills\u002Fskills\u002Fpython-scala-api-compile-guardrails",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":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add linyouxue\u002Fskill-repair-benchmark --skill python-scala-api-compile-guardrails",{"tool":38,"command":39},"bunx","bunx skills add linyouxue\u002Fskill-repair-benchmark --skill python-scala-api-compile-guardrails",{"tool":41,"command":42},"pnpm","pnpm dlx skills add linyouxue\u002Fskill-repair-benchmark --skill python-scala-api-compile-guardrails","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fevaluation\u002Fresults\u002FSkillHone\u002Fevaluator_runs\u002Fskillhone-v2\u002Fpython-scala-translation-skillhone-v2-vllm-verifier900-20260922T024153Z\u002Finputs\u002Fskills\u002Fskills\u002Fpython-scala-api-compile-guardrails\u002FSKILL.md",true,[],[47,54,61,68,73,78],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"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":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"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":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"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":69,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"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":74,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"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":79,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"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",[],[]]