fix(check): default review scope to HEAD
This commit is contained in:
+11
-11
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: check
|
||||
description: Fast pre-integration review of current changes or specified paths. Use when the user invokes $check, asks to run a check pass, or wants a quick high-signal review before committing, opening a PR, merging, rebasing, or shipping. Uses independent read-only area reviewers. Focus on reuse, quality, correctness, efficiency, local conventions, and high-confidence findings.
|
||||
description: Fast pre-commit or pre-integration review of current changes or specified paths. Use when the user invokes $check, asks to run a check pass, or wants a quick high-signal review before committing, opening a PR, merging, rebasing, or shipping. Uses independent read-only area reviewers. Focus on reuse, quality, correctness, efficiency, local conventions, and high-confidence findings.
|
||||
---
|
||||
|
||||
# Check
|
||||
@@ -29,10 +29,10 @@ $check --patch HEAD~1 src/foo.rs
|
||||
|
||||
Inputs resolve to one review scope. Flags may appear in any order. Support `--` to end flag parsing when a path starts with `-`.
|
||||
|
||||
- No scope flag: review current changes, which means the current branch compared with the inferred base branch, plus staged and unstaged changes. Paths narrow current changes to those files or directories.
|
||||
- No scope flag: review staged and unstaged changes compared with `HEAD`. Committed local branch changes are out of scope unless the user passes `--base` or `--patch`. Paths narrow those changes to those files or directories.
|
||||
- `--files <path...>`: review the current contents of those files or directories.
|
||||
- `--staged [path...]`: review staged changes only. Paths narrow staged changes to those files or directories.
|
||||
- `--base <rev> [path...]`: review current changes against the requested base revision. Paths narrow current changes to those files or directories.
|
||||
- `--base <rev> [path...]`: review committed branch changes plus staged and unstaged changes against the requested base revision. Use this for integration-style review. Paths narrow current changes to those files or directories.
|
||||
- `--patch <rev> [path...]`: review the patch introduced by the requested Git revision. Paths narrow the patch to those files or directories. Accept revision expressions that resolve to a commit, such as a branch, tag, full SHA, short SHA, or `HEAD~2`. For merge commits, review against the first parent unless the user explicitly asks for a different parent.
|
||||
|
||||
Use at most one scope flag. If `--files` has no paths, if a flag is unknown, if a required value is missing, or if a revision cannot be resolved to a commit, ask for clarification.
|
||||
@@ -44,14 +44,13 @@ Use at most one scope flag. If `--files` has no paths, if a flag is unknown, if
|
||||
### Parent
|
||||
|
||||
1. Parse the invocation into a review target. Reviewers should not need to know which input flags produced it.
|
||||
- `kind`: `current_changes`, `file_contents`, `staged`, or `patch`.
|
||||
- `base_revision`: set only when `kind` is `current_changes` and the user requested a base revision.
|
||||
- `kind`: `uncommitted`, `base`, `file_contents`, `staged`, or `patch`.
|
||||
- `base_revision`: set only when `kind` is `base`.
|
||||
- `patch_revision`: set only when `kind` is `patch`.
|
||||
- `paths`: optional for `current_changes`, `staged`, and `patch`. Required for `file_contents`.
|
||||
- `paths`: optional for `uncommitted`, `base`, `staged`, and `patch`. Required for `file_contents`.
|
||||
2. Resolve shared revisions before spawning reviewers.
|
||||
- For `kind: current_changes`, set `resolved_base_revision`.
|
||||
- If `base_revision` is set, resolve it to a commit or ask for clarification if it cannot be resolved.
|
||||
- If `base_revision` is unset, try `origin/HEAD`, `main`, and `master` one at a time in that order. Stop after the first successful resolution. Ask only if none can be resolved.
|
||||
- For `kind: uncommitted`, no base resolution is needed. Review against `HEAD` and do not infer a base branch.
|
||||
- For `kind: base`, resolve `base_revision` to a commit and set `resolved_base_revision`. Ask for clarification if it cannot be resolved.
|
||||
- For `kind: patch`, resolve `patch_revision` to a commit and set `resolved_patch_revision`. Ask for clarification if it cannot be resolved.
|
||||
3. Spawn four read-only subagents with `fork_context: false`, preferably in parallel, one for each area: Reuse, Quality, Correctness, and Efficiency.
|
||||
4. For each reviewer, pass the repo root, review target, assigned area, the `### Reviewer` section, and only the matching subsection from `### Areas`.
|
||||
@@ -68,11 +67,12 @@ Use at most one scope flag. If `--files` has no paths, if a flag is unknown, if
|
||||
|
||||
Before using tools, treat this as an already spawned read-only reviewer task. Do not invoke skills, spawn agents, edit files, ask for approval, or send progress updates. Return only raw findings or exactly `Nothing flagged`.
|
||||
1. Resolve the review target.
|
||||
- `kind: current_changes`: review committed branch changes plus staged and unstaged changes. Use `resolved_base_revision` when provided. Otherwise resolve the base from `base_revision`, then `origin/HEAD`, then `main`, then `master`. Try candidates one at a time in that order and stop after the first successful resolution. Ask only if none can be resolved.
|
||||
- `kind: uncommitted`: review staged and unstaged changes compared with `HEAD`. Do not compare against a base branch.
|
||||
- `kind: base`: review committed branch changes plus staged and unstaged changes against the requested base. Use `resolved_base_revision` when provided. Otherwise resolve `base_revision` to a commit. Ask for clarification if it cannot be resolved.
|
||||
- `kind: file_contents`: review current contents of the requested files or directories, recursing into directories.
|
||||
- `kind: staged`: review staged changes only.
|
||||
- `kind: patch`: review only the patch introduced by `patch_revision`. Use `resolved_patch_revision` when provided. Otherwise resolve the revision to a commit with `git rev-parse --verify <patch_revision>^{commit}`. Compare the commit's first parent to the commit. For root commits, compare the empty tree to the commit.
|
||||
- If `paths` are set on `current_changes`, `staged`, or `patch`, limit the selected diff to those paths.
|
||||
- If `paths` are set on `uncommitted`, `base`, `staged`, or `patch`, limit the selected diff to those paths.
|
||||
2. Read local context before judging code. Check `AGENTS.md`, `TODO.md`, and `BACKLOG.md` at the repo root and in relevant subdirectories when they exist.
|
||||
3. Identify touched files and related files needed to understand the change. Read in-scope files fully enough to understand surrounding code, not only changed hunks.
|
||||
4. Review the assigned area:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
interface:
|
||||
display_name: "Check"
|
||||
short_description: "Fast pre-integration change review"
|
||||
short_description: "Fast pre-commit or integration review"
|
||||
default_prompt: "Use $check to review my current changes before I commit, open a PR, or merge."
|
||||
|
||||
policy:
|
||||
|
||||
Reference in New Issue
Block a user