git 5.1.0 → 5.2.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.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +45 -0
  3. data/CONTRIBUTING.md +185 -165
  4. data/LICENSE +1 -1
  5. data/README.md +151 -151
  6. data/git.gemspec +35 -3
  7. data/lib/git/command_line/base.rb +1 -2
  8. data/lib/git/commands/base.rb +1 -1
  9. data/lib/git/commands/cat_file/raw.rb +8 -7
  10. data/lib/git/repository/branching.rb +79 -5
  11. data/lib/git/version.rb +1 -1
  12. metadata +5 -94
  13. data/.claude/commands/address-copilot-reviews.md +0 -14
  14. data/.claude/settings.json +0 -16
  15. data/.claude/skills +0 -1
  16. data/.commitlintrc.yml +0 -38
  17. data/.dockerignore +0 -27
  18. data/.github/copilot-instructions.md +0 -30
  19. data/.github/hooks/bin-setup-on-worktree.json +0 -11
  20. data/.github/hooks/run-bin-setup-once.sh +0 -20
  21. data/.github/issue_template.md +0 -15
  22. data/.github/prompts/iteratively-address-copilot-reviews.prompt.md +0 -188
  23. data/.github/pull_request_template.md +0 -21
  24. data/.github/skills/breaking-change-analysis/SKILL.md +0 -99
  25. data/.github/skills/ci-cd-troubleshooting/SKILL.md +0 -264
  26. data/.github/skills/command-implementation/REFERENCE.md +0 -994
  27. data/.github/skills/command-implementation/SKILL.md +0 -230
  28. data/.github/skills/command-test-conventions/SKILL.md +0 -664
  29. data/.github/skills/command-yard-documentation/SKILL.md +0 -434
  30. data/.github/skills/dependency-management/SKILL.md +0 -72
  31. data/.github/skills/development-workflow/SKILL.md +0 -512
  32. data/.github/skills/facade-implementation/REFERENCE.md +0 -837
  33. data/.github/skills/facade-implementation/SKILL.md +0 -269
  34. data/.github/skills/facade-test-conventions/SKILL.md +0 -391
  35. data/.github/skills/facade-yard-documentation/SKILL.md +0 -435
  36. data/.github/skills/make-skill-template/SKILL.md +0 -226
  37. data/.github/skills/pr-readiness-review/SKILL.md +0 -205
  38. data/.github/skills/project-context/SKILL.md +0 -306
  39. data/.github/skills/pull-request-review/SKILL.md +0 -168
  40. data/.github/skills/rebase/SKILL.md +0 -148
  41. data/.github/skills/refactor-command-to-commandlineresult/SKILL.md +0 -131
  42. data/.github/skills/release-management/SKILL.md +0 -125
  43. data/.github/skills/resolve-feedback/SKILL.md +0 -288
  44. data/.github/skills/review-arguments-dsl/CHECKLIST.md +0 -788
  45. data/.github/skills/review-arguments-dsl/SKILL.md +0 -214
  46. data/.github/skills/review-cross-command-consistency/SKILL.md +0 -139
  47. data/.github/skills/reviewing-skills/SKILL.md +0 -214
  48. data/.github/skills/rspec-unit-testing-standards/SKILL.md +0 -685
  49. data/.github/skills/tdd-refactor-step/SKILL.md +0 -236
  50. data/.github/skills/test-debugging/SKILL.md +0 -161
  51. data/.github/skills/yard-documentation/SKILL.md +0 -981
  52. data/.github/skills/yard-documentation/element-rules.md +0 -162
  53. data/.github/skills-deprecated/README.md +0 -21
  54. data/.github/skills-deprecated/extract-command-from-lib/SKILL.md +0 -487
  55. data/.github/skills-deprecated/extract-facade-from-base-lib/KEYWORD_ARG_REMEDIATION.md +0 -22
  56. data/.github/skills-deprecated/extract-facade-from-base-lib/SKILL.md +0 -600
  57. data/.github/skills-deprecated/review-backward-compatibility/SKILL.md +0 -275
  58. data/.github/workflows/continuous_integration.yml +0 -358
  59. data/.github/workflows/enforce_conventional_commits.yml +0 -35
  60. data/.github/workflows/experimental_continuous_integration.yml +0 -59
  61. data/.github/workflows/release.yml +0 -52
  62. data/.github/workflows/warm_bundler_caches.yml +0 -82
  63. data/.gitignore +0 -30
  64. data/.husky/commit-msg +0 -1
  65. data/.husky/pre-commit +0 -13
  66. data/.release-please-config.json +0 -36
  67. data/.release-please-manifest.json +0 -3
  68. data/.rspec +0 -2
  69. data/.rubocop.yml +0 -44
  70. data/.rubocop_todo.yml +0 -30
  71. data/.yard-lint.yml +0 -75
  72. data/CLAUDE.md +0 -11
  73. data/Gemfile +0 -22
  74. data/Rakefile +0 -41
  75. data/docker/test/Dockerfile +0 -32
  76. data/docker/test/docker-compose.yml +0 -0
  77. data/package.json +0 -10
  78. data/redesign/1_architecture_existing.md +0 -102
  79. data/redesign/2_architecture_redesign.md +0 -449
  80. data/redesign/3_architecture_implementation.md +0 -1623
  81. data/redesign/Phase 4 - Step A.md +0 -366
  82. data/redesign/Phase 4 - Step B.md +0 -921
  83. data/redesign/Phase 4 - Step C.md +0 -833
  84. data/redesign/beta_release.md +0 -107
  85. data/redesign/branch_parse_refactor_plan.md +0 -163
  86. data/redesign/c1a-public-api-scope.tsv +0 -256
  87. data/redesign/c1c2_audit.md +0 -566
  88. data/redesign/c1c2_bucket6_lib_orphans.md +0 -626
  89. data/redesign/config_design.rb +0 -501
  90. data/redesign/index.md +0 -34
  91. data/redesign/info_object_migration_plan.md +0 -126
  92. data/redesign/integration_test_analysis.md +0 -521
  93. data/redesign/phase-4-step-b-test-audit.tsv +0 -485
  94. data/redesign/remote_refactor_plan.md +0 -164
  95. data/redesign/reverse_dependencies.sql +0 -44
  96. data/tasks/gem_tasks.rake +0 -14
  97. data/tasks/npm_tasks.rake +0 -7
  98. data/tasks/rspec.rake +0 -111
  99. data/tasks/rubocop.rake +0 -5
  100. data/tasks/test_gem.rake +0 -12
  101. data/tasks/yard.rake +0 -57
@@ -1,434 +0,0 @@
1
- ---
2
- name: command-yard-documentation
3
- description: "Command-specific YARD documentation rules for Git::Commands::Base subclasses, overriding and extending the general yard-documentation skill. Use when writing or reviewing YARD docs for command classes."
4
- ---
5
-
6
- # Command YARD Documentation
7
-
8
- Write and verify YARD documentation for command classes aligned with
9
- the `Git::Commands::Base` pattern. Use this skill when writing or reviewing
10
- YARD docs on command classes — it overrides and extends the general
11
- [YARD Documentation](../yard-documentation/SKILL.md) skill with
12
- command-specific rules.
13
-
14
- This skill verifies that YARD docs accurately mirror the `arguments do` block
15
- as-implemented. It does not re-adjudicate which options belong based on Git
16
- version — version gating is the domain of the DSL and the
17
- [Command Implementation](../command-implementation/SKILL.md) skill, not YARD review.
18
-
19
- ## Contents
20
-
21
- - [Contents](#contents)
22
- - [Related skills](#related-skills)
23
- - [Input](#input)
24
- - [Reference](#reference)
25
- - [Required documentation model](#required-documentation-model)
26
- - [No `def call` override (simple commands)](#no-def-call-override-simple-commands)
27
- - [Explicit `def call` override](#explicit-def-call-override)
28
- - [DSL-to-YARD type mapping](#dsl-to-yard-type-mapping)
29
- - [Common issues](#common-issues)
30
- - [Workflow](#workflow)
31
- - [1. Class-level docs](#1-class-level-docs)
32
- - [2. Arguments docs](#2-arguments-docs)
33
- - [3. Return and raise tags](#3-return-and-raise-tags)
34
- - [4. `allow_exit_status` rationale consistency](#4-allow_exit_status-rationale-consistency)
35
- - [5. Formatting consistency](#5-formatting-consistency)
36
- - [6. Avoid internal implementation detail leakage](#6-avoid-internal-implementation-detail-leakage)
37
- - [Output](#output)
38
- - [When writing new YARD docs](#when-writing-new-yard-docs)
39
- - [When reviewing existing YARD docs](#when-reviewing-existing-yard-docs)
40
-
41
- ## Related skills
42
-
43
- - [YARD Documentation](../yard-documentation/SKILL.md) — authoritative
44
- source for general YARD formatting rules and writing standards
45
- - [Review Arguments DSL](../review-arguments-dsl/SKILL.md) — verifying DSL entries
46
- match git CLI
47
- - [Command Implementation](../command-implementation/SKILL.md) — class
48
- structure, phased rollout gates, and internal compatibility contracts
49
- - [Command Test Conventions](../command-test-conventions/SKILL.md) — unit/integration
50
- test conventions for command classes
51
-
52
- ## Input
53
-
54
- Before starting, you **MUST** load the following skill(s) in their entirety:
55
-
56
- - [YARD Documentation](../yard-documentation/SKILL.md) — authoritative
57
- source for YARD formatting rules and writing standards
58
-
59
- Then gather the following for each command under review:
60
-
61
- 1. **Command source** — one or more files from `lib/git/commands/` containing:
62
- - `class < Git::Commands::Base`
63
- - `arguments do ... end`
64
- - optional `allow_exit_status`
65
- - either a `# @!method call(*, **)` YARD directive (when no `def call` override)
66
- or YARD doc comments directly above an explicit `def call` override
67
-
68
- 2. **Git documentation for the git command**
69
-
70
- - **Latest-version online command documentation**
71
-
72
- Read the **entire** official git documentation online man page for the command
73
- for the latest version of git. This version will be used as the primary
74
- authority for verifying option names, aliases, descriptions, and ordering.
75
- Fetch this version from the URL `https://git-scm.com/docs/git-{command}`
76
- (this URL always serves the latest release).
77
-
78
- - **Minimum-version online command documentation**
79
-
80
- Read the **entire** official git documentation online man page for the command
81
- for the `Git::MINIMUM_GIT_VERSION` version of git. This will be used to
82
- confirm whether the command/class is gated by `requires_git_version` and,
83
- when it is, that the YARD docs include a continuation paragraph noting the
84
- minimum version requirement. Fetch this version from the URL
85
- `https://git-scm.com/docs/git-{command}/{version}`.
86
-
87
- Do **not** rely on local `git <command> -h` output — the installed Git version
88
- is unknown and may differ from the minimum or latest supported version.
89
-
90
- ## Reference
91
-
92
- ### Required documentation model
93
-
94
- The placement of `call` documentation depends on whether the command class overrides
95
- `def call`.
96
-
97
- #### No `def call` override (simple commands)
98
-
99
- When the class does **not** define `def call`, use the `# @!method call(*, **)` YARD
100
- directive. This tells YARD to attach per-command docs to the inherited `call` method
101
- without a method definition in the subclass:
102
-
103
- ```ruby
104
- # @!method call(*, **)
105
- #
106
- # @overload call(**options)
107
- #
108
- # Execute the git ... command.
109
- #
110
- # @param options [Hash] command options
111
- #
112
- # @option options [Boolean, nil] :force (nil) ...
113
- #
114
- # @return [Git::CommandLineResult]
115
- ```
116
-
117
- Note the placement rules:
118
-
119
- - The `@overload` description text **must appear inside the `@overload` block** (indented
120
- one extra level, as in the template above). Do **not** place the description between
121
- the `@!method` line and the `@overload` tag — that level belongs to any `@!method`-scope
122
- prose that is not part of any overload, which is rarely needed.
123
- - Place the directive inside the class body, after the `arguments do` block (and after
124
- `allow_exit_status` when present). Do **not** combine `@!method` with an explicit
125
- `def call`.
126
-
127
- #### Explicit `def call` override
128
-
129
- When the class defines `def call` explicitly (for input validation, stdin feeding, or
130
- non-trivial option routing), place YARD docs **directly above** the `def call`
131
- method. Do **not** use `@!method` — YARD will read the normal doc comment on the real
132
- method:
133
-
134
- ```ruby
135
- # @overload call(*revision_range, **options)
136
- #
137
- # Execute the `git log` command.
138
- #
139
- # @param revision_range [Array<String>] zero or more revision specifiers
140
- #
141
- # @param options [Hash] command options
142
- #
143
- # @option options [Boolean, nil] :all (nil) ...
144
- #
145
- # @return [Git::CommandLineResult] the result of calling `git log`
146
- #
147
- # @raise [ArgumentError] if conflicting options are given
148
- #
149
- # @raise [Git::FailedError] if git exits with a non-zero exit status
150
- def call(*, **kwargs)
151
- # custom logic …
152
- super
153
- end
154
- ```
155
-
156
- Using `@!method` when `def call` already exists causes YARD to generate duplicate or
157
- conflicting documentation for the method.
158
-
159
- ### DSL-to-YARD type mapping
160
-
161
- | DSL method | YARD type |
162
- | --- | --- |
163
- | `flag_option` | `[Boolean, nil]` — default `(nil)` (flag not emitted by default; both `false` and `nil` suppress the flag) |
164
- | `flag_option ..., max_times: N` | `[Boolean, Integer, nil]` |
165
- | `flag_option ..., negatable: true` | registers two entries; document **two** `@option` tags: positive key `[Boolean, nil]` (`true` → `--flag`; default `(nil)` → nothing), negative key `[Boolean, nil]` (`true` → `--no-flag`; default `(nil)` → nothing) |
166
- | `flag_or_value_option` | `[Boolean, String, nil]` (or the specific value type with `nil` appended) |
167
- | `flag_or_value_option ..., negatable: true` | registers two entries; document **two** `@option` tags: positive key `[Boolean, String, nil]` (`true` → `--flag`; string → `--flag=value` with `inline: true`, or `--flag <value>` without; default `(nil)` → nothing), negative key `[Boolean, nil]` (`true` → `--no-flag`; default `(nil)` → nothing) |
168
- | `value_option` | `[String]` — `value_option` does not enforce types; it accepts any non-nil value and converts it to a string. Use `[String]` unless callers are expected to pass a narrower type, in which case widen the annotation to reflect reality (e.g. `[Integer, String]` for options documented as taking `<n>` lines/bytes). Never use a bare numeric type such as `[Integer]` alone — that misrepresents what the implementation accepts. |
169
- | `operand` (repeatable) | `[Array<String>]` |
170
- | `operand` (single) | `[String]` |
171
-
172
- ### Common issues
173
-
174
- - Using `# @!method call(*, **)` when an explicit `def call` override exists — causes
175
- YARD to generate duplicate or conflicting documentation; remove the `@!method`
176
- directive and place the `@overload` docs directly above `def call`
177
- - Missing `# @!method call(*, **)` directive when there is no `def call` override
178
- (loses child-specific docs in generated YARD)
179
- - `@option` docs out of sync with `arguments do`
180
- - **YARD tags inside the `arguments do` block** — placing a tag (`@see`, `@param`,
181
- `@return`, etc.) in a comment above a DSL entry such as `flag_option :x` produces an
182
- orphaned doc comment. The DSL call is not a documentable construct, so YARD silently
183
- drops the comment and `Documentation/OrphanedDocComment` flags it. Document each
184
- option in its `@option` tag (put URLs in continuation text) and use a class-level
185
- `@see` for command-wide references. A plain-prose comment (no leading `@tag`) inside
186
- the block is fine.
187
- - **Missing `@raise [ArgumentError]` when `**options` is in the overload signature** —
188
- every `@overload` that includes `**options` requires
189
- `@raise [ArgumentError] if unsupported options are provided`. The `Arguments` DSL
190
- always raises this at bind time for unknown keys via `validate_unsupported_options!`.
191
- For commands whose `arguments` block declares **no** options (only `operand` entries),
192
- drop `**options` from the signature entirely — then no `@raise [ArgumentError]` is
193
- needed.
194
- - **`**options` in `@overload` without `@param options [Hash]`** — whenever an
195
- `@overload` signature includes `**options`, a corresponding `@param options [Hash]`
196
- tag is required. For commands whose `arguments` block declares **no** options (only
197
- `operand` entries), omit `**options` from the `@overload` signature entirely and
198
- remove any `@raise [ArgumentError] if unsupported options are provided` tag.
199
-
200
- ```ruby
201
- # ❌ No options in DSL but **options appears in overload without @param
202
- # @overload call(name, **options)
203
- # @param name [String] the remote name to remove
204
- # @raise [ArgumentError] if unsupported options are provided
205
-
206
- # ✅ Operand-only command: drop **options from the signature
207
- # @overload call(name)
208
- # @param name [String] the remote name to remove
209
- ```
210
- - **Missing second `@option` tag for `negatable:` options** — when the DSL declares
211
- `flag_option :foo, negatable: true` or `flag_or_value_option :foo, negatable: true`,
212
- two separate `@option` entries are required: one for the positive key (`:foo`) and
213
- one for the negative companion key (`:no_foo`). A single tag documents only half
214
- the interface.
215
-
216
- ```ruby
217
- # ❌ Missing negative companion tag
218
- # @option options [Boolean, nil] :create_reflog (nil) create the branch's reflog
219
-
220
- # ✅ Both forms documented with separate tags
221
- # @option options [Boolean, nil] :create_reflog (nil) create the branch's reflog
222
- #
223
- # @option options [Boolean, nil] :no_create_reflog (nil) suppress branch reflog
224
- # creation (`--no-create-reflog`)
225
- ```
226
- - Missing/incorrect `@raise` guidance for `allow_exit_status`
227
- - **Overly specific `@raise [Git::FailedError]` description** — do not enumerate
228
- specific failure causes (e.g., "if the branch doesn't exist", "if the target
229
- already exists"). Git can fail for many reasons beyond any list (invalid ref name,
230
- not a git repository, permission error, etc.). Use the generic range-based form:
231
-
232
- ```ruby
233
- # ❌ Overly specific — does not cover all failure cases
234
- # @raise [Git::FailedError] if the branch doesn't exist or target exists (without force)
235
-
236
- # ✅ Correct — generic, matches sibling commands, accurate for all failure causes
237
- # @raise [Git::FailedError] if git exits with a non-zero exit status
238
- ```
239
-
240
- For commands with a non-default range (e.g. `allow_exit_status 0..1`):
241
-
242
- ```ruby
243
- # ✅ Correct for allow_exit_status 0..1
244
- # @raise [Git::FailedError] if git exits outside the allowed range (exit code > 1)
245
- ```
246
- - Legacy references to `ARGS` constant or command-specific `initialize`
247
- - **`@option` description references a short flag instead of the emitted long flag** —
248
- `@option` prose must describe behavior using the emitted CLI form (the long flag),
249
- not the git man-page synopsis short notation. The DSL emits the primary (long) flag
250
- regardless of which alias the caller uses.
251
-
252
- ```ruby
253
- # ❌ Wrong — describes -v as if it is emitted
254
- # @option options [Boolean, Integer, nil] :verbose (nil) ...
255
- # Pass `true` for `-v`; pass `2` for `-v -v`.
256
-
257
- # ✅ Correct — describes the actually emitted flag
258
- # @option options [Boolean, Integer, nil] :verbose (nil) ...
259
- # Pass `true` for `--verbose`; pass `2` for `--verbose --verbose`.
260
- ```
261
-
262
- - Description leaks internal mechanics (e.g., "written via IO pipe") instead of
263
- describing caller-facing behavior
264
- - **Uppercase first letter or trailing period on tag short descriptions** — the
265
- summary text of every `@option`, `@param`, `@return`, and `@raise` tag must start
266
- with a **lowercase** letter and must not end with punctuation (`.`, `,`, `;`, `:`).
267
- Git man pages start descriptions with uppercase and end them with periods; both
268
- mistakes are easy to copy verbatim. Run `bundle exec rake yard` to catch trailing
269
- periods — YARD treats any failure as fatal. Correct form:
270
-
271
- ```ruby
272
- # ❌ Copied verbatim from the git man page
273
- # @option options [Boolean, nil] :force (nil) Allow renaming even if target already exists.
274
-
275
- # ✅ Correct — lowercase start, no trailing period
276
- # @option options [Boolean, nil] :force (nil) allow renaming even if target already exists
277
- ```
278
- - **Raw blank line inside a doc comment block** — a raw blank line (an empty line
279
- with no leading `#`) silently terminates the YARD block. Any comment lines after
280
- the raw blank line are dropped from generated docs. Replace every raw blank line
281
- inside a block with a blank comment line (`#`). This is easy to miss in
282
- continuation paragraphs and alias notes. Correct form:
283
-
284
- ```ruby
285
- # @option options [Boolean, nil] :ipv4 (nil) use IPv4 addresses only
286
- #
287
- # Alias: :"4"
288
- ```
289
-
290
- - **Multi-sentence short description without a blank comment line** — when an
291
- `@option` needs more than one sentence, the first sentence is the short description
292
- and all additional detail must go in a continuation paragraph separated by a blank
293
- `#` line. Writing both sentences on the same run-in line violates YARD's
294
- short-description rule. Correct form:
295
-
296
- ```ruby
297
- # @option options [Boolean, nil] :update_head_ok (nil) allow updating HEAD ref
298
- #
299
- # When true, passes --update-head-ok. By default git fetch refuses to update HEAD.
300
- ```
301
-
302
- ## Workflow
303
-
304
- For each command file, run through these checks in order:
305
-
306
- ### 1. Class-level docs
307
-
308
- - [ ] one-line summary
309
- - [ ] brief behavior description
310
- - [ ] `@example` blocks with representative usage
311
- - [ ] ``@note `arguments` block audited against https://git-scm.com/docs/git-{command}/<version>`` —
312
- present and recording the latest git version at the time of the last DSL audit.
313
- Flag as an error if missing or if the version in the URL does not match the
314
- current latest git version (run `bin/latest-git-version` from the repo root to
315
- check; a stale version means the DSL may be missing options added in later releases)
316
- - [ ] `@see` to parent command module where applicable
317
- - [ ] `@see` to the full documentation URL (e.g., `@see https://git-scm.com/docs/git-show-ref`)
318
- - [ ] `@api private`
319
-
320
- ### 2. Arguments docs
321
-
322
- - [ ] `@overload` blocks cover valid call shapes
323
- - [ ] every positional arg has `@param`
324
- - [ ] every applicable option has `@option`
325
- - [ ] `@option` entries appear in the same order as the corresponding entries in the
326
- `arguments do` block
327
- - [ ] `@option` types match the DSL method (see
328
- [DSL-to-YARD type mapping](#dsl-to-yard-type-mapping))
329
- - [ ] `@option` defaults match the DSL method — `flag_option` (plain or negatable)
330
- always uses `(nil)` for both the positive and negative `no_` companion tag;
331
- `value_option` uses `(nil)`. Check every `@option` default tag against the DSL entry.
332
- For `negatable:` options, verify that **two** `@option` tags are present (one
333
- for the positive key, one for the `no_` companion key) and that both use `(nil)`.
334
- - [ ] option defaults/types are consistent with DSL definitions
335
- - [ ] `@option` descriptions for options that have an `allowed_values` declaration
336
- enumerate the accepted values in the description text, e.g.: `@option options
337
- [String] :cleanup (nil) Cleanup mode — one of verbatim, whitespace, or
338
- strip`
339
-
340
- ### 3. Return and raise tags
341
-
342
- - [ ] `@return [Git::CommandLineResult]` with wording: "the result of calling `git
343
- <subcommand>`"
344
- - [ ] `@api public` is present at the end of the `@overload` block (after all `@raise`
345
- tags) — every command class is `@api private` at the class level, but `call` is
346
- the public contract and must be marked `@api public`
347
- - [ ] whenever the `@overload` signature includes `**options`, include
348
- `@raise [ArgumentError] if unsupported options are provided` — the `Arguments`
349
- DSL always raises this at bind time for unknown keys via `validate_unsupported_options!`
350
- - [ ] `@raise [Git::FailedError]` uses the canonical generic wording — **never**
351
- enumerate specific failure causes; use the form that matches the command's
352
- declared exit-status range:
353
-
354
- | `allow_exit_status` | Canonical `@raise` wording |
355
- | --- | --- |
356
- | none declared (default `0..0`) | `if git exits with a non-zero exit status` |
357
- | `allow_exit_status 0..1` | `if git exits outside the allowed range (exit code > 1)` |
358
- | `allow_exit_status 0..N` | `if git exits outside the allowed range (exit code > N)` |
359
-
360
- ### 4. `allow_exit_status` rationale consistency
361
-
362
- When command declares non-default exit range:
363
-
364
- - [ ] includes short rationale comment above declaration
365
- - [ ] YARD `@raise` text does not contradict accepted status behavior
366
-
367
- ### 5. Formatting consistency
368
-
369
- - [ ] every YARD tag (`@param`, `@option`, `@return`, `@raise`, `@overload`,
370
- `@see`, `@api`, etc.) is preceded by a blank comment line (`#`)
371
- - [ ] no raw blank lines (lines with no leading `#`) appear inside any doc block —
372
- a raw blank line silently terminates the block and drops everything after it
373
- - [ ] tag short descriptions (the first sentence of each `@param`, `@option`,
374
- `@return`, `@raise`, etc.) do not end with punctuation (no `.`, `,`, `;`, `:`)
375
- - [ ] multi-paragraph tag descriptions have a blank comment line (`#`) between the
376
- short description and each continuation paragraph
377
- - [ ] `@option`, `@param`, `@return`, and `@raise` short descriptions all start with a
378
- **lowercase** letter (e.g. `show the HEAD ref even when filtered`, `the path to the
379
- repository`, `the result of calling \`git show-ref\``, `if git exits with a non-zero
380
- status`)
381
- - [ ] consistent option wording and defaults across sibling commands
382
- - [ ] `max_times:` flags use `[Boolean, Integer]` type, not just `[Boolean]`, and
383
- include a continuation paragraph explaining integer semantics (e.g. "When an
384
- integer is given, the flag is repeated that many times")
385
- - [ ] no stale references to removed per-command implementation details
386
- - [ ] all other general formatting rules from [YARD
387
- Documentation](../yard-documentation/SKILL.md) are satisfied
388
-
389
- ### 6. Avoid internal implementation detail leakage
390
-
391
- Prefer interface-level wording (what callers can pass/expect), not internals.
392
-
393
- **Common example — stdin transport mechanism:**
394
-
395
- ```ruby
396
- # Bad: leaks implementation detail (IO pipe, threading)
397
- # Object names are written to the process's stdin via an in-memory IO pipe;
398
- # this avoids spawning additional processes and works with the --batch protocol.
399
-
400
- # Good: describes caller-facing behavior
401
- # Object names are passed to the git process's stdin using the --batch protocol.
402
- ```
403
-
404
- - [ ] description does not mention `IO.pipe`, threads, or pipe buffer management
405
- - [ ] description does not reference internal method names (`with_stdin`,
406
- `run_batch`)
407
- - [ ] description describes what the caller passes and what they get back
408
-
409
- ## Output
410
-
411
- ### When writing new YARD docs
412
-
413
- Produce the complete YARD doc block(s) for the command class, then self-verify
414
- by running every checklist item from [Workflow](#workflow) against your output.
415
- If any issues are found, fix and re-verify until all checks pass.
416
-
417
- ### When reviewing existing YARD docs
418
-
419
- For each file, provide:
420
-
421
- 1. issue table
422
-
423
- | Check | Status | Issue |
424
- | --- | --- | --- |
425
-
426
- 2. corrected doc block snippets (only where needed)
427
-
428
- 3. **Self-verify before concluding** — after writing corrected snippets, re-run
429
- every checklist item from [Workflow](#workflow) against your proposed
430
- snippets. If any new issues are found, update the snippets and repeat until all
431
- checks pass. Only then write the final issue table marking everything as passing.
432
-
433
- > **Branch workflow:** Implement any fixes on a feature branch. Never commit or push
434
- > directly to `main` — open a pull request when changes are ready to merge.
@@ -1,72 +0,0 @@
1
- ---
2
- name: dependency-management
3
- description: "Updates gem dependencies, handles CVEs, and manages gemspec rules. Use when updating dependencies, checking for outdated gems, or fixing security vulnerabilities."
4
- ---
5
-
6
- # Dependency Management Workflow
7
-
8
- ## Contents
9
-
10
- - [How to use this skill](#how-to-use-this-skill)
11
- - [Related skills](#related-skills)
12
- - [Project-Specific Rules](#project-specific-rules)
13
- - [Update Process](#update-process)
14
- - [Key Considerations](#key-considerations)
15
- - [Commit Guidelines](#commit-guidelines)
16
-
17
- ## How to use this skill
18
-
19
- Attach this file to your Copilot Chat context, then invoke it with the specific
20
- dependency update or CVE remediation scope. Apply this workflow before changing
21
- version constraints so updates remain consistent with gem project rules.
22
-
23
- ## Related skills
24
-
25
- - [CI/CD Troubleshooting](../ci-cd-troubleshooting/SKILL.md) — diagnose failures
26
- introduced by dependency updates
27
- - [Development Workflow](../development-workflow/SKILL.md) — drive any required
28
- code changes via TDD
29
- - [Release Management](../release-management/SKILL.md) — understand how
30
- dependency changes flow into automated releases
31
-
32
- ## Project-Specific Rules
33
-
34
- - **All dependencies go in `git.gemspec`** (both runtime and development) - enforced by Rubocop
35
- - **`Gemfile` should remain minimal/empty** - do not add dependencies here
36
- - **`Gemfile.lock` is NOT committed** - this is a gem/library project
37
-
38
- ## Update Process
39
-
40
- 1. **Assess:** Run `bundle outdated` and `bundle audit check --update` (if available)
41
- 2. **Update:** Edit `git.gemspec` if constraints need changing, then run `bundle update`
42
- 3. **Test:** Run `bundle exec rake default` - must pass on all supported Ruby versions (see CI matrix in `.github/workflows/` and minimum version in `git.gemspec`)
43
- 4. **Commit:** Use conventional commit format:
44
- - Security: `fix(deps): update <gem> to fix CVE-XXXX-XXXX`
45
- - Regular: `chore(deps): update dependencies`
46
- - Breaking: `chore(deps)!: update <gem>` with `BREAKING CHANGE:` footer
47
-
48
- ## Key Considerations
49
-
50
- - Security vulnerabilities are highest priority - address immediately
51
- - For gem projects, version constraints in gemspec must be carefully chosen since users resolve dependencies independently
52
- - Breaking changes in dependencies may require code changes (use TDD workflow)
53
- - Test with both minimum supported versions and latest versions when possible
54
- - If tests fail, isolate by updating gems one at a time or use binary search
55
-
56
- ## Commit Guidelines
57
-
58
- This project uses [Conventional Commits](https://www.conventionalcommits.org/). A
59
- commit hook enforces the format. See the "Commit message guidelines" section in
60
- `CONTRIBUTING.md` for the full format and allowed types.
61
-
62
- **Issue and PR references in the body:** Do not use `#<number>` in the commit
63
- body — write `issue 1000` not `issue #1000`. A commitlint parser flaw treats any
64
- line containing `#<number>` as a footer token, breaking the body/footer split. To
65
- close an issue/PR, use `Closes`/`Fixes`/`Resolves #<number>` in the footer. To
66
- merely mention one for context, omit the `#` and no footer line is needed.
67
-
68
- To validate a commit message file before committing:
69
-
70
- ```bash
71
- npx commitlint --format @commitlint/format < commit_msg.txt
72
- ```