/kernel-development-skills:kernel-development-skillsfrom Kernel Field Guide
Provides Linux kernel engineering workflows for writing, debugging, reviewing, and upstreaming code across mainline, stable, LTS, Android, and vendor BSP trees.
Ships in Kernel Field Guide. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
How experienced kernel engineers change, debug, and upstream Linux kernel code,
in mainline and in the stable, LTS, and vendor trees people actually ship.
Explicit user instructions and the target repository's own rules (AGENTS.md,
README, MAINTAINERS, subsystem maintainer-*.rst profiles) take precedence
over this skill.
git log -p,
git blame, and the lore thread behind the last change). Most problems have
been argued about on a list before, and the answer is often in a commit
message.make kernelversion, git describe, and the branch it
tracks. References mark newer APIs with "since vX.Y"; confirm a symbol with
git grep in the target tree before using it, because stable branches
backport some new names and vendor trees carry their own.git status --short. Leave pre-existing uncommitted changes alone.scripts/get_maintainer.pl -f <file>, and git log --oneline -10 -- <file>
for the subject prefix the maintainer actually applies.python3 <skill-dir>/scripts/triage_kernel_change.py [paths...] for the
checks that apply to the touched paths. <skill-dir> is the directory this
file is in. The kernel tree has a scripts/ of its own, so a bare
scripts/... path typed at the kernel root finds the wrong one.Open a reference only when its row below matches the task in front of you.
Most tasks need one or two; do not read the whole references/ directory up
front, and do not reread a reference already loaded in this session.
Independent reads (MAINTAINERS entry, binding, driver, DTS, Kconfig) can be
done together in one step.
| Read | When |
|---|---|
references/tree.md | Working out which tree you are in and what its rules are (linux-next, a subsystem tree, stable/LTS, Android GKI, a vendor BSP), choosing a base, or finding the build wrapper |
references/downstream.md | Shipping from a product, vendor, or distro tree: an out-of-tree module, getting a build onto a device, a kernel built by Yocto, Buildroot, OpenWrt, or Kleaf, carrying or rebasing a patch stack, a frozen module ABI, or upstreaming a vendor driver |
references/archaeology.md | You need to know why code is the way it is, who owns it, or how other drivers solved the same problem |
references/build.md | Configuring, building, cross-compiling, booting a test kernel quickly, or checking that every commit in a series builds |
references/drivers.md | Writing or substantially changing driver code |
references/devicetree.md | Writing a binding, editing DTS, DTSI, or overlays, or fixing dt_binding_check and dtbs_check |
references/debugging.md | Any failure: oops, warning splat, no probe, hang, corruption, race, early-boot death, suspend/resume, latency, or "it worked before" |
references/testing.md | Writing or running KUnit or kselftest, fault injection, fuzzing, or deciding what evidence proves a change |
references/review.md | Reviewing a patch, your own before sending or someone else's |
references/patches.md | Commit messages and tags, AI disclosure, preparing and sending a series, or answering review |
references/regressions.md | Acting on a regression report or a bot (syzbot, kernel test robot, KernelCI), or on flaky CI |
references/stable.md | Fixes headed for stable or LTS, backports, vendor tree intake, security bugs and CVEs |
Find documentation in the tree itself with git grep -ln '<term>' Documentation/;
<skill-dir>/scripts/index_kernel_docs.py builds a map of a tree's docs when
you need one.
Signed-off-by:. Only a human can certify the Developer's
Certificate of Origin, so the human submitter adds it after review.Assisted-by: trailer in v7.4 and its checkpatch now flags it;
only trees at v7.0 to v7.3 still document one. For upstream work, say in the
cover letter, or in a note below a single patch's --- line, which tools
were used, what they produced, and how the result was tested
(Documentation/process/generated-content.rst).--- line into a commit message: git commit -s adds the
sign-off after it, and git am drops everything from the first --- on.
Notes for below that line go in with git notes add and come out with
git format-patch --notes.Reviewed-by:, Tested-by:, or Acked-by: only when that person gave
it explicitly; inventing one misrepresents review. Reported-by: is followed
by Closes: (or Link: for a partial fix) pointing at a public URL.Fixes: takes at least 12 hex digits and the original subject:
git log -1 --abbrev=12 --format='Fixes: %h ("%s")' <sha>.make <vendor>/<board>.dtb alone runs no schema validation. Use
make CHECK_DTBS=y <vendor>/<board>.dtb, and
make dt_binding_check DT_SCHEMA_FILES=<binding> for the binding.timer_delete() exists since v6.2 and
del_timer() was removed in v6.15, platform .remove returns void since
v6.11, strncpy() was removed in v7.2, and kzalloc_obj() (since v7.0) and
devm_kzalloc_obj() (since v7.4) replace the sizeof forms. Check the
target tree with git grep instead of inferring from the version number..dts/.dtsi, not the SoC .dtsi,
because every board using that SoC inherits SoC-file edits.build.sh, Android Kleaf, Yocto,
Buildroot), build and configure through it; it sets the toolchain, config
fragments, and output directory that plain make misses.cat /proc/version shows the build, and
dtc -I fs -O dts /proc/device-tree the devicetree in use. A stale boot
image or a second DTB source is likelier than a bug in the change. Try the
new image from RAM (fastboot boot, or the bootloader's equivalent) before
flashing again.make -s kernelrelease has to match uname -r
and a directory under /lib/modules/ on the target, or everything built as
a module silently stops loading.#syz commands), rewriting published history, changing a defconfig shared
with other boards, changing ABI, flashing or rebooting a device, or wiping
build state or untracked files (make mrproper, make distclean,
git clean), and wait for an explicit yes.dtbs_check, and ships.| Change | Minimum checks |
|---|---|
| C driver logic | scripts/checkpatch.pl --strict -g HEAD; make W=1 <dir>/<file>.o; make C=1 (sparse); relevant KUnit or kselftest; probe and log evidence at runtime |
| A series | every commit builds: git rebase -x 'make -j"$(nproc)" W=1 <dir>/' <base> |
| Kconfig or defconfig | make olddefconfig (through the wrapper if one exists); scripts/diffconfig on the resolved .config; make savedefconfig for defconfig edits |
| dt-bindings YAML | make dt_binding_check DT_SCHEMA_FILES=<file> |
| DTS or overlay | make CHECK_DTBS=y <vendor>/<board>.dtb; boot, probe, and sysfs evidence on hardware when available |
| Documentation or kernel-doc | make htmldocs, or scripts/kernel-doc -none -Wall <file> |
| uapi or ABI | scripts/check-uapi.sh; an entry under Documentation/ABI/ |
| Stable or regression fix | culprit proven by bisect or revert; Fixes:; Closes: or Link:; decide on Cc: [email protected] |
| Backport | git cherry-pick -x; prerequisites identified; deltas from upstream explained in the commit message |
| Out-of-tree module | built against the target kernel's build directory; modinfo -F vermagic matches uname -r on the target; loads, works, and unloads without a splat |
| Kernel for a device | built through the tree's wrapper; /proc/version on the target shows the new build; modules load; boot log compared with the previous kernel's |
gpio: foo: fix IRQ domain leak on probe failure
The IRQ domain allocated in foo_probe() is not released when
devm_gpiochip_add_data() fails, so a deferred probe leaks it.
Fixes: 1234567890ab ("gpio: foo: add IRQ support")
Reported-by: Jane Doe <[email protected]>
Closes: https://lore.kernel.org/r/<message-id>
Cc: [email protected]
The human submitter adds Signed-off-by: after reviewing the patch. The
disclosure and test note travel beside the commit, not in it:
git config notes.rewriteRef refs/notes/commits # so the note survives the sign-off amend and rebases
git notes add -m 'Fixed with an AI coding assistant, which also drafted the
commit message. Reproduced by failing gpiochip registration with fault
injection: kmemleak reports the leaked domain before the fix, nothing after.'
git format-patch --notes -1 # prints the note below the --- line
Run these; there is no need to read their source. Each supports --help.
They live in <skill-dir>/scripts/, need python3 3.9 or newer with no extra
packages, and make no network calls. The first two only read the tree.
triage_kernel_change.py [--against REV] [paths...]: prints the references
and checks that apply to the changed paths (the git diff plus untracked
files when no paths are given), and names a build wrapper when it finds
one. Exits 0; 2 only on bad arguments.check_kernel_api_patterns.py [--against REV] [--strict] [--json] [paths...]:
advisory scan for deprecated or risky driver APIs; each finding says which
kernel version it applies from. A path may also be a .diff, a
git format-patch .patch, or a b4 .mbx: only the lines it adds are
scanned, reported with post-patch line numbers. Exits 1 on findings with
--strict, 2 on a missing path or bad arguments.index_kernel_docs.py <kernel_root> [--out DIR]: indexes the tree's
Documentation/ into a routes file and a JSONL index under a per-tree cache
directory (or --out), then prints both paths. Query the JSONL with rg or
jq; do not load it whole.agents/openai.yaml (opens in a new tab)references/archaeology.md (opens in a new tab)references/build.md (opens in a new tab)references/debugging.md (opens in a new tab)references/devicetree.md (opens in a new tab)references/downstream.md (opens in a new tab)references/drivers.md (opens in a new tab)references/patches.md (opens in a new tab)references/regressions.md (opens in a new tab)references/review.md (opens in a new tab)references/stable.md (opens in a new tab)references/testing.md (opens in a new tab)references/tree.md (opens in a new tab)scripts/check_kernel_api_patterns.py (opens in a new tab)scripts/index_kernel_docs.py (opens in a new tab)scripts/triage_kernel_change.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub utsavbalar1231/kernel-development-skills --plugin kernel-development-skills