agentsclimarketplace

Run1 scala naming conventions and style

Skill cxcscmu/SkillLearnBench/skills/b3-teacher-feedback-claude-haiku-4-5/python-scala-translation/run1_scala-naming-conventions-and-style

Scala-specific naming conventions, code organization patterns, and style guidelines that differ from Python conventions.From its SKILL.md

Install
npx -y skills add cxcscmu/SkillLearnBench --skill run1_scala-naming-conventions-and-style

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

1.8 KB, 404 tokens by cl100k_base, as published. Nobody here has run it

Scala Naming Conventions

Classes, Traits, and Objects

  • PascalCase for class names: TokenType, BaseTokenizer, UniversalTokenizer
  • PascalCase for trait names and sealed traits
  • camelCase for object names if singleton: TokenizerBuilder (if companion object, use same name as class)
  • UPPER_SNAKE_CASE for constants and enum-like values

Functions and Variables

  • camelCase for method and variable names: tokenize, tokenizeBatch, toToken, withMetadata
  • camelCase for parameters: input, maxLength, delimiter
  • Use descriptive names; avoid single letters except in lambda expressions or mathematical contexts

Package Organization

  • Lowercase package names: com.example.tokenizer
  • Structure: separate classes/traits from utility objects
  • One public class per file is conventional (but not required)

Code Style

  • No underscore prefix for private fields; use private modifier
  • Prefer val over var (immutability first)
  • Use method chaining and builder patterns for fluent APIs
  • Indent with 2 spaces (Scala convention)

Scala-Specific Patterns

Sealed Traits for Enums

sealed trait TokenType
case object StringToken extends TokenType
case object NumericToken extends TokenType

Case Classes for Data

case class Token(
  value: String,
  tokenType: TokenType,
  position: Int,
  metadata: Map[String, String] = Map.empty
)

Builder Pattern

class TokenizerBuilder {
  private var config: Map[String, Any] = Map.empty
  def withOption(key: String, value: Any): TokenizerBuilder = {
    config = config + (key -> value)
    this
  }
  def build(): Tokenizer = new Tokenizer(config)
}

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.