Index of every page on this site: llms.txt
All skills
openclaw avatar

/autoreview

@0a5ba4b
by openclawopenclaw/agent-skills1.1k stars
126
Run it yourself

Structured code review when explicitly requested, preferring OpenAI/Codex before Claude.

Use this Skill: https://skilld.dev/gh/openclaw/agent-skills/autoreview

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesgit-and-context.md

≈3.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Git collection and context

Git collection

  • Registered nested linked checkouts from same repository: outside current review scope; presence/edits do not make parent dirty. Ordinary adjacent files stay included.

  • Revalidate worktree boundaries without changing Git ignore rules.

  • Regular tracked RFC source companions may use a credential-named RFC directory: specs/rfcs/NNNN-lowercase-slug/ or docs/rfcs/NNNN-lowercase-slug/, with immediate README.md, index.md, contracts.md, design.md, or security.md. This is a path convention, not content scanning. Other sensitive title words, nested storage, unknown Markdown names and credential data remain subject to the existing guards. The same convention admits frozen committed source-context blobs, with normal topology, identity and mutation checks. Untracked files and general evidence retain their stricter credential-directory rules.

  • Local status columns come from the captured base → index and index → working-tree diff queues, not a separate HEAD-relative status. Paths are JSON strings; renames appear as add/delete transitions, matching the no-renames patches.

  • Git display settings cannot suppress context markers or add patch colors; repository configuration unchanged. Source paths/text retain literal whitespace.

  • Empty present source: line 1, column 1, empty excerpt. Empty physical lines: empty excerpt at column 1. Source identity mandatory.

  • Binary deletions stay in scope as Git deletion metadata; former contents neither included nor reviewed. Check each local transition independently: deleting working-tree file cannot hide staged binary change.

  • Finding locations may use native absolute paths resolving inside reviewed repository; convert to repository-relative before scope/attribution checks. Preserve changed symlink's path when target also inside.

  • Parent traversal/paths resolving outside repository: invalid. Invalid location fails report; never silently drop findings.

  • Local selection honors external operator Git core.autocrlf; repository-local values/attributes keep precedence. Only validated scalar value reaches diff/status; other global/system Git configuration stays disabled.

  • Never import repository-owned/relative global-config overrides or rewrite reviewed source bytes.

  • Local collection disables effective Git clean/process commands; conversion must succeed. Unused drivers, unchanged filtered neighbors, staged-only changes, deletions: reviewable without executing converters.

  • Git needs executable conversion to assemble diff: fail collection before reviewer starts. Can include unchanged filtered file whose stat cache needs refreshing. Use explicit branch/commit mode for committed content then.

  • Built-in line-ending normalization stays enabled; raw bytes never substitute for required executable conversion.

  • PR-base discovery: trusted external Git + scoped GitHub CLI environment; preserve external authentication/configuration + proxy settings; exclude inherited Git routing, GH_REPO redirection, checkout-owned executables.

  • Differently named AUTOREVIEW_GIT override child cannot also select as git: explicit --base required. Rejected GitHub configuration paths: same requirement.

Submodule pins

Gitlink changes (mode 160000) include full old/new commit IDs and the path's URLs from the corresponding .gitmodules states. Branch/commit mode reads frozen blobs; local mode reads base, index and working-tree mappings independently. Local Git config, URL rewrites, includes and submodule update commands are not used. Missing mappings are explicit null values; ambiguous mappings fail preparation.

This reviews the superproject pin and integration, not the upstream code. No network fetch or submodule checkout runs. To review upstream changes, explicitly fetch the range in a separate checkout and supply relevant evidence with --dataset; that context does not expand finding scope beyond the superproject. Uncommitted submodule contents and mixed staged/unstaged gitlink changes remain unsupported; use committed branch/commit mode for pin reviews. Other source, authentication, sandbox and mutation checks remain enabled.

Committed source context

  • Basic context flags/safety rules: SKILL.md.

  • Repeated paths in same evidence role share one validated capture. Equal content at different paths and prompt-file versus dataset roles stay distinct.

  • Unchanged committed source: repeatable --source-context <repo-relative-path> with branch/commit mode. Source must stay intact every review pass: --source-context-file <repo-relative-path>.

  • Both read exact regular-file blob from frozen reviewed commit (branch HEAD or --commit), including executable source files.

  • Local mode, including auto-selected local target: unsupported. No separate context revision or working-copy substitution accepted.

  • Checkout path must stay regular file; revalidate bytes/path topology throughout review.

  • Repeated normalized source-context paths share one capture after validating every argument; different paths/evidence roles stay distinct.

  • Both roles: tracked-source filename classification; source names such as src/token_count.py accepted. Source files in compound-named directories such as credential-proxy use the same tracked source/store classification, without requiring content pins. Literal credential directories, stores and keyfiles remain restricted. Regular-file Markdown documents directly under docs/flows/credential-source-egress/, docs/reference/repository-credentials/, docs/reference/credential-sources/ or specs/rfcs/0023-egress-proxy-credential-lifecycle/ use ordinary tracked-source rules. These named directories hold behavior docs or proposals, not credential storage. Sensitive basenames, nested directories, other file types and private roots retain their restrictions. This also keeps these documents in tracked change bundles. Both changed sides must be regular files or absent; symlinks, gitlinks and type changes involving them remain restricted. Untracked, prompt-file and dataset rules remain unchanged. A shared-policy maintainer can pin a naming false positive after reviewing the full committed file for disclosure. Each installed pin matches the repository-relative path, Git blob ID, Git mode 100644, and content SHA-256. Pins can cover otherwise restricted source or chart-template names. Private roots, literal credential directories such as credentials/ and secrets/, and credential stores remain restricted. The sole literal-directory exception is the inspected apps/controller/src/drivers/secret/kubernetes/index.ts source, which must also match its installed blob, mode and SHA-256 pin. Neighboring files and other versions remain refused. Both source-context flags and batch-manifest contexts use this check. Only the installed policy can supply pins. A pin stops matching after a move, edit, or mode change. Pins authorize context delivery only. Changed-file, prompt-file, and dataset rules still apply.

  • Every source block: path, commit, blob, mode provenance.

  • --source-context bytes: partition with change when needed.

  • --source-context-file blocks: complete every pass; must fit with instructions

    • change framing. Over-capacity plan: refuse, never drop required evidence.
  • Context never adds finding targets/instruction authority. Contract: source-provenance, not secret-content scanning.

"$AUTOREVIEW" --mode branch --base origin/main --source-context src/token_count.py
"$AUTOREVIEW" --mode branch --base origin/main --source-context-file src/token_count.py

Runtime diagnostics

  • Before repository detection/target selection: Git must pass --version within 10 seconds. Failure: exit 2, incomplete diagnostic + resolved executable (or unresolved selection); never scoped-clean.
  • Executable discovery skips inaccessible search candidates; inaccessible explicit executable override still fails preflight.
  • Set AUTOREVIEW_GIT to trusted external Git executable: override every helper-owned Git invocation.
  • macOS, broken selected Xcode: use DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer for invocation.
  • Git sanitized environment additionally retains only absolute, external DEVELOPER_DIR; neither override forwarded to isolated reviewer environment.

Partition planning

  • Text review files: no size/count cap; never truncate. Image inputs: image safety limits. Partition large diffs/datasets automatically.
  • Change partitions retain complete datasets when they fit with sufficient change space. Preference may cost more passes/prompt bytes than evidence batching; explicit pass budget still applies.
  • Terminal fallbacks preserve feasible complete-evidence plan when batch framing cannot fit.
  • Intact instructions, source-context files, required mixed source context must fit per-pass prompt budget. Failed pass never produces partial clean verdict.
  • --max-prompt-bytes N selects that UTF-8 byte budget for dry-run and live review (default 512000). The plan reports its limit and largest rendered prompt. A larger explicit budget admits more complete context only when it fits; it does not change engine/model context limits or guarantee token capacity.
  • Otherwise compare bounded evidence allocations; keep existing plan unless total prompt bytes improve without more passes, or equal bytes need fewer passes.
  • By default, every change is reviewed against every evidence batch.

Explicit branch allocations

--review-batches <repo-relative-json> is an opt-in alternative to the default cross-product planner. It allocates one frozen complete branch capture, never independent path-filtered Git reviews. Version 1 accepts text additions, changes, deletions and executable-mode changes. It refuses local/commit mode, sensitive omissions, images, binary changes/deletions, symlinks and gitlinks. Use the ordinary route for unsupported forms; do not remove them to obtain a clean allocation.

First run the ordinary branch --dry-run to obtain bundle identity (resolved merge-base, HEAD, SHA-256 of the exact captured bundle). Keep the same --base argument: its label is part of those bytes. Declare each source context's exact HEAD blob and mode from Git. Store the operator manifest in an ignored directory inside the reviewed repository, so a preflight export can still require a clean branch. The helper rejects symlinked/unsafe inputs and revalidates manifest bytes and path identity before every send and before publishing the aggregate.

{
  "version": 1,
  "base": "<full resolved merge-base OID>",
  "head": "<full reviewed HEAD OID>",
  "bundle_sha256": "<dry-run bundle SHA-256>",
  "contexts": [
    {"path": "src/owner.py", "blob": "<HEAD blob OID>", "mode": "100644"}
  ],
  "batches": [
    {
      "name": "owner-and-caller",
      "kind": "integration",
      "changes": ["src/owner.py", "src/caller.py"],
      "contexts": ["src/owner.py"],
      "obligations": ["Verify the caller consumes the owner's settled result before publication."]
    }
  ]
}
  • Exact fields and canonical paths only; no globs, commands, duplicate keys or relevance inference. Every changed path in the original range and every declared context must occur in an assignment. Repeating a changed unit or context across assignments is allowed for integration; repetition cannot hide an omission.
  • Each assignment has a unique name, kind owner or integration, nonempty changed units, and explicit obligations. More than one assignment requires an integration assignment. The operator must supply its actual caller/callee contracts; naming it integration does not prove the chosen context sufficient.
  • Units retain complete original patch headers/bytes and Git-owned before/after modes/OIDs. The helper checks exact reconstruction and records byte offsets, digests, manifest identity, assigned contexts and rendered prompt identities. Whole source blobs retain commit/blob/mode provenance and existing source checks.
  • Each assignment is one intact pass. All assignments must fit the existing --max-prompt-bytes and --max-review-passes limits before any reviewer starts. The helper does not split required contracts or automatically raise a limit.
  • --source-context-file and prompt instructions remain whole in every pass. --source-context and --dataset cannot combine with this mode; declare the complete source inventory in the manifest instead. Without this flag, existing context flags and cross-product planning are unchanged.
  • Finding scope is the assignment's changed units. Out-of-assignment findings remain visible as scope-rejected and make the aggregate incomplete. An accepted integration finding remains actionable in the merged report. Every assignment independently returns complete/incomplete; missing contracts, invalid/failed reports, filtered findings and changed inputs cannot produce aggregate clean.
  • Dry and live planning use the same capture/allocation/rendering path. JSON output retains review_allocation and per-assignment outcomes. Native preflight export retains its clean committed full-range requirement and projects aggregate completion/status, never an individual assignment's success.

This mode changes evidence placement, not authority, review status, model, transport, sandbox, timeouts or publication gates. A successful fit only admits the review; the reviewers still decide whether the supplied evidence is sufficient.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alerttoday3 checks · Risk SAFE
  • Gen Agent Trust Hubtoday

    The autoreview skill is a specialized tool for performing automated code reviews using AI engines. It includes extensive testing fixtures and documentation focused on security, specifically addressing process isolation, environment sanitization, and the detection of credentials and vulnerabilities in code. All potentially suspicious patterns, such as dynamic code execution and hardcoded fake secrets, are confined to the test suite and are used to validate the tool's robustness and security boundaries.

  • Socket3d

    1 alert: gptSecurity

  • Snyktoday

    Risk: CRITICAL · 3 issues

Signed by skilld at 0a5ba4b. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 weeks ago

README badge

README badge for openclaw/agent-skills/autoreview