[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-110910":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":14,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":31,"updatedAt":32,"readmeContent":33,"aiSummary":34,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":35,"discoverSource":36},110910,"code-review-gate-skill","kyy-logs\u002Fcode-review-gate-skill","kyy-logs","Auditable code review skill for Claude Code and Codex: four independent probes, evidence-backed findings, and a JSON-derived merge gate.",null,"Python",517,7,1,2,0,13,82,61.41,"MIT License",false,"main",true,[24,25,26,27,28,29,30],"agent-skills","ai-code-review","claude-code","code-review","codex","developer-tools","static-analysis","2026-11-23 12:51:27","2026-11-23 20:19:38","# code-review-gate-skill\n\nEnglish | [简体中文](README.zh-CN.md)\n\n**Evidence-backed code review. Static-first, probe-driven, and gated.**\n\nThe skill sources live in [`skills\u002Fcode-review-gate\u002F`](skills\u002Fcode-review-gate\u002F) (English) and [`skills\u002Fcode-review-gate-zh\u002F`](skills\u002Fcode-review-gate-zh\u002F) (Chinese), independently of any host's installation directory. The current stable release is `v0.2.4`; see [VERSION](VERSION).\n\n[![Claude Code](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FClaude%20Code-skill-6B4FBB?style=flat-square)](https:\u002F\u002Fclaude.com\u002Fclaude-code)\n[![Agent Skills](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAgent%20Skills-standard-1f6feb?style=flat-square)](https:\u002F\u002Fagentskills.io)\n[![Python 3.9+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.9%2B-3776AB?style=flat-square&logo=python&logoColor=white)](https:\u002F\u002Fwww.python.org\u002F)\n[![Static-first](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Freview-static--first-2ea44f?style=flat-square)](#what-this-is-not)\n[![GitHub stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fkyy-logs\u002Fcode-review-gate-skill?style=flat-square&logo=github)](https:\u002F\u002Fgithub.com\u002Fkyy-logs\u002Fcode-review-gate-skill\u002Fstargazers)\n\nMost AI reviews stop at “this looks risky.” This skill produces a review you can audit: every finding points to a location, a contract or code path, and a severity; every gate decision is rendered from machine-readable JSON. It reads the diff, surrounding source, tests, and project rules — no build, test run, or coverage report required.\n\nIt never modifies the code under review.\n\n## Latest news\n\n\u003C!-- NEWS:START -->\n### v0.2.4 (2026-11-10)\n\n#### Changed\n\n- code-review: behavior review requires a concrete delimiter-whitespace input pair and traces match result, field\u002Fdefault, validation, and use\n- code-review: serialization review inspects the encoder\u002Frenderer\u002Fdecoder and traces a quote, backslash, or newline input; unresolved decisive implementations go to `unverified_items`\n- code-review: when repository calls or tests establish the path, a missing external production caller is an impact-scope gap, not a blocker\n- code-review: probe searches prefer `git grep \u003Chead>` for commit reviews and scope caller discovery\n\n[Full update history](NEWS.md)\n\u003C!-- NEWS:END -->\n\n## Release status\n\n`v0.2.4` is a stable release within the scope described below.\nPre-1.0 contract or format changes will be documented in [NEWS](NEWS.md).\n\n- **Severity is three levels:** `high`, `medium`, `low`. Records written by the\n  earlier four-level version, including any `critical` value, are **not\n  compatible**; `collect-metrics` rejects them. Re-run the review or migrate the\n  records before using them with this release.\n- **Scope:** static-first review with four probes and JSON-derived report\u002Fgate\n  output. It does not replace tests, CI, or human review.\n- **Validation:** 116 offline pipeline, NEWS, installation, bilingual, locale, and source-freshness tests; clean-project\n  end-to-end gate runs; additional probe smokes. These are regression checks,\n  not a general recall claim. Concurrency-defect detection has not been\n  validated.\n\nFor the next stable release, update `VERSION` (for example, to `0.1.1`) and push it to `main`. After Validate skills succeeds, the release workflow generates NEWS from commits, updates the README release information, and publishes the version tag and GitHub Release. Existing releases are preserved; failed CI does not publish.\n\n## Contents\n\n- [Latest news](#latest-news)\n- [Release status](#release-status)\n- [Why this skill](#why-this-skill)\n- [Quick start](#quick-start)\n- [How it works](#how-it-works)\n- [Evidence contract](#evidence-contract)\n- [Configuration](#configuration)\n- [What this is not](#what-this-is-not)\n- [Validation](#validation)\n- [Requirements](#requirements)\n- [Repository layout](#repository-layout)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Why this skill\n\n**No self-grading.**\n\nThe implementation context does not sign off on its own work. Four probes run in fresh contexts, each files its own evidence, and the gate is derived from those records.\n\n*This is separation of duties, not independent human adjudication; all probes still use the same model.*\n\n| | |\n|---|---|\n| **Static-first** | Works on a fresh clone or a partial checkout. Coverage is optional, not a prerequisite. |\n| **Evidence contract** | A finding without a location, summary, and checkable evidence is not a finding. |\n| **Four probes** | Behavior, tests, rules, and impact are separate questions with separate reports. |\n| **Machine-checkable gate** | Counts and blockers come from JSON, not from prose the model retyped. |\n| **Auditable output** | The human report and the JSON records are rendered from the same source and verified against each other. |\n\n## Quick start\n\n### Install\n\nRun this command **inside your project**:\n\n```bash\n# English (default)\nnpx -y skills add kyy-logs\u002Fcode-review-gate-skill --agent codex --skill code-review-gate --yes\n\n# Chinese\nnpx -y skills add kyy-logs\u002Fcode-review-gate-skill --agent codex --skill code-review-gate-zh --yes\n```\n\nUse `--agent claude-code` for Claude Code. Codex installs to `.agents\u002Fskills\u002F\u003Cskill>\u002F`; Claude Code installs to `.claude\u002Fskills\u002F\u003Cskill>\u002F`. Node.js 22.20+ is required. Install one language per project. The Python installers also accept `--lang en|zh-CN` and default to English.\n\n### Run\n\nAsk in Claude Code:\n\n```text\nReview these changes with code-review-gate.\n```\n\nOr invoke the skill directly:\n\n```text\n\u002Fcode-review-gate\n```\n\nFor a fixed range:\n\n```text\nUse code-review-gate on commits abc123..def456\n```\n\nThe skill supports two review modes:\n\n- `worktree` — staged, unstaged, and untracked changes against the current `HEAD`.\n- `commits` — a fixed `base..head` range.\n\n### Read the result\n\n```text\ndocs\u002Fwork\u002Factive\u002F{slug}\u002F\n├── code-review.md      # human report\n├── review-snapshot.json\n└── probes\u002F\n    ├── behavior-review.json\n    ├── test-coverage.json\n    ├── repo-guard.json\n    └── impact-analysis.json\n```\n\n## How it works\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"assets\u002Fcode-review-architecture.svg\" width=\"1160\" alt=\"Four fresh-context probes run in parallel and write their own JSON; the main executor syncs, reconciles high findings, renders the report, and applies the gate.\">\n\u003C\u002Fp>\n\nThe four probes use the same model in fresh contexts. This is separation of duties, not independent human review. A passing gate is not human approval, CI, or proof that no issues remain. The current skill has no separate reviewer or finding-verification stage; raw findings feed the report and gate.\n\n1. **Scope** — determine `worktree` or `commits`; record base and head as commit IDs, then init the run with `--mode` to pin `review-snapshot.json`.\n2. **Probes** — dispatch four independent agents with the same scope and diff, each writing its own probe JSON. Run in batches if host capacity is limited, or record a serial fallback if agents are unavailable. Cross-probe duplicates are retained and counted; actual speed and token savings remain unverified.\n3. **Sync** — validate probe JSON and derive counts with `collect-metrics`.\n4. **Reconcile** — high findings must be closed or marked false-positive by the probe.\n5. **Report** — render the human report’s fact sections from JSON, then verify them.\n6. **Gate** — source freshness, required-probe failures, and open high findings block the merge.\n\n### The four probes\n\n| Probe | Required | Question it answers |\n|---|---|---|\n| `behavior-review` | yes | Does the changed behavior match its actual contract and implementation path? |\n| `test-coverage` | yes | Are the tests meaningful, and is incremental coverage measured when data exists? |\n| `repo-guard` | yes | Does the change violate repository or project rules? |\n| `impact-analysis` | no | Who calls this, what contracts change, and what is the performance\u002Farchitecture blast radius? |\n\nProbes are intentionally narrow. `behavior-review` is not a linter, and `repo-guard` is not a general bug scanner.\n\n### Language and stack coverage\n\nThe default `repo-guard` workflow selects `.java`, `.ts`, `.tsx`, and `.vue` files for pattern scanning. The built-in rule pack includes Java- and Spring-specific guidance; selecting an extension does not establish complete framework or language coverage.\n\nAI semantic checks can inspect relevant code beyond those extensions, but their results depend on the model and available contracts, source, and tests. The historical cases below exercise particular stacks and skill snapshots; they do not establish equally validated support across all stacks. Use applicable project rules and record unverified dependencies or language-specific behavior.\n\n## Evidence contract\n\nEvery finding records:\n\n| Field | Meaning |\n|---|---|\n| `location` | `path:line`, or file level with a reason |\n| `summary` | What is wrong — not “consider improving” |\n| `evidence` | Contract, code path, test output, or rule ID |\n| `severity` | `high` \u002F `medium` \u002F `low` |\n| `status` | `open` \u002F `reconciled` \u002F `wontfix` \u002F `false-positive` |\n\nHigh-severity findings must cite the actual method signature and the contract they violate, or a concrete code path. A hunch is capped at `medium` until the evidence is checked.\n\n## Configuration\n\n`references\u002Fprobes.yaml` controls the probe registry:\n\nProject-specific rules can live in `.code-review\u002Frules\u002F`, or be pointed to with `CODE_REVIEW_RULES_DIR`:\n\n```bash\nexport CODE_REVIEW_RULES_DIR=\u002Fpath\u002Fto\u002Frules\n```\n\nA project rule package **replaces** the built-in package; it is not merged with it.\n\n## What this is not\n\n- Not a replacement for tests, CI, or human review.\n- Not a guarantee that a clean report means the change is correct.\n- Not a coverage tool: coverage is used when provided, not required.\n- Not a fixer: it does not modify the code under review.\n\n## Validation\n\nOffline tests check JSON validation, derived counts, report consistency, installation, and gate behavior. Passing them does not establish defect-detection recall, false-positive rates, or the correctness of an AI finding.\n\nA controlled comparison against a single-agent review, measuring missed defects, false positives, wall-clock time, and token usage on the same cases and model configuration, has not yet been established. The historical runs below are snapshot-specific observations and do not demonstrate an improvement over that baseline.\n\n\u003Cdetails>\n\u003Csummary>11-case historical Java regression (2026-10-29)\u003C\u002Fsummary>\n\n- Baseline: commit `494a39bb`, before `behavior-review` was extracted into a standalone probe. The snapshot validates the shared finding and gate contract, not the four-probe split itself.\n- 11\u002F11 cases completed; static review.\n- Original behavior targets: 5\u002F5 hit; including two independently confirmed edge cases, 5\u002F7 required targets were found.\n- Clean and fixed controls: 4\u002F4 passed without false blocking.\n- Two confirmed edge-case misses remain: legal input formatting in a parser, and a JSON representation round-trip in command rendering.\n- 33 raw findings: 8 high, 20 medium, 5 low; 0 confirmed false positives, with unverified items still open.\n- The full merge gate was not run.\n\nRisk areas exercised by these cases:\n\n| Risk area | Cases | Observed result |\n|---|---|---|\n| Resource lifecycle | DBeaver | Found an input stream left open after copying; confirmed target. |\n| Execution logic | Kestra, Keycloak guides | Found duplicate interpreter\u002Fcommand assembly in Kestra; confirmed target. Also reported switch fall-through in Keycloak, with downstream impact only partly supported. |\n| Input boundaries and value handling | Lang-1, Spring AI Alibaba | Found hexadecimal overflow handling and blank-string sentinel problems; confirmed targets. The leading-zero return-type finding remained a contract dispute and was rated too high. |\n| Permissions and data scope | Keycloak groups (m01), Elasticsearch | Found authorization resource IDs used as group IDs; confirmed target. The non-default filesystem permission-bypass candidate still needs threat-model and exploitability evidence. |\n| API compatibility | Kestra | Identified public SPI return-type changes and new abstract methods; compatibility break supported, affected external plugins not measured. |\n| Cache and state consistency | Keycloak login cache (m02) | Reported an invalidation risk involving organization-wrapped models; runtime consequences remain unverified. |\n| Performance and repeated work | Elasticsearch, Kestra, Keycloak login cache | Reported logging overhead, repeated rendering\u002Fdownloads, and extra lookups; performance impact was not benchmarked. |\n| Test quality and regression protection | DBeaver, Keycloak, Kestra | Identified missing branch tests, tests bypassing the changed production entry point, and incorrect cleanup or cache-invalidation coverage. |\n\nThe two confirmed misses were Keycloak's valid `tileVisible = \"false\"`\nsyntax bypassing validation, and Kestra's JSON render\u002Fparse round-trip\ncorrupting command values containing quotes, backslashes, or newlines.\n\nThe four controls checked false alarms: the Lang-1 fix, normal pagination,\nnormal tag normalization, and a valid login-cache delegation path that should\nnot be reported as recursion. Passing a control does not establish that its\nentire change is defect-free.\n\nThe evaluation harness and raw reports are kept out of the published repository. This snapshot is a regression result, not a claim of general recall.\n\n\u003C\u002Fdetails>\n\n\u003Cdetails>\n\u003Csummary>9-case expansion (2026-10-30)\u003C\u002Fsummary>\n\n- Separate run `2026-10-30-review9-1a4adc1` on an older `main` (`1a4adc1`); it did not re-run the 11 historical cases. Do not combine the two batches into a 20\u002F20 claim.\n- 9\u002F9 cases completed; 36\u002F36 probe records; 0 probe errors or skipped cases.\n- Positive targets: 4\u002F6. Fixed controls: 3\u002F3 stopped reporting.\n- 22 raw findings: 7 high, 13 medium, 2 low. This older run used the reviewer (5 run \u002F 4 skip); the current skill has no independent reviewer.\n- Confirmed misses: x01's legal `d` flag and x04's cancellation\u002Floading lifecycle.\n- Severity or contract caveats remain for several cases, including x02, x05, x06, and x08; this is not a general recall claim.\n\n\u003C\u002Fdetails>\n\n## Requirements\n\n- Claude Code with Agent Skills support, or Codex with custom-agent support.\n- Bash 3.2+, Git, awk, grep, sed (macOS: invoke with `\u002Fbin\u002Fbash`; Linux\u002FWindows Git Bash: `bash`).\n- Python 3.9+ is required to run the review scripts; PyYAML is used for report parsing and metrics.\n- Node.js 22.20+ is required for the `npx skills` install entry.\n\n## Repository layout\n\n```text\ncode-review-gate-skill\u002F\n├── README.md\n├── README.zh-CN.md\n├── NEWS.md\n├── LICENSE\n├── VERSION\n├── assets\u002F\n│   ├── code-review-architecture.svg\n│   └── code-review-architecture.zh-CN.svg\n├── .github\u002Fworkflows\u002F\n│   ├── news-update.yml\n│   ├── skill-validation.yml\n│   ├── star-history.yml\n│   └── sync-news.yml\n├── scripts\u002F\n│   ├── check-skill-locales.py\n│   ├── install\n│   ├── install.py\n│   ├── install-remote.py\n│   ├── news-update.py\n│   ├── sync-skill-scripts.py\n│   └── sync-news.py\n├── shared\u002Fscripts\u002F\n│   ├── collect-metrics\n│   ├── lib-metrics\n│   ├── rule-grep\n│   └── sync-results.py\n├── skills\u002F\n│   ├── code-review-gate\u002F\n│   │   ├── SKILL.md\n│   │   ├── assets\u002F\n│   │   ├── references\u002F\n│   │   └── scripts\u002F\n│   └── code-review-gate-zh\u002F\n│       ├── SKILL.md\n│       ├── assets\u002F\n│       ├── references\u002F\n│       └── scripts\u002F\n└── tests\u002F\n```\n\n## Star history\n\n[![Star History Chart](https:\u002F\u002Fraw.githubusercontent.com\u002Fkyy-logs\u002Fcode-review-gate-skill\u002Fstar-history\u002Fstar-history.svg)](https:\u002F\u002Fstar-history.com\u002F#kyy-logs\u002Fcode-review-gate-skill&Date)\n\nUpdated daily by [`star-history.yml`](.github\u002Fworkflows\u002Fstar-history.yml).\n\n## Contributing\n\nIssues and pull requests are welcome. For a behavior change, include the review target (repo and base\u002Fhead), expected and observed result or gate decision, and evidence that distinguishes them.\n\nFor a probe or schema change, update the probe document, output contract, and affected scripts together.\n\nRun tests with `python -m unittest discover -s tests -v`; set `CODE_REVIEW_TEST_BASH` to include shell and installation checks. These tests do not call models or establish defect recall.\n\nFor user-facing changes, add an entry to `NEWS.md`. Pushes to `main` update the README news preview; locally, run `python scripts\u002Fnews-update.py` and `python scripts\u002Fsync-news.py` (use `--check` to verify only). Keep the Chinese README aligned.\n\n## License\n\nThis repository is distributed under the [MIT License](LICENSE).\n\n\n## Project policy and output\n\nOptional `.code-review\u002Fconfig.json` (paths relative to the reviewed project):\n\n```json\n{\n  \"output_dir\": \"docs\u002Fwork\",\n  \"line_target\": 85,\n  \"branch_target\": 80\n}\n```\n\n85% \u002F 80% are configurable defaults. Line coverage blocks below target; branch coverage is advisory.\nProbes, gates, and reports use the same effective targets. `CODE_REVIEW_OUTPUT_DIR` overrides the output root;\npass identical settings to every shell invocation. Source inspection is read-only, but the workflow writes\n`active\u002F\u003Cslug>\u002Fcode-review.md`, `probes\u002F*.json`, `review-snapshot.json`, root-level `workflow-events.log`,\nand scorecards \u002F `quality-trend.csv` on archive.\nStart a new review with `bash \"$CODE_REVIEW_SKILL_DIR\u002Fscripts\u002Fcollect-metrics\" init \u003Cunique-slug> --mode worktree`\n(or `--mode commits --base \u003Cbase> [--head \u003Chead>]`). With `--mode`, init writes `review-snapshot.json`; new runs\nshould always pass it. Omitting `--mode` keeps the legacy behavior and skips freshness checking.\nExisting active, archived, or event-history slugs are rejected. Re-rendering the same run updates only automatic report regions;\ndo not run concurrent writers for the same run. The effective thresholds are returned by `init` and recorded in the generated report; keep configuration stable when\nresuming, and re-check findings and re-render after policy changes. `gate-pass code-review` recomputes `review-snapshot.json`\nand returns `stale-review` when the reviewed source changed; run `snapshot \u003Cslug>` after a fix and re-review.\nThe minimum shell is Bash 3.2. macOS can use `\u002Fbin\u002Fbash`; Linux \u002F Windows Git Bash use `bash`.\nA macOS CI job is configured; a passing macOS result has not been established locally.\n","这是一个面向AI编程助手（Claude Code\u002FCodex）的可审计代码审查技能，通过四个独立静态探针分析代码变更，生成带位置定位、影响路径和严重等级（high\u002Fmedium\u002Flow）的证据支撑型审查结果，并输出JSON格式的合并门控决策。项目采用纯静态分析，不依赖构建、运行或测试，仅读取diff、上下文源码、测试用例及项目规则。适用于CI\u002FCD流水线中自动化前置代码质量卡点、AI辅助开发场景下的审查结果留痕与合规审计，以及需要机器可读、可追溯审查结论的工程治理流程。","2026-11-24 04:39:56","CREATED_QUERY"]