Skip to content

Discover Git checkouts under a managed project for skill sync #953

Closed

Description

@amphetamlne

Problem

I keep several independent Git repositories in one workspace directory. One Skillshare projects entry covers the workspace folder. When I open a child checkout directly in Codex, its skill discovery stops at that checkout's Git root. The skills synced to the workspace folder are missing from the selector. Installing those skills globally also exposes them in unrelated projects.

The current workaround is to register each checkout and worktree with the same targets and filters. Every new clone or worktree needs another registration.

Proposal

Add an optional repository_dirs field to a managed project. It lists workspace-relative directories to search for checkout roots.

projects:
  ~/work/suite:
    targets: [codex]
    repository_dirs: [".", ".worktrees"]
    skills:
      mode: merge
      include: ["team-*"]
  • The project and its discovered checkouts use the existing sync target engine. Preview includes the derived targets.
  • A regular Git checkout and a linked worktree each get the same filtered skills at their own tool paths. Opening a folder inside an enrolled checkout can use the same repository-scoped skills.
  • Explicit projects and targets retain ownership of their paths. Discovery skips linked directories and checkouts with their own Skillshare project configuration.
  • The scope is skills. Agents, MCP servers, hooks and Git ignore rules continue to have separate configuration. Removing discovery leaves the previously written files for deliberate cleanup.

I have a reference implementation on a fork and will link it from the proposal PR. The configuration shape and cleanup behavior are open for maintainer feedback.

Activity

  1. runkids commented on Nov 18, 2026

    @runkids
    Owner

    Thanks for the clear write-up and the reference implementation. The problem is real: Codex stops at each checkout's Git root, so skills synced to the workspace never reach it. I'd rather not scan the workspace on every config load, though. Every command would walk the tree, the targets would change with what's on disk, and turning discovery off would leave files nothing tracks.

    A one-time scan on skillshare project add fits better. A new --scan option would register each checkout it finds below the folder as a normal project with the same settings:

    skillshare project add ~/work/suite --scan . --scan .worktrees \
      --target codex --skills-mode merge --skills-include 'team-*' --sync -n

    Drop -n to apply it. After a new clone or worktree, run it again; skillshare project remove cleans up a checkout the same way it does today. Would that work for you?

  2. runkids commented on Nov 18, 2026

    @runkids
    Owner

    A small clarification on the example: ~/work/suite is already registered in your setup, so --scan would leave that entry as it is and only add the checkouts it finds below it. project add on an existing root with the same settings is already a no-op, and different settings point you to project edit. A worktree that shares a folder name with another checkout, such as .worktrees/app-a next to app-a, would need a distinct name so the two projects don't collide.

  3. runkids commented on Nov 18, 2026

    @runkids
    Owner

    To make the proposal concrete, here is what it would do to config.yaml. Say the workspace looks like this:

    ~/work/suite/
    ├── app-a/             Git checkout
    ├── app-b/             Git checkout
    ├── docs/              plain folder, skipped
    └── .worktrees/
        └── app-a-fix/     linked worktree of app-a
    

    Before, only the workspace is registered:

    projects:
      ~/work/suite:
        targets: [codex]
        skills:
          mode: merge
          include: ["team-*"]

    Running the command without -n:

    skillshare project add ~/work/suite --scan . --scan .worktrees \
      --target codex --skills-mode merge --skills-include 'team-*' --sync

    After, each checkout is an ordinary entry, exactly as if you had added them one by one:

    projects:
      ~/work/suite:
        targets: [codex]
        skills:
          mode: merge
          include: ["team-*"]
      ~/work/suite/app-a:
        targets: [codex]
        skills:
          mode: merge
          include: ["team-*"]
      ~/work/suite/app-b:
        targets: [codex]
        skills:
          mode: merge
          include: ["team-*"]
      ~/work/suite/.worktrees/app-a-fix:
        targets: [codex]
        skills:
          mode: merge
          include: ["team-*"]

    --sync then links the team-* skills into each checkout's .agents/skills/. If the worktree were named .worktrees/app-a instead, it would clash with app-a, so its entry would carry a name such as name: app-a-worktree. There is no new field and no scan marker, so project edit and project remove work on each entry as usual. With projects_storage: machine-local, the same entries go to this machine's project registry instead of config.yaml.

  4. amphetamlne commented on Nov 18, 2026

    @amphetamlne
    Author

    Yes, this would work for me as a first version. Thanks for the concrete example. Ordinary project entries and machine-local storage fit my setup, and I can rerun the scan after creating a clone or worktree.

    Could a rescan skip child checkouts that already have their own settings and still register the new ones in the same run? It would also help if the scan could assign a stable, distinct name automatically when a checkout and a worktree share a folder name. I use that layout, so both details would make the rescan easy to automate locally.

  5. runkids commented on Nov 18, 2026

    @runkids
    Owner

    Thanks for the quick reply. Both make sense, and I'd build them in from the start. --scan would only add entries. A checkout that is already registered, with the same or different settings, or that has its own .skillshare/ stays as it is and shows up as skipped with the reason, while new ones are registered in the same run, so it is safe to call from a script.

    Rerunning the scan: new checkouts are registered, existing ones are kept or skipped with the reason

    When two checkouts share a folder name, the new one is named from its path under the workspace, so .worktrees/app-a becomes worktrees-app-a. The name is written to the config, so later scans keep it. If that name is also taken, the -n preview reports it instead of adding a number.

    Naming checkouts that share a folder name

    We'll take on the implementation in skillshare and follow up here.

  6. self-assigned this
    on Nov 18, 2026
  7. added
    feature
    on Nov 18, 2026
  8. amphetamlne commented on Nov 18, 2026

    @amphetamlne
    Author

    Thanks for taking this on! I closed the proposal PR (#954) and will test --scan on Windows once it is released.

  9. runkids commented on Nov 18, 2026

    @runkids
    Owner

    Thanks for waiting, and for the details on rescans and naming. skillshare project add <root> --scan DIR is out in v0.30.12 (#958). It registers each checkout as its own project, keeps or skips the ones already set up with the reason, and names a clashing worktree from its path. The dashboard's Add project dialog can do the same, with a review before anything is written.

    Since you planned to try it on Windows, please open a new issue if anything behaves differently there.

  10. added a commit that references this issue on Nov 20, 2026
    52744e2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions