[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CWRPGGV796XZG651KT2A3R":3,"skill-same:01M6CWRPGGV796XZG651KT2A3R":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":32,"linkOnly":33,"markdownContent":34,"markdownBody":35,"frontMatter":36,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":47,"install":48,"resources":61},"01M6CWRPGGV796XZG651KT2A3R","Scala",null,"Hybrid object-oriented and functional programming language that runs on the JVM with strong static typing.","ffsshhttiikk\u002Fopencode-agents-skills","ffsshhttiikk","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F226346827?v=4","01M6CWD9RR3Y7VRQX3MXYC8FYH","01M6CWD9WVPYAZW0J82G1VKGHY",3,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fcomputer-science\u002Fscala\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[23,24,25,26,27,28,29,30,31],"scala","big data","functional programming","programming language","static typing","data","programming","backend","language","2026-11-10 10:12:30",false,"---\nname: Scala\ndescription: Hybrid object-oriented and functional programming language that runs on the JVM with strong static typing.\nlicense: Apache License 2.0\ncompatibility: Scala 2.13+, Scala 3.x\naudience: Big data engineers, backend developers, functional programming enthusiasts\ncategory: Programming Languages\n---\n\n# Scala\n\n## What I do\n\nI am a general-purpose programming language designed by Martin Odersky, first released in 2003. I run on the Java Virtual Machine (JVM), providing full interoperability with Java and access to the Java ecosystem. I combine object-oriented and functional programming paradigms, featuring immutable data structures, pattern matching, case classes, and powerful type inference. I am widely used in big data processing (Apache Spark), Akka for concurrent\u002Fdistributed applications, and web frameworks (Play Framework).\n\n## When to use me\n\nUse Scala when building big data applications with Apache Spark, concurrent and distributed systems with Akka, web applications with Play Framework, enterprise applications requiring functional patterns, or when you need JVM compatibility with more expressive syntax than Java.\n\n## Core Concepts\n\n- **Object-Oriented + Functional**: Everything is an object, with functions as first-class citizens and immutable by default.\n- **Case Classes**: Special classes for immutable data with automatic equality, hashing, and pattern matching.\n- **Pattern Matching**: Powerful matching on data structures, types, and conditions with exhaustiveness checking.\n- **Immutability**: Values (val) preferred over variables (var), immutable collections by default.\n- **Type Inference**: Compiler infers types in most cases, reducing verbosity while maintaining safety.\n- **Higher-Order Functions**: Functions taking functions as parameters (map, flatMap, filter, reduce).\n- **Traits**: Like interfaces but can contain concrete methods and fields, supporting composition.\n- **Implicit Parameters\u002FConversions**: Compiler-supplied parameters and type conversions for flexible APIs.\n- **Lazy Evaluation**: lazy val for deferred initialization and computation when needed.\n- **SBT Build Tool**: Scala Build Tool for compilation, testing, and dependency management.\n\n## Code Examples\n\n**Pattern Matching and Case Classes:**\n```scala\nsealed trait Message\ncase class Text(from: String, content: String) extends Message\ncase class Image(from: String, url: String, size: Int) extends Message\ncase class Video(from: String, url: String, duration: Int) extends Message\ncase class SystemMessage(content: String) extends Message\n\ndef processMessage(msg: Message): String = msg match {\n  case Text(from, content) if content.length > 100 =>\n    s\"Long text from $from: ${content.take(50)}...\"\n  case Text(from, content) =>\n    s\"Text from $from: $content\"\n  case Image(from, url, size) =>\n    s\"Image from $from: $url (${size \u002F 1024}KB)\"\n  case Video(from, url, duration) =>\n    s\"Video from $from: $url (${duration \u002F 60}min)\"\n  case SystemMessage(content) =>\n    s\"SYSTEM: $content\"\n}\n\nval messages: List[Message] = List(\n  Text(\"Alice\", \"Hello!\"),\n  Text(\"Bob\", \"This is a very long message that exceeds one hundred characters in length for demonstration purposes.\"),\n  Image(\"Charlie\", \"https:\u002F\u002Fexample.com\u002Fimage.jpg\", 102400),\n  Video(\"Diana\", \"https:\u002F\u002Fexample.com\u002Fvideo.mp4\", 300),\n  SystemMessage(\"Welcome to the chat!\")\n)\n\nmessages.foreach { msg =>\n  println(processMessage(msg))\n}\n```\n\n**Higher-Order Functions and Collections:**\n```scala\nval numbers = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n\nval doubled = numbers.map(_ * 2)\nval evens = numbers.filter(_ % 2 == 0)\nval sum = numbers.reduce(_ + _)\nval product = numbers.fold(1)(_ * _)\n\nprintln(s\"Doubled: $doubled\")\nprintln(s\"Evens: $evens\")\nprintln(s\"Sum: $sum\")\nprintln(s\"Product: $product\")\n\nval words = List(\"hello\", \"world\", \"scala\", \"programming\", \"functional\")\n\nval lengths = words.map(_.length)\nval sortedByLength = words.sortBy(_.length)\nval groupedByLength = words.groupBy(_.length)\n\nprintln(s\"Lengths: $lengths\")\nprintln(s\"Sorted by length: $sortedByLength\")\nprintln(s\"Grouped by length: $groupedByLength\")\n\ncase class Person(name: String, age: Int, city: String)\n\nval people = List(\n  Person(\"Alice\", 30, \"NYC\"),\n  Person(\"Bob\", 25, \"LA\"),\n  Person(\"Charlie\", 35, \"NYC\"),\n  Person(\"Diana\", 28, \"Chicago\")\n)\n\nval names = people.map(_.name)\nval adults = people.filter(_.age >= 30)\nval groupedByCity = people.groupBy(_.city)\nval averageAge = people.map(_.age).sum \u002F people.length\n\nprintln(s\"Names: $names\")\nprintln(s\"Adults: $adults\")\nprintln(s\"Grouped by city: $groupedByCity\")\nprintln(s\"Average age: $averageAge\")\n```\n\n**Futures and Concurrency:**\n```scala\nimport scala.concurrent.{Future, Await}\nimport scala.concurrent.duration._\nimport scala.concurrent.ExecutionContext.Implicits.global\n\ndef fetchData(id: Int): Future[String] = Future {\n  Thread.sleep(100)\n  s\"Data for $id\"\n}\n\ndef fetchMultiple(ids: List[Int]): Future[List[String]] = {\n  Future.sequence(ids.map(fetchData))\n}\n\nval future1 = fetchData(1)\nval future2 = fetchData(2)\nval combined = for {\n  data1 \u003C- future1\n  data2 \u003C- future2\n} yield s\"$data1 and $data2\"\n\nval result = Await.result(combined, 1.second)\nprintln(result)\n\nval ids = (1 to 10).toList\nval results = fetchMultiple(ids)\n\nresults.onComplete {\n  case Success(data) => println(s\"Success: ${data.mkString(\", \")}\")\n  case Failure(ex) => println(s\"Failed: ${ex.getMessage}\")\n}\n\nAwait.result(results, 2.seconds)\n```\n\n**Traits and Mixins:**\n```scala\ntrait Loggable {\n  def log(message: String): Unit = {\n    println(s\"[${java.time.LocalDateTime.now}] $message\")\n  }\n}\n\ntrait Timestampable {\n  def createdAt: java.time.LocalDateTime\n  def updatedAt: java.time.LocalDateTime\n}\n\nabstract class Entity(val id: Long) extends Loggable {\n  def save(): Boolean = {\n    log(s\"Saving entity $id\")\n    true\n  }\n}\n\nclass User(id: Long, val name: String, val email: String) \n    extends Entity(id) \n    with Timestampable {\n  \n  override val createdAt: java.time.LocalDateTime = java.time.LocalDateTime.now()\n  override var updatedAt: java.time.LocalDateTime = java.time.LocalDateTime.now()\n  \n  def update(name: String, email: String): Unit = {\n    this.name = name\n    this.email = email\n    this.updatedAt = java.time.LocalDateTime.now()\n    log(s\"Updated user $id\")\n  }\n  \n  override def toString: String = s\"User($id, $name, $email)\"\n}\n\nval user = new User(1, \"Alice\", \"alice@example.com\")\nprintln(user)\nuser.update(\"Alice Smith\", \"alice.smith@example.com\")\nprintln(s\"Created: ${user.createdAt}\")\nprintln(s\"Updated: ${user.updatedAt}\")\n```\n\n## Best Practices\n\n1. **Prefer vals over vars**: Use immutable values by default; only use mutable variables when necessary.\n2. **Use Case Classes for Immutable Data**: Case classes provide equals, hashCode, toString, and copy automatically.\n3. **Use Option Instead of Null**: Return Option[T] instead of T | null to represent optional values.\n4. **Use Try for Exception Handling**: Return Try[T] for operations that might throw exceptions.\n5. **Prefer For Comprehensions Over Nested Maps\u002FFlatMaps**: For comprehensions are more readable for nested operations.\n6. **Use Sealed Traits for Enums**: sealed trait with case classes provides exhaustiveness checking in pattern matching.\n7. **Keep Functions Small**: Functions should do one thing; use small, composable functions.\n8. **Use Type Aliases for Complex Types**: Create type aliases for frequently used complex types.\n9. **Run Scalafmt**: Use the standard Scala formatter for consistent code style.\n10. **Write Tests with ScalaTest\u002FMunit**: Use ScalaTest or Munit for unit and property-based testing.\n","# Scala\n\n## What I do\n\nI am a general-purpose programming language designed by Martin Odersky, first released in 2003. I run on the Java Virtual Machine (JVM), providing full interoperability with Java and access to the Java ecosystem. I combine object-oriented and functional programming paradigms, featuring immutable data structures, pattern matching, case classes, and powerful type inference. I am widely used in big data processing (Apache Spark), Akka for concurrent\u002Fdistributed applications, and web frameworks (Play Framework).\n\n## When to use me\n\nUse Scala when building big data applications with Apache Spark, concurrent and distributed systems with Akka, web applications with Play Framework, enterprise applications requiring functional patterns, or when you need JVM compatibility with more expressive syntax than Java.\n\n## Core Concepts\n\n- **Object-Oriented + Functional**: Everything is an object, with functions as first-class citizens and immutable by default.\n- **Case Classes**: Special classes for immutable data with automatic equality, hashing, and pattern matching.\n- **Pattern Matching**: Powerful matching on data structures, types, and conditions with exhaustiveness checking.\n- **Immutability**: Values (val) preferred over variables (var), immutable collections by default.\n- **Type Inference**: Compiler infers types in most cases, reducing verbosity while maintaining safety.\n- **Higher-Order Functions**: Functions taking functions as parameters (map, flatMap, filter, reduce).\n- **Traits**: Like interfaces but can contain concrete methods and fields, supporting composition.\n- **Implicit Parameters\u002FConversions**: Compiler-supplied parameters and type conversions for flexible APIs.\n- **Lazy Evaluation**: lazy val for deferred initialization and computation when needed.\n- **SBT Build Tool**: Scala Build Tool for compilation, testing, and dependency management.\n\n## Code Examples\n\n**Pattern Matching and Case Classes:**\n```scala\nsealed trait Message\ncase class Text(from: String, content: String) extends Message\ncase class Image(from: String, url: String, size: Int) extends Message\ncase class Video(from: String, url: String, duration: Int) extends Message\ncase class SystemMessage(content: String) extends Message\n\ndef processMessage(msg: Message): String = msg match {\n  case Text(from, content) if content.length > 100 =>\n    s\"Long text from $from: ${content.take(50)}...\"\n  case Text(from, content) =>\n    s\"Text from $from: $content\"\n  case Image(from, url, size) =>\n    s\"Image from $from: $url (${size \u002F 1024}KB)\"\n  case Video(from, url, duration) =>\n    s\"Video from $from: $url (${duration \u002F 60}min)\"\n  case SystemMessage(content) =>\n    s\"SYSTEM: $content\"\n}\n\nval messages: List[Message] = List(\n  Text(\"Alice\", \"Hello!\"),\n  Text(\"Bob\", \"This is a very long message that exceeds one hundred characters in length for demonstration purposes.\"),\n  Image(\"Charlie\", \"https:\u002F\u002Fexample.com\u002Fimage.jpg\", 102400),\n  Video(\"Diana\", \"https:\u002F\u002Fexample.com\u002Fvideo.mp4\", 300),\n  SystemMessage(\"Welcome to the chat!\")\n)\n\nmessages.foreach { msg =>\n  println(processMessage(msg))\n}\n```\n\n**Higher-Order Functions and Collections:**\n```scala\nval numbers = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n\nval doubled = numbers.map(_ * 2)\nval evens = numbers.filter(_ % 2 == 0)\nval sum = numbers.reduce(_ + _)\nval product = numbers.fold(1)(_ * _)\n\nprintln(s\"Doubled: $doubled\")\nprintln(s\"Evens: $evens\")\nprintln(s\"Sum: $sum\")\nprintln(s\"Product: $product\")\n\nval words = List(\"hello\", \"world\", \"scala\", \"programming\", \"functional\")\n\nval lengths = words.map(_.length)\nval sortedByLength = words.sortBy(_.length)\nval groupedByLength = words.groupBy(_.length)\n\nprintln(s\"Lengths: $lengths\")\nprintln(s\"Sorted by length: $sortedByLength\")\nprintln(s\"Grouped by length: $groupedByLength\")\n\ncase class Person(name: String, age: Int, city: String)\n\nval people = List(\n  Person(\"Alice\", 30, \"NYC\"),\n  Person(\"Bob\", 25, \"LA\"),\n  Person(\"Charlie\", 35, \"NYC\"),\n  Person(\"Diana\", 28, \"Chicago\")\n)\n\nval names = people.map(_.name)\nval adults = people.filter(_.age >= 30)\nval groupedByCity = people.groupBy(_.city)\nval averageAge = people.map(_.age).sum \u002F people.length\n\nprintln(s\"Names: $names\")\nprintln(s\"Adults: $adults\")\nprintln(s\"Grouped by city: $groupedByCity\")\nprintln(s\"Average age: $averageAge\")\n```\n\n**Futures and Concurrency:**\n```scala\nimport scala.concurrent.{Future, Await}\nimport scala.concurrent.duration._\nimport scala.concurrent.ExecutionContext.Implicits.global\n\ndef fetchData(id: Int): Future[String] = Future {\n  Thread.sleep(100)\n  s\"Data for $id\"\n}\n\ndef fetchMultiple(ids: List[Int]): Future[List[String]] = {\n  Future.sequence(ids.map(fetchData))\n}\n\nval future1 = fetchData(1)\nval future2 = fetchData(2)\nval combined = for {\n  data1 \u003C- future1\n  data2 \u003C- future2\n} yield s\"$data1 and $data2\"\n\nval result = Await.result(combined, 1.second)\nprintln(result)\n\nval ids = (1 to 10).toList\nval results = fetchMultiple(ids)\n\nresults.onComplete {\n  case Success(data) => println(s\"Success: ${data.mkString(\", \")}\")\n  case Failure(ex) => println(s\"Failed: ${ex.getMessage}\")\n}\n\nAwait.result(results, 2.seconds)\n```\n\n**Traits and Mixins:**\n```scala\ntrait Loggable {\n  def log(message: String): Unit = {\n    println(s\"[${java.time.LocalDateTime.now}] $message\")\n  }\n}\n\ntrait Timestampable {\n  def createdAt: java.time.LocalDateTime\n  def updatedAt: java.time.LocalDateTime\n}\n\nabstract class Entity(val id: Long) extends Loggable {\n  def save(): Boolean = {\n    log(s\"Saving entity $id\")\n    true\n  }\n}\n\nclass User(id: Long, val name: String, val email: String) \n    extends Entity(id) \n    with Timestampable {\n  \n  override val createdAt: java.time.LocalDateTime = java.time.LocalDateTime.now()\n  override var updatedAt: java.time.LocalDateTime = java.time.LocalDateTime.now()\n  \n  def update(name: String, email: String): Unit = {\n    this.name = name\n    this.email = email\n    this.updatedAt = java.time.LocalDateTime.now()\n    log(s\"Updated user $id\")\n  }\n  \n  override def toString: String = s\"User($id, $name, $email)\"\n}\n\nval user = new User(1, \"Alice\", \"alice@example.com\")\nprintln(user)\nuser.update(\"Alice Smith\", \"alice.smith@example.com\")\nprintln(s\"Created: ${user.createdAt}\")\nprintln(s\"Updated: ${user.updatedAt}\")\n```\n\n## Best Practices\n\n1. **Prefer vals over vars**: Use immutable values by default; only use mutable variables when necessary.\n2. **Use Case Classes for Immutable Data**: Case classes provide equals, hashCode, toString, and copy automatically.\n3. **Use Option Instead of Null**: Return Option[T] instead of T | null to represent optional values.\n4. **Use Try for Exception Handling**: Return Try[T] for operations that might throw exceptions.\n5. **Prefer For Comprehensions Over Nested Maps\u002FFlatMaps**: For comprehensions are more readable for nested operations.\n6. **Use Sealed Traits for Enums**: sealed trait with case classes provides exhaustiveness checking in pattern matching.\n7. **Keep Functions Small**: Functions should do one thing; use small, composable functions.\n8. **Use Type Aliases for Complex Types**: Create type aliases for frequently used complex types.\n9. **Run Scalafmt**: Use the standard Scala formatter for consistent code style.\n10. **Write Tests with ScalaTest\u002FMunit**: Use ScalaTest or Munit for unit and property-based testing.\n",{"name":5,"license":37,"audience":38,"category":39,"description":7,"compatibility":40},"Apache License 2.0","Big data engineers, backend developers, functional programming enthusiasts","Programming Languages","Scala 2.13+, Scala 3.x","main","5f7a3e453c98261f93d19a6a7de44ad8f7b72d41","computer-science\u002Fscala",2,"https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk","2026-03-01 06:55:40",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill Scala",{"tool":54,"command":55},"bunx","bunx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill Scala",{"tool":57,"command":58},"pnpm","pnpm dlx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill Scala","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fcomputer-science\u002Fscala\u002FSKILL.md",true,[],[63,76,85,94,104,113],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":32},"01M6CXT9TXDF79BWJTMQAPB49G","xamarin","Xamarin cross-platform development","MIT","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fxamarin\u002FSKILL.md",[],[65,71,72,73,74,75],"platform","cross-platform","mobile","opencode","development",{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":32},"01M6CXT8AD04MFYDA32VW3FKAG","wrangling","Data wrangling fundamentals","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwrangling\u002FSKILL.md",[],[78,83,74,84,28],"data wrangling","science",{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":32},"01M6CXT717GCN7SRRNPBDP4508","windows","Windows operating system administration and scripting","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwindows\u002FSKILL.md",[],[87,92,74,93],"system","scripting",{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":32},"01M6CXT54K794NMEM3XAPZZDKT","wide-column","Wide-column data model","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwide-column\u002FSKILL.md",[],[101,102,74,103,28],"wide column","databases","model",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":32},"01M6CXT28FMT2P4V9GZE67WA8E","wide-column-stores","Wide-column database stores","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwide-column-stores\u002FSKILL.md",[],[111,102,74,112],"wide column stores","database",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":67,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":32},"01M6CXT0D0M0Q4T2N7C2RX7DSN","websockets","WebSocket implementation and best practices","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwebsockets\u002FSKILL.md",[],[115,120,121,122,74,123,124],"websocket","real-time","time","best practices","implementation"]