Agent skill

Python Scala Syntax Mapping

by benchflow-ai in benchflow-ai/skillsbench

Reference guide for translating Python syntax constructs to Scala equivalents.

Apache-2.0Auto-check passedWriting & Content

Install Python Scala Syntax Mapping

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

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

GitHub CLI
$ gh skill install benchflow-ai/skillsbench python-scala-syntax-mapping --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-syntax-mapping .claude/skills/python-scala-syntax-mapping && 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-syntax-mapping
GitHub stars
1.8k
Token cost
~1k tokens
SKILL.md length
141 words
Files
1
Skills in repo
178
Repo updated
First seen
Licence
Apache-2.0

At a glance

Reference guide for translating Python syntax constructs to Scala equivalents.

  • Converting Python code to Scala and need mappings for basic syntax elements like variable declarations
  • SKILL.md covers Variable Declarations, Type Mappings, Control Flow and Comprehensions, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • String formatting

What it does

Python Scala Syntax Mapping is an agent skill from benchflow-ai/skillsbench. Reference guide for translating Python syntax constructs to Scala equivalents. Use when converting Python code to Scala and need mappings for basic syntax elements like variable declarations, control flow, comprehensions, string formatting, and common operators.

Its SKILL.md is about 1k 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 Writing & Content, covering Translation. 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 to Scala and need mappings for basic syntax elements like variable declarations
  • String formatting
  • Common operators

Example prompts

  • “/python-scala-syntax-mapping”

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 Syntax Mapping loads about 1k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 141 words of instructions outside code blocks.

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

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). 141 words, ~1,013 tokens.

Download SKILL.mdSave it as .claude/skills/python-scala-syntax-mapping/SKILL.md (or your agent's skills folder).
name
python-scala-syntax-mapping
description
Reference guide for translating Python syntax constructs to Scala equivalents. Use when converting Python code to Scala and need mappings for basic syntax elements like variable declarations, control flow, comprehensions, string formatting, and common operators.

Python to Scala Syntax Mapping

Variable Declarations

PythonScala
x = 5val x = 5 (immutable) or var x = 5 (mutable)
x: int = 5val x: Int = 5
x, y = 1, 2val (x, y) = (1, 2)

Prefer val over var unless mutation is required.

Type Mappings

PythonScala
intInt
floatDouble
strString
boolBoolean
NoneNone (of type Option) or null
list[T]List[T] or Seq[T]
dict[K, V]Map[K, V]
set[T]Set[T]
tuple[A, B](A, B) or Tuple2[A, B]
Optional[T]Option[T]

Control Flow

Conditionals
python
# Python
if x > 0:
    result = "positive"
elif x < 0:
    result = "negative"
else:
    result = "zero"
scala
// Scala - if is an expression
val result = if (x > 0) "positive"
             else if (x < 0) "negative"
             else "zero"
Loops
python
# Python for loop
for i in range(10):
    print(i)

for item in items:
    process(item)

for i, item in enumerate(items):
    print(f"{i}: {item}")
scala
// Scala equivalents
for (i <- 0 until 10) println(i)

for (item <- items) process(item)

for ((item, i) <- items.zipWithIndex) println(s"$i: $item")
While loops
python
# Python
while condition:
    do_something()
scala
// Scala
while (condition) {
  doSomething()
}

Comprehensions

python
# Python list comprehension
squares = [x ** 2 for x in range(10)]
evens = [x for x in numbers if x % 2 == 0]
pairs = [(x, y) for x in xs for y in ys]
scala
// Scala for-comprehensions or map/filter
val squares = (0 until 10).map(x => x * x).toList
val evens = numbers.filter(_ % 2 == 0)
val pairs = for { x <- xs; y <- ys } yield (x, y)

Functions

python
# Python
def add(a: int, b: int) -> int:
    return a + b

# Lambda
square = lambda x: x ** 2

# Default arguments
def greet(name: str, greeting: str = "Hello") -> str:
    return f"{greeting}, {name}!"
scala
// Scala
def add(a: Int, b: Int): Int = a + b

// Lambda
val square: Int => Int = x => x * x
// or shorter: val square = (x: Int) => x * x

// Default arguments
def greet(name: String, greeting: String = "Hello"): String =
  s"$greeting, $name!"

String Formatting

PythonScala
f"Hello, {name}!"s"Hello, $name!"
f"Value: {x:.2f}"f"Value: $x%.2f"
f"{x + y}"s"${x + y}"

Common Operators

PythonScala
** (power)math.pow(x, y) or use scala.math.pow
// (floor div)x / y (for Int) or math.floor(x / y)
% (modulo)%
and, or, not&&, `
in.contains()
iseq (reference equality)
==== (value equality)

Exception Handling

python
# Python
try:
    result = risky_operation()
except ValueError as e:
    handle_error(e)
finally:
    cleanup()
scala
// Scala
import scala.util.{Try, Success, Failure}

// Pattern 1: try-catch
try {
  val result = riskyOperation()
} catch {
  case e: IllegalArgumentException => handleError(e)
} finally {
  cleanup()
}

// Pattern 2: Try monad (preferred for functional style)
val result = Try(riskyOperation()) match {
  case Success(value) => value
  case Failure(e) => handleError(e)
}

None/Null Handling

python
# Python
if value is None:
    return default
return process(value)

# Or
result = value if value is not None else default
scala
// Scala - use Option
val result = optionValue match {
  case Some(v) => process(v)
  case None => default
}

// Or more concisely
val result = optionValue.map(process).getOrElse(default)

© 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-syntax-mapping of benchflow-ai/skillsbench.

Open the folder on GitHubat commit 9a1f4dd

Compare with similar skills

Python Scala Syntax Mapping 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 Syntax Mapping compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Python Scala Syntax Mapping this skillbenchflow-ai/skillsbench1.8k—~1kAutomated safety check: PassApache-2.0
China Travel Kittczyliu/china-travel-kit194—~1.3kAutomated safety check: PassMIT
Technology Searchfreestylefly/wesight943—~3.3kAutomated safety check: PassMIT
Translate Popython/python-docs-zh-tw284—~793Automated safety check: PassCustom licence
Obs Build LogsNuitka/Nuitka15k—~849Automated safety check: PassAGPL-3.0
Update Gui TranslationsArduPilot/MethodicConfigurator163—~1.5kAutomated safety check: PassGPL-3.0

Similar skills

  • China Travel Kit

    tczyliu/china-travel-kit

    Research and plan first-time independent trips in China with bilingual, source-aware city data and official live-check entry points.

    194 GitHub stars~1.3k tokensUpdated 1 mo ago
    Writing & ContentAuto-check passed
  • Technology Search

    freestylefly/wesight

    Search tech blogs, developer forums, and IT media (TechCrunch, Hacker News, 36氪, etc.) for software and hardware industry updates with heat ranking and EN↔CN translation.

    943 GitHub stars~3.3k tokensUpdated 6 days ago
    Writing & ContentAuto-check passed
  • Translate Po

    python/python-docs-zh-tw

    Official

    Translates PO file entries from English to Traditional Chinese (zhTW) following project conventions.

    284 GitHub stars~793 tokensUpdated 2 days ago
    Writing & ContentAuto-check passed
  • Obs Build Logs

    Nuitka/Nuitka

    Access and diagnose openSUSE Build Service (OBS) package build logs.

    15k GitHub stars~849 tokensUpdated today
    Writing & ContentAuto-check passed
  • Update Gui Translations

    ArduPilot/MethodicConfigurator

    Update existing GUI translations using AI assistance. An agent skill from ArduPilot/MethodicConfigurator.

    163 GitHub stars~1.5k tokensUpdated today
    Writing & ContentAuto-check passed
  • Check Terminology

    python/python-docs-zh-tw

    Official

    Checks terminology consistency against project glossary and identifies zhCN terms that need conversion to zhTW.

    284 GitHub stars~705 tokensUpdated 2 days ago
    Writing & ContentAuto-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 Syntax Mapping

What does Python Scala Syntax Mapping do?

Reference guide for translating Python syntax constructs to Scala equivalents. Python Scala Syntax Mapping is an agent skill from benchflow-ai/skillsbench. Reference guide for translating Python syntax constructs to Scala equivalents.

When should I use Python Scala Syntax Mapping?

Python Scala Syntax Mapping fits situations like: converting Python code to Scala and need mappings for basic syntax elements like variable declarations; string formatting; common operators.

How do I install Python Scala Syntax Mapping in Claude Code?

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

How do I install Python Scala Syntax Mapping in Codex?

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

Can I use Python Scala Syntax Mapping 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-syntax-mapping -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-syntax-mapping, .gemini/skills/python-scala-syntax-mapping, .github/skills/python-scala-syntax-mapping and .opencode/skills/python-scala-syntax-mapping in your project.

What does Python Scala Syntax Mapping need to run?

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

Does Python Scala Syntax Mapping 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 Syntax Mapping 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 Syntax Mapping use?

Python Scala Syntax Mapping 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 Syntax Mapping use?

About 1k tokens (SKILL.md is roughly 4.1k 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 Syntax Mapping?

Skills that share tags, products or a category with Python Scala Syntax Mapping: China Travel Kit (tczyliu/china-travel-kit, 194 stars), Technology Search (freestylefly/wesight, 943 stars), Translate Po (python/python-docs-zh-tw, 284 stars) and Obs Build Logs (Nuitka/Nuitka, 15k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Python Scala Syntax Mapping?

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.