Skip to content

Commit ec0c1eb

Browse files
Workaround line ending issue
See vercel-labs/skills#781 for details
1 parent 3f38dc8 commit ec0c1eb

4 files changed

Lines changed: 45 additions & 15 deletions

File tree

.agents/skills/usethis-skills-external-add/SKILL.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Add an external (community) skill to the project from a third-party
44
compatibility: usethis, agent skills, npx, markdown
55
license: MIT
66
metadata:
7-
version: "1.0"
7+
version: "1.1"
88
---
99

1010
# Adding External Skills
@@ -13,27 +13,30 @@ External skills are sourced from third-party repositories rather than written lo
1313

1414
## Procedure
1515

16-
1. Install the skills using `npx skills add <source> --skill '*' --agent github-copilot --yes` (e.g. `npx skills add CodSpeedHQ/codspeed --skill '*' --agent github-copilot --yes`).
17-
2. Note the skill name(s) added to `skills-lock.json`.
18-
3. Add each new skill to the external skills registry in `AGENTS.md`.
19-
4. Verify the hook passes: `python hooks/check-skills-documented.py`.
16+
1. Set the line-ending environment variables (see "Line endings and reproducible hashes" below).
17+
2. Install the skills using `npx skills add <source> --skill '*' --agent github-copilot --yes` (e.g. `npx skills add CodSpeedHQ/codspeed --skill '*' --agent github-copilot --yes`).
18+
3. Note the skill name(s) added to `skills-lock.json`.
19+
4. Add each new skill to the external skills registry in `AGENTS.md`.
20+
5. Verify the hook passes: `python hooks/check-skills-documented.py`.
21+
22+
## Line endings and reproducible hashes
23+
24+
Due to a [bug in the skills CLI](https://github.com/vercel-labs/skills/issues/781), `computedHash` values in `skills-lock.json` differ depending on git's `core.autocrlf` setting. To produce reproducible hashes, **always** set the following environment variables when running any `npx skills` command:
25+
26+
- `GIT_CONFIG_COUNT=1`
27+
- `GIT_CONFIG_KEY_0=core.autocrlf`
28+
- `GIT_CONFIG_VALUE_0=false`
2029

2130
## Installing the skill
2231

23-
To **add a new** external skill, run from the repository root:
32+
To **add a new** external skill, run from the repository root (with the line-ending environment variables set as described above):
2433

2534
```commandline
2635
npx skills add <github-org>/<repo> --skill '*' --agent github-copilot --yes
2736
```
2837

2938
This adds the skill entry to `skills-lock.json`. Multiple skills may be added from a single source.
3039

31-
To **reinstall** already-tracked external skills that are not present locally (e.g. after a fresh clone):
32-
33-
```commandline
34-
npx skills experimental_install
35-
```
36-
3740
## Documenting in AGENTS.md
3841

3942
After installing, add a row to the external skills table in the "External skills" section of `AGENTS.md`:
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: usethis-skills-external-install
3+
description: Reinstall already-tracked external skills from skills-lock.json (e.g. after a fresh clone)
4+
compatibility: usethis, agent skills, npx
5+
license: MIT
6+
metadata:
7+
version: "1.0"
8+
---
9+
10+
# Installing External Skills
11+
12+
External skills tracked in `skills-lock.json` may not be present locally (e.g. after a fresh clone, since skill files are gitignored). This skill describes how to restore them.
13+
14+
## Procedure
15+
16+
1. Set the line-ending environment variables to ensure reproducible hashes (see below).
17+
2. Run `npx skills experimental_install` from the repository root.
18+
3. Verify `skills-lock.json` is unchanged (e.g. `git diff --exit-code skills-lock.json`).
19+
20+
## Line endings and reproducible hashes
21+
22+
Due to a [bug in the skills CLI](https://github.com/vercel-labs/skills/issues/781), `computedHash` values in `skills-lock.json` differ depending on git's `core.autocrlf` setting. To produce reproducible hashes, **always** set the following environment variables when running any `npx skills` command:
23+
24+
- `GIT_CONFIG_COUNT=1`
25+
- `GIT_CONFIG_KEY_0=core.autocrlf`
26+
- `GIT_CONFIG_VALUE_0=false`

AGENTS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ The `.agents/skills` directory contains agent skills.
3535
| `usethis-qa-static-checks` | Perform static code checks |
3636
| `usethis-skills-create` | Create new agent skills (SKILL.md files) following best practices for content quality, structure, and discoverability |
3737
| `usethis-skills-external-add` | Add an external (community) skill and document it in AGENTS.md |
38+
| `usethis-skills-external-install` | Install/reinstall already-tracked external skills from skills-lock.json (e.g. after a fresh clone) |
3839
| `usethis-skills-modify` | Modify agent skills (SKILL.md files) |
3940
| `usethis-test-with-coverage` | Write tests that achieve full code coverage and verify coverage locally before pushing |
4041

4142
#### External skills
4243

43-
External skills can be installed via `npx skills experimental_install` if they are not present.
44+
External skills can be installed if they are not present — see the `usethis-skills-external-install` skill.
4445

4546
| Skill | Source | Description |
4647
| ------------------------ | --------------------- | ----------------------------------------------------------------------- |

skills-lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"codspeed-optimize": {
55
"source": "CodSpeedHQ/codspeed",
66
"sourceType": "github",
7-
"computedHash": "7645f43a7a8ca9705a9a8e7367ac1f4ad9d8822ba94230e2b38381c05957d5c5"
7+
"computedHash": "8521003ae5faf606e129f18139fa6eb401821c41f8948dd8e45f0db8d40e46b3"
88
},
99
"codspeed-setup-harness": {
1010
"source": "CodSpeedHQ/codspeed",
1111
"sourceType": "github",
12-
"computedHash": "bd861b140b75372438d0dbbf5b697e563a80d567bc8bb2b3f2880cdfe41ef27f"
12+
"computedHash": "587a58bc7498635347ee7a7eba66ac17c75430db7543be4af7eaab74533a6714"
1313
}
1414
}
1515
}

0 commit comments

Comments
 (0)