一键导入
self-review-critique
Critique a git diff and generate review.xml with comments and suggestions for human validation in self-review
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Critique a git diff and generate review.xml with comments and suggestions for human validation in self-review
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Capture a kenkeep node manually from the current session. Writes a new node directly under `.ai/kenkeep/nodes/<kind>/`. The reviewer accepts by leaving the file in place and rejects by deleting it. Use when the user wants to record a project convention, gotcha, rationale, or named-thing into the project knowledge base.
First-time bootstrap of the project knowledge base from existing markdown documentation. Surveys docs, follows cross-references, and writes new node files directly under `.ai/kenkeep/nodes/`. Supervised by the user, who reviews each node on disk before accepting or deleting it. Use when the user wants to seed an empty knowledge base from the project's existing docs.
Curate pending session logs into kenkeep nodes by reading sessions in-host, drafting curator actions, then deduping and persisting via the kenkeep primitives. Resolves any surfaced contradictions interactively with the user. Use when the user wants to process accumulated session captures, or when the SessionStart nudge reports pending session logs.
Capture a knowledge-base node manually from the current session. Writes a new node directly under `.ai/knowledge-base/nodes/<kind>/`. The reviewer accepts via `git commit` and rejects via `git restore`. Use when the user wants to record a project convention, gotcha, rationale, or named-thing into the project knowledge base.
First-time bootstrap of the project knowledge base from existing markdown documentation. Surveys docs, follows cross-references, and writes new node files directly under `.ai/knowledge-base/nodes/`. Supervised by the user, who reviews each node with `git diff` before committing. Use when the user wants to seed an empty knowledge base from the project's existing docs.
Curate pending session logs into knowledge-base nodes by running the `npx @e0ipso/ai-knowledge-base curate` CLI, then resolve any contradictions surfaced by the curator with the user in-session. Use when the user wants to process accumulated session captures, or when the SessionStart nudge reports pending session logs.
| name | self-review-critique |
| description | Critique a git diff and generate review.xml with comments and suggestions for human validation in self-review |
| metadata | {"argument-hint":"[git-diff-args...]"} |
Analyze a git diff, identify issues, and produce a review.xml file that can be loaded into
self-review via --resume-from for human validation.
Non-obvious semantics (keep in sync with ../self-review-apply/assets/self-review-v1.xsd):
new-line-start/new-line-end (for
added/context lines) OR old-line-start/old-line-end (for deleted lines). Never both. If
neither pair is present, it's a file-level comment.viewed attribute: Set to true for all files (the AI "viewed" them all).path on renames: For renamed files (change-type="renamed"), path is the new path.change-type values: added, modified, deleted, renamed.original-code: Must be the exact text at the referenced lines, copied verbatim from the
file content. The applying agent uses text matching to locate the replacement target.author: Set to your model name on every comment you generate (e.g., "Claude Sonnet 4.6").Read $ARGUMENTS for git diff args. If empty, default to unstaged changes (plain git diff).
The arguments support the same format as self-review CLI: --staged, HEAD~3,
main..feature-branch, -- path/to/file, etc.
Check if .self-review.yaml exists in the current directory. If it does, read it to extract:
categories: Array of {name, description, color} objects, use only these category names
in your commentsoutput-file: Output path (default ./review.xml)If no config file exists, use these default categories:
question, Clarification neededbug, Likely defect or incorrect behaviorsecurity, Security vulnerability or concernstyle, Code style, naming, or formatting issuetask, Action item or follow-up tasknit, Minor nitpick, low priorityUse the Bash tool to run:
git diff $ARGUMENTS
If the diff output is empty, report "No changes to review." and stop.
Also capture the repository root for the XML header:
git rev-parse --show-toplevel
For each file in the diff:
If there are many files (>15), prioritize reading files with the largest diffs first. For very large files, read only the regions around the changed lines (with 50 lines of surrounding context).
Review each file's changes. Look for:
Guidelines:
suggestion blocks for every comment where you can propose a concrete fix. The human
reviewer can then accept or reject each suggestion individually.Read the XSD schema at .agents/skills/self-review-apply/assets/self-review-v1.xsd for the
complete XML structure and validation rules. The <xs:documentation> annotations in the schema
describe all element and attribute semantics.
Construct the XML using the Write tool. Here is a minimal example for reference:
<?xml version="1.0" encoding="UTF-8"?>
<review xmlns="urn:self-review:v1" timestamp="2026-02-28T14:30:00.000Z" git-diff-args="--staged" repository="/absolute/path/to/repo">
<file path="src/utils.ts" change-type="modified" viewed="true">
<comment new-line-start="42" new-line-end="42" author="Claude Sonnet 4.6">
<body>Division by zero when input is empty.</body>
<category>bug</category>
<suggestion>
<original-code> const avg = sum / input.length;</original-code>
<proposed-code> if (input.length === 0) return 0;
const avg = sum / input.length;</proposed-code>
</suggestion>
</comment>
</file>
<file path="src/other.ts" change-type="added" viewed="true" />
</review>
Additional notes not in the schema:
timestamp: Get current time with node -e "console.log(new Date().toISOString())"repository: Get absolute path with git rev-parse --show-toplevelviewed: Always "true" for all files (the assistant "viewed" them all)author: Set to your model name on every comment you generate (e.g., "Claude Sonnet 4.6")& → &, < → <, > → >, " → ",
' → 'Use the Bash tool to run:
xmllint --schema .agents/skills/self-review-apply/assets/self-review-v1.xsd REVIEW_XML_PATH --noout
Where REVIEW_XML_PATH is the output path from step 2.
xmllint is not installed: warn the user and continue without validation.After writing the file, print a summary:
Then remind the user how to load the review:
To review in self-review:
self-review <same-diff-args> --resume-from REVIEW_XML_PATH