code-review
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", "code review", "/df:code-review", or provides a git ref or diff path. Read-only — never posts comments.
What this skill does
# 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. | Flag | Meaning | | ---------------- | -------------------------------------------- | | `--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. | | `--print` | Print 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: | Form | Source | | ------------------------------- | ------------------------------------- | | empty | current branch vs base (master/main) | | `staged` | `git diff --staged` | | path ending `.diff` or `.patch` | local diff file | | anything else | treat 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 ```bash 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/review-diff-$(date +%s).diff" files=$(git diff --name-only "$base"...HEAD) title="$cur" slug="$cur" ``` #### `staged` ```bash git diff --staged > "/tmp/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 ```bash git diff "<ref>"...HEAD > "/tmp/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 ```bash 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. ```bash #!/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" "/df:code-review --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 (e.g. `/df:pr checkout <id>` for Azure DevOps), then invoke `/df:code-review`. The skill reviews the current branch vs base. ### 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. For comments use `pr-comments` skill. - Pipeline detail lives in `references/pipeline.md` — load only when running review. - No `az`, no `gh`, no PR-id resolution. PR resolution lives in `df:pr`, `df:az-cli`, or shell wrappers.
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.