Skip to content

Commit e419202

Browse files
committed
feat(review): add commit mode to triage-review command
1 parent a0bfff1 commit e419202

8 files changed

Lines changed: 77 additions & 14 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
33
"name": "context-engineering-kit",
4-
"version": "3.4.0",
4+
"version": "3.5.0",
55
"description": "Hand-crafted collection of advanced context engineering techniques and patterns with minimal token footprint focused on improving agent result quality.",
66
"owner": {
77
"name": "NeoLabHQ",
@@ -22,7 +22,7 @@
2222
{
2323
"name": "review",
2424
"description": "Introduce codebase and PR review commands and skills using multiple specialized agents.",
25-
"version": "3.1.0",
25+
"version": "3.2.0",
2626
"author": {
2727
"name": "Vlad Goncharov",
2828
"email": "vlad.goncharov@neolab.finance"

docs/plugins/review/traiage-review.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,27 @@ An orchestrator agent launches four specialized triage agents in parallel, each
1313

1414
## Review Modes
1515

16-
The orchestrator auto-detects the review mode before launching any agents:
16+
The orchestrator determines the review mode before launching any agents, checking in this order:
1717

18-
- local changes - review staged, unstaged, and untracked changes
19-
- branch diff - review changes between current branch and default branch
18+
- **commit** - reviews the diff introduced by a single commit, not the whole changeset. Triggered by passing `commit <commit-hash>` (reviews that specific commit) or `commit` / `latest commit` with no hash (the orchestrator resolves HEAD to a concrete commit hash via `git rev-parse HEAD` and reviews that). This takes precedence over the other two modes.
19+
- **branch diff** - review changes between the current branch and the detected default branch (`origin/main` or `origin/master`). Triggered explicitly by passing `branch`, or automatically when there are no local changes and the current branch is not the default branch.
20+
- **local changes** - review staged, unstaged, and untracked changes. The default behavior when local changes exist and no other mode was requested.
21+
22+
## Usage
23+
24+
| Invocation | Mode | What it reviews |
25+
|------------|------|------------------|
26+
| `/traiage-review` | local changes (default) | Staged, unstaged, and untracked changes in the working tree |
27+
| `/traiage-review branch` | branch diff | Current branch vs. the detected default branch (`origin/main` or `origin/master`) |
28+
| `/traiage-review commit <commit-hash>` | commit | The diff introduced by that specific commit only |
29+
| `/traiage-review commit` | commit | The diff introduced by the latest commit (HEAD) |
30+
| `/traiage-review latest commit` | commit | The diff introduced by the latest commit (HEAD) - same as `commit` with no hash |
31+
32+
For the commit mode's two no-hash forms (`commit` and `latest commit`), the orchestrator resolves the latest commit to a concrete hash with `git rev-parse HEAD` before doing anything else, then treats it exactly like an explicitly given hash - every agent and the random-sample step receive that resolved concrete hash. The reviewed diff is the diff introduced by that single commit (equivalent to `git show <commit-hash>` or `git diff <commit-hash>^!`), not the cumulative diff up to that commit.
2033

2134
## Triage Agents
2235

23-
The four agents run in parallel, each receiving the mode-appropriate prompt (local-changes or branch-diff):
36+
The four agents run in parallel, each receiving the mode-appropriate prompt (local-changes, branch-diff, or commit):
2437

2538
| Agent | Focus |
2639
|-------|-------|

plugins/review/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "review",
3-
"version": "3.1.0",
3+
"version": "3.2.0",
44
"description": "Introduce codebase and PR review commands and skills using multiple specialized agents.",
55
"author": {
66
"name": "Vlad Goncharov",

plugins/review/agents/change-expectation-agent.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ Detect the review mode from the instruction you received:
2424
- `git diff HEAD` — unstaged changes
2525
- `git diff --cached` — staged changes
2626
- `git status` — overview of changed files
27+
- **Commit mode** — instruction says to review the diff introduced by a specific commit whose concrete hash is provided in the instruction (never the literal `HEAD` or `latest` — the orchestrator resolves that first). Use:
28+
- `git show <commit-hash>` or `git diff <commit-hash>^!` (equivalently `git diff <commit-hash>^ <commit-hash>`) — full commit diff
29+
- `git show --name-only --pretty=format: <commit-hash>` — file names only
2730

28-
Use only read-only git commands. The `origin/<default-branch>` value is provided in the instruction (e.g. `origin/main`).
31+
Use only read-only git commands. The `origin/<default-branch>` value is provided in the instruction (e.g. `origin/main`). In commit mode the concrete `<commit-hash>` is provided in the instruction.
2932

3033
## Process
3134

plugins/review/agents/change-failure-agent.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ Detect the review mode from the instruction you received:
2424
- `git diff HEAD` — unstaged changes
2525
- `git diff --cached` — staged changes
2626
- `git status` — overview of changed files
27+
- **Commit mode** — instruction says to review the diff introduced by a specific commit whose concrete hash is provided in the instruction (never the literal `HEAD` or `latest` — the orchestrator resolves that first). Use:
28+
- `git show <commit-hash>` or `git diff <commit-hash>^!` (equivalently `git diff <commit-hash>^ <commit-hash>`) — full commit diff
29+
- `git show --name-only --pretty=format: <commit-hash>` — file names only
2730

28-
Use only read-only git commands. The `origin/<default-branch>` value is provided in the instruction (e.g. `origin/main`).
31+
Use only read-only git commands. The `origin/<default-branch>` value is provided in the instruction (e.g. `origin/main`). In commit mode the concrete `<commit-hash>` is provided in the instruction.
2932

3033
## Process
3134

plugins/review/agents/change-impact-agent.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ Detect the review mode from the instruction you received:
2424
- `git diff HEAD` — unstaged changes
2525
- `git diff --cached` — staged changes
2626
- `git status` — overview of changed files
27+
- **Commit mode** — instruction says to review the diff introduced by a specific commit whose concrete hash is provided in the instruction (never the literal `HEAD` or `latest` — the orchestrator resolves that first). Use:
28+
- `git show <commit-hash>` or `git diff <commit-hash>^!` (equivalently `git diff <commit-hash>^ <commit-hash>`) — full commit diff
29+
- `git show --name-only --pretty=format: <commit-hash>` — file names only
2730

28-
Use only read-only git commands. The `origin/<default-branch>` value is provided in the instruction (e.g. `origin/main`).
31+
Use only read-only git commands. The `origin/<default-branch>` value is provided in the instruction (e.g. `origin/main`). In commit mode the concrete `<commit-hash>` is provided in the instruction.
2932

3033
## Process
3134

plugins/review/agents/change-story-agent.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ Detect the review mode from the instruction you received:
2424
- `git diff HEAD` — unstaged changes
2525
- `git diff --cached` — staged changes
2626
- `git status` — overview of changed files
27+
- **Commit mode** — instruction says to review the diff introduced by a specific commit whose concrete hash is provided in the instruction (never the literal `HEAD` or `latest` — the orchestrator resolves that first). Use:
28+
- `git show <commit-hash>` or `git diff <commit-hash>^!` (equivalently `git diff <commit-hash>^ <commit-hash>`) — full commit diff
29+
- `git show --name-only --pretty=format: <commit-hash>` — file names only
2730

28-
Use only read-only git commands. The `origin/<default-branch>` value is provided in the instruction (e.g. `origin/main`).
31+
Use only read-only git commands. The `origin/<default-branch>` value is provided in the instruction (e.g. `origin/main`). In commit mode the concrete `<commit-hash>` is provided in the instruction.
2932

3033
## Process
3134

plugins/review/skills/traiage-review/SKILL.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@ CRITICAL: Human attention and time is limited. Reviewer cannot check all existin
1717
- You ARE allowed to run the following read-only commands yourself, and ONLY these:
1818
- The random sample script (see "## Random Sample Script").
1919
- Read-only git detection commands needed for review-mode and default-branch detection: `git status`, `git diff --name-only`, `git branch`, `git symbolic-ref`, `git rev-parse`.
20+
- Read-only commit commands needed for commit-mode detection and latest-commit resolution: `git rev-parse HEAD` (resolve the latest commit), `git show --name-only`, `git diff` (commit-diff inspection).
2021
- You MUST NOT do any implementation work, read source files, or run any mutation git command (commit, stash, push, checkout, reset, revert, add, merge, rebase, etc.). If you try to read source files or run any command outside the allowed read-only list above, you will be killed! Your life is at stake!
2122

2223
## Process
2324

2425
1. Determine the review mode BEFORE launching agents:
25-
- If a `branch` param was passed to the skill → use the **branch-diff workflow** directly.
26+
- If a `commit` param was passed to the skill → use the **commit workflow** directly (this takes precedence over the local-changes/branch auto-detection below):
27+
- If a concrete commit hash was given (`commit <commit-hash>`) → use that hash.
28+
- If no hash was given (`commit` or `latest commit`) → resolve the latest commit with `git rev-parse HEAD` and use the resolved concrete hash.
29+
- Record the resolved concrete commit hash for use in the commit-mode prompt and the random sample script.
30+
- Else, if a `branch` param was passed to the skill → use the **branch-diff workflow** directly.
2631
- Else, check for local changes with a read-only command:
2732
`git status --porcelain` (non-empty output means staged, unstaged, or untracked changes exist).
2833
- If local changes exist → use the **local-changes workflow** (default behavior).
@@ -34,7 +39,7 @@ CRITICAL: Human attention and time is limited. Reviewer cannot check all existin
3439
- Primary: `git symbolic-ref --short refs/remotes/origin/HEAD` → strip the `origin/` prefix to get `main` or `master`.
3540
- Fallback (if primary fails): `git rev-parse --verify origin/main` — if it succeeds, default is `main`; otherwise try `git rev-parse --verify origin/master` — if it succeeds, default is `master`.
3641
- Record the detected default ref as `origin/<default-branch>` (e.g. `origin/main`) for use in the branch-mode prompt and the random sample script.
37-
2. Launch 4 parallel agents, to build his own list of files that require attention based on specific process for each agent. Pass the mode-appropriate agent prompt (see "## Agents"): the local-changes prompt for the local-changes workflow, or the branch-mode prompt (with the detected `origin/<default-branch>` filled in) for the branch-diff workflow.
42+
2. Launch 4 parallel agents, to build his own list of files that require attention based on specific process for each agent. Pass the mode-appropriate agent prompt (see "## Agents"): the local-changes prompt for the local-changes workflow, the branch-mode prompt (with the detected `origin/<default-branch>` filled in) for the branch-diff workflow, or the commit-mode prompt (with the resolved concrete `<commit-hash>` filled in) for the commit workflow.
3843
- change-story-agent
3944
- change-impact-agent
4045
- change-failure-agent
@@ -70,9 +75,19 @@ Review the diff of the current branch against the default branch `origin/<defaul
7075

7176
```
7277

78+
### Commit-mode prompt for commit workflow
79+
80+
Replace `<commit-hash>` with the concrete commit hash the orchestrator resolved:
81+
82+
```md
83+
84+
Review the diff introduced by commit `<commit-hash>` (use `git show <commit-hash>` or `git diff <commit-hash>^!`, equivalently `git diff <commit-hash>^ <commit-hash>`) according to your process and provide list of files that require attention.
85+
86+
```
87+
7388
## Random Sample Script
7489

75-
Use this script to pick 20 random files from the whole batch of changed files. Use the **local mode** block for the local-changes workflow (staged + unstaged + untracked) and the **branch mode** block for the branch-diff workflow (files changed between the default branch and the current branch). Replace `origin/<default-branch>` with the default ref you detected (e.g. `origin/main`).
90+
Use this script to pick 20 random files from the whole batch of changed files. Use the **local mode** block for the local-changes workflow (staged + unstaged + untracked), the **branch mode** block for the branch-diff workflow (files changed between the default branch and the current branch), and the **commit mode** block for the commit workflow (files changed by the commit). Replace `origin/<default-branch>` with the default ref you detected (e.g. `origin/main`), and `<commit-hash>` with the resolved concrete commit hash.
7691

7792
**Local mode** (staged + unstaged + untracked):
7893

@@ -118,6 +133,29 @@ print(random_files)
118133

119134
```
120135

136+
**Commit mode** (files changed by the commit):
137+
138+
```python
139+
140+
import random
141+
import subprocess
142+
143+
# Files changed by the commit
144+
commit = '<commit-hash>' # set to the resolved concrete commit hash
145+
changed_files = sorted(set(
146+
line for line in subprocess.check_output(
147+
['git', 'show', '--name-only', '--pretty=format:', commit]
148+
).decode('utf-8').splitlines()
149+
if line.strip()
150+
))
151+
152+
# Pick up to 20 random files (won't crash on small changesets)
153+
random_files = random.sample(changed_files, min(20, len(changed_files)))
154+
155+
print(random_files)
156+
157+
```
158+
121159
In list of random files, pick only files that relate to logic changes, ignore documentation, tests, configuration, etc. Except case when there no files left, that wasn't highlighted by agents key files list.
122160

123161
## Output Format

0 commit comments

Comments
 (0)