Use cases & recipes
Recipes for reviewing your own changes before they leave your machine. Modes, the gate, output formats, and exit codes are covered in Usage. Runnable artifacts (git hook, Makefile, agent script) are in examples/review-local/.
miucr review --staged --gate highPre-commit gate
Section titled “Pre-commit gate”Block the commit on a high or critical finding:
miucr review --staged --gate high--stagedreviews the staged blobs, not your unstaged tree, so it sees what the commit will contain.- Exit
2when a finding reaches the gate,0otherwise. From a hook, a non-zero exit aborts the commit. - Install the
pre-commitexample as.git/hooks/pre-commit(chmod +x). Bypass once withgit commit --no-verify.
Pre-PR branch check
Section titled “Pre-PR branch check”Review everything your branch adds over main:
miucr review --from main --to HEAD -o pretty- It reviews
HEADagainst the merge-base of the two refs: the changes a PR would introduce, not a rawmain..HEADdiff. - Add
--gate highto also fail non-zero in scripts. - The whole branch is one change, so cross-file issues a single-commit review misses can show up.
One commit or hotfix
Section titled “One commit or hotfix”miucr review --commit <sha> --gate medium<sha> is any ref (HEAD, HEAD~1, a tag), diffed against its first parent. A lower gate suits a hotfix where you want more surfaced before it ships.
Read it in the terminal
Section titled “Read it in the terminal”miucr review --staged -o prettypretty shows jumpable file:line, severity, rationale, a code excerpt, and a patch preview. Color only on a TTY. The default -o json is for agents and scripts. See Output formats.
Agent fix loop
Section titled “Agent fix loop”An agent reviews, parses, fixes, and re-reviews until clean:
miucr review --staged -o json- Each entry in
.data.findingshasfile,line,end_line,severity,category,rationale,suggested_patch, andquoted_code. Stop whensummary.findingsis0or.data.stats.max_severityis below your bar. - A gate hit is exit
2, and the findings still print to stdout. Read the JSON either way. See Exit codes. - Without a shell loop: install the agent skill or run
miucr mcpso the agent callsreview_rundirectly. See MCP integration. Theagent-review.shexample shows the shell-loop shape.
SARIF in your editor
Section titled “SARIF in your editor”Open the report in a SARIF viewer extension (for example VS Code “SARIF Viewer”):
miucr review --staged -o sarif > review.sarif # SARIF onlymiucr review --staged --sarif-out review.sarif # JSON on stdout plus a SARIF file--sarif-out comes from the same single review run, with no second LLM pass. Details: --sarif-out.
Makefile or npm script
Section titled “Makefile or npm script”review: miucr review --staged --gate high -o pretty{ "scripts": { "review": "miucr review --staged --gate high" }}Use it as a local pre-push check or a CI step. The example directory has a Makefile with review and review-range targets.
Teach the reviewer your conventions
Section titled “Teach the reviewer your conventions”miucr rules init # scaffold .miu/cr/rules/example.mdmiucr rules check internal/foo/bar.go # which rules apply to a pathMarkdown files in .miu/cr/rules/*.md (repo) or ~/.config/miu/cr/rules/*.md (personal) are injected as review context for matching files. They never gate. See Project rules and examples/rules/.
Revisit past reviews
Section titled “Revisit past reviews”Every review is saved locally unless you pass --no-save:
miucr history # recent reviews, newest firstmiucr history --since 7d # 7d, 24h, or 2026-06-01miucr history show <id> # findings, stats, transcript, raw I/OThe review_id in a review’s envelope is the <id>. See Review history.
See also
Section titled “See also”- Usage: modes, gate, formats, exit codes, flags.
- How it works: what each pipeline stage means for your results.
- Project rules, Review history, MCP integration, GitHub PR review.