claude-dev-env 8.126.4 → 8.126.5

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.
@@ -11,7 +11,7 @@ User-level rule: applies to **every** git repo that uses GitHub with `gh`. Small
11
11
 
12
12
  ### Workflow decision tree
13
13
 
14
- **When to use stacked PRs:** Feature B depends on Feature A's implementation. See the Delivery section of `~/.claude/docs/rule-guides/verified-work.md`. To decide where to cut, or to split an open PR, read [the slice test](reference/split-a-pull-request.md).
14
+ **When to use stacked PRs:** Feature B depends on Feature A's implementation. See the Delivery section of `~/.claude/docs/rule-guides/verified-work.md`. To decide where to cut, or to split an open PR, read [the slice test](reference/split-a-pull-request.md). Every PR, stacked or not, checks [the size bar](reference/split-a-pull-request.md#size-bar).
15
15
 
16
16
  **When to extract shared infrastructure first:** Multiple features need same utilities/helpers
17
17
 
@@ -7,13 +7,23 @@ A slice is worth its own pull request when all four tests hold:
7
7
  3. It reverts alone.
8
8
  4. One sentence states its purpose, and a reviewer can judge it without reading later levels. A slice that needs two sentences is usually two slices.
9
9
 
10
- A cut by folder, file count, or line cap that fails these tests is cosmetic. Merge it back. Fewer slices is a valid answer, and so is one pull request with a stated reason.
10
+ A cut by folder, file count, or line cap that fails these tests is cosmetic, and the [size bar](#size-bar) only says when to look for a seam. Merge it back. Fewer slices is a valid answer, and so is one pull request with a stated reason.
11
11
 
12
12
  Split when the change carries more than one purpose, or when one small part carries the behaviour change and its risk while the rest is library, data, or docs. Isolate the part that switches the behaviour on, so its revert is small.
13
13
 
14
- Try the cheaper move first. Mark generated or data files that swell the diff with a `linguist-generated` line in `.gitattributes`, then judge the size again.
14
+ Try the cheaper move first. Mark generated or data files that swell the diff with a `linguist-generated` line in `.gitattributes`, then judge the size again against the [size bar](#size-bar).
15
15
 
16
- Decide the slices when you write the plan. The Delivery section of `~/.claude/docs/rule-guides/verified-work.md` already commits each verified piece as its own level. The steps below repair a pull request where that did not happen.
16
+ Decide the slices when you write the plan. The Delivery section of `~/.claude/docs/rule-guides/verified-work.md` already commits each verified piece as its own level. The steps in [Split a pull request that is already open](#split-a-pull-request-that-is-already-open) repair a pull request where that did not happen.
17
+
18
+ ## Size bar
19
+
20
+ Apply the bar to each pull request, including each stack level. The bar only says when to look for a seam. Every cut still passes the four tests. Count added plus deleted lines, tests included, without lockfiles and without files marked `linguist-generated`. A renamed or moved file counts only its edited lines. Count against the merge base with the target branch, which for a stack level is the branch below it.
21
+
22
+ - Up to 400 lines fits one review, and about 100 lines reads best.
23
+ - Over 400 lines, look for a seam that passes the four tests. When none passes, keep the slice whole and state the reason in the pull request body.
24
+ - Over 1,000 lines, put that reason under a `## Why one pull request` heading.
25
+
26
+ Sources: [Google small CLs](https://google.github.io/eng-practices/review/developer/small-cls.html) and [SmartBear code review practices](https://smartbear.com/learn/code-review/best-practices-for-peer-code-review/).
17
27
 
18
28
  ## Split a pull request that is already open
19
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-dev-env",
3
- "version": "8.126.4",
3
+ "version": "8.126.5",
4
4
  "description": "Claude Code development standards — rules, hooks, agents, commands, and skills",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,4 +1,4 @@
1
- """The pr-lifecycle skill points at the slice rule, and the reference carries the four tests and the retro-split steps."""
1
+ """The pr-lifecycle skill points at the slice rule, and the reference carries the four tests, the size bar, and the retro-split steps."""
2
2
 
3
3
  from pathlib import Path
4
4
 
@@ -35,7 +35,7 @@ def test_the_reference_lists_the_four_slice_tests_in_order() -> None:
35
35
  def test_the_reference_merges_cosmetic_cuts_back_and_allows_one_pull_request() -> None:
36
36
  reference_text = SLICE_REFERENCE_PATH.read_text(encoding="utf-8")
37
37
  assert (
38
- "A cut by folder, file count, or line cap that fails these tests is cosmetic. Merge it back."
38
+ "A cut by folder, file count, or line cap that fails these tests is cosmetic, and the [size bar](#size-bar) only says when to look for a seam. Merge it back."
39
39
  in reference_text
40
40
  )
41
41
  assert (
@@ -83,3 +83,45 @@ def test_the_retro_split_links_the_stack_level_proof_and_does_not_copy_it() -> N
83
83
  assert "(../SKILL.md#each-stack-level-stands-on-its-own)" in reference_text
84
84
  assert "A symbol belongs at the level that first" not in reference_text
85
85
  assert "CI runs only on the stack tip" in reference_text
86
+
87
+
88
+ def test_the_decision_tree_points_every_pull_request_at_the_size_bar() -> None:
89
+ decision_tree = _decision_tree(PR_LIFECYCLE_PATH.read_text(encoding="utf-8"))
90
+ assert (
91
+ "Every PR, stacked or not, checks [the size bar](reference/split-a-pull-request.md#size-bar)."
92
+ in decision_tree
93
+ )
94
+
95
+
96
+ def test_the_reference_sets_a_size_bar_after_the_four_tests() -> None:
97
+ reference_text = SLICE_REFERENCE_PATH.read_text(encoding="utf-8")
98
+ fourth_test_position = reference_text.index("4. One sentence states its purpose")
99
+ size_bar_position = reference_text.index("## Size bar")
100
+ assert fourth_test_position < size_bar_position
101
+ retro_split_position = reference_text.index(
102
+ "## Split a pull request that is already open"
103
+ )
104
+ assert size_bar_position < retro_split_position
105
+ size_bar = reference_text[size_bar_position:retro_split_position]
106
+ all_required_phrases = (
107
+ "Apply the bar to each pull request, including each stack level.",
108
+ "A renamed or moved file counts only its edited lines.",
109
+ "Count against the merge base with the target branch, which for a stack level is the branch below it.",
110
+ "Every cut still passes the four tests.",
111
+ "Count added plus deleted lines, tests included, without lockfiles",
112
+ "without files marked `linguist-generated`",
113
+ "Up to 400 lines fits one review, and about 100 lines reads best.",
114
+ "Over 400 lines, look for a seam that passes the four tests.",
115
+ "When none passes, keep the slice whole and state the reason in the pull request body.",
116
+ "Over 1,000 lines, put that reason under a `## Why one pull request` heading.",
117
+ "google.github.io/eng-practices/review/developer/small-cls.html",
118
+ "smartbear.com/learn/code-review/best-practices-for-peer-code-review",
119
+ )
120
+ for each_phrase in all_required_phrases:
121
+ assert each_phrase in size_bar, each_phrase
122
+ all_bullet_positions = [
123
+ size_bar.index("- Up to 400 lines"),
124
+ size_bar.index("- Over 400 lines"),
125
+ size_bar.index("- Over 1,000 lines"),
126
+ ]
127
+ assert all_bullet_positions == sorted(all_bullet_positions)