name: dfly-code-review description: Review DragonFly BSD changes for OS-level correctness, safety, and style. allowed-tools: Read, Grep, Glob, Bash disable-model-invocation: false user-invocable: true
What this does
Provide a structured code review for DragonFly BSD changes, focused on OS-level correctness, safety, and consistency with project conventions.
When to use
- Reviewing diffs before submitting or merging changes.
- Assessing risk and correctness in kernel or userland code.
- Validating Makefile or build-related edits.
How to invoke
Use during code review tasks, or invoke directly:
/dfly-code-review
Workflow
- Inspect the diff (
git diff,git show) and summarize scope. - Read surrounding code and relevant headers or Makefiles.
- Evaluate against the OS review checklist below.
- Report findings grouped by severity with file references.
- Suggest concrete fixes or follow-ups.
OS review checklist
- Correctness: error handling, return codes, and cleanup paths.
- Concurrency: locking, SMP safety, ordering, and races.
- Memory safety: bounds, lifetimes, ownership, and leaks.
- ABI/API stability: headers, exported symbols, struct changes.
- Build system: Makefiles, includes, conditional compilation.
- Portability: arch guards, endian assumptions, compiler warnings.
- Security: privilege boundaries, input validation, unsafe defaults.
DragonFly-specific checks
C and C++ style
- For C changes, follow
style(9). - Avoid unnecessary reformatting; keep diffs focused on functional changes.
Makefiles and build plumbing
- Treat changes under
share/mk/as high-impact. Avoid modifying system BSD makefiles without strong justification. - Watch for unintended build behavior changes: include ordering, conditionals, install targets, and toolchain assumptions.
- Prefer
make -n(dry-run) to sanity-check modified targets when relevant.
Git workflow assumptions
- Assume work is done on a branch (not directly on
master). - Before review sign-off, prefer diffs that are rebased on an up-to-date
masterto reduce noise.
Vendor imports (contrib)
- If changes touch
contrib/, confirm whether this is a vendor import. - Do not modify vendor sources before importing them on the vendor branch.
- Strip unnecessary sources (especially unused test suites) when appropriate.
- After import, ensure
README.DRAGONFLYandREADME.DELETEDare added; the latter is typically generated bytools/tools/genreadmedeleted/genreadmedeleted.
Style guide
Follow DragonFly BSD style guidance: https://man.dragonflybsd.org/?command=style§ion=ANY
Allowed commands
Read-only commands only, such as:
git statusgit diffgit showgit loggit blamerggrepmake -n