Official agent skill

Testfx Parallel Safety Preflight

by microsoft in microsoft/testfx

Check concurrency and isolation before implementing or refactoring TestFx tests, lifecycle code, helpers, shared-state declarations, or production paths those tests exercise.

OfficialMITAuto-check passedDevelopment

Install Testfx Parallel Safety Preflight

skills CLI
$ npx skills add microsoft/testfx --skill testfx-parallel-safety-preflight -a claude-code

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

GitHub CLI
$ gh skill install microsoft/testfx testfx-parallel-safety-preflight --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/microsoft/testfx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/testfx-parallel-safety-preflight .claude/skills/testfx-parallel-safety-preflight && 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
testfx-parallel-safety-preflight
GitHub stars
1k
Token cost
~2.4k tokens
SKILL.md length
1,126 words
Files
1
Skills in repo
50
Repo updated
First seen
Licence
MIT

At a glance

Check concurrency and isolation before implementing or refactoring TestFx tests, lifecycle code, helpers, shared-state declarations, or production paths those tests exercise.

  • Works in 3 steps: Resolve the effective test engine,… → Record the existing resource coverage… → Choose elimination or the narrowest…
  • Tasks that involve Async programming
  • SKILL.md covers Reuse the canonical analysis, Before editing: establish the…, While implementing: close the… and Before finishing: reconcile…, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Testfx Parallel Safety Preflight is an agent skill from microsoft/testfx, published by the product's own GitHub organization. Check concurrency and isolation before implementing or refactoring TestFx tests, lifecycle code, helpers, shared-state declarations, or production paths those tests exercise. Use before narrowing DoNotParallelize or ResourceLock, changing parallelization settings, or introducing asynchronous workers; repeat against the final diff.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Async programming and Refactoring. The repository describes itself as: This repository holds the source code of Microsoft.Testing.Platform (MTP), a lightweight alternative to VSTest, as well as MSTest adapter and framework. The licence is MIT.

When your agent uses it

  • Tasks that involve Async programming
  • Tasks that involve Refactoring

Example prompts

  • “/testfx-parallel-safety-preflight”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Resolve the effective test engine, target frameworks, assembly scheduling
  2. Record the existing resource coverage matrix in working notes, not a new
  3. Choose elimination or the narrowest correct shared read/write declaration

What it can do on your machine

Read from SKILL.md and the folder at commit 19d717a. 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

    No scripts in the folder and no shell commands in SKILL.md.

    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

Testfx Parallel Safety Preflight loads about 2.4k tokens when it runs. Until then it costs about 91 tokens; SKILL.md has 1,126 words of instructions outside code blocks.

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

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 microsoft/testfx at commit 19d717a, republished under its MIT licence (© microsoft). 1,126 words, ~2,381 tokens.

Download SKILL.mdSave it as .claude/skills/testfx-parallel-safety-preflight/SKILL.md (or your agent's skills folder).
name
testfx-parallel-safety-preflight
description
Check concurrency and isolation before implementing or refactoring TestFx tests, lifecycle code, helpers, shared-state declarations, or production paths those tests exercise. Use before narrowing DoNotParallelize or ResourceLock, changing parallelization settings, or introducing asynchronous workers; repeat against the final diff.

TestFx parallel-safety preflight

Run this during implementation, not only during review. Keep it bounded to the requested change and its reachable conflicts; do not turn it into a repository audit or speculative hardening.

Reuse the canonical analysis

Read .github/copilot-instructions.md, the owning project's configuration and BannedSymbols.txt when present, and .github/workflows/shared/parallel-safety-audit-shared.md. Apply the shared rubric from # Parallel-safety audit through Step 3, including its assembly-scoping rules. It owns scheduling semantics, the A-D taxonomy, severity, confidence, culture/ExecutionContext distinctions, and declaration reconciliation; do not duplicate or replace it.

Read .github/agents/parallel-safety-reviewer.agent.md for the specialist's evidence and partial-analysis contract. No specialist invocation or GitHub publication is required. Ignore review-only read-only instructions, event expressions, extraction-tool assumptions, output formatting, and safe-output calls: use the actual implementation scope and local diff instead. For existing branch changes, compare against their merge base, not a moving base-branch tip.

Before editing: establish the isolation contract

  1. Resolve the effective test engine, target frameworks, assembly scheduling scope, workers, and configuration sources using Step 0. Include constructors, initialization, cleanup, disposal, fixtures, linked sources, and production helpers reached by the affected tests. Do not assume that every project uses MSTest or that an attribute is the effective runtime configuration.

  2. Record the existing resource coverage matrix in working notes, not a new repository planning file:

    Resource and boundaryLifetimeDirect test readers/writersProduction readers/writersOther tests reaching those pathsDeclaration: key, mode, placement
    Exact state, path, source, or registry; assembly/process/externalPer-test, class, assembly, or workerNamed tests and lifecycle membersConcrete helpers and call pathsNamed observers or mutators in the owning assemblyExisting coverage or a confirmed gap

    Trace through production helpers and back to every reachable caller in the owning test assembly. A literal-key search is an inventory aid, not proof. Before claiming a race, name a concrete conflicting observer, the scheduling interleaving, and the observable wrong result. If no conflict is established, do not add a lock merely because a mutation exists; mark uncertainty or readiness-only concerns as such.

  3. Choose elimination or the narrowest correct shared read/write declaration using categories C and D. Reuse the existing key and shared constants; include indirect readers and compatible producers, not only direct mutations. Justify method versus class placement against the whole lifecycle. Preserve assembly-level safety; a narrower method/class lock must not silently opt an assembly in or replace assembly-lifetime exclusion.

For a requested scheduling change, expand to the whole affected assembly as the shared rubric requires. Otherwise leave assembly scheduling unchanged. If coverage is incomplete, retain the existing exclusion and report the gap rather than serializing unrelated tests or weakening safety to finish a patch.

While implementing: close the assertion and lifetime boundaries

  • Global observers: trace activity, metric, logging, and event listeners back to every producer they can observe. A lock around a captured list only makes the collection thread-safe; it does not prove an event belongs to this test. Prefer a per-test identity filter and assert the intended producer. If an unfiltered observer is necessary, reconcile all interfering producers with the same coordination key. Compatible filtered tests/producers can share Mode = ResourceAccessMode.Read when the established protocol permits it; use exclusive access only where required. Do not turn an entire class into ReadWrite merely because one method needs exclusion.
  • Inherited state: enumerate the environment values the exercised production paths actually consult, including inherited CI gates such as TF_BUILD. Explicitly arrange required present and absent values using existing fakes or child-process environment overrides where possible. A lock does not neutralize CI inheritance. When real process state must change, capture exact previous values (including absence), restore them in finally inside the protected lifetime, and reconcile readers. Restore changed culture and static state too; use the rubric's target-framework/ExecutionContext distinctions rather than treating all current-culture changes as process-global races.
  • Rendezvous and cleanup: use deterministic started/ready/release signals, not sleeps or elapsed-time guesses. Keep handles to the original worker tasks, not only cancellation/timeout wrappers. In finally, release blocked workers and request cancellation as appropriate, then await their termination before disposing gates/listeners, restoring shared state, or releasing test ownership. A release signal, cancellation request, or "reached finally" marker is not completion. Bound rendezvous and cleanup separately with named limits and target-framework-compatible existing helpers; cleanup must not immediately abandon the join because the test's cancellation token is already canceled. Surface worker faults and cleanup timeouts without hiding the original test failure. If in-process workers cannot terminate within the bound, use an existing isolated-process harness or keep the attempted refactor out; do not leave background mutation running and declare the test isolated.
Show full SKILL.md (379 more words)Show less

Before finishing: reconcile the final diff

Rebuild the matrix from the final implementation, including removals of locks, opt-outs, restoration, or cleanup. Verify that each named conflicting observer is covered and that compatible readers remain concurrent. Missing evidence is partial, never clean. Do not remove an exclusion when any row is unknown.

Use the smallest existing build and focused tests for the affected behavior, following the repository-pinned toolchain and packing rules. Include the named conflicting tests and the relevant normal, assertion-failure, cancellation, and timeout cleanup paths, not just the changed method. Preserve the actual assembly scheduling in validation; a serial filtered run or passing stress run is not proof that a race is impossible. When environment-dependent behavior is in scope, cover the required present/absent CI values without changing unrelated host state.

Keep a concise handoff: assembly scope/workers, concrete conflict and declaration choice (or why none is needed), rendezvous/termination evidence, exact validation commands and results, and unresolved evidence. This skill does not authorize publication, unrelated fixes, or changing assembly scheduling.

Repository-backed examples

These are analysis examples, not requests to patch the referenced tests. Recheck their implementation at HEAD before reusing a pattern.

ScenarioPreflight decision and reference
A test writes ProcessKilledByHangDump; another calls the crash handler without mentioning that slot.Trace CrashDumpProcessLifetimeHandler.OnTestHostProcessExitedAsync to AppDomain.CurrentDomain.GetData. For example, the writer in CrashDumpTests could make CrashDumpArtifactPublisherMutationTests.OnTestHostProcessExitedAsync_MissingDumpPattern_ThrowsInvariantViolation skip its expected exception if exclusion were removed. Preserve the matching readers, writer's exclusive declaration, and exact restoration.
A raw activity listener could accept another test's builder event.In OpenTelemetryProviderExtensionsTests, AddTestingPlatformDiagnostics_RawListenerObservesBuilderActivityWithoutProvider needs exclusion from the producer DiagnosticsAndProviderRegistration_IsIdempotentAndOrdered, not just a lock on its captured list. They use matching exclusive/read source-key declarations. OpenTelemetryPlatformServiceTests also uses a unique activity prefix and a compatible class-level read declaration; do not serialize all readers.
A test expects no CI resource attributes while running on an Azure Pipelines agent.Inspect the environment read set, not the developer machine. OpenTelemetryProviderExtensionsTests.WithEnvironment / WithEnvironmentAsync explicitly clear observed values including TF_BUILD, then restore the snapshot. Prefer the existing fake when testing configuration alone.
A test's timeout/cancellation wrapper completes while its worker is still active.src/Platform/Microsoft.Testing.Platform/Helpers/TaskExtensions.cs separates cancellation of the wait from completion of the original task. Retain and join that original worker after releasing its rendezvous, with bounded failure cleanup; observing the wrapper or a pre-exit marker is insufficient.

© microsoft, MIT. 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 .github/skills/testfx-parallel-safety-preflight of microsoft/testfx.

Open the folder on GitHubat commit 19d717a

Compare with similar skills

Testfx Parallel Safety Preflight 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.

Testfx Parallel Safety Preflight compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testfx Parallel Safety Preflight this skillmicrosoft/testfx1k—~2.4kAutomated safety check: PassMIT
Modern JavaScript Patternswshobson/agents40k12 repos~548Automated safety check: PassMIT
Swift Concurrencysupabitapp/supaterm172—~3.3kAutomated safety check: PassCustom licence
Pre PR AblationPopupMaker/Popup-Maker110—~2.5kAutomated safety check: PassNone
cmux Swift Package Architecturemanaflow-ai/cmux28k1 repos~4.2kAutomated safety check: PassCustom licence
Swift ConcurrencyAFK-surf/OpenBridge430—~2.8kAutomated safety check: PassMIT

Similar skills

  • Covers ES6+ syntax and functional patterns for refactoring older JavaScript: async/await, destructuring, spread, modules, generators and data pipelines.

    40k GitHub starsUsed in 12 repos~548 tokens
    DevelopmentAuto-check passed
  • Swift Concurrency

    supabitapp/supaterm

    Diagnose data races, convert callback-based code to async/await, implement actor isolation patterns, resolve Sendable conformance issues, and guide Swift 6 migration.

    172 GitHub stars~3.3k tokensUpdated 15 days ago
    DevelopmentAuto-check passed
  • Pre PR Ablation

    PopupMaker/Popup-Maker

    Use before finalizing or opening/updating a PR for non-trivial code changes, especially third-party integrations, compatibility layers, hooks and filters, lifecycle code, providers, abstractions…

    110 GitHub stars~2.5k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Architecture rules for cmux's move to Swift Packages: acyclic whole-domain packages, minimal public API, group folders, Xcode project wiring and Swift 6 concurrency.

    28k GitHub starsUsed in 1 repo~4.2k tokens
    DevelopmentAuto-check passed
  • Swift Concurrency

    AFK-surf/OpenBridge

    Expert guidance on Swift Concurrency best practices, patterns, and implementation.

    430 GitHub stars~2.8k tokensUpdated 4 mo ago
    DevelopmentAuto-check passed
  • JavaScript Pro

    Jeffallan/claude-skills

    Writes and reviews modern JavaScript: ES2023+ syntax, async/await, ESM modules, Node.js and browser APIs, with linting, leak checks and Jest tests.

    12k GitHub stars~1.2k tokensUpdated 6 days ago
    DevelopmentAuto-check passed

More from microsoft/testfx

All 50 skills in this repo
  • Official

    Guide for organizing MSBuild infrastructure with Directory.Build.props, Directory.Build.targets, Directory.Packages.props, and Directory.Build.rsp.

    1k GitHub starsUsed in 1 repo~2.5k tokens
    Auto-check passed
  • Coverage Analysis

    microsoft/testfx

    Official

    Project-wide code coverage and CRAP (Change Risk Anti-Patterns) score analysis for .NET projects.

    1k GitHub stars~7.3k tokensUpdated today
    Auto-check passed
  • Incremental Build

    microsoft/testfx

    Official

    Guide for optimizing MSBuild incremental builds. An agent skill from microsoft/testfx.

    1k GitHub starsUsed in 3 repos~3.7k tokens
    Auto-check passed
  • Official

    Validate TestFx shipping paths and capable CI execution using packed consumers, package/cache provenance, exact exits and artifacts, and selected-versus-executed test evidence.

    1k GitHub stars~4.7k tokensUpdated today
    Auto-check passed
  • Msbuild Modernization

    microsoft/testfx

    Official

    Guide for modernizing and migrating MSBuild project files to SDK-style format.

    1k GitHub starsUsed in 3 repos~4.3k tokens
    Auto-check passed
  • Official

    Guide for interpreting ResolveProjectReferences time in MSBuild performance summaries.

    1k GitHub starsUsed in 3 repos~743 tokens
    Auto-check passed

Categories

Questions about Testfx Parallel Safety Preflight

What does Testfx Parallel Safety Preflight do?

Check concurrency and isolation before implementing or refactoring TestFx tests, lifecycle code, helpers, shared-state declarations, or production paths those tests exercise. Testfx Parallel Safety Preflight is an agent skill from microsoft/testfx, published by the product's own GitHub organization. Check concurrency and isolation before implementing or refactoring TestFx tests, lifecycle code, helpers, shared-state declarations, or production paths those tests exercise.

When should I use Testfx Parallel Safety Preflight?

Testfx Parallel Safety Preflight fits situations like: tasks that involve Async programming; tasks that involve Refactoring.

How do I install Testfx Parallel Safety Preflight in Claude Code?

Run `npx skills add microsoft/testfx --skill testfx-parallel-safety-preflight -a claude-code`. Or copy the skill folder (.github/skills/testfx-parallel-safety-preflight in microsoft/testfx) into .claude/skills/testfx-parallel-safety-preflight in your project. Claude Code loads it when a task matches its description.

How do I install Testfx Parallel Safety Preflight in Codex?

Run `npx skills add microsoft/testfx --skill testfx-parallel-safety-preflight -a codex`. Or copy the skill folder (.github/skills/testfx-parallel-safety-preflight in microsoft/testfx) into .agents/skills/testfx-parallel-safety-preflight in your project. Codex loads it when a task matches its description.

Can I use Testfx Parallel Safety Preflight 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 microsoft/testfx --skill testfx-parallel-safety-preflight -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testfx-parallel-safety-preflight, .gemini/skills/testfx-parallel-safety-preflight, .github/skills/testfx-parallel-safety-preflight and .opencode/skills/testfx-parallel-safety-preflight in your project.

What does Testfx Parallel Safety Preflight need to run?

SKILL.md names no scripts, command-line tools or credentials: Testfx Parallel Safety Preflight is instructions for the agent only.

Does Testfx Parallel Safety Preflight 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 Testfx Parallel Safety Preflight 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 Testfx Parallel Safety Preflight use?

Testfx Parallel Safety Preflight is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Testfx Parallel Safety Preflight use?

About 2.4k tokens (SKILL.md is roughly 9.5k 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 Testfx Parallel Safety Preflight?

Skills that share tags, products or a category with Testfx Parallel Safety Preflight: Modern JavaScript Patterns (wshobson/agents, 40k stars), Swift Concurrency (supabitapp/supaterm, 172 stars), Pre PR Ablation (PopupMaker/Popup-Maker, 110 stars) and cmux Swift Package Architecture (manaflow-ai/cmux, 28k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testfx Parallel Safety Preflight?

microsoft (a GitHub organization, an official publisher) maintains it in microsoft/testfx, which has 1,047 GitHub stars. The repository holds 50 skills in this directory. The repository was last updated on October 9, 2026.

Source: microsoft/testfx on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.