Go Concurrency
inference-gateway/inference-gateway
Idiomatic Go concurrency - sync primitives, channel semantics, the select statement, and the standard channel patterns (cancellation/done-channel, fan-out/fan-in, pipeline, or-done, context…
Covers handling Go's context.Context idiomatically in fp-go code: reading and scoping context through operators, timeouts, cancellation and converting ctx-first functions.
$ npx skills add IBM/fp-go --skill fp-go-context -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install IBM/fp-go fp-go-context --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/IBM/fp-go.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/fp-go-context .claude/skills/fp-go-context && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "fp-go-context" agent skill from https://github.com/IBM/fp-go/tree/main/skills/fp-go-context into .claude/skills/fp-go-context/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fp-go-context", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/IBM/fp-go/tree/main/skills/fp-go-contextType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add IBM/fp-go --skill fp-go-context -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install IBM/fp-go fp-go-context --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/IBM/fp-go.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/fp-go-context .agents/skills/fp-go-context && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "fp-go-context" agent skill from https://github.com/IBM/fp-go/tree/main/skills/fp-go-context into .agents/skills/fp-go-context/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fp-go-context", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add IBM/fp-go --skill fp-go-context -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install IBM/fp-go fp-go-context --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/IBM/fp-go.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/fp-go-context .cursor/skills/fp-go-context && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "fp-go-context" agent skill from https://github.com/IBM/fp-go/tree/main/skills/fp-go-context into .cursor/skills/fp-go-context/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fp-go-context", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/IBM/fp-go.git --path skills/fp-go-context--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add IBM/fp-go --skill fp-go-context -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install IBM/fp-go fp-go-context --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/IBM/fp-go.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/fp-go-context .gemini/skills/fp-go-context && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "fp-go-context" agent skill from https://github.com/IBM/fp-go/tree/main/skills/fp-go-context into .gemini/skills/fp-go-context/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fp-go-context", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install IBM/fp-go fp-go-contextInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add IBM/fp-go --skill fp-go-context -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/IBM/fp-go.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/fp-go-context .github/skills/fp-go-context && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "fp-go-context" agent skill from https://github.com/IBM/fp-go/tree/main/skills/fp-go-context into .github/skills/fp-go-context/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fp-go-context", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add IBM/fp-go --skill fp-go-context -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install IBM/fp-go fp-go-context --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/IBM/fp-go.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/fp-go-context .opencode/skills/fp-go-context && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "fp-go-context" agent skill from https://github.com/IBM/fp-go/tree/main/skills/fp-go-context into .opencode/skills/fp-go-context/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "fp-go-context", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
fp-go-contextCovers handling Go's context.Context idiomatically in fp-go code: reading and scoping context through operators, timeouts, cancellation and converting ctx-first functions.
In fp-go the context is the Reader environment rather than a parameter passed by hand. A computation describes what to do and runs only once a context is supplied, so pipelines never mention ctx, the context is supplied once at the edge (an HTTP handler, main or a test), and it is read with operators such as Ask and AskValue and scoped with WithValue, WithTimeout, WithDeadline or Local instead of context.With calls and defer cancel.
The skill also says only request-scoped data belongs in the context, while databases, clients and config go into the Effect type. A table compares the readerioresult, readerresult, readerio, statereaderioresult, idiomatic readerresult, reader and effect packages with when to use each; readerioresult is the default for services. Because fp-go signatures are easy to misremember, the agent should look unfamiliar combinators up through the fp-go MCP server, then run go build and go vet and fix errors before showing code.
10 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 4c9c328. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
goFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Context Handling in fp-go loads about 4.2k tokens when it runs. Until then it costs about 141 tokens; SKILL.md has 1,305 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from IBM/fp-go at commit 4c9c328, republished under its Apache-2.0 licence (© IBM). 1,305 words, ~4,224 tokens.
.claude/skills/fp-go-context/SKILL.md (or your agent's skills folder).In imperative Go the context is threaded by hand: every function takes ctx first, values are read with ctx.Value(k).(T), scopes are opened with ctx, cancel := context.WithTimeout(...); defer cancel().
In fp-go the context is the Reader environment. A computation is a description func(context.Context) … that runs only when a context is supplied. Therefore:
ctx. Build them from operators; the context flows implicitly.r.Context()), main, or a test (t.Context()).Ask, FromReader, AskValue), never with ctx.Value(k).(T).WithValue, WithTimeout, WithDeadline, Local), never with context.With* + defer cancel().Effect[Deps, A].fp-go is low-frequency in training data, so signatures are easy to misremember.
For any combinator not shown below, look it up via the fp-go MCP server's
search_examples / get_example tools (see the fp-go-mcp skill) instead of
guessing. After writing code, run go build ./... and go vet ./... and fix any
type-parameter or argument-order errors before presenting it.
| Package | Shape | Use when |
|---|---|---|
context/readerioresult (RIO) | func(ctx) func() Result[A] | default for services: IO + errors + context |
context/readerresult (RR) | func(ctx) Result[A] | synchronous, can fail |
context/readerio (RIOC) | func(ctx) func() A | IO that cannot fail |
context/statereaderioresult (SRIO) | func(S) func(ctx) func() Result[Pair[S, A]] | explicit state + context |
idiomatic/context/readerresult (IRR) | func(ctx) (A, error) | high-performance, native (A, error) |
context/reader (CR) | func(ctx) A | plain building blocks for use outside pipelines |
effect (EF) | func(C) RIO.ReaderIOResult[A] | typed deps C plus the runtime context |
| Operator | RIO | RR | RIOC | SRIO | IRR | CR |
|---|---|---|---|---|---|---|
Ask() | ✓ | ✓ | ✓ | ✓ | ||
FromReader(f) / Asks(f) | ✓ | ✓ | ✓ | Asks | ✓ | |
AskValue[V](key) | ✓ | ✓ | ✓ | ✓ ([S, V]) | ✓ | ✓ |
WithValue[A](key, v) | ✓ | ✓ | ✓ | ✓ ([S, A]) | ✓ | Kleisli form |
WithTimeout[A](d) / WithDeadline[A](t) | ✓ | ✓ | ✓ | ✓ ([S, A]) | ✓ | |
Local[A](f) | ✓ | ✓ | ✓ | ✓ | ✓ | |
LocalIOK / LocalIOResultK | ✓ / ✓ | ✓ / | ||||
WithContext / WithContextK | ✓ | ✓ | ✓ | |||
NopCancel(ctx) | ✓ |
Local's argument is func(ctx) Pair[context.CancelFunc, context.Context] in the standard packages and func(ctx) (context.Context, context.CancelFunc) in IRR.
// HTTP handler: the request context is supplied once
func handler(w http.ResponseWriter, r *http.Request) {
res := handleRequest(r)(r.Context())() // Result[Response] — ONE value
resp, err := R.Unwrap(res) // bridge back to (A, error)
// ...
}
// Tests: use t.Context(), cancelled automatically when the test ends
res := pipeline(t.Context())()Never capture a ctx in a closure and never store it in a struct; pass it only when running.
func(ctx, …) (T, error)Existing context-first Go functions are lifted, not wrapped by hand:
// func(context.Context, string) ([]byte, error) -> func(string) RIO.ReaderIOResult[[]byte]
fetch := RIO.Eitherize1(fetchBytes)
// idiomatic package: the shape is already native
fetchI := IRR.From1(fetchBytes) // func(string) IRR.ReaderResult[[]byte]
// and back, for APIs that expect the Go shape
fetchGo := RIO.Uneitherize1(fetch) // func(context.Context, string) ([]byte, error)The lifted function receives the pipeline's (possibly scoped) context — timeouts and values applied with the operators below reach it automatically.
| Need | Operator | Result |
|---|---|---|
| whole context | RIO.Ask() | ReaderIOResult[context.Context] |
| pure projection | RIO.FromReader(f) | ReaderIOResult[A] |
| one typed value | RIO.AskValue[V](key) | ReaderIOResult[Option[V]] |
AskValue never panics and never fails: Some(v) if the key holds a V, None if it is absent or holds another type. The caller decides what "missing" means.
Use an unexported key type — never plain strings or exported types — and keep one read and one write accessor next to each key, so the rest of the code never touches the key:
type ctxKey int
const (
userKey ctxKey = iota
requestIDKey
)
var errNoUser = errors.New("no authenticated user in context")
// optional value: None -> default
func requestID() RIO.ReaderIOResult[string] {
return F.Pipe1(
RIO.AskValue[string](requestIDKey),
RIO.Map(O.GetOrElse(LZ.Of("-"))),
)
}
// required value: None -> error
func requireUser() RIO.ReaderIOResult[User] {
return F.Pipe1(
RIO.AskValue[User](userKey),
RIO.Chain(RIO.FromOption[User](F.Constant(errNoUser))),
)
}
// writer: scopes the value to the wrapped computation
func withUser[A any](u User) RIO.Operator[A, A] {
return RIO.WithValue[A](userKey, u)
}RR and IRR have no FromOption, so the required-value accessor looks slightly different there:
// RR: lift result.FromOption (Option[User] -> Result[User]) into the reader
func requireUserRR() RR.ReaderResult[User] {
return F.Pipe1(
RR.AskValue[User](userKey),
RR.ChainEitherK(R.FromOption[User](LZ.Of(errNoUser))),
)
}
// IRR: ChainOptionK expects an idiomatic (B, bool) Kleisli; O.Unwrap turns the Option into that tuple
func requireUserIRR() IRR.ReaderResult[User] {
return F.Pipe1(
IRR.AskValue[User](userKey),
IRR.ChainOptionK[O.Option[User], User](LZ.Of(errNoUser))(O.Unwrap[User]),
)
}The IRR form needs the explicit [O.Option[User], User] because ChainOptionK receives only the onNone error first, so Go cannot infer A and B from it.
Scoping operators run the wrapped computation with a derived context. The caller's context is never modified, and the derived context's cancel function is always released when the computation completes — no defer cancel(), no leaks.
| Operator | Derives with | Notes |
|---|---|---|
WithValue[A](key, v) | context.WithValue | inner values shadow outer ones for the same key |
WithTimeout[A](d) | context.WithTimeout | relative to when the computation runs, not when the operator is built |
WithDeadline[A](t) | context.WithDeadline | an earlier parent deadline still wins |
Local[A](f) | anything | general form; the others are built on it |
They are ordinary operators and compose in Pipe. The context flows from the last operator inwards, so the last one is applied first:
func handleRequest(r *http.Request) RIO.ReaderIOResult[Response] {
return F.Pipe4(
requireUser(),
RIO.Chain(loadProfile),
RIO.WithTimeout[Response](5*time.Second), // bounds the work above
withUser[Response](userFromRequest(r)), // visible to everything above
RIO.WithValue[Response](requestIDKey, r.Header.Get(HD.XRequestID)),
)
}Scope as narrowly as the requirement: put WithTimeout directly after the step it should bound, not around the whole handler, if only one call needs it.
When the new context value itself needs IO (generating an ID, loading a token), use LocalIOK / LocalIOResultK with the context/reader building blocks:
// uuid.NewString is a func() string, i.e. already an IO[string]
func addRequestID(ctx context.Context) IO.IO[RIO.ContextCancel] {
return F.Pipe1(
uuid.NewString,
IO.Map(F.Flow3(
CR.WithValue[string](requestIDKey), // string -> Endomorphism[context.Context]
RD.Read[context.Context](ctx), // apply it to ctx
CR.NopCancel, // -> Pair[CancelFunc, context.Context]
)),
)
}
scoped := RIO.LocalIOK[Response](addRequestID)(handler)LocalIOResultK does the same with a fallible derivation; on failure the wrapped computation does not run.
RIO, RR and IRR, Chain checks the context before each step: once the context is cancelled, the next step does not run and the result is Left(context.Cause(ctx)). Map does not check (pure functions are cheap).RIOC (context/readerio) has no error channel, so it cannot short-circuit; use it only for IO that is fine to complete.WithContext(ma) / WithContextK(f) add the same check explicitly, e.g. before an expensive first step.Delay, retries, Bracket / WithResource and the HTTP client observe cancellation.select, custom IO) must watch ctx.Done() themselves and return ctx.Err() / context.Cause(ctx):func waitForJob(id string) RIO.ReaderIOResult[Job] {
return func(ctx context.Context) RIO.IOResult[Job] {
return func() R.Result[Job] {
select {
case job := <-jobs(id):
return R.Of(job)
case <-ctx.Done():
return R.Left[Job](context.Cause(ctx))
}
}
}
}logging.WithLogger(l) already has Local's argument shape, so a request logger is one operator. All context-aware logging (TapSLog, SLog, LogEntryExit) inside picks it up:
F.Pipe1(
pipeline,
RIO.Local[Response](logging.WithLogger(slog.Default().With("requestID", id))),
)Read it with logging.GetLoggerFromContext (falls back to the global logger). For a logger under your own key: F.Flow2(CR.AskValue[*slog.Logger](myKey), O.GetOrElse(slog.Default)).
EffectC holds the dependencies and context.Context holds the request scope; see the fp-go-effect skill for designing C.
Effect[C, A] is func(C) RIO.ReaderIOResult[A]: C carries typed dependencies, context.Context is still the runtime context supplied by RunSync(…)(ctx).
EF.Local, EF.Ask, EF.Asks operate on C, not on context.Context.EF.Eitherize(func(C, context.Context) (T, error)) receives both.Effect, lift the RIO operator over C with RD.Map (plain reader.Map):bounded := RD.Map[Deps](RIO.WithTimeout[User](2*time.Second))(fetchUserEffect) // Effect[Deps, User]
tagged := RD.Map[Deps](RIO.WithValue[User](requestIDKey, id))(fetchUserEffect)(RD = github.com/IBM/fp-go/v2/reader.)
When a plain context.Context is genuinely needed (handing it to a non-fp-go API, building a fixture), use the context/reader building blocks instead of the standard library calls, so reads and writes stay symmetric:
ctx2 := CR.WithValue[User](userKey)(u)(ctx) // context.WithValue, curried
user := CR.AskValue[User](userKey)(ctx2) // Option[User]
cc := CR.NopCancel(ctx2) // Pair[CancelFunc, ctx] for Local-shaped APIsFor optics composition over the context: lenses.AtContext[V](key) (optics/lenses) is a lens context.Context → Option[V].
| Data | Where |
|---|---|
| request / correlation / trace IDs | context (WithValue) |
| authenticated principal | context (WithValue) |
| request-scoped logger | context (Local(logging.WithLogger(l))) |
| deadlines, cancellation | context (WithTimeout, WithDeadline) |
| DB handles, HTTP clients, repositories | Effect[Deps, A] |
| configuration, feature flags | Effect[Deps, A] or function parameters |
| per-call inputs | function parameters (Kleisli arrows) |
A value that is required for the program to be correct is a dependency, not a context value — the compiler cannot check that it was provided.
func TestRequireUser(t *testing.T) {
// present
res := F.Pipe1(requireUser(), withUser[User](alice))(t.Context())()
assert.Equal(t, R.Of(alice), res)
// missing -> error, no panic
assert.Equal(t, R.Left[User](errNoUser), requireUser()(t.Context())())
}
func TestTimeout(t *testing.T) {
res := F.Pipe1(waitForJob("slow"), RIO.WithTimeout[Job](10*time.Millisecond))(t.Context())()
assert.Equal(t, R.Left[Job](context.DeadlineExceeded), res)
}t.Context(), not context.Background().with… accessors production code uses.context.DeadlineExceeded.| ❌ Avoid | ✅ Prefer | Why |
|---|---|---|
ctx.Value(k).(T) | RIO.AskValue[T](k) + GetOrElse / FromOption | assertion panics when missing or mistyped |
v, _ := ctx.Value(k).(T) then if v == "" | AskValue + Option | zero value is indistinguishable from "missing" |
context.WithValue(ctx, "user", u) | unexported ctxKey + WithValue[A](userKey, u) | string keys collide across packages |
ctx, cancel := context.WithTimeout(ctx, d); defer cancel() around pipeline(ctx)() | F.Pipe1(pipeline, RIO.WithTimeout[A](d)) | scoping belongs to the description, not the call site |
Local with ctx2, _ := context.WithTimeout(…) | WithTimeout[A](d) | discarded cancel leaks a timer until the deadline |
func(ctx) … { return pipeline(ctx) } wrappers | return the pipeline value itself | the Reader already is that function |
capturing ctx in a closure or struct field | supply it when running | the pipeline silently uses a stale context |
| DB / client stored in the context | Effect[Deps, A] | untyped, unchecked, hard to test |
pair.Unpack(logging.WithLogger(l)(ctx)) + defer | RIO.Local[A](logging.WithLogger(l)) | already Local-shaped |
context.Background() inside library code or tests | the caller's context / t.Context() | breaks cancellation and deadlines |
blocking leaf that ignores ctx.Done() | select on ctx.Done() | timeouts and cancellation cannot take effect |
ctx.Value(...) type assertions; values are read with AskValue.FromOption / ChainOptionK), optional ones defaulted.context.WithValue / WithTimeout / WithDeadline / WithCancel inside or around pipelines — operators are used instead.ctx.Done().Effect[Deps, A], not in the context.t.Context() and cover the missing-value and timeout paths.import (
RIO "github.com/IBM/fp-go/v2/context/readerioresult"
RR "github.com/IBM/fp-go/v2/context/readerresult"
RIOC "github.com/IBM/fp-go/v2/context/readerio"
SRIO "github.com/IBM/fp-go/v2/context/statereaderioresult"
IRR "github.com/IBM/fp-go/v2/idiomatic/context/readerresult"
CR "github.com/IBM/fp-go/v2/context/reader"
EF "github.com/IBM/fp-go/v2/effect"
F "github.com/IBM/fp-go/v2/function"
O "github.com/IBM/fp-go/v2/option"
R "github.com/IBM/fp-go/v2/result"
IO "github.com/IBM/fp-go/v2/io"
LZ "github.com/IBM/fp-go/v2/lazy"
RD "github.com/IBM/fp-go/v2/reader"
HD "github.com/IBM/fp-go/v2/http/headers"
LS "github.com/IBM/fp-go/v2/optics/lenses"
"github.com/IBM/fp-go/v2/logging"
)See also the context package documentation (go doc github.com/IBM/fp-go/v2/context) and the fp-go, fp-go-logging and fp-go-http skills.
© IBM, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/fp-go-context of IBM/fp-go.
Open the folder on GitHubat commit 4c9c328
Context Handling in fp-go next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Context Handling in fp-go this skillIBM/fp-go | 2k | — | ~4.2k | Automated safety check: Pass | Apache-2.0 | |
| Go Concurrencyinference-gateway/inference-gateway | 214 | — | ~2.3k | Automated safety check: Pass | Apache-2.0 | |
| Dotnet Backend Patternswshobson/agents | 40k | 7 repos | ~6.6k | Automated safety check: Pass | MIT | |
| Golang Patternsantoniopaya22/go-rest-template | 172 | 9 repos | ~3.5k | Automated safety check: Pass | None | |
| Grepaiyoanbernabeu/grepai | 1.9k | — | ~1.1k | Automated safety check: Pass | MIT | |
| Golang Project Layoutcontext-labs/whip | 1.1k | 1 repos | ~1.8k | Automated safety check: Pass | MIT |
inference-gateway/inference-gateway
Idiomatic Go concurrency - sync primitives, channel semantics, the select statement, and the standard channel patterns (cancellation/done-channel, fan-out/fan-in, pipeline, or-done, context…
wshobson/agents
Master C/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications.
antoniopaya22/go-rest-template
Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.
yoanbernabeu/grepai
Semantic code search and call-graph tracing. An agent skill from yoanbernabeu/grepai.
context-labs/whip
Golang project layouts and workspaces. An agent skill from context-labs/whip.
yoanbernabeu/grepai
Create a new release for grepai. An agent skill from yoanbernabeu/grepai.
IBM/fp-go
Teaches an agent to write fp-go v2 services with the Effect type, carrying dependencies in its type parameter instead of in context.Context or parameters.
IBM/fp-go
Shows how to build composable, context-aware HTTP pipelines in Go using fp-go's ReaderIOResult monad instead of raw net/http calls.
IBM/fp-go
Generates or hand-writes composable lenses for the fp-go library so nested Go structs can be read and updated immutably.
IBM/fp-go
Adds logging to fp-go functional pipelines with Tap operators, entry and exit logs and error context, so that logging never changes the value or error flowing through.
IBM/fp-go
Configures and queries the fp-go MCP server so Claude Code, Claude Desktop or another MCP client can search fp-go's examples and skills directly.
IBM/fp-go
Guides writing or reviewing point-free, first-match-wins case lists in fp-go v2 Go code instead of switch statements and if-else chains.
Works with
Categories
Covers handling Go's context.Context idiomatically in fp-go code: reading and scoping context through operators, timeouts, cancellation and converting ctx-first functions. In fp-go the context is the Reader environment rather than a parameter passed by hand.With calls and defer cancel.
Context Handling in fp-go fits situations like: converting a function that takes ctx and returns a value and error into a ReaderIOResult; adding timeouts or deadlines to an fp-go pipeline; reading request-scoped values or loggers from the context in fp-go code; reviewing fp-go code that still threads ctx by hand.
Run `npx skills add IBM/fp-go --skill fp-go-context -a claude-code`. Or copy the skill folder (skills/fp-go-context in IBM/fp-go) into .claude/skills/fp-go-context in your project. Claude Code loads it when a task matches its description.
Run `npx skills add IBM/fp-go --skill fp-go-context -a codex`. Or copy the skill folder (skills/fp-go-context in IBM/fp-go) into .agents/skills/fp-go-context in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add IBM/fp-go --skill fp-go-context -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fp-go-context, .gemini/skills/fp-go-context, .github/skills/fp-go-context and .opencode/skills/fp-go-context in your project.
Going by SKILL.md and its folder, Context Handling in fp-go needs the command-line tools its instructions call (go). Our summary lists: The fp-go library; A Go toolchain for go build and go vet; The fp-go MCP server for looking up combinators.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Context Handling in fp-go is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.2k tokens (SKILL.md is roughly 17k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Context Handling in fp-go: Go Concurrency (inference-gateway/inference-gateway, 214 stars), Dotnet Backend Patterns (wshobson/agents, 40k stars), Golang Patterns (antoniopaya22/go-rest-template, 172 stars) and Grepai (yoanbernabeu/grepai, 1.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
IBM (a GitHub organization, an official publisher) maintains it in IBM/fp-go, which has 2,029 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 7, 2026.
Source: IBM/fp-go on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.