AI Coding Assistants

This document provides guidance for AI tools and developers using AI assistance when contributing to the Linux kernel.

AI tools helping with Linux kernel development should follow the standard kernel development process:

For guidelines on content generated by AI coding assistants see:

Agent resources

Skills for coding assistants live under agents/skills/, one directory per skill with a SKILL.md entry point in the Agent Skills format. Each skill points at the process documents that apply to its task and adds only what assistants tend to get wrong.

Unless a skill’s task is to write or modify code or tests, skills only inspect and report: they do not change files, create commits or tags, or send mail. A skill returns its result with the evidence for it, or says what is missing. Do not fill a missing result with a guess or a placeholder, and do not finalize the work until it is resolved.

The following skills are available:

  • agents/skills/find-fixes/SKILL.md determines the Fixes tag of a bug fix, or checks an existing one.

  • agents/skills/stable-tag/SKILL.md decides whether a fix goes to stable and returns its stable tag, or checks an existing one.

  • agents/skills/find-siblings/SKILL.md looks for the same bug elsewhere in the tree.

  • agents/skills/commit-message/SKILL.md writes, rewrites or reviews a commit message or cover letter, and writes the text of a pull request.

  • agents/skills/writing-kunit-tests/SKILL.md designs, writes, verifies, or reviews KUnit unit tests.

Signed-off-by and Developer Certificate of Origin

AI agents MUST NOT add Signed-off-by tags. Only humans can legally certify the Developer Certificate of Origin (DCO). The human submitter is responsible for:

  • Reviewing all AI-generated code

  • Ensuring compliance with licensing requirements

  • Adding their own Signed-off-by tag to certify the DCO

  • Taking full responsibility for the contribution

Procedure for finding and fixing bugs

When an AI assistant is used to find and fix bugs, it MUST follow at least these steps:

  1. Before starting, read the whole process documentation listed above, as well as any other document mentioned in the request. Do not rely on isolated parts found by keyword search.

  2. Note the commit ID and Locate a bug as instructed.

  3. For any bug found that is not trivial, verify that it looks real by attempting to create a reproducer to demonstrate it. Lacking it may cause the report to be ignored, as many unverified bug reports sent to maintainers happen to be invalid. Stop here if it finally looks wrong.

  4. Write a fix for the bug. This part is not optional: except in a few very rare cases, an AI assistant able to find a bug is able to fix it. Note that fixes written in the same session as used to find the bug will generally lead to better and more accurate fixes as the LLM’s reasoning context remains present.

  5. Build and verify that the fix works either using the reproducer or by re-running a complete analysis; drop any fix that doesn’t work and try another one. The fix must not add build warnings and must pass the checkpatch.pl checks (see Submitting patches: the essential guide to getting your code into the kernel). Then look for the same bug elsewhere with the find-siblings skill.

  6. Commit the working fix with a message written with the commit-message skill, describing the problem, the solution, a Fixes tag determined with the find-fixes skill, and a stable tag if the stable-tag skill calls for one. Do not add a Signed-off-by tag.

  7. Identify the maintainers and lists using scripts/get_maintainer.pl. Security bugs shows how to do that.

  8. Indicate what could not be done. If the fix could not be built or tested, or if no reproducer could be produced, say so explicitly: maintainers currently waste too much time analyzing unverified reports and untested fixes.

  9. Read The Linux Kernel threat model to determine whether the bug is a vulnerability or a regular bug, and leave the result to the reporter for review (the assistant must never send anything itself). Regular bugs are submitted as described in Submitting patches: the essential guide to getting your code into the kernel, vulnerabilities as described in Security bugs.