@chris1807/claude-kit 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
Review PR #$ARGUMENTS in the current project. Automatically:
|
|
2
2
|
|
|
3
|
-
1. **Read the full diff** — understand every change in the PR
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
1. **Read the full diff** — understand every change in the PR.
|
|
4
|
+
|
|
5
|
+
2. **Read the linked work item** and gather the full acceptance criteria.
|
|
6
|
+
|
|
7
|
+
3. **Detect rework context — do this BEFORE judging acceptance criteria.**
|
|
8
|
+
|
|
9
|
+
A small diff does not mean a small feature. The PR you are reviewing may be a rework that only addresses targeted feedback, while the bulk of the implementation already shipped in earlier PRs. Judging acceptance criteria against the current diff alone will produce false "not met" findings.
|
|
10
|
+
|
|
11
|
+
For each PR linked to the work item (via `relations` / artifact links), fetch its details and classify:
|
|
12
|
+
- **This PR** — the one being reviewed.
|
|
13
|
+
- **Prior merged PRs** — `status: completed` and merged before this PR was created. Their changes are already in the target branch.
|
|
14
|
+
- **Prior abandoned PRs** — ignore for acceptance-criteria coverage; their code is not in the target branch.
|
|
15
|
+
|
|
16
|
+
Also scan the work item comments for rework feedback posted after the most recent prior merged PR. That feedback is what the current PR is expected to address.
|
|
17
|
+
|
|
18
|
+
Treat the PR as a **rework** if any prior merged PR exists for this work item, OR if the work item has rework feedback comments dated after a prior PR. Otherwise treat it as an **initial PR**.
|
|
19
|
+
|
|
20
|
+
4. **Evaluate acceptance criteria against the cumulative work, not just this diff.**
|
|
21
|
+
|
|
22
|
+
- **Initial PR**: evaluate every acceptance criterion against this PR's diff.
|
|
23
|
+
- **Rework PR**: evaluate every acceptance criterion against (prior merged PRs' changes already in the target branch) + (this PR's diff). For criteria already satisfied by prior merged PRs, do not flag them as missing — mark them as **previously delivered** and only re-check them if this PR's diff touches the same area in a way that could regress the prior implementation.
|
|
24
|
+
|
|
25
|
+
When a rework PR's diff is small, the right question is **"does this diff correctly address the rework feedback, and does it avoid regressing the prior implementation?"** — not "does this diff implement every acceptance criterion from scratch?"
|
|
26
|
+
|
|
27
|
+
5. **Review for:**
|
|
6
28
|
- Clean Architecture boundaries (Domain has no infrastructure dependencies)
|
|
7
29
|
- Tenant/organizationId enforcement on all database queries
|
|
8
30
|
- Missing unit or integration tests for new code
|
|
@@ -11,20 +33,51 @@ Review PR #$ARGUMENTS in the current project. Automatically:
|
|
|
11
33
|
- Error handling (are exceptions caught appropriately?)
|
|
12
34
|
- Naming conventions and code style consistency
|
|
13
35
|
- Breaking changes or backwards compatibility issues
|
|
14
|
-
|
|
15
|
-
|
|
36
|
+
- **Rework-specific (if applicable):** does this diff fully address every item in the rework feedback? Does it regress anything that prior merged PRs delivered?
|
|
37
|
+
|
|
38
|
+
6. **Draft (do not post yet) the inline comments** for every finding. For each, capture: file path, line number, severity, and the exact comment body you intend to post.
|
|
39
|
+
|
|
40
|
+
7. **Draft (do not post yet) the PR-level summary comment** with:
|
|
41
|
+
- **PR type**: Initial PR or Rework (and if rework, list the prior merged PR numbers and the rework feedback being addressed)
|
|
16
42
|
- Overall assessment (ready to merge / needs changes)
|
|
17
43
|
- Count of issues by severity (critical / warning / suggestion)
|
|
18
|
-
- Acceptance criteria checklist
|
|
44
|
+
- **Acceptance criteria checklist**, with each item marked as one of:
|
|
45
|
+
- **met (this PR)** — satisfied by changes in this diff
|
|
46
|
+
- **met (prior PR #N)** — already delivered in a prior merged PR; not in this diff
|
|
47
|
+
- **not met** — not satisfied by any merged or pending change
|
|
48
|
+
- **not applicable** — out of scope for this work item
|
|
49
|
+
- **Rework feedback checklist** (rework PRs only) — each feedback item marked addressed / not addressed
|
|
19
50
|
- Test coverage assessment
|
|
20
51
|
|
|
21
|
-
|
|
52
|
+
8. **Preview every comment to me and wait for approval before posting anything to the PR.** Show:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
Review drafted — nothing has been posted to PR #{id} yet.
|
|
56
|
+
|
|
57
|
+
## Inline comments ({count})
|
|
58
|
+
1. {file}:{line} [{severity}] — {comment body}
|
|
59
|
+
2. ...
|
|
60
|
+
|
|
61
|
+
## PR summary comment
|
|
62
|
+
{full summary body as it will appear on the PR}
|
|
63
|
+
|
|
64
|
+
Reply with one of:
|
|
65
|
+
- "approve" → post all inline comments and the summary exactly as shown above
|
|
66
|
+
- "skip" → post nothing
|
|
67
|
+
- "edit <number>: <new text>" or "skip <numbers>" → revise/drop specific items, then I'll re-preview before posting
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Wait for my response. Never post any comment to the PR until I reply "approve".** If I edit or skip individual items, apply the changes and re-preview the full set before asking again. "skip" with no numbers means post nothing at all — move directly to step 9 without posting.
|
|
71
|
+
|
|
72
|
+
9. If I approved, post the inline comments and the summary to the PR. If I skipped, post nothing. Either way, then ask me:
|
|
22
73
|
```
|
|
23
|
-
|
|
74
|
+
{Comments posted to PR #{id}. | No comments posted (skipped).}
|
|
75
|
+
- PR type: {Initial | Rework of prior PR(s) #N, #M}
|
|
24
76
|
- X critical issues
|
|
25
77
|
- Y warnings
|
|
26
78
|
- Z suggestions
|
|
27
|
-
- Acceptance criteria: A
|
|
79
|
+
- Acceptance criteria: A met this PR, B met in prior PRs, C not met
|
|
80
|
+
- Rework feedback (if rework): D/E addressed
|
|
28
81
|
|
|
29
82
|
Approve, Request Changes, or skip the vote?
|
|
30
83
|
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Show which environments a work item is currently deployed to. Usage: `/where <work-item-id>`
|
|
2
|
+
|
|
3
|
+
Parse `$ARGUMENTS` to extract the work item ID. Accept formats like `AB#1234`, `#1234`, or just `1234`. If no ID is provided, report the error and stop.
|
|
4
|
+
|
|
5
|
+
## Step 1: Fetch the Work Item
|
|
6
|
+
|
|
7
|
+
Read the work item from Azure DevOps using the project from the current repo's CLAUDE.md configuration. Expand with `relations` so PR links are included.
|
|
8
|
+
|
|
9
|
+
If the work item is not found, report the error and stop.
|
|
10
|
+
|
|
11
|
+
Capture: id, title, type, state, and any linked Pull Request artifacts from `relations`.
|
|
12
|
+
|
|
13
|
+
## Step 2: Resolve the Environment Chain
|
|
14
|
+
|
|
15
|
+
Read the **Pipeline Configuration** table from the current repo's `CLAUDE.md`. The table rows define the environment branches in promotion order (top → bottom). Example:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
| Branch | Environment | Pipeline(s) |
|
|
19
|
+
|--------|------------|-------------|
|
|
20
|
+
| develop | Dev | ... |
|
|
21
|
+
| staging | Staging | ... |
|
|
22
|
+
| main | Production | ... |
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If the table is missing, report that the project has no pipeline configuration in `CLAUDE.md` and stop.
|
|
26
|
+
|
|
27
|
+
For each environment branch, run `git fetch origin <branch>` first so the local view is current.
|
|
28
|
+
|
|
29
|
+
## Step 3: Find the Commits for This Work Item
|
|
30
|
+
|
|
31
|
+
Locate the commits associated with the work item using these signals (combine results, dedupe by SHA):
|
|
32
|
+
|
|
33
|
+
1. **Linked PRs** — for each linked PR from Step 1, get the merge commit on the target branch (Azure DevOps API: `lastMergeCommit`).
|
|
34
|
+
2. **Commit message search** — `git log --all --grep="AB#<id>\b" --grep="#<id>\b" -i --format=%H` to catch commits whose messages reference the ID.
|
|
35
|
+
3. **Branch name** — `git log --all --format=%H` filtered to commits whose source branch matched `*AB#<id>-*` (use `git for-each-ref` + reflog if needed; skip if not resolvable).
|
|
36
|
+
|
|
37
|
+
If no commits are found, report:
|
|
38
|
+
```
|
|
39
|
+
AB#<id>: <title>
|
|
40
|
+
No commits found referencing this work item — not deployed to any environment.
|
|
41
|
+
```
|
|
42
|
+
and stop.
|
|
43
|
+
|
|
44
|
+
## Step 4: Check Each Environment
|
|
45
|
+
|
|
46
|
+
For each branch in the Pipeline Configuration table, determine whether **any** of the work item's commits is reachable from `origin/<branch>`:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
git merge-base --is-ancestor <commit> origin/<branch>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
A work item is "in" an environment if at least one of its commits is an ancestor of that environment's branch tip. Track which specific commits landed in which environment so partial deployments are visible.
|
|
53
|
+
|
|
54
|
+
## Step 5: Display the Result
|
|
55
|
+
|
|
56
|
+
Output a concise summary in plain language followed by a details block.
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
AB#<id>: <title>
|
|
60
|
+
<type> · <state>
|
|
61
|
+
|
|
62
|
+
This work item is in <env list joined with " and ">.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Where `<env list>` is the environments where the work item is present, in promotion order. If none, say "not deployed to any environment yet."
|
|
66
|
+
|
|
67
|
+
Then a details table:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
| Environment | Branch | Deployed | Commits |
|
|
71
|
+
|-------------|---------|----------|---------|
|
|
72
|
+
| Dev | develop | Yes | 2 of 2 |
|
|
73
|
+
| Staging | staging | Yes | 2 of 2 |
|
|
74
|
+
| Production | main | No | 0 of 2 |
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
- **Deployed**: Yes if at least one commit is reachable from the branch tip; No otherwise.
|
|
78
|
+
- **Commits**: how many of the work item's commits are present on that branch (e.g. `1 of 2` flags a partial cherry-pick).
|
|
79
|
+
|
|
80
|
+
If any linked PRs are still open (not merged), append:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
Open PRs:
|
|
84
|
+
- PR #<n> → <target branch> (<status>)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
That's it — read-only. Do not modify branches, push, or create PRs.
|