Skip to content
Agentmart
Submit a tool

nuget-package-contextfreetasks

Use when writing C# async library methods that should avoid capturing the synchronization context without repeating ConfigureAwait(false), or when adapting…

Skill by Cologler

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/cologler-nuget-package-contextfreetasks

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when writing C# async library methods that should avoid capturing the synchronization context without repeating ConfigureAwait(false), or when adapting ContextFreeTask methods to Task APIs.

Use cases: writing, productivity

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/nuget-package-contextfreetasks

What's inside

Skill name
nuget-package-contextfreetasks
Description
Use when writing C# async library methods that should avoid capturing the synchronization context without repeating ConfigureAwait(false), or when adapting ContextFreeTask methods to Task APIs.
License
MIT
Metadata
version: ContextFreeTasks 0.4.0 · homepage: https://github.com/ufcpp/ContextFreeTask · generated-by: gpt-6 · last-updated: 2026-10-16
Instructions
42 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# ContextFreeTasks

## Prerequisite

For a project-local skill, inspect every project in the consuming repository or solution for `ContextFreeTasks`, including imported package references and resolved dependencies. A central `PackageVersion` entry alone does not prove installation. If no project references it, ask whether to install the package or remove this skill, and wait for the user's choice. Only if installation is chosen, run `dotnet add <project.csproj> package ContextFreeTasks`. This check does not apply to the skill catalog itself.

## When and why

Use `ContextFreeTask` or `ContextFreeTask<T>` as an async method's return type when its body does not need the caller's synchronization context. This replaces repeated `ConfigureAwait(false)` calls inside that method, reducing repetition and missed awaits. Requires C# 7 or later.

Keep context-dependent code, such as UI updates, outside these methods. This is a `Task` wrapper, not a `ValueTask` allocation optimization or a request to run work on another thread.

## Usage

```csharp
using ContextFreeTasks;
using System.Net.Http;
using System.Threading.Tasks;

static async ContextFreeTask<string> ReadTrimmedAsync(HttpClient client, string url)
{
    // This method needs no caller context, so ConfigureAwait(false) is unnecessary here.
    string text = await client.GetStringAsync(url);
    return text.Trim();
}

// Preserve an existing Task-based API contract with the wrapped Task property.
static Task<string> ReadAsync(HttpClient client, string url)
    => ReadTrimmedAsync(client, url).Task;
```

Use non-generic `async ContextFreeTask` for methods without a result. Await either form directly. Use `.Task` when passing the result to APIs such as `Task.WhenAll`.

The context-free behavior belongs to the method body. A caller using ordinary `async Task` still captures its own context when awaiting a `ContextFreeTask`; use `await operation.ConfigureAwait(false)` there if that caller also needs to avoid capture. Merely exposing `.Task` does not change the method body's behavior.

## Further reference

The [project homepage](https://github.com/ufcpp/ContextFreeTask) and its linked source cover the task-like pattern and async method builder implementation intentionally omitted here. Consult them only when those internals or less common helpers such as `ContextFreeTask.Run` are needed.

Do not fetch the homepage for information already covered here.

From Cologler/Skills, MIT.

More from Cologler/Skills

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Oct 15, 2026 (14 days ago)

From GitHub (fetched Oct 24, 2026).

Details

Version
ContextFreeTasks 0.4.0
License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Cologler

Cite this page

nuget-package-contextfreetasks skill. Agent Mart. https://agentmart.dev/skills/cologler-nuget-package-contextfreetasks (last updated 2026-10-24)