con un clic
code-review
Dispatch a code reviewer subagent to catch issues before they cascade. Use after completing features, fixing complex bugs, or before merging.
Menú
Dispatch a code reviewer subagent to catch issues before they cascade. Use after completing features, fixing complex bugs, or before merging.
Generate a self-contained, human-friendly companion HTML report from a markdown AI-agent response (or any markdown document). The output is a single .html file with no external dependencies, an explicit light/dark mode toggle (with OS-preference default and persistence), and a layout chosen to fit the content type (explainer, comparison, decision doc, review feedback, status report, etc.).
Track project tasks and epics in individual markdown files under docs/tasks/, with docs/PROJECT.md as the central index. Supports bootstrapping new projects and managing ongoing work.
Create a new Linear ticket using the linear CLI
Configure a Hetzner Cloud Floating IP persistently on Ubuntu servers using Netplan. Ensures the floating IP survives reboots and is externally accessible.
Commit all changes, push to remote, and create a GitHub pull request with an auto-generated description if one doesn't already exist.
Initialize a fresh Hetzner Ubuntu server with a non-root user configured for Docker application deployment. Sets up secure SSH access, Docker permissions, and a dedicated data directory.
| name | code-review |
| description | Dispatch a code reviewer subagent to catch issues before they cascade. Use after completing features, fixing complex bugs, or before merging. |
| allowed-tools | ["Bash","Read","Grep","Task"] |
Dispatch a code reviewer subagent to evaluate completed work against requirements before issues cascade. The reviewer receives precisely crafted context — never your session history — keeping it focused on the work product.
Should use:
Nice to have:
| Placeholder | Description | Example |
|---|---|---|
{DESCRIPTION} | Brief summary of what was built | "Added verifyIndex() and repairIndex() with 4 issue types" |
{PLAN_OR_REQUIREMENTS} | What it should do — paste requirements, a plan excerpt, or task text | "Users must be able to reset their password via email link" |
{BASE_SHA} | Starting commit (exclusive) | a7981ec |
{HEAD_SHA} | Ending commit (inclusive) | 3df7661 |
{TEST_FILE_GLOBS} | (Optional) Test file patterns for the project | **/*.spec.ts, **/*_test.go |
# HEAD SHA is always the current commit
HEAD_SHA=$(git rev-parse HEAD)
# BASE SHA: use the merge base with main/master, or the previous commit
BASE_SHA=$(git merge-base origin/main HEAD 2>/dev/null || git rev-parse HEAD~1)
echo "Reviewing: $BASE_SHA..$HEAD_SHA"
git diff --stat "$BASE_SHA".."$HEAD_SHA"
Note: uncommitted or unstaged changes will not appear in the diff. Commit or stash any in-progress work before running the review.
Choose BASE_SHA based on the scope of the review:
git rev-parse HEAD~1git merge-base origin/main HEADBefore dispatching the code reviewer, dispatch a separate read-only Task subagent to check whether the PR diff is reviewable and scoped correctly. This catches noisy reviews where a branch contains duplicated cherry-picks from main, stale replayed commits, or a much broader diff than the PR description claims.
First identify {DESCRIPTION} and {PLAN_OR_REQUIREMENTS} using the guidance in Step 2. If they are not known yet, pause and gather them before running this preflight; the scope check needs the intended change to compare against the actual diff.
Use the Task tool with general subagent type:
Task tool (general):
description: "Check PR scope before review"
prompt: |
You are doing a read-only PR scope preflight before code review.
Git range:
Base: {BASE_SHA}
Head: {HEAD_SHA}
Description:
{DESCRIPTION}
Requirements / PR description:
{PLAN_OR_REQUIREMENTS}
Check for:
1. Duplicated changes already present on origin/main or the merge-base target.
2. Stale cherry-picks or replayed commits that reintroduce code already merged.
3. A diff that is materially broader than the description or requirements.
4. Unrelated file churn, generated files, lockfile/vendor updates, formatting-only rewrites, or large moves/renames that obscure the intended change.
Run only read-only git/file inspection commands. Suggested commands:
- git log --oneline --cherry-pick --right-only origin/main...HEAD
- git cherry -v origin/main HEAD
- git diff --stat {BASE_SHA}..{HEAD_SHA}
- git diff --name-status {BASE_SHA}..{HEAD_SHA}
- git diff --find-renames {BASE_SHA}..{HEAD_SHA}
- git log --oneline --decorate {BASE_SHA}..{HEAD_SHA}
If this is a GitHub PR and the PR number or URL is known, also inspect read-only PR metadata such as title, body, base branch, head branch, commit list, changed files, and merge state.
Return:
- Scope verdict: Clean / Needs attention / Block review
- Duplicate or stale changes found, with evidence
- Files or commits that appear unrelated to the description
- Recommended action before code review: proceed, narrow the range, rebase, split PR, create a fresh PR, update description, or stop
If the preflight verdict is Block review, stop before Step 4 and offer the user these choices:
Before offering to clean up duplicated code, stale cherry-picks, or replayed commits in an existing PR, always create a local backup branch from the current HEAD:
# Preserve the current PR state before any cleanup, rebase, or history rewrite
BACKUP_BRANCH="backup/pr-cleanup-$(date +%Y%m%d-%H%M%S)"
git branch "$BACKUP_BRANCH" HEAD
# Verify the backup branch points at the current PR HEAD
git rev-parse "$BACKUP_BRANCH"
git rev-parse HEAD
Tell the user the backup branch name before making cleanup changes. Do not delete the backup branch during the review session unless the user explicitly asks.
If the preflight verdict is Needs attention, summarize the concern and ask before dispatching the code reviewer unless the user already explicitly requested reviewing despite stale or duplicated changes.
Preflight must not rely only on commit SHAs: squash merges, cherry-picks, rebases, and backports can make commit identity misleading. Ask the subagent to compare content, file scope, and PR description as well as commit history.
Before dispatching the reviewer, check the test-to-source ratio of the diff:
# Source files changed (excluding tests)
git diff --name-only "$BASE_SHA".."$HEAD_SHA" -- \
':(exclude)*test*' ':(exclude)*spec*' ':(exclude)*_test.*' \
':(exclude)test_*' ':(exclude)__tests__/*'
# Test files changed
git diff --name-only "$BASE_SHA".."$HEAD_SHA" | grep -E '(test|spec|_test\.|test_|__tests__)'
If the project has a {TEST_FILE_GLOBS} pattern, use that instead of the defaults. This context helps the reviewer build the Test impact map from test-review-checklist.md.
Identify what to pass as {DESCRIPTION} and {PLAN_OR_REQUIREMENTS}:
Read code-reviewer.md — it is in the same directory as this SKILL.md file. Use the Read tool with the full path to locate it. Fill in the four placeholders in the content after the first horizontal rule (---):
{DESCRIPTION} → your description from Step 2{PLAN_OR_REQUIREMENTS} → your requirements from Step 2{BASE_SHA} → from Step 1{HEAD_SHA} → from Step 1Use the Task tool with general subagent type. Pass everything after the first --- in code-reviewer.md (with placeholders filled in) as the prompt:
Task tool (general):
description: "Review code changes"
prompt: <filled-in prompt from code-reviewer.md, starting after the first horizontal rule>
The subagent will run git diff against the SHA range, read the changed files, and return a structured review.
Triage the reviewer's findings by severity:
| Severity | Action |
|---|---|
| Critical | Fix immediately before proceeding |
| Important | Fix before merging |
| Minor | Note for later; optional before merge |
If the reviewer is wrong, push back with technical reasoning — show the code or tests that prove it works. If the review flags an issue with the plan rather than the implementation, note it separately.
After the subagent returns:
{DESCRIPTION} or {PLAN_OR_REQUIREMENTS}. Use placeholders like <REDACTED> if referencing secrets.BASE_SHA and HEAD_SHA are correct: git log --oneline "$BASE_SHA".."$HEAD_SHA"git fetch origin if reviewing remote commits{PLAN_OR_REQUIREMENTS} and proceed only after the user confirms{PLAN_OR_REQUIREMENTS} — paste the actual acceptance criteria rather than a vague summary{DESCRIPTION}git rev-parse --show-toplevel./code-reviewer.md (same directory as this file)./test-review-checklist.md (same directory as this file)