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,214 +0,0 @@
1
- ---
2
- name: review-arguments-dsl
3
- description: "Audits a command class's arguments DSL definition to verify it accurately maps Ruby call arguments to git CLI arguments in the correct order with correct DSL methods and modifiers."
4
- ---
5
-
6
- # Review Arguments DSL
7
-
8
- Verify that a command class's `arguments do ... end` definition accurately maps Ruby
9
- call arguments to git CLI arguments, in the correct order, with the correct DSL
10
- methods and modifiers.
11
-
12
- ## Contents
13
-
14
- - [Contents](#contents)
15
- - [Related skills](#related-skills)
16
- - [Input](#input)
17
- - [Command source code](#command-source-code)
18
- - [Command test code](#command-test-code)
19
- - [Git documentation for the git command](#git-documentation-for-the-git-command)
20
- - [Reference](#reference)
21
- - [Architecture Context (Base Pattern)](#architecture-context-base-pattern)
22
- - [DSL to CLI Mapping](#dsl-to-cli-mapping)
23
- - [Workflow](#workflow)
24
- - [Output](#output)
25
-
26
- ## Related skills
27
-
28
- - [Command Implementation](../command-implementation/SKILL.md) — class structure, phased rollout gates, and
29
- internal compatibility contracts
30
- - [Command Test Conventions](../command-test-conventions/SKILL.md) — unit/integration test conventions for command classes
31
- - [Command YARD Documentation](../command-yard-documentation/SKILL.md) — documentation completeness for command classes
32
-
33
- ## Input
34
-
35
- What the agent requires to run this skill and where to get it.
36
-
37
- ### Command source code
38
-
39
- Read the command class from `lib/git/commands/{command}.rb` or, for subcommands,
40
- `lib/git/commands/{command}/{subcommand}.rb`. For subcommands, also read the
41
- namespace module at `lib/git/commands/{command}.rb` which should list all sibling
42
- subcommands and provide the module-level documentation.
43
-
44
- ### Command test code
45
-
46
- Read unit tests matching `spec/unit/git/commands/{command}/**/*_spec.rb`. Use these as
47
- supplemental evidence when tracing the verification chain (Ruby call → bound
48
- argument → expected git CLI). Coverage completeness is assessed by the
49
- [Command Test Conventions](../command-test-conventions/SKILL.md) skill.
50
-
51
- ### Git documentation for the git command
52
-
53
- - **Latest-version online command documentation**
54
-
55
- Read the **entire** official git documentation online man page for the command
56
- for the latest version of git. This version will be used as the primary
57
- authority for DSL completeness, including the options to include in the
58
- DSL, argument names, aliases, ordering, etc.
59
- Fetch this version from the URL `https://git-scm.com/docs/git-{command}`
60
- (this URL always serves the latest release).
61
-
62
- - **Minimum-version online command documentation**
63
-
64
- Read the **entire** official git documentation online man page for the command for
65
- the `Git::MINIMUM_GIT_VERSION` version of git. This will be used only for
66
- command-introduction and `requires_git_version` decisions. Fetch this version from
67
- URL `https://git-scm.com/docs/git-{command}/{version}`.
68
-
69
- Do **not** scaffold from local `git <command> -h` output alone — the installed Git
70
- version is unknown and may differ from the latest supported version. Local help should
71
- NOT be used even as a supplemental check.
72
-
73
- ## Reference
74
-
75
- ### Architecture Context (Base Pattern)
76
-
77
- Command classes follow this structure:
78
-
79
- - `class < Git::Commands::Base`
80
- - class-level `arguments do ... end`
81
- - optional class-level macros such as `allow_exit_status <range>` and
82
- `requires_git_version <version>`
83
- - YARD documentation with `@overload` blocks containing `@param`, `@option`,
84
- `@return`, and `@raise` tags, in one of two forms:
85
- - **when `#call` is overridden:** standard YARD comments directly above `def call`
86
- - **when `#call` is not overridden:** a `# @!method call(*, **)` directive with
87
- nested standard YARD comments
88
-
89
- The CLI argument mapping is still defined exclusively by the Arguments DSL. The
90
- `Base` class handles binding and execution.
91
-
92
- ### DSL to CLI Mapping
93
-
94
- <!--
95
- Purpose: gives the agent the mental model for predicting CLI output from a
96
- DSL definition — the mapping rules needed to execute the verification chain
97
- (Ruby call → bound argument → expected git CLI).
98
-
99
- CHECKLIST.md works in the reverse direction: given git man-page behavior,
100
- which DSL method and modifiers to use.
101
- -->
102
-
103
- The Arguments DSL (`arguments do ... end`) declares how Ruby keyword and positional
104
- arguments map to git CLI flags, options, and operands. See [CHECKLIST.md §
105
- Verify DSL method per option type](CHECKLIST.md#2-verify-dsl-method-per-option-type)
106
- for the full DSL method mapping table.
107
-
108
- Key behaviors:
109
-
110
- - **Basic emit** — `flag_option :verbose` → `--verbose`; `value_option :message` →
111
- `--message <value>`; `operand :commit` → bare `<value>` in positional slot.
112
- - **`flag_or_value_option`** — hybrid: `true` → `--flag`; string → `--flag value`
113
- (or `--flag=value` with `inline:`); `false`/`nil` → nothing. Supports `negatable:`.
114
- - **`key_value_option`** — accepts a Hash or Array of pairs; emits `--flag key=value`
115
- per pair. `key_separator:` overrides `=`; `inline:` joins as `--flag=key=value`.
116
- - **`custom_option`** — block receives the raw value and returns CLI strings; String
117
- is appended, Array is concatenated, `nil`/empty emits nothing.
118
- - **nil / false suppression** — for boolean-style options (`flag_option`,
119
- `flag_or_value_option` in boolean mode), `false` or `nil` suppresses emission.
120
- For `value_option` / `inline_value` options, `false` is treated as a value
121
- (stringified to `"false"`) unless a type constraint rejects it. `nil` suppresses
122
- emission for all option types (including negatable options — `false` is absent,
123
- not `--no-*`).
124
- - **Output order matches definition order** — bound arguments are emitted in the
125
- order entries appear in `arguments do`.
126
- - **Name-to-flag mapping** — underscores become hyphens, single-char names map to
127
- `-x`, multi-char names map to `--name`. **Case is preserved**: `:A` → `-A`, `:N` →
128
- `-N`. Uppercase short flags do not require `as:`.
129
- - **`as:` override** — emits a verbatim string instead of deriving the flag from the
130
- symbol name. See [CHECKLIST.md § The `as:` escape
131
- hatch](CHECKLIST.md#the-as-escape-hatch) for when use is justified.
132
- - **Aliases** — first alias is canonical and determines the generated flag; remaining
133
- aliases are accepted as caller-side synonyms. Long name first:
134
- `%i[force f]`, not `%i[f force]`.
135
- - **`negatable:`** — registers two entries: the positive key and a `no_` companion.
136
- Both follow standard boolean semantics: `true` emits the flag, `false`/`nil` omits
137
- it. Pass `no_edit: true` to emit `--no-edit`.
138
- - `flag_option :edit, negatable: true` → `:edit` `[Boolean]` and `:no_edit`
139
- `[Boolean]`
140
- - `flag_or_value_option :track, negatable: true` → `:track` `[Boolean, String]`
141
- (positive or value form) and `:no_track` `[Boolean]` (boolean only; the negated
142
- form never takes a value)
143
- - **`inline:`** — `value_option :format, inline: true` emits `--format=value` as one
144
- token; without it, `--format value` as two tokens.
145
- - **`max_times:`** — `flag_option :force, max_times: 2` with `force: 2` emits
146
- `--force --force`.
147
- - **`repeatable:`** — accepts an array; emits the flag once per value
148
- (e.g., `--include a --include b`).
149
- - **`as_operand:`** — `value_option :pathspec, as_operand: true` is passed as a
150
- keyword but emitted in the operand position after `end_of_options`.
151
- - **`literal`** — always emits its string unconditionally; the caller has no control.
152
- - **`execution_option`** — never emits anything to argv; forwarded as Ruby kwargs to
153
- the subprocess runner.
154
- - **`skip_cli:` on operands** — `operand ..., skip_cli: true` binds and validates
155
- like any other operand and remains accessible on `Bound`, but is excluded from argv
156
- emission.
157
- - **`end_of_options`** — signals end of options in the emitted argv; only operands
158
- may follow (though operands may also appear before it). Emits `--` by default.
159
- Override with `as:` when the command uses a different token. See [CHECKLIST.md §
160
- Choosing the `as:` token](CHECKLIST.md#choosing-the-as-token) for the decision
161
- rule.
162
- - **Operand/option name collision** — if a positional operand and a keyword option
163
- share the same name, the **option keeps its name** and the **operand is renamed**.
164
- For repeatable operands, prefer the plural form (`:commit` → `:commits`). See
165
- [CHECKLIST.md § Operand naming](CHECKLIST.md#operand-naming) for details.
166
-
167
- ## Workflow
168
-
169
- 1. **Determine scope and exclusions** — using the git documentation loaded during
170
- [Input](#input), identify which options are in scope for the DSL. See
171
- [CHECKLIST.md §1](CHECKLIST.md#1-determine-scope-and-exclusions).
172
-
173
- 2. **Audit each DSL entry** — for each entry in `arguments do`, walk through
174
- [CHECKLIST.md](CHECKLIST.md) §2–§5:
175
- 1. Verify DSL method per option type
176
- 2. Verify alias and `as:` usage
177
- 3. Verify ordering
178
- 4. Verify modifiers
179
-
180
- For each entry, also trace the verification chain — confirm the full mapping:
181
-
182
- `Ruby call → bound argument → expected git CLI`
183
-
184
- Compare the expected CLI output against the git man-page documentation.
185
-
186
- 3. **Check completeness** — verify the DSL as a whole against the git man page per
187
- [CHECKLIST.md §6](CHECKLIST.md#6-check-completeness): YARD↔DSL parity, missing
188
- options, repeatable flags, operand naming, and per-argument validation.
189
-
190
- 4. **Check class-level declarations** — verify `allow_exit_status` and
191
- `requires_git_version` per
192
- [CHECKLIST.md §7](CHECKLIST.md#7-check-class-level-declarations).
193
-
194
- 5. **Check the validation delegation policy** — verify that cross-argument
195
- constraint methods (`conflicts`, `requires`, etc.) are used only when
196
- justified. See the constraint policy in
197
- [CHECKLIST.md §6 Per-argument validation completeness](CHECKLIST.md#per-argument-validation-completeness).
198
-
199
- 6. **Collect issues** — record all findings for the [Output](#output).
200
-
201
- ## Output
202
-
203
- Produce:
204
-
205
- 1. A per-entry table:
206
-
207
- | # | DSL method | Definition | CLI output | Correct? | Issue |
208
- | --- | --- | --- | --- | --- | --- |
209
-
210
- 2. A list of missing options/modifier/order/conflict issues
211
- 3. Any class-level declaration mismatches: `allow_exit_status` not present with
212
- a `Range` and rationale comment when the command has non-zero successful
213
- exits; `requires_git_version` not present only when the command was
214
- introduced after `Git::MINIMUM_GIT_VERSION`
@@ -1,139 +0,0 @@
1
- ---
2
- name: review-cross-command-consistency
3
- description: "Compares sibling command classes for consistent structure, documentation, testing, and exit-status conventions under the Base architecture. Use for cross-command audits."
4
- ---
5
-
6
- # Review Cross-Command Consistency
7
-
8
- Review sibling command classes (same module/family) for consistent structure,
9
- documentation, testing, and exit-status conventions under the `Base` architecture.
10
-
11
- ## Contents
12
-
13
- - [How to use this skill](#how-to-use-this-skill)
14
- - [Prerequisites](#prerequisites)
15
- - [Related skills](#related-skills)
16
- - [Version-Aware Comparison Scope](#version-aware-comparison-scope)
17
- - [What to Check](#what-to-check)
18
- - [1. Class structure consistency](#1-class-structure-consistency)
19
- - [2. Arguments DSL consistency](#2-arguments-dsl-consistency)
20
- - [3. Exit-status consistency](#3-exit-status-consistency)
21
- - [4. YARD consistency](#4-yard-consistency)
22
- - [5. Unit spec consistency](#5-unit-spec-consistency)
23
- - [6. Integration spec consistency](#6-integration-spec-consistency)
24
- - [7. Migration process consistency](#7-migration-process-consistency)
25
- - [Output](#output)
26
-
27
- ## How to use this skill
28
-
29
- Attach this file to your Copilot Chat context, then invoke it with the sibling
30
- command files (same module/family) to compare. Examples:
31
-
32
- ```text
33
- Using the Review Cross-Command Consistency skill, review the
34
- Git::Commands::Diff family: lib/git/commands/diff/patch.rb,
35
- lib/git/commands/diff/numstat.rb, lib/git/commands/diff/raw.rb.
36
- ```
37
-
38
- ```text
39
- Review Cross-Command Consistency: all files under lib/git/commands/stash/
40
- ```
41
-
42
- The invocation needs two or more sibling command files from the same family.
43
-
44
- ## Prerequisites
45
-
46
- Before starting, you **MUST** load the following skill(s) in their entirety:
47
-
48
- - [YARD Documentation](../yard-documentation/SKILL.md) — authoritative
49
- source for YARD formatting rules and writing standards;
50
-
51
- ## Related skills
52
-
53
- - [Command Implementation](../command-implementation/REFERENCE.md#phased-rollout-requirements) — canonical class-shape checklist, phased
54
- rollout gates, and internal compatibility contracts
55
- - [Review Arguments DSL](../review-arguments-dsl/SKILL.md) — verifying DSL entries match git CLI
56
- - [Command Test Conventions](../command-test-conventions/SKILL.md) — unit/integration test conventions for command classes
57
- - [Command YARD Documentation](../command-yard-documentation/SKILL.md) — documentation completeness for command classes
58
-
59
- ## Version-Aware Comparison Scope
60
-
61
- Before flagging siblings as inconsistent for option names, aliases, negated
62
- forms, or documented values, determine the repository's minimum supported Git
63
- version from project metadata. In this repository, `git.gemspec` declares
64
- `git 2.28.0 or greater`.
65
-
66
- Consistency judgments for CLI surface area must be based on the minimum
67
- supported Git version, not only on the locally installed Git. Use
68
- version-matched upstream documentation first, version-matched upstream source
69
- when exact parser behavior is ambiguous, and local `git <command> -h` output
70
- only as a supplemental check.
71
-
72
- ## What to Check
73
-
74
- ### 1. Class structure consistency
75
-
76
- - [ ] all classes use `class < Git::Commands::Base`
77
- - [ ] all require `git/commands/base`
78
- - [ ] all use `arguments do ... end` (no legacy `ARGS =` constants)
79
- - [ ] simple commands carry YARD directive `# @!method call(*, **)` with nested `@overload` blocks and have no explicit `def call` definition
80
- - [ ] commands with legitimate `call` overrides (stdin protocol, input validation, non-trivial option routing) use explicit YARD docs instead and do **not** carry the `# @!method` directive
81
- - [ ] commands with `call` overrides use `Base#with_stdin` for stdin feeding and delegate exit-status validation to `validate_exit_status!`
82
-
83
- ### 2. Arguments DSL consistency
84
-
85
- - [ ] shared options use same alias/modifier patterns
86
- - [ ] shared entries appear in same relative order
87
- - [ ] command-specific differences are intentional and documented
88
- - [ ] no `literal` entries for policy/output-control flags (`--no-edit`, `--verbose`,
89
- `--no-progress`, `--no-color`, etc.) — command classes are neutral, faithful
90
- representations of the git CLI; all siblings use `flag_option` /
91
- `value_option` for these, leaving policy decisions to the facade. See
92
- "Command-layer neutrality" in CONTRIBUTING.md.
93
-
94
- ### 3. Exit-status consistency
95
-
96
- - [ ] siblings with same git exit semantics use same `allow_exit_status` range
97
- - [ ] rationale comments are present and consistent in tone
98
- - [ ] commands without non-zero successful exits do not declare custom ranges
99
-
100
- ### 4. YARD consistency
101
-
102
- - [ ] consistent class summaries and `@api private`
103
- - [ ] `@overload` coverage consistent for equivalent call shapes
104
- - [ ] `@return` and `@raise` wording consistent across siblings — `@raise [Git::FailedError]` uses the canonical generic form ("if git exits with a non-zero exit status" for default range; "if git exits outside the allowed range (exit code > N)" for non-default); never enumerates specific failure causes
105
- - [ ] tag short descriptions do not end with punctuation
106
- - [ ] multi-paragraph tag descriptions have a blank comment line between the short
107
- description and each continuation paragraph
108
-
109
- ### 5. Unit spec consistency
110
-
111
- - [ ] expectations include `raise_on_failure: false` where command invocation is asserted
112
- - [ ] similar option paths use similar context naming
113
- - [ ] exit-status tests are parallel where ranges are shared
114
-
115
- ### 6. Integration spec consistency
116
-
117
- - [ ] success/failure grouping uses same structure
118
- - [ ] no output-format assertions (smoke + error handling only)
119
-
120
- ### 7. Migration process consistency
121
-
122
- See **[Command Implementation § Phased rollout requirements](../command-implementation/REFERENCE.md#phased-rollout-requirements)** for
123
- the canonical checklist. During a cross-command audit, verify that sibling commands
124
- were migrated in the same slice and that the same quality gates were applied.
125
-
126
- ## Output
127
-
128
- 1. Summary table:
129
-
130
- | Aspect | File A | File B | File C | Status |
131
- | --- | --- | --- | --- | --- |
132
-
133
- 2. Inconsistency list with canonical recommendation:
134
-
135
- | Issue | Files | Recommended canonical form |
136
- | --- | --- | --- |
137
-
138
- > **Branch workflow:** Implement any fixes on a feature branch. Never commit or
139
- > push directly to `main` — open a pull request when changes are ready to merge.
@@ -1,214 +0,0 @@
1
- ---
2
- name: reviewing-skills
3
- description: 'Audits Agent Skills for quality, discoverability, and adherence to best practices. Use when reviewing a skill, checking skill quality, auditing skill descriptions, or validating skill structure before committing.'
4
- ---
5
-
6
- # Reviewing Skills
7
-
8
- Audit one or more Agent Skills for quality, discoverability, consistency, and
9
- adherence to the Anthropic skill-authoring best practices.
10
-
11
- ## Contents
12
-
13
- - [Contents](#contents)
14
- - [How to use this skill](#how-to-use-this-skill)
15
- - [Related skills](#related-skills)
16
- - [Input](#input)
17
- - [Review checklist](#review-checklist)
18
- - [1. Frontmatter](#1-frontmatter)
19
- - [2. Description quality](#2-description-quality)
20
- - [3. Body structure and size](#3-body-structure-and-size)
21
- - [4. Conciseness](#4-conciseness)
22
- - [5. Degrees of freedom](#5-degrees-of-freedom)
23
- - [6. Progressive disclosure](#6-progressive-disclosure)
24
- - [7. Workflows and feedback loops](#7-workflows-and-feedback-loops)
25
- - [8. Content quality](#8-content-quality)
26
- - [9. Cross-skill consistency](#9-cross-skill-consistency)
27
- - [10. Discoverability sections](#10-discoverability-sections)
28
- - [Output](#output)
29
- - [Reference: Anthropic best-practices summary](#reference-anthropic-best-practices-summary)
30
-
31
- ## How to use this skill
32
-
33
- Attach this file to your Copilot Chat context, then invoke it with the skill
34
- folder or SKILL.md file(s) to review. Examples:
35
-
36
- ```text
37
- Using the Reviewing Skills skill, review .github/skills/command-implementation/.
38
- ```
39
-
40
- ```text
41
- Review all skills under .github/skills/ for best-practice compliance.
42
- ```
43
-
44
- ## Related skills
45
-
46
- - [Make Skill Template](../make-skill-template/SKILL.md) — scaffold new skills;
47
- use this reviewing skill afterward to validate quality
48
- - [PR Readiness Review](../pr-readiness-review/SKILL.md) — final pre-PR quality
49
- gate (broader than skill-specific review)
50
-
51
- ## Input
52
-
53
- One or more skill directories or SKILL.md files from `.github/skills/`.
54
-
55
- ## Review checklist
56
-
57
- Work through each section below for every skill under review.
58
-
59
- ### 1. Frontmatter
60
-
61
- - [ ] `name` is present, 1-64 chars, lowercase letters/numbers/hyphens only
62
- - [ ] `name` matches the folder name exactly
63
- - [ ] `name` does not contain reserved words (`anthropic`, `claude`)
64
- - [ ] `description` is present, 1-1024 chars
65
- - [ ] `description` does not contain XML tags
66
-
67
- ### 2. Description quality
68
-
69
- The description is the **primary discovery mechanism** — it determines whether the
70
- skill is selected from potentially hundreds of available skills.
71
-
72
- - [ ] Written in **third person** (not "I can…" or "You can…")
73
- - [ ] Describes **what** the skill does (capabilities)
74
- - [ ] Describes **when** to use it (triggers, scenarios, keywords)
75
- - [ ] Includes specific key terms users are likely to mention
76
- - [ ] Is not vague (e.g. "Helps with documents" is too vague)
77
-
78
- ### 3. Body structure and size
79
-
80
- - [ ] SKILL.md body targets **under 500 lines** and is reviewed carefully above
81
- 600 lines
82
- - [ ] Exceeding the target is justified when splitting always-needed workflow or
83
- review rules would make the skill less effective
84
- - [ ] If approaching the limit, situational content is split into separate
85
- reference files before core workflows or checklists are split
86
- - [ ] Reference files are at most **one level deep** from SKILL.md (no
87
- deeply-nested chains like SKILL → A.md → B.md → actual content)
88
- - [ ] Reference files longer than 100 lines include a table of contents
89
- - [ ] Reference files state their purpose and when the agent should load them
90
-
91
- ### 4. Conciseness
92
-
93
- Every token in a loaded skill competes with conversation history and other
94
- context. Challenge each piece of information:
95
-
96
- - [ ] Only includes context the model does not already have
97
- - [ ] Does not over-explain concepts the model already knows
98
- - [ ] Avoids redundant paragraphs or verbose preambles
99
- - [ ] Uses code examples instead of lengthy prose where possible
100
-
101
- ### 5. Degrees of freedom
102
-
103
- Match instruction specificity to task fragility:
104
-
105
- - [ ] **High freedom** (general text guidance) for tasks where multiple
106
- approaches are valid and context determines the best route
107
- - [ ] **Medium freedom** (pseudocode / parameterized templates) for tasks with a
108
- preferred pattern but acceptable variation
109
- - [ ] **Low freedom** (exact scripts, no parameters) for fragile or
110
- error-prone operations where consistency is critical
111
- - [ ] The chosen level is appropriate for the skill's domain
112
-
113
- ### 6. Progressive disclosure
114
-
115
- - [ ] SKILL.md serves as an overview / table of contents
116
- - [ ] Detailed materials are in separate files loaded only when needed
117
- - [ ] Mandatory workflow steps, validation loops, and review checklist items stay
118
- in SKILL.md even when detailed examples move to references
119
- - [ ] Situational, element-specific, type-specific, or platform-specific rules
120
- are good candidates for reference files
121
- - [ ] File names are descriptive (not `doc1.md`, `file2.md`)
122
- - [ ] Directory structure is organized by domain or feature
123
-
124
- ### 7. Workflows and feedback loops
125
-
126
- - [ ] Complex multi-step operations are broken into clear, sequential steps
127
- - [ ] Long workflows include a progress checklist the agent can track
128
- - [ ] Validation / feedback loops are present for quality-critical tasks
129
- (run validator → fix errors → repeat until clean)
130
- - [ ] Decision points use conditional workflow patterns (if X → workflow A,
131
- if Y → workflow B)
132
- - [ ] For standards and review skills, rules are mandatory unless explicitly
133
- marked `Optional`; advisory skills consistently distinguish requirements,
134
- recommendations, and examples
135
-
136
- ### 8. Content quality
137
-
138
- - [ ] No time-sensitive information (dates that will become stale); if legacy
139
- context is needed, it is in a collapsible "old patterns" section
140
- - [ ] Consistent terminology throughout (one term per concept, not synonyms)
141
- - [ ] Named thresholds, modes, phases, or terms are defined before first use and
142
- have one authoritative definition
143
- - [ ] Examples are concrete, not abstract
144
- - [ ] Examples and domain facts are technically accurate; repo-specific skills
145
- use real project patterns where practical
146
- - [ ] All file paths use forward slashes (no Windows-style backslashes)
147
- - [ ] No "voodoo constants" — every magic number or config value is justified
148
- - [ ] Important rule sections use real markdown headings, not bold paragraphs as
149
- pseudo-headings
150
- - [ ] Duplicate rationale and repeated examples are removed, while short
151
- normative checklist rules remain self-contained
152
-
153
- ### 9. Cross-skill consistency
154
-
155
- When reviewing multiple skills in the same repository:
156
-
157
- - [ ] Naming convention is consistent (all gerund, all noun-phrase, or all
158
- action-oriented — not a mix)
159
- - [ ] Shared policies (branch rules, commit conventions, quality gates,
160
- changelog policy) do not contradict each other
161
- - [ ] Cross-skill links in `## Related skills` resolve to existing files
162
- - [ ] Intra-skill links, cross-skill deep links, table-of-contents anchors, and
163
- referenced files resolve after heading or file moves
164
- - [ ] Every skill referenced in `.github/copilot-instructions.md`'s routing
165
- table resolves to an existing `.github/skills/*/SKILL.md` file
166
- - [ ] Skills that extend other skills clearly state what they inherit, override,
167
- or add
168
- - [ ] Stop/ask checkpoints are used consistently for comparable risk levels
169
-
170
- ### 10. Discoverability sections
171
-
172
- Every skill in this repository must include these standard sections:
173
-
174
- - [ ] `## Contents` — table of contents with anchor links
175
- - [ ] `## How to use this skill` — brief invocation guidance
176
- - [ ] `## Related skills` — cross-links to related skills with one-line
177
- descriptions
178
-
179
- ## Output
180
-
181
- For each reviewed skill, produce:
182
-
183
- 1. A per-check result table:
184
-
185
- | # | Check | Status | Issue |
186
- | --- | ----- | ------ | ----- |
187
-
188
- 2. A summary of required fixes (if any)
189
-
190
- 3. A list of suggestions for improvement (optional, lower priority)
191
-
192
- ## Reference: Anthropic best-practices summary
193
-
194
- This checklist is derived from the official Anthropic skill-authoring best
195
- practices at
196
- <https://platform.claude.com/docs/en/agents-and-tools/agent-skills/best-practices>.
197
-
198
- Key principles distilled:
199
-
200
- | Principle | One-liner |
201
- | --------- | --------- |
202
- | Concise is key | Only add context the model does not already have |
203
- | Degrees of freedom | Match specificity to task fragility |
204
- | Progressive disclosure | SKILL.md is an overview; details in separate files |
205
- | Effective descriptions | Third-person, specific, includes triggers and keywords |
206
- | Workflows | Sequential steps with checklists and feedback loops |
207
- | No time-sensitive info | Avoid dates that will become stale |
208
- | Consistent terminology | One term per concept throughout |
209
- | One-level references | No deeply nested file chains |
210
- | Size targets | Target under 500 lines; review carefully above 600 lines |
211
- | Test with real usage | Iterate based on observed agent behavior |
212
-
213
- > **Branch workflow:** Implement any fixes on a feature branch. Never commit or
214
- > push directly to `main` — open a pull request when changes are ready to merge.