$npx -y skills add mgratzer/forge --skill forge-reflectReview current changes with a lean review flow. Works on a PR, branch diff, or uncommitted changes. Tiny low-risk diffs stay inline; larger or riskier changes use fresh-context review. Use when the user wants to self-review before committing, pushing, or requesting peer review.
| 1 | # Reflect |
| 2 | |
| 3 | Self-review current changes before committing, pushing, or requesting peer review. |
| 4 | |
| 5 | ## Input |
| 6 | |
| 7 | No primary argument required — automatically detects what to review. Optional: `-- <additional context>` for review focus guidance. |
| 8 | |
| 9 | ## Process |
| 10 | |
| 11 | ### Step 1: Identify Changes |
| 12 | |
| 13 | Detect the review scope by checking, in order: |
| 14 | |
| 15 | **1. PR for current branch:** |
| 16 | ```bash |
| 17 | gh pr view --json number,title,url 2>/dev/null |
| 18 | ``` |
| 19 | If a PR exists, note its number and URL for the report. |
| 20 | |
| 21 | **2. Branch diff vs default branch:** |
| 22 | ```bash |
| 23 | DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@') |
| 24 | CURRENT_BRANCH=$(git branch --show-current) |
| 25 | ``` |
| 26 | If on a branch different from default with commits ahead, use `$DEFAULT_BRANCH...HEAD`. |
| 27 | |
| 28 | **3. Uncommitted changes (staged + unstaged):** |
| 29 | ```bash |
| 30 | git diff --name-only # unstaged |
| 31 | git diff --name-only --cached # staged |
| 32 | ``` |
| 33 | If there are uncommitted changes, review those. |
| 34 | |
| 35 | **Use the first scope that has changes.** If nothing to review, tell the user. |
| 36 | |
| 37 | Collect the full diff and changed file list for the detected scope: |
| 38 | |
| 39 | ```bash |
| 40 | # PR or branch diff |
| 41 | git fetch origin |
| 42 | DEFAULT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') |
| 43 | git diff origin/$DEFAULT_BRANCH...HEAD |
| 44 | git diff --name-only origin/$DEFAULT_BRANCH...HEAD |
| 45 | |
| 46 | # Uncommitted changes (staged + unstaged combined) |
| 47 | git diff HEAD |
| 48 | git diff --name-only HEAD |
| 49 | ``` |
| 50 | |
| 51 | ### Step 2: Review Changes (delegate) |
| 52 | |
| 53 | Follow the [review-delegation](../_shared/review-delegation.md) process: collect materials, prefer one inline review pass for tiny low-risk diffs, otherwise run one fresh-context review pass by default, add a second pass only when risk justifies it, and aggregate findings. |
| 54 | |
| 55 | **Expected output:** Deduplicated findings grouped by file with severity tags (P0/P1/P2). |
| 56 | |
| 57 | ### Step 3: Quality Gates |
| 58 | |
| 59 | Run the project's lint, format, type check, and test commands. Fix issues and commit fixes. |
| 60 | |
| 61 | ### Step 4: Report |
| 62 | |
| 63 | Aggregate findings from all review passes (Step 2) with quality gate results (Step 3) into the summary format below. Deduplicate any findings flagged by multiple passes — keep the highest severity. |
| 64 | |
| 65 | ### Step 5: Triage Deferred Items |
| 66 | |
| 67 | Present each deferred improvement to the user and ask whether to **fix now** or **defer as a follow-up issue**. |
| 68 | |
| 69 | Bias hard toward **fix now**. Recommend deferral only when the finding is truly out of scope, materially expands the PR, or needs separate design/review. |
| 70 | |
| 71 | For each item, recommend one of: |
| 72 | - **Fix now** — default for in-scope findings and small follow-up work (e.g., missing tests, stale docs, duplicated lines, modest refactors that fit the current change) |
| 73 | - **Defer** — only for larger or truly out-of-scope changes (e.g., a cross-cutting refactor, a new feature, a separate migration strategy) |
| 74 | |
| 75 | State your recommendation and let the user decide. Then: |
| 76 | - **Fix now items:** apply the fix and commit it |
| 77 | - **Deferred items:** create an Issue in the project's Issue tracker (see [issue-operations](../_shared/issue-operations.md)) with context and proposed solution |
| 78 | |
| 79 | ## Output Format |
| 80 | |
| 81 | ```text |
| 82 | ## Reflection Summary |
| 83 | |
| 84 | **Scope:** <PR #N | branch <name> vs <default> | uncommitted changes> |
| 85 | |
| 86 | ### Findings |
| 87 | #### <file> |
| 88 | - [P0/P1/P2] <finding> |
| 89 | |
| 90 | ### Deferred Items |
| 91 | - Fixed: <what was addressed> |
| 92 | - Created #<num>: <title> |
| 93 | - (or: None identified) |
| 94 | |
| 95 | ### Quality Gates |
| 96 | - Lint: ✓/✗ |
| 97 | - Format: ✓/✗ |
| 98 | - Types: ✓/✗ |
| 99 | - Tests: ✓/✗ |
| 100 | |
| 101 | (Use severity tags: P0, P1, P2. Omit P3 — see [review rubric](../_shared/review-rubric.md).) |
| 102 | ``` |
| 103 | |
| 104 | ## Guidelines |
| 105 | |
| 106 | - **Pattern consistency is the highest-value check** |
| 107 | - **Tiny low-risk diffs stay inline** — avoid fresh-context overhead when the change is obviously small |
| 108 | - **Keep review lean** — one reviewer by default, second only when risk justifies it |
| 109 | - **Skip noise** — see [review rubric](../_shared/review-rubric.md) |
| 110 | - **Bias toward fixing in the same PR** — only create Issues for confirmed deferrals that are truly larger or out of scope |
| 111 | - **Aggregate and deduplicate** — merge overlapping findings, keep highest severity |
| 112 | |
| 113 | ## Related Skills |
| 114 | |
| 115 | **After review:** Use `forge-address-pr-feedback` to address reviewer feedback. |
| 116 | **Single invocation:** Use `forge-ship` to implement and review in one step. |
| 117 | |
| 118 | ## Example Usage |
| 119 | |
| 120 | ``` |
| 121 | /forge-reflect |
| 122 | /forge-reflect -- pay extra attention to migration safety and missing regression tests |
| 123 | ``` |