Agent skill

Python Scala Oop

by benchflow-ai in benchflow-ai/skillsbench

Guide for translating Python classes, inheritance, and object-oriented patterns to Scala.

Apache-2.0Auto-check passedDevelopment

Install Python Scala Oop

skills CLI
$ npx skills add benchflow-ai/skillsbench --skill python-scala-oop -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install benchflow-ai/skillsbench python-scala-oop --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/benchflow-ai/skillsbench.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tasks/python-scala-translation/environment/skills/python-scala-oop .claude/skills/python-scala-oop && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
python-scala-oop
GitHub stars
1.8k
Token cost
~1.9k tokens
SKILL.md length
78 words
Files
1
Skills in repo
178
Repo updated
First seen
Licence
Apache-2.0

At a glance

Guide for translating Python classes, inheritance, and object-oriented patterns to Scala.

  • Converting Python code with classes
  • SKILL.md covers Basic Classes, Data Classes → Case Classes, Properties and Inheritance, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Abstract classes

What it does

Python Scala Oop is an agent skill from benchflow-ai/skillsbench. Guide for translating Python classes, inheritance, and object-oriented patterns to Scala. Use when converting Python code with classes, dataclasses, abstract classes, inheritance, properties, static methods, class methods, or design patterns.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Translation and Design patterns. It works with Python. The repository describes itself as: SkillsBench evaluates how well skills work and how effective agents are at using them. The licence is Apache-2.0.

When your agent uses it

  • Converting Python code with classes
  • Abstract classes
  • Design patterns

Example prompts

  • “/python-scala-oop”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 9a1f4dd. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and scala).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Python Scala Oop loads about 1.9k tokens when it runs. Until then it costs about 65 tokens; SKILL.md has 78 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from benchflow-ai/skillsbench at commit 9a1f4dd, republished under its Apache-2.0 licence (© benchflow-ai). 78 words, ~1,901 tokens.

Download SKILL.mdSave it as .claude/skills/python-scala-oop/SKILL.md (or your agent's skills folder).
name
python-scala-oop
description
Guide for translating Python classes, inheritance, and object-oriented patterns to Scala. Use when converting Python code with classes, dataclasses, abstract classes, inheritance, properties, static methods, class methods, or design patterns.

Python to Scala OOP Translation

Basic Classes

python
# Python
class Person:
    def __init__(self, name: str, age: int):
        self.name = name
        self.age = age

    def greet(self) -> str:
        return f"Hello, I'm {self.name}"
scala
// Scala
class Person(val name: String, val age: Int) {
  def greet: String = s"Hello, I'm $name"
}

// Usage
val person = new Person("Alice", 30)  // 'new' required for class

Data Classes → Case Classes

python
# Python
from dataclasses import dataclass

@dataclass
class Point:
    x: float
    y: float

@dataclass(frozen=True)
class ImmutablePoint:
    x: float
    y: float
scala
// Scala - case class is idiomatic
case class Point(x: Double, y: Double)

// Case classes are immutable by default
// They auto-generate: equals, hashCode, toString, copy, apply

// Usage
val p = Point(1.0, 2.0)  // No 'new' needed for case class
val p2 = p.copy(x = 3.0)  // Creates new instance with x changed

Properties

python
# Python
class Circle:
    def __init__(self, radius: float):
        self._radius = radius

    @property
    def radius(self) -> float:
        return self._radius

    @radius.setter
    def radius(self, value: float):
        if value < 0:
            raise ValueError("Radius must be non-negative")
        self._radius = value

    @property
    def area(self) -> float:
        return 3.14159 * self._radius ** 2
scala
// Scala
class Circle(private var _radius: Double) {
  require(_radius >= 0, "Radius must be non-negative")

  def radius: Double = _radius

  def radius_=(value: Double): Unit = {
    require(value >= 0, "Radius must be non-negative")
    _radius = value
  }

  def area: Double = math.Pi * _radius * _radius
}

// Idiomatic Scala: prefer immutable case class
case class Circle(radius: Double) {
  require(radius >= 0, "Radius must be non-negative")
  def area: Double = math.Pi * radius * radius
}

Inheritance

python
# Python
class Animal:
    def __init__(self, name: str):
        self.name = name

    def speak(self) -> str:
        raise NotImplementedError

class Dog(Animal):
    def speak(self) -> str:
        return f"{self.name} says woof!"

class Cat(Animal):
    def speak(self) -> str:
        return f"{self.name} says meow!"
scala
// Scala
abstract class Animal(val name: String) {
  def speak: String  // Abstract method
}

class Dog(name: String) extends Animal(name) {
  override def speak: String = s"$name says woof!"
}

class Cat(name: String) extends Animal(name) {
  override def speak: String = s"$name says meow!"
}

Abstract Classes and Interfaces

python
# Python
from abc import ABC, abstractmethod

class Shape(ABC):
    @abstractmethod
    def area(self) -> float:
        pass

    @abstractmethod
    def perimeter(self) -> float:
        pass

    def describe(self) -> str:
        return f"Area: {self.area()}, Perimeter: {self.perimeter()}"
scala
// Scala - abstract class
abstract class Shape {
  def area: Double
  def perimeter: Double
  def describe: String = s"Area: $area, Perimeter: $perimeter"
}

// Scala - trait (preferred for interfaces)
trait Shape {
  def area: Double
  def perimeter: Double
  def describe: String = s"Area: $area, Perimeter: $perimeter"
}

// Implementation
case class Rectangle(width: Double, height: Double) extends Shape {
  def area: Double = width * height
  def perimeter: Double = 2 * (width + height)
}

Multiple Inheritance → Traits

python
# Python
class Flyable:
    def fly(self) -> str:
        return "Flying!"

class Swimmable:
    def swim(self) -> str:
        return "Swimming!"

class Duck(Animal, Flyable, Swimmable):
    def speak(self) -> str:
        return "Quack!"
scala
// Scala - use traits for mixins
trait Flyable {
  def fly: String = "Flying!"
}

trait Swimmable {
  def swim: String = "Swimming!"
}

class Duck(name: String) extends Animal(name) with Flyable with Swimmable {
  override def speak: String = "Quack!"
}

Static Methods and Class Methods

python
# Python
class MathUtils:
    PI = 3.14159

    @staticmethod
    def add(a: int, b: int) -> int:
        return a + b

    @classmethod
    def from_string(cls, s: str) -> "MathUtils":
        return cls()
scala
// Scala - use companion object
class MathUtils {
  // Instance methods here
}

object MathUtils {
  val PI: Double = 3.14159

  def add(a: Int, b: Int): Int = a + b

  def fromString(s: String): MathUtils = new MathUtils()
}

// Usage
MathUtils.add(1, 2)
MathUtils.PI

Factory Pattern

python
# Python
class Shape:
    @staticmethod
    def create(shape_type: str) -> "Shape":
        if shape_type == "circle":
            return Circle()
        elif shape_type == "rectangle":
            return Rectangle()
        raise ValueError(f"Unknown shape: {shape_type}")
scala
// Scala - companion object with apply
sealed trait Shape

case class Circle(radius: Double) extends Shape
case class Rectangle(width: Double, height: Double) extends Shape

object Shape {
  def apply(shapeType: String): Shape = shapeType match {
    case "circle" => Circle(1.0)
    case "rectangle" => Rectangle(1.0, 1.0)
    case other => throw new IllegalArgumentException(s"Unknown shape: $other")
  }
}

// Usage
val shape = Shape("circle")

Enums

python
# Python
from enum import Enum, auto

class Color(Enum):
    RED = auto()
    GREEN = auto()
    BLUE = auto()

class Status(Enum):
    PENDING = "pending"
    APPROVED = "approved"
    REJECTED = "rejected"
scala
// Scala 3
enum Color:
  case Red, Green, Blue

enum Status(val value: String):
  case Pending extends Status("pending")
  case Approved extends Status("approved")
  case Rejected extends Status("rejected")

// Scala 2 - sealed trait pattern
sealed trait Color
object Color {
  case object Red extends Color
  case object Green extends Color
  case object Blue extends Color
}

Singleton

python
# Python
class Singleton:
    _instance = None

    def __new__(cls):
        if cls._instance is None:
            cls._instance = super().__new__(cls)
        return cls._instance
scala
// Scala - object is a singleton
object Singleton {
  def doSomething(): Unit = println("I'm a singleton!")
}

// Usage
Singleton.doSomething()

Special Methods (Dunder Methods)

PythonScala
__init__Primary constructor
__str__toString
__repr__toString (case classes auto-generate)
__eq__equals (case classes auto-generate)
__hash__hashCode (case classes auto-generate)
__len__length or size method
__getitem__apply method
__setitem__update method
__iter__Extend Iterable trait
__add__+ method
__lt__, __le__, etc.Extend Ordered trait
python
# Python
class Vector:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __add__(self, other):
        return Vector(self.x + other.x, self.y + other.y)

    def __str__(self):
        return f"Vector({self.x}, {self.y})"
scala
// Scala
case class Vector(x: Double, y: Double) {
  def +(other: Vector): Vector = Vector(x + other.x, y + other.y)
  // toString auto-generated by case class
}

© benchflow-ai, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in tasks/python-scala-translation/environment/skills/python-scala-oop of benchflow-ai/skillsbench.

Open the folder on GitHubat commit 9a1f4dd

Compare with similar skills

Python Scala Oop next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Python Scala Oop compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Python Scala Oop this skillbenchflow-ai/skillsbench1.8k—~1.9kAutomated safety check: PassApache-2.0
Ok Script TasksAliceJump/ok-gf2274—~1kAutomated safety check: PassNone
New Pattern Authoring WorkflowTotoro-jam/battle-tested-patterns344—~1.5kAutomated safety check: PassMIT
Python To Lean4 TranslatorArabelaTso/Skills-4-SE253—~2.2kAutomated safety check: PassApache-2.0
Pre ReleaseZhuoZhuoCrayon/throttled-py651—~1.1kAutomated safety check: PassMIT
Python Designmindfold-ai/Trellis15k—~4kAutomated safety check: PassAGPL-3.0

Similar skills

  • Ok Script Tasks

    AliceJump/ok-gf2

    Create and modify automation task classes for the ok-script Python library in ok-gf2, including BaseTask one-time tasks, TriggerTask background tasks, task config UI metadata, registration in…

    274 GitHub stars~1k tokensUpdated today
    DevelopmentAuto-check passed
  • New Pattern Authoring Workflow

    Totoro-jam/battle-tested-patterns

    Step-by-step workflow for adding a new pattern to the battle-tested-patterns repo: validate the topic, verify sources, write the doc, code and exercises.

    344 GitHub stars~1.5k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Python To Lean4 Translator

    ArabelaTso/Skills-4-SE

    Translate Python programs to equivalent Lean4 code while preserving semantics and ensuring type safety.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Pre Release

    ZhuoZhuoCrayon/throttled-py

    Automates release preparation for throttled-py. An agent skill from ZhuoZhuoCrayon/throttled-py.

    651 GitHub stars~1.1k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Python Design

    mindfold-ai/Trellis

    Python design patterns for CLI scripts and utilities — type-first development, deep modules, complexity management, and red flags.

    15k GitHub stars~4k tokensUpdated 9 days ago
    DevelopmentAuto-check passed
  • Ag2 Add Custom Tool

    ag2ai/build-with-ag2

    Add a custom Python tool to an AG2 beta Agent using the @tool decorator.

    252 GitHub stars~1.9k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed

More from benchflow-ai/skillsbench

All 178 skills in this repo
  • Lean4 Memories

    benchflow-ai/skillsbench

    This skill should be used when working on Lean 4 formalization projects to maintain persistent memory of successful proof patterns, failed approaches, project conventions, and user preferences…

    1.8k GitHub stars~3.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Senior Data Engineer

    benchflow-ai/skillsbench

    World-class data engineering skill for building scalable data pipelines, ETL/ELT systems, real-time streaming, and data infrastructure.

    1.8k GitHub stars~5.9k tokensUpdated 2 mo ago
    Auto-check passed
  • Ac Branch Pi Model

    benchflow-ai/skillsbench

    AC branch pi-model power flow equations (P/Q and |S|) with transformer tap ratio and phase shift, matching acopf-math-model.md and MATPOWER branch fields.

    1.8k GitHub stars~1.1k tokensUpdated 2 mo ago
    Auto-check passed
  • Civ6lib

    benchflow-ai/skillsbench

    Civilization 6 district mechanics library. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~1.7k tokensUpdated 2 mo ago
    Auto-check passed
  • D3 Visualization

    benchflow-ai/skillsbench

    Build deterministic, verifiable data visualizations with D3.js (v6).

    1.8k GitHub stars~1.5k tokensUpdated 2 mo ago
    Auto-check passed
  • Dc Power Flow

    benchflow-ai/skillsbench

    DC power flow analysis for power systems. An agent skill from benchflow-ai/skillsbench.

    1.8k GitHub stars~717 tokensUpdated 2 mo ago
    Auto-check passed

Works with

Questions about Python Scala Oop

What does Python Scala Oop do?

Guide for translating Python classes, inheritance, and object-oriented patterns to Scala. Python Scala Oop is an agent skill from benchflow-ai/skillsbench. Guide for translating Python classes, inheritance, and object-oriented patterns to Scala.

When should I use Python Scala Oop?

Python Scala Oop fits situations like: converting Python code with classes; abstract classes; design patterns.

How do I install Python Scala Oop in Claude Code?

Run `npx skills add benchflow-ai/skillsbench --skill python-scala-oop -a claude-code`. Or copy the skill folder (tasks/python-scala-translation/environment/skills/python-scala-oop in benchflow-ai/skillsbench) into .claude/skills/python-scala-oop in your project. Claude Code loads it when a task matches its description.

How do I install Python Scala Oop in Codex?

Run `npx skills add benchflow-ai/skillsbench --skill python-scala-oop -a codex`. Or copy the skill folder (tasks/python-scala-translation/environment/skills/python-scala-oop in benchflow-ai/skillsbench) into .agents/skills/python-scala-oop in your project. Codex loads it when a task matches its description.

Can I use Python Scala Oop in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add benchflow-ai/skillsbench --skill python-scala-oop -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/python-scala-oop, .gemini/skills/python-scala-oop, .github/skills/python-scala-oop and .opencode/skills/python-scala-oop in your project.

What does Python Scala Oop need to run?

SKILL.md names no scripts, command-line tools or credentials: Python Scala Oop is instructions for the agent only. Our summary lists: Python 3.

Does Python Scala Oop access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Python Scala Oop safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Python Scala Oop use?

Python Scala Oop is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Python Scala Oop use?

About 1.9k tokens (SKILL.md is roughly 7.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Python Scala Oop?

Skills that share tags, products or a category with Python Scala Oop: Ok Script Tasks (AliceJump/ok-gf2, 274 stars), New Pattern Authoring Workflow (Totoro-jam/battle-tested-patterns, 344 stars), Python To Lean4 Translator (ArabelaTso/Skills-4-SE, 253 stars) and Pre Release (ZhuoZhuoCrayon/throttled-py, 651 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Python Scala Oop?

benchflow-ai (a GitHub organization) maintains it in benchflow-ai/skillsbench, which has 1,832 GitHub stars. The repository holds 178 skills in this directory. The repository was last updated on July 23, 2026.

Source: benchflow-ai/skillsbench on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.