nw-fp-scala
Scala 3 language-specific patterns with ZIO, Cats Effect, and opaque types
Install / Use
npx skills add nWave-ai/nWave --skill nw-fp-scalaInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of nw-fp-scala
nw-fp-scala scores 87/100 on our quality scale, 2227th of 4,702 Development & Engineering skills we index (top 48%).
Its SKILL.md is 6.5 KB long, well organised into 21 sections with 10 code examples: a thorough specification that gives an agent plenty to work with.
It has 617 GitHub stars, a meaningful sign that others use it.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so nw-fp-scala is actively maintained.
- Our last check on 2026-10-11 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-10-08. Automated pattern scan on 2026-10-08. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
nw-fp-scala compared with similar skills
All 4 of these similar skills score higher than nw-fp-scala; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| nw-fp-scala (this skill)by nWave-ai | 87 | 617 | 2mo ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 117.6k | 9d ago | CLAUDE.md |
| ai-job-searchby ai-job-search-dev | 100 | 72.3k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 47.4k | 3d ago | CLAUDE.md |
| lobehubby lobehub | 100 | 85.7k | today | MCP Server |
Frequently asked questions
- How do I install nw-fp-scala?
- Run
npx skills add nWave-ai/nWave --skill nw-fp-scala. The install tabs above show the steps for each supported agent. - Which AI agents does nw-fp-scala work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is nw-fp-scala safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is nw-fp-scala still maintained?
- The repository was last updated about 2 months ago, so nw-fp-scala is actively maintained.
Skill content
View source on GitHubname: nw-fp-scala agent: nw-functional-software-crafter description: Scala 3 language-specific patterns with ZIO, Cats Effect, and opaque types user-invocable: false disable-model-invocation: true
FP in Scala 3 -- Functional Software Crafter Skill
Cross-references: fp-principles | fp-domain-modeling | property-based-testing
When to Choose Scala
- Best for: JVM with full FP power | large-scale systems | data engineering | richest effect ecosystem
- Not ideal for: small teams wanting simplicity | Android (use Kotlin) | teams allergic to OO/FP duality
[STARTER] Quick Setup
cs install scala3-compiler scala3-repl sbt
sbt new scala/scala3.g8 && cd order-service
# Add zio, zio-test, scalacheck to build.sbt
sbt compile && sbt test
[STARTER] Type System for Domain Modeling
Choice Types and Record Types
enum PaymentMethod:
case CreditCard(cardNumber: String, expiryDate: String)
case BankTransfer(accountNumber: String)
case Cash
case class Customer(
customerId: CustomerId,
customerName: CustomerName,
customerEmail: EmailAddress
)
Case classes provide structural equality, copy, and pattern matching for free.
[STARTER] Domain Wrappers (Opaque Types) -- Zero Cost
object OrderDomain:
opaque type OrderId = Int
object OrderId:
def apply(value: Int): OrderId = value
extension (id: OrderId) def value: Int = id
opaque type EmailAddress = String
object EmailAddress:
def from(raw: String): Either[ValidationError, EmailAddress] =
if raw.contains("@") then Right(raw)
else Left(InvalidEmail(raw))
Inside defining scope, alias is transparent. Outside, only exported operations available.
[INTERMEDIATE] Composition Style
For-Comprehensions (Monadic Chaining)
def placeOrder(raw: RawOrder): Either[OrderError, Confirmation] =
for
validated <- validateOrder(raw)
priced <- priceOrder(validated)
confirmed <- confirmOrder(priced)
yield confirmed
Error Accumulation (Cats Validated or ZIO)
import cats.data.Validated
import cats.syntax.all.*
def validateCustomer(raw: RawCustomer): ValidatedNel[ValidationError, Customer] =
(validateName(raw.name), validateEmail(raw.email), validateAddress(raw.address))
.mapN(Customer.apply)
[ADVANCED] Effect Management
ZIO vs Cats Effect
ZIO: ZIO[R, E, A] with built-in typed errors, DI (ZLayer), batteries-included. Cats Effect: IO[A], minimal type-class-based, Typelevel ecosystem (http4s, FS2, Doobie). Pick one and stay consistent.
ZIO Hexagonal Architecture
trait OrderRepository:
def findOrder(id: OrderId): Task[Option[Order]]
def saveOrder(order: Order): Task[Unit]
def placeOrder(raw: RawOrder): ZIO[OrderRepository & PricingService, OrderError, Confirmation] =
for
repo <- ZIO.service[OrderRepository]
validated <- ZIO.fromEither(validateOrder(raw))
priced <- ZIO.fromEither(priceOrder(validated))
_ <- repo.saveOrder(priced)
yield Confirmation(priced.orderId)
// Adapter
class PostgresOrderRepository(ds: DataSource) extends OrderRepository:
def findOrder(id: OrderId): Task[Option[Order]] = ZIO.attemptBlocking { /* query */ }
def saveOrder(order: Order): Task[Unit] = ZIO.attemptBlocking { /* insert */ }
val appLayer: ZLayer[Any, Nothing, OrderRepository & PricingService] =
PostgresOrderRepository.layer ++ PricingServiceLive.layer
Cats Effect / Tagless Final
trait OrderRepository[F[_]]:
def findOrder(id: OrderId): F[Option[Order]]
def placeOrder[F[_]: Monad](repo: OrderRepository[F])(raw: RawOrder): F[Either[OrderError, Confirmation]] =
for
validated <- Monad[F].pure(validateOrder(raw))
result <- validated match
case Left(err) => Monad[F].pure(Left(err))
case Right(v) => repo.findOrder(v.orderId).map(_.toRight(OrderNotFound))
yield result
[INTERMEDIATE] Testing
Frameworks: ScalaCheck (PBT) | ZIO Test (integrated PBT + unit) | ScalaTest (BDD) | MUnit (lightweight). See property-based-testing for detailed PBT patterns.
Property Test (ScalaCheck)
import org.scalacheck.Properties
import org.scalacheck.Prop.forAll
object OrderSpec extends Properties("Order"):
property("serialization round-trips") = forAll { (order: Order) =>
deserialize(serialize(order)) == Right(order)
}
property("validated orders have positive totals") = forAll { (raw: RawOrder) =>
validateOrder(raw) match
case Left(_) => true
case Right(valid) => valid.total.value > 0
}
[ADVANCED] Idiomatic Patterns
Enum-Based State Machines
enum OrderState:
case Unvalidated(raw: RawOrder)
case Validated(order: ValidatedOrder)
case Priced(order: PricedOrder)
case Confirmed(confirmation: Confirmation)
def transition(state: OrderState, command: OrderCommand): Either[OrderError, OrderState] =
(state, command) match
case (OrderState.Unvalidated(raw), OrderCommand.Validate) =>
validateOrder(raw).map(OrderState.Validated(_))
case (OrderState.Validated(order), OrderCommand.Price) =>
priceOrder(order).map(OrderState.Priced(_))
case _ => Left(InvalidTransition(state, command))
Extension Methods for Domain Operations
extension (order: PricedOrder)
def totalWithTax(taxRate: BigDecimal): Money = Money(order.total.value * (1 + taxRate))
def isHighValue: Boolean = order.total.value > 1000
Maturity and Adoption
- Ecosystem fragmentation: ZIO vs Cats Effect creates split ecosystem. Libraries often target one or the other. Mixing is painful.
- Slow compilation: Scala 3 faster than 2 but still significantly slower than Kotlin or Java. Keep modules small; consider Mill over sbt.
- Complexity reputation: Scala's power (implicits, type-level programming, macros) creates wildly varying codebases. Establish team conventions early.
- Migration burden: Scala 2 to 3 migration non-trivial. Ecosystem has mostly caught up by 2025-2026.
Common Pitfalls
- Ecosystem fragmentation: Pick one effect ecosystem (ZIO or Cats) and stay consistent. Mixing creates dependency conflicts.
- Implicit/given complexity: Keep
giveninstances close to their types. Deep resolution chains produce cryptic errors. - OO/FP tension: Prefer case classes + enums + pure functions over class hierarchies with mutable state.
- Slow compilation: Use sbt incremental compilation, keep modules small, consider Mill for faster builds.
Related Skills
taste-skill
117.6kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
ai-job-search
72.3kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
47.4kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
lobehub
85.7k🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
