agentleFS
GoogleKnown publishergoogle/gvisor/.agents/skills/gvisor-kernel-development/SKILL.md

gvisor-kernel-development

Skill20k starsChanged 10 days agoApache-2.0View on GitHub

Use when modifying gVisor application kernel behavior: adding a new system call, adding new flags to an existing system call, editing the syscall tests in `//test/syscalls`.

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When modifying or expanding the way the gVisor kernel works, such as when implementing a new system call, adding a new flag to an existing …

    line 9
  2. Distinctive:

    If applicable, come up with a way to quickly test and exercise the relevant kernel functionality by using a shell command or a short Python …

    line 15
  3. Very specific:

    Before you look at any gVisor code, start by establishing a black-box understanding of the current behavior of both Linux and gVisor for …

    line 24
  4. Very specific:

    If asked to modify the behavior of a specific system call, look for existing syscall tests that cover this syscall.

    line 28
  5. Very specific:

    Only after you have done the above, start reading gVisor kernel source code.

    line 32
  6. Distinctive:

    Do not stop at the first file you think is most likely to implement the functionality you want to implement.

    line 33
  7. Very specific:

    If you change or add a syscall test, you should first run it under Linux to make sure that the syscall test works properly under Linux.

    line 81
  8. Very specific:

    Only after a syscall test works under Linux does it make sense to ever run it under gVisor.

    line 90

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

When modifying or expanding the way the gVisor kernel works, such as when implementing a new system call, adding a new flag to an existing system call, or modifying the way an existing system call works, you should generally follow this approach:

  1. Repeat your understanding of this aspect of the Linux kernel functionality.
  2. If applicable, come up with a way to quickly test and exercise the relevant kernel functionality by using a shell command or a short Python script. For example, if asked to change the way the stat(2) system call works on a specific device file like /dev/zero, you can use stat /dev/zero as a representative command for which the output can guide your understanding of the way the kernel works. See the "Running a C program in gVisor" section below for how to run it. Syscall tests are also appropriate and excellent at establishing coverage of all the edge cases a syscall may have; during development, both are useful.
  3. Before you look at any gVisor code, start by establishing a black-box understanding of the current behavior of both Linux and gVisor for the representative command or script you have come up with. Use the tools available at your disposal to verify this.
  4. If asked to modify the behavior of a specific system call, look for existing syscall tests that cover this syscall. Read the syscall test file, and run it under both Linux and gVisor at least once to make sure it is starting from a good state to begin with.
  5. Only after you have done the above, start reading gVisor kernel source code. Do not stop at the first file you think is most likely to implement the functionality you want to implement; look for multiple such files and only settle on a decision once you are confident about your decision.
  6. Make code changes, running your representative command or script or syscall tests as often as necessary.

While Linux man pages are the ABI spec, they are also often wrong or out-of-date, hence gVisor's use of black-box syscall tests to assert Linux behavior.

Running gVisor development workflows

Running a C program in gVisor

During development, to verify more complex syscall behavior in gVisor, it may be useful to write a custom program in C that calls system calls directly, then to compile it, and to run it in Linux and in gVisor.

To do so, generate a dependency-free C program, compile it with gcc, move it to a temporary directory such as /tmp (important: gVisor cannot directly run from special directories such as bazel-bin due to uninteresting permission issues), then use runsc's do helper as follows:

# Recompile and extract to a world-accessible directory:
$ make release-tarball DESTINATION=out/ && mkdir -p /tmp/gvisor && tar -C /tmp/gvisor -xf out/gvisor.tar.bz2

# Run:
$ /tmp/gvisor/runsc --rootless=true --network=none --debug-log=/dev/stderr --strace=true do /absolute/path/to/the/binary

This will run /absolute/path/to/the/binary inside gVisor, with debug logs and the syscall trace (strace) output included. Don't forget to also run it under Linux so that you can compare its behavior.

Running syscall tests

As gVisor is a kernel meant to replicate Linux-like behavior, application-observable kernel behavior is not tested with Go unit tests, and you should not add such tests for it. Go unit tests are only appropriate for self-contained internals with no Linux behavior to compare against. Instead, the gVisor kernel behavior is tested by "syscall tests", which are C++ test binaries which can be run either in Linux and in gVisor. These syscall test binaries call some system calls in the kernel they are run in (either Linux or gVisor), and verify that the system call behaves in the same expected way.

These tests are defined in //test/syscalls/linux as .cc.

If you change or add a syscall test, you should first run it under Linux to make sure that the syscall test works properly under Linux. A syscall test that fails under Linux reflects a problem with the test itself, not a problem in gVisor. If this happens, fix the syscall test C++ program itself. Example:

make syscall-tests TARGETS="//test/syscalls:signalfd_test_native"

Only after a syscall test works under Linux does it make sense to ever run it under gVisor. A syscall test that succeeds under Linux but fails under gVisor reflects a problem in gVisor itself. In this case, iterate on the gVisor kernel code, and keep running the syscall test under gVisor until the syscall test passes. Example to run signalfd.cc in both Linux and gVisor in one shot:

make syscall-tests TARGETS="//test/syscalls:signalfd_test_native //test/syscalls:signalfd_test_runsc_systrap_shared"

Download now (ZIP)

Trending

More talk lately.about the whole repository

Dec 2025: 1 mentionJan 2026: 0 mentionsFeb 2026: 2 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 2 mentionsAug 2026: 2 mentionsSep 2026: 5 mentionsOct 2026: 6 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the google/gvisor repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about google/gvisor

The biggest 5 of 52 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 52

Talked about on GitHub, Stack Overflow, Hacker News and Bluesky (52 times).

On GitHub · 35

30 more on GitHub

On Hacker News · 7

2 more on Hacker News

On Bluesky · 2

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.