git 5.0.0.beta.2 → 5.0.0.beta.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.
Files changed (270) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +27 -0
  3. data/.github/copilot-instructions.md +3 -8
  4. data/.github/hooks/bin-setup-on-worktree.json +11 -0
  5. data/.github/hooks/run-bin-setup-once.sh +14 -0
  6. data/.github/skills/breaking-change-analysis/SKILL.md +6 -9
  7. data/.github/skills/ci-cd-troubleshooting/SKILL.md +2 -2
  8. data/.github/skills/command-implementation/REFERENCE.md +34 -33
  9. data/.github/skills/command-implementation/SKILL.md +5 -4
  10. data/.github/skills/command-test-conventions/SKILL.md +13 -9
  11. data/.github/skills/command-yard-documentation/SKILL.md +14 -6
  12. data/.github/skills/development-workflow/SKILL.md +20 -14
  13. data/.github/skills/facade-implementation/REFERENCE.md +19 -22
  14. data/.github/skills/facade-implementation/SKILL.md +0 -5
  15. data/.github/skills/facade-test-conventions/SKILL.md +4 -7
  16. data/.github/skills/facade-yard-documentation/SKILL.md +8 -2
  17. data/.github/skills/make-skill-template/SKILL.md +53 -3
  18. data/.github/skills/pr-readiness-review/SKILL.md +22 -2
  19. data/.github/skills/project-context/SKILL.md +16 -23
  20. data/.github/skills/pull-request-review/SKILL.md +2 -2
  21. data/.github/skills/rebase/SKILL.md +148 -0
  22. data/.github/skills/refactor-command-to-commandlineresult/SKILL.md +1 -1
  23. data/.github/skills/resolve-feedback/SKILL.md +288 -0
  24. data/.github/skills/review-arguments-dsl/CHECKLIST.md +3 -3
  25. data/.github/skills/reviewing-skills/SKILL.md +28 -3
  26. data/.github/skills/test-debugging/SKILL.md +20 -19
  27. data/.github/skills/yard-documentation/SKILL.md +671 -483
  28. data/.github/skills/yard-documentation/element-rules.md +162 -0
  29. data/.github/skills-deprecated/README.md +21 -0
  30. data/.github/{skills → skills-deprecated}/extract-command-from-lib/SKILL.md +9 -9
  31. data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/SKILL.md +12 -12
  32. data/.github/workflows/continuous_integration.yml +3 -2
  33. data/.rubocop.yml +7 -39
  34. data/.yard-lint.yml +75 -0
  35. data/CONTRIBUTING.md +186 -174
  36. data/Gemfile +17 -0
  37. data/README.md +86 -23
  38. data/Rakefile +3 -21
  39. data/UPGRADING.md +219 -70
  40. data/docker/test/Dockerfile +32 -0
  41. data/docker/test/docker-compose.yml +0 -0
  42. data/git.gemspec +3 -4
  43. data/lib/git/author.rb +20 -1
  44. data/lib/git/branch.rb +26 -6
  45. data/lib/git/branch_delete_failure.rb +3 -0
  46. data/lib/git/branch_delete_result.rb +6 -3
  47. data/lib/git/branch_info.rb +6 -6
  48. data/lib/git/command_line/base.rb +6 -13
  49. data/lib/git/command_line/capturing.rb +67 -10
  50. data/lib/git/command_line/result.rb +0 -8
  51. data/lib/git/command_line/streaming.rb +45 -5
  52. data/lib/git/command_line.rb +4 -3
  53. data/lib/git/commands/add.rb +61 -53
  54. data/lib/git/commands/am/abort.rb +2 -2
  55. data/lib/git/commands/am/apply.rb +109 -98
  56. data/lib/git/commands/am/continue.rb +2 -2
  57. data/lib/git/commands/am/quit.rb +2 -2
  58. data/lib/git/commands/am/retry.rb +4 -2
  59. data/lib/git/commands/am/show_current_patch.rb +1 -1
  60. data/lib/git/commands/am/skip.rb +2 -2
  61. data/lib/git/commands/am.rb +2 -2
  62. data/lib/git/commands/apply.rb +7 -2
  63. data/lib/git/commands/archive/list_formats.rb +3 -3
  64. data/lib/git/commands/archive.rb +7 -2
  65. data/lib/git/commands/arguments.rb +1370 -359
  66. data/lib/git/commands/base.rb +111 -13
  67. data/lib/git/commands/branch/copy.rb +29 -21
  68. data/lib/git/commands/branch/create.rb +72 -68
  69. data/lib/git/commands/branch/delete.rb +25 -17
  70. data/lib/git/commands/branch/list.rb +76 -60
  71. data/lib/git/commands/branch/move.rb +29 -21
  72. data/lib/git/commands/branch/set_upstream.rb +8 -8
  73. data/lib/git/commands/branch/show_current.rb +3 -3
  74. data/lib/git/commands/branch/unset_upstream.rb +4 -8
  75. data/lib/git/commands/branch.rb +2 -2
  76. data/lib/git/commands/cat_file/batch.rb +36 -20
  77. data/lib/git/commands/cat_file/filtered.rb +12 -12
  78. data/lib/git/commands/cat_file/raw.rb +13 -13
  79. data/lib/git/commands/cat_file.rb +4 -4
  80. data/lib/git/commands/checkout/branch.rb +7 -5
  81. data/lib/git/commands/checkout/files.rb +5 -4
  82. data/lib/git/commands/checkout.rb +4 -4
  83. data/lib/git/commands/checkout_index.rb +5 -4
  84. data/lib/git/commands/clean.rb +6 -4
  85. data/lib/git/commands/clone.rb +5 -4
  86. data/lib/git/commands/commit.rb +5 -4
  87. data/lib/git/commands/commit_tree.rb +5 -4
  88. data/lib/git/commands/config_option_syntax/add.rb +7 -4
  89. data/lib/git/commands/config_option_syntax/get.rb +9 -5
  90. data/lib/git/commands/config_option_syntax/get_all.rb +7 -4
  91. data/lib/git/commands/config_option_syntax/get_color.rb +8 -4
  92. data/lib/git/commands/config_option_syntax/get_color_bool.rb +7 -4
  93. data/lib/git/commands/config_option_syntax/get_regexp.rb +8 -4
  94. data/lib/git/commands/config_option_syntax/get_urlmatch.rb +8 -4
  95. data/lib/git/commands/config_option_syntax/list.rb +8 -4
  96. data/lib/git/commands/config_option_syntax/remove_section.rb +7 -2
  97. data/lib/git/commands/config_option_syntax/rename_section.rb +7 -2
  98. data/lib/git/commands/config_option_syntax/replace_all.rb +7 -2
  99. data/lib/git/commands/config_option_syntax/set.rb +7 -2
  100. data/lib/git/commands/config_option_syntax/unset.rb +7 -4
  101. data/lib/git/commands/config_option_syntax/unset_all.rb +7 -2
  102. data/lib/git/commands/describe.rb +5 -4
  103. data/lib/git/commands/diff.rb +13 -12
  104. data/lib/git/commands/diff_files.rb +7 -6
  105. data/lib/git/commands/diff_index.rb +10 -7
  106. data/lib/git/commands/fetch.rb +6 -4
  107. data/lib/git/commands/fsck.rb +6 -4
  108. data/lib/git/commands/gc.rb +6 -4
  109. data/lib/git/commands/grep.rb +6 -5
  110. data/lib/git/commands/init.rb +6 -4
  111. data/lib/git/commands/log.rb +287 -285
  112. data/lib/git/commands/ls_files.rb +69 -65
  113. data/lib/git/commands/ls_remote.rb +62 -56
  114. data/lib/git/commands/ls_tree.rb +50 -46
  115. data/lib/git/commands/maintenance/register.rb +25 -23
  116. data/lib/git/commands/maintenance/run.rb +7 -2
  117. data/lib/git/commands/maintenance/start.rb +7 -2
  118. data/lib/git/commands/maintenance/stop.rb +7 -2
  119. data/lib/git/commands/maintenance/unregister.rb +7 -2
  120. data/lib/git/commands/merge/abort.rb +2 -2
  121. data/lib/git/commands/merge/continue.rb +2 -2
  122. data/lib/git/commands/merge/quit.rb +2 -2
  123. data/lib/git/commands/merge/start.rb +7 -2
  124. data/lib/git/commands/merge.rb +2 -2
  125. data/lib/git/commands/merge_base.rb +7 -2
  126. data/lib/git/commands/mv.rb +7 -2
  127. data/lib/git/commands/name_rev.rb +7 -2
  128. data/lib/git/commands/pull.rb +7 -2
  129. data/lib/git/commands/push.rb +7 -2
  130. data/lib/git/commands/read_tree.rb +7 -2
  131. data/lib/git/commands/remote/add.rb +7 -2
  132. data/lib/git/commands/remote/get_url.rb +4 -2
  133. data/lib/git/commands/remote/list.rb +4 -2
  134. data/lib/git/commands/remote/prune.rb +4 -2
  135. data/lib/git/commands/remote/remove.rb +4 -2
  136. data/lib/git/commands/remote/rename.rb +4 -2
  137. data/lib/git/commands/remote/set_branches.rb +9 -2
  138. data/lib/git/commands/remote/set_head.rb +12 -5
  139. data/lib/git/commands/remote/set_url.rb +9 -2
  140. data/lib/git/commands/remote/set_url_add.rb +11 -2
  141. data/lib/git/commands/remote/set_url_delete.rb +9 -2
  142. data/lib/git/commands/remote/show.rb +18 -12
  143. data/lib/git/commands/remote/update.rb +19 -12
  144. data/lib/git/commands/remote.rb +2 -2
  145. data/lib/git/commands/repack.rb +67 -63
  146. data/lib/git/commands/reset.rb +51 -44
  147. data/lib/git/commands/rev_parse.rb +135 -128
  148. data/lib/git/commands/revert/abort.rb +2 -2
  149. data/lib/git/commands/revert/continue.rb +7 -2
  150. data/lib/git/commands/revert/quit.rb +2 -2
  151. data/lib/git/commands/revert/skip.rb +2 -2
  152. data/lib/git/commands/revert/start.rb +7 -2
  153. data/lib/git/commands/revert.rb +2 -2
  154. data/lib/git/commands/rm.rb +35 -36
  155. data/lib/git/commands/show.rb +1 -1
  156. data/lib/git/commands/show_ref/exclude_existing.rb +3 -4
  157. data/lib/git/commands/show_ref/exists.rb +15 -13
  158. data/lib/git/commands/show_ref/list.rb +39 -35
  159. data/lib/git/commands/show_ref/verify.rb +29 -27
  160. data/lib/git/commands/show_ref.rb +4 -4
  161. data/lib/git/commands/stash/apply.rb +31 -25
  162. data/lib/git/commands/stash/branch.rb +10 -8
  163. data/lib/git/commands/stash/clear.rb +7 -5
  164. data/lib/git/commands/stash/create.rb +10 -8
  165. data/lib/git/commands/stash/drop.rb +15 -9
  166. data/lib/git/commands/stash/list.rb +9 -5
  167. data/lib/git/commands/stash/pop.rb +21 -12
  168. data/lib/git/commands/stash/push.rb +20 -11
  169. data/lib/git/commands/stash/show.rb +21 -12
  170. data/lib/git/commands/stash/store.rb +19 -10
  171. data/lib/git/commands/stash.rb +2 -2
  172. data/lib/git/commands/status.rb +7 -2
  173. data/lib/git/commands/symbolic_ref/delete.rb +18 -14
  174. data/lib/git/commands/symbolic_ref/read.rb +24 -20
  175. data/lib/git/commands/symbolic_ref/update.rb +20 -17
  176. data/lib/git/commands/symbolic_ref.rb +4 -4
  177. data/lib/git/commands/tag/create.rb +45 -42
  178. data/lib/git/commands/tag/delete.rb +5 -3
  179. data/lib/git/commands/tag/list.rb +47 -44
  180. data/lib/git/commands/tag/verify.rb +12 -12
  181. data/lib/git/commands/tag.rb +2 -2
  182. data/lib/git/commands/update_ref/batch.rb +6 -1
  183. data/lib/git/commands/update_ref/delete.rb +19 -21
  184. data/lib/git/commands/update_ref/update.rb +22 -25
  185. data/lib/git/commands/update_ref.rb +4 -4
  186. data/lib/git/commands/version.rb +14 -11
  187. data/lib/git/commands/worktree/add.rb +50 -51
  188. data/lib/git/commands/worktree/list.rb +17 -17
  189. data/lib/git/commands/worktree/lock.rb +12 -12
  190. data/lib/git/commands/worktree/move.rb +16 -16
  191. data/lib/git/commands/worktree/prune.rb +2 -2
  192. data/lib/git/commands/worktree/remove.rb +2 -2
  193. data/lib/git/commands/worktree/repair.rb +2 -2
  194. data/lib/git/commands/worktree/unlock.rb +2 -2
  195. data/lib/git/commands/write_tree.rb +2 -2
  196. data/lib/git/commands.rb +4 -3
  197. data/lib/git/config.rb +47 -1
  198. data/lib/git/configuring.rb +89 -15
  199. data/lib/git/detached_head_info.rb +4 -1
  200. data/lib/git/diff.rb +2 -5
  201. data/lib/git/diff_file_numstat_info.rb +3 -1
  202. data/lib/git/diff_file_patch_info.rb +3 -1
  203. data/lib/git/diff_file_raw_info.rb +3 -1
  204. data/lib/git/diff_info.rb +8 -15
  205. data/lib/git/diff_path_status.rb +16 -3
  206. data/lib/git/diff_result.rb +3 -1
  207. data/lib/git/diff_stats.rb +15 -0
  208. data/lib/git/dirstat_info.rb +24 -8
  209. data/lib/git/encoding_utils.rb +32 -1
  210. data/lib/git/errors.rb +19 -9
  211. data/lib/git/escaped_path.rb +55 -3
  212. data/lib/git/execution_context/repository.rb +15 -0
  213. data/lib/git/execution_context.rb +76 -74
  214. data/lib/git/file_ref.rb +6 -3
  215. data/lib/git/fsck_object.rb +8 -0
  216. data/lib/git/fsck_result.rb +26 -15
  217. data/lib/git/log.rb +152 -5
  218. data/lib/git/object.rb +284 -8
  219. data/lib/git/parsers/branch.rb +18 -0
  220. data/lib/git/parsers/cat_file.rb +2 -2
  221. data/lib/git/parsers/diff.rb +213 -5
  222. data/lib/git/parsers/fsck.rb +11 -0
  223. data/lib/git/parsers/ls_remote.rb +1 -1
  224. data/lib/git/parsers/stash.rb +51 -0
  225. data/lib/git/parsers/tag.rb +38 -0
  226. data/lib/git/remote.rb +34 -2
  227. data/lib/git/repository/branching.rb +23 -21
  228. data/lib/git/repository/committing.rb +46 -6
  229. data/lib/git/repository/context_helpers.rb +45 -16
  230. data/lib/git/repository/diffing.rb +32 -23
  231. data/lib/git/repository/factories.rb +153 -28
  232. data/lib/git/repository/inspecting.rb +1 -1
  233. data/lib/git/repository/logging.rb +169 -30
  234. data/lib/git/repository/maintenance.rb +1 -1
  235. data/lib/git/repository/merging.rb +3 -3
  236. data/lib/git/repository/object_operations.rb +108 -14
  237. data/lib/git/repository/remote_operations.rb +150 -171
  238. data/lib/git/repository/shared_private.rb +7 -5
  239. data/lib/git/repository/staging.rb +36 -12
  240. data/lib/git/repository/stashing.rb +16 -16
  241. data/lib/git/repository/status_operations.rb +1 -1
  242. data/lib/git/repository/worktree_operations.rb +1 -1
  243. data/lib/git/repository.rb +287 -6
  244. data/lib/git/stash.rb +16 -21
  245. data/lib/git/stash_info.rb +4 -4
  246. data/lib/git/stashes.rb +20 -26
  247. data/lib/git/status.rb +25 -13
  248. data/lib/git/tag_delete_failure.rb +3 -0
  249. data/lib/git/tag_delete_result.rb +6 -3
  250. data/lib/git/tag_info.rb +1 -0
  251. data/lib/git/url.rb +12 -5
  252. data/lib/git/version.rb +6 -4
  253. data/lib/git/version_constraint.rb +4 -0
  254. data/lib/git.rb +400 -314
  255. data/redesign/3_architecture_implementation.md +81 -30
  256. data/redesign/Phase 4 - Step A.md +6 -0
  257. data/redesign/Phase 4 - Step B.md +921 -0
  258. data/redesign/Phase 4 - Step C.md +833 -0
  259. data/redesign/c1a-public-api-scope.tsv +256 -0
  260. data/redesign/phase-4-step-b-test-audit.tsv +485 -0
  261. data/tasks/yard.rake +24 -17
  262. metadata +24 -58
  263. data/commitlint.test +0 -4
  264. data/lib/git/args_builder.rb +0 -103
  265. data/lib/git/command_line_result.rb +0 -8
  266. data/lib/git/deprecation.rb +0 -9
  267. data/lib/git/repository/configuring.rb +0 -351
  268. data/tasks/test.rake +0 -25
  269. /data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/KEYWORD_ARG_REMEDIATION.md +0 -0
  270. /data/.github/{skills → skills-deprecated}/review-backward-compatibility/SKILL.md +0 -0
@@ -293,17 +293,14 @@ integration grouping. Use a multi-command or post-processing facade method —
293
293
  single-command delegators do not warrant integration tests (see [When to skip
294
294
  integration tests](#when-to-skip-integration-tests)):
295
295
 
296
- The shared context (e.g. `'in an empty repository'`) provides `repo` and
297
- `repo_dir` helpers. Facade integration specs must override `execution_context`
298
- to a `Git::ExecutionContext::Repository` (the shared context's default is
299
- `repo.lib`, a `Git::Lib`). Stage any required repository state in a `before`
300
- block inside the spec itself.
296
+ The shared context (e.g. `'in an empty repository'`) provides `repo`,
297
+ `repo_dir`, and `execution_context` helpers. Stage any required repository state
298
+ in a `before` block inside the spec itself.
301
299
 
302
300
  ```ruby
303
301
  RSpec.describe Git::Repository::Stashing, :integration do
304
- include_context 'in an empty repository' # provides repo and repo_dir helpers
302
+ include_context 'in an empty repository' # provides repo, repo_dir, and execution_context helpers
305
303
 
306
- let(:execution_context) { Git::ExecutionContext::Repository.from_base(repo) }
307
304
  let(:described_instance) { Git::Repository.new(execution_context: execution_context) }
308
305
 
309
306
  before do
@@ -16,6 +16,7 @@ parser, or execution context that implements the behavior.
16
16
 
17
17
  ## Contents
18
18
 
19
+ - [Contents](#contents)
19
20
  - [Related skills](#related-skills)
20
21
  - [Input](#input)
21
22
  - [Reference](#reference)
@@ -27,7 +28,12 @@ parser, or execution context that implements the behavior.
27
28
  - [Cross-referencing the implementation](#cross-referencing-the-implementation)
28
29
  - [Common issues](#common-issues)
29
30
  - [Workflow](#workflow)
31
+ - [1. Module-level docs](#1-module-level-docs)
32
+ - [2. Method-level docs (per method)](#2-method-level-docs-per-method)
33
+ - [3. Formatting consistency](#3-formatting-consistency)
30
34
  - [Output](#output)
35
+ - [When writing new facade YARD docs](#when-writing-new-facade-yard-docs)
36
+ - [When reviewing existing facade YARD docs](#when-reviewing-existing-facade-yard-docs)
31
37
 
32
38
  ## Related skills
33
39
 
@@ -82,7 +88,7 @@ end
82
88
  ```
83
89
 
84
90
  Module-level tags appear in the order required by
85
- [YARD Documentation — Modules](../yard-documentation/SKILL.md#element-specific-rules):
91
+ [YARD element rules — Modules](../yard-documentation/element-rules.md#modules):
86
92
  `@note`, `@deprecated`, `@see`, `@api`. (Facade modules do not use module-level
87
93
  `@example` — see the override note below.)
88
94
 
@@ -104,7 +110,7 @@ Do **not** add:
104
110
  link is misleading; for single-command modules it is redundant with the
105
111
  method-level link.
106
112
  - `@example` blocks at the module level — **facade-specific override of
107
- [YARD Documentation — Modules](../yard-documentation/SKILL.md#element-specific-rules)**,
113
+ [YARD element rules — Modules](../yard-documentation/element-rules.md#modules)**,
108
114
  which permits module-level `@example` when a module provides standalone
109
115
  methods. Facade modules do provide standalone methods, but every facade
110
116
  method already carries its own `@example`, so a module-level example would
@@ -9,11 +9,19 @@ A meta-skill for creating new Agent Skills. Use this skill when you need to scaf
9
9
 
10
10
  ## Contents
11
11
 
12
+ - [Contents](#contents)
12
13
  - [How to use this skill](#how-to-use-this-skill)
13
14
  - [Related skills](#related-skills)
14
15
  - [When to Use This Skill](#when-to-use-this-skill)
15
16
  - [Prerequisites](#prerequisites)
16
17
  - [Creating a New Skill](#creating-a-new-skill)
18
+ - [Step 1: Create the Skill Directory](#step-1-create-the-skill-directory)
19
+ - [Step 2: Generate SKILL.md with Frontmatter](#step-2-generate-skillmd-with-frontmatter)
20
+ - [Frontmatter Field Requirements](#frontmatter-field-requirements)
21
+ - [Description Best Practices](#description-best-practices)
22
+ - [Step 3: Write the Skill Body](#step-3-write-the-skill-body)
23
+ - [Step 4: Add Optional Directories (If Needed)](#step-4-add-optional-directories-if-needed)
24
+ - [Skill Body Organization](#skill-body-organization)
17
25
  - [Example: Complete Skill Structure](#example-complete-skill-structure)
18
26
  - [Quick Start: Duplicate This Template](#quick-start-duplicate-this-template)
19
27
  - [Validation Checklist](#validation-checklist)
@@ -54,7 +62,7 @@ check discoverability quality before committing.
54
62
 
55
63
  Create a new folder with a lowercase, hyphenated name:
56
64
 
57
- ```
65
+ ```text
58
66
  .github/skills/<skill-name>/
59
67
  └── SKILL.md # Required
60
68
  ```
@@ -114,6 +122,17 @@ After the frontmatter, add markdown instructions. Recommended sections:
114
122
  | `## Troubleshooting` | Common issues and solutions |
115
123
  | `## References` | Links to bundled docs |
116
124
 
125
+ For standards and review skills, rules are mandatory unless explicitly marked
126
+ `Optional`. For advisory skills, distinguish requirements, recommendations, and
127
+ examples with consistent labels.
128
+
129
+ Define named thresholds, modes, phases, or terms before first use, and keep one
130
+ authoritative definition for each concept.
131
+
132
+ Use real markdown headings for durable rule sections. Avoid bold paragraphs as
133
+ pseudo-headings when the section may need a table-of-contents entry, deep link,
134
+ or review reference.
135
+
117
136
  ### Step 4: Add Optional Directories (If Needed)
118
137
 
119
138
  | Folder | Purpose | When to Use |
@@ -123,9 +142,35 @@ After the frontmatter, add markdown instructions. Recommended sections:
123
142
  | `assets/` | Static files used AS-IS | Images, fonts, templates |
124
143
  | `templates/` | Starter code agent modifies | Scaffolds to extend |
125
144
 
145
+ ## Skill Body Organization
146
+
147
+ Target `SKILL.md` under 500 lines; review carefully above 600 lines. Exceeding
148
+ the target is acceptable when splitting always-needed workflow or review rules
149
+ would make the skill less effective. Split situational references first.
150
+
151
+ Keep these in `SKILL.md`:
152
+
153
+ - Routing, prerequisites, and precedence rules
154
+ - The main workflow and required feedback loops
155
+ - Mandatory validation or review checklists
156
+ - Rules needed on nearly every invocation
157
+
158
+ Move these to reference files:
159
+
160
+ - Element-specific, type-specific, or platform-specific rules
161
+ - Long examples and templates
162
+ - Rare edge cases and background material
163
+ - Appendices or migration notes
164
+
165
+ Each reference file should state its purpose and when the agent should load it.
166
+ Keep references one level deep from `SKILL.md`.
167
+
168
+ When one skill extends another, state what it inherits, overrides, or adds. Link
169
+ to the parent skill or reference file and keep child-skill overrides narrow.
170
+
126
171
  ## Example: Complete Skill Structure
127
172
 
128
- ```
173
+ ```text
129
174
  my-awesome-skill/
130
175
  ├── SKILL.md # Required instructions
131
176
  ├── LICENSE.txt # Optional license file
@@ -158,7 +203,12 @@ my-awesome-skill/
158
203
  - [ ] `description` is 10-1024 characters
159
204
  - [ ] `description` explains WHAT and WHEN
160
205
  - [ ] `description` is wrapped in single quotes
161
- - [ ] Body content is under 500 lines
206
+ - [ ] Body content targets under 500 lines and is reviewed carefully above 600 lines
207
+ - [ ] Always-needed workflow and review rules remain in `SKILL.md`
208
+ - [ ] Situational details are split into reference files with clear load conditions
209
+ - [ ] Named thresholds, modes, phases, or terms are defined before first use
210
+ - [ ] Standards/review rules are mandatory unless explicitly marked `Optional`
211
+ - [ ] Deep links, TOC anchors, and referenced files resolve after heading changes
162
212
  - [ ] Bundled assets are under 5MB each
163
213
 
164
214
  ## Troubleshooting
@@ -5,12 +5,15 @@ description: "Performs a comprehensive pre-PR readiness review covering tests, c
5
5
 
6
6
  # PR Readiness Review Workflow
7
7
 
8
- Use this at the end of implementation to prepare for PR submission:
8
+ Use this at the end of implementation to prepare for PR submission. Example
9
+ request:
9
10
 
10
- **"I've completed the implementation. Please perform a comprehensive PR readiness review."**
11
+ > I've completed the implementation. Please perform a comprehensive PR readiness
12
+ > review.
11
13
 
12
14
  ## Contents
13
15
 
16
+ - [Contents](#contents)
14
17
  - [How to use this skill](#how-to-use-this-skill)
15
18
  - [Prerequisites](#prerequisites)
16
19
  - [Related skills](#related-skills)
@@ -50,16 +53,21 @@ Before starting, you **MUST** load the following skill(s) in their entirety:
50
53
  unit/integration test conventions for `Git::Repository::*` facade methods
51
54
  - [Facade YARD Documentation](../facade-yard-documentation/SKILL.md) — verify
52
55
  facade module/method documentation completeness and consistency
56
+ - [Reviewing Skills](../reviewing-skills/SKILL.md) — audit skill quality,
57
+ discoverability, reference structure, and cross-skill links when skill files
58
+ change
53
59
 
54
60
  ## 1. Run Final Validation
55
61
 
56
62
  Execute and report results for:
63
+
57
64
  - `bundle exec rake default` - all tests and linters must pass
58
65
  - Check test output for any Ruby warnings
59
66
 
60
67
  ## 2. Verify Testing Quality
61
68
 
62
69
  **Unit Tests (Critical):**
70
+
63
71
  - [ ] **100% coverage of all changed code** - every branch, edge case, error condition
64
72
  - [ ] All external dependencies properly mocked (execution_context, git commands)
65
73
  - [ ] Each test verifies one specific behavior
@@ -67,6 +75,7 @@ Execute and report results for:
67
75
  - [ ] Test only through public interfaces (see RSpec Unit Testing Standards Rule 6)
68
76
 
69
77
  **Integration Tests (Essential Only):**
78
+
70
79
  - [ ] **Minimal and purposeful** - only test what unit tests cannot verify
71
80
  - [ ] Each test validates one specific git interaction pattern
72
81
  - [ ] Tests verify mocked assumptions match real git behavior
@@ -74,6 +83,7 @@ Execute and report results for:
74
83
  - [ ] Follow CONTRIBUTING.md guidelines: test gem's interaction with git, not git itself
75
84
 
76
85
  **Command Tests (if any `Git::Commands::*` specs are included):**
86
+
77
87
  - [ ] Apply the [Command Test Conventions](../command-test-conventions/SKILL.md) skill to
78
88
  every new or modified unit and integration spec file for command classes. Resolve
79
89
  all findings before proceeding.
@@ -123,6 +133,10 @@ Execute and report results for:
123
133
  - [ ] README.md updated if public API changed
124
134
  - [ ] Examples are clear and demonstrate common use cases
125
135
  - [ ] All `@param`, `@return`, `@raise` tags are accurate
136
+ - [ ] **Skill docs (if any `.github/skills/**` files are included):** Apply the
137
+ [Reviewing Skills](../reviewing-skills/SKILL.md) skill to every new or
138
+ modified skill. Verify TOC anchors, relative links, cross-skill deep links,
139
+ referenced files, and any stated inheritance/override relationships.
126
140
 
127
141
  ## 7. Verify Branch Placement
128
142
 
@@ -143,22 +157,26 @@ history), or recommit (uncommitted changes) — based on the situation.
143
157
  Provide a comprehensive report with:
144
158
 
145
159
  **Implementation Summary:**
160
+
146
161
  - What was implemented and why
147
162
  - Key design decisions made
148
163
  - Any trade-offs or limitations
149
164
 
150
165
  **Test Coverage:**
166
+
151
167
  - Unit tests: X examples covering Y scenarios
152
168
  - Integration tests: Z examples validating specific git interactions
153
169
  - Coverage: 100% of changed lines (or explain gaps)
154
170
  - Edge cases tested: [list critical ones]
155
171
 
156
172
  **Quality Verification:**
173
+
157
174
  - ✅ Items that passed all checks
158
175
  - ⚠️ Items that need attention (if any)
159
176
  - Reference to relevant documentation verified
160
177
 
161
178
  **Suggested PR Materials:**
179
+
162
180
  - PR Title: `type: clear description of change`
163
181
  - PR Description draft including:
164
182
  - Summary of changes
@@ -168,6 +186,7 @@ Provide a comprehensive report with:
168
186
  - Checklist from .github/pull_request_template.md
169
187
 
170
188
  **PR Body Editing Safety:**
189
+
171
190
  - The terminal tool mangles multi-line markdown (backticks, asterisks, newlines) in
172
191
  any shell command, including heredocs. Always write the PR body using the
173
192
  **`create_file` tool** (the VS Code Copilot agent tool that writes file content
@@ -180,6 +199,7 @@ Provide a comprehensive report with:
180
199
  - If the body is garbled, rewrite the file with `create_file` and re-run `gh pr edit`
181
200
 
182
201
  **Next Steps:**
202
+
183
203
  - Any remaining items to address before PR submission
184
204
  - Confirmation that all checklist items are complete
185
205
  - Make sure to create a feature branch for the PR -- never push directly to main
@@ -34,12 +34,7 @@ coding standard details, or implementation constraints.
34
34
  - [Command Implementation](../command-implementation/SKILL.md) — generating and
35
35
  reviewing command classes in the layered architecture
36
36
  - [Facade Implementation](../facade-implementation/SKILL.md) — generating and
37
- reviewing `Git::Repository::*` facade methods (the planned v5.0.0 facade
38
- layer is being introduced incrementally during the architectural redesign;
39
- `Git::Base` / `Git::Lib` remain the current public API until the migration
40
- completes)
41
- - [Extract Facade from Base/Lib](../extract-facade-from-base-lib/SKILL.md) —
42
- migrating public methods from `Git::Base` / `Git::Lib` into facade methods
37
+ reviewing `Git::Repository::*` facade methods, the gem's public API layer
43
38
  - [YARD Documentation](../yard-documentation/SKILL.md) — documentation
44
39
  standards
45
40
 
@@ -49,8 +44,8 @@ coding standard details, or implementation constraints.
49
44
 
50
45
  | Class | Role |
51
46
  | --- | --- |
52
- | `Git::Base` | Main facade — entry point for all user-facing operations |
53
- | `Git::Lib` | Low-level adapter/facade; calls `Git::Commands::*`, builds rich objects via parsers |
47
+ | `Git::Repository` | Main facade — entry point for all user-facing operations; methods live in `Git::Repository::*` topic modules under `lib/git/repository/`, included into the class |
48
+ | `Git::ExecutionContext::*` | Configured subprocess runner; holds binary path, env vars, and global opts; provides `#command_capturing`/`#command_streaming` to command classes |
54
49
  | `Git::Commands::*` | Command classes: define CLI API, bind args, execute → return `CommandLineResult` |
55
50
  | `Git::CommandLine` | Subprocess execution: escaping, timeout, stdout/stderr capture |
56
51
  | `Git::Parsers::*` | Transform raw stdout into structured data |
@@ -67,7 +62,7 @@ coding standard details, or implementation constraints.
67
62
 
68
63
  - `lib/git/` — Core library code
69
64
  - `lib/git/commands/` — Command classes (new architecture)
70
- - `tests/units/` — Legacy Test::Unit suite
65
+ - `lib/git/repository/` — Facade topic modules (`Git::Repository::*`)
71
66
  - `spec/unit/` — RSpec unit tests (mocked execution context)
72
67
  - `spec/integration/` — RSpec integration tests (real git repositories)
73
68
  - `spec/support/` — Shared test contexts and helpers
@@ -81,9 +76,9 @@ coding standard details, or implementation constraints.
81
76
  The three-layer architecture separates concerns cleanly:
82
77
 
83
78
  ```
84
- Git::Base (facade)
85
- └── Git::Lib (adapter pre-processes args, builds rich objects)
86
- └── Git::Commands::* (defines CLI API, binds args, executes)
79
+ Git::Repository (facade — topic modules under lib/git/repository/)
80
+ └── Git::Commands::* (defines CLI API, binds args, executes via execution_context)
81
+ └── Git::ExecutionContext::* (configured subprocess runner: env, binary, global opts)
87
82
  └── Git::CommandLine (subprocess execution)
88
83
  ```
89
84
 
@@ -99,13 +94,11 @@ Git::Base (facade)
99
94
  for the same operation with different output modes are an anti-pattern.
100
95
  - **Parser layer** (`Git::Parsers::*`): Transforms raw stdout/stderr into structured
101
96
  Ruby data. No execution.
102
- - **Facade layer** (`Git::Lib`): Pre-processes caller arguments, invokes the right
103
- command class, calls parsers, constructs rich response objects. **Parser-contract
104
- options** (e.g. `no_color: true`, `pretty: 'raw'`, `format: FORMAT_STRING`) are
105
- passed explicitly at the facade call site — this makes the parser contract
106
- auditable by reading `Git::Lib`. Being incrementally migrated to `Git::Repository`.
107
- - **Interface layer** (`Git::Base`): User-facing API. Delegates to `Git::Lib`.
108
- Returns domain objects.
97
+ - **Facade layer** (`Git::Repository::*`): Pre-processes caller arguments, invokes
98
+ the right command class, calls parsers, constructs rich response objects.
99
+ **Parser-contract options** (e.g. `no_color: true`, `pretty: 'raw'`,
100
+ `format: FORMAT_STRING`) are passed explicitly at the facade call site — this makes
101
+ the parser contract auditable by reading the topic module method.
109
102
 
110
103
  `Git::Commands::Base` provides default `#initialize(execution_context)` and `#call`.
111
104
  Command classes that need non-zero successful exits declare
@@ -115,7 +108,7 @@ Command classes that need non-zero successful exits declare
115
108
 
116
109
  Command classes are neutral, faithful representations of the git CLI. They declare
117
110
  options via the DSL but never embed policy choices (output-control flags, editor
118
- suppression, progress, verbose mode). The facade (`Git::Lib`) sets safe defaults
111
+ suppression, progress, verbose mode). The facade (`Git::Repository::*`) sets safe defaults
119
112
  at each call site. Some defaults are **fixed** (not in `ALLOWED_OPTS` — rejected by
120
113
  `assert_valid_opts!` before reaching the command); others are **overridable** (in
121
114
  `ALLOWED_OPTS`, placed before the caller's `**opts` so the caller's value wins).
@@ -209,7 +202,7 @@ See [CONTRIBUTING.md](../../CONTRIBUTING.md) for authoritative, complete guideli
209
202
 
210
203
  - **Lightweight wrapper** — minimal abstraction over `git` CLI
211
204
  - **Principle of least surprise** — predictable, follows git conventions
212
- - **Direct CLI mapping** — `git add` → `Git::Base#add`; use prefix + suffix for
205
+ - **Direct CLI mapping** — `git add` → `Git::Repository#add`; use prefix + suffix for
213
206
  multi-purpose commands (`#ls_files_untracked`, `#ls_files_staged`)
214
207
  - **Parameter naming** mirrors long CLI options
215
208
  - **Rich output objects** — translate git output to Ruby objects when useful to
@@ -233,7 +226,7 @@ swallow exceptions silently.
233
226
  ### Path Handling
234
227
 
235
228
  - Working-directory paths: relative to repo working directory
236
- - Paths stored as `Pathname` objects on `Git::Base`
229
+ - Paths stored as `Pathname` objects on `Git::Repository`
237
230
  - `Git::EscapedPath` for paths with special characters
238
231
  - Handle Windows path separators; test with Unicode filenames
239
232
 
@@ -292,7 +285,7 @@ swallow exceptions silently.
292
285
  ### Adding new commands
293
286
 
294
287
  Follow the three-layer pattern: command class (CLI contract) → parser (output
295
- transform) → `Git::Lib` method (orchestration + rich object). See
288
+ transform) → `Git::Repository::*` facade method (orchestration + rich object). See
296
289
  [Command Implementation](../command-implementation/SKILL.md).
297
290
 
298
291
  ### Working with paths
@@ -48,9 +48,9 @@ confirms.
48
48
 
49
49
  Evaluate the PR against these criteria:
50
50
 
51
- **Code Quality:** Ruby style (Rubocop-compliant), `frozen_string_literal: true`, proper naming (snake_case/PascalCase), single-responsibility, no duplication, Ruby 3.2+ idioms.
51
+ **Code Quality:** Ruby style (RuboCop-compliant), `frozen_string_literal: true`, proper naming (snake_case/PascalCase), single-responsibility, no duplication, Ruby 3.2+ idioms.
52
52
 
53
- **Testing:** Changes are covered by atomic RSpec specs (`spec/`), well-named, and passing CI. Legacy Test::Unit tests (`tests/units/`) require justification to modify.
53
+ **Testing:** Changes are covered by atomic RSpec specs (`spec/`), well-named, and passing CI.
54
54
 
55
55
  **Documentation:** YARD docs on public methods with `@param`, `@return`, `@raise`, `@example`. README updated for user-facing changes. Platform differences and security documented. For `Git::Commands::*` classes, `@raise [Git::FailedError]` must use the canonical generic wording — **never** enumerate failure causes; see the `@raise` wording table in [Command YARD Documentation](../command-yard-documentation/SKILL.md#3-return-and-raise-tags).
56
56
 
@@ -0,0 +1,148 @@
1
+ ---
2
+ name: rebase
3
+ description: 'Rebases the current branch onto origin/main, resolves rebase conflicts, and force-pushes with lease using non-interactive Git commands that never open an editor. Use when updating a feature branch from main, handling rebase conflicts, or rewriting branch history before updating a pull request.'
4
+ ---
5
+
6
+ # Rebase
7
+
8
+ Rebase the current branch on `origin/main`, resolve conflicts, and force-push
9
+ the rewritten history without opening an editor.
10
+
11
+ ## Contents
12
+
13
+ - [Contents](#contents)
14
+ - [How to use this skill](#how-to-use-this-skill)
15
+ - [Related skills](#related-skills)
16
+ - [Prerequisites](#prerequisites)
17
+ - [Safety rules](#safety-rules)
18
+ - [Workflow](#workflow)
19
+ - [Step 1: Preflight checks and fetch](#step-1-preflight-checks-and-fetch)
20
+ - [Step 2: Start rebase on origin/main](#step-2-start-rebase-on-originmain)
21
+ - [Step 3: Resolve conflicts and continue](#step-3-resolve-conflicts-and-continue)
22
+ - [Step 4: Verify the rebased branch](#step-4-verify-the-rebased-branch)
23
+ - [Step 5: Force-push with lease](#step-5-force-push-with-lease)
24
+ - [Troubleshooting](#troubleshooting)
25
+
26
+ ## How to use this skill
27
+
28
+ Attach this file to your Copilot Chat context, then invoke it when the current
29
+ branch needs to be rebased onto `origin/main` and pushed.
30
+
31
+ ## Related skills
32
+
33
+ - [Resolve Feedback](../resolve-feedback/SKILL.md) — follow-up workflow for
34
+ addressing PR review comments after rebasing
35
+ - [PR Readiness Review](../pr-readiness-review/SKILL.md) — final validation
36
+ before opening or updating a pull request
37
+
38
+ ## Prerequisites
39
+
40
+ - `git` is installed and authenticated for the remote.
41
+ - The branch is a topic branch with an upstream on `origin`.
42
+ - The working tree is clean before rebasing.
43
+
44
+ ## Safety rules
45
+
46
+ These rules are mandatory:
47
+
48
+ - Never run this workflow on `main` or `4.x`.
49
+ - Always fetch `origin` immediately before rebasing.
50
+ - Always run rebase commands with `GIT_EDITOR=:` and `GIT_SEQUENCE_EDITOR=:` so
51
+ no editor opens.
52
+ - Force-push only with `--force-with-lease`.
53
+
54
+ ## Workflow
55
+
56
+ 1. [Preflight checks and fetch](#step-1-preflight-checks-and-fetch)
57
+ 2. [Start rebase on origin/main](#step-2-start-rebase-on-originmain)
58
+ 3. [Resolve conflicts and continue](#step-3-resolve-conflicts-and-continue)
59
+ 4. [Verify the rebased branch](#step-4-verify-the-rebased-branch)
60
+ 5. [Force-push with lease](#step-5-force-push-with-lease)
61
+
62
+ ## Step 1: Preflight checks and fetch
63
+
64
+ ```bash
65
+ git branch --show-current
66
+ git status --short --branch
67
+ git fetch --prune origin
68
+ ```
69
+
70
+ If the current branch is `main` or `4.x`, stop and ask the user to switch to a
71
+ topic branch first.
72
+
73
+ If `git status --short --branch` shows uncommitted changes, stop and ask the
74
+ user whether to commit or stash before continuing.
75
+
76
+ ## Step 2: Start rebase on origin/main
77
+
78
+ ```bash
79
+ GIT_EDITOR=: GIT_SEQUENCE_EDITOR=: git rebase origin/main
80
+ ```
81
+
82
+ If the command succeeds, continue to Step 4. If it stops with conflicts, go to
83
+ Step 3.
84
+
85
+ ## Step 3: Resolve conflicts and continue
86
+
87
+ Repeat until the rebase completes:
88
+
89
+ 1. Inspect conflicted files:
90
+
91
+ ```bash
92
+ git status --short
93
+ ```
94
+
95
+ 2. Edit conflicted files, remove conflict markers, and keep the intended final
96
+ content.
97
+
98
+ 3. Stage resolved files:
99
+
100
+ ```bash
101
+ git add <resolved-path> [<resolved-path>...]
102
+ ```
103
+
104
+ 4. Continue the rebase without opening an editor:
105
+
106
+ ```bash
107
+ GIT_EDITOR=: GIT_SEQUENCE_EDITOR=: git rebase --continue
108
+ ```
109
+
110
+ 5. If Git reports an empty patch after conflict resolution, skip that commit:
111
+
112
+ ```bash
113
+ GIT_EDITOR=: GIT_SEQUENCE_EDITOR=: git rebase --skip
114
+ ```
115
+
116
+ If the rebase cannot be completed safely, abort and report back:
117
+
118
+ ```bash
119
+ git rebase --abort
120
+ ```
121
+
122
+ ## Step 4: Verify the rebased branch
123
+
124
+ ```bash
125
+ git status --short --branch
126
+ git merge-base --is-ancestor origin/main HEAD
127
+ git --no-pager log --oneline --decorate --max-count=15
128
+ ```
129
+
130
+ `git merge-base --is-ancestor origin/main HEAD` must exit successfully.
131
+
132
+ ## Step 5: Force-push with lease
133
+
134
+ ```bash
135
+ git push --force-with-lease
136
+ ```
137
+
138
+ If push is rejected, fetch and reconcile remote updates before retrying. Never
139
+ replace this with plain `--force`.
140
+
141
+ ## Troubleshooting
142
+
143
+ | Issue | Solution |
144
+ | ----- | -------- |
145
+ | Rebase stops with conflicts | Resolve files, `git add`, then run `GIT_EDITOR=: GIT_SEQUENCE_EDITOR=: git rebase --continue`. |
146
+ | Rebase continue opens an editor | Re-run with both `GIT_EDITOR=:` and `GIT_SEQUENCE_EDITOR=:` prefixes. |
147
+ | `--force-with-lease` push rejected | Run `git fetch origin`, inspect divergence, reconcile, and retry `--force-with-lease`. |
148
+ | Need to abandon rebasing attempt | Run `git rebase --abort` and report the reason to the user. |
@@ -51,7 +51,7 @@ Before starting, you **MUST** load the following skill(s) in their entirety:
51
51
  rollout gates, and internal compatibility contracts
52
52
  - [Review Arguments DSL](../review-arguments-dsl/SKILL.md) — verifying DSL entries match git CLI
53
53
  - [Command Test Conventions](../command-test-conventions/SKILL.md) — unit/integration test conventions for command classes
54
- - [Review Backward Compatibility](../review-backward-compatibility/SKILL.md) — preserving `Git::Lib` return-value contracts
54
+ - [Facade Implementation](../facade-implementation/SKILL.md) — preserving `Git::Repository::*` return-value contracts
55
55
 
56
56
  ## Target end state
57
57