moai-lang-scala

0
0
Source

Scala 3.4+ development specialist covering Akka, Cats Effect, ZIO, and Spark patterns. Use when building distributed systems, big data pipelines, or functional programming applications.

Install

mkdir -p .claude/skills/moai-lang-scala && curl -L -o skill.zip "https://mcp.directory/api/skills/download/5626" && unzip -o skill.zip -d .claude/skills/moai-lang-scala && rm skill.zip

Installs to .claude/skills/moai-lang-scala

About this skill

Scala 3.4+ Development Specialist

Functional programming, effect systems, and big data processing for JVM applications.

Quick Reference

Auto-Triggers: Scala files (.scala, .sc), build files (build.sbt, project/build.properties)

Core Capabilities:

  • Scala 3.4: Given/using, extension methods, enums, opaque types, match types
  • Akka 2.9: Typed actors, streams, clustering, persistence
  • Cats Effect 3.5: Pure FP runtime, fibers, concurrent structures
  • ZIO 2.1: Effect system, layers, streaming, error handling
  • Apache Spark 3.5: DataFrame API, SQL, structured streaming

Key Ecosystem Libraries:

  • HTTP: Http4s 0.24, Tapir 1.10
  • JSON: Circe 0.15, ZIO JSON 0.6
  • Database: Doobie 1.0, Slick 3.5, Quill 4.8
  • Streaming: FS2 3.10, ZIO Streams 2.1
  • Testing: ScalaTest, Specs2, MUnit, Weaver

Module Index

This skill uses progressive disclosure with specialized modules:

Core Language

Effect Systems

  • cats-effect.md - Cats Effect 3.5: IO monad, Resources, Fibers, FS2 Streaming
  • zio-patterns.md - ZIO 2.1: Effects, Layers, ZIO Streams, Error handling

Frameworks

  • akka-actors.md - Akka Typed Actors 2.9: Actors, Streams, Clustering patterns
  • spark-data.md - Apache Spark 3.5: DataFrame API, SQL, Structured Streaming

Implementation Guide

Project Setup (SBT 1.10)

In build.sbt, set ThisBuild / scalaVersion to "3.4.2" and organization. Define lazy val root project with settings including name and libraryDependencies. Add dependencies for cats-effect, zio, akka-actor-typed, http4s-ember-server, circe-generic, and scalatest for test scope. Include scalacOptions for deprecation, feature warnings, and Xfatal-warnings.

Quick Examples

Extension Methods: Use extension keyword with parameter in parentheses. Define methods like words splitting on whitespace and truncate checking length before taking characters and appending ellipsis.

Given and Using: Define trait with abstract method signature. Create given instance with with keyword and implement the method. Create functions with using parameter clause for implicit resolution.

Enum Types: Define enum with generic type parameters and plus variance annotations. Create case entries with parameters. Define methods on enum using match expression to handle each case, returning appropriate results.


Context7 Integration

Library mappings for latest documentation:

Core Scala:

  • /scala/scala3 - Scala 3.4 language reference
  • /scala/scala-library - Standard library

Effect Systems:

  • /typelevel/cats-effect - Cats Effect 3.5 documentation
  • /typelevel/cats - Cats 2.10 functional abstractions
  • /zio/zio - ZIO 2.1 documentation
  • /zio/zio-streams - ZIO Streams 2.1

Akka Ecosystem:

  • /akka/akka - Akka 2.9 typed actors and streams
  • /akka/akka-http - Akka HTTP REST APIs
  • /akka/alpakka - Akka connectors

HTTP and Web:

  • /http4s/http4s - Functional HTTP server/client
  • /softwaremill/tapir - API-first design

Big Data:

  • /apache/spark - Spark 3.5 DataFrame and SQL
  • /apache/flink - Flink 1.19 streaming
  • /apache/kafka - Kafka clients 3.7

Testing Quick Reference

ScalaTest: Extend AnyFlatSpec with Matchers. Use string description with should in for behavior. Make assertions with shouldBe for equality checks.

MUnit with Cats Effect: Extend CatsEffectSuite. Define test with string name. Return IO containing assertEquals assertions.

ZIO Test: Extend ZIOSpecDefault. Define spec as suite with test entries. Use for-comprehension to run effects and yield assertTrue assertions.


Troubleshooting

Common Issues:

  • Implicit resolution: Use scalac -explain for detailed error messages
  • Type inference: Add explicit type annotations when inference fails
  • SBT slow compilation: Enable Global / concurrentRestrictions in build.sbt

Effect System Issues:

  • Cats Effect: Check for missing import cats.effect._ or import cats.syntax.all._
  • ZIO: Verify layer composition with ZIO.serviceWith and ZIO.serviceWithZIO
  • Akka: Review actor hierarchy and supervision strategies

Works Well With

  • moai-lang-java - JVM interoperability, Spring Boot integration
  • moai-domain-backend - REST API, GraphQL, microservices patterns
  • moai-domain-database - Doobie, Slick, database patterns
  • moai-workflow-testing - ScalaTest, MUnit, property-based testing

Additional Resources

For comprehensive reference materials:

  • reference.md - Complete Scala 3.4 coverage, Context7 mappings, performance
  • examples.md - Production-ready code: Http4s, Akka, Spark patterns

Last Updated: 2026-01-11 Status: Production Ready (v2.1.0)

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

643969

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

591705

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

318399

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

340397

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

452339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.