Zephyr Patch Review
Audit workflow
For every non-trivial task that writes to the workspace, choose a stable task
slug and keep agent-only records under:
.zephyr-skills/<agent-task>/
├── audit.md # Baseline, decisions, evidence, verification, and gaps
├── commands.md # Redacted commands, working directories, and results
├── scripts/ # Intermediate debug documents, scripts, and harnesses
├── output/ # Non-Zephyr dependencies and temporary binaries
└── logs/ # Decisive build, test, runtime, or diagnostic logs
Put every generated intermediate debugging document, debug script, and
scaffolding or harness script, including Bash and Python scripts, under
scripts/, never in a build directory. Put non-Zephyr third-party source or
libraries acquired solely for the agent's task, and temporary binaries produced
by agent-only probes or tools, under output/. Do not copy normal Zephyr build
artifacts there. Keep other agent plans and temporary evidence in the same task
directory. In a Git worktree, add
/.zephyr-skills/ to the repository-local exclude file returned by
git rev-parse --git-path info/exclude before writing audit artifacts. Preserve
existing entries, avoid duplicates, and verify before handoff that
git status --short contains no .zephyr-skills/ paths. Keep Zephyr-native
build trees, binaries, and test outputs separate: honor a user-specified path,
otherwise use defaults such as configured build.dir-fmt, build/, or
twister-out/. Record the effective paths, do not stage .zephyr-skills/
unless requested, and report the task directory and unresolved gaps at handoff.
Review
- Bound the review to an explicit base and intended behavior; separate
unrelated changes before judging the patch.
- Inspect correctness and semantic integration, including ownership, lifetime,
locking, error paths, generated artifacts, and 32/64-bit assumptions.
- Check the affected Kconfig, CMake, devicetree, architecture, board, SoC,
toolchain, documentation, and API-lifecycle boundaries.
- Verify that targeted tests and logs support each behavior claim and state the
remaining coverage gaps.
- Check patch order, reviewer-sized separation, bisectability, and applicable
SPDX and license conventions for new files.
Ownership and precedent
- Use
MAINTAINERS.yml for affected areas, reviewers, labels, and tests;
CODEOWNERS is not authoritative in this tree.
- Consult local history for unfamiliar APIs, regressions, or subsystem boundary
changes. Prefer
git log --follow, git log -S, git blame, and git show.
- Query the current Gerrit change and patch-set state, or an upstream pull
request when explicitly in scope, only for merge readiness. Read current
submit, approval, and blocker policy instead of hard-coding it.
- Treat unavailable history as a gap, not evidence of a defect.
Findings
- Report only actionable, source-backed findings, with file and line references
when available.
- Explain the failure mode, impact, and any missing or inadequate verification.
- If there are no findings, say so and list residual verification gaps.
1---2name: zephyr-patch-review3description: Use when reviewing Zephyr diffs or patch stacks for correctness, integration, coverage, reviewer boundaries, or merge readiness.4---56# Zephyr Patch Review78## Audit workflow910For every non-trivial task that writes to the workspace, choose a stable task11slug and keep agent-only records under:1213```text14.zephyr-skills/<agent-task>/15├── audit.md # Baseline, decisions, evidence, verification, and gaps16├── commands.md # Redacted commands, working directories, and results17├── scripts/ # Intermediate debug documents, scripts, and harnesses18├── output/ # Non-Zephyr dependencies and temporary binaries19└── logs/ # Decisive build, test, runtime, or diagnostic logs20```2122Put every generated intermediate debugging document, debug script, and23scaffolding or harness script, including Bash and Python scripts, under24`scripts/`, never in a build directory. Put non-Zephyr third-party source or25libraries acquired solely for the agent's task, and temporary binaries produced26by agent-only probes or tools, under `output/`. Do not copy normal Zephyr build27artifacts there. Keep other agent plans and temporary evidence in the same task28directory. In a Git worktree, add29`/.zephyr-skills/` to the repository-local exclude file returned by30`git rev-parse --git-path info/exclude` before writing audit artifacts. Preserve31existing entries, avoid duplicates, and verify before handoff that32`git status --short` contains no `.zephyr-skills/` paths. Keep Zephyr-native33build trees, binaries, and test outputs separate: honor a user-specified path,34otherwise use defaults such as configured `build.dir-fmt`, `build/`, or35`twister-out/`. Record the effective paths, do not stage `.zephyr-skills/`36unless requested, and report the task directory and unresolved gaps at handoff.3738## Review39401. Bound the review to an explicit base and intended behavior; separate41 unrelated changes before judging the patch.422. Inspect correctness and semantic integration, including ownership, lifetime,43 locking, error paths, generated artifacts, and 32/64-bit assumptions.443. Check the affected Kconfig, CMake, devicetree, architecture, board, SoC,45 toolchain, documentation, and API-lifecycle boundaries.464. Verify that targeted tests and logs support each behavior claim and state the47 remaining coverage gaps.485. Check patch order, reviewer-sized separation, bisectability, and applicable49 SPDX and license conventions for new files.5051## Ownership and precedent5253- Use `MAINTAINERS.yml` for affected areas, reviewers, labels, and tests;54 `CODEOWNERS` is not authoritative in this tree.55- Consult local history for unfamiliar APIs, regressions, or subsystem boundary56 changes. Prefer `git log --follow`, `git log -S`, `git blame`, and `git show`.57- Query the current Gerrit change and patch-set state, or an upstream pull58 request when explicitly in scope, only for merge readiness. Read current59 submit, approval, and blocker policy instead of hard-coding it.60- Treat unavailable history as a gap, not evidence of a defect.6162## Findings6364- Report only actionable, source-backed findings, with file and line references65 when available.66- Explain the failure mode, impact, and any missing or inadequate verification.67- If there are no findings, say so and list residual verification gaps.