plurigrid/asi/cats-focus-monad

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Cats Focus + Monad: Lawful composition for effect management

Install

npx vskill@latest install plurigrid/asi/cats-focus-monad

SKILL.md

Cats Focus + Monad

flatMap that shit

Core Laws

scala
// Monad Laws
pure(a).flatMap(f) === f(a) // Left identity
fa.flatMap(pure) === fa // Right identity
fa.flatMap(f).flatMap(g) === fa.flatMap(a => f(a).flatMap(g)) // Associativity

Focus (Monocle Optics)

scala
import monocle.Focus
import monocle.syntax.all._
case class State(entropy: Long, archive: List[HyDefn])
// Lens into nested structure
val entropyLens = Focus[State](_.entropy)
val archiveLens = Focus[State](_.archive)
// Compose
state.focus(_.archive).modify(_ :+ newDefn)

Monad Composition Pattern

scala
import cats.Monad
import cats.syntax.all._
def godelStep[F[_]: Monad](state: State): F[State] =
for {
entropy <- nextEntropy[F](state.entropy)
hydefn <- generateHyDefn[F](entropy)
proven <- attemptProof[F](hydefn)
newState <- if (proven)
Monad[F].pure(state.focus(_.archive).modify(_ :+ hydefn))
else
Monad[F].pure(state)
} yield newState

GF(3) Trit

cats-focus-monad (0) ⊕ cats-effect (+1) ⊕ validation (-1) = 0 ✓

Commands

bash
# Add to build.sbt
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % "2.13.0",
"dev.optics" %% "monocle-core" % "3.3.0",
"dev.optics" %% "monocle-macro" % "3.3.0"
)

Autopoietic Marginalia

The interaction IS the skill improving itself.

Every use of this skill is an opportunity for worlding:

  • MEMORY (-1): Record what was learned
  • REMEMBERING (0): Connect patterns to other skills
  • WORLDING (+1): Evolve the skill based on use

Add Interaction Exemplars here as the skill is used.

CT lattice atlas

Part of: para-mensch-commons (CT lattice family).

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
67
Repository forks
12
7-day trend score
26

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/plurigrid/asi/cats-focus-monad/badge)](https://verified-skill.com/skills/plurigrid/asi/cats-focus-monad)

Something wrong with this skill or its page? Tell us.