Official agent skill

Context Handling in fp-go

by IBM in IBM/fp-go

Covers handling Go's context.Context idiomatically in fp-go code: reading and scoping context through operators, timeouts, cancellation and converting ctx-first functions.

OfficialApache-2.0Auto-check passedDevelopment

Install Context Handling in fp-go

skills CLI
$ npx skills add IBM/fp-go --skill fp-go-context -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install IBM/fp-go fp-go-context --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ 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-src

Use ~/.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/

Facts

Skill name
fp-go-context
GitHub stars
2k
Token cost
~4.2k tokens
SKILL.md length
1,305 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
Apache-2.0

At a glance

Covers handling Go's context.Context idiomatically in fp-go code: reading and scoping context through operators, timeouts, cancellation and converting ctx-first functions.

  • Works in 10 steps: Running at the Edge → Bridging func(ctx, …) (T, error) → Reading the Context → …
  • Converting a function that takes ctx and returns a value and error into a ReaderIOResult
  • SKILL.md covers Core Principle, Before You Generate, Packages and Availability and 1. Running at the Edge, plus 12 more sections
  • Calls go

What it does

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.

When your agent uses it

  • 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

Example prompts

  • “Rewrite this handler's fetchUser function so it takes no ctx argument and returns a ReaderIOResult.”
  • “Add a five-second timeout to this fp-go pipeline without using defer cancel.”
  • “Replace the ctx.Value lookups for the request ID with AskValue.”

Requirements

  • The fp-go library
  • A Go toolchain for go build and go vet
  • The fp-go MCP server for looking up combinators

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. Running at the Edge
  2. Bridging func(ctx, …) (T, error)
  3. Reading the Context
  4. Scoping the Context
  5. Cancellation
  6. Request-Scoped Logger
  7. Context in Effect
  8. Outside Pipelines
  9. What Belongs in the Context
  10. Testing

What it can do on your machine

Read from SKILL.md and the folder at commit 4c9c328. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    Shell commands in SKILL.md call:

    • go

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

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.

Always · name and description, kept in context so the agent knows when to use it
~141
When it runs · the whole SKILL.md, loaded when a task matches
~4.2k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from IBM/fp-go at commit 4c9c328, republished under its Apache-2.0 licence (© IBM). 1,305 words, ~4,224 tokens.

Download SKILL.mdSave it as .claude/skills/fp-go-context/SKILL.md (or your agent's skills folder).
name
fp-go-context
description
Use this skill when working with Go's context.Context in fp-go code (github.com/IBM/fp-go/v2/context/...). Trigger on mentions of context.Context in fp-go pipelines, request-scoped values, ctx.Value, context.WithValue, context keys, AskValue, WithValue, timeouts or deadlines (WithTimeout, WithDeadline, context.WithTimeout, defer cancel), cancellation, Local / LocalIOK / LocalIOResultK, WithContext / WithContextK, request-scoped loggers, converting func(ctx, ...) (T, error) functions to ReaderIOResult, or reviewing code that threads ctx by hand.

fp-go Context Handling

Core Principle

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:

  1. Pipelines never mention ctx. Build them from operators; the context flows implicitly.
  2. Supply the context exactly once, at the edge — HTTP handler (r.Context()), main, or a test (t.Context()).
  3. Read the context with operators (Ask, FromReader, AskValue), never with ctx.Value(k).(T).
  4. Scope the context with operators (WithValue, WithTimeout, WithDeadline, Local), never with context.With* + defer cancel().
  5. Only request-scoped data goes into the context. Dependencies (DB, clients, config) belong in Effect[Deps, A].

Before You Generate

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.

Packages and Availability

PackageShapeUse 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() AIO 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) Aplain building blocks for use outside pipelines
effect (EF)func(C) RIO.ReaderIOResult[A]typed deps C plus the runtime context
OperatorRIORRRIOCSRIOIRRCR
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.

1. Running at the Edge

go
// 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.

2. Bridging func(ctx, …) (T, error)

Existing context-first Go functions are lifted, not wrapped by hand:

go
// 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.

3. Reading the Context

NeedOperatorResult
whole contextRIO.Ask()ReaderIOResult[context.Context]
pure projectionRIO.FromReader(f)ReaderIOResult[A]
one typed valueRIO.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.

Keys and Accessors

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:

go
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:

go
// 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.

4. Scoping the Context

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.

OperatorDerives withNotes
WithValue[A](key, v)context.WithValueinner values shadow outer ones for the same key
WithTimeout[A](d)context.WithTimeoutrelative to when the computation runs, not when the operator is built
WithDeadline[A](t)context.WithDeadlinean earlier parent deadline still wins
Local[A](f)anythinggeneral 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:

go
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.

Deriving the Context from an Effect

When the new context value itself needs IO (generating an ID, loading a token), use LocalIOK / LocalIOResultK with the context/reader building blocks:

go
// 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.

5. Cancellation

  • In 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.
  • Leaf computations that block (loops, select, custom IO) must watch ctx.Done() themselves and return ctx.Err() / context.Cause(ctx):
go
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))
            }
        }
    }
}
Show full SKILL.md (539 more words)Show less

6. Request-Scoped Logger

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:

go
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)).

7. Context in Effect

C 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.
  • To scope the runtime context of an Effect, lift the RIO operator over C with RD.Map (plain reader.Map):
go
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.)

8. Outside Pipelines

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:

go
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 APIs

For optics composition over the context: lenses.AtContext[V](key) (optics/lenses) is a lens context.Context → Option[V].

9. What Belongs in the Context

DataWhere
request / correlation / trace IDscontext (WithValue)
authenticated principalcontext (WithValue)
request-scoped loggercontext (Local(logging.WithLogger(l)))
deadlines, cancellationcontext (WithTimeout, WithDeadline)
DB handles, HTTP clients, repositoriesEffect[Deps, A]
configuration, feature flagsEffect[Deps, A] or function parameters
per-call inputsfunction 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.

10. Testing

go
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)
}
  • Always run with t.Context(), not context.Background().
  • Inject context values with the same with… accessors production code uses.
  • Test the missing-value path of every required value.
  • Keep timeouts in tests short (milliseconds) and assert on context.DeadlineExceeded.

Common Mistakes

❌ Avoid✅ PreferWhy
ctx.Value(k).(T)RIO.AskValue[T](k) + GetOrElse / FromOptionassertion panics when missing or mistyped
v, _ := ctx.Value(k).(T) then if v == ""AskValue + Optionzero 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) } wrappersreturn the pipeline value itselfthe Reader already is that function
capturing ctx in a closure or struct fieldsupply it when runningthe pipeline silently uses a stale context
DB / client stored in the contextEffect[Deps, A]untyped, unchecked, hard to test
pair.Unpack(logging.WithLogger(l)(ctx)) + deferRIO.Local[A](logging.WithLogger(l))already Local-shaped
context.Background() inside library code or teststhe 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

Review Checklist

  • No ctx.Value(...) type assertions; values are read with AskValue.
  • Keys are unexported types; each key has a read and a write accessor.
  • Required values are turned into errors explicitly (FromOption / ChainOptionK), optional ones defaulted.
  • No context.WithValue / WithTimeout / WithDeadline / WithCancel inside or around pipelines — operators are used instead.
  • No discarded cancel functions.
  • The context is supplied once, at the edge; not captured or stored.
  • Blocking leaf computations observe ctx.Done().
  • Dependencies live in Effect[Deps, A], not in the context.
  • Tests run with t.Context() and cover the missing-value and timeout paths.

Import Reference

go
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

Files

Just SKILL.md in skills/fp-go-context of IBM/fp-go.

Open the folder on GitHubat commit 4c9c328

Compare with similar skills

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.

Context Handling in fp-go compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Context Handling in fp-go this skillIBM/fp-go2k—~4.2kAutomated safety check: PassApache-2.0
Go Concurrencyinference-gateway/inference-gateway214—~2.3kAutomated safety check: PassApache-2.0
Dotnet Backend Patternswshobson/agents40k7 repos~6.6kAutomated safety check: PassMIT
Golang Patternsantoniopaya22/go-rest-template1729 repos~3.5kAutomated safety check: PassNone
Grepaiyoanbernabeu/grepai1.9k—~1.1kAutomated safety check: PassMIT
Golang Project Layoutcontext-labs/whip1.1k1 repos~1.8kAutomated safety check: PassMIT

Similar skills

  • 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…

    214 GitHub stars~2.3k tokensUpdated today
    DevelopmentAuto-check passed
  • Master C/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications.

    40k GitHub starsUsed in 7 repos~6.6k tokens
    Backend & APIsAuto-check passed
  • Golang Patterns

    antoniopaya22/go-rest-template

    Idiomatic Go patterns, best practices, and conventions for building robust, efficient, and maintainable Go applications.

    172 GitHub starsUsed in 9 repos~3.5k tokens
    DevelopmentAuto-check passed
  • Grepai

    yoanbernabeu/grepai

    Semantic code search and call-graph tracing. An agent skill from yoanbernabeu/grepai.

    1.9k GitHub stars~1.1k tokensUpdated 16 days ago
    DevelopmentAuto-check passed
  • Golang Project Layout

    context-labs/whip

    Golang project layouts and workspaces. An agent skill from context-labs/whip.

    1.1k GitHub starsUsed in 1 repo~1.8k tokens
    DevelopmentAuto-check passed
  • Release

    yoanbernabeu/grepai

    Create a new release for grepai. An agent skill from yoanbernabeu/grepai.

    1.9k GitHub stars~918 tokensUpdated 16 days ago
    DevelopmentAuto-check passed

More from IBM/fp-go

All 10 skills in this repo
  • 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.

    2k GitHub stars~4.3k tokensUpdated today
    Auto-check passed
  • Official

    Shows how to build composable, context-aware HTTP pipelines in Go using fp-go's ReaderIOResult monad instead of raw net/http calls.

    2k GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Official

    Generates or hand-writes composable lenses for the fp-go library so nested Go structs can be read and updated immutably.

    2k GitHub stars~4.3k tokensUpdated today
    Auto-check passed
  • Official

    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.

    2k GitHub stars~3.7k tokensUpdated today
    Auto-check passed
  • Official

    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.

    2k GitHub stars~3.3k tokensUpdated today
    Auto-check passed
  • Official

    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.

    2k GitHub stars~2.8k tokensUpdated today
    Auto-check passed

Categories

Questions about Context Handling in fp-go

What does Context Handling in fp-go do?

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.

When should I use Context Handling in fp-go?

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.

How do I install Context Handling in fp-go in Claude Code?

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.

How do I install Context Handling in fp-go in Codex?

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.

Can I use Context Handling in fp-go in Cursor, Gemini CLI or GitHub Copilot?

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.

What does Context Handling in fp-go need to run?

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.

Does Context Handling in fp-go access the network?

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.

Is Context Handling in fp-go safe to install?

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.

What licence does Context Handling in fp-go use?

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.

How many tokens does Context Handling in fp-go use?

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.

What are the alternatives to Context Handling in fp-go?

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.

Who maintains Context Handling in fp-go?

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.