Skip to content

fix(skills): ignore hidden directories when walking skill files#3177

Draft
adboio wants to merge 1 commit into
mainfrom
posthog-code/skill-bundle-ignore-hidden-dirs
Draft

fix(skills): ignore hidden directories when walking skill files#3177
adboio wants to merge 1 commit into
mainfrom
posthog-code/skill-bundle-ignore-hidden-dirs

Conversation

@adboio

@adboio adboio commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Problem

A user hit Local skill bundle contains more than 1000 files when invoking a custom skill on a cloud run. Two issues behind it:

  • The bundler walks the entire skill directory tree and its ignore list was only .DS_Store / .git / node_modules / __pycache__, so hidden directories like .venv (easily 5–20k files) counted toward the limit and got uploaded.
  • The error named neither the offending skill nor a remedy — and the offender can be a skill pulled in via dependencies: that the user never tagged.

Changes

  • Skip hidden directories when walking skill files, via a shared isIgnoredSkillEntry predicate. This extends the existing findSkillDirs rule that hidden dirs are never skills. Hidden files (.gitignore) still count.
  • Apply the same predicate in listSkillFiles, so the skill-contents UI and team-skill exports match what a cloud bundle uploads (previously that walker skipped nothing — publishing a team skill would ship a .venv to the skills store).
  • The bundle limit errors now name the skill, its resolved path, and what to do: Skill "alpha" (/home/u/.claude/skills/alpha) contains more than 1000 files. Cloud runs upload every file in the skill folder, so move data and build artifacts out of it.

Left alone: the 1000-file cap itself (only the PostHog server's 30MB artifact size limit is a real platform constraint; raising/dropping the count cap can be a follow-up if legit >1000-file skills show up), and the marketplace install direction (unpacking downloaded archives stays a faithful copy).

Testing

  • New skill-bundler.test.ts unzips real bundles: hidden dirs and junk excluded while hidden files and nested content survive; 1100 files inside .venv bundle fine (the reported scenario); the limit error names skill and path.
  • Matching listSkillFiles case in skill-discovery.test.ts.
  • All 90 workspace-server skills tests pass; tsc --noEmit and Biome clean.

🤖 Generated with Claude Code

Cloud skill bundling walked every file under a skill directory, so a
.venv or similar hidden directory inside the skill folder blew past the
1000-file bundle limit with an error that named neither the skill nor
the cause.

Skip hidden directories (and the existing junk names) via a shared
predicate used by both the cloud bundler and listSkillFiles, so the
skill contents UI and team-skill exports match what a bundle uploads.
Hidden files like .gitignore still count. The bundle limit errors now
name the skill, its path, and the remedy.

Generated-By: PostHog Code
Task-Id: 78d26270-9485-4378-bfc0-f35b27af7bbf
@trunk-io

trunk-io Bot commented Jul 6, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 0f3162c.

@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(skills): ignore hidden directories w..." | Re-trigger Greptile

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