agentleFS
gvagogvago/unofficial-qodo-review-skills/skills/kernel-execution-flow/SKILL.md

kernel-execution-flow

Skill2 starsChanged 2 months agoApache-2.0View on GitHub

Use when a Linux kernel PR diff changes C/Rust control flow, traces execution statically (Sashiko stage 3): broken error paths, NULL derefs, uninitialized or stale values, off-by-one loop logic, preprocessor/linkage hazards in the CHANGED code only. Part of the linux-kernel-review suite.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

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

    Never make assumptions from return types, comments, WARN_ON/BUG_ON, or error-handling patterns, verify by tracing concrete execution paths.

    line 23

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

kernel-execution-flow

Lens for control-flow and logic verification (Sashiko stage 3). Acts as a static analysis engine tracing C (or Rust) execution flow through the diff.

How to apply

  • Trace every branch, switch, loop, and goto in the changed code.
  • Explore every error handling path (goto cleanup;) and prove it behaves correctly under failure.
  • Never make assumptions from return types, comments, WARN_ON/BUG_ON, or error-handling patterns, verify by tracing concrete execution paths. Full tracing discipline: references/technical-patterns.md.
  • For deadlock/infinite-wait/crash candidates, prove the path is structurally possible, not that it fires every run. Method: references/callstack.md.

Rule index

  • F1. Logic errors: incorrect loop conditions, inverted tests, off-by-one in bounds, wrong operator precedence.
  • F2. Unhandled error paths and missing return-value checks. Checking returns of allocation, init, locking, and resource-management calls is a mandatory kernel API contract, not defensive programming. Exceptions: __init/early-boot code, debugfs APIs, teardown paths, explicit (void) casts with sound justification.
  • F3. NULL pointer dereference. Reading a pointer field is not a dereference; only accessing its contents is. Prove the NULL can reach the access.
  • F4. Preprocessor and linkage correctness: CONFIG_ prefix misspellings (e.g. HAVE_ where CONFIG_ was intended), #ifdef branch divergence, static/inline or section placement that breaks linking or loses symbols under LTO.

Mapping a finding to the contract

  • action_level: action_required for a proven logic error or mandatory unchecked return on a real path; remediation_recommended when the failure path is real but consequence is contained.
  • category: Correctness.
  • evidence: the traced path, caller, condition values, and the line where behavior diverges from intent.

What NOT to flag

  • Errors impossible in the call path found (e.g. guarded by IS_ENABLED upstream). Prove reachability before reporting.
  • Defensive bounds checks without a proven untrusted source.
  • likely()/unlikely() hint changes with no logic impact.

References (load only when needed)

  • references/technical-patterns.md, core kernel tracing rules, context rules, error-handling notes, RCU mandatory check.
  • references/callstack.md, blocking/waiting bug analysis protocol.

Sourcing

Stage text adapted from Sashiko (Apache-2.0). References reproduced from masoncl/review-prompts (MIT).

Download now (ZIP)

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.