jez 0.1.0

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d789cfbfc272355110d15bcd1c3be934b119f778f683dd136dc31d728a33f3dd
4
+ data.tar.gz: 86954cb55dcc6573f1c50a868a23e36823972f8f626fcf5bca9232d9d37336b3
5
+ SHA512:
6
+ metadata.gz: 99cf56b80e7fe7fe4e5a672af1a307e4a43905f52e723a25667254f53696b7e8ea7b822ce540d5eddccb66bf075f5e03351404cc4496c47bdeb4861224e3cd73
7
+ data.tar.gz: dd77da0ebe6764508302616f0b40284d3260bb050e904941ec3420427e3532089c21662ccaa235b1d821d19a066764ecc43d5f4e198eba32cf396078a8c97171
data/.reek.yml ADDED
@@ -0,0 +1,59 @@
1
+ detectors:
2
+ # Private helpers that format or parse external data are not misplaced behavior.
3
+ UtilityFunction:
4
+ public_methods_only: true
5
+ # Disables keeps no state, but its role still requires an instance.
6
+ exclude:
7
+ - "RubyQuality::Measures::Disables#observe"
8
+ # Reek counts each block body as statements, so a four-line method can reach seven.
9
+ TooManyStatements:
10
+ max_statements: 7
11
+ # A second read of a Data member is clearer than a local variable.
12
+ DuplicateMethodCall:
13
+ max_calls: 2
14
+ # group_by followed by map is one idea, not nested logic.
15
+ NestedIterators:
16
+ max_allowed_nesting: 2
17
+ # Keyword arguments name themselves.
18
+ LongParameterList:
19
+ max_params: 5
20
+ exclude:
21
+ - "RubyQuality::Observation#initialize"
22
+ # Tool adapters exist to read the tool's output, so they envy it by design.
23
+ FeatureEnvy:
24
+ exclude:
25
+ - "RubyQuality::Measures"
26
+ - "JezEval::Transcript"
27
+
28
+ directories:
29
+ "tests":
30
+ DuplicateMethodCall:
31
+ enabled: false
32
+ FeatureEnvy:
33
+ enabled: false
34
+ InstanceVariableAssumption:
35
+ enabled: false
36
+ IrresponsibleModule:
37
+ enabled: false
38
+ TooManyStatements:
39
+ enabled: false
40
+ UtilityFunction:
41
+ enabled: false
42
+ # Hidden acceptance tests for eval fixtures are tests too.
43
+ "evals/fixtures/*/hidden":
44
+ BooleanParameter:
45
+ enabled: false
46
+ DuplicateMethodCall:
47
+ enabled: false
48
+ Attribute:
49
+ enabled: false
50
+ InstanceVariableAssumption:
51
+ enabled: false
52
+ TooManyStatements:
53
+ enabled: false
54
+ # Reference solutions' tests for eval fixtures are tests too.
55
+ "evals/fixtures/*/reference/test":
56
+ InstanceVariableAssumption:
57
+ enabled: false
58
+ IrresponsibleModule:
59
+ enabled: false
data/.rubocop.yml ADDED
@@ -0,0 +1,29 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ SuggestExtensions: false
4
+ TargetRubyVersion: 3.2
5
+
6
+ # Keyword arguments name themselves; Data constructors take one per member.
7
+ Metrics/ParameterLists:
8
+ CountKeywordArgs: false
9
+
10
+ # Matches the other Ruby skills in this repository, which rely on Ruby's own string handling.
11
+ Style/FrozenStringLiteralComment:
12
+ Enabled: false
13
+
14
+ Style/StringLiterals:
15
+ EnforcedStyle: double_quotes
16
+
17
+ Style/StringLiteralsInInterpolation:
18
+ EnforcedStyle: double_quotes
19
+
20
+ # Test classes are described by their test names.
21
+ Style/Documentation:
22
+ Exclude:
23
+ - "tests/**/*"
24
+ - "evals/fixtures/*/hidden/**/*"
25
+ - "evals/fixtures/*/reference/test/**/*"
26
+
27
+ # Name rescued errors for what they are, as the naming guidance asks.
28
+ Naming/RescuedExceptionsVariableName:
29
+ PreferredName: error
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ## [0.1.0]
6
+
7
+ ### Added
8
+
9
+ - Interactive `jez decide` for choosing a Precise, Progressive, or Pragmatic approach and drafting a plan.
10
+ - A bundled design skill with installation support for Claude Code, Codex, and Antigravity.
11
+ - `jez check` for detecting Ruby quality regressions or applying strict thresholds to an explicit scope.
12
+ - Optional advisory edit hooks for Claude Code and Codex.
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source "https://rubygems.org"
2
+
3
+ ruby ">= 3.2", "< 5.0"
4
+
5
+ gem "flay", "~> 2.14"
6
+ gem "flog", "~> 4.9"
7
+ gem "reek", "~> 6.5"
8
+ gem "rubocop", "~> 1.92"
9
+ gem "rubycritic", "~> 4.12"
10
+
11
+ group :development, :test do
12
+ gem "minitest", "~> 6.0"
13
+ gem "rake", "~> 13.0"
14
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,203 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ addressable (2.9.2)
5
+ public_suffix (>= 2.0.2, < 8.0)
6
+ ast (2.4.3)
7
+ axiom-types (0.1.1)
8
+ descendants_tracker (~> 0.0.4)
9
+ ice_nine (~> 0.11.0)
10
+ thread_safe (~> 0.3, >= 0.3.1)
11
+ bigdecimal (4.1.3)
12
+ childprocess (5.1.0)
13
+ logger (~> 1.5)
14
+ coercible (1.0.0)
15
+ descendants_tracker (~> 0.0.1)
16
+ concurrent-ruby (1.3.8)
17
+ descendants_tracker (0.0.4)
18
+ thread_safe (~> 0.3, >= 0.3.1)
19
+ drb (2.2.3)
20
+ dry-configurable (1.4.0)
21
+ dry-core (~> 1.0)
22
+ zeitwerk (~> 2.6)
23
+ dry-core (1.2.0)
24
+ concurrent-ruby (~> 1.0)
25
+ logger
26
+ zeitwerk (~> 2.6)
27
+ dry-inflector (1.3.1)
28
+ dry-initializer (3.2.0)
29
+ dry-logic (1.6.0)
30
+ bigdecimal
31
+ concurrent-ruby (~> 1.0)
32
+ dry-core (~> 1.1)
33
+ zeitwerk (~> 2.6)
34
+ dry-schema (1.16.0)
35
+ concurrent-ruby (~> 1.0)
36
+ dry-configurable (~> 1.0, >= 1.0.1)
37
+ dry-core (~> 1.1)
38
+ dry-initializer (~> 3.2)
39
+ dry-logic (~> 1.6)
40
+ dry-types (~> 1.9, >= 1.9.1)
41
+ zeitwerk (~> 2.6)
42
+ dry-types (1.9.1)
43
+ bigdecimal (>= 3.0)
44
+ concurrent-ruby (~> 1.0)
45
+ dry-core (~> 1.0)
46
+ dry-inflector (~> 1.0)
47
+ dry-logic (~> 1.4)
48
+ zeitwerk (~> 2.6)
49
+ erubi (1.13.1)
50
+ flay (2.14.5)
51
+ erubi (~> 1.10)
52
+ path_expander (~> 2.0)
53
+ prism (>= 1.9, < 3)
54
+ sexp_processor (~> 4.0)
55
+ flog (4.9.4)
56
+ path_expander (~> 2.0)
57
+ prism (~> 1.7)
58
+ sexp_processor (~> 4.8)
59
+ ice_nine (0.11.2)
60
+ json (3.1.0)
61
+ language_server-protocol (3.17.0.6)
62
+ launchy (3.1.1)
63
+ addressable (~> 2.8)
64
+ childprocess (~> 5.0)
65
+ logger (~> 1.6)
66
+ lint_roller (1.1.0)
67
+ logger (1.7.0)
68
+ minitest (6.1.0)
69
+ drb (~> 2.0)
70
+ prism (>= 1.5, < 3)
71
+ parallel (2.3.0)
72
+ parser (3.3.13.0)
73
+ ast (~> 2.4.1)
74
+ racc
75
+ path_expander (2.0.1)
76
+ prism (1.9.0)
77
+ public_suffix (7.0.5)
78
+ racc (1.8.1)
79
+ rainbow (3.1.1)
80
+ rake (13.4.2)
81
+ reek (6.5.0)
82
+ dry-schema (~> 1.13)
83
+ logger (~> 1.6)
84
+ parser (~> 3.3.0)
85
+ rainbow (>= 2.0, < 4.0)
86
+ rexml (~> 3.1)
87
+ regexp_parser (2.13.1)
88
+ rexml (3.4.4)
89
+ rubocop (1.92.2)
90
+ json (>= 2.3)
91
+ language_server-protocol (~> 3.17.0.2)
92
+ lint_roller (~> 1.1.0)
93
+ parallel (>= 1.10)
94
+ parser (>= 3.3.0.2)
95
+ rainbow (>= 2.2.2, < 4.0)
96
+ regexp_parser (>= 2.11.3, < 3.0)
97
+ rubocop-ast (>= 1.49.0, < 2.0)
98
+ ruby-progressbar (~> 1.7)
99
+ unicode-display_width (>= 2.4.0, < 4.0)
100
+ rubocop-ast (1.51.0)
101
+ parser (>= 3.3.7.2)
102
+ prism (>= 1.7)
103
+ ruby-progressbar (1.13.0)
104
+ ruby_parser (3.22.0)
105
+ racc (~> 1.5)
106
+ sexp_processor (~> 4.16)
107
+ rubycritic (4.12.0)
108
+ flay (~> 2.13)
109
+ flog (~> 4.7)
110
+ launchy (>= 2.5.2)
111
+ parser (>= 3.3.0.5)
112
+ prism (>= 1.6.0)
113
+ rainbow (~> 3.1.1)
114
+ reek (~> 6.5.0, < 7.0)
115
+ rexml
116
+ ruby_parser (~> 3.21)
117
+ simplecov (>= 0.22.0)
118
+ tty-which (~> 0.5.0)
119
+ virtus (~> 2.0)
120
+ sexp_processor (4.17.6)
121
+ simplecov (1.3.2)
122
+ thread_safe (0.3.6)
123
+ tty-which (0.5.0)
124
+ unicode-display_width (3.3.0)
125
+ unicode-emoji (~> 4.3)
126
+ unicode-emoji (4.3.0)
127
+ virtus (2.0.0)
128
+ axiom-types (~> 0.1)
129
+ coercible (~> 1.0)
130
+ descendants_tracker (~> 0.0, >= 0.0.3)
131
+ zeitwerk (2.8.3)
132
+
133
+ PLATFORMS
134
+ arm64-darwin-25
135
+ ruby
136
+
137
+ DEPENDENCIES
138
+ flay (~> 2.14)
139
+ flog (~> 4.9)
140
+ minitest (~> 6.0)
141
+ rake (~> 13.0)
142
+ reek (~> 6.5)
143
+ rubocop (~> 1.92)
144
+ rubycritic (~> 4.12)
145
+
146
+ CHECKSUMS
147
+ addressable (2.9.2) sha256=9117c7e7d6ee07230e75ce41fb9401ae55354dc654fcd0e862ba41d539e9a610
148
+ ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
149
+ axiom-types (0.1.1) sha256=c1ff113f3de516fa195b2db7e0a9a95fd1b08475a502ff660d04507a09980383
150
+ bigdecimal (4.1.3) sha256=61ebe1e5e559bdc3cc6f2c0ee7f427321fc838f59611c294356eb04d6e21cf66
151
+ bundler (4.0.23) sha256=407ba8a1d928f412847f819aa5f8b6aef7c59fb51feb517112af8a165487287b
152
+ childprocess (5.1.0) sha256=9a8d484be2fd4096a0e90a0cd3e449a05bc3aa33f8ac9e4d6dcef6ac1455b6ec
153
+ coercible (1.0.0) sha256=5081ad24352cc8435ce5472bc2faa30260c7ea7f2102cc6a9f167c4d9bffaadc
154
+ concurrent-ruby (1.3.8) sha256=b2f1be836e968ccc78ccfce277ea79c72a88633f22306782c16ff23fb415d1e1
155
+ descendants_tracker (0.0.4) sha256=e9c41dd4cfbb85829a9301ea7e7c48c2a03b26f09319db230e6479ccdc780897
156
+ drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
157
+ dry-configurable (1.4.0) sha256=e35d1b5f3c081753ef361f564919db79000f32cfa6f20ee3a3ba5921b41b73ce
158
+ dry-core (1.2.0) sha256=0cc5a7da88df397f153947eeeae42e876e999c1e30900f3c536fb173854e96a1
159
+ dry-inflector (1.3.1) sha256=7fb0c2bb04f67638f25c52e7ba39ab435d922a3a5c3cd196120f63accb682dcc
160
+ dry-initializer (3.2.0) sha256=37d59798f912dc0a1efe14a4db4a9306989007b302dcd5f25d0a2a20c166c4e3
161
+ dry-logic (1.6.0) sha256=da6fedbc0f90fc41f9b0cc7e6f05f5d529d1efaef6c8dcc8e0733f685745cea2
162
+ dry-schema (1.16.0) sha256=cd3aaeabc0f1af66ec82a29096d4c4fb92a0a58b9dae29a22b1bbceb78985727
163
+ dry-types (1.9.1) sha256=baebeecdb9f8395d6c9d227b62011279440943e3ef2468fe8ccc1ba11467f178
164
+ erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9
165
+ flay (2.14.5) sha256=2f6c97ade18eacc87dabdc8a1a2fa5cbd80b84eb0e290cea7af257ac0801a206
166
+ flog (4.9.4) sha256=12cc054fab7a2cbd2a906514397c4d7788954d530564782d6f14939dc2dfbcbb
167
+ ice_nine (0.11.2) sha256=5d506a7d2723d5592dc121b9928e4931742730131f22a1a37649df1c1e2e63db
168
+ json (3.1.0) sha256=3ce7ccf8fde58960177a3a756c31f292a4c1e1dedee884547096a5b0604e3bd8
169
+ language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
170
+ launchy (3.1.1) sha256=72b847b5cc961589dde2c395af0108c86ff0119f42d4648d25b5440ebb10059e
171
+ lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
172
+ logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
173
+ minitest (6.1.0) sha256=ff373595aa8888631e8a5463986a76b3845346ae6d7fa46e139c1633d418076e
174
+ parallel (2.3.0) sha256=f75a3e904101ce6a1ccb6b8dc800cbafd42166d83330192438dcf29395167a6f
175
+ parser (3.3.13.0) sha256=e02f9b63c2fe05b0c68f692ba4df89b3cb113b663964f75d988fbebfd6c3deca
176
+ path_expander (2.0.1) sha256=2de201164bff4719cc4d0b3767286e9977cc832a59c4d70abab571ec86cb41e4
177
+ prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
178
+ public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
179
+ racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
180
+ rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
181
+ rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
182
+ reek (6.5.0) sha256=d26d3a492773b2bbc228888067a21afe33ac07954a17dbd64cdeae42c4c69be1
183
+ regexp_parser (2.13.1) sha256=5aedb6b7c35688f51e86eef17a15374dfd287c83f4ca644b2c5f3ec50a33b44b
184
+ rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
185
+ rubocop (1.92.2) sha256=14fb31eed143a0dc6f78186c550c1715e81cd38f59d05d1165050e445c1f5382
186
+ rubocop-ast (1.51.0) sha256=0ec311e36b191b3872d909078a35274e962ae97dbce64be6812d145ca59acfcb
187
+ ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
188
+ ruby_parser (3.22.0) sha256=1eb4937cd9eb220aa2d194e352a24dba90aef00751e24c8dfffdb14000f15d23
189
+ rubycritic (4.12.0) sha256=024fed90fe656fa939f6ea80aab17569699ac3863d0b52fd72cb99892247abc8
190
+ sexp_processor (4.17.6) sha256=3c5d0e9db06377abde06db51dbacb14ce239ed0bd038ae515bc42c81602c6c1f
191
+ simplecov (1.3.2) sha256=2a22ec1759f1b8db60881a2e038758956fc69ef93ed669be0bde0678de6d0e85
192
+ thread_safe (0.3.6) sha256=9ed7072821b51c57e8d6b7011a8e282e25aeea3a4065eab326e43f66f063b05a
193
+ tty-which (0.5.0) sha256=5824055f0d6744c97e7c4426544f01d519c40d1806ef2ef47d9854477993f466
194
+ unicode-display_width (3.3.0) sha256=4b7aa66a4b11db50f6f7e98411215cd0dd10eaecb665d36eec5bcacb3fa0b613
195
+ unicode-emoji (4.3.0) sha256=11c02fa73290378c066bb0562cd4c87d8e1b706fbbe0059ca12746a4244de8ce
196
+ virtus (2.0.0) sha256=8841dae4eb7fcc097320ba5ea516bf1839e5d056c61ee27138aa4bddd6e3d1c2
197
+ zeitwerk (2.8.3) sha256=2c85125a8467ce069e20123d1e709a08955c9d29c118c25b46b7b7fafdbb92e5
198
+
199
+ RUBY VERSION
200
+ ruby 4.0.9
201
+
202
+ BUNDLED WITH
203
+ 4.0.23
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Dan Brubaker Horst
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # Jez
2
+
3
+ Jez is a skill that helps coding agents produce adequate Ruby code.
4
+ It helps guide design decisions based on the kind of change you need to make.
5
+ There is an accompanying CLI.
6
+
7
+ ## Try it
8
+
9
+ ```
10
+ gem install jez
11
+ jez decide
12
+ ```
13
+
14
+ > [!NOTE]
15
+ > From a Git checkout, you can also run `ruby exe/jez decide` with Ruby 3.2 or later (3.x or 4.x).
16
+
17
+ Jez frames work in three ways:
18
+
19
+ - **Precise** — Focus on changing a specific function without disturbing the surrounding code.
20
+ - **Progressive** — Realign or refactor a small area of the codebase by bringing it up to standards while keeping the changes within that boundary.
21
+ - **Pragmatic** — Apply appropriate design principles to greenfield work.
22
+
23
+ The guide uses the example of a waiting list for a book at a library to illustrate these three kinds of work.
24
+
25
+ - **Precise** — Correct the position returned by the existing reservation method and cover the second reader's case with a test.
26
+ - **Progressive** — Move the sorting rule shared by two operations (adding a reservation and expiring one) into one place and check that readers keep their order.
27
+ - **Pragmatic** — Design the waiting list itself, starting with two readers reserving the same book and getting positions 1 and 2.
28
+
29
+ ## Install
30
+
31
+ Build and install the gem from the checkout to use `jez` in other projects.
32
+
33
+ ```sh
34
+ bundle install
35
+ bundle exec rake build
36
+ gem install --local pkg/jez-0.1.0.gem
37
+ ```
38
+
39
+ Run `jez --help` for the command list.
40
+
41
+ ### Use with a coding agent
42
+
43
+ Run `jez install` to install the bundled skill for any supported agents Jez finds on your machine.
44
+ To choose agents yourself, pass one or more of `--claude`, `--codex`, and `--antigravity`.
45
+ For example, preview a Codex install with `jez install --codex --dry-run`.
46
+ The same options work with `ruby exe/jez install` from a checkout.
47
+
48
+ You can read the instructions with `jez skill` and find the installed gem's skill files with `jez path`.
49
+
50
+ ## Check a change
51
+
52
+ Once you've [set up the optional analyzers](references/setup.md#enable-the-optional-diagnostics), run `jez check` in the project you're changing.
53
+ By default, it looks for regressions in Ruby files that have changed since `HEAD`.
54
+ If you've agreed to bring a whole directory up to the project's quality thresholds, give it that scope explicitly.
55
+
56
+ ```sh
57
+ jez check --strict lib/shipping
58
+ ```
59
+
60
+ I use a finding to decide what deserves a closer look.
61
+ Whether it's worth extracting a method depends on what the next person will have to understand to change it.
62
+ See [Ruby diagnostics](references/diagnostics.md) for baselines, path selection, and exit codes.
63
+
64
+ ## Development
65
+
66
+ Run `bundle install` in the checkout, then `bundle exec rake test`.
67
+ The [evaluation harness](evals/README.md) uses the checkout's Git history and fixtures to evaluate agent changes.
68
+
69
+ Use `./exe/jez check` to check your diff for regressions.
70
+ Use `bundle exec rake check` to apply strict thresholds to Jez's own code and tests.
71
+ The latter skips the legacy code in the benchmark fixtures under `evals/fixtures`.
72
+
73
+ For Markdown, install `md-tools` 1.2.1 or later with `brew install danhorst/tap/md-tools`.
74
+ Run `bundle exec rake lint:markdown` to check for one sentence per source line and aligned tables.
75
+ To reformat specific files, run `./bin/md-lint --fix PATH...` and review the diff.
76
+
77
+ ## Release
78
+
79
+ 1. Set the version in `lib/jez/version.rb`, run `bundle lock`, and add a matching entry to the [changelog](CHANGELOG.md).
80
+ 2. Run `bundle exec rake release:check` to validate the changelog, lint Markdown, check Ruby, run the tests, and build the gem.
81
+ 3. Inspect the gem in `pkg/` and install it locally to try the executable.
82
+ 4. From a clean, committed checkout, run `bundle exec rake release` to run the checks, tag the version, push the commit and tag, and publish to RubyGems.
83
+
84
+ ## License
85
+
86
+ [MIT](LICENSE.txt)
data/SKILL.md ADDED
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: jez
3
+ description: Use when fixing, restructuring, or designing Ruby code. Choose the scope of the change, identify contracts that callers rely on, and weigh the cost of a new abstraction.
4
+ ---
5
+
6
+ # Choose a design that fits the Ruby change
7
+
8
+ Choose the smallest design that satisfies the request.
9
+ Correct behavior and preserved contracts are requirements.
10
+ Structural preferences and metric thresholds are evidence to interpret.
11
+
12
+ Optional arguments: a spec path, a mode (`precise`, `progressive`, `pragmatic`), or paths in scope.
13
+ Respect a named mode; explain a mismatch once if it threatens the requested outcome.
14
+
15
+ For team installation or a request to initialize Jez in a project, see [Setup and project defaults](references/setup.md).
16
+
17
+ ## Assess and choose
18
+
19
+ Read the request and applicable project instructions.
20
+ When existing behavior is in question, trace it to callers, tests, and documented contracts.
21
+ If the evidence is inconclusive during restructuring, capture the observed behavior in a characterization test at the caller boundary and preserve it.
22
+ If the requested outcome depends on which behavior is intended, explain the observable difference and ask which result the caller should receive.
23
+
24
+ | Mode | Use when | Where to stop |
25
+ | ----------- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
26
+ | Precise | An existing interface or extension point can express the requested behavior cleanly. | The affected caller gets the right result, including any required compatibility. |
27
+ | Progressive | Restructuring is the requested outcome, or a specific obstacle blocks the change and restructuring is in scope. | The named obstacle is removed inside the agreed boundary and the preserved contracts still hold. |
28
+ | Pragmatic | The task leaves a new capability's interface and responsibilities open to design. | A working slice serves its intended caller and satisfies the agreed requirements. For a prototype, stop once it answers the stated question. |
29
+
30
+ Respect a requested mode and the project's scope rules.
31
+ Otherwise apply the most specific project default, then use the table where the project leaves the choice open.
32
+ Choose at the boundary being changed.
33
+ A new Ruby class that fills an existing extension point can still be precise.
34
+ A new capability with its own interface can be pragmatic inside a mature application.
35
+
36
+ If a precise edit exposes an obstacle, identify what the caller needs and why the existing boundary gets in the way before proposing a progressive change.
37
+ A diagnostic finding alone is insufficient reason to broaden the work.
38
+
39
+ ## State the design argument
40
+
41
+ For a precise fix, the change summary can explain why the existing boundary fits and how the fix was verified.
42
+
43
+ Before substantial work, identify the boundary, the callers or contracts to preserve, and the checks that will verify them.
44
+ Explain why the chosen design fits the request and what any new abstraction costs.
45
+ A short sketch of responsibilities and messages can help when several objects must change together.
46
+
47
+ If an anticipated requirement tips the choice between two designs, name it, identify the evidence or assumption behind it, and say where the future edit would land.
48
+ Keep implementation within the current request.
49
+ Record the argument beside the spec when it will help someone resume the work.
50
+
51
+ Proceed within existing authorization.
52
+ Ask only about unresolved choices that materially affect scope or behavior.
53
+ A mode change does not itself require renewed permission; an expansion beyond authorized work does.
54
+
55
+ ## Implement proportionately
56
+
57
+ Preserve required behavior and public contracts, and test the change at a meaningful boundary.
58
+ Work in small verifiable steps; separate structural changes from behavior changes when it improves reviewability.
59
+ Commit only as authorized by the task or repository workflow.
60
+
61
+ Use names that express the responsibility from the caller's perspective.
62
+ Check compatibility before renaming a public method.
63
+ For a choice about seams, sequencing, object responsibilities, or abstraction, consult [Ruby design decisions](references/design-decisions.md).
64
+
65
+ ## Verify the change
66
+
67
+ Run the project's required tests and checks.
68
+ Cover the new behavior and any contracts the change puts at risk.
69
+ When a check is unavailable, say which claim remains unverified.
70
+
71
+ For a Git project using the bundled analyzers, capture the base commit before editing.
72
+ Use `jez check` for regressions in touched files and `jez check --strict` for a declared design boundary.
73
+ Review significant findings against the design argument.
74
+ Record why a remaining finding is acceptable and what would justify revisiting it.
75
+ See [Running the diagnostics](references/diagnostics.md) for commands, dependencies, and exit codes.
76
+
77
+ ## Revisit the argument
78
+
79
+ If an anticipated requirement influenced the design, walk through that change against the finished code.
80
+ Name the files and responsibilities it would touch, callers that remain stable, and assumptions that proved wrong.
81
+ Remove speculative machinery that did not earn its cost.
82
+ Distinguish the walkthrough from an implemented and tested follow-up.
83
+ If the design rested entirely on the current request, finish with verification of that change.
84
+
85
+ When the user authorizes a real follow-up, compare its actual scope with any earlier prediction.
86
+ Verify both new behavior and original contracts.
87
+ Review responsibility cohesion, dependency direction, names in use, review effort, and unnecessary abstractions.
88
+ File/line counts are evidence of spread, not targets to minimize.
89
+
90
+ Done means required behavior and checks hold, significant diagnostic findings have a disposition, and the design argument reflects the actual result.
91
+ Do not claim proven changeability from a metric score or hypothetical walkthrough alone.
data/bin/install ADDED
@@ -0,0 +1,19 @@
1
+ #!/bin/sh
2
+ # Install jez's pinned Ruby toolchain and, for each harness named, the hook that
3
+ # runs jez check after each Ruby edit. Safe to run repeatedly.
4
+ # Usage: bin/install [--claude [SETTINGS]] [--codex [HOOKS]]
5
+ set -eu
6
+
7
+ skill_dir=$(CDPATH='' cd -- "$(dirname -- "$(realpath -- "$0")")/.." && pwd -P)
8
+
9
+ if ! command -v mise >/dev/null 2>&1; then
10
+ echo "jez install: mise is required to provide the pinned Ruby" >&2
11
+ exit 1
12
+ fi
13
+
14
+ mise trust --quiet "$skill_dir/mise.toml"
15
+ mise -C "$skill_dir" install --quiet
16
+ BUNDLE_GEMFILE="$skill_dir/Gemfile" mise -C "$skill_dir" exec -- bundle install --quiet
17
+ echo "jez toolchain installed"
18
+
19
+ mise -C "$skill_dir" exec -- ruby "$skill_dir/scripts/install.rb" "$@"
data/exe/jez ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative "../lib/jez"
4
+
5
+ if ARGV.first == "check"
6
+ require_relative "../lib/jez/check"
7
+ exit Jez::Check.new.run(ARGV.drop(1))
8
+ end
9
+
10
+ require_relative "../lib/jez/decision"
11
+ require_relative "../lib/jez/installer"
12
+
13
+ usage = "Usage: jez <command> [options]"
14
+ case ARGV
15
+ when ["decide"] then exit Jez::Decision.new.run
16
+ when ["decide", "--help"], ["decide", "-h"] then puts Jez::Decision::HELP
17
+ when ["skill"] then puts File.read(File.join(Jez::ROOT, "SKILL.md"))
18
+ when ["path"] then puts Jez::ROOT
19
+ when ->(args) { args.first == "install" } then exit Jez::Installer.new.run(ARGV.drop(1))
20
+ when ["--version"], ["-v"] then puts Jez::VERSION
21
+ when [], ["--help"], ["-h"]
22
+ puts usage, "", <<~HELP
23
+ Commands:
24
+ decide Choose a design mode, compare examples, or sketch a plan.
25
+ install Install the Jez skill for your agents.
26
+ check Report Ruby quality regressions in changed files.
27
+ skill Print the bundled skill instructions.
28
+ path Print the bundled skill directory.
29
+
30
+ Options:
31
+ -h, --help Show this help.
32
+ -v, --version Print the Jez version.
33
+ HELP
34
+ else
35
+ warn usage
36
+ exit 2
37
+ end
@@ -0,0 +1,52 @@
1
+ #!/bin/sh
2
+ # PostToolUse hook for Claude Code and Codex: run jez's check command on
3
+ # each Ruby file an edit touched. Claude names one file_path; Codex sends an
4
+ # apply_patch body whose Add File, Update File, and Move to lines name the files.
5
+ # Findings are advisory context (exit 0); tool errors remain visible (exit 1).
6
+ set -u
7
+
8
+ command -v jq >/dev/null 2>&1 || { echo "jez hook requires jq" >&2; exit 1; }
9
+
10
+ jez="$(dirname -- "$(realpath -- "$0")")/../exe/jez"
11
+ payload=$(cat)
12
+ cwd=$(printf '%s' "$payload" | jq -r '.cwd // empty')
13
+ files=$(printf '%s' "$payload" | jq -r '
14
+ (.tool_input.file_path // empty),
15
+ ((.tool_input.command // "") | strings | split("\n")[]
16
+ | capture("^\\*\\*\\* (?:Add File|Update File|Move to): (?<path>.+)$")? | .path)')
17
+
18
+ findings=""
19
+ errors=""
20
+ while IFS= read -r file; do
21
+ case "$file" in
22
+ "") continue ;;
23
+ /*) ;;
24
+ *) file="${cwd:-$PWD}/$file" ;;
25
+ esac
26
+ case "$file" in
27
+ *.rb | *.rake | */Rakefile | */Gemfile) ;;
28
+ *) continue ;;
29
+ esac
30
+ [ -f "$file" ] || continue
31
+ directory=$(dirname -- "$file")
32
+ git -C "$directory" rev-parse --show-toplevel >/dev/null 2>&1 || continue
33
+
34
+ report=$(cd "$directory" && "$jez" check "$file" 2>&1)
35
+ case $? in
36
+ 0) ;;
37
+ 1) findings="$findings$report
38
+ " ;;
39
+ *) errors="$errors$report
40
+ " ;;
41
+ esac
42
+ done <<EOF
43
+ $files
44
+ EOF
45
+
46
+ if [ -n "$findings" ]; then
47
+ printf '%sAdvisory: review these findings against the design argument; fix or record a reasoned tradeoff.\n' "$findings"
48
+ fi
49
+ if [ -n "$errors" ]; then
50
+ printf 'jez check could not run: %s' "$errors" >&2
51
+ exit 1
52
+ fi
data/jez.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/jez/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "jez"
7
+ spec.version = Jez::VERSION
8
+ spec.authors = ["Dan Brubaker Horst"]
9
+ spec.email = ["dan.brubaker.horst@gmail.com"]
10
+ spec.summary = "Choose and verify a proportionate design for a Ruby change"
11
+ spec.homepage = "https://github.com/danhorst/jez"
12
+ spec.license = "MIT"
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.2", "< 5")
14
+ spec.metadata["source_code_uri"] = spec.homepage
15
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
16
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
17
+
18
+ spec.files = %w[README.md CHANGELOG.md LICENSE.txt SKILL.md Gemfile Gemfile.lock mise.toml jez.gemspec
19
+ bin/install scripts/install.rb scripts/check.rb
20
+ .rubocop.yml .reek.yml lib/jez.rb lib/ruby_quality.rb] +
21
+ Dir["exe/*", "references/*.md", "hooks/*", "lib/{jez,ruby_quality}/**/*.rb"]
22
+ spec.bindir = "exe"
23
+ spec.executables = ["jez"]
24
+ end