mcpbeat

Ffi Testing

microsoft/ffi-testing

>- Test changes to the TAV C, WASM, and C# FFI surfaces. Use when exported functions, handles, constants, ownership rules, errors, goldens, or consumer tests change under ffi/.

528 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
9
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/microsoft/TEE-Attestation-Verification --skill ffi-testing

The instruction itself

4 sections, as written by the author

FFI testing

Treat each consumer suite as an external user of its public surface.

Required coverage

  • Enumerate the complete changed public surface from its authoritative source:
  • C: ffi/include/tav/*.h
  • WASM: exported items in ffi/src/wasm_ffi
  • C#: public types and members under ffi/csharp/TeeAttestationVerification
  • Exercise every matching function, property, enum member, and ownership

operation in the corresponding consumer suite.

  • Assert behavior with known values or negative cases; successful invocation

alone is insufficient.

  • Test owned handles, borrowed byte views, null/error behavior, and

out-parameter reset rules where applicable.

  • Update goldens only alongside behavioral tests.

ABI constants

When constants change:

  • Keep explicit test mappings between compiled Rust constants and their C

names. Compare values and exact name sets in both directions.

  • For constants exposed in C#, keep explicit C-name-to-managed-name mappings.

Parse the public C header and compare values and exact member sets with the

reflected managed enum.

  • Reject missing, extra, duplicate, or mismatched members. Do not update only

one side to make a test pass.

  • Use named Rust constants in runtime logic and tests; do not repeat numeric

literals in match arms and equivalence tests.

  • Keep function signatures, handle ownership, and boolean/layout checks outside

constant-equivalence tests.

Validation

Use half-machine concurrency for builds.

  • Native Rust: both crypto_openssl and crypto_pure_rust
  • C consumer: shared and static, both native backends
  • WASM consumer: crypto_webcrypto and crypto_pure_rust
  • C#: python3 ffi/csharp/run_tests.py --configuration Release
  • Repository: formatting, version sync, license headers, and git diff --check

How to use it

Copy the folder

Take microsoft/ffi-testing from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.