matdev83/golang-curated-agent-skills/golang-samber-ro
Claude Code and agent skill by matdev83/golang-curated-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Use samber/ro v0.4 for asynchronous observable streams, subjects, operators, subscriptions, cancellation, retry, and error recovery.
Install
npx vskill@latest install matdev83/golang-curated-agent-skills/golang-samber-roSKILL.md
The same SKILL.md was published earlier as matdev83/golang-curated-agent-skills/golang-samber-ro.
samber/ro
The module path is github.com/samber/ro and the current v0.4 API is pre-1.0. Verify all operators against the pinned release. Use a normal slice/loop or samber/lo for finite synchronous transforms; ro adds asynchronous subscription and lifecycle machinery.
Observable and subscription
Creation functions include Of/Just, FromSlice, FromChannel, Interval, Timer, Future, Empty, Never, Throw, and Defer. Operators are functions from Observable[A] to Observable[B]. Pipe1 through Pipe5 are type-safe; the variadic Pipe uses reflection and validates operator shape at runtime, so prefer typed PipeN functions when the chain is known.
Subscribe returns one Subscription. Observable also supports SubscribeWithContext, and Collect/CollectWithContext gather a finite stream. A subscription owns teardown; call Unsubscribe when the consumer no longer needs a stream. Wait exists but can block and is not a replacement for context cancellation.
~go source := ro.Of(1, 2, 3) stream := ro.Pipe2( source, ro.Map(func(v int) string { return strconv.Itoa(v) }), ro.Filter(func(v string) bool { return v != "" }), ) sub := stream.Subscribe(ro.NewObserver( func(v string) { fmt.Println(v) }, func(err error) { fmt.Println("error:", err) }, func() { fmt.Println("complete") }, )) defer sub.Unsubscribe() ~
Use NewObservableWithContext when a producer must observe subscriber cancellation. Return a Teardown that closes owned resources. Do not start unbounded work without a teardown and a bounded upstream context.
Subjects and sharing
NewPublishSubject broadcasts only to current subscribers. NewBehaviorSubject sends the current value to a new subscriber. NewReplaySubject(bufferSize) replays recent values. NewAsyncSubject emits the last value on completion, and NewUnicastSubject buffers for one subscriber according to its contract. Subject methods include Next, Error, Complete, Subscribe, and context-aware subscription; inspect the interface for exact signatures.
Connectable observables use Connect() Subscription in v0.4; ConnectWithContext accepts a context. Share starts when subscribed and ShareReplay stores a bounded replay history. Do not assume late subscribers receive values unless the chosen subject/operator explicitly provides replay.
Errors, retry, and backpressure
Errors are terminal notifications. Catch maps an error to a replacement Observable. OnErrorReturn emits a fallback item, and OnErrorResumeNextWith switches sequences. Retry() retries forever; use RetryWithConfig with MaxRetries, Delay, and ResetOnSuccess when a bounded policy is required, and ensure delay is cancellation-aware.
Schedulers/operators can introduce goroutines and buffering. Bound buffers, rate, retries, and source lifetime. Do not use stream retry for non-idempotent side effects or treat it as a substitute for a queue. Test completion, error, unsubscribe, context cancellation, teardown, and slow consumers.
This skill documents core APIs only. Do not assume an ecosystem of plugins or import paths that are absent from the pinned module.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/golang-samber-ro/SKILL.md
Popularity
- Repository stars
- 2
- 7-day trend score
- 0
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
[](https://verified-skill.com/skills/matdev83/golang-curated-agent-skills/golang-samber-ro)