Skip to content

proposal: install local path as symlink (--link flag) - #207

Closed
hhh2210 wants to merge 1 commit into
runkids:mainfrom
hhh2210:proposal/206-install-link
Closed

hhh2210 wants to merge 1 commit into
runkids:mainfrom
hhh2210:proposal/206-install-link

Conversation

@hhh2210

@hhh2210 hhh2210 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)

Linked Issue

Closes #206

Summary

App-bundled skills silently fall behind after app updates because skillshare install <local-path> copies files rather than creating a symlink.

Concrete example: Surge for macOS ships an authoritative skill at /Applications/Surge.app/Contents/Resources/Skills/surge. After installing, the skillshare copy diverges from the app bundle on every Surge update. The only fix today is re-running install --force or manually placing a symlink in the source directory — both bypass skillshare's tracking.

This proposal adds a --link flag to install for local paths. Instead of copying, skillshare places a symlink in the source tree so skill content always reflects the live path.

skillshare install --link /Applications/Surge.app/Contents/Resources/Skills/surge
# source tree: ~/.config/skillshare/skills/surge → /Applications/.../surge

See proposals/206-install-link.md for the full design including CLI surface, metadata, adjacent-command behavior, and open questions.

Checklist

  • I've read CONTRIBUTING.md
  • Tests included and passing (make check) — proposal only, no code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

App-bundled skills (e.g. Surge's built-in skill shipped inside the .app
bundle) silently fall behind after each app update because skillshare
install copies rather than links. Proposes a --link flag for local paths
so the source-tree entry is a symlink and skill content stays live.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copilot AI review requested due to automatic review settings June 7, 2026 13:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a feature proposal describing a new skillshare install --link flag to install local skills via symlink instead of copying, aimed at keeping app-bundled skills (e.g., Surge) automatically up-to-date.

Changes:

  • Introduces a new proposal document for symlink-based installs (--link / -L) for local-path sources.
  • Specifies expected behavior across adjacent commands (list, check, update, uninstall, doctor, sync).
  • Outlines scope, touch points, and open questions (config persistence, Windows behavior, collect semantics, name override).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +61 to +67
| Command | Linked skill behavior |
|---|---|
| `skillshare list` | Show `→ /path/to/target` instead of `(local)` to make the live link visible |
| `skillshare check` | Report "externally managed — link is live" when the target path exists |
| `skillshare update` | Skip with "externally managed" message (the link is always current) |
| `skillshare uninstall` | Remove the symlink; do **not** touch the target directory |
| `skillshare doctor` | Warn when a linked target no longer exists (broken symlink) |

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a feature proposal to add a --link flag to skillshare install, allowing local paths to be installed as symlinks rather than copied. The review feedback suggests several design improvements and clarifications, including visually highlighting broken symlinks in the list command, clarifying how sync handles broken links and target symlink modes, and utilizing directory junctions on Windows to avoid privilege escalation issues.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.


| Command | Linked skill behavior |
|---|---|
| `skillshare list` | Show `→ /path/to/target` instead of `(local)` to make the live link visible |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Handling Broken Links in skillshare list

If the symlink is broken (i.e., the target directory was deleted or moved), skillshare list should visually indicate this (e.g., by appending a [broken] suffix or displaying the path in red/dimmed text). This will make it immediately obvious to the user that the link is inactive without needing to run skillshare doctor.


### Sync behavior

`skillshare sync` should follow the symlink when propagating to targets, not copy the symlink itself. This matches how the current flow works today when users place symlinks manually in the source directory.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Sync Behavior Clarification

It would be beneficial to clarify the behavior of skillshare sync under two specific scenarios:

  1. Broken Symlinks: If the source symlink is broken (the target path no longer exists), how should skillshare sync handle it? It should ideally skip the skill and emit a warning rather than failing the entire sync operation.
  2. Target Symlink Mode: If a target is configured with mode: symlink, should the symlink created in the target directory point to the skillshare source directory symlink (e.g., ~/.config/skillshare/skills/surge) or resolve to the ultimate original path (e.g., /Applications/...)? Pointing to the source symlink is generally preferred to maintain the indirection, but this should be explicitly specified.


1. **Config persistence** — Should `--link` be a CLI-only flag per invocation, or should it be persisted in `config.yaml` (e.g. as `mode: link` at the skill level) so that `skillshare install` (no args, from config) recreates the symlink? A config-level key would make the intent declarative and reproducible across machines.

2. **Cross-device / Windows** — On Windows, directory symlinks require elevated permissions or Developer Mode. Should skillshare fall back to a junction point, emit a clear error, or document the limitation? (macOS and Linux have no restrictions.)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Windows Junction Fallback

On Windows, directory symlinks indeed require elevated privileges (unless Developer Mode is enabled), whereas directory junctions (junctions) do not.

Since skillshare already has some Windows junction support helper functions (as seen in internal/utils/link.go), the implementation should default to or fall back to creating a directory junction on Windows when --link is used. This ensures a seamless developer experience without requiring users to run the CLI as Administrator.

@salmonumbrella

Copy link
Copy Markdown
Contributor

@runkids this and #181 would be amazing!

@hhh2210

hhh2210 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Following up here — sounds like there's some demand for this (thanks @salmonumbrella). @runkids let me know if you'd like changes to the --link flag approach, happy to adjust.

@salmonumbrella

Copy link
Copy Markdown
Contributor

@hhh2210 opened hhh2210#1 into your branch with a suggested revision — it aligns the proposal with skillshare's actual persistence model (per-source .metadata.json + project config replay, no global registry), adds commit/rollback + locking semantics, and narrows v1 scope. If you merge it, this PR updates in place and stays yours — take whatever's useful!

@runkids

runkids commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Thanks for the detailed proposal, @hhh2210, and thanks @salmonumbrella for the revision. App-bundled skills drifting after an app update is a real problem, and I'd like to solve it. Before we commit to --link, though, I tested both the premise and the current behavior on main (b789042) in a clean environment, and the results point toward a smaller change.

1. A symlinked skill in the source directory is not discovered today

The proposal says sync should "match how the current flow works today when users place symlinks manually in the source directory." In practice, a symlinked skill directory inside the source is skipped entirely:

source/
  control/                                  # regular skill
  surge -> /tmp/pr207-probe/surge           # symlink to a dir with a valid SKILL.md

$ skillshare list --json   -> control, skillshare        (no surge)
$ skillshare sync          -> Discovered 2 skills
$ ls ~/.claude/skills      -> control, skillshare        (no surge)
$ skillshare doctor        -> no warning about surge

Discovery resolves a symlink only at the source root (internal/sync/discover_walk.go); filepath.Walk does not descend into symlinked children. So --link would also need changes to discovery, list, doctor, and backup (which documents that symlinked skills are not followed). The linked content would also change without passing through the install/update audit gate, and an absolute symlink breaks when the source directory is synced to another machine via git.

2. Local installs can already be refreshed with update

install <local-path> records source and type: local in .metadata.json, and update re-copies from that path and runs the audit:

$ skillshare install /tmp/pr207-probe/copied
# edit /tmp/pr207-probe/copied/SKILL.md (v1 -> v2)
$ skillshare update copied     -> Audit: CLEAN, content is now v2
# edit again (v2 -> v3)
$ skillshare update --all      -> "Updating 1 standalone skill(s)... Updating copied", content is now v3

So for Surge, this already works today:

skillshare install /Applications/Surge.app/Contents/Resources/Skills/surge
# after Surge updates:
skillshare update surge && skillshare sync

The actual gap

The missing piece is detection. skillshare check reports a local skill as Local skill (no remote source) even after its source path has changed, so users never learn they should run update.

Plan

Instead of --link, I'm going to take this on directly:

  1. check detects drift for local sources. For type: local entries, hash the files at the recorded source path and compare them with the stored file_hashes; report "update available" on a mismatch, and a clear error if the path no longer exists.
  2. Docs. Document that local installs can be refreshed with update, using the app-bundled case as the example.

This keeps the audit, works the same on Windows (no symlinks or junctions), and leaves backup, git sync, and copy-mode targets unaffected.

I'll keep #206 open and link the implementation PR to it, then close this proposal once that lands. Thanks again @hhh2210 for the clear write-up and the Surge example, which made the gap easy to pin down, and @salmonumbrella for pushing on it.

@runkids

runkids commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Closing in favor of #334, now merged. skillshare check now reports when the files at a local install source change, so app-bundled skills such as Surge can be refreshed with skillshare update <name>. See Local-Path Installs in the docs once the site is redeployed. Thanks again @hhh2210 and @salmonumbrella!

@runkids runkids closed this Oct 2, 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.

Feature: install local path as symlink so app-bundled skills stay in sync automatically

4 participants