English · Chinese
A model-agnostic, evidence-based code-review Skill for your existing agent host. Inspired by How the Claude Code team does code review and everyday review practice. Independent and unofficial; not affiliated with or endorsed by Anthropic.
Humans decide whether a requirement is worthwhile, architecture, acceptable risk and acceptance. Agents perform substantial implementation, checks, investigation, evidence organization and authorized repair/recheck. This project focuses on code review; action permissions and required human decisions remain explicit.
Get the complete repository and open it as your agent's project directory:
git clone https://github.com/zhenkun26/Code-Inspection.git
cd Code-InspectionKeep the complete layout: copying only the discovery entry or a single Skill folder breaks relative references. This repository starts from a sanitized file-only snapshot; private development history, PR discussions and audit records are excluded.
Ask an existing agent host that can read local files:
Read
skills/pre-pr-review/SKILL.md. Review my specified project and local changes against the original requirements and acceptance criteria. Start read-only. Use only granted verification/repair permissions. Report the actual version, evidence, findings, unresolved gaps and next-stage recommendation.
Supply the target, original requirement, acceptance criteria, trusted policy, permitted actions and task budget. Relevant staged, unstaged and untracked changes are included. No global Skill installation is required. For Codex, the repo-local code-inspection entry routes to the existing stage Skills; see setup and explicit-load fallback. Earlier discovery/routing feedback is historical and does not validate this copy. Host discovery/loading, installation into another project and cancellation/resumption are unverified for this snapshot. Reader-facing protocols and interface documentation are in English; the Chinese README is available above.
| Stage | Available capability |
|---|---|
| Before PR | Instruction Skill, five shared protocols, real-use verification and independent review when the host supports them. |
| During PR | Local record runner for version-bound evidence, finding decisions, continuous budgets and host-supplied human-decision records; optional security-result import. |
| At merge | Real controlled bare-Git candidate, integration evidence, expected-old conditional ref update and receipt query. Only explicitly isolated repositories and merge commits. |
| After merge | Optional local simulation, plus a trusted-host deploy/rollback interface; no bundled production provider. |
No native hosted-CI/SARIF result importer, identity authentication or production deployment/flag/metrics/rollback provider is included. No automatic PR creation, comments, real-project merging or deployment. Evaluation datasets and scoring are not implemented.
The optional host delivery interface accepts a policy-selected provider from trusted Python host code for deploy/rollback. Missing capability remains UNKNOWN/HOLD; the default CLI installs none. New external actions also require a policy-selected operational persistence checkpoint; an ordinary successful save or reload is not proof of power-loss durability. Conditional writes, authentication, storage guarantees and durable idempotency require actual host integration and acceptance. Other real delivery actions are unsupported.
The optional build provenance contract accepts a policy-selected verifier supplied by a trusted Python host. It binds the result to exact source/tree/configuration/artifact/run and plan intent; no external CI identity or signature verifier is bundled. Without the required capability, new actions remain UNKNOWN/HOLD. Historical recovery does not renew authentication.
From the checkout root:
python3 -B examples/lifecycle_demo.py --simulate-approvals --with-deliveryIt retains a new external directory with commands and evidence. The tiny content check and isolated Git merge are real; review reports, person decisions and delivery are explicitly synthetic. Its PASS summary includes expected HOLD/UNKNOWN states and is not release approval. Omit --with-delivery to leave that stage NOT_RUN.
- Walkthrough, minimum configuration and troubleshooting
- Current workflow, trust boundaries and verification scope
- Lifecycle CLI and record contract
- Optional security-result interface
- Support and acceptance evidence
- Sources and license scope
An explicit temporary-state inspection reports crash residues under the host lock, without reading their contents or deleting them. It is a recovery aid, not evidence that a pending action succeeded. An opt-in trusted-host POSIX interface can recover exactly registered new resources under an exclusive cooperating-writer namespace; default inspection and unknown legacy files never authorize deletion. Windows managed cleanup is not supported.
Default A is Markdown plus your agent host: no new mandatory third-party runtime. Host/model access may have costs or send data to authorized providers; low dependency does not mean guaranteed offline operation. Optional B uses Python 3.9+ standard library and POSIX no-follow file operations/locks, or the native Windows backend described in platform support; isolated Git operations need Git supporting merge-tree --write-tree. Only trusted self-owned fixtures may run through these helpers.
python3 -B validation/run_checks.py --keep-artifacts
python3 -B validation/mutation_check.pyThe unified checker requires a Git checkout. Both commands may initialize disposable self-owned Git fixtures; run them only when that local execution is authorized. They cover the repository router, four stage entries, both Python modes and distribution hygiene; receipts/fixtures stay outside the checkout. On Windows, use python in place of python3 if that is your installed interpreter command. The fixed platform guard-removal checks are targeted regressions, not comprehensive mutation coverage. Tests do not establish production safety, model review quality or scanner effectiveness.
The large lifecycle suite runs in two disjoint groups in each Python mode, with complete case coverage and the existing 180-second command limit. Timeout failures retain partial output and leave remaining checks NOT_RUN; they do not prove all descendant processes stopped. See verification limits.
Distribution checks reject unsafe selections before reading payloads and reuse the bounded, no-follow reader. Test fixtures share the external-directory and KEEP policy. The verification contract defines the file/count/aggregate limits and remaining trust boundaries.
The included CI definition runs on pushes to main, pull requests and manual dispatch. Ubuntu 24.04/Python 3.9 and 3.13 retain their maintained checks; 3.13 also runs all applicable fixed guard-removal checks. Windows 2025 x64/Python 3.13 uses two serial jobs: native prechecks and all ordinary/optimized maintained checks first, then all Windows mutations with their positive controls, both API observations and a completeness gate. Both jobs use independent fresh runners and fixtures. The final Windows check succeeds only when both stages match the same candidate version and run/attempt and every required result is present and successful. It retains read-only permissions, SHA-pinned official Actions and no repository secrets or deployment steps. Read the exact revision in Actions; historical results are not current validation. Green CI is not production acceptance. Other runner combinations are outside this matrix, and Windows support still requires its applicable native tests. Update SHA256SUMS after intentional selected-file changes, excluding the manifest itself.
CI job ceilings are 15 minutes for each Ubuntu job, 40 minutes for Windows maintenance, and 25 minutes for the dependent Windows mutation/observation job. Windows concurrency remains one per workflow; its cumulative configured ceiling is 65 runner-minutes, and the workflow ceiling is 95. These are execution limits, not measured duration or billed cost. Maintained commands retain 180-second limits and mutation subprocesses retain 90 seconds; the repeated native prechecks now explicitly use the same 180-second command bound. Missing, failed, cancelled or mixed-attempt results cannot satisfy the gate. See Windows CI scope and budget.
The host protects trusted policy, authority and ledger directories. Reviewed content and logs cannot grant permissions; JSON actor names and hashes are not authentication or a sandbox. Required missing/stale/partial evidence remains an explicit gap. READY_FOR_NEXT does not authorize merge or release. See the shared core contract.
Stored merge/delivery plans and receipts are checked for exact intent and object/state consistency before execution or recovery. Unsafe legacy records require explicit replanning or migration; see integrity and recovery compatibility. These checks do not protect against a malicious writer controlling the trusted policy and approval store.
Check results retain optional failures separately from blocking decisions. N_A requires a current, scoped host applicability record; a legacy reason alone becomes UNKNOWN. CLI budget reports separate existing ledger capacity, observed work in this invocation and unknown external costs. Capacity is not authorization, and safe receipt queries remain available after exhaustion. See the record and accounting contract.
Optional single-file artifact binding checks actual bytes and binds source/tree/configuration associations to new plans. Trusted policy selects required actions; legacy labels remain unverified. Delivery consumes the same bounded in-memory snapshot it verifies, with either the local simulation or an explicitly supplied trusted-host provider. Build provenance and writer isolation are host assertions, not authentication.
Optional source manifests bind scoped directory inputs or separate HEAD/index/actual-worktree projections to review identity. Collectors support POSIX and the bounded Windows NTFS configuration described in platform support; native collection must pass the exact revision’s Windows checks. Windows records read-only attributes separately from Git index executable modes. Scope, exclusions and limits are part of the identity. It is not an atomic directory snapshot, directory-deployment consumer or authenticated build provenance; dirty source cannot silently become a committed merge candidate.
New charged attempts save a versioned started record with the counter increment; started does not mean the action succeeded. A failed ledger save leaves durability unknown and fences that Session until a validated reload. Old usage is preserved without invented history, and accepted-operation recovery remains uncharged.
Validation uses the maintained local/CI entry, including ordinary and optimized Python, isolated Git demos, file safety and distribution checks. Results bind to the tested revision; see verification scope and the actual Actions run. Independent AI reviews are development activities, not an installed automatic AI-review service. Simulated approvals/delivery do not prove live platform acceptance.
| Path | Purpose |
|---|---|
.agents/skills/code-inspection/ |
Repository-scoped Codex entry. |
skills/ |
Four stage instructions and shared evidence/authority protocols. |
interfaces/, support/ |
Optional local record runner and platform file/Git helpers. |
examples/, validation/ |
Disposable demonstration and maintained checks. |
docs/ |
Setup, workflow, limits and source attribution. |
Use Issues for sanitized questions and reproducible non-sensitive bugs. A private reporting channel is not assumed to be configured. Read contribution guidance before proposing changes and the security policy before reporting a vulnerability. Do not put credentials, private code, personal paths or raw host transcripts in public issues or pull requests. No response-time or production-support commitment is implied.
Original project content that the owner has the right to license is available under the MIT License, Copyright (c) 2026 Zhenkun. Third-party articles, translations, images and private inputs are excluded and are not relicensed. No third-party runtime is vendored; method references and future copying obligations are recorded in sources.