Commit Graph
25 Commits
Author SHA1 Message Date
Willie c040917bc7 fix(security): enforce credential and filesystem trust boundaries (#861)
Bind provider credentials to canonical or explicitly configured HTTPS origins and preserve that policy across remote consumers. Reject cross-site credentialed reads, linked fallback directories, and discovered-agent writes outside the source; audit staged content before rooted atomic publication.

Add boundary regressions, private Git update coverage, stable cross-platform fixtures, and aligned documentation. Verified the integrated main baseline with all executed CI checks passing.
2026-11-11 23:17:54 +08:00
Rusty Shackleford 71ff2d9e14 fix(discovery): find repository-root .agents/skills (#801)
A repository-root .agents/skills now counts as a skill anchor only when the repository has no other SKILL.md outside .git and target directories, so tracked checkouts that author skills there are discovered, while repos that commit .agents/skills copies keep discovering only their authored skills.

Fixes #800
2026-11-10 16:04:20 +08:00
Willie baf8d0487e test(sourcewalk): keep caller root in follow walk helper
walkEntries replaced its root with the resolved path before calling
Walk and WalkDir, so the follow tests never exercised Walk's own root
resolution on aliased temp dirs such as macOS /var. Resolve only the
base used for relative labels.
2026-10-30 20:26:24 +08:00
star-nebula 86f89bf242 test(sourcewalk): cover Windows resolved roots (#673)
Windows temporary paths can use a spelling that differs from the path returned by filepath.EvalSymlinks. Canonicalize test roots before relativizing callback paths and restore internal/sourcewalk to the windows-test allow-list.
2026-10-30 20:25:45 +08:00
Willie 330114bd6a fix(install): use frontmatter names for generic skill directories (#617)
* fix(install): use frontmatter names for generic skill directories

Resolve meaningful defaults for generic containers while preserving explicit names, tracked paths, existing update destinations, and directory-based source selection. Fall back on unsafe or colliding names to prevent overwrites.

Cover global and project installs, local and Git sources, naming overrides, tracked reports, collision safety, and updates. Closes #616.

* fix(install): preserve names during source-based updates

Resolve source-based updates against existing metadata before choosing destinations. Reject ambiguous or colliding update targets before writes, and reserve case-insensitive discovery names across filesystems.

Add global/project regressions for local and Git source updates, legacy destinations, grouping, and upstream-added collisions.

* fix(install): retain update ownership and selection checks

Only allow a metadata-verified same-source update to bypass destination conflicts. Reject occupied fallback destinations for both local and Git sources unless overwrite is explicitly forced.

Resolve destinations after skill selection so unrelated conflicts do not block filtered updates. Cover cross-source and unmanaged destinations, selected/excluded updates, and collision aborts in global and project modes.
2026-10-23 20:04:45 +08:00
Rusty Shackleford d23a44aec9 refactor(projects): share safe dashboard and CLI operations (#602) 2026-10-23 02:07:54 +08:00
Willie cf5783ee88 fix(backup): reclaim abandoned staging directories safely (#558)
* fix(backup): reclaim abandoned staging directories safely

Interrupted backup copies leave hidden .snapshot-* directories that retention cleanup never discovers. Hold a shared process lock during copies and use an exclusive cleanup lock to reclaim orphaned staging without deleting active work.

Share retention planning with non-mutating dry runs, report busy manual cleanup in the CLI and API, and align dashboard messages and translated docs. Cover process interruption and automatic cleanup with regression tests and an executable E2E runbook.

Closes #556

* fix(backup): address staging cleanup review findings

Keep cleanup reachable for staging-only dashboard backups and disclose abandoned incomplete directory deletion in every confirmation locale. Cover the empty-state confirmation with a regression test.

Read staging entries before a read-only lock probe so first-use dry runs cannot count a newly active writer. Refresh entries only under the acquired lock and classify both backup-root reads in the filesystem guard.

* fix(backup): align cleanup guides and doctor status

Disclose abandoned incomplete directory removal in backup help, completion descriptions, and the daily backup guide with all four translations. Add help and completion regressions so these consumers stay aligned with cleanup.

Keep the doctor Backups row visible when only the persistent lock remains after cleanup, preserving the existing JSON check and covering the lock-only state.

* fix(backup): complete cleanup documentation disclosure

Cleanup reclaims abandoned incomplete directories regardless of retention, so retention-only summaries understated the action. Align the backup synopsis, option table and previews, related workflow guides, built-in reference and all four website translations. Scope the retention defaults to completed snapshots.
2026-10-13 22:42:05 +08:00
Willie 8213a4a385 feat(ui): make shared memory easier to find and read (#537)
* feat(ui): surface existing shared memory on the dashboard

Make shared notes visible through recent updates and direct links, with file timestamps and an introductory state for untouched starters. Keep the dashboard quiet until memory is configured, and preserve access to existing notes when starter files are missing.

* fix(memory): bound dashboard reads and remember preview expansion

Count vault entries from metadata and read at most the two starters and four recent candidates instead of hashing the full vault on dashboard load. Keep incomplete starter states accessible and refresh the overview after source and instruction changes. Remember preview expansion in browser storage and raise the collapsed height to 360px.
2026-10-12 17:34:33 +08:00
Willie d2f5936be9 fix(sourcewalk): never skip the source root as a target dotdir (#514)
SkipTargetDotDir only exempted dotdirs directly under the walk root, never
the root itself. ProjectTargetDotDirs() always contains ".skillshare", so a
source whose basename is a target dotdir (".skillshare", ".claude", ...) had
its first Walk callback return SkipDir. Discovery then saw an empty source:
`skillshare list` returned [] and sync pruned previously managed links.

Exempt path == walkRoot in the shared helper so both callers
(sync discovery and resource skill discovery) are fixed. Nested target
dotdirs are still skipped and first-level ones stay visible.

Fixes #511
2026-10-10 21:43:35 +08:00
Willie 3ec60a3732 fix(doctor): count skills kept by hand in another target's folder
The leak check compared only source skills, so a skill the user keeps
in ~/.claude/skills (which merge mode preserves) passed as harmless,
although OpenCode loads it. Read the writer's folder too and count
entries sync did not put there and OpenCode's own folder lacks.

The wording no longer says these skills are left out by filters, and
the suggestion asks to sync them to opencode, which fits both causes.

Refs #458
2026-10-07 12:58:22 +08:00
Willie 9db36b472a Merge remote-tracking branch 'origin/main' into runkids/419-link-unlink
# 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
2026-10-05 22:49:25 +08:00
Willie 50b6515a16 fix(sourcefs): retain the staged-copy traversal allowance
Keep the existing non-source traversal allowance attached to the recursive staged-copy helper. The walk still reads only incoming content outside the skills source and all destination writes remain anchored by sourcefs.
2026-10-05 22:32:59 +08:00
Willie e7eecffeab Merge remote-tracking branch 'origin/main' into runkids/274-follow-source-links 2026-10-05 21:32:38 +08:00
Willie 064048da89 fix(server): list files from followed skill roots
A symlink passed as a filepath.Walk root is listed as a single file, so root-of-link skills returned files containing only a dot. Reuse the discovery follow policy to resolve the walk root and compute relative file names from it while retaining logical resource paths.

Cover global/project responses and disabled following, update the existing traversal inventory, and document root-of-link file browsing in all website locales and troubleshooting guidance.
2026-10-05 21:31:29 +08:00
Willie a280a20f8c Merge remote-tracking branch 'origin/runkids/274-follow-source-links' into runkids/419-link-unlink
# Conflicts:
#	internal/sourcewalk/follow_test.go
#	skills/skillshare/references/TROUBLESHOOTING.md
2026-10-05 21:19:53 +08:00
Willie df7a6ad73d fix(sourcewalk): preserve inventory on followed traversal failures
Discovery callbacks may ignore filesystem errors after a followed target passes its availability probe. Record these failures in the shared Follow policy before dispatching callbacks so sync and reconciliation preserve entries missing from an incomplete inventory.

Keep ordinary vanished-child races tolerated, while treating loss of the target itself as unavailable. Cover both walkers and merge/copy pruning, and document read failures in the English and translated configuration guidance.
2026-10-05 20:46:45 +08:00
Willie 97446744ff feat(omp): add native Oh My Pi support (#423)
* feat(omp): add native Oh My Pi support

Support OMP skills, instructions, MCP, code hooks and guarded extension selection using its verified native contracts rather than Pi aliases.

Add reviewed marketplace plugin installation, cache-preserving scoped removal and fresh-cache reinstall. Align Pi/OMP extension cards and localize inventory guidance while keeping native ownership and read-only constraints.

Include regression coverage, isolated E2E runbooks, documentation and verification policies. Native plugin updates and unverified runtime platforms remain guarded.

Refs #409

* fix(omp): guard runtime ownership and localize inventory guidance

Native install recursively replaces its runtime destination, and a missing cache manifest could leave the real runtime link installed after removal. Bind and recheck an absent reviewed destination, and recover removal names only from verified scope-local links.

Localize fixed backend reasons and warnings across dashboard locales while preserving paths and external diagnostics. Restore the reviewed source in the existing reinstall fixture and record real native verification.

* fix(omp): allow forgetting natively removed plugins

A different plugin can retain node_modules after native uninstall deletes this installation. When its cache, registration and known runtime state are absent, forget only the stale Skillshare binding instead of demanding runtime-name proof for unrelated files.

Extend the existing removal recovery test with a failing-before-fix case that verifies the binding is dropped and unrelated native lock bytes and plugin files are preserved. make check passes.
2026-10-05 20:36:39 +08:00
Willie 4ae67cbe52 feat(source-links): add link and unlink commands
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
2026-10-05 18:27:12 +08:00
Willie d6162baba0 fix(sourcewalk): resolve junction chains and compare canonical roots
canonicalPath relied on filepath.EvalSymlinks, which since Go 1.23 leaves
a Windows junction component in place. A link whose target is itself a
junction, or sits below one, was followed as the unresolved junction:
the walk saw no descendants while the inventory counted as complete, so
target entries from that link could be pruned, and a sync target spelled
through a junction could evade the overlap guard. Every existing path
component is now resolved hop by hop, and a target that still ends in a
link marks the link unavailable instead of being followed.

The policy also kept the source root as spelled, so a relative global
source was discovered but never resolved for writes or audit. Root,
first-level and Resolve comparisons now use the same canonical absolute
form. Copy and checksum roots get the same one-hop resolution so a
followed junction that is itself a skill no longer trips the cycle guard.
2026-10-05 15:40:51 +08:00
Willie 8092b234b7 fix(source-links): judge overlap before existence and keep doctor from suggesting prune
A link into a sync target that is not created yet was reported as a
missing target, which marked the inventory incomplete and held back
pruning for a link that would never be followed. The where-it-points
guards now run on the link text before the does-it-exist check, so such
a link is an overlap and the run prunes as usual.

doctor reported the dangling target links behind an unmounted source
link as broken symlinks and suggested `skillshare sync` to prune them,
while sync deliberately keeps them. Those links are now a warning that
names the waiting source link and carries no prune suggestion.
2026-10-05 15:27:42 +08:00
Willie e3c9763e1a fix(sourcewalk): resolve junction targets with Readlink on Windows
filepath.EvalSymlinks leaves a Windows junction unresolved since Go 1.23
reports mount points as irregular rather than symlinks, so the follow
policy walked the junction entry itself and discovered no skills behind
it, while doctor and tracked-repo detection (which only Stat the entry)
reported it as followed. Resolve the link text first, then canonicalize
the target.

Add the Windows E2E script that found this: a junction under the skills
source pointing at a checkout, with the drive-away, write-through, and
trash round-trip steps.

Refs #274
2026-10-05 15:14:10 +08:00
Willie 04ee235277 feat(sourcewalk): expose Follow.Resolve for writes through followed links
Operations that write or scan below a followed first-level link need the
real location of a logical path (<source>/_dev-skills/foo). Resolve maps
such a path onto the link's canonical target, reusing the same guards as
traversal, so sourcefs, group walks, trash, and audit roots can share one
answer instead of each re-deriving link identity.

Refs #274
2026-10-05 14:28:00 +08:00
Willie 89fc4fbdf1 feat(sourcewalk): follow first-level source links when enabled
Users link a checkout directly under the skills source (e.g.
skills/_dev-skills -> ~/code/dev-skills) and expect it to behave like any
other first-level entry. sourcewalk resolved only the root, so these links
were invisible to discovery, sync, update, and the dashboard.

follow_source_links (global and project config, default false) enables a
per-operation sourcewalk.Follow policy. Walk, WalkDir, and ReadDir report a
followed link under its own name as a directory and descend into its
target, so names, RelPath, FlatName, SourcePath, tracked-repo detection, and
metadata keys stay logical. Only entries directly under the source root are
followed. The policy is built from config and passed explicitly to every
discovery caller in the CLI, server, and reconcile, so counts agree; the
server keeps a per-instance snapshot refreshed on config load and save
instead of a process-global flag.

A link is skipped, with one warning per operation, when its target is
missing or unreadable, is the source or a parent of it, or overlaps an
active skills target. A missing or unreadable target marks the operation
incomplete: sync then skips pruning and copy-orphan deletion, and reconcile
keeps metadata, so an unmounted drive or a re-clone in progress cannot
erase target entries or install records. A link to an existing file is not
a directory link and stays an ordinary entry; treating it as incomplete
would disable pruning for anyone sharing a file such as .skillignore.

doctor keeps raw link identity: with the key off it still says the link is
not followed and names follow_source_links: true; with it on it reports
followed links and skipped links with the reason.

The raw-walk allowlist gains entries for the policy path in Walk and
WalkDir: the source root walk with a policy, and the walk of a validated
link target whose paths are remapped to the logical link path. Both live
in sourcewalk itself, the package that owns source traversal.

Refs #274
2026-10-05 14:26:09 +08:00
Willie 881d08e52e fix(sync): skip nested target dotdirs when discovering source skills
Installing a repo whose root is a skill copies the whole repo into the
source, including any .claude/skills/ the author keeps for their own
development. Install discovery already skips target dotdirs, but the
source walk used by sync, check, and the dashboard only skipped .git,
so those dev-only skills surfaced as nested skills and were synced to
every target.

Share the skip set through sourcewalk and apply it in both source
walks. Only dotdirs nested below the source root are skipped: host-style
paths directly under the root (.cursor/skills/*) stay visible because
they drive target inference.
2026-10-04 17:11:53 +08:00
Willie 8c60f51b9f feat(source): add the sourcewalk walker and sourcefs write boundary for proposal 274 (#385)
Implements rollout steps 1 and 2 of proposals/274-skillfollow.md. Nothing follows a link or parses .skillfollow yet.

Step 1: doctor reports first-level symlinks and junctions in the skills source as info, in text and JSON, without following them.

Step 2a: internal/sourcewalk owns traversal of the skills source. Thirteen raw walks move onto it with identical behavior, and a go/parser ratchet fails the tests on any new unclassified walk.

Step 2b: internal/sourcefs wraps an os.Root opened at the skills source and refuses any write whose path has a link component. The six write sites the proposal found in review move onto it, including the cross-device copy fallback, and a second ratchet covers raw os write calls. The only behavior change is that an explicit path crossing a link inside the source is refused instead of written through.

Refs #274

Release-As: 0.24.3
2026-10-04 15:15:43 +08:00