git 4.3.2 → 5.0.0.beta.1

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 (280) hide show
  1. checksums.yaml +4 -4
  2. data/.github/copilot-instructions.md +67 -2705
  3. data/.github/pull_request_template.md +3 -1
  4. data/.github/skills/breaking-change-analysis/SKILL.md +102 -0
  5. data/.github/skills/ci-cd-troubleshooting/SKILL.md +264 -0
  6. data/.github/skills/command-implementation/REFERENCE.md +993 -0
  7. data/.github/skills/command-implementation/SKILL.md +229 -0
  8. data/.github/skills/command-test-conventions/SKILL.md +660 -0
  9. data/.github/skills/command-yard-documentation/SKILL.md +426 -0
  10. data/.github/skills/dependency-management/SKILL.md +72 -0
  11. data/.github/skills/development-workflow/SKILL.md +506 -0
  12. data/.github/skills/extract-command-from-lib/SKILL.md +487 -0
  13. data/.github/skills/extract-facade-from-base-lib/SKILL.md +586 -0
  14. data/.github/skills/facade-implementation/REFERENCE.md +840 -0
  15. data/.github/skills/facade-implementation/SKILL.md +260 -0
  16. data/.github/skills/facade-test-conventions/SKILL.md +380 -0
  17. data/.github/skills/facade-yard-documentation/SKILL.md +429 -0
  18. data/.github/skills/make-skill-template/SKILL.md +176 -0
  19. data/.github/skills/pr-readiness-review/SKILL.md +185 -0
  20. data/.github/skills/project-context/SKILL.md +313 -0
  21. data/.github/skills/pull-request-review/SKILL.md +168 -0
  22. data/.github/skills/refactor-command-to-commandlineresult/SKILL.md +131 -0
  23. data/.github/skills/release-management/SKILL.md +125 -0
  24. data/.github/skills/review-arguments-dsl/CHECKLIST.md +788 -0
  25. data/.github/skills/review-arguments-dsl/SKILL.md +214 -0
  26. data/.github/skills/review-backward-compatibility/SKILL.md +275 -0
  27. data/.github/skills/review-cross-command-consistency/SKILL.md +139 -0
  28. data/.github/skills/reviewing-skills/SKILL.md +189 -0
  29. data/.github/skills/rspec-unit-testing-standards/SKILL.md +639 -0
  30. data/.github/skills/tdd-refactor-step/SKILL.md +236 -0
  31. data/.github/skills/test-debugging/SKILL.md +160 -0
  32. data/.github/skills/yard-documentation/SKILL.md +793 -0
  33. data/.github/workflows/continuous_integration.yml +3 -2
  34. data/.github/workflows/enforce_conventional_commits.yml +1 -1
  35. data/.github/workflows/experimental_continuous_integration.yml +2 -2
  36. data/.github/workflows/release.yml +3 -4
  37. data/.gitignore +8 -0
  38. data/.husky/pre-commit +13 -0
  39. data/.release-please-manifest.json +1 -1
  40. data/.rspec +3 -0
  41. data/.rubocop.yml +7 -3
  42. data/.rubocop_todo.yml +23 -5
  43. data/.yardopts +1 -0
  44. data/CHANGELOG.md +0 -40
  45. data/CONTRIBUTING.md +694 -53
  46. data/README.md +17 -5
  47. data/Rakefile +61 -9
  48. data/commitlint.test +4 -0
  49. data/git.gemspec +14 -8
  50. data/lib/git/args_builder.rb +0 -8
  51. data/lib/git/base.rb +486 -410
  52. data/lib/git/branch.rb +380 -43
  53. data/lib/git/branch_delete_failure.rb +31 -0
  54. data/lib/git/branch_delete_result.rb +63 -0
  55. data/lib/git/branch_info.rb +178 -0
  56. data/lib/git/branches.rb +130 -24
  57. data/lib/git/command_line/base.rb +245 -0
  58. data/lib/git/command_line/capturing.rb +249 -0
  59. data/lib/git/command_line/result.rb +96 -0
  60. data/lib/git/command_line/streaming.rb +194 -0
  61. data/lib/git/command_line.rb +43 -322
  62. data/lib/git/command_line_result.rb +4 -88
  63. data/lib/git/commands/add.rb +131 -0
  64. data/lib/git/commands/am/abort.rb +43 -0
  65. data/lib/git/commands/am/apply.rb +252 -0
  66. data/lib/git/commands/am/continue.rb +43 -0
  67. data/lib/git/commands/am/quit.rb +43 -0
  68. data/lib/git/commands/am/retry.rb +47 -0
  69. data/lib/git/commands/am/show_current_patch.rb +64 -0
  70. data/lib/git/commands/am/skip.rb +42 -0
  71. data/lib/git/commands/am.rb +33 -0
  72. data/lib/git/commands/apply.rb +237 -0
  73. data/lib/git/commands/archive/list_formats.rb +46 -0
  74. data/lib/git/commands/archive.rb +140 -0
  75. data/lib/git/commands/arguments.rb +3510 -0
  76. data/lib/git/commands/base.rb +403 -0
  77. data/lib/git/commands/branch/copy.rb +94 -0
  78. data/lib/git/commands/branch/create.rb +173 -0
  79. data/lib/git/commands/branch/delete.rb +80 -0
  80. data/lib/git/commands/branch/list.rb +162 -0
  81. data/lib/git/commands/branch/move.rb +94 -0
  82. data/lib/git/commands/branch/set_upstream.rb +86 -0
  83. data/lib/git/commands/branch/show_current.rb +49 -0
  84. data/lib/git/commands/branch/unset_upstream.rb +57 -0
  85. data/lib/git/commands/branch.rb +34 -0
  86. data/lib/git/commands/cat_file/batch.rb +364 -0
  87. data/lib/git/commands/cat_file/filtered.rb +105 -0
  88. data/lib/git/commands/cat_file/raw.rb +210 -0
  89. data/lib/git/commands/cat_file.rb +49 -0
  90. data/lib/git/commands/checkout/branch.rb +151 -0
  91. data/lib/git/commands/checkout/files.rb +115 -0
  92. data/lib/git/commands/checkout.rb +38 -0
  93. data/lib/git/commands/checkout_index.rb +105 -0
  94. data/lib/git/commands/clean.rb +100 -0
  95. data/lib/git/commands/clone.rb +240 -0
  96. data/lib/git/commands/commit.rb +272 -0
  97. data/lib/git/commands/commit_tree.rb +100 -0
  98. data/lib/git/commands/config_option_syntax/add.rb +83 -0
  99. data/lib/git/commands/config_option_syntax/get.rb +117 -0
  100. data/lib/git/commands/config_option_syntax/get_all.rb +115 -0
  101. data/lib/git/commands/config_option_syntax/get_color.rb +91 -0
  102. data/lib/git/commands/config_option_syntax/get_color_bool.rb +93 -0
  103. data/lib/git/commands/config_option_syntax/get_regexp.rb +115 -0
  104. data/lib/git/commands/config_option_syntax/get_urlmatch.rb +102 -0
  105. data/lib/git/commands/config_option_syntax/list.rb +107 -0
  106. data/lib/git/commands/config_option_syntax/remove_section.rb +74 -0
  107. data/lib/git/commands/config_option_syntax/rename_section.rb +78 -0
  108. data/lib/git/commands/config_option_syntax/replace_all.rb +104 -0
  109. data/lib/git/commands/config_option_syntax/set.rb +114 -0
  110. data/lib/git/commands/config_option_syntax/unset.rb +89 -0
  111. data/lib/git/commands/config_option_syntax/unset_all.rb +89 -0
  112. data/lib/git/commands/config_option_syntax.rb +56 -0
  113. data/lib/git/commands/describe.rb +155 -0
  114. data/lib/git/commands/diff.rb +656 -0
  115. data/lib/git/commands/diff_files.rb +518 -0
  116. data/lib/git/commands/diff_index.rb +496 -0
  117. data/lib/git/commands/fetch.rb +352 -0
  118. data/lib/git/commands/fsck.rb +136 -0
  119. data/lib/git/commands/gc.rb +132 -0
  120. data/lib/git/commands/grep.rb +338 -0
  121. data/lib/git/commands/init.rb +99 -0
  122. data/lib/git/commands/log.rb +632 -0
  123. data/lib/git/commands/ls_files.rb +191 -0
  124. data/lib/git/commands/ls_remote.rb +155 -0
  125. data/lib/git/commands/ls_tree.rb +131 -0
  126. data/lib/git/commands/maintenance/register.rb +75 -0
  127. data/lib/git/commands/maintenance/run.rb +104 -0
  128. data/lib/git/commands/maintenance/start.rb +66 -0
  129. data/lib/git/commands/maintenance/stop.rb +55 -0
  130. data/lib/git/commands/maintenance/unregister.rb +79 -0
  131. data/lib/git/commands/maintenance.rb +31 -0
  132. data/lib/git/commands/merge/abort.rb +44 -0
  133. data/lib/git/commands/merge/continue.rb +44 -0
  134. data/lib/git/commands/merge/quit.rb +46 -0
  135. data/lib/git/commands/merge/start.rb +245 -0
  136. data/lib/git/commands/merge.rb +28 -0
  137. data/lib/git/commands/merge_base.rb +86 -0
  138. data/lib/git/commands/mv.rb +77 -0
  139. data/lib/git/commands/name_rev.rb +114 -0
  140. data/lib/git/commands/pull.rb +377 -0
  141. data/lib/git/commands/push.rb +246 -0
  142. data/lib/git/commands/read_tree.rb +149 -0
  143. data/lib/git/commands/remote/add.rb +91 -0
  144. data/lib/git/commands/remote/get_url.rb +66 -0
  145. data/lib/git/commands/remote/list.rb +54 -0
  146. data/lib/git/commands/remote/prune.rb +61 -0
  147. data/lib/git/commands/remote/remove.rb +52 -0
  148. data/lib/git/commands/remote/rename.rb +69 -0
  149. data/lib/git/commands/remote/set_branches.rb +63 -0
  150. data/lib/git/commands/remote/set_head.rb +82 -0
  151. data/lib/git/commands/remote/set_url.rb +71 -0
  152. data/lib/git/commands/remote/set_url_add.rb +61 -0
  153. data/lib/git/commands/remote/set_url_delete.rb +64 -0
  154. data/lib/git/commands/remote/show.rb +71 -0
  155. data/lib/git/commands/remote/update.rb +72 -0
  156. data/lib/git/commands/remote.rb +42 -0
  157. data/lib/git/commands/repack.rb +277 -0
  158. data/lib/git/commands/reset.rb +147 -0
  159. data/lib/git/commands/rev_parse.rb +297 -0
  160. data/lib/git/commands/revert/abort.rb +45 -0
  161. data/lib/git/commands/revert/continue.rb +57 -0
  162. data/lib/git/commands/revert/quit.rb +47 -0
  163. data/lib/git/commands/revert/skip.rb +44 -0
  164. data/lib/git/commands/revert/start.rb +153 -0
  165. data/lib/git/commands/revert.rb +29 -0
  166. data/lib/git/commands/rm.rb +114 -0
  167. data/lib/git/commands/show.rb +632 -0
  168. data/lib/git/commands/show_ref/exclude_existing.rb +120 -0
  169. data/lib/git/commands/show_ref/exists.rb +78 -0
  170. data/lib/git/commands/show_ref/list.rb +145 -0
  171. data/lib/git/commands/show_ref/verify.rb +120 -0
  172. data/lib/git/commands/show_ref.rb +42 -0
  173. data/lib/git/commands/stash/apply.rb +75 -0
  174. data/lib/git/commands/stash/branch.rb +65 -0
  175. data/lib/git/commands/stash/clear.rb +41 -0
  176. data/lib/git/commands/stash/create.rb +58 -0
  177. data/lib/git/commands/stash/drop.rb +67 -0
  178. data/lib/git/commands/stash/list.rb +39 -0
  179. data/lib/git/commands/stash/pop.rb +78 -0
  180. data/lib/git/commands/stash/push.rb +103 -0
  181. data/lib/git/commands/stash/show.rb +149 -0
  182. data/lib/git/commands/stash/store.rb +63 -0
  183. data/lib/git/commands/stash.rb +38 -0
  184. data/lib/git/commands/status.rb +169 -0
  185. data/lib/git/commands/symbolic_ref/delete.rb +68 -0
  186. data/lib/git/commands/symbolic_ref/read.rb +95 -0
  187. data/lib/git/commands/symbolic_ref/update.rb +76 -0
  188. data/lib/git/commands/symbolic_ref.rb +38 -0
  189. data/lib/git/commands/tag/create.rb +139 -0
  190. data/lib/git/commands/tag/delete.rb +55 -0
  191. data/lib/git/commands/tag/list.rb +143 -0
  192. data/lib/git/commands/tag/verify.rb +71 -0
  193. data/lib/git/commands/tag.rb +26 -0
  194. data/lib/git/commands/update_ref/batch.rb +140 -0
  195. data/lib/git/commands/update_ref/delete.rb +92 -0
  196. data/lib/git/commands/update_ref/update.rb +106 -0
  197. data/lib/git/commands/update_ref.rb +42 -0
  198. data/lib/git/commands/version.rb +52 -0
  199. data/lib/git/commands/worktree/add.rb +140 -0
  200. data/lib/git/commands/worktree/list.rb +64 -0
  201. data/lib/git/commands/worktree/lock.rb +58 -0
  202. data/lib/git/commands/worktree/management_base.rb +51 -0
  203. data/lib/git/commands/worktree/move.rb +66 -0
  204. data/lib/git/commands/worktree/prune.rb +67 -0
  205. data/lib/git/commands/worktree/remove.rb +63 -0
  206. data/lib/git/commands/worktree/repair.rb +76 -0
  207. data/lib/git/commands/worktree/unlock.rb +47 -0
  208. data/lib/git/commands/worktree.rb +43 -0
  209. data/lib/git/commands/write_tree.rb +68 -0
  210. data/lib/git/commands.rb +89 -0
  211. data/lib/git/detached_head_info.rb +54 -0
  212. data/lib/git/diff.rb +297 -7
  213. data/lib/git/diff_file_numstat_info.rb +29 -0
  214. data/lib/git/diff_file_patch_info.rb +134 -0
  215. data/lib/git/diff_file_raw_info.rb +127 -0
  216. data/lib/git/diff_info.rb +169 -0
  217. data/lib/git/diff_path_status.rb +78 -19
  218. data/lib/git/diff_result.rb +32 -0
  219. data/lib/git/diff_stats.rb +59 -14
  220. data/lib/git/dirstat_info.rb +86 -0
  221. data/lib/git/errors.rb +65 -2
  222. data/lib/git/execution_context/global.rb +56 -0
  223. data/lib/git/execution_context/repository.rb +147 -0
  224. data/lib/git/execution_context.rb +482 -0
  225. data/lib/git/file_ref.rb +74 -0
  226. data/lib/git/fsck_object.rb +9 -9
  227. data/lib/git/fsck_result.rb +1 -1
  228. data/lib/git/lib.rb +1606 -1028
  229. data/lib/git/log.rb +15 -2
  230. data/lib/git/object.rb +92 -22
  231. data/lib/git/parsers/branch.rb +224 -0
  232. data/lib/git/parsers/cat_file.rb +111 -0
  233. data/lib/git/parsers/diff.rb +585 -0
  234. data/lib/git/parsers/fsck.rb +133 -0
  235. data/lib/git/parsers/grep.rb +42 -0
  236. data/lib/git/parsers/ls_tree.rb +58 -0
  237. data/lib/git/parsers/stash.rb +208 -0
  238. data/lib/git/parsers/tag.rb +257 -0
  239. data/lib/git/remote.rb +133 -9
  240. data/lib/git/repository/branching.rb +572 -0
  241. data/lib/git/repository/committing.rb +191 -0
  242. data/lib/git/repository/configuring.rb +156 -0
  243. data/lib/git/repository/diffing.rb +775 -0
  244. data/lib/git/repository/inspecting.rb +153 -0
  245. data/lib/git/repository/logging.rb +247 -0
  246. data/lib/git/repository/merging.rb +295 -0
  247. data/lib/git/repository/object_operations.rb +1101 -0
  248. data/lib/git/repository/path_resolver.rb +207 -0
  249. data/lib/git/repository/remote_operations.rb +753 -0
  250. data/lib/git/repository/shared_private.rb +51 -0
  251. data/lib/git/repository/staging.rb +390 -0
  252. data/lib/git/repository/stashing.rb +107 -0
  253. data/lib/git/repository/status_operations.rb +180 -0
  254. data/lib/git/repository/worktree_operations.rb +159 -0
  255. data/lib/git/repository.rb +264 -1
  256. data/lib/git/stash.rb +85 -4
  257. data/lib/git/stash_info.rb +104 -0
  258. data/lib/git/stashes.rb +130 -13
  259. data/lib/git/status.rb +224 -18
  260. data/lib/git/tag_delete_failure.rb +31 -0
  261. data/lib/git/tag_delete_result.rb +63 -0
  262. data/lib/git/tag_info.rb +105 -0
  263. data/lib/git/version.rb +109 -2
  264. data/lib/git/version_constraint.rb +81 -0
  265. data/lib/git/worktree.rb +120 -5
  266. data/lib/git/worktrees.rb +107 -7
  267. data/lib/git.rb +114 -18
  268. data/redesign/1_architecture_existing.md +54 -18
  269. data/redesign/2_architecture_redesign.md +365 -46
  270. data/redesign/3_architecture_implementation.md +1451 -54
  271. data/tasks/gem_tasks.rake +4 -0
  272. data/tasks/npm_tasks.rake +7 -0
  273. data/tasks/rspec.rake +48 -0
  274. data/tasks/test.rake +13 -1
  275. data/tasks/yard.rake +34 -7
  276. metadata +349 -20
  277. data/lib/git/index.rb +0 -6
  278. data/lib/git/path.rb +0 -38
  279. data/lib/git/working_directory.rb +0 -6
  280. /data/{release-please-config.json → .release-please-config.json} +0 -0
@@ -0,0 +1,429 @@
1
+ ---
2
+ name: facade-yard-documentation
3
+ description: "Facade-specific YARD documentation rules for Git::Repository::* topic modules and their facade methods, overriding and extending the general yard-documentation skill. Use when writing or reviewing YARD docs for facade modules under lib/git/repository/."
4
+ ---
5
+
6
+ # Facade YARD Documentation
7
+
8
+ Write and verify YARD documentation for facade modules and methods on
9
+ `Git::Repository::*`. This skill overrides and extends the general
10
+ [YARD Documentation](../yard-documentation/SKILL.md) skill with facade-specific
11
+ rules.
12
+
13
+ The facade is the **public API surface** of the gem. Facade docs describe what
14
+ the caller passes and what they get back — never the internal command class,
15
+ parser, or execution context that implements the behavior.
16
+
17
+ ## Contents
18
+
19
+ - [Related skills](#related-skills)
20
+ - [Input](#input)
21
+ - [Reference](#reference)
22
+ - [Module-level docs](#module-level-docs)
23
+ - [Method-level docs](#method-level-docs)
24
+ - [Documenting forwarded options with `@overload`](#documenting-forwarded-options-with-overload)
25
+ - [Return type rules](#return-type-rules)
26
+ - [`@raise` rules](#raise-rules)
27
+ - [Cross-referencing the implementation](#cross-referencing-the-implementation)
28
+ - [Common issues](#common-issues)
29
+ - [Workflow](#workflow)
30
+ - [Output](#output)
31
+
32
+ ## Related skills
33
+
34
+ - [YARD Documentation](../yard-documentation/SKILL.md) — authoritative source for
35
+ general YARD formatting rules; **must be loaded** as a prerequisite
36
+ - [Facade Implementation](../facade-implementation/SKILL.md) — facade module
37
+ structure and orchestration patterns
38
+ - [Facade Test Conventions](../facade-test-conventions/SKILL.md) — unit and
39
+ integration test conventions for facade methods
40
+ - [Command YARD Documentation](../command-yard-documentation/SKILL.md) — sibling
41
+ skill for the underlying command classes (different rules — facade docs do
42
+ **not** mirror command DSL)
43
+
44
+ ## Input
45
+
46
+ Before starting, you **MUST** load the following skill(s) in their entirety:
47
+
48
+ - [YARD Documentation](../yard-documentation/SKILL.md) — authoritative source for
49
+ YARD formatting rules and writing standards
50
+
51
+ Then gather:
52
+
53
+ 1. **Facade module source** — `lib/git/repository/<topic>.rb`
54
+ 2. **Underlying command class(es)** — `lib/git/commands/<command>.rb` for each
55
+ command the facade method calls. Use these to confirm option semantics, but
56
+ do **not** copy the command's `@option` docs verbatim — the facade only
57
+ exposes the options it documents in its public contract.
58
+ 3. **Underlying parser/result class** — when the facade returns a structured
59
+ value, read the parser or result class to confirm the documented return type.
60
+
61
+ ## Reference
62
+
63
+ ### Module-level docs
64
+
65
+ Every facade module under `lib/git/repository/` requires a module-level YARD
66
+ block:
67
+
68
+ ```ruby
69
+ module Git
70
+ class Repository
71
+ # Short summary of the topic and the facade methods it provides
72
+ #
73
+ # Included by {Git::Repository}.
74
+ #
75
+ # @api public
76
+ #
77
+ module Topic
78
+ # ...
79
+ end
80
+ end
81
+ end
82
+ ```
83
+
84
+ Module-level tags appear in the order required by
85
+ [YARD Documentation — Modules](../yard-documentation/SKILL.md#element-specific-rules):
86
+ `@note`, `@deprecated`, `@see`, `@api`. (Facade modules do not use module-level
87
+ `@example` — see the override note below.)
88
+
89
+ Required tags:
90
+
91
+ - [ ] short summary describing the topic (e.g. "Facade methods for staging-area
92
+ operations: adding and resetting files") — follows the short-description
93
+ rules in [YARD Documentation](../yard-documentation/SKILL.md)
94
+ - [ ] sentence noting "Included by {Git::Repository}." with the YARD link
95
+ - [ ] `@api public` — every facade module is part of the public API
96
+
97
+ Do **not** add:
98
+
99
+ - `@see Git::Commands::*` at the module level — implementation detail
100
+ - `@see https://git-scm.com/docs/...` at the module level — git man-page
101
+ links belong on the individual facade methods, where the link maps directly
102
+ to the command being invoked. A module typically groups several facade
103
+ methods (sometimes spanning multiple git commands), so a single module-level
104
+ link is misleading; for single-command modules it is redundant with the
105
+ method-level link.
106
+ - `@example` blocks at the module level — **facade-specific override of
107
+ [YARD Documentation — Modules](../yard-documentation/SKILL.md#element-specific-rules)**,
108
+ which permits module-level `@example` when a module provides standalone
109
+ methods. Facade modules do provide standalone methods, but every facade
110
+ method already carries its own `@example`, so a module-level example would
111
+ be redundant. Examples belong on the methods.
112
+
113
+ ### Method-level docs
114
+
115
+ Every facade method requires full YARD docs. Two acceptable forms:
116
+
117
+ **Form A — `@overload` with anonymous splat in the `def`** (the **default**
118
+ for any method that forwards positional args and/or keyword options unchanged
119
+ to the underlying command). The `def` uses an anonymous splat — `**`, `*`, or
120
+ `...` — to satisfy RuboCop's `Style/ArgumentsForwarding` cop, and the
121
+ `@overload` block introduces named parameters that `@param` and `@option` bind
122
+ to:
123
+
124
+ ```ruby
125
+ # Update the index with the current content found in the working tree
126
+ #
127
+ # @overload add(paths = '.', **options)
128
+ #
129
+ # @example Stage all changed files
130
+ # repo.add
131
+ #
132
+ # @example Stage a specific file
133
+ # repo.add('README.md')
134
+ #
135
+ # @param paths [String, Array<String>] a file or files to add (relative to
136
+ # the worktree root); defaults to `'.'` (all files)
137
+ #
138
+ # @param options [Hash] options for the add command
139
+ #
140
+ # @option options [Boolean, nil] :all (nil) add, modify, and remove index
141
+ # entries to match the worktree
142
+ #
143
+ # @option options [Boolean, nil] :force (nil) allow adding otherwise ignored
144
+ # files
145
+ #
146
+ # @return [String] git's stdout from the add
147
+ #
148
+ # @raise [ArgumentError] if unsupported options are provided
149
+ #
150
+ # @raise [Git::FailedError] if `git add` exits with a non-zero status
151
+ #
152
+ def add(paths = '.', **)
153
+ Git::Repository::Internal.assert_valid_opts!(ADD_ALLOWED_OPTS, **)
154
+ Git::Commands::Add.new(@execution_context).call(*Array(paths), **).stdout
155
+ end
156
+ ```
157
+
158
+ See [Documenting forwarded options with
159
+ `@overload`](#documenting-forwarded-options-with-overload) for the rationale
160
+ and variations (`*`, `...`, multiple call shapes).
161
+
162
+ **Form B — direct doc comment on a fully named signature** (the **narrow
163
+ exception**: use only when the method body must inspect or mutate the options
164
+ hash before forwarding it, or when the signature has no splat at all). When
165
+ the `def` has a named parameter for every documented argument, `@param` and
166
+ `@option` bind directly:
167
+
168
+ ```ruby
169
+ # Commit staged changes
170
+ #
171
+ # @example Commit with a message
172
+ # repo.commit('Initial commit')
173
+ #
174
+ # @example Amend the previous commit
175
+ # repo.commit('Updated message', amend: true)
176
+ #
177
+ # @param message [String] the commit message
178
+ #
179
+ # @param opts [Hash] commit options
180
+ #
181
+ # @option opts [Boolean, nil] :amend (nil) amend the previous commit
182
+ #
183
+ # @return [String] git's stdout from the commit
184
+ #
185
+ # @raise [ArgumentError] if unsupported options are provided
186
+ #
187
+ # @raise [Git::FailedError] if `git commit` exits with a non-zero status
188
+ #
189
+ def commit(message, opts = {})
190
+ Git::Repository::Internal.assert_valid_opts!(COMMIT_ALLOWED_OPTS, **opts)
191
+ opts = opts.merge(message: message) if message
192
+ Git::Commands::Commit.new(@execution_context).call(no_edit: true, **opts).stdout
193
+ end
194
+ ```
195
+
196
+ Form B is required here because the method body needs a named variable (`opts`)
197
+ to build and transform before forwarding — e.g. `opts.merge(message: message)`
198
+ returns a new hash that is assigned back, and `opts = deprecate_commit_no_gpg_sign_option(opts)`
199
+ reassigns it; an anonymous `**` in the `def` provides no named variable to
200
+ operate on.
201
+
202
+ When a method has multiple genuinely distinct call shapes (e.g.
203
+ `commit(message)` vs. `commit(message, opts)` with materially different
204
+ return types), use one `@overload` block per shape — see
205
+ [YARD Documentation — Overload
206
+ template](../yard-documentation/SKILL.md#overload-template).
207
+
208
+ Required elements (apply to both forms):
209
+
210
+ - [ ] one-line summary describing what the method does from the caller's
211
+ perspective (not "calls `Git::Commands::Foo`")
212
+ - [ ] at least one `@example` block with a descriptive title (required on every
213
+ public facade method; use representative input and show the return value)
214
+ - [ ] `@param` for every positional parameter, with type and short description
215
+ - [ ] `@param <name> [Hash]` preceding any `@option` tags — the name comes
216
+ from the `@overload` signature (e.g. `options` or `opts`) when the actual
217
+ `def` uses anonymous `**` for `Style/ArgumentsForwarding`; otherwise it
218
+ matches the named parameter on the `def` itself
219
+ - [ ] `@option` for every option the facade exposes (the caller-facing contract,
220
+ not every option the underlying command accepts)
221
+ - [ ] `@return` with the **documented public return type** (see [Return type
222
+ rules](#return-type-rules))
223
+ - [ ] `@raise` for every error the caller can hit (see [`@raise`
224
+ rules](#raise-rules))
225
+
226
+ ### Documenting forwarded options with `@overload`
227
+
228
+ When a facade method forwards positional args and/or keyword options unchanged
229
+ to the underlying command, keep the anonymous splat (`**`, `*`, or `...`) in
230
+ the `def` (so `Style/ArgumentsForwarding` stays satisfied) and document the
231
+ call shape with an `@overload` block that names the parameters — Form A in
232
+ [Method-level docs](#method-level-docs) above shows the canonical `add`
233
+ example.
234
+
235
+ Key constraints:
236
+
237
+ - **Do not** name the splat — or expand `...` into `*args, **kwargs, &block` —
238
+ solely to make `@param`/`@option` bind. **Do not** suppress
239
+ `Style/ArgumentsForwarding` with `# rubocop:disable`. The `@overload` form is
240
+ the project-standard resolution.
241
+ - The `@overload` signature owns the parameter names; `@param`, `@option`,
242
+ `@yield`, and `@yieldparam` tags inside the overload bind to those names.
243
+ - When a facade method has multiple distinct call shapes (e.g.
244
+ `commit(message)` vs. `commit(message, **opts)`), write one `@overload`
245
+ block per shape.
246
+ - Form B (named splat, direct doc comment) is the narrow exception — use only
247
+ when the body inspects or mutates the options hash before forwarding it.
248
+ - The **anonymous block parameter (`&`)** is not covered by this rule.
249
+ `@yield`/`@yieldparam`/`@yieldreturn` describe what is yielded rather than
250
+ the block parameter itself, so anonymous `&` is fine. Name the block
251
+ (`&block`) only when documenting it as a first-class `Proc` value.
252
+
253
+ See the general
254
+ [YARD Documentation — Documenting anonymous splats with `@overload`](../yard-documentation/SKILL.md#documenting-anonymous-splats-with-overload)
255
+ for the underlying rule.
256
+
257
+ Decision rules for facade methods:
258
+
259
+ - Use `@overload` when the method uses anonymous `*`, `**`, or `...`
260
+ - Use `@overload` when call shapes differ meaningfully (different params and/or
261
+ return contracts)
262
+ - Skip `@overload` only when a single named signature fully describes the API
263
+
264
+ When using `@overload`, place tags as follows:
265
+
266
+ - Put `@param`, `@option`, and `@return` in overload blocks
267
+ - Put overload-specific `@raise` only in the relevant overload block
268
+ - Put shared `@raise` once at top level
269
+ - Do not duplicate the same `@raise` at both levels
270
+
271
+ ### Return type rules
272
+
273
+ The `@return` annotation must reflect the **public contract** of the facade
274
+ method, not the type of the underlying call expression.
275
+
276
+ | Facade does | `@return` type |
277
+ | --- | --- |
278
+ | Returns the raw `CommandLineResult` | `[Git::CommandLineResult]` |
279
+ | Returns `result.stdout` (chomped or raw) | `[String]` |
280
+ | Returns parsed structured data via a parser | The parser's return type (e.g. `[Array<Git::BranchInfo>]`, `[Hash]`) |
281
+ | Returns a result-class instance via a factory | The result class (e.g. `[Git::BranchDeleteResult]`) |
282
+ | Returns a single Boolean derived from the result | `[Boolean]` |
283
+
284
+ Never write `@return [Git::Commands::Foo::Result]` — command-class result types
285
+ are internal. Surface `Git::CommandLineResult` only when the topic module's
286
+ documented contract is to expose raw results.
287
+
288
+ ### `@raise` rules
289
+
290
+ - Always include `@raise [Git::FailedError]` for any facade method that can
291
+ cause git to exit non-zero. Use the canonical generic wording matching the
292
+ command's exit-status range:
293
+
294
+ | Command's `allow_exit_status` | Facade `@raise` wording |
295
+ | --- | --- |
296
+ | none / `0..0` | `if git exits with a non-zero exit status` |
297
+ | `0..1` | `if git exits outside the allowed range (exit code > 1)` |
298
+
299
+ - When the facade calls `assert_valid_opts!`, include
300
+ `@raise [ArgumentError] if unsupported options are provided`.
301
+ - When the facade itself validates arguments and raises (e.g. "you must specify
302
+ a remote if a branch is specified"), document with a specific `@raise
303
+ [ArgumentError]` line that names the constraint.
304
+ - Do **not** enumerate specific git failure causes (no "if the branch doesn't
305
+ exist", no "if the working tree is dirty"). Use the generic form.
306
+
307
+ Scope `@raise` tags by call-shape:
308
+
309
+ - Shared across all overloads: keep as one top-level `@raise`
310
+ - Specific to one or more overloads: keep only in those overload blocks
311
+ - Never duplicate identical `@raise` tags at both top level and overload level
312
+
313
+ ### Cross-referencing the implementation
314
+
315
+ When useful, cross-link to the underlying components with `@see` tags **at the
316
+ end** of the method's doc block:
317
+
318
+ ```ruby
319
+ # @see Git::Commands::Branch::List
320
+ # @see Git::Parsers::Branch
321
+ # @see https://git-scm.com/docs/git-branch git-branch
322
+ ```
323
+
324
+ Use sparingly — only when the cross-link helps a reader navigate to non-obvious
325
+ internals. Do not add `@see` for every command and parser by default; trivial
326
+ delegators do not need them.
327
+
328
+ ### Common issues
329
+
330
+ - **`@return [Git::CommandLineResult]` on a method that actually returns a
331
+ parsed value.** Match the actual return value, not the inner call expression.
332
+ - **Copying `@option` blocks from the command class.** The facade exposes only
333
+ the options listed in its public contract (and the `<METHOD>_ALLOWED_OPTS`
334
+ whitelist when present). Do not copy every option the command DSL declares.
335
+ - **Documenting policy defaults as caller options.** When the facade hardcodes
336
+ `no_edit: true`, do not list `:no_edit` as a caller option. The facade's contract
337
+ is "non-interactive commit"; mention the policy in prose if relevant, not as
338
+ an `@option`.
339
+ - **Documenting the underlying command in the summary.** Wrong: "Calls
340
+ `Git::Commands::Add.#call`". Right: "Update the index with the current
341
+ content found in the working tree."
342
+ - **Leaking `Git::ExecutionContext::Repository` into docs.** The execution
343
+ context is injected once at construction; facade method docs do not mention
344
+ it.
345
+ - **Missing `@example` on a public method.** Every public facade method requires
346
+ at least one `@example` block with a descriptive title. Examples belong on the
347
+ method, not at the module level.
348
+ - **Missing `@param <name> [Hash]` before `@option` tags.** Every `@option` tag
349
+ requires a preceding `@param` for the options hash. Use the parameter name from
350
+ the `@overload` signature when the `def` uses anonymous `**`.
351
+ - **Missing `@api public` on the module.** Every facade module is part of the
352
+ public API and must declare it.
353
+ - **Uppercase first letter or trailing period on tag short descriptions.** Same
354
+ rule as command YARD: lowercase start, no trailing punctuation on the short
355
+ description.
356
+ - **Raw blank line inside a doc comment block.** A line with no leading `#`
357
+ silently terminates the YARD block. Use blank comment lines (`#`) inside
358
+ multi-paragraph descriptions.
359
+
360
+ ## Workflow
361
+
362
+ For each facade module file, run through these checks in order:
363
+
364
+ ### 1. Module-level docs
365
+
366
+ - [ ] short topic summary (per
367
+ [YARD Documentation](../yard-documentation/SKILL.md) short-description rules)
368
+ - [ ] "Included by {Git::Repository}." sentence with the YARD link
369
+ - [ ] `@api public`
370
+ - [ ] no `@example` at the module level
371
+ - [ ] no `@see Git::Commands::*` at the module level
372
+ - [ ] no `@see https://git-scm.com/docs/...` at the module level (those belong
373
+ on the individual facade methods)
374
+
375
+ ### 2. Method-level docs (per method)
376
+
377
+ - [ ] one-line summary describing caller-facing behavior
378
+ - [ ] at least one `@example` block with a descriptive title
379
+ - [ ] every positional parameter has `@param` with type and short description
380
+ - [ ] every facade-exposed option has `@option` (matching the
381
+ `<METHOD>_ALLOWED_OPTS` whitelist when present)
382
+ - [ ] when `@option` is used, `@param <name> [Hash]` precedes the `@option`
383
+ tags; for methods using `@overload`, the parameter name comes from the
384
+ overload signature (e.g. `@overload add(paths, **options)`) — the `def`
385
+ may still use anonymous `**`
386
+ - [ ] options that exist on the underlying command but are not exposed by the
387
+ facade are **not** listed
388
+ - [ ] policy defaults the facade hardcodes are not listed as `@option`
389
+ - [ ] `@return` matches the actual return value type per [Return type
390
+ rules](#return-type-rules)
391
+ - [ ] `@raise` tags follow [`@raise` rules](#raise-rules)
392
+ - [ ] shared `@raise` tags are top-level; overload-specific `@raise` tags are in
393
+ the relevant overload only
394
+ - [ ] no duplicate identical `@raise` appears at both top level and overload level
395
+ - [ ] `@see` tags appear at the end and are limited to non-obvious cross-links
396
+
397
+ ### 3. Formatting consistency
398
+
399
+ - [ ] every YARD tag is preceded by a blank comment line (`#`)
400
+ - [ ] no raw blank lines inside any doc block
401
+ - [ ] tag short descriptions start lowercase and have no trailing punctuation
402
+ - [ ] multi-paragraph tag descriptions have a blank `#` line between paragraphs
403
+ - [ ] all general formatting rules from
404
+ [YARD Documentation](../yard-documentation/SKILL.md) are satisfied
405
+
406
+ ## Output
407
+
408
+ ### When writing new facade YARD docs
409
+
410
+ Produce the complete YARD doc block(s) for the module and each method, then
411
+ self-verify by running every checklist item from [Workflow](#workflow) against
412
+ your output. Fix and re-verify until all checks pass.
413
+
414
+ ### When reviewing existing facade YARD docs
415
+
416
+ For each file, provide:
417
+
418
+ 1. issue table
419
+
420
+ | Check | Status | Issue |
421
+ | --- | --- | --- |
422
+
423
+ 2. corrected doc block snippets (only where needed)
424
+
425
+ 3. **Self-verify before concluding** — re-run every checklist item against
426
+ your proposed snippets until all checks pass.
427
+
428
+ > **Branch workflow:** Implement any fixes on a feature branch. Never commit or
429
+ > push directly to `main` — open a pull request when changes are ready to merge.
@@ -0,0 +1,176 @@
1
+ ---
2
+ name: make-skill-template
3
+ description: 'Create new Agent Skills for GitHub Copilot from user requests or by duplicating this template. Use when asked to "create a skill", "make a new skill", "scaffold a skill", or when building specialized AI capabilities with bundled resources. Generates SKILL.md files with proper frontmatter, directory structure, and optional scripts/references/assets folders.'
4
+ ---
5
+
6
+ # Make Skill Template
7
+
8
+ A meta-skill for creating new Agent Skills. Use this skill when you need to scaffold a new skill folder, generate a SKILL.md file, or help users understand the Agent Skills specification.
9
+
10
+ ## Contents
11
+
12
+ - [How to use this skill](#how-to-use-this-skill)
13
+ - [Related skills](#related-skills)
14
+ - [When to Use This Skill](#when-to-use-this-skill)
15
+ - [Prerequisites](#prerequisites)
16
+ - [Creating a New Skill](#creating-a-new-skill)
17
+ - [Example: Complete Skill Structure](#example-complete-skill-structure)
18
+ - [Quick Start: Duplicate This Template](#quick-start-duplicate-this-template)
19
+ - [Validation Checklist](#validation-checklist)
20
+ - [Troubleshooting](#troubleshooting)
21
+ - [References](#references)
22
+
23
+ ## How to use this skill
24
+
25
+ Attach this file to your Copilot Chat context, then invoke it when creating or
26
+ refining a skill under `.github/skills/`. Use it to scaffold new skills and to
27
+ check discoverability quality before committing.
28
+
29
+ ## Related skills
30
+
31
+ - [Reviewing Skills](../reviewing-skills/SKILL.md) — audit a skill for quality,
32
+ discoverability, and best-practice compliance after authoring
33
+ - [Development Workflow](../development-workflow/SKILL.md) — integrate skill
34
+ creation changes into the repository workflow
35
+ - [PR Readiness Review](../pr-readiness-review/SKILL.md) — final validation
36
+ before opening a pull request with new or updated skills
37
+
38
+ ## When to Use This Skill
39
+
40
+ - User asks to "create a skill", "make a new skill", or "scaffold a skill"
41
+ - User wants to add a specialized capability to their GitHub Copilot setup
42
+ - User needs help structuring a skill with bundled resources
43
+ - User wants to duplicate this template as a starting point
44
+
45
+ ## Prerequisites
46
+
47
+ - Understanding of what the skill should accomplish
48
+ - A clear, keyword-rich description of capabilities and triggers
49
+ - Knowledge of any bundled resources needed (scripts, references, assets, templates)
50
+
51
+ ## Creating a New Skill
52
+
53
+ ### Step 1: Create the Skill Directory
54
+
55
+ Create a new folder with a lowercase, hyphenated name:
56
+
57
+ ```
58
+ .github/skills/<skill-name>/
59
+ └── SKILL.md # Required
60
+ ```
61
+
62
+ ### Step 2: Generate SKILL.md with Frontmatter
63
+
64
+ Every skill requires YAML frontmatter with `name` and `description`:
65
+
66
+ ```yaml
67
+ ---
68
+ name: <skill-name>
69
+ description: '<What it does>. Use when <specific triggers, scenarios, keywords users might say>.'
70
+ ---
71
+ ```
72
+
73
+ #### Frontmatter Field Requirements
74
+
75
+ | Field | Required | Constraints |
76
+ | ----- | -------- | ----------- |
77
+ | `name` | **Yes** | 1-64 chars, lowercase letters/numbers/hyphens only, must match folder name |
78
+ | `description` | **Yes** | 10-1024 chars, must describe WHAT it does AND WHEN to use it |
79
+ | `license` | No | License name or reference to bundled LICENSE.txt |
80
+ | `compatibility` | No | 1-500 chars, environment requirements if needed |
81
+ | `metadata` | No | Key-value pairs for additional properties |
82
+ | `allowed-tools` | No | Space-delimited list of pre-approved tools (experimental) |
83
+
84
+ #### Description Best Practices
85
+
86
+ **CRITICAL**: The `description` is the PRIMARY mechanism for automatic skill discovery. Include:
87
+
88
+ 1. **WHAT** the skill does (capabilities)
89
+ 2. **WHEN** to use it (triggers, scenarios, file types)
90
+ 3. **Keywords** users might mention in requests
91
+
92
+ **Good example:**
93
+
94
+ ```yaml
95
+ description: 'Toolkit for testing local web applications using Playwright. Use when asked to verify frontend functionality, debug UI behavior, capture browser screenshots, or view browser console logs. Supports Chrome, Firefox, and WebKit.'
96
+ ```
97
+
98
+ **Poor example:**
99
+
100
+ ```yaml
101
+ description: 'Web testing helpers'
102
+ ```
103
+
104
+ ### Step 3: Write the Skill Body
105
+
106
+ After the frontmatter, add markdown instructions. Recommended sections:
107
+
108
+ | Section | Purpose |
109
+ | ------- | ------- |
110
+ | `# Title` | Brief overview |
111
+ | `## When to Use This Skill` | Reinforces description triggers |
112
+ | `## Prerequisites` | Required tools, dependencies |
113
+ | `## Step-by-Step Workflows` | Numbered steps for tasks |
114
+ | `## Troubleshooting` | Common issues and solutions |
115
+ | `## References` | Links to bundled docs |
116
+
117
+ ### Step 4: Add Optional Directories (If Needed)
118
+
119
+ | Folder | Purpose | When to Use |
120
+ | ------ | ------- | ----------- |
121
+ | `scripts/` | Executable code (Python, Bash, JS) | Automation that performs operations |
122
+ | `references/` | Documentation agent reads | API references, schemas, guides |
123
+ | `assets/` | Static files used AS-IS | Images, fonts, templates |
124
+ | `templates/` | Starter code agent modifies | Scaffolds to extend |
125
+
126
+ ## Example: Complete Skill Structure
127
+
128
+ ```
129
+ my-awesome-skill/
130
+ ├── SKILL.md # Required instructions
131
+ ├── LICENSE.txt # Optional license file
132
+ ├── scripts/
133
+ │ └── helper.py # Executable automation
134
+ ├── references/
135
+ │ ├── api-reference.md # Detailed docs
136
+ │ └── examples.md # Usage examples
137
+ ├── assets/
138
+ │ └── diagram.png # Static resources
139
+ └── templates/
140
+ └── starter.ts # Code scaffold
141
+ ```
142
+
143
+ ## Quick Start: Duplicate This Template
144
+
145
+ 1. Copy the `make-skill-template/` folder
146
+ 2. Rename to your skill name (lowercase, hyphens)
147
+ 3. Update `SKILL.md`:
148
+ - Change `name:` to match folder name
149
+ - Write a keyword-rich `description:`
150
+ - Replace body content with your instructions
151
+ 4. Add bundled resources as needed
152
+ 5. Review with the [Reviewing Skills](../reviewing-skills/SKILL.md) skill
153
+
154
+ ## Validation Checklist
155
+
156
+ - [ ] Folder name is lowercase with hyphens
157
+ - [ ] `name` field matches folder name exactly
158
+ - [ ] `description` is 10-1024 characters
159
+ - [ ] `description` explains WHAT and WHEN
160
+ - [ ] `description` is wrapped in single quotes
161
+ - [ ] Body content is under 500 lines
162
+ - [ ] Bundled assets are under 5MB each
163
+
164
+ ## Troubleshooting
165
+
166
+ | Issue | Solution |
167
+ | ----- | -------- |
168
+ | Skill not discovered | Improve description with more keywords and triggers |
169
+ | Validation fails on name | Ensure lowercase, no consecutive hyphens, matches folder |
170
+ | Description too short | Add capabilities, triggers, and keywords |
171
+ | Assets not found | Use relative paths from skill root |
172
+
173
+ ## References
174
+
175
+ - Agent Skills official spec: <https://agentskills.io/specification>
176
+ - Skill authoring best practices: <https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices>