agentleFS
savinofioresavinofiore/lexi/skills/code-review/SKILL.md

code-review

Skill4 starsChanged 50 days agoMITView on GitHub

Hybrid Jev + Claude code review. review.py has TypeSafe's Jev judge the diff on closed questions (generic risk and code quality, plus the project's own conventions from .lexi/review.json) and computes the verdict in code (BLOCK, SECURITY REVIEW, CONVENTIONS, QUALITY, NITS, MERGE); Claude takes the handoff, locates fired rules, verifies uncertain checks, delegates triggers and, after a fix, reruns Jev to measure the deltas. lexi's bug and feature flows call it after the last GREEN. Use for "/jev:code-review", "review the diff", "can I merge?", "is this code ok?", "does it follow our conventions?", a PR number, a git ref or a .diff/.patch file.

  • Reads credentials

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use close-spec, design-with-images and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • dzhngSkill

    close-spec

    When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).

    Also in 5 projects that use this

  • dzhngSkill

    design-with-images

    Explore UI and visual design with image generation, then iterate the real implementation against the user-selected concept. Use when brainstorming visual directions, offering mockup variants, or implementing an approved generated design; do not stop at the mockups or the first code approximation.

    Also in 5 projects that use this

  • PydanticSkill

    add-new-model

    Add support for a newly-released language or image generation model in pydantic-ai (e.g. openai:gpt-5.6, anthropic:claude-sonnet-5, openai:gpt-image-2). Use when a provider ships a new model id and you need to wire literals, profile flags, adapters, and tests to recognize it. Handles SDK-lag, gateway list conventions, capability probing, and direct image-model geometry. Also use when Anthropic, OpenAI or Google deprecates or retires a model, to update the deprecation tables.

    Also in 10 projects that use this

  • Microsoft AzureSkill

    azsdk-common-apiview-feedback-resolution

    Analyze and resolve APIView review feedback on Azure SDK PRs. **UTILITY SKILL**. USE FOR: APIView comments, API review feedback, SDK API surface changes. DO NOT USE FOR: general code review, non-APIView feedback. INVOKES: azure-sdk-mcp:azsdk_apiview_get_comments, azure-sdk-mcp:azsdk_customized_code_update, azure-sdk-mcp:azsdk_typespec_delegate_apiview_feedback, azure-sdk-mcp:azsdk_run_typespec_validation, azure-sdk-mcp:azsdk_package_generate_code.

    Also in 6 projects that use this

  • Microsoft AzureSkill

    azsdk-common-generate-sdk-locally

    Generate and finalize Azure SDKs locally from TypeSpec, including build, checks, tests, changelog, metadata, and version updates by default. WHEN: "generate SDK locally", "build SDK", "run SDK tests", "run CI checks", "validate package", "run checks", "update changelog", "fix SDK build errors", "resolve SDK generation errors", "customize TypeSpec", "rename SDK client", "rename SDK model", "hide operation from SDK", "fix analyzer errors", "resolve customization drift", "create subclient", "update metadata", "update version". INVOKES: azsdk_verify_setup, azsdk_package_generate_code, azsdk_package_build_code, azsdk_package_run_check, azsdk_package_run_tests, azsdk_customized_code_update, azsdk_package_update_changelog_content, azsdk_package_update_metadata, azsdk_package_update_version.

    Also in 6 projects that use this

  • +4 more from dzhng
  • +3 more from Azure

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 186 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If you disagree with a number, say so after the verdict as a separate opinion.

    line 92

“Common” is measured: kept by at least 6 in 10 of the 186 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

code-review — hybrid Jev + Claude protocol

Division of labour, fixed:

WhoDoesDoes not
Jevanswers every closed question with calibrated probabilities, one call, ~1–2 swrite prose, know where, see the codebase
review.pyapplies policy.json: verdict, exit code, handoffhold questions or thresholds
Claudelocates (path:line), verifies uncertain checks, delegates, proposes the minimal fix, reruns Jev to measureread the diff to decide the verdict, rewrite it, edit without confirmation

REVIEW below is python3 "${CLAUDE_SKILL_DIR}/../../jev/review/review.py". Run it from the project root.

1. Run Jev (always --json, save the output)

$REVIEW <source> --json > "$SCRATCH/jev-1.json"

$SCRATCH is your scratchpad directory, or mktemp -d.

Skill argument<source>
none, dirty tree (git status --porcelain not empty)--working --title "..." --description "..." taken from the request or the task just finished; missing → ask in one line
none, clean tree, not on the default branch--git $(git merge-base HEAD <default>), <default> from git symbolic-ref --short refs/remotes/origin/HEAD (fallback main)
none, clean tree, on the default branch--git HEAD~1
git ref--git <ref>
.diff/.patch file--diff <file>
PR number (326)gh pr diff 326 > "$SCRATCH/pr.diff" and gh pr view 326 --json title,body, then --diff "$SCRATCH/pr.diff" --title "<title>" --description "<body>"

Exit 4 with TYPESAFE_API_KEY not set → explain where it goes (env in the gitignored .claude/settings.local.json, or the shell) and stop; never ask for the key in chat. Other exit 4 (bad .lexi/review.json, network) → quote the error and stop. Empty diff → say so and stop. omitted_files > 0 → say it first: the verdict is on a partial diff, with the rules on suspended_checks not applied.

2. Report the verdict without rewriting it

From the JSON, in this order, adding no judgement of yours:

  1. verdict + fired_rules[].comparison on one line (QUALITY — deep_nesting 0.92 >= 0.7, too_many_params 0.95 >= 0.7);
  2. notable checks: probabilities > 0.5, or < 0.5 for higher_is_better checks (adds_tests, docs_only, description_matches, outside_test_perimeter); scores with their level; choices.primary_concern with confidence;
  3. ms, cost_usd.

3. Handoff

handoff is what Jev passes to you. Three kinds of ask:

askWhenWhat Claude does
locatea rule firedopens only files, finds the line (path:line) answering question, proposes the minimal fix in one line. Does not apply
verifya critical check in the uncertainty bandopens only files, answers question with one sentence and the line that proves it
delegateescalate_to: "agent:<name>"launches that agent (Agent tool, subagent_type = name) with files, question, probability; reports its outcome in two lines

Rules:

  • more than 3 locate → one Explore agent per check, in parallel, with question + files; collect the path:lines;
  • escalate_to: "skill:<name>" on a locate is the remedy to name in step 4, not to launch on your own;
  • empty handoff → "nothing handed off" in one line, stop;
  • the verdict stays the policy's: your lines are additions. --escalate prints the same handoff as a prompt for another session.

Arguments: --fix → skip the confirmation in step 4 (the user already asked to apply). Depth levels (low…max) → ignored: Jev always answers everything at a fixed cost.

4. Confirm

For any verdict other than MERGE: one question (AskUserQuestion), options fix all / pick / none, listing the proposed fixes (check → path:line → fix). No edits without confirmation. For MERGE propose nothing.

5. Fix, then Jev measures

Apply only the confirmed fixes. A fix on a path under .lexi.json → testable goes through lexi's RED→GREEN like any other change: the guard holds it anyway. Then rerun the same source with --compare:

$REVIEW <source> --json --compare "$SCRATCH/jev-1.json" > "$SCRATCH/jev-2.json"

Report compare: verdict before → after and the per-check deltas. Read them like this:

  • the fired check dropped below its threshold → the fix worked;
  • it stayed high → the fix missed what Jev saw: reread the question, never lower the threshold;
  • a new check rose → the fix introduced a problem: say so.

Two rounds at most. Then run the project's gate (.lexi.json → gate).

6. Disagreement → criteria, never thresholds

If you disagree with a number, say so after the verdict as a separate opinion. If the disagreement is systematic (same check, several diffs), propose a change to that check's criteria with the boundary case to add: in .lexi/review.json for a project check (or to override a core check for this project), in the plugin's review/checks.json for everyone. Never move a threshold in policy.json, never touch review.py.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.