Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Scala Pro

ASecurity

Idiomatic Scala: functional-OO blend, case classes, pattern matching, effect systems, and build tooling. Use when writing, reviewing, or structuring Scala applications.

2 stars
0 votes
0 copies
0 views
Added 9/29/2026
ai-agentsgojavaexpressdebuggingapiperformance

Works with

api

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add aicodedecode/awesome-muse-skills --skill scala-pro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Scala Pro?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Scala Pro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aicodedecode-scala-pro/badge)](https://www.skillsdirectory.com/skills/aicodedecode-scala-pro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: scala-pro
description: Idiomatic Scala: functional-OO blend, case classes, pattern matching, effect systems, and build tooling. Use when writing, reviewing, or structuring Scala applications.
category: development
---

# Scala Pro

## Overview

Scala's strength — **a principled blend of functional and object-oriented programming on the JVM** —
is also its risk: the language lets you write Java-with-sugar, Haskell-on-the-JVM, or anything in
between. Professional Scala means picking a coherent style for the codebase (and sticking to it):
immutable data with case classes, `Option`/`Either` instead of nulls/exceptions for expected cases,
for-comprehensions for sequencing, and an effect story the team understands.

The through-line: expressive types, immutable data, explicit effects — and consistency across the codebase.

## When to use

- Writing or reviewing Scala for idiom (Scala 2.13 or 3).
- Modeling domains with case classes, ADTs, and pattern matching.
- Choosing effect management (Future, cats-effect, ZIO).
- Structuring Scala projects (sbt, modules, layering).
- Debugging implicits/givens, type inference, or performance issues.

## Core concepts

- **Case classes + ADTs.** `case class` for immutable data (structural equality, pattern matching,
  `copy` for updates); `sealed trait` hierarchies for variants with exhaustive matching. This pair
  models most domains better than any framework.
- **Option/Either/Try over nulls and exceptions.** `Option` for absence, `Either[E, A]` for
  failures as values, exceptions only for the truly exceptional. For-comprehensions sequence these
  cleanly — learn to read and write them fluently.
- **Immutability by default.** `val` not `var`; immutable collections (`List`, `Vector`, `Map`);
  transformations return new values. `var` is occasionally pragmatic (local accumulators, perf
  hotspots) — never shared mutable state.
- **Effects, one story.** `Future` for simple async interop (mind the ExecutionContext); cats-effect
  `IO` or ZIO for principled effect management with resource safety (`Resource`/`ZManaged` for
  acquire-release). Don't mix raw Futures and IO in the same codebase without a clear boundary.
- **Implicits (Scala 2) / givens (Scala 3):** powerful, dangerous. Use for typeclass instances and
  DI-ish context passing; avoid implicit conversions (Scala 3 wisely makes them explicit). When a
  newcomer can't find where a value comes from, you've overused them.
- **Pattern matching as control flow.** Destructure in matches, extract with custom extractors
  sparingly, and let exhaustiveness checking (`-Xfatal-warnings` + sealed traits) catch missing cases.

## Practical workflow

1. **Scaffold:** sbt project, Scala 3 (or 2.13 for legacy ecosystems), scalafmt enforced in CI,
   `-Xfatal-warnings` with `-Wunused` to keep the codebase honest.
2. **Model the domain.** Sealed traits + case classes; smart constructors (`object` factories
   validating input) where invariants matter; no nulls crossing boundaries.
3. **Choose the effect story early.** Team decision, documented: plain Futures, cats-effect IO, or
   ZIO. Consistency beats optimality — a mixed codebase pays both ecosystems' complexity costs.
4. **Structure in layers.** Domain (pure, no effects) → services (effectful orchestration) →
   interpreters/adapters (DB, HTTP, messaging). The domain stays testable without mocks.
5. **Test behaviorally.** ScalaTest or munit for unit tests, property-based (ScalaCheck) for
   invariants, and integration tests with real dependencies (testcontainers) at the adapter layer.
6. **Watch compile times and binary weight.** Scala compiles slowly — modularize (sbt subprojects),
   avoid implicit-heavy megatraits, and profile before blaming the language.

Idiomatic snippets:

```scala
// ADT + exhaustive matching
sealed trait OrderStatus
object OrderStatus:
  case object Pending extends OrderStatus
  case object Paid extends OrderStatus
  case object Shipped extends OrderStatus
  case object Cancelled extends OrderStatus

def canCancel(s: OrderStatus): Boolean = s match
  case OrderStatus.Pending | OrderStatus.Paid => true
  case OrderStatus.Shipped | OrderStatus.Cancelled => false

// For-comprehension sequencing Either
def placeOrder(cmd: PlaceCmd): Either[OrderError, Order] =
  for
    cart  <- validateCart(cmd.cart)
    priced <- priceCart(cart)
    order <- persist(priced)
  yield order
```

## Common pitfalls

- **Style schizophrenia.** Half the codebase in Java-style mutable OO, half in Haskell-style
  point-free. Agree on the team's Scala dialect (document it) and review for consistency.
- **Exceptions for expected failures.** Throwing for validation errors or "not found" in normal
  flow. `Either`/`Option` for expected cases; exceptions for programmer errors and truly
  exceptional infrastructure failures.
- **`null` leaking in.** From Java interop or careless code — wrap Java APIs at the boundary
  (`Option(x)`), never let null flow through Scala code.
- **Implicit/given soup.** Instances and conversions that make code magical and undebuggable.
  Explicit is better than implicit when the reader can't trace the source.
- **Blocking in Futures.** Calling blocking I/O inside the default ExecutionContext starves it.
  Dedicated (blocking) context for blocking calls, or an effect system that manages shifting.
- **Over-abstracted typelevel gymnastics.** Shapeless/HList wizardry and 5-parameter typeclasses
  for business CRUD. The type system serves the domain — when the types are harder than the
  problem, simplify.
- **Ignoring compile-time cost.** Massive implicit resolution and macro expansion making builds
  take 20 minutes. Modularize, reduce implicit scope, and treat build time as a team tax.

Attribution

aicodedecodeaicodedecode
View sourceSee grades on GitHubMore from aicodedecode →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →