mcpbeat Sign in

Cws Iouring Coverage Agent Skill

Audit CWS (runtime-security) io_uring functional-test coverage and add a functional test for any io_uring opcode whose operation CWS observes but that is not exercised through io_uring. Test-driven — coverage is judged by tests, never by reading eBPF/hook internals. Use when auditing io_uring test coverage or after new IORING_OP_ opcodes appear.

1k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
3695
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/DataDog/datadog-agent --skill cws-iouring-coverage

What it tells the agent to use

found in the instruction text
WebFetch fetches pages from the network

The instruction itself

6 sections, as written by the author

CWS io_uring test coverage audit

For every io_uring operation CWS observes, there must be a functional test that issues the

operation *through io_uring* and asserts the event fires. This skill finds the gaps and fills

them.

Principle: tests are the only arbiter

Coverage is decided by tests, nothing else. Do not read eBPF programs or C hooks (anything

under pkg/security/ebpf/) to judge coverage — implementation is out of scope and misleads.

The only question is: *does an io_uring test exist for this operation, and does it pass?*

The one io_uring-specific fact (it's a test assertion, not implementation): io_uring completes

asynchronously, so every io_uring test must assert event.async == true.

The audit: build three lists, then intersect

List A — io_uring opcodes. WebFetch https://man7.org/linux/man-pages/man2/io_uring_enter.2.html

and list every IORING_OP_* with the syscall it performs (e.g. IORING_OP_SOCKETsocket(2)).

Offline fallback: the iouring-go fork is replaced in go.mod — import path stays

github.com/iceber/iouring-go, but source on disk is under

$(go env GOMODCACHE)/github.com/lebauce/iouring-go@*/syscall/types.go.

List B — tested syscalls. Read pkg/security/tests/. A syscall is *tested* when a test

issues it as the triggering action (inside the func() error {…} passed to

WaitSignal/runSyscallTester) and asserts an event — not when it only appears as setup.

Build the list from test bodies, not event names: the asserted event may be named differently.

List C — tested io_uring opcodes. grep -rn 'iouring\.\|io_uring' pkg/security/tests/*.go.

Mostly t.Run("io_uring", …) subtests plus a few standalone funcs.

Conclude, per opcode in A:

  • syscall ∉ B → out of scope (CWS doesn't observe it; no io_uring test expected).
  • syscall ∈ B → in scope; then opcode ∈ C → tested, else → gap.

Write a test for every gap.

Writing the io_uring test

Model on an existing subtest (open_test.got.Run("io_uring", …)). For each gap:

  • Rule scope. The test process is testsuite. Many rules are scoped to

process.file.name == "syscall_tester"; reuse the parent rule only if it already admits

testsuite (e.g. in [ "syscall_tester", "testsuite" ]), otherwise add a new rule scoped to

process.file.name == "testsuite". Check the parent's ruleDefs first.

  • Submit. iour, err := iouring.New(1); submit the op; read the result; in the validation

callback assert event type, key fields, and event.async == true.

  • Kernel gate, not errno skip. Gate "kernel too old for this opcode" deterministically at

the top of the subtest:

checkKernelCompatibility(t, "io_uring <op> needs Linux X.Y", func(kv *kernel.Version) bool { return kv.Code < kernel.VersionCode(X, Y, 0) }).

Don't skip on a negative errno — a malformed raw SQE returns one too, so skipping would hide

the gap behind a green test. On a supported kernel, treat an unexpected negative result as a

failure (return fmt.Errorf(...)). (A library prep helper can't be malformed, so an

errno skip there is harmless.)

  • ebpfless. Only matters if the parent test is in the available list (~-prefixed

entries) in pkg/security/tests/main_linux.go — those prefix-match subtests and pull yours

into the ebpfless run, where io_uring is unsupported. If so, add an exclude entry. The

match is exact on the full t.Name(), so prefer a flat sibling name

(TestOpen/io_uring_ftruncate, not a nested TestOpen/io_uring/ftruncate).

No prep helper in the fork? The fork wraps only a subset. For other opcodes build a raw SQE

with a custom iouring.PrepRequest using the helpers in pkg/security/tests/iouring_test.go

(extend them as needed). This is the one place you may touch an opcode's low-level shape.

Verify

  • gofmt -l <your files> (no output = OK).
  • Run the test via the harness:

dda inv security-agent.functional-tests --skip-linters --testflags="-test.run <YourTest>".

Green = covered, red = the gap is real.

Report

Report the per-opcode classification (out of scope / tested / gap) and the test files

added or changed.

Other skills for the same job

different authors, same section of the catalogue
Webapp Testing
by anthropics
vendor ×12

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

6k tokens scripts
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
Test Driven Development
by w95
×7

Use when implementing any feature or bugfix, before writing implementation code

2k tokens
Systematic Debugging
by ratacat
×7

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes

10k tokens scripts
Verification Before Completion
by ZhanlinCui
×6

Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always

1k tokens
Backtest Expert
by BaggaT236
×3

Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.

15k tokens scripts
Adaptyv
by christophacham
×3

Cloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.

16k tokens
Aeon
by christophacham
×3

This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.

19k tokens

How to use it

Copy the folder

Take datadog/cws-iouring-coverage 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.