package_data_skill.py reports success with an empty ZIP under .claude
Summary
On main at 95bdacc803aa5cfdb10f35e5b9fb2d4b11100133, package_data_skill.py reports success but creates an empty ZIP when the source skill is beneath a dot-prefixed parent directory such as .claude/skills.
Steps to reproduce
- Create two identical valid skill trees at
visible/acme-analyst/and.claude/skills/acme-analyst/. Each has aSKILL.mdbeginning with this frontmatter and areferences/metrics.mdfile:
---
name: acme-analyst
description: Test data skill
---
- From the repository root, package each tree and inspect the ZIP entries:
python data/skills/data-context-extractor/scripts/package_data_skill.py visible/acme-analyst out-visible
python data/skills/data-context-extractor/scripts/package_data_skill.py .claude/skills/acme-analyst out-hidden
python -c "from zipfile import ZipFile; print(ZipFile('out-visible/acme-analyst.zip').namelist()); print(ZipFile('out-hidden/acme-analyst.zip').namelist())"
Observed behavior
Both packager runs print Validation passed and Successfully packaged and exit 0. The visible tree produces a ZIP containing SKILL.md and references/metrics.md (2 entries). The .claude/skills tree produces a valid ZIP with 0 entries.
Expected behavior
Both archives should contain the two skill files. Packaging should not report success if it added no files.
Cause and verification
The hidden-file filter checks file_path.parts, which includes parent directories outside the skill. The .claude ancestor therefore causes every file to be skipped. I reproduced this on Windows with Python 3.14.8 using byte-identical skill contents. In an isolated copy, checking path parts relative to the skill directory produced two-file archives from both locations and still excluded a hidden file inside the skill.
Hi, I would like to work on this issue.
I understand that the hidden-file filter checks the full file path, causing all files under ".claude/skills/" to be skipped because ".claude" is a hidden directory.
I propose fixing the filter so that hidden-file checks are performed relative to the skill directory. This should preserve the exclusion of hidden files inside the skill while allowing valid files in skills stored under hidden parent directories to be packaged correctly.
I will also add regression tests to verify that:
- Skills under ".claude/skills/" produce ZIP archives containing the expected files.
- Hidden files inside a skill remain excluded.
- Packaging does not report success when the archive contains no files.
Please let me know if I can proceed with this approach.
Thanks for offering to help. I reported the issue, and the maintainers handle upstream changes. The repo's external PR workflow is set up to close non-member PRs that change plugin code, so please check with a maintainer before investing time in a PR.
A non-patching workaround verified against current main e91a1345: copy the skill to a staging directory whose resolved ancestors contain no dot-prefixed components, then run the same data packager there. This preserves this packager's existing hidden-file exclusion policy.
For example (replace the source and script paths; output stays in a new temporary directory):
stage=$(mktemp -d /tmp/data-skill-stage.XXXXXX)
cp -R /absolute/path/to/acme-analyst "$stage/acme-analyst"
python3 /path/to/package_data_skill.py "$stage/acme-analyst" "$stage/out"
python3 -m zipfile -l "$stage/out/acme-analyst.zip"
In a synthetic fixture on macOS/Python 3.12, the visible tree and staged copy both produced SKILL.md + references/metrics.md with identical payload bytes; packaging directly under .claude/skills returned 0 with zero entries. An internal .local-only sentinel remained excluded in both successful data-packager outputs. The staging recipe leaves the original skill unchanged; keep the temporary output until copied/verified.
One caution about switching packagers: Anthropic skills' skill-creator packager at 2c5958e did package the same hidden-parent tree, but also included the internal .local-only file. Its exclusion policy is different, so it is not a policy-equivalent drop-in workaround. A replacement needs an explicitly reviewed release payload, especially if local-only files are present.
Does staging outside the hidden parent restore the expected archive for your setup? No private archive is needed to confirm. I checked the external-PR policy and have not opened a competing code PR.
Disclosure: this reproduction, comparison and comment were authored with Codex under my account. These are synthetic maintainer-side checks, not a report of exposed user data.
Executable follow-through: synthetic reproduction and recovery runner, tested against the pinned upstream script on Linux/macOS/Windows with Python 3.10 and 3.12 (CI). The source download was also run in a fresh local directory. I maintain the linked harness; it is optional—the standard-library ZIP listing above is sufficient to detect an empty archive.
Thanks for checking. I tested the staging workaround on Windows with Python 3.12.14 against e91a1345. Packaging the synthetic skill directly under .claude/skills exited 0 but produced an empty ZIP; copying it to a staging path with no dot-prefixed resolved ancestors produced both SKILL.md and references/metrics.md, with bytes matching the original files. An internal .local-only file remained excluded.
This confirms the workaround for the synthetic fixture used in my report; I haven’t tested an actual user skill or other platforms in this run. AI-assisted testing.