Skip to content

fix: download full skill bundle instead of SKILL.md only#1

Merged
girofu merged 1 commit intomainfrom
girofu/fetch-skill-bundle
Apr 23, 2026
Merged

fix: download full skill bundle instead of SKILL.md only#1
girofu merged 1 commit intomainfrom
girofu/fetch-skill-bundle

Conversation

@girofu
Copy link
Copy Markdown
Owner

@girofu girofu commented Apr 23, 2026

Summary

Skills often bundle SKILL.md with references/, scripts/, assets/, templates/, and other subdirs. The install flow previously hardcoded SKILL.md + references/*.md + scripts/*.sh, which silently dropped every other file — skills with .py/.js scripts or unlisted subdirs were installed broken.

This PR makes the installer fetch the entire skill root directory via the git tree API, preserving the subtree layout.

Changes

  • New: scripts/fetch-skill-bundle.sh — parses GitHub blob/tree/raw.githubusercontent.com URLs, enumerates the skill root via git/trees/{ref}?recursive=1, downloads every file preserving layout. Handles SKILL.md URLs by auto-deriving the parent dir.
  • installation-guide.md §3d rewrite — GitHub + Direct URL sources now use tree enumeration instead of hardcoded subdirs/extensions.
  • SKILL.md Step 4 rewrite — walks the full installed tree; verifies bundle completeness against relative paths SKILL.md references.
  • Scan scope + integrity hashing — covers every file in the bundle (via find -type f), not just SKILL.md/references/*.md/scripts/*.sh.
  • Rationalization table + red flags — new entries call out partial-download mistakes.

Test plan

Verified end-to-end against anthropics/skills/skills/pdf (9 Python scripts):

Flow Files installed
Old (hardcoded subdirs) 1 (SKILL.md only)
New (fetch-skill-bundle.sh) 12 (SKILL.md + forms.md + reference.md + LICENSE.txt + 8× scripts/*.py)
  • ShellCheck (--severity=warning) passes for the new script (CI config)
  • SKILL.md frontmatter validation still passes
  • Installer smoke test still passes (bash -n install.sh, py_compile install.py)
  • URL parsing tested: tree/, blob/SKILL.md, raw.githubusercontent.com — all produce identical 12-file output
  • Error paths tested: malformed URL / missing args → exit 2 with JSON error
  • SHA-256 integrity walks the full tree (12 hashes, not just 3)

Breaking changes

None. The change only affects the internal install flow; user-facing skill directory layout is unchanged.

🤖 Generated with Claude Code

Skills often bundle SKILL.md with references/, scripts/, assets/, templates/,
and other subdirs. The install flow previously hardcoded SKILL.md +
references/*.md + scripts/*.sh, which silently dropped every other file.
Skills with .py/.js scripts or unlisted subdirs were installed broken.

- Add scripts/fetch-skill-bundle.sh: parses GitHub blob/tree/raw URLs,
  enumerates the skill root via git tree API, downloads every file
  preserving subtree layout
- Rewrite installation-guide.md §3d (GitHub + Direct URL sources) to use
  tree enumeration instead of hardcoded subdirs/extensions
- Update SKILL.md Step 4 to walk the full installed tree and verify bundle
  completeness against relative paths SKILL.md references
- Update scan scope and integrity hashing to cover every file in the bundle
- Add rationalization/red-flag entries for partial-download mistakes

Verified against anthropics/skills/skills/pdf: old flow produced 1 file,
new flow produces 12 files (SKILL.md + forms.md + reference.md +
LICENSE.txt + 8 Python scripts) with correct scripts/ subtree.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@girofu girofu merged commit 2ef7dfb into main Apr 23, 2026
3 checks passed
@girofu girofu deleted the girofu/fetch-skill-bundle branch April 23, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant