本文へ移動
cccskills
無料GitHub で公開

code-review-diff

Review code changes from the current branch, staged changes, a git ref, or a diff/patch file. Pure git-native — no platform/PR awareness. Trigger when user says "review this", "review diff", "/aiwork:code-review-diff", or provides a git ref or diff path. Read-only — never posts comments.

インストール方法を見る

含まれるファイル(2)

  • SKILL.md5.8 KB
  • references/pipeline.md21.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Code Review

Pure git-native review pipeline. Resolves a diff from git-native inputs, runs the review pipeline, and produces a markdown report.

Does NOT check out branches, talk to Azure DevOps / GitHub, or post comments. PR resolution is the caller's job (see Usage).

Arguments

$ARGUMENTS is a space-separated string. Parse out optional flags first, then treat the remainder as the diff source.

FlagMeaning
--rules <path>Project rules markdown file.
--pr <number>PR / MR id (label only — no platform fetch).
--ticket <id>Ticket / work-item id (label only).
--name <title>Override inferred report title.
--printPrint review to stdout; skip save prompt.

Wrappers may pre-pin any of rules_file, pr, ticket, name — user-passed flags WIN.

Input Detection

After flags are stripped, the remainder selects the diff source:

FormSource
emptycurrent branch vs base (master/main)
stagedgit diff --staged
path ending .diff or .patchlocal diff file
anything elsetreat as git ref (branch / sha / tag)

Ambiguous → ask user. Do NOT guess. Never treat a bare numeric as a PR id — PR identity is set only via --pr.

Workflow

1. Resolve input → diff file path + metadata

empty

base=$(git rev-parse --verify master 2>/dev/null && echo master || echo main)
cur=$(git branch --show-current)
[ "$cur" = "$base" ] && abort "On base branch ($base). Switch to a feature branch."
git diff "$base"...HEAD > "/tmp/code-review-diff-$(date +%s).diff"
files=$(git diff --name-only "$base"...HEAD)
title="$cur"
slug="$cur"

staged

git diff --staged > "/tmp/code-review-diff-staged-$(date +%s).diff"
files=$(git diff --staged --name-only)
title="staged changes"
slug="staged"

.diff / .patch path

Use file as-is. Parse changed files from diff headers (+++ b/...). slug="$(date +%s)".

git ref

git diff "<ref>"...HEAD > "/tmp/code-review-diff-ref-$(date +%s).diff"
files=$(git diff --name-only "<ref>"...HEAD)
title="HEAD vs <ref>"
slug="$(git branch --show-current)"

1.5. Resolve report metadata

name = --name ?? title. branch = git branch --show-current (empty for diff-file / detached HEAD). pr / ticket = flags, empty if unset. Phase 4 omits empty fields.

2. Diff size guard

n=$(wc -l < <(echo "$files"))

If n > 50 → warn user, ask: proceed full / filter to paths / abort.

3. Run pipeline

Read references/pipeline.md and execute every phase. The phase sequence, the lens set chosen by Step 1.4 (kind routing), the scoring pass, and the final Critical/Concerns/Nits format are mandatory — no shortcut to a freeform review, regardless of how small the diff looks. Inline vs. Task-tool fan-out is a perf choice (threshold + kind routing defined in pipeline.md); the contract is the steps and the output.

Inputs to pass through:

  • DIFF_FILE, CHANGED_FILES — from step 1
  • TITLE — name from step 1.5
  • BRANCH, PR, TICKET — from step 1.5 (may be empty)
  • RULES_FILE — resolved rules path (may be unset)

4. Output

Hold the rendered markdown review in memory. Then choose destination:

  • If --print is set: print the markdown to stdout. Done.
  • Otherwise, ask the user:
    1. Print only (no save) — default
    2. Save to /tmp/review-<slug>.md
    3. Other path

Skill produces markdown and stops. Sending it to a PR, a chat, or anywhere else is a follow-up the user runs themselves — this skill never invokes other skills or posts to forges.

Usage

Recommended: shell wrapper + worktree (non-destructive)

Run from terminal. Resolve PR id → source branch via platform CLI, then launch Claude in a worktree pinned to that branch. Keeps the user's main working tree untouched.

#!/usr/bin/env bash
# bin/cr-pr <pr-id>
PR_ID=$1
BRANCH=$(az repos pr show --id "$PR_ID" --query sourceRefName -o tsv | sed 's|refs/heads/||')
claude --worktree "$BRANCH" "/aiwork:code-review-diff --rules .claude/code-review-rules.md"

Replace az repos pr show with gh pr view --json headRefName for GitHub.

In-session: check out first

Land on the PR's source branch first, then invoke /aiwork:code-review-diff. The skill reviews the current branch vs base. For Azure DevOps, /dev-azdo:pr checkout <id> does the checkout if that plugin is installed — otherwise check out the source branch with plain git first.

Warning

This skill never checks anything out. Whatever is in cwd is what gets reviewed. If you want PR context but are on the wrong branch, the diff will reflect the wrong starting point.

Notes

  • Read-only. Never posts PR comments. Posting is a separate concern — dev-azdo:pr (comments op) covers Azure DevOps if that plugin is installed.
  • Pipeline detail lives in references/pipeline.md — load only when running review.
  • No az, no gh, no PR-id resolution. PR resolution lives outside this skill — in dev-azdo:pr when installed, or in a shell wrapper. Absent that, the user checks out the branch themselves; this skill still works.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Structure AI work artifacts under .aiwork/{YYYY-MM-DD}_{slug}/ folders using the project's protocol (intent, triage, research, spec, prd, areas, plan, review, notes, docs/). Use when the user asks to plan, capture an intent, make a spec, triage, research a task, write a report, code review, summarize findings, save the work, document decisions, record this, write that down, persist findings, or references any path under .aiwork/. Also use when starting a non-trivial task that needs a plan or spec before implementation, or when finishing one and capturing notes.

日本語の概要は準備中です。原文の説明を表示しています。

lttr/claude-marketplace22026年10月6日 更新

Use this skill when the user asks to test, verify, interact with, or automate web pages and browsers. Trigger for requests involving Chrome automation, browser testing, web scraping, screenshot capture, element selection, or checking web applications. Also trigger when user mentions "browser tools" explicitly.

日本語の概要は準備中です。原文の説明を表示しています。

lttr/claude-marketplace22026年10月6日 更新

changelog

無料

Show recent Claude Code changes personalized to user's setup. Trigger when user asks about changelog, "what's new", "cc changelog", "claude code updates", "recent changes", or wants to know what changed in Claude Code.

日本語の概要は準備中です。原文の説明を表示しています。

lttr/claude-marketplace22026年10月6日 更新

Review code changes from current branch, an Azure DevOps PR, a git ref, or a diff/patch file. Trigger when user says "review this", "code review", "/df:code-review", or provides a PR id/URL, ticket URL, git ref, or diff path. Read-only — never posts comments.

日本語の概要は準備中です。原文の説明を表示しています。

lttr/claude-marketplace22026年10月6日 更新

Czech typography rules for web development. Use when building web pages in Czech language, writing Czech content, or fixing typography issues in Czech text. Covers punctuation, dashes, quotes, numbers, units, non-breaking spaces, and HTML entities.

日本語の概要は準備中です。原文の説明を表示しています。

lttr/claude-marketplace22026年10月6日 更新

Periodic dependency update run. Reads what the package manager says is outdated, upgrades what is safe, applies the code changes the new versions need, verifies, and opens one reviewable PR. Supports a read-only dry run that reports what it would do. Use when the user says "dependency update", "/dependency-update", "update deps", "dry run the dep update", or when a scheduled cloud routine fires.

日本語の概要は準備中です。原文の説明を表示しています。

lttr/claude-marketplace22026年10月6日 更新

lttr のスキルをすべて見る

このスキルの問題を報告する