elelem-skills 0.3.0 → 0.4.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 (34) hide show
  1. checksums.yaml +4 -4
  2. data/.agents/backlog/001-enforce-pinned-digests.md +71 -0
  3. data/.agents/backlog/002-refresh-skill-tool-description.md +64 -0
  4. data/.agents/backlog/003-redirect-status-handling.md +47 -0
  5. data/.agents/backlog/004-private-address-fetches.md +58 -0
  6. data/.agents/backlog/005-release-changelog-fixes.md +47 -0
  7. data/.agents/backlog/006-gem-metadata-links.md +65 -0
  8. data/.github/workflows/release.yml +63 -0
  9. data/.release-please-manifest.json +3 -0
  10. data/.rubocop.yml +62 -0
  11. data/CHANGELOG.md +22 -0
  12. data/exe/elelem-skills +6 -0
  13. data/lib/elelem/skills/catalog.rb +7 -10
  14. data/lib/elelem/skills/cli.rb +55 -0
  15. data/lib/elelem/skills/fetcher.rb +90 -16
  16. data/lib/elelem/skills/lockfile.rb +56 -0
  17. data/lib/elelem/skills/setup.rb +27 -10
  18. data/lib/elelem/skills/skill_file.rb +6 -2
  19. data/lib/elelem/skills/version.rb +1 -1
  20. data/lib/elelem/skills.rb +2 -0
  21. data/release-please-config.json +12 -0
  22. data/spec/elelem/skills/catalog_spec.rb +6 -19
  23. data/spec/elelem/skills/cli_spec.rb +66 -0
  24. data/spec/elelem/skills/fetcher_spec.rb +126 -2
  25. data/spec/elelem/skills/lockfile_spec.rb +51 -0
  26. data/spec/elelem/skills/setup_spec.rb +66 -8
  27. data/spec/elelem/skills/skill_file_spec.rb +20 -0
  28. metadata +35 -17
  29. data/lib/elelem/skills/builtin/scrum/SKILL.md +0 -32
  30. data/lib/elelem/skills/builtin/scrum/build.md +0 -29
  31. data/lib/elelem/skills/builtin/scrum/design.md +0 -32
  32. data/lib/elelem/skills/builtin/scrum/plan.md +0 -67
  33. data/lib/elelem/skills/builtin/scrum/review.md +0 -43
  34. data/lib/elelem/skills/builtin/scrum/verify.md +0 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 941ba03698ec16a9c0c6bffa098b25192cb633d1c22c34d8099400ff0baf87c7
4
- data.tar.gz: 1656947d3135a5b4679d492d6c1912d1f6b5b2fefe3434eb7c5b36e19c34fbbb
3
+ metadata.gz: cfee764ae9f27287445312fca8d26cfbac9faf1a3ed842e20534dfa5ebbf9713
4
+ data.tar.gz: 5486237efc2303d1e59a3ef445e81ef9d24c6b92bb2a7b5a4e870eb0988fde69
5
5
  SHA512:
6
- metadata.gz: b53aabc68112a4164f942da764691458c6a488324a4ef58c4866977bb984d800f4b0aca0f29f75f6a72d10ee0b86b378ff64ab1e5f16166e7aac193232c2e3cb
7
- data.tar.gz: deaf2dee82d9dd91ba1731d80311533ee8506973aa28023f4b9abb05e1c66cb6b60d246ea7c9b5f6ea0f40a9314669c39d657ed0f94874a803324de431608d35
6
+ metadata.gz: ea2ae3b2cf4387babfd1f0bcf367378af7304652fb8c6734240432b596406fcfa1ab8fa52e3296b671f6f8d7c3dd93219d2f4609474d609bff58659651c56554
7
+ data.tar.gz: ab32f78d73439d6f0c4fed14aeedc4befa01755b616edb358f29d7bb967200bbddd8c96becd73b8449b3f0580763db0854733753ef3d67b6caa1e13d867e2ef1
@@ -0,0 +1,71 @@
1
+ As a `user who fetches skills from a remote index`, I `want a skill
2
+ whose digest changed since I pinned it to be held back until I accept
3
+ it`, so that `a compromised or changed server cannot swap the
4
+ instructions my agent follows`.
5
+
6
+ # SYNOPSIS
7
+
8
+ Refuse changed pinned digests unless accepted, and skip entries without
9
+ a digest instead of aborting the fetch.
10
+
11
+ # DESCRIPTION
12
+
13
+ The fetcher now pins each skill's digest in `.skill-lock.json` on first
14
+ fetch and reads it back on later fetches. When the index advertises a
15
+ different digest, `warn_if_changed` logs a warning, adds the skill to
16
+ `changed`, and installs the new content anyway (fetcher.rb:88-95). The
17
+ digest and the content come from the same server, so the pin only helps
18
+ if a change is stopped, not just reported. A warning in a log, or one
19
+ line in `/skills fetch` output, is easy to miss.
20
+
21
+ An index entry with no digest raises `FetchError`
22
+ (fetcher.rb:69). Because every skill is downloaded before any is
23
+ installed, one such entry aborts the whole fetch and nothing installs,
24
+ including well-formed skills from the same index.
25
+
26
+ Already fixed on main (commit 1134c2d and later):
27
+
28
+ * https is required; plain http is allowed only for a skill server on
29
+ this machine (fetcher.rb:154-161).
30
+ * All skills are downloaded and checked before any is written, and
31
+ each file is written beside the target and renamed
32
+ (fetcher.rb:42-46, :82-84).
33
+ * Redirects are followed, up to 5 hops, never from https to http and
34
+ never from a remote origin to this machine.
35
+ * The lockfile is read on later fetches (lockfile.rb:34).
36
+
37
+ Proposed behavior:
38
+
39
+ * A changed digest for a pinned skill is not installed. The fetch says
40
+ which skills were held back, with old and new digests, and how to
41
+ accept them (for example `elelem-skills fetch --update NAME` or a
42
+ flag that accepts all changes; decide in design).
43
+ * An entry without a digest is skipped with a warning, like an
44
+ unsupported type (fetcher.rb:64-68), and the rest of the index
45
+ installs.
46
+
47
+ # SEE ALSO
48
+
49
+ * [ ] lib/elelem/skills/fetcher.rb:69 - missing digest aborts the fetch
50
+ * [ ] lib/elelem/skills/fetcher.rb:88-95 - changed digest only warns
51
+ * [ ] lib/elelem/skills/lockfile.rb:34 - digest_for
52
+ * [ ] lib/elelem/skills/setup.rb:72 - /skills fetch reports changes
53
+ * [ ] lib/elelem/skills/cli.rb - elelem-skills fetch
54
+ * [ ] Formerly elelem-sh/elelem.sh#4
55
+
56
+ # Tasks
57
+
58
+ * [ ] TBD (filled in design mode)
59
+
60
+ # Acceptance Criteria
61
+
62
+ * [ ] A skill whose index digest differs from its pinned digest is not
63
+ written, and the pinned file is left as it was
64
+ * [ ] The fetch output names each held-back skill with both digests
65
+ * [ ] An explicit accept option installs the new content and updates
66
+ the pin
67
+ * [ ] An index entry without a digest is skipped with a warning, and the
68
+ other skills from that index install
69
+ * [ ] A first fetch (no pin yet) still installs and pins as today
70
+ * [ ] Specs cover each case above, for both `/skills fetch` and the
71
+ elelem-skills CLI
@@ -0,0 +1,64 @@
1
+ As a `user who just ran /skills fetch`, I `want the model to see the
2
+ new skills in the skill tool's description right away`, so that `I do
3
+ not have to restart elelem before the model knows they exist`.
4
+
5
+ # SYNOPSIS
6
+
7
+ Rebuild the skill tool description when the catalog reloads.
8
+
9
+ # DESCRIPTION
10
+
11
+ The `skill` tool's description embeds the catalog index: "Load a
12
+ skill's instructions by name. Available skills:" followed by one
13
+ summary per skill (setup.rb:27-29). The string is built once, when the
14
+ tool is registered. After `/skills fetch`, `@catalog.all(reload: true)`
15
+ refreshes the catalog (setup.rb:74), so `/skills`, `/skills NAME` and a
16
+ `skill` call by name all see the new skills. The description the model
17
+ reads still lists the old set until elelem restarts, and the fetch
18
+ message says so (setup.rb:75-76). A model rarely calls a skill it has
19
+ not been told about.
20
+
21
+ Options to weigh in design:
22
+
23
+ * Re-register the `skill` tool after a fetch, so the toolbox holds a
24
+ new description.
25
+ * Let core accept a description that is computed when tools are sent
26
+ to the provider (a callable), and use it here. That change belongs in
27
+ core.
28
+
29
+ Already fixed on main, from the same issue:
30
+
31
+ * The CLI (`exe/elelem-skills`, cli.rb) and the lockfile are in the
32
+ source. They reach users when 0.4.0 is released; the release PR is
33
+ open (release-please branch, version 0.4.0) and RubyGems still has
34
+ 0.3.0.
35
+ * The bundled `scrum` skill was dropped (6a66dd9).
36
+ * The catalog is reloaded after a fetch, so `/skills` sees new skills
37
+ (setup.rb:74, catalog.rb:18-21).
38
+
39
+ Not in this repository: the `/tools` table cuts the skill row at
40
+ "Available skills:". Core's tools plugin uses only the first line of
41
+ each description (`t.description.lines.first`, elelem
42
+ lib/elelem/plugins/tools.rb:13). Whether that is the right summary for a
43
+ table is a core decision; this story does not change it.
44
+
45
+ # SEE ALSO
46
+
47
+ * [ ] lib/elelem/skills/setup.rb:27-29 - description built once
48
+ * [ ] lib/elelem/skills/setup.rb:74-76 - reload and restart notice
49
+ * [ ] lib/elelem/skills/catalog.rb:18 - all(reload:)
50
+ * [ ] elelem lib/elelem/plugins/tools.rb:13 - /tools row uses the first
51
+ line (core)
52
+ * [ ] Formerly elelem-sh/elelem.sh#46
53
+
54
+ # Tasks
55
+
56
+ * [ ] TBD (filled in design mode)
57
+
58
+ # Acceptance Criteria
59
+
60
+ * [ ] After `/skills fetch` installs a skill, the next request to the
61
+ provider carries a `skill` tool description that lists it
62
+ * [ ] The fetch message no longer tells the user to restart
63
+ * [ ] A spec fetches a skill, then checks the tool description sent on
64
+ the next turn
@@ -0,0 +1,47 @@
1
+ As a `user fetching skills`, I `want a 304 or a redirect with no
2
+ Location to be reported for what it is`, so that `I am not told "too
3
+ many redirects" for a server that never redirected`.
4
+
5
+ # SYNOPSIS
6
+
7
+ Treat only real redirects as redirects; report 304 and missing
8
+ Location plainly.
9
+
10
+ # DESCRIPTION
11
+
12
+ `get` follows any `Net::HTTPRedirection` (fetcher.rb:118).
13
+ `Net::HTTPNotModified` (304) is a subclass of `Net::HTTPRedirection`,
14
+ so a 304 is followed like a redirect. `redirect` joins the current URI
15
+ with `response["location"].to_s` (fetcher.rb:131). With an empty or
16
+ missing Location header that resolves back to the same URI, so the
17
+ fetcher requests the same URL until the 5-hop limit and raises "too
18
+ many redirects" (fetcher.rb:129).
19
+
20
+ Expected:
21
+
22
+ * 301, 302, 303, 307 and 308 with a Location header are followed as
23
+ today.
24
+ * A 3xx without a Location, or with an empty one, raises a
25
+ `FetchError` that says the redirect had no Location.
26
+ * A 304 raises a `FetchError` that reports the status. The fetcher
27
+ sends no conditional headers, so a 304 is unexpected.
28
+
29
+ # SEE ALSO
30
+
31
+ * [ ] lib/elelem/skills/fetcher.rb:118 - is_a?(Net::HTTPRedirection)
32
+ * [ ] lib/elelem/skills/fetcher.rb:128-131 - redirect
33
+ * [ ] spec/elelem/skills/fetcher_spec.rb
34
+ * [ ] Formerly elelem-sh/elelem.sh#51
35
+
36
+ # Tasks
37
+
38
+ * [ ] TBD (filled in design mode)
39
+
40
+ # Acceptance Criteria
41
+
42
+ * [ ] A 304 response raises an error that names the status, after one
43
+ request
44
+ * [ ] A 302 with no Location raises an error that says the Location is
45
+ missing, after one request
46
+ * [ ] A 302 with an empty Location behaves the same way
47
+ * [ ] Existing redirect specs still pass
@@ -0,0 +1,58 @@
1
+ As a `user fetching skills from a remote index`, I `want the fetcher
2
+ to refuse private and cloud metadata addresses`, so that `a remote
3
+ index or redirect cannot make my machine request internal services`.
4
+
5
+ # SYNOPSIS
6
+
7
+ Decide whether SSRF protection is in scope; if so, refuse private
8
+ ranges for remote origins.
9
+
10
+ # DESCRIPTION
11
+
12
+ Decision needed first: is protection against server-side request
13
+ forgery in scope for `skills fetch`? The user chooses the index, which
14
+ argues no. A remote index can still redirect, and can list skill URLs
15
+ on any host, which argues yes. Record the decision in this story before
16
+ any code changes. If out of scope, document the limit in the README
17
+ and close the story.
18
+
19
+ Current behavior: `secure?` (fetcher.rb:154-161) refuses only this
20
+ machine (loopback, `localhost`, `0.0.0.0` and their numeric spellings),
21
+ and only when the origin is remote. An https URL, or a redirect, to
22
+ 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 (including the
23
+ 169.254.169.254 metadata address), IPv6 unique local or link-local
24
+ addresses is allowed. `local?` checks numeric forms only
25
+ (fetcher.rb:134-152); a host name that resolves to a private or
26
+ loopback address is not checked, as its comment says.
27
+
28
+ If in scope:
29
+
30
+ * Resolve each host before connecting, and refuse private, loopback,
31
+ link-local, unique local and metadata addresses unless the origin
32
+ itself is private (someone fetching from their own LAN server).
33
+ * Connect to the address that was checked, so a second DNS answer
34
+ cannot differ from the first.
35
+ * Check again after every redirect.
36
+
37
+ # SEE ALSO
38
+
39
+ * [ ] lib/elelem/skills/fetcher.rb:134-152 - local?, numeric_addresses
40
+ * [ ] lib/elelem/skills/fetcher.rb:154-161 - secure?
41
+ * [ ] lib/elelem/skills/fetcher.rb:114 - get, checked per hop
42
+ * [ ] Formerly elelem-sh/elelem.sh#52
43
+
44
+ # Tasks
45
+
46
+ * [ ] TBD (filled in design mode)
47
+
48
+ # Acceptance Criteria
49
+
50
+ * [ ] The scope decision is recorded in this story
51
+ * [ ] If out of scope: the README states that fetch does not block
52
+ private addresses
53
+ * [ ] If in scope: a remote origin, skill URL or redirect that resolves
54
+ to a private, link-local or metadata address is refused with a
55
+ clear error
56
+ * [ ] If in scope: a private origin can still fetch from itself
57
+ * [ ] If in scope: specs cover numeric addresses, a name that resolves
58
+ to a private address, and a redirect into a private range
@@ -0,0 +1,47 @@
1
+ As a `user reading the elelem-skills changelog`, I `want each entry to
2
+ state the real elelem requirement and link to the right place`, so
3
+ that `I know which elelem I need and can find the story behind a fix`.
4
+
5
+ # SYNOPSIS
6
+
7
+ Correct the 0.4.0 changelog before release, and stop generating links
8
+ to the wrong repository.
9
+
10
+ # DESCRIPTION
11
+
12
+ The open release PR for 0.4.0 (release-please branch, commit 9527824)
13
+ adds a CHANGELOG.md with two problems:
14
+
15
+ * The entry for 8b25a4f says "require elelem ~> 0.12". The gemspec now
16
+ allows `>= 0.12, < 1` (elelem-skills.gemspec:32). The change was made
17
+ in 877903f, a chore commit, so it is not in the changelog.
18
+ * Two entries link `elelem-sh/elelem.sh#4` to
19
+ `https://github.com/elelem-sh/skills/issues/4`. release-please links
20
+ a `#N` in a commit subject to the repository it runs in, so a
21
+ reference to another repository's issue gets the wrong URL.
22
+
23
+ Fix the CHANGELOG.md in the release PR by hand before merging: state
24
+ the actual constraint, and point the issue links at
25
+ `https://github.com/elelem-sh/elelem.sh/issues/4` (or drop them).
26
+
27
+ Going forward, issues are moving to `.agents/backlog` story files, so
28
+ new commits should reference a story path, not `#N`. That avoids the
29
+ wrong link on every later release.
30
+
31
+ # SEE ALSO
32
+
33
+ * [ ] elelem-skills.gemspec:32 - elelem dependency
34
+ * [ ] release-please-config.json
35
+ * [ ] .release-please-manifest.json - still 0.3.0 on main
36
+ * [ ] Formerly elelem-sh/elelem.sh#55
37
+
38
+ # Tasks
39
+
40
+ * [ ] TBD (filled in design mode)
41
+
42
+ # Acceptance Criteria
43
+
44
+ * [ ] The 0.4.0 changelog states the elelem requirement the gemspec
45
+ has (`>= 0.12, < 1`)
46
+ * [ ] No changelog link points at `elelem-sh/skills/issues/`
47
+ * [ ] The 0.4.0 gem is released with the corrected changelog
@@ -0,0 +1,65 @@
1
+ As a `person who finds elelem-skills on RubyGems`, I `want the
2
+ gem page to link to the plugin's documentation, backlog and
3
+ changelog`, so that `I can learn how to use it and see known
4
+ problems without GitHub Issues`.
5
+
6
+ # SYNOPSIS
7
+
8
+ Point the gemspec homepage at elelem.sh and add the standard links.
9
+
10
+ # DESCRIPTION
11
+
12
+ RubyGems shows `homepage_uri` and the other `metadata` links on every
13
+ gem page. Today `elelem-skills.gemspec` sets `spec.homepage`
14
+ to the site root (https://elelem.sh) and sets only `homepage_uri`,
15
+ `source_code_uri`, `allowed_push_host` and
16
+ `rubygems_mfa_required`.
17
+ There is no documentation, bug tracker or changelog link.
18
+
19
+ Proposed change:
20
+
21
+ ```ruby
22
+ spec.homepage = "https://elelem.sh/plugins/skills/"
23
+ spec.metadata["homepage_uri"] = spec.homepage
24
+ spec.metadata["source_code_uri"] = "https://github.com/elelem-sh/skills"
25
+ spec.metadata["documentation_uri"] = spec.homepage
26
+ spec.metadata["bug_tracker_uri"] = "https://github.com/elelem-sh/skills/tree/main/.agents/backlog"
27
+ spec.metadata["changelog_uri"] = "https://github.com/elelem-sh/skills/blob/main/CHANGELOG.md"
28
+ ```
29
+
30
+ The original proposal pointed `bug_tracker_uri` at GitHub Issues on
31
+ elelem-sh/elelem.sh, filtered by label. That no longer fits: the
32
+ project is moving its backlog out of GitHub Issues and into
33
+ `.agents/backlog` story files in each repository, so the bug tracker
34
+ link points at this repository's backlog directory instead.
35
+
36
+ /man/skills/ redirects to /plugins/skills/ on elelem.sh, so a
37
+ separate documentation_uri adds nothing. Point both at the plugin page.
38
+
39
+ CHANGELOG.md does not exist yet; release-please adds it with the
40
+ 0.4.0 release, so the link works once that release PR merges.
41
+
42
+ Keep `allowed_push_host` and `rubygems_mfa_required` as they are.
43
+ RubyGems only shows the new links after the next release.
44
+
45
+ # SEE ALSO
46
+
47
+ * [ ] elelem-skills.gemspec - spec.homepage
48
+ * [ ] elelem-skills.gemspec - source_code_uri
49
+ * [ ] .agents/backlog/ - where bug_tracker_uri will point
50
+ * [ ] Formerly elelem-sh/elelem.sh#41
51
+
52
+ # Tasks
53
+
54
+ * [ ] TBD (filled in design mode)
55
+
56
+ # Acceptance Criteria
57
+
58
+ * [ ] `spec.homepage` and `homepage_uri` are https://elelem.sh/plugins/skills/
59
+ * [ ] `bug_tracker_uri` points at this repository's `.agents/backlog`,
60
+ not at GitHub Issues
61
+ * [ ] `changelog_uri` and `source_code_uri` point at this repository
62
+ * [ ] `allowed_push_host` and `rubygems_mfa_required` are unchanged
63
+ * [ ] `gem build` succeeds and `gem spec` on the built gem shows every
64
+ link
65
+ * [ ] Every link resolves (no 404) at release time
@@ -0,0 +1,63 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ permissions: {}
9
+
10
+ concurrency:
11
+ group: release
12
+ cancel-in-progress: false
13
+
14
+ jobs:
15
+ test:
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ contents: read
19
+ steps:
20
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
21
+ with:
22
+ persist-credentials: false
23
+ - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
24
+ with:
25
+ ruby-version: "4.0"
26
+ bundler-cache: true
27
+ - run: bin/test
28
+ - run: bin/lint
29
+
30
+ release-please:
31
+ needs: test
32
+ runs-on: ubuntu-latest
33
+ permissions:
34
+ contents: write
35
+ issues: write
36
+ pull-requests: write
37
+ outputs:
38
+ release_created: ${{ steps.release.outputs.release_created }}
39
+ steps:
40
+ - id: release
41
+ uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
42
+ with:
43
+ config-file: release-please-config.json
44
+ manifest-file: .release-please-manifest.json
45
+
46
+ publish:
47
+ needs: release-please
48
+ if: needs.release-please.outputs.release_created == 'true'
49
+ runs-on: ubuntu-latest
50
+ permissions:
51
+ contents: write
52
+ id-token: write
53
+ steps:
54
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
55
+ with:
56
+ persist-credentials: false
57
+ - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0
58
+ with:
59
+ ruby-version: "4.0"
60
+ bundler-cache: true
61
+ - uses: rubygems/release-gem@7f9650160c1a4e7989fdc9855807bdbd421d8b6b # v1.4.1
62
+ with:
63
+ await-release: false
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.4.0"
3
+ }
data/.rubocop.yml ADDED
@@ -0,0 +1,62 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ TargetRubyVersion: 4.0
4
+ SuggestExtensions: false
5
+ Exclude:
6
+ - "pkg/**/*"
7
+ - "bin/**/*"
8
+ - "vendor/**/*"
9
+ - "fixtures/**/*"
10
+
11
+ Metrics:
12
+ Enabled: false
13
+
14
+ Naming/PredicateMethod:
15
+ AllowedMethods:
16
+ - call
17
+ - run
18
+ - summarize
19
+ - prompt
20
+
21
+ Naming/MethodParameterName:
22
+ AllowedNames:
23
+ - me
24
+ - id
25
+ - as
26
+ - io
27
+
28
+ Style/GlobalVars:
29
+ Exclude:
30
+ - "spec/**/*"
31
+
32
+ Lint/EmptyBlock:
33
+ Exclude:
34
+ - "spec/**/*"
35
+
36
+ Lint/UselessDefaultValueArgument:
37
+ Enabled: false
38
+
39
+ Lint/RedundantRequireStatement:
40
+ Enabled: false
41
+
42
+ Lint/UnusedBlockArgument:
43
+ IgnoreEmptyBlocks: true
44
+ AllowUnusedKeywordArguments: true
45
+
46
+ Style/Documentation:
47
+ Enabled: false
48
+
49
+ Style/FormatStringToken:
50
+ Enabled: false
51
+
52
+ Style/FrozenStringLiteralComment:
53
+ Enabled: true
54
+
55
+ Style/StringLiterals:
56
+ EnforcedStyle: double_quotes
57
+
58
+ Style/StringLiteralsInInterpolation:
59
+ EnforcedStyle: double_quotes
60
+
61
+ Layout/LineLength:
62
+ Max: 120
data/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+
3
+ ## [0.4.0](https://github.com/elelem-sh/skills/compare/v0.3.0...v0.4.0) (2026-11-17)
4
+
5
+
6
+ ### Features
7
+
8
+ * add elelem-skills CLI, lockfile for remote fetches, drop bundled scrum skill ([6a66dd9](https://github.com/elelem-sh/skills/commit/6a66dd990d974709fabd16fd3023ddf30087a53c))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * a remote skills index cannot redirect to this machine, and /skills fetch names skills that changed ([61a0f7a](https://github.com/elelem-sh/skills/commit/61a0f7aa6ff3312776c5b9c8747dac31973cef88))
14
+ * require elelem &gt;= 0.13.1, the release the specs are written against ([7ef87b8](https://github.com/elelem-sh/skills/commit/7ef87b82dbb0b4b8603c665d214949eb741d9340))
15
+ * require elelem ~&gt; 0.12, the floor builtins/skills actually need ([8b25a4f](https://github.com/elelem-sh/skills/commit/8b25a4f60c298e2a647ca66529e921583ab983a4))
16
+ * SKILL.md files with Windows line endings or a byte order mark load ([550d3b5](https://github.com/elelem-sh/skills/commit/550d3b529a6a7a72325eb1490c5d7d2143fe1c79))
17
+ * SKILL.md is read as UTF-8 whatever the locale ([8f7447c](https://github.com/elelem-sh/skills/commit/8f7447c1827227aaec00583d131c53e65c5b1201))
18
+ * skills also treats numeric loopback forms like 127.1 as this machine ([a78391e](https://github.com/elelem-sh/skills/commit/a78391ee04b6f4e66461b7321f9a800d46c205b3))
19
+ * skills decides this machine by address, so other spellings of loopback are refused too ([8bb1924](https://github.com/elelem-sh/skills/commit/8bb19249aa446c95338a3c76b59ee1771311c9f3))
20
+ * skills fetch follows up to 5 redirects, never from https to http (elelem-sh/elelem.sh[#4](https://github.com/elelem-sh/skills/issues/4)) ([44635ad](https://github.com/elelem-sh/skills/commit/44635adac765e4be51f083154205de711a656cab))
21
+ * skills fetch needs https, installs all or nothing, and warns when a pinned digest changes (elelem-sh/elelem.sh[#4](https://github.com/elelem-sh/skills/issues/4)) ([1134c2d](https://github.com/elelem-sh/skills/commit/1134c2d0aee89b94587b4cf83ba528455d1806ef))
22
+ * wrap Agent in Session in specs ([0c7cab1](https://github.com/elelem-sh/skills/commit/0c7cab14c377e83ba20871b997dd5b036082d97f))
data/exe/elelem-skills ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env -S ruby -W0
2
+ # frozen_string_literal: true
3
+
4
+ require "elelem/skills"
5
+
6
+ Elelem::Skills::CLI.new(ARGV).run
@@ -3,11 +3,9 @@
3
3
  module Elelem
4
4
  module Skills
5
5
  class Catalog
6
- GEM_SKILLS = File.expand_path("builtin", __dir__).freeze
7
6
  REMOTE_SKILLS = File.expand_path("~/.agents/remote-skills").freeze
8
7
 
9
8
  LOAD_PATHS = [
10
- GEM_SKILLS,
11
9
  "~/.agents/skills",
12
10
  ".agents/skills"
13
11
  ].freeze
@@ -17,7 +15,8 @@ module Elelem
17
15
  @remote_skills = remote_skills
18
16
  end
19
17
 
20
- def all
18
+ def all(reload: false)
19
+ @all = nil if reload
21
20
  @all ||= discover
22
21
  end
23
22
 
@@ -36,10 +35,8 @@ module Elelem
36
35
  def discover
37
36
  seen = {}
38
37
 
39
- @load_paths.each do |path|
40
- scan_one_level(path, seen)
41
- scan_remote(seen) if path == GEM_SKILLS && @remote_skills
42
- end
38
+ scan_remote(seen) if @remote_skills
39
+ @load_paths.each { |path| scan_one_level(path, seen) }
43
40
 
44
41
  seen.values
45
42
  end
@@ -48,14 +45,14 @@ module Elelem
48
45
  dir = File.expand_path(path)
49
46
  return unless File.directory?(dir)
50
47
 
51
- Dir["#{dir}/*/SKILL.md"].sort.each { |skill_md| load_into(skill_md, seen) }
48
+ Dir["#{dir}/*/SKILL.md"].each { |skill_md| load_into(skill_md, seen) }
52
49
  end
53
50
 
54
51
  def scan_remote(seen)
55
52
  dir = File.expand_path(@remote_skills)
56
53
  return unless File.directory?(dir)
57
54
 
58
- Dir["#{dir}/*/*/SKILL.md"].sort.each { |skill_md| load_into(skill_md, seen) }
55
+ Dir["#{dir}/*/*/SKILL.md"].each { |skill_md| load_into(skill_md, seen) }
59
56
  end
60
57
 
61
58
  def load_into(skill_md, seen)
@@ -63,7 +60,7 @@ module Elelem
63
60
  return unless skill
64
61
 
65
62
  seen[skill.name] = skill
66
- rescue => e
63
+ rescue StandardError => e
67
64
  Elelem.logger.warn("elelem-skills: failed to load #{skill_md}: #{e.message}")
68
65
  end
69
66
 
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Elelem
4
+ module Skills
5
+ class CLI
6
+ COMMANDS = %w[fetch list help].freeze
7
+
8
+ def initialize(args)
9
+ @args = args
10
+ end
11
+
12
+ def run
13
+ command = @args.shift || "help"
14
+ abort "Unknown command: #{command}\n\n#{usage}" unless COMMANDS.include?(command)
15
+ send(command)
16
+ end
17
+
18
+ private
19
+
20
+ def fetch
21
+ origin = @args.shift
22
+ abort "Usage: elelem-skills fetch <origin>" unless origin
23
+
24
+ names = Fetcher.new.fetch(origin)
25
+ return puts "No skills installed from #{origin}." if names.empty?
26
+
27
+ puts "Installed: #{names.join(", ")}"
28
+ rescue Fetcher::FetchError => e
29
+ abort "elelem-skills: #{e.message}"
30
+ end
31
+
32
+ def list
33
+ catalog = Catalog.new
34
+ return puts "No skills found." if catalog.all.empty?
35
+
36
+ catalog.all.each { |skill| puts skill.summary }
37
+ end
38
+
39
+ def help
40
+ puts usage
41
+ end
42
+
43
+ def usage
44
+ <<~USAGE
45
+ Usage: elelem-skills <command> [args]
46
+
47
+ Commands:
48
+ fetch <origin> Install skills from <origin>/.well-known/agent-skills/index.json
49
+ list List all discovered skills
50
+ help Show this help
51
+ USAGE
52
+ end
53
+ end
54
+ end
55
+ end