关于
The crit-cli skill enables programmatic creation and management of code review comments through CLI commands, including syncing with GitHub PRs and handling review files. It's designed for automated workflows where agents need to comment on shared code, documents, or proposals without interactive review loops. Key operations include publishing/unpublishing reviews, pushing/pulling reviews to GitHub, and working with the crit review JSON format.
快速安装
Claude Code
推荐npx skills add tomasz-tomczyk/crit -a claude-code/plugin add https://github.com/tomasz-tomczyk/critgit clone https://github.com/tomasz-tomczyk/crit.git ~/.claude/skills/crit-cli在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Crit CLI Reference
If a plan was just written and the user said "crit" or "review", use the
$critskill instead — it covers the full review loop. This skill covers CLI operations likecrit comment,crit pull/push, andcrit share.
Comments have three scopes:
- Line comments (
scope: "line") — tied to specific lines, stored infiles.<path>.comments - File comments (
scope: "file") — about a file overall, stored infiles.<path>.commentswithstart_line: 0 - Review comments (
scope: "review") — general feedback, stored in the top-levelreview_commentsarray
The review file path is shown by crit status.
Reading comments
When crit completes a review round, read stdout and follow its instructions. Unresolved comments are often embedded in that prompt as JSON. Check stderr for approved: true or approved: false.
When you need to read comments separately:
crit comments # human-readable, unresolved only (default)
crit comments --json # flat JSON for agents
crit comments --all # include resolved comments
crit comments --plan <slug> # plan reviews
crit comments [path] # explicit review.json or .crit directory
Review-level comments are listed first — easy to miss in raw review.json. Uses the same review resolution as crit comment (--output, --plan, daemon session).
Multiple active sessions
When more than one review session matches the current directory and branch, crit comment refuses to guess. Run crit status (or crit status --json) to list every active session, then target the intended review explicitly:
crit comment --session <id> --author <name> <path>:<line> <body>
crit comment --session <id> --json --file comments.json --author <name>
The JSON status output exposes the candidates in sessions.
Review file format
{
"review_comments": [
{
"id": "r_f1e2d3",
"body": "Overall the architecture looks good",
"scope": "review",
"author": "User Name",
"resolved": false,
"replies": [
{ "id": "rp_b4a5c6", "body": "Thanks, addressed the minor issues", "author": "Codex" }
]
}
],
"files": {
"path/to/file.go": {
"comments": [
{
"id": "c_a1b2c3",
"start_line": 5,
"end_line": 10,
"body": "Comment text",
"quote": "the specific words selected",
"anchor": "The sessions table needs a complete rewrite...",
"author": "User Name",
"resolved": false,
"replies": [
{ "id": "rp_c7d8e9", "body": "Fixed by extracting to helper", "author": "Codex" }
]
}
]
}
}
}
Field rules:
resolved:falseor missing — both mean unresolved. Onlytruemeans resolved.quote(optional): the specific text the reviewer selected — narrows scope within the line range. Focus changes on the quoted text rather than the entire range.anchor(line comments): full text of the commented lines when placed. When edits shift line numbers, locate content by anchor rather than trustingstart_line/end_line.drifted: true: original content was removed or heavily rewritten — line numbers are approximate at best.- Unresolved comments may have
replies— read them before acting.
Authoring comments
# Review-level (general feedback)
crit comment --author 'Codex' '<body>'
# File-level (whole file, no line numbers)
crit comment --author 'Codex' <path> '<body>'
# Line (single line or range)
crit comment --author 'Codex' <path>:<line> '<body>'
crit comment --author 'Codex' <path>:<start>-<end> '<body>'
# Reply to an existing comment
crit comment --reply-to <id> --author 'Codex' '<body>'
Hard rules:
- Always pass
--author 'Codex'so comments are attributed correctly. - Always single-quote the body — double quotes break on backticks and shell metachars.
- Line numbers reference the file on disk (1-indexed), not diff line numbers.
- Reply bodies support markdown — use code fences and inline code where helpful.
- Only pass
--resolvewhen the user explicitly asks. Never resolve proactively. Same rule applies to theresolvefield in--jsonmode.
Bulk commenting (3+ comments)
Use --json for atomicity (single write, no partial state) and speed (one process). The JSON can come from stdin or --file <path>:
# stdin — fine for short, single-line bodies:
echo '[
{"body": "overall feedback", "scope": "review"},
{"path": "session.go", "body": "restructure", "scope": "file"},
{"file": "src/auth.go", "line": 42, "body": "Missing null check"},
{"file": "src/auth.go", "line": "50-55", "body": "Extract to helper"},
{"reply_to": "c_a1b2c3", "body": "Fixed — added null check"},
{"reply_to": "r_f1e2d3", "body": "Done"}
]' | crit comment --json --author 'Codex'
For multi-paragraph bodies, prefer --file. A literal newline inside a "body" string breaks JSON parsing, and shell-quoted heredocs make this easy to introduce by accident. Write the JSON to a temp file (use your file-edit tool), then:
crit comment --json --file /tmp/crit-bulk.json --author 'Codex'
--file - is an explicit "read stdin" if you ever need it.
Per-entry schema:
| Field | Type | Required | Notes |
|---|---|---|---|
file / path | string | line/file comments | Relative path. path alone (no line) → file-level. |
line | int/string | line comments | 42 or "45-47" |
end_line | int | optional | Defaults to line |
body | string | always | |
author | string | optional | Per-entry override; falls back to --author |
scope | string | optional | "review" / "file" — usually inferred |
reply_to | string | replies | Comment ID (c_… or r_…) |
resolve | bool | optional | Only when user explicitly asks |
Scope inference (when scope omitted): has reply_to → reply; no file/path and no line → review-level; path but no line → file-level; file/path + line → line.
Multi-file disambiguation
Comment IDs are unique per session, but the same ID can collide across files. If crit comment errors with "comment found in multiple files", disambiguate with --path:
crit comment --reply-to c_a1b2c3 --path src/auth.go --author 'Codex' 'Fixed the null check'
In --json mode, set the file field on the entry. Review-level IDs (r_…) are globally unique and never need this.
Plan-mode comments
Plan reviews (via crit plan or the ExitPlanMode hook) store the review file in ~/.crit/plans/<slug>/. Always pass --plan <slug> — without it, crit comment looks in the project root and won't find the comments. The slug is shown in the review feedback prompt.
crit comment --plan my-plan-2026-03-23 --reply-to c_a1b2c3 --author 'Codex' 'Updated the plan'
GitHub PR Integration
crit pull [pr-number] # Fetch PR review comments into the review file
crit push [--dry-run] [--event <type>] [-m <msg>] [pr] # Post review comments as a GitHub PR review
Requires gh CLI installed and authenticated. PR number is auto-detected from the current branch.
--event values: comment (default), approve, request-changes. -m adds a review-level body message.
Sharing
crit share <file> [file...] # Upload and print URL
crit share --qr <file> # Also print QR code (terminal only)
crit share --org <slug> <file> # Share under an organization
crit share --org <slug> --visibility unlisted <file> # Org share with explicit visibility
crit unpublish [file...] # Remove shared review
- Always relay the output — copy the URL (and QR if used) into your response. Don't make the user dig through tool output.
--qris terminal-only — skip in mobile apps, web chat UIs, or anywhere Unicode block characters won't render correctly.--org <slug>shares under an organization. Visibility defaults toorganization(members only). Override with--visibility(organization,unlisted,public).- If a review file exists, comments for the shared files are included automatically.
- Unpublish uses the persisted delete token in the review file — no extra args needed.
GitHub 仓库
常见问题
什么是 crit-cli Skill?
crit-cli 是一个 Claude Skill,作者为 tomasz-tomczyk。Skill 将 Claude 按需加载的说明和资源打包,让 Claude 无需额外提示即可执行与 crit-cli 相关的任务。
如何安装 crit-cli?
使用本页的安装命令:将 crit-cli 作为插件添加到 Claude Code,或将其仓库克隆到 skills 目录,然后重启 Claude 以加载该 Skill。
crit-cli 属于哪个分类?
crit-cli 属于元分类。
crit-cli 可以免费使用吗?
可以。crit-cli 已收录在 AIMCP,可免费安装。
相关推荐技能
Content Collections 是一个 TypeScript 优先的构建工具,可将本地 Markdown/MDX 文件转换为类型安全的数据集合。它专为构建博客、文档站和内容密集型 Vite+React 应用而设计,提供基于 Zod 的自动模式验证。该工具涵盖从 Vite 插件配置、MDX 编译到生产环境部署的完整工作流。
这个Claude Skill为开发者提供完整的Polymarket预测市场开发支持,涵盖API调用、交易执行和市场数据分析。关键特性包括实时WebSocket数据流,可监控实时交易、订单和市场动态。开发者可用它构建预测市场应用、实施交易策略并集成实时市场预测功能。
该Skill帮助开发者创建OpenCode插件,用于接入命令、文件、LSP等25+种事件。它提供了插件结构、事件API规范和JavaScript/TypeScript实现模式,适合需要拦截操作、扩展功能或自定义事件处理的场景。开发者可通过它快速构建响应式模块来增强OpenCode AI助手的能力。
SGLang是一个专为LLM设计的高性能推理框架,特别适用于需要结构化输出的场景。它通过RadixAttention前缀缓存技术,在处理JSON、正则表达式、工具调用等具有重复前缀的复杂工作流时,能实现极速生成。如果你正在构建智能体或多轮对话系统,并追求远超vLLM的推理性能,SGLang是理想选择。
