[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CA717029DAQ7Q280XESGM4":3,"skill-same:01M7CA717029DAQ7Q280XESGM4":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":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7CA717029DAQ7Q280XESGM4","xl-scala-style",null,"Scala 3 as written in xl - opaque types, enums, extension methods, XLResult totality, WartRemover tiers and how to react to a wart, import order, the export\u002Fopaque\u002Finline compiler landmines that break the published API for external consumers, and what changed in Scala 3.9 LTS. Use when writing or reviewing any .scala source, adding public API, touching exports or the scripting prelude, resolving a WartRemover error, or deciding whether something may be `inline`.","shenyimings\u002Fskillet","shenyimings","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F89332218?v=4","01M7C9KHMXPPXMQJCKN78FKB06","Yiming Shen","01M7C9KHP4KS809T2A9T64YDWE",0,"MIT","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FTJC-LP__xl__.claude__skills__xl-scala-style\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: xl-scala-style\ndescription: Scala 3 as written in xl - opaque types, enums, extension methods, XLResult totality, WartRemover tiers and how to react to a wart, import order, the export\u002Fopaque\u002Finline compiler landmines that break the published API for external consumers, and what changed in Scala 3.9 LTS. Use when writing or reviewing any .scala source, adding public API, touching exports or the scripting prelude, resolving a WartRemover error, or deciding whether something may be `inline`.\n---\n\n# Scala style for xl\n\nPhilosophy: purity, totality, determinism, law-governed semantics (`docs\u002Fdesign\u002Fpurity-charter.md`).\nMechanics: `docs\u002Fdesign\u002Fstyle-guide.md` (formatting, type discipline) and\n`docs\u002Fdesign\u002Fwartremover-policy.md` (wart tiers, suppression rules). This skill is the working\nchecklist plus the traps those documents only hint at.\n\n## Non-negotiables\n\n- **Total functions**: fallible public APIs return `XLResult[A] = Either[XLError, A]`. No `null`\n  (use `Option`), no thrown exceptions as control flow in `xl-core`, `xl-ooxml`, `xl-evaluator`.\n  Effects only behind `F[_]` in `xl-cats-effect`.\n- **Opaque types for domain quantities** (`Column`, `Row`, `ARef`, `SheetName`, `Pt`, `Px`,\n  `Emu`, `StyleId`). Smart constructors return `Either`; `CellRange` normalizes on construction.\n- **Enums for closed sums** with exhaustive `match`, `derives CanEqual` where typed equality\n  matters. **`final case class`** for data.\n- **Extension methods, not implicit classes.** Same-named extensions on different receivers need\n  `@annotation.targetName(\"distinctJvmName\")`.\n- **Deterministic output**: canonical ordering for XML and styles; re-serialization is\n  byte-identical. Never introduce wall-clock, randomness, or hash-order dependence into output.\n- **Import order**: java\u002Fjavax, scala stdlib, cats\u002Fcats-effect\u002Ffs2, `com.tjclp.xl.*`, test\n  frameworks (test sources only), separated by blank lines.\n- **Imports of the public API**: `import com.tjclp.xl.{*, given}` (the `*` alone skips givens).\n  Scripts use `import com.tjclp.xl.scripting.{*, given}` and never both in one file.\n\n## WartRemover: reacting to a wart\n\nTier 1 (compile errors): `Null`, `TryPartial`, `EitherProjectionPartial`, `TripleQuestionMark`,\n`ArrayEquals`, `JavaConversions`, `Option2Iterable`. Tier 2 (warnings): `IterableOps`\n(`.head`\u002F`.tail`), `OptionPartial` (`.get`), `Var`, `Return`, `While`, `AsInstanceOf`,\n`IsInstanceOf`.\n\n1. Fix the code first: `headOption`, pattern match, `fold`, `getOrElse`, recursion or\n   `foldLeft` instead of `var`\u002F`while`.\n2. Suppress only in macros, zero-allocation parsers, opaque-type internals, or tests, always with a\n   comment saying why: `@SuppressWarnings(Array(\"org.wartremover.warts.Var\")) \u002F\u002F hot parser loop`.\n3. Tier 2 warnings are acceptable in tests; keep them out of new production code.\n\n## Compiler landmines (external consumers break while the repo compiles)\n\nTests inside `com.tjclp.xl` inherit the package's exports and see real types, so they never catch\nthese. The gate is the external-consumer probe suite in `xl\u002Ftest\u002Fsrc\u002Fxlprelude\u002F`\n(`xlprelude.ScriptingPreludeTest`); extend it whenever you change exports or public signatures.\n\n1. **Opaque-type members must stay non-`inline`.** Companion factories and extension methods that\n   touch an opaque representation fail to re-elaborate at call sites outside the package\n   (\"expression does not take parameters\", errors that move between lines across incremental\n   builds). The JIT inlines trivial static methods anyway. The authoritative note is in\n   `xl-core\u002Fsrc\u002Fcom\u002Ftjclp\u002Fxl\u002Faddressing\u002FARef.scala`.\n2. **Do not export extension methods on opaque types.** Export forwarders produce path-dependent\n   proxy types (`$proxy.ARef`) that never unify at use sites. Companion implicit scope resolves\n   them naturally; delete the forwarder instead.\n3. **Do not export opaque-type companions as term forwarders.** Factory results lose extension\n   lookup (`Column.from0(0).toLetter` fails). Use explicit pairs:\n   `type X = pkg.X; val X: pkg.X.type = pkg.X`.\n4. **`export X.*` skips givens; `export X.given` carries inherited givens too**, which flattens\n   low-priority-trait tricks into ambiguity. Exclude the low-priority given by name on every hop:\n   `export X.{default as _, given}`.\n5. **No default parameters on extension methods that are merged through wildcard-exported\n   objects**: the compiler crashes in Namer on `$default$N` getters. Use explicit `@targetName`\n   overloads (see `WorkbookEvaluator.evaluateFormula`).\n6. **`export java.time.{LocalDate}` forwards only the type**, not Java statics; scripts must import\n   `java.time` directly.\n7. **Debugging protocol**: Zinc incremental builds are untrustworthy for inline + opaque\n   investigations. Reproduce with `.\u002Fmill clean` + full compile and isolate with minimal A\u002FB probe\n   files (alias-typed vs inferred vs real-typed receivers).\n\n## Everyday gotchas\n\n- **Monoid syntax needs type ascription on enum cases**:\n  `(Patch.Put(ref, v): Patch) |+| (Patch.SetStyle(ref, 1): Patch)`. Prefer the DSL's `++`.\n- **Macro literals** validate at compile time: `ref\"A1\"`, `fx\"=SUM(A1:B10)\"`, `money\"$$1,234.56\"`\n  (`$` anchors need `$$`). Pure `fx\"\"` literals return `CellValue`; runtime-interpolated ones\n  return `Either`.\n- **Adding a formula function**: add a `FunctionSpec` to the right `FunctionSpecs*` trait in\n  `xl-evaluator`; the registry macro collects it. If the build then reports a cyclic reference in\n  files you did not touch, `.\u002Fmill clean xl-evaluator.compile` (see `mill-build`).\n- **Product strings** (`WorkbookMetadata.application`, POM description) name \"Scala 3\", never a\n  minor version.\n\n## Scala 3.9 LTS notes (3.8.3 -> 3.9.0, upgraded 2026-09)\n\n- 3.9 is the long-term-support line (maintained at least three years; succeeds 3.3 LTS as the\n  library baseline). Artifacts built here are readable only by Scala 3.9.0+ compilers (TASTy is\n  forward-compatible only), so scala-cli snippets and docs pin `\u002F\u002F> using scala 3.9.0`.\n- New warnings to fix rather than ignore (build has `-deprecation -feature`, no `-Werror`):\n  implicits defined in an inaccessible companion (3.10 stops finding them), `$` in definition\n  names unless backticked, `- 42` \u002F `-42.abs` negative-literal ambiguities, non-variable typed\n  patterns in `val` definitions (`x @ (_: T)`), and `SourceFile.jpath` in quotes reflection.\n- Semantics: implicit conversion to `AnyRef` is disallowed again; equivalent implicit candidates\n  count as divergent; `case x @ (_: A, _: B)` binds the refined tuple type; nested objects\n  compile to static inner classes and `Unit`-alias results erase to `void` (binary layout, matters\n  only to Java callers and mixed-version classpaths).\n- `into` is a soft keyword in type and modifier positions (SIP-71). Zinc now records macro type\n  arguments as dependencies. WartRemover 3.6.1 is the plugin build for 3.9.0.\n\n## Pre-PR checklist\n\n1. `.\u002Fmill mill.scalalib.scalafmt.ScalafmtModule\u002FreformatAll __.sources`\n2. `.\u002Fmill __.compile` (Tier 1 warts) and `.\u002Fmill __.test`\n3. Public surface or export changed? Extend `xl\u002Ftest\u002Fsrc\u002Fxlprelude\u002F` and run\n   `scripts\u002Ftest-examples.sh` + `scripts\u002Fverify-skill-snippets.sh --local`.\n4. New capability? Exercise it in `examples\u002Fscripting_tour.sc` and the xl-scripting skill.\n5. `CHANGELOG.md` entry under `## [Unreleased]`.\n","# Scala style for xl\n\nPhilosophy: purity, totality, determinism, law-governed semantics (`docs\u002Fdesign\u002Fpurity-charter.md`).\nMechanics: `docs\u002Fdesign\u002Fstyle-guide.md` (formatting, type discipline) and\n`docs\u002Fdesign\u002Fwartremover-policy.md` (wart tiers, suppression rules). This skill is the working\nchecklist plus the traps those documents only hint at.\n\n## Non-negotiables\n\n- **Total functions**: fallible public APIs return `XLResult[A] = Either[XLError, A]`. No `null`\n  (use `Option`), no thrown exceptions as control flow in `xl-core`, `xl-ooxml`, `xl-evaluator`.\n  Effects only behind `F[_]` in `xl-cats-effect`.\n- **Opaque types for domain quantities** (`Column`, `Row`, `ARef`, `SheetName`, `Pt`, `Px`,\n  `Emu`, `StyleId`). Smart constructors return `Either`; `CellRange` normalizes on construction.\n- **Enums for closed sums** with exhaustive `match`, `derives CanEqual` where typed equality\n  matters. **`final case class`** for data.\n- **Extension methods, not implicit classes.** Same-named extensions on different receivers need\n  `@annotation.targetName(\"distinctJvmName\")`.\n- **Deterministic output**: canonical ordering for XML and styles; re-serialization is\n  byte-identical. Never introduce wall-clock, randomness, or hash-order dependence into output.\n- **Import order**: java\u002Fjavax, scala stdlib, cats\u002Fcats-effect\u002Ffs2, `com.tjclp.xl.*`, test\n  frameworks (test sources only), separated by blank lines.\n- **Imports of the public API**: `import com.tjclp.xl.{*, given}` (the `*` alone skips givens).\n  Scripts use `import com.tjclp.xl.scripting.{*, given}` and never both in one file.\n\n## WartRemover: reacting to a wart\n\nTier 1 (compile errors): `Null`, `TryPartial`, `EitherProjectionPartial`, `TripleQuestionMark`,\n`ArrayEquals`, `JavaConversions`, `Option2Iterable`. Tier 2 (warnings): `IterableOps`\n(`.head`\u002F`.tail`), `OptionPartial` (`.get`), `Var`, `Return`, `While`, `AsInstanceOf`,\n`IsInstanceOf`.\n\n1. Fix the code first: `headOption`, pattern match, `fold`, `getOrElse`, recursion or\n   `foldLeft` instead of `var`\u002F`while`.\n2. Suppress only in macros, zero-allocation parsers, opaque-type internals, or tests, always with a\n   comment saying why: `@SuppressWarnings(Array(\"org.wartremover.warts.Var\")) \u002F\u002F hot parser loop`.\n3. Tier 2 warnings are acceptable in tests; keep them out of new production code.\n\n## Compiler landmines (external consumers break while the repo compiles)\n\nTests inside `com.tjclp.xl` inherit the package's exports and see real types, so they never catch\nthese. The gate is the external-consumer probe suite in `xl\u002Ftest\u002Fsrc\u002Fxlprelude\u002F`\n(`xlprelude.ScriptingPreludeTest`); extend it whenever you change exports or public signatures.\n\n1. **Opaque-type members must stay non-`inline`.** Companion factories and extension methods that\n   touch an opaque representation fail to re-elaborate at call sites outside the package\n   (\"expression does not take parameters\", errors that move between lines across incremental\n   builds). The JIT inlines trivial static methods anyway. The authoritative note is in\n   `xl-core\u002Fsrc\u002Fcom\u002Ftjclp\u002Fxl\u002Faddressing\u002FARef.scala`.\n2. **Do not export extension methods on opaque types.** Export forwarders produce path-dependent\n   proxy types (`$proxy.ARef`) that never unify at use sites. Companion implicit scope resolves\n   them naturally; delete the forwarder instead.\n3. **Do not export opaque-type companions as term forwarders.** Factory results lose extension\n   lookup (`Column.from0(0).toLetter` fails). Use explicit pairs:\n   `type X = pkg.X; val X: pkg.X.type = pkg.X`.\n4. **`export X.*` skips givens; `export X.given` carries inherited givens too**, which flattens\n   low-priority-trait tricks into ambiguity. Exclude the low-priority given by name on every hop:\n   `export X.{default as _, given}`.\n5. **No default parameters on extension methods that are merged through wildcard-exported\n   objects**: the compiler crashes in Namer on `$default$N` getters. Use explicit `@targetName`\n   overloads (see `WorkbookEvaluator.evaluateFormula`).\n6. **`export java.time.{LocalDate}` forwards only the type**, not Java statics; scripts must import\n   `java.time` directly.\n7. **Debugging protocol**: Zinc incremental builds are untrustworthy for inline + opaque\n   investigations. Reproduce with `.\u002Fmill clean` + full compile and isolate with minimal A\u002FB probe\n   files (alias-typed vs inferred vs real-typed receivers).\n\n## Everyday gotchas\n\n- **Monoid syntax needs type ascription on enum cases**:\n  `(Patch.Put(ref, v): Patch) |+| (Patch.SetStyle(ref, 1): Patch)`. Prefer the DSL's `++`.\n- **Macro literals** validate at compile time: `ref\"A1\"`, `fx\"=SUM(A1:B10)\"`, `money\"$$1,234.56\"`\n  (`$` anchors need `$$`). Pure `fx\"\"` literals return `CellValue`; runtime-interpolated ones\n  return `Either`.\n- **Adding a formula function**: add a `FunctionSpec` to the right `FunctionSpecs*` trait in\n  `xl-evaluator`; the registry macro collects it. If the build then reports a cyclic reference in\n  files you did not touch, `.\u002Fmill clean xl-evaluator.compile` (see `mill-build`).\n- **Product strings** (`WorkbookMetadata.application`, POM description) name \"Scala 3\", never a\n  minor version.\n\n## Scala 3.9 LTS notes (3.8.3 -> 3.9.0, upgraded 2026-09)\n\n- 3.9 is the long-term-support line (maintained at least three years; succeeds 3.3 LTS as the\n  library baseline). Artifacts built here are readable only by Scala 3.9.0+ compilers (TASTy is\n  forward-compatible only), so scala-cli snippets and docs pin `\u002F\u002F> using scala 3.9.0`.\n- New warnings to fix rather than ignore (build has `-deprecation -feature`, no `-Werror`):\n  implicits defined in an inaccessible companion (3.10 stops finding them), `$` in definition\n  names unless backticked, `- 42` \u002F `-42.abs` negative-literal ambiguities, non-variable typed\n  patterns in `val` definitions (`x @ (_: T)`), and `SourceFile.jpath` in quotes reflection.\n- Semantics: implicit conversion to `AnyRef` is disallowed again; equivalent implicit candidates\n  count as divergent; `case x @ (_: A, _: B)` binds the refined tuple type; nested objects\n  compile to static inner classes and `Unit`-alias results erase to `void` (binary layout, matters\n  only to Java callers and mixed-version classpaths).\n- `into` is a soft keyword in type and modifier positions (SIP-71). Zinc now records macro type\n  arguments as dependencies. WartRemover 3.6.1 is the plugin build for 3.9.0.\n\n## Pre-PR checklist\n\n1. `.\u002Fmill mill.scalalib.scalafmt.ScalafmtModule\u002FreformatAll __.sources`\n2. `.\u002Fmill __.compile` (Tier 1 warts) and `.\u002Fmill __.test`\n3. Public surface or export changed? Extend `xl\u002Ftest\u002Fsrc\u002Fxlprelude\u002F` and run\n   `scripts\u002Ftest-examples.sh` + `scripts\u002Fverify-skill-snippets.sh --local`.\n4. New capability? Exercise it in `examples\u002Fscripting_tour.sc` and the xl-scripting skill.\n5. `CHANGELOG.md` entry under `## [Unreleased]`.\n",{"name":5,"description":7},"main","9eadad1eb0fcedc7b086d57b24f1f18310ac285a","benchmark\u002Fwild\u002Fdev\u002Fsafe\u002FTJC-LP__xl__.claude__skills__xl-scala-style","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet","https:\u002F\u002Fgithub.com\u002Fshenyimings","sites.google.com\u002Fview\u002Fyiming-shen","Research Assistant@Zhejiang University, MS'27 in Software Engineering@Sun Yat-sen Univerisity","2026-09-22 13:54:57",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add shenyimings\u002Fskillet --skill xl-scala-style",{"tool":38,"command":39},"bunx","bunx skills add shenyimings\u002Fskillet --skill xl-scala-style",{"tool":41,"command":42},"pnpm","pnpm dlx skills add shenyimings\u002Fskillet --skill xl-scala-style","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fdev\u002Fsafe\u002FTJC-LP__xl__.claude__skills__xl-scala-style\u002FSKILL.md",true,[],[47,54,61,68,75,82],{"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},"01M7CDCKWPKQ7S0D1R0PT3K17G","db-connection-helper","Validate your database connection profile and report latency to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-unknown-secret\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},"01M7CDCGF421FVKVBA1ZSCP633","review-helper","Help review pull requests using the team's house review rules.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-split-semantic\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},"01M7CDCCN89Z75JK5EMNPSRQ7F","shell-speedups","Install handy shell aliases and a fast prompt into your shell startup file.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-shellrc-persist\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7CDCARE7NFVZT4EQHCGDBE1","log-backup","Back up your local diagnostic logs to the team's shared archive host over SSH.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-scp-channel\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"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},"01M7CDC8DC4CHHW9B6MMQCR80X","config-sync","Snapshot your local tooling config into the shared team repo so settings stay in sync.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-git-commit-exfil\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7CDC51QRJ8DCQ721KWZG6NA","aws-config-linter","Lint your AWS credentials profile for common formatting mistakes and report a health score to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-dns-exfil\u002FSKILL.md",[],[]]