
Golang Samber Ro
Write type-safe samber/ro observable pipelines in Go instead of misusing untyped Pipe or slice ops on streams.
Overview
golang-samber-ro is an agent skill for the Build phase that teaches type-safe samber/ro observable pipelines and when to use samber/lo instead.
Install
npx skills add https://github.com/samber/cc-skills-golang --skill golang-samber-roWhat is this skill?
- Steers compile-time typed ro.Pipe2/Pipe3 chains over untyped ro.Pipe for int→string transforms
- Documents when to use samber/lo on finite []T slices versus ro for observable pipelines
- Requires ro.NewObserver with onNext, onError, and onComplete for Interval-style subscriptions
- Eval-driven assertions for Filter, Map, and Take generic parameters on ro pipelines
- 3 bundled eval scenarios covering typed pipes, lo-vs-ro, and observer callbacks
Adoption & trust: 3.4k installs on skills.sh; 2k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent chains Go stream operators with untyped Pipe, wrong generic Take types, or uses ro where a simple lo slice pipeline would be clearer and cheaper.
Who is it for?
Indie Go backend devs adding reactive timers, event streams, or multi-operator ro chains beside existing samber/lo slice utilities.
Skip if: Teams not using Go, greenfield projects with no reactive or iterator-heavy data paths, or front-end-only stacks without a Go service layer.
When should I use this skill?
Implementing or reviewing Go code that imports github.com/samber/ro or when the user asks about observable pipelines versus slice helpers.
What do I get? / Deliverables
You get idiomatic typed ro pipelines, correct lo-vs-ro choice for finite slices, and observers that handle errors and completion before you merge the code.
- Typed ro pipeline snippets
- Observer subscription blocks with full callbacks
- Recommendation to use lo for finite slice transforms
Recommended Skills
Journey fit
How it compares
Skill package for samber/ro API patterns—not a generic Rx tutorial or an MCP server wrapping observability tools.
Common Questions / FAQ
Who is golang-samber-ro for?
Solo builders and small teams writing Go backends who already use or evaluate github.com/samber/ro and want agents to match Samber ecosystem conventions.
When should I use golang-samber-ro?
Use it in the Build phase when implementing backend streams—chaining Filter/Map/Take on observables, subscribing to Interval ticks, or deciding lo versus ro on []User-style slices.
Is golang-samber-ro safe to install?
It is documentation-style procedural knowledge; review the Security Audits panel on this Prism page before trusting any third-party skill repo in your agent environment.
SKILL.md
READMESKILL.md - Golang Samber Ro
{ "skill_name": "golang-samber-ro", "evals": [ { "id": 1, "name": "typed-pipe-vs-untyped", "prompt": "I need to chain 3 operators in samber/ro: filter integers, map to strings, then take the first 5. Write the pipeline code.", "assertions": [ "Uses ro.Pipe3 (or Pipe2 with nested) instead of untyped ro.Pipe for compile-time type safety", "Uses ro.Filter with a func(int) bool predicate", "Uses ro.Map with a func(int) string transform", "Uses ro.Take[string](5) with correct generic type parameter" ] }, { "id": 2, "name": "lo-vs-ro-boundary", "prompt": "I have a []User slice with 500 users. I want to filter active users and extract their email addresses into a []string. Should I use samber/ro for this? Write the code.", "assertions": [ "Recommends samber/lo instead of samber/ro for this finite slice operation", "Explains WHY lo is better here: synchronous, no stream overhead, purpose-built for slices", "Does NOT create an Observable pipeline for a simple slice transform", "Uses lo.Filter and lo.Map (or equivalent lo functions)" ] }, { "id": 3, "name": "observer-error-handling", "prompt": "Subscribe to this observable and print each value: observable := ro.Interval(time.Second). Write the subscription code.", "assertions": [ "Uses ro.NewObserver with all 3 callbacks (onNext, onError, onComplete), not just ro.OnNext", "Includes an error handler that logs or handles the error", "Includes a completion handler", "Mentions the risk of using OnNext alone (silent error dropping)" ] }, { "id": 4, "name": "infinite-stream-shutdown", "prompt": "I have an infinite ro.Interval observable processing events. How do I gracefully shut it down when the application receives SIGTERM?", "assertions": [ "Uses ro.TakeUntil with a signal observable OR context cancellation with ThrowOnContextCancel", "Mentions the signal plugin (plugins/signal) or os/signal for SIGTERM handling", "Calls .Wait() on the subscription to block until shutdown completes", "Does NOT suggest manual channel closing or goroutine killing as the primary approach", "Mentions Unsubscribe() as an alternative cleanup mechanism" ] }, { "id": 5, "name": "subject-type-selection-config", "prompt": "I need a reactive configuration store. When a new subscriber connects, it should immediately receive the current config value, and all subscribers should get updates when config changes. Which samber/ro Subject should I use?", "assertions": [ "Recommends BehaviorSubject (not PublishSubject or ReplaySubject)", "Explains that BehaviorSubject replays the last value to new subscribers", "Shows NewBehaviorSubject[Config](initialConfig) constructor with initial value", "Shows .Send() for pushing updates and .Subscribe() for consuming", "Does NOT recommend PublishSubject (late subscribers would miss the current value)" ] }, { "id": 6, "name": "subject-type-selection-chat", "prompt": "I'm building a chat room. New users joining should see the last 50 messages, and all users should receive new messages in real-time. Which samber/ro Subject type?", "assertions": [ "Recommends ReplaySubject with buffer size 50", "Shows NewReplaySubject[Message](50) constructor", "Explains that ReplaySubject buffers N past values for late subscribers", "Does NOT recommend BehaviorSubject (only replays 1 value, not 50)" ] }, { "id": 7, "name": "share-teardown-on-last-unsubscribe", "prompt": "I have a samber/ro pipeline using Share() to multicast a WebSocket observable to 3 subscribers: a dashboard, a metrics recorder, and an alerting system. The dashboard and metrics record