refactor(scripts): symlink-aware index generation with local override#370
Merged
refactor(scripts): symlink-aware index generation with local override#370
Conversation
The index generators walk skills/ and agents/ and follow symlinks, so the tracked index files end up containing entries for symlinked directories that are not part of the public tree. Refactor the generator to skip symlinks by default and add an --include-private flag for local workflows that want to see everything. - generate-skill-index.py: skip symlinked directories by default - Add --include-private flag to preserve prior behavior - Add --output flag for writing to an alternate target - generate-agent-index.py: same symlink filtering and CLI flags - routing-manifest.py prefers skills/INDEX.local.json when present - Regenerate skills/INDEX.json, agents/INDEX.json, and routing-tables.md to match the new generator behavior - scripts/README.md: document local workflow with --include-private - scan-negative-framing.py: generalize header comment - toolkit-evolution-cron.sh: instruct cron to use default mode - Tests for symlink exclusion, flag override, output path, and non-symlink preservation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Refactor
generate-skill-index.pyand related index generators to skipsymlinked directories by default. Add an opt-in
--include-privateflagand a separate
--outputtarget so local workflows can maintain anenriched index without committing it.
Why
The generators walk directory trees under
skills/andagents/andfollow symlinks, so the tracked index files end up with entries for
symlinked directories that are not part of the public tree. The public
index should reflect the public tree.
Changes
scripts/generate-skill-index.py: skip symlinks by default,--include-privateflag,--outputflagscripts/generate-agent-index.py: same filtering and CLI flagsscripts/routing-manifest.py: preferskills/INDEX.local.jsonwhen present, fall back toskills/INDEX.jsonskills/INDEX.json,agents/INDEX.json,skills/do/references/routing-tables.md.gitignore: addskills/INDEX.local.json,agents/INDEX.local.jsonscripts/README.md: document local workflowscripts/scan-negative-framing.py: generalize header commentscripts/toolkit-evolution-cron.sh: instruct cron to use default modescripts/tests/test_generate_skill_index.py: new tests for default exclusion, flag override, output path, non-symlink preservationLocal workflow
```
python3 scripts/generate-skill-index.py --include-private --output skills/INDEX.local.json
python3 scripts/generate-agent-index.py --include-private --output agents/INDEX.local.json
```
The router prefers the local file when present, so local runs see all entries while the tracked index stays public.
Testing