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