Repository navigation
feat: add link and unlink for followed source folders - #421
Conversation
follow_source_links only follows a link the user made by hand, so the guards (source or parent, sync target overlap, link chain) surfaced in doctor only after the link existed, and Windows users had to pick between a junction and mklink /D themselves. link checks the prospective target with Follow.Allow, which shares the guard rules and reason strings with the walk, before creating a junction on Windows or an absolute symlink elsewhere. It warns when the target is not a git checkout and leaves follow_source_links alone unless --enable is given. unlink moves only the link entry to trash, the same way uninstall removes a first-level link, so the target is never touched and trash restore undoes it. internal/sourcelink holds both operations so the dashboard can call them too. Refs #419
…er action follow_source_links only follows a link that already exists, and the docs told users to create it with ln -s or mklink /J. The guards then surfaced only in doctor, after the link existed. Now that skillshare link checks the target first and picks a junction on Windows, the docs point at the command and keep the manual way as a note. Adds command pages for link and unlink, quick-reference and index rows, the dashboard Link folder sentence, all four translations, and the built-in skill guidance. Refs #419
Let dashboard users add local skill folders through the shared source-link guards without creating links by hand. Keep follow_source_links opt-in in the current mode and expose link removal through the API with recoverable trash semantics. Cover handler behavior, request shapes, dialog errors, and all dashboard locales, and document the endpoints in the API audit topic.
Expose policy-resolved first-level link identity on listed skills so linked groups can be distinguished from ordinary folders without another request. Add a confirmation that preserves the target folder and explains trash recovery, then refresh the dashboard after unlinking.
Match tracked repository affordances without offering whole-repo uninstall for followed user checkouts. Resolve checkout identity for Update repo, keep linked skill uninstall scoped to the selected skill, and explain target preservation, sync impact, and trash recovery before destructive requests.
Keep followed checkout updates in the Updates tab and expose unlink as a single quiet icon in group headers. Remove unused checkout metadata and linked-group menus while preserving the confirmation and single-skill uninstall flows.
The unlink icon at rest read as a broken link, not as the linked folder it marks. Show the link icon and swap to the unlink icon in the danger color only on hover or keyboard focus, so the row says what it is and the action appears where the pointer is.
The link icon and the muted target path already say that a group is a followed link, so the extra `linked` tag only repeated the same fact on the row. Remove it from the list and card headers, the tree row and the detail pane, and delete the now unused locale key.
Resolve followed skills with the discovery policy before applying tracked-repo restrictions or prefix-based batch routing. This lets dashboard uninstall move only the selected skill from a followed checkout while retaining managed-repo protection and logical trash restore paths. Add single and batch handler regressions for global and project modes, skipped links, and tracked-repo members; document the API behavior.
The dashboard section of the ui reference only covered Link folder. Add the final unlink design so the docs match the shipped UI: the linked group row, the hover icon button with confirmation, trash restore, single-skill uninstall inside a link, and the absence of repo actions.
Pass the current global or project follow policy to skill trash restore so the dashboard matches CLI behavior and can restore into followed link targets. Keep disabled-link refusals and agent restores unchanged, and cover both scopes and link naming styles with handler regression tests.
Prefer exact skill flat names and reject ambiguous basename fallbacks in both uninstall handlers. Route explicit managed repositories before basename lookup so a followed checkout cannot hijack removal of a root skill or repository.
Share policy-based link identity enrichment between skill list and detail responses. Use that identity in the detail action menu and shared uninstall dialog so followed checkout members keep single-skill confirmation and submit their own flat name.
Stop parsing mode and command options after -- so valid link names and relative paths beginning with a hyphen can be addressed. Document the unlink form in every command locale and verify that -g and -p after the terminator remain names.
Use the existing link detection and target resolution helpers so correct directory junctions pass the source-link core, API, and CLI tests. Accept the Windows junction kind while retaining symlink coverage and target identity checks without platform skips.
Replace the removed linked badge description with the link icon, muted target path, and hover or focus unlink icon used by the dashboard. Keep the tree detail-pane behavior explicit.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 53303ebe8a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A root skill discovered through a followed source link occupies the link entry itself. Moving that entry to trash silently unlinks every nested skill instead of removing one skill. Share the root-skill guard across single and batch API handlers and CLI uninstall, report the unlink action clearly, and preserve explicit unlink and nested skill removal.
The feature map omitted link and unlink, leaving their existing reference pages undiscoverable from the command overview. List both commands in their workflow groups and derive the displayed total from the current 37 command pages, excluding the reference index.
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: abbd792299
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Dry runs returned before the linked-root guard, so text preview claimed a trash move and JSON listed a root-skill link as removed even though real execution refused it. Run the existing non-mutating move check before either preview and extend the root-link fixture to verify text and JSON refusals without claiming removal.
The linked-root skill guard makes uninstall refuse some first-level links, so generic link-removal instructions could direct users to a command that fails. Point configuration, FAQ, unlink reference, and built-in skill guidance to unlink or the dashboard Unlink action, preserving target folders for checkout and root-skill links across all five documentation locales.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3265259d1a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Source links disappeared from the dashboard when discovery found no skills, leaving empty or unavailable folders without an Unlink action. Return first-level links independently with their follow-policy availability and preserve their groups in every skills view, including empty unlink confirmations. Cover empty and dangling inventory, disabled following, and empty-link removal in list, cards, and tree views; document the API field and rendering.
… into runkids/419-link-unlink # Conflicts: # internal/sourcewalk/follow_test.go # skills/skillshare/references/TROUBLESHOOTING.md
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a280a20f8c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
# Conflicts: # internal/server/handler_skills.go # skills/skillshare/references/TROUBLESHOOTING.md # website/docs/reference/commands/ui.md # website/docs/reference/targets/configuration.md # website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/ui.md # website/i18n/ja/docusaurus-plugin-content-docs/current/reference/targets/configuration.md # website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/ui.md # website/i18n/ko/docusaurus-plugin-content-docs/current/reference/targets/configuration.md # website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/ui.md # website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/targets/configuration.md # website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/ui.md # website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/targets/configuration.md # website/src/data/featureMap.ts
|
@codex review |
macOS temp directories live under /var, a symlink to /private/var, so EvalSymlinks on the created link returns the /private form while the test compared it with the raw t.TempDir() path. Canonicalize the expected path as well so the integration test passes on macOS runners.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9db36b472a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
link --enable created the link, logged success, and only then wrote the config; a failed config write left a link discovery ignores behind a logged success, and a retry failed with "already exists". Enable before logging and remove the fresh link when enabling fails so the command, the filesystem, and the operation log agree.
Standalone source links were added to every grouping regardless of the active search or filters, so a query that matched nothing rendered the links as zero-skill groups instead of the no-match state with its Clear filters action. Links have no skills to match, so they are shown only while no filter is active.
sourceLinks were built before discovery ran, so a target readable at its root whose subtree failed during traversal stayed available: true with no warning while sourceLinkWarnings already reported it as incomplete. Build the items after discovery and treat a recorded skip as unavailable.
|
@codex review |
The write ratchet flags raw os writes below the skills source; the rollback added for a failed --enable removed the fresh link with os.Remove. Go through sourcefs.Unlink so only the link entry goes and the boundary stays enforced.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 294c332484
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
POST /api/source-links with enable: true left the new link in the source when the config could not be saved, so the dialog reported a failure the filesystem did not match and a retry failed with "already exists". Share one sourcelink.Discard rollback between the CLI and the handler.
The developer rule still equated Remove with uninstall <link>, which is refused when the linked folder itself is a skill.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 294c332484
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A followed checkout whose root is a skill is classified as a tracked repository, so a dirty checkout hit the uncommitted-changes preflight and was told to retry with --force before the linked-root guard ran. Run the guard right after target validation for every mode so the answer is always "use unlink".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f4a466eed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ame values link -h loaded the config first, so it failed with "config not found" without one and, with --project, could create .skillshare files just to print help. Detect help among the option arguments before loading the scope. Pass --name as a value flag to parseModeArgs so "--name -g" no longer selects global mode (#422).
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d5776ef79
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| func cmdLink(args []string) error { | ||
| start := time.Now() | ||
| if wantsHelp(optionArgs(args)) { |
There was a problem hiding this comment.
Skip
--name values when detecting help
When the requested link name is -h or --help, this pre-scan mistakes the value of --name for an actual help flag and exits successfully without creating the link. Both names pass sourcelink.checkName, and the later parser accepts option-looking --name values (as it now does for -g and -p), so help detection should skip the token following --name while still handling genuine help before loading the scope.
Useful? React with 👍 / 👎.
Closes #419. Stacked on #417 (
runkids/274-follow-source-links); merge that first.What
Adds the two commands that create and remove the link
follow_source_linksfollows, plus the same actions in the dashboard.skillshare link <path> [--name N] [--enable] [-p|-g]creates a symlink (junction on Windows, no Developer Mode needed) directly under the skills source, named_<folder>by default. It runs the same guards as discovery (source root or parent, overlapping a sync target, unreadable target) and refuses withcannot link <path>: <reason>;--enableturnsfollow_source_linkson.skillshare unlink <name> [-p|-g]moves only the link to the trash, sotrash restore <name>undoes it. Both accept--before a name that starts with-.POST /api/source-links({path, name?, enable?}→{path, target, kind, warning}) andDELETE /api/source-links/{name};GET /api/resourcesand the single-skill detail carrylinkName/linkTarget, resolved through the follow policy (never by the_prefix).follow_source_linkscheckbox while it is off). A linked folder is one group with the link icon, the target path and an icon-only button that turns into Unlink on hover and opens a confirm dialog; the tree detail pane gets a secondary Unlink. Linked groups have no Update repo / Uninstall repo, and the Updates tab leaves them alone (feat: follow first-level source links (follow_source_links) #417)._reponame is routed as a repo before any basename lookup, and an ambiguous basename is refused.link,unlink, the dashboard section ofui, configuration, FAQ, quick reference, source-and-targets, the built-in skill, and the four translations.Verification
make checkin the devcontainer (unit, integration, UI tests, lint, build) and the five-language website build pass on the rebased head.Follow-ups
link --namewith a value of-g/-pis read as the mode flag (pre-existing argument parsing); not changed here.