Skip to content

fix: community-index file scoping, nested entries, auto-child deps - #6

Merged
dsiddharth2 merged 1 commit into
mainfrom
fix/community-index-file-scoping
Apr 18, 2026
Merged

dsiddharth2 merged 1 commit into
mainfrom
fix/community-index-file-scoping

Conversation

@dsiddharth2

Copy link
Copy Markdown
Owner

Summary

  • Fix file scoping: packages no longer inherit sibling/child files from shared directories
  • Detect nested agents and commands (agents/**/*.md, commands/**/*.md) — previously only flat agents/*.md was indexed
  • Auto-detect parent→child dependencies for skills with nested entry points

Problem

The builder assigned files using a naive directory prefix match:

  • Commands: installing brainstorm downloaded all 30 command files
  • Agents: installing architect downloaded all 48 agent files
  • Parent skills: c-level-advisor got 128 files including all child packages
  • Nested agents: agents/engineering/cs-senior-engineer.md was invisible (not indexed)

Solution

Added resolveFileOwnership(entryPoints, dirMap) with three categories:

Category Detection Files Assigned
A: Flat shared dir Multiple entries share same dirHint Entry file only
B: Dedicated dir Unique dirHint (skills with own subdir) Own files minus child entry point subtrees
C: Root-level dirHint is root Root dir files only

Added Pass C dependency detection: parent skills automatically list child entry points as required: false dependencies with source: auto-child.

Results (873 packages, up from 846)

Package Before After
brainstorm (command) 3 files 1 file
changelog (command) 30 files 1 file
c-level-advisor (skill) 128 files 8 files + 33 auto-child deps
cs-senior-engineer (agent) MISSING exists (1 file)
systematic-debugging (skill) 11 files 11 files (unchanged)

Test plan

  • Builder runs successfully: node scripts/build-community-index.js
  • Output validated: commands=1 file, agents=1 file, parent skills scoped correctly
  • Nested agents now indexed (27 new packages)
  • Integration test in plug-doer confirms installs work with rebuilt index

Note: Companion PR in plug: multi-file install fix, refs/heads URLs, integration test — dsiddharth2/plug#22

…hild deps

- Fix detectEntryPoints to recursively match agents and commands in
  subdirectories (agents/**/*.md, commands/**/*.md) instead of flat only
- Filter infrastructure files (.gitkeep, README.md, TEMPLATE.md, CLAUDE.md)
  from entry point detection
- Add resolveFileOwnership() with three categories:
  A) Flat shared dirs (multiple entries same dirHint) → entry file only
  B) Dedicated dirs (skills with own subdir) → own files minus child subtrees
  C) Root-level → root dir files only
- Add Pass C auto-child dependencies for parent skills containing child
  entry points (required: false, source: auto-child)
- Use refs/heads/main in rawBaseUrl and plug-deps.json fetch URLs
@dsiddharth2
dsiddharth2 merged commit 4682c8d into main Apr 18, 2026
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