@chris1807/claude-kit 2.1.2 → 2.1.3

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@chris1807/claude-kit",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "Claude Code starter kit — agents, hooks, MCP servers, slash commands, and workflow automation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -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.