gem-skill 0.1.2 → 0.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.
- checksums.yaml +4 -4
- data/.github/workflows/deploy-github-pages.yml +52 -0
- data/CHANGELOG.md +55 -0
- data/README.md +71 -13
- data/docs/assets/images/gem-skill.jpg +0 -0
- data/docs/cache.md +185 -0
- data/docs/commands/bundle-skill.md +154 -0
- data/docs/commands/gem-skill.md +212 -0
- data/docs/configuration.md +112 -0
- data/docs/how-it-works.md +209 -0
- data/docs/index.md +73 -0
- data/docs/installation.md +62 -0
- data/docs/skill-files.md +141 -0
- data/lib/gem/skill/cache.rb +24 -0
- data/lib/gem/skill/cli/bundle_command.rb +53 -18
- data/lib/gem/skill/cli/gem_command.rb +163 -8
- data/lib/gem/skill/fetcher.rb +52 -0
- data/lib/gem/skill/frontmatter.rb +64 -0
- data/lib/gem/skill/generator.rb +1 -0
- data/lib/gem/skill/linker.rb +17 -3
- data/lib/gem/skill/runner.rb +69 -9
- data/lib/gem/skill/verifier.rb +136 -0
- data/lib/gem/skill/version.rb +1 -1
- data/lib/gem/skill.rb +12 -0
- data/mkdocs.yml +115 -0
- data/ruby-gem-skills/SKILL.md +53 -0
- metadata +16 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c425b88d925bd6ef993c1ea04581ffd0e457bebc9137cccf68cf3aacd6e00fde
|
|
4
|
+
data.tar.gz: ba39b45df96bc6f76c6b2ffa950a3a2cafbba4b7c0b2bfd94ecbd9cd4b38cd06
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b4558c9312730d8d7218951591985d868db5bea5f4282f52702ad01feb5ec381c3cfe5af56cb9b50cfa5c45b58e5dbf54bbefee99d6c36d033598383977c35e
|
|
7
|
+
data.tar.gz: 7464f9cd590e6899ad7a4d2b5a464c42c054ce4287502625349f5cb438e3c66e53e4b56ab7291f8730404f9f9f9f4636a7412cf736a40f40e6dce9a94a5ff048
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Deploy Documentation to GitHub Pages
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
- develop
|
|
7
|
+
paths:
|
|
8
|
+
- "docs/**"
|
|
9
|
+
- "mkdocs.yml"
|
|
10
|
+
- ".github/workflows/deploy-github-pages.yml"
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
pages: write
|
|
16
|
+
id-token: write
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
deploy:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout code
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
with:
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
|
|
27
|
+
- name: Setup Python
|
|
28
|
+
uses: actions/setup-python@v5
|
|
29
|
+
with:
|
|
30
|
+
python-version: 3.x
|
|
31
|
+
|
|
32
|
+
- name: Install dependencies
|
|
33
|
+
run: |
|
|
34
|
+
pip install mkdocs
|
|
35
|
+
pip install mkdocs-material
|
|
36
|
+
pip install mkdocs-macros-plugin
|
|
37
|
+
pip install mike
|
|
38
|
+
|
|
39
|
+
- name: Configure Git
|
|
40
|
+
run: |
|
|
41
|
+
git config --local user.email "action@github.com"
|
|
42
|
+
git config --local user.name "GitHub Action"
|
|
43
|
+
|
|
44
|
+
- name: Deploy to GitHub Pages
|
|
45
|
+
run: |
|
|
46
|
+
if [ "${{ github.ref }}" = "refs/heads/main" ]; then
|
|
47
|
+
echo "Deploying from main branch"
|
|
48
|
+
mkdocs gh-deploy --force --clean
|
|
49
|
+
else
|
|
50
|
+
echo "Deploying from develop branch"
|
|
51
|
+
mkdocs gh-deploy --force --clean
|
|
52
|
+
fi
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to gem-skill are documented here.
|
|
4
|
+
Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
5
|
+
|
|
1
6
|
## [Unreleased]
|
|
2
7
|
|
|
8
|
+
### Added
|
|
9
|
+
- Bundled `ruby-gem-skills` "router" skill (shipped at the gem root) that teaches assistants how to find cached gem skills in `~/.gem/skills` — a directory neither Claude Code nor Codex scans by default. `gem skill setup` now also copies this skill into each detected assistant's default root (`~/.claude/skills`, `~/.codex/skills`, `~/.agents/skills`), creating none that don't already exist. `Gem::Skill::ROUTER_SKILL_NAME` / `ROUTER_SKILL_DIR` locate the bundled template.
|
|
10
|
+
|
|
11
|
+
## [0.2.0] - 2026-06-19
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- `--verify` flag for `gem skill install` and `bundle skill install`/`refresh` — runs a second LLM pass that checks the generated skill's code against the gem's **actual source code** (the source of truth) and corrects mismatched method signatures, default argument values, visibility, return values, and behavioral claims. READMEs and docstrings are frequently stale; this catches it.
|
|
15
|
+
- `gem skill verify GEM_NAME [GEM_NAME ...]` subcommand — verify an already-cached skill in place (never generates; errors if the gem isn't installed or the skill isn't cached).
|
|
16
|
+
- `gem skill list` flags verified versions with a green checkmark (`✓`); unverified versions show no mark. The checkmark is colored only for interactive terminals.
|
|
17
|
+
- `GEMSKILL_PROJECT_DIR` env var (default `.claude/skills`) — controls the project-relative directory `bundle skill` writes symlinks into. Codex users can set it to `.agents` or `.codex` to link skills into a Codex project root.
|
|
18
|
+
- `Gem::Skill::Verifier` — the verification pass. Whether the skill changed is decided by a deterministic diff (not the model's self-report), so the result is trustworthy.
|
|
19
|
+
- `Gem::Skill::Frontmatter` — deterministic, idempotent frontmatter builder shared by the generator and verifier, so a skill always carries valid frontmatter even if the model omits it.
|
|
20
|
+
- `Fetcher#source_code` — concatenates the gem's `lib/**/*.rb` (size-capped) as the ground truth the verifier checks against.
|
|
21
|
+
- `Cache.read_metadata`, `Cache.write_skill`, `Cache.merge_metadata` — support verifying/rewriting a cached skill without clobbering `generated_at`/`model`/`sources`.
|
|
22
|
+
- Verified skills gain a `verification` block in `metadata.json` recording that the skill was checked against the gem's actual source: `verified`, `verified_at`, `model`, and `fixed` (whether the check changed anything). When no installed source is available to check against, it records `verified: false` with a `skipped_reason`.
|
|
23
|
+
- Exit status `2` (`Gem::Skill::EXIT_VERIFY_FIXED`) when `--verify` found and corrected problems, so CI can detect README/source drift. `0` = clean, `1` = error.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- `Runner.install_skill` now accepts `verify:` and returns a `Runner::Result` (`error`, `verify_fixed`) instead of a nil/error-string.
|
|
27
|
+
- Documentation reworded to be assistant-neutral: `SKILL.md` is a shared format read by Claude Code, OpenAI Codex, and other AI coding assistants. Added guidance for pointing non-Claude assistants (e.g. Codex's `~/.codex/skills`, the vendor-neutral `~/.agents/skills`) at the shared cache. `bundle skill` still links into `.claude/skills/` (Claude Code's convention).
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
- Generated `SKILL.md` files now include the required YAML frontmatter (`name` + `description`). Without it, the files were never registered/triggered as skills by Claude Code or OpenAI Codex — they were just markdown in a skills folder. `name` is the gem name normalized to hyphen-case (e.g. `ruby_llm` → `ruby-llm`); `description` is a trigger-oriented one-liner derived from the Overview (sanitized for both assistants: single line, no angle brackets). Verified against Claude Code's skill validator and OpenAI's Codex skill spec.
|
|
31
|
+
|
|
32
|
+
### Note
|
|
33
|
+
- Skills cached before this change lack frontmatter; regenerate them with `gem skill install GEM --force` (or `bundle skill refresh --force`) to add it.
|
|
34
|
+
|
|
35
|
+
## [0.1.3] - 2026-06-17
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
- `gem skill setup` subcommand — registers gem-skill as a Bundler plugin in one step
|
|
39
|
+
- `--version` / `-v` flag for both `gem skill` and `bundle skill`
|
|
40
|
+
- `post_install_message` guiding users to run `gem skill setup` after install
|
|
41
|
+
- `async` gem dependency — concurrent fiber-based LLM calls replace threads
|
|
42
|
+
- `Gem::Skill::Runner` module — shared `install_skill` core extracted from both CLI commands
|
|
43
|
+
- `test/support/cache_helpers.rb` — shared `stub_cache_root`/`restore_cache_root` test helpers
|
|
44
|
+
- MkDocs documentation site (`docs/`) with full reference for all commands, cache layout, skill file format, and architecture
|
|
45
|
+
|
|
46
|
+
### Changed
|
|
47
|
+
- `bundle skill install` and `bundle skill refresh` now run all gems concurrently via `Async::Barrier` (previously sequential)
|
|
48
|
+
- `gem skill install` also migrated from threads to async fibers
|
|
49
|
+
- `Lockfile.gems` now includes runtime dependencies declared in gemspec files (via `gemspec` in `Gemfile`), not just direct `Gemfile` entries
|
|
50
|
+
- `.claude/skills/` symlinks now point to version directories (e.g. `~/.gem/skills/faraday/2.14.3/`) instead of individual `SKILL.md` files
|
|
51
|
+
- `GEMSKILL_DIR` environment variable controls the cache root (default: `~/.gem/skills`)
|
|
52
|
+
- `GEMSKILL_MODEL` environment variable controls the default LLM model
|
|
53
|
+
- `scripts/e2e_test` updated to exercise the full pipeline: Fetch → Runner → Cache → Linker
|
|
54
|
+
|
|
55
|
+
### Removed
|
|
56
|
+
- `thor` runtime dependency (was declared but never used)
|
|
57
|
+
|
|
3
58
|
## [0.1.0] - 2026-06-16
|
|
4
59
|
|
|
5
60
|
- Initial release
|
data/README.md
CHANGED
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
# gem-skill
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<table style="width:38%;margin:0 auto;" border="0" cellpadding="8">
|
|
5
|
+
<tr>
|
|
6
|
+
<td width="40%"><img src="docs/assets/images/gem-skill.jpg" alt="gem-skill logo" width="100%"></td>
|
|
7
|
+
<td width="60%">
|
|
8
|
+
Generate <code>SKILL.md</code> files for AI coding assistants
|
|
9
|
+
(Claude Code, OpenAI Codex, and others) from Ruby gem documentation,
|
|
10
|
+
and cache them globally so every project that uses a gem can share the
|
|
11
|
+
same pre-built knowledge.<br><br>
|
|
12
|
+
<strong><a href="https://madbomber.github.io/gem-skill">Full documentation →</a></strong>
|
|
13
|
+
</td>
|
|
14
|
+
</tr>
|
|
15
|
+
</table>
|
|
16
|
+
</p>
|
|
5
17
|
|
|
6
18
|
## The problem it solves
|
|
7
19
|
|
|
8
|
-
Every time
|
|
9
|
-
re-reads the README, scans examples, and figures out the API. That
|
|
10
|
-
and time — and the result evaporates when the conversation ends.
|
|
20
|
+
Every time an AI coding assistant encounters a gem it hasn't seen in the current
|
|
21
|
+
context, it re-reads the README, scans examples, and figures out the API. That
|
|
22
|
+
costs tokens and time — and the result evaporates when the conversation ends.
|
|
11
23
|
|
|
12
24
|
`gem-skill` runs that pipeline once, offline, and stores the output as a
|
|
13
|
-
`SKILL.md` in `~/.gem/skills`. Projects symlink to the cached version, so
|
|
14
|
-
has accurate, version-specific knowledge about each gem without
|
|
15
|
-
ingestion work.
|
|
25
|
+
`SKILL.md` in `~/.gem/skills`. Projects symlink to the cached version, so your
|
|
26
|
+
assistant has accurate, version-specific knowledge about each gem without
|
|
27
|
+
repeating the ingestion work. `SKILL.md` is a shared format — Claude Code,
|
|
28
|
+
OpenAI Codex, and other assistants all read it.
|
|
16
29
|
|
|
17
30
|
## How the cache is laid out
|
|
18
31
|
|
|
@@ -27,7 +40,8 @@ ingestion work.
|
|
|
27
40
|
└── metadata.json
|
|
28
41
|
```
|
|
29
42
|
|
|
30
|
-
Each project's `.claude/skills/`
|
|
43
|
+
Each project's `.claude/skills/` directory (Claude Code's convention) holds
|
|
44
|
+
symlinks that point into this cache:
|
|
31
45
|
|
|
32
46
|
```
|
|
33
47
|
your-app/.claude/skills/
|
|
@@ -37,6 +51,29 @@ your-app/.claude/skills/
|
|
|
37
51
|
Two projects that pin different versions of the same gem each get the right
|
|
38
52
|
skill; the underlying content is generated once and shared.
|
|
39
53
|
|
|
54
|
+
### Using the cache with other assistants
|
|
55
|
+
|
|
56
|
+
The `~/.gem/skills` cache is assistant-neutral — `SKILL.md` is a shared format.
|
|
57
|
+
By default `bundle skill` links skills into `.claude/skills/`, which Claude Code
|
|
58
|
+
reads automatically. Other assistants discover skills in their own roots; for
|
|
59
|
+
example, OpenAI Codex looks in `~/.codex/skills` and the vendor-neutral
|
|
60
|
+
`~/.agents/skills` (and project-local `.agents/` / `.codex/`).
|
|
61
|
+
|
|
62
|
+
To make `bundle skill` link into a different project directory, set
|
|
63
|
+
`GEMSKILL_PROJECT_DIR`:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
export GEMSKILL_PROJECT_DIR=".agents" # Codex project root
|
|
67
|
+
bundle skill install # symlinks now land in .agents/
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
> **Availability ≠ activation.** Claude Code treats every `SKILL.md` under
|
|
71
|
+
> `.claude/skills/` as active automatically. Some assistants (e.g. Codex) only
|
|
72
|
+
> activate a skill if it's in the session's available-skills list or you point
|
|
73
|
+
> at it explicitly — so linking makes a skill *available*, not necessarily
|
|
74
|
+
> *active*. See
|
|
75
|
+
> [Using with other assistants](https://madbomber.github.io/gem-skill/skill-files/#using-with-other-assistants).
|
|
76
|
+
|
|
40
77
|
## Installation
|
|
41
78
|
|
|
42
79
|
```bash
|
|
@@ -71,7 +108,8 @@ Two environment variables control `gem-skill`'s behaviour:
|
|
|
71
108
|
|
|
72
109
|
| Variable | Default | Description |
|
|
73
110
|
|---|---|---|
|
|
74
|
-
| `GEMSKILL_DIR` | `~/.gem/skills` | Root directory for the skill cache |
|
|
111
|
+
| `GEMSKILL_DIR` | `~/.gem/skills` | Root directory for the global skill cache |
|
|
112
|
+
| `GEMSKILL_PROJECT_DIR` | `.claude/skills` | Project-relative directory where `bundle skill` writes symlinks |
|
|
75
113
|
| `GEMSKILL_MODEL` | `gpt-5.5` | LLM model used when generating skills |
|
|
76
114
|
|
|
77
115
|
```bash
|
|
@@ -80,6 +118,9 @@ export GEMSKILL_DIR="/Volumes/shared/gem-skills"
|
|
|
80
118
|
|
|
81
119
|
# Switch the default model to Claude
|
|
82
120
|
export GEMSKILL_MODEL="claude-sonnet-4-6"
|
|
121
|
+
|
|
122
|
+
# Codex users: link skills into a Codex project root instead of .claude/skills
|
|
123
|
+
export GEMSKILL_PROJECT_DIR=".agents" # or ".codex"
|
|
83
124
|
```
|
|
84
125
|
|
|
85
126
|
The `--model` flag on any command overrides `GEMSKILL_MODEL` for that
|
|
@@ -102,7 +143,10 @@ gem skill install chunker-ruby --force
|
|
|
102
143
|
# Use a different model
|
|
103
144
|
gem skill install chunker-ruby --model claude-haiku-4-5
|
|
104
145
|
|
|
105
|
-
#
|
|
146
|
+
# Verify an already-cached skill against the gem's source (fixes mismatches)
|
|
147
|
+
gem skill verify chunker-ruby
|
|
148
|
+
|
|
149
|
+
# Show everything in the cache (verified versions are flagged with a ✓)
|
|
106
150
|
gem skill list
|
|
107
151
|
|
|
108
152
|
# Remove a specific cached version
|
|
@@ -110,19 +154,30 @@ gem skill purge chunker-ruby 1.2.3
|
|
|
110
154
|
|
|
111
155
|
# Remove all cached versions of a gem
|
|
112
156
|
gem skill purge chunker-ruby --all
|
|
157
|
+
|
|
158
|
+
# Print the installed version
|
|
159
|
+
gem skill --version
|
|
113
160
|
```
|
|
114
161
|
|
|
115
162
|
If a gem isn't installed locally, `gem skill install` will install it first.
|
|
116
163
|
|
|
117
164
|
### `gem skill setup`
|
|
118
165
|
|
|
119
|
-
Run once after `gem install gem-skill
|
|
166
|
+
Run once after `gem install gem-skill`:
|
|
120
167
|
|
|
121
168
|
```bash
|
|
122
169
|
gem skill setup
|
|
123
170
|
```
|
|
124
171
|
|
|
125
|
-
This
|
|
172
|
+
This does two things:
|
|
173
|
+
|
|
174
|
+
1. Registers gem-skill as a Bundler plugin so `bundle skill` works in every project.
|
|
175
|
+
2. Installs the **`ruby-gem-skills`** router skill into the default skill root of
|
|
176
|
+
each detected assistant (`~/.claude/skills`, `~/.codex/skills`,
|
|
177
|
+
`~/.agents/skills`). Cached gem skills live in `~/.gem/skills`, which
|
|
178
|
+
assistants don't scan by default — this small always-on skill teaches Claude
|
|
179
|
+
Code and Codex how to find and load a gem's `SKILL.md` on demand. Re-run
|
|
180
|
+
`gem skill setup` after upgrading gem-skill to refresh it.
|
|
126
181
|
|
|
127
182
|
### `gem install --with-skill`
|
|
128
183
|
|
|
@@ -151,6 +206,9 @@ bundle skill list
|
|
|
151
206
|
# Options available on install and refresh
|
|
152
207
|
bundle skill install --force
|
|
153
208
|
bundle skill install --model claude-haiku-4-5
|
|
209
|
+
|
|
210
|
+
# Print the installed version
|
|
211
|
+
bundle skill --version
|
|
154
212
|
```
|
|
155
213
|
|
|
156
214
|
## What gets generated
|
|
Binary file
|
data/docs/cache.md
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# Cache
|
|
2
|
+
|
|
3
|
+
## Location
|
|
4
|
+
|
|
5
|
+
The global skill cache lives at `~/.gem/skills` by default. Override with:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
export GEMSKILL_DIR="/path/to/your/cache"
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Structure
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
~/.gem/skills/
|
|
15
|
+
├── debug_me/
|
|
16
|
+
│ └── 1.1.0/
|
|
17
|
+
│ ├── SKILL.md
|
|
18
|
+
│ └── metadata.json
|
|
19
|
+
├── faraday/
|
|
20
|
+
│ ├── 2.12.0/
|
|
21
|
+
│ │ ├── SKILL.md
|
|
22
|
+
│ │ └── metadata.json
|
|
23
|
+
│ └── 2.14.3/
|
|
24
|
+
│ ├── SKILL.md
|
|
25
|
+
│ └── metadata.json
|
|
26
|
+
└── zeitwerk/
|
|
27
|
+
└── 2.8.2/
|
|
28
|
+
├── SKILL.md
|
|
29
|
+
└── metadata.json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Each gem can have multiple cached versions. They coexist without conflict — two
|
|
33
|
+
projects pinning different versions of the same gem each get the correct skill.
|
|
34
|
+
|
|
35
|
+
## Files
|
|
36
|
+
|
|
37
|
+
### `SKILL.md`
|
|
38
|
+
|
|
39
|
+
The generated skill file. Contains structured documentation for AI coding
|
|
40
|
+
assistants (Claude Code, OpenAI Codex, and others). See
|
|
41
|
+
[Skill Files](skill-files.md) for the format.
|
|
42
|
+
|
|
43
|
+
### `metadata.json`
|
|
44
|
+
|
|
45
|
+
Stores provenance information:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"gem_name": "faraday",
|
|
50
|
+
"version": "2.14.3",
|
|
51
|
+
"model": "claude-sonnet-4-6",
|
|
52
|
+
"generated_at": "2026-06-17T10:23:45Z",
|
|
53
|
+
"sources": ["readme", "changelog", "rubygems"]
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
When a skill is generated with `--verify`, a `verification` block is added that
|
|
58
|
+
records that the gem's actual source code was consulted, exactly which files were
|
|
59
|
+
examined, and the issue-ready corrections that resulted:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"gem_name": "tty-spinner",
|
|
64
|
+
"version": "0.9.3",
|
|
65
|
+
"model": "gpt-5.5",
|
|
66
|
+
"generated_at": "2026-06-17T10:23:45Z",
|
|
67
|
+
"sources": ["metadata", "readme", "changelog"],
|
|
68
|
+
"verification": {
|
|
69
|
+
"verified": true,
|
|
70
|
+
"verified_at": "2026-06-19T14:02:11Z",
|
|
71
|
+
"model": "gpt-5.5",
|
|
72
|
+
"used_source_code": true,
|
|
73
|
+
"source": {
|
|
74
|
+
"files": ["lib/tty/spinner.rb", "lib/tty/spinner/multi.rb", "lib/tty/spinner/formats.rb"],
|
|
75
|
+
"file_count": 3,
|
|
76
|
+
"chars": 26452,
|
|
77
|
+
"truncated": false
|
|
78
|
+
},
|
|
79
|
+
"fixed": true,
|
|
80
|
+
"change_count": 1,
|
|
81
|
+
"changes": [
|
|
82
|
+
{
|
|
83
|
+
"category": "default_value",
|
|
84
|
+
"symbol": "TTY::Spinner#stop",
|
|
85
|
+
"skill_section": "Core API",
|
|
86
|
+
"source_location": "lib/tty/spinner.rb:387",
|
|
87
|
+
"was": "stop(message = nil)",
|
|
88
|
+
"now": "stop(message = '')",
|
|
89
|
+
"detail": "Default argument is an empty string, not nil; the README implied nil.",
|
|
90
|
+
"source_evidence": "def stop(stop_message = '')"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Each entry in `changes` is detailed enough to open a documentation issue against
|
|
98
|
+
the gem: it names the affected symbol, where the skill was wrong, what it claimed
|
|
99
|
+
versus the truth, and the source snippet that proves it. When source isn't
|
|
100
|
+
available locally, `verification` instead records `"verified": false`,
|
|
101
|
+
`"used_source_code": false`, and a `"skipped_reason"`.
|
|
102
|
+
|
|
103
|
+
## Cache commands
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# List everything in the cache
|
|
107
|
+
gem skill list
|
|
108
|
+
|
|
109
|
+
# Remove a specific version
|
|
110
|
+
gem skill purge faraday 2.12.0
|
|
111
|
+
|
|
112
|
+
# Remove all versions of a gem
|
|
113
|
+
gem skill purge faraday --all
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Sharing the cache
|
|
117
|
+
|
|
118
|
+
You can share a skill cache across machines by pointing `GEMSKILL_DIR` at a
|
|
119
|
+
shared location:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# Team-shared network drive
|
|
123
|
+
export GEMSKILL_DIR="/Volumes/team-shared/gem-skills"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
All machines with the same `GEMSKILL_DIR` will read and write to the same cache.
|
|
127
|
+
Skills generated on one machine are immediately available on others.
|
|
128
|
+
|
|
129
|
+
## Project symlinks
|
|
130
|
+
|
|
131
|
+
Projects don't store skills locally — they hold symlinks into the global cache.
|
|
132
|
+
`bundle skill` writes these into the directory named by
|
|
133
|
+
[`GEMSKILL_PROJECT_DIR`](configuration.md#gemskill_project_dir), which defaults
|
|
134
|
+
to `.claude/skills/` (Claude Code's convention):
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
your-project/.claude/skills/
|
|
138
|
+
├── faraday → ~/.gem/skills/faraday/2.14.3/
|
|
139
|
+
└── zeitwerk → ~/.gem/skills/zeitwerk/2.8.2/
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Each symlink points to the **version directory**, and the assistant reads
|
|
143
|
+
`SKILL.md` from inside the linked directory.
|
|
144
|
+
|
|
145
|
+
`bundle skill refresh` updates symlinks when versions change after `bundle update`.
|
|
146
|
+
`bundle skill list` shows the status of all current symlinks.
|
|
147
|
+
|
|
148
|
+
### Other assistants
|
|
149
|
+
|
|
150
|
+
`SKILL.md` is a shared format and the cache is assistant-neutral. Assistants
|
|
151
|
+
other than Claude Code look in their own skill roots — for example, OpenAI Codex
|
|
152
|
+
uses `~/.codex/skills` and the vendor-neutral `~/.agents/skills` globally, or
|
|
153
|
+
project-local `.agents/` / `.codex/`.
|
|
154
|
+
|
|
155
|
+
For project links, set `GEMSKILL_PROJECT_DIR` so `bundle skill` writes straight
|
|
156
|
+
into the right directory:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
export GEMSKILL_PROJECT_DIR=".agents"
|
|
160
|
+
bundle skill install
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
For a global, cross-project link, symlink a cached version directory into the
|
|
164
|
+
assistant's global root:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
ln -s ~/.gem/skills/faraday/2.14.3 ~/.agents/skills/faraday
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Note that linking only makes a skill *available*; some assistants (e.g. Codex)
|
|
171
|
+
won't *activate* it unless it's in the session's available-skills list or you
|
|
172
|
+
reference it explicitly. See
|
|
173
|
+
[Using with other assistants](skill-files.md#using-with-other-assistants).
|
|
174
|
+
|
|
175
|
+
## Regenerating skills
|
|
176
|
+
|
|
177
|
+
Skills do not auto-expire. Regenerate explicitly when you want updated content:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Regenerate one gem
|
|
181
|
+
gem skill install faraday --force
|
|
182
|
+
|
|
183
|
+
# Regenerate all project gems with a better model
|
|
184
|
+
bundle skill install --force --model claude-opus-4-8
|
|
185
|
+
```
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# bundle skill
|
|
2
|
+
|
|
3
|
+
The `bundle skill` command is project-aware: it reads `Gemfile.lock` to
|
|
4
|
+
determine which gems and versions are in use, generates skills for all of them,
|
|
5
|
+
and links the results into `.claude/skills/` (Claude Code's skill directory) in
|
|
6
|
+
the project root. The generated `SKILL.md` files are a shared format that other
|
|
7
|
+
assistants read too — see [Using with other assistants](../skill-files.md#using-with-other-assistants).
|
|
8
|
+
|
|
9
|
+
## Global options
|
|
10
|
+
|
|
11
|
+
These flags work without a subcommand:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
bundle skill --version # print installed version and exit
|
|
15
|
+
bundle skill -v # same
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Prerequisites
|
|
19
|
+
|
|
20
|
+
Run once after installing gem-skill:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
gem skill setup
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or add to the project `Gemfile`:
|
|
27
|
+
|
|
28
|
+
```ruby
|
|
29
|
+
plugin "gem-skill"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Subcommands
|
|
33
|
+
|
|
34
|
+
### `bundle skill install`
|
|
35
|
+
|
|
36
|
+
Generate and link skills for all direct dependencies in `Gemfile.lock`.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
bundle skill install [OPTIONS]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Options:**
|
|
43
|
+
|
|
44
|
+
| Flag | Description |
|
|
45
|
+
|------|-------------|
|
|
46
|
+
| `--force` | Regenerate even if skills are already cached |
|
|
47
|
+
| `--verify` | Verify generated skills against each gem's source and fix mismatches (exit `2` if any fixes applied) |
|
|
48
|
+
| `--model MODEL` | LLM model to use (overrides `GEMSKILL_MODEL`) |
|
|
49
|
+
| `--version`, `-v` | Print the installed gem-skill version and exit |
|
|
50
|
+
|
|
51
|
+
**Example:**
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cd your-project
|
|
55
|
+
bundle skill install
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**What it processes:**
|
|
59
|
+
|
|
60
|
+
- All gems listed in the `DEPENDENCIES` section of `Gemfile.lock`
|
|
61
|
+
- Runtime dependencies declared in any `gemspec` referenced by the `Gemfile` (via `gemspec` directive)
|
|
62
|
+
|
|
63
|
+
All gems are processed concurrently:
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
⠋ Installing skills (claude-sonnet-4-6)
|
|
67
|
+
✓ rake 13.4.2 already cached
|
|
68
|
+
✓ zeitwerk 2.8.2 done
|
|
69
|
+
✓ ruby_llm 1.16.0 done
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
After completion, each skill is symlinked into the project skill directory
|
|
73
|
+
(`.claude/skills/` by default; set
|
|
74
|
+
[`GEMSKILL_PROJECT_DIR`](../configuration.md#gemskill_project_dir) to change it,
|
|
75
|
+
e.g. `.agents` for Codex):
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
your-project/.claude/skills/
|
|
79
|
+
├── rake → ~/.gem/skills/rake/13.4.2/
|
|
80
|
+
├── ruby_llm → ~/.gem/skills/ruby_llm/1.16.0/
|
|
81
|
+
└── zeitwerk → ~/.gem/skills/zeitwerk/2.8.2/
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The assistant automatically reads `SKILL.md` from each linked directory (Claude
|
|
85
|
+
Code reads `.claude/skills/`; other assistants use their own roots).
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### `bundle skill refresh`
|
|
90
|
+
|
|
91
|
+
Re-sync `.claude/skills/` after `bundle update`.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
bundle skill refresh [OPTIONS]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
| Flag | Description |
|
|
98
|
+
|------|-------------|
|
|
99
|
+
| `--force` | Regenerate all skills, even those already at the correct version |
|
|
100
|
+
| `--model MODEL` | LLM model to use |
|
|
101
|
+
|
|
102
|
+
`refresh` skips gems that are already linked at the correct version (shows
|
|
103
|
+
`up to date`), regenerates gems whose version changed, and removes dead symlinks
|
|
104
|
+
for gems no longer in `Gemfile.lock`.
|
|
105
|
+
|
|
106
|
+
**Typical workflow:**
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
bundle update
|
|
110
|
+
bundle skill refresh
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
### `bundle skill list`
|
|
116
|
+
|
|
117
|
+
Show all skills currently linked in this project.
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
bundle skill list
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Example output:**
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
Skills linked in .claude/skills/ (3 ok):
|
|
127
|
+
|
|
128
|
+
[ok ] rake 13.4.2
|
|
129
|
+
[ok ] ruby_llm 1.16.0
|
|
130
|
+
[ok ] zeitwerk 2.8.2
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
A `BROKEN` status means the symlink target no longer exists in the cache —
|
|
134
|
+
run `bundle skill install` to regenerate.
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Typical project workflow
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# First time setup
|
|
142
|
+
bundle install
|
|
143
|
+
bundle skill install
|
|
144
|
+
|
|
145
|
+
# After bundle update
|
|
146
|
+
bundle update
|
|
147
|
+
bundle skill refresh
|
|
148
|
+
|
|
149
|
+
# Check what's linked
|
|
150
|
+
bundle skill list
|
|
151
|
+
|
|
152
|
+
# Force full regeneration (e.g. after model upgrade)
|
|
153
|
+
bundle skill install --force --model claude-opus-4-8
|
|
154
|
+
```
|