Commit Graph
1281 Commits
Author SHA1 Message Date
Willie ce76f58393 fix(doctor): read metadata.version + harden frontmatter delimiter parsing
- doctor: replace inline frontmatter parser with version.ReadLocalSkillVersion
  which correctly reads nested metadata.version (fixes #119)
- frontmatter_write: use TrimRight instead of TrimSpace for --- delimiter
  so indented --- inside YAML block scalars is not mistaken for end marker
- Update changelog and website changelog for v0.18.7
2026-04-04 17:05:22 +08:00
Willie 4fbee521ce fix(server): batch targets folder matching + reduce mutex scope
- Fix folder trailing slash bug: filepath.Clean now normalizes input
  before matchesFolder comparison (e.g. 'frontend/' → 'frontend')
- Narrow mutex scope in handleBatchSetTargets: RLock for config read,
  no lock during DiscoverSourceSkillsAll, Lock only for write loop
  (matches existing handleSetSkillTargets pattern)
- Defensive filepath.Clean on cleanEmptyParents inputs
- Add TestMatchesFolder unit test and trailing slash handler test
2026-04-04 17:05:22 +08:00
Willie a8f3aaf62f fix(ui): resolve TypeScript build errors in Docker sandbox CI
- Add explicit undefined initializer to useRef<T>() for React 19 compat
- Remove unused isProjectMode from DashboardPage (dead after refactor)
- Remove unused queryClient/toast from SkillsTable (moved to useSkillActions)
2026-04-04 17:05:22 +08:00
Willie 1057b1449c docs: add v0.18.7 changelog, release notes, bump skill version
Folder-level target display, bulk editing, right-click context menu,
table view redesign, optimistic updates, and config panel fix.
2026-04-04 17:05:22 +08:00
Willie 4e20a71e10 feat(ui): target display + context menu actions across all 3 skill views
Grouped view:
- FolderNode target aggregation (bottom-up O(n) computation)
- Target badges on folder rows (uniform/mixed) and skill rows
- Right-click context menu for batch (folder) and single (skill) editing

Grid view:
- Target badges on skill cards
- Right-click context menu for single skill editing

Table view:
- 'Available in' column with inline Select dropdown
- Simplified to 5 columns (merged Path/Source into Name)
- Actions column (⋯) with flat menu items
- Page size persisted in localStorage

All views:
- Shared useSkillActions hook with optimistic cache updates
- Context menu actions: Available in, View Detail, Enable/Disable, Uninstall
- ConfirmDialog for destructive actions
- Hover-matching highlight on active context menu item
- Clickable source globe icon linking to repo
- Dismissible right-click tip banner with playful theme

Config page:
- Panel wrapper overflow-visible when expanded (fixes dashed border clipping)

Closes #115.
2026-04-04 17:05:22 +08:00
Willie feaf086e91 feat(ui): add SkillContextMenu + TargetMenu with submenu pattern
SkillContextMenu: extensible right-click context menu with:
- Submenu support (hover-expand with 180ms intent delay)
- Portal rendering (escapes transform containing blocks)
- Dismiss overlay (prevents click-through to Links)
- Scroll/Escape close, viewport collision detection
- Spring pop + slide animations, playful theme integration

TargetMenu: convenience wrapper adding 'Available in...' submenu
with extraItems prop for additional actions (Uninstall, etc).

CSS: ss-context-menu + ss-context-submenu classes with playful
theme overrides (wobble radius, hard shadow, dashed borders).

Part of issue #115.
2026-04-04 17:05:22 +08:00
Willie 59e6e7137d feat(ui): add batchSetTargets and setSkillTargets API client methods
Part of issue #115.
2026-04-04 17:05:22 +08:00
Willie 9abd9af71f feat(server): add SetFrontmatterList utility + batch/single target endpoints
New utility: SetFrontmatterList() writes/removes YAML list fields
in SKILL.md frontmatter with dot-notation support (metadata.targets).
Normalizes legacy top-level targets field. Preserves body content.

New endpoints:
- POST /api/skills/batch/targets — set targets for all skills in folder
- PATCH /api/skills/{name}/targets — set target for single skill
Both use s.mu.Lock() for safe concurrent access.

Includes 15 unit tests covering set/remove/traverse/root-only/not-found.
Part of issue #115.
2026-04-04 17:05:22 +08:00
Willie 96a084a4f4 docs: add v0.18.7 changelog, release notes, bump skill version 2026-04-04 17:05:22 +08:00
Willie 115edf3f24 fix(server): correct project-mode gitignore path + prevent registry prune basename collision
P2-1: handleUninstallRepo and handleBatchUninstall used s.cfg.Source for
gitignore removal, but project-mode installs write to .skillshare/.gitignore
with a "skills/" prefix. Add gitignoreDir() helper that returns the correct
base directory per mode, and prefix entries in project mode.

P2-2: Registry prune used filepath.Base(repoName) to derive the legacy group,
causing sibling nested repos (e.g., org/_team-skills vs dept/_team-skills) to
collide on the same basename. Now uses exact Group match for nested repos and
restricts legacy basename matching to top-level repos only.

Tests added (15 new):
- resolveTrackedRepo: auto _ prefix, nested, already-prefixed, not-found,
  basename fallback
- Registry prune: full-path Group, nested members by prefix, sibling isolation
- Project-mode gitignore: single + batch uninstall
- updateSingle: basename fallback, not-found, regular skill priority
- cleanEmptyParents: multi-level, stops at non-empty, stops at boundary
2026-04-04 17:05:22 +08:00
Willie 603f7e86fa fix(ui): refine tracked repo row — add xs button size, move status to info group
- Add 'xs' button size tier (px-2 py-1 text-xs) to Button component
- Use xs buttons for tracked repo Update/Uninstall actions to reduce
  visual weight in row-level controls
- Move clean/modified status from action area to info group (left side)
  as Badge — status is metadata, not an action
- clean: subtle default Badge; modified: warning Badge with dot
- Remove unused Check icon import
2026-04-04 17:05:22 +08:00
Willie 814e14c88b fix(ui): show tracked repos section in project mode dashboard 2026-04-04 17:05:22 +08:00
Willie 7dcf64ea69 fix(server): drop reconcile from repo uninstall to avoid pruning agents
ReconcileGlobalSkills uses PruneStaleSkills(skillsOnly=false) which
removes agent entries unrelated to the uninstalled repo. The explicit
filter + Save is sufficient; full reconcile deferred to next sync.
2026-04-04 17:05:22 +08:00
Willie b22cd6b50b fix(server): scope registry prune to tracked entries only
Group-based filter now requires entry.Tracked to avoid removing
unrelated agent entries that happen to share the same group name.
2026-04-04 17:05:22 +08:00
Willie 657e400f8c fix(server): resolve order + registry prune for repo uninstall
- updateSingle: check exact skill path before resolveTrackedRepo
  fallback, preventing basename collision with nested repos
- handleUninstallRepo: match repo's own registry entry by FullName
  in addition to group-based matching for member skills
2026-04-04 17:05:22 +08:00
Willie a4984cd322 fix(server): resolve nested repos in update + prune registry on uninstall
P1: updateSingle now uses resolveTrackedRepo (shared with uninstall)
to find nested tracked repos like org/_team-skills instead of only
probing root-level _name/name.

P2: handleUninstallRepo now prunes registry entries belonging to the
uninstalled repo and runs ReconcileGlobalSkills/ReconcileProjectSkills,
matching the cleanup that handleUninstallBatch already does.

Extracted resolveTrackedRepo as a Server method to deduplicate the
nested path resolution logic between uninstall and update handlers.
2026-04-04 17:05:22 +08:00
Willie 7e160dee16 fix(trash): support nested tracked repo names in trash lifecycle
MoveToTrash, List, Restore, and Cleanup all assumed flat names.
When a nested tracked repo like org/_team-skills was uninstalled,
the trash entry landed in a subdirectory that List could not see
and Restore could not reach.

- MoveToTrash: create intermediate dirs via filepath.Dir(trashPath)
- List: recursive WalkDir to discover nested entries, store full
  relative path in TrashEntry.Name
- Restore: MkdirAll on destination parent before rename
- Cleanup: remove empty intermediate dirs after expiry via
  cleanEmptyParents helper

Closes runkids/skillshare#116 follow-up (nested trash path)
2026-04-04 17:05:22 +08:00
Willie 7b283ead8e Merge pull request #117 from amdoi7/fix/dashboard-tracked-repo-actions
fix: add dashboard controls for tracked repos
2026-04-03 21:19:51 +08:00
amdoi7 b625b8ce9a Merge origin/main into fix/dashboard-tracked-repo-actions 2026-04-03 15:34:10 +08:00
amdoi7 b1dde02519 test(server): cover tracked repo uninstall edge cases
Add handler tests for nested tracked repo uninstall, ambiguous basename rejection, and traversal rejection.
Also isolate trash-backed server tests by setting XDG_DATA_HOME in test helpers.
2026-04-03 15:29:05 +08:00
amdoi7 e3ea2afb88 fix(ui): address tracked repo review feedback
Validate tracked repo names against path traversal and surface repository listing errors in the uninstall handler.
Track in-flight dashboard repo actions with sets so loading state stays correct during overlapping clicks.
2026-04-03 15:14:51 +08:00
amdoi7 14da64f33a fix(ui): manage tracked repos from dashboard
Add update and uninstall controls to the dashboard tracked repo list.
Handle nested tracked repo paths in the uninstall API so dashboard actions work for both top-level and nested repos.
2026-04-03 14:34:17 +08:00
Willie a570670a92 fix: registry cleanup after uninstall and sync, UI polish
- Fix UI batch uninstall not removing nested skill registry entries:
  handler used flat names (__) but registry stores path names (/),
  now tracks exact RelPath from discovered skills for matching

- Add stale entry pruning to ReconcileGlobalSkills and
  ReconcileProjectSkills using a live set built during disk walk,
  so skills deleted from source are removed from registry

- Trigger registry reconcile after sync in both UI handler (via defer
  for early-return safety) and CLI (global + project mode), writing
  warnings to stderr to avoid corrupting --json output

- UI: fix BatchUninstallPage search treating plain text as exact-match
  glob (now substring search when no * or ? present), display nested
  skill paths with / instead of __ in confirm and result dialogs

- UI: hide redundant 'X repo(s) and Y skill(s) already up to date'
  line on UpdatePage when everything is already current

- Fix test isolation: set XDG_CONFIG_HOME in server test helpers to
  prevent host agents dir leaking into test results, skip chmod-based
  oplog test when running as root

- Add README badge for Awesome Codex CLI
v0.18.6
2026-04-01 22:30:39 +08:00
Willie 39fe8128ba docs: add jessica-engel to contributors 2026-04-01 14:26:41 +08:00
Willie 115a7dd086 docs: add v0.18.5 changelog and bump skill version v0.18.5 2026-04-01 14:22:05 +08:00
Willie 3f7cfc7fbc feat: add --help support to all commands
Add --help/-h flag handling to 7 commands that were missing it:
sync, status, collect, pull, push, doctor, ui.

Previously, running e.g. 'skillshare push --help' would execute
the push instead of showing help. Now all commands safely show
usage info when --help is passed.

Also adds wantsHelp() helper to reduce duplication across commands.

Closes #113
2026-04-01 14:20:51 +08:00
Willie 80e6941852 docs: add Curtion and amdoi7 to contributors v0.18.4 2026-04-01 00:32:49 +08:00
Willie f9163d717c fix(ui): reduce table tooltip delay from 1500ms to 1000ms 2026-04-01 00:32:49 +08:00
Willie 0424a690c4 fix(ui): improve table name truncation, tooltip positioning, and detail metadata layout
Table view:
- Add max-w-[300px] + truncate + tooltip on Name column
- Fix tooltip overflow clamping to slide instead of flip
- Add block prop to Tooltip for correct getBoundingClientRect in table cells
- Set tooltip delay to 1500ms for table columns

Tooltip component:
- Add block prop to render wrapper as block element
- Fix horizontal overflow: use vw - MARGIN - w instead of flipping left
- Add useEffect cleanup to prevent timer/RAF leak on unmount

Skill detail page:
- Switch metadata from stacked to horizontal label:value layout
- Move CopyButton from label to value side to prevent layout shift
- Reduce spacing (space-y-3 → space-y-2) and label size (text-sm → text-xs)
- Shorten Repository label to Repo
2026-04-01 00:32:49 +08:00
Willie 24b7b4d5b2 fix(reconcile): write tracked repo branch to registry.yaml
Tracked repos have no .skillshare-meta.json, so reconcile could not
read branch from metadata. Now falls back to git rev-parse --abbrev-ref
HEAD for tracked repos, ensuring branch is written to registry.yaml
for cross-device rebuild.

Added gitCurrentBranch() helper in config package (cannot import
internal/git due to circular dependency).

Added registry assertion to TestInstallBranch_TrackedRepo.
2026-04-01 00:32:49 +08:00
Willie 178462dcfe fix: three branch-related bugs found in review
P1: check.go '@' separator broke SSH URLs (git@github.com:org/repo)
    — splitURLBranch would split at the '@' in the URL itself
    — Fix: use tab character as separator (cannot appear in URLs)
    — Added unit test for SSH URL round-trip

P1: install_config.go grouped same-repo different-branch skills together
    — groupConfigSkillsByRepo keyed by CloneURL only, ignoring Branch
    — Fix: include branch in grouping key so each branch clones separately

P2: reconcile never cleared stale branch from registry
    — Only updated when meta.Branch was non-empty, never cleared it
    — Fix: sync branch unconditionally when meta is available
2026-04-01 00:32:49 +08:00
Willie 14713f9e3d fix(install): pass source.Branch to sparse checkout in subdir discovery
sparseCloneSubdir in discoverFromGitSubdir was hardcoding empty branch,
ignoring --branch when sparse checkout was used for subdirectory discovery.

Reported by: gemini-code-assist on PR #112
2026-04-01 00:32:49 +08:00
Willie 284b3cb2fd fix(test): update sync warning assertion to match summary format
TestSync_TargetNamingStandard_InvalidSkillWarnsAndSkips now checks
for summarized output 'skill(s) skipped (naming validation)' instead
of per-skill warning line.
2026-04-01 00:32:49 +08:00
Willie c574d30ceb docs: ensure --branch examples cover both regular and tracked installs
quick-reference.md and SKILL.md now show both regular (--branch --all)
and tracked (--track --branch) usage patterns.
2026-04-01 00:32:49 +08:00
Willie 074b139855 docs: update check JSON example, quick reference, and built-in skill for --branch
- check.md: JSON output now includes branch field for tracked repos
- quick-reference.md: added --branch example in team sharing section
- SKILL.md: added -b flag to install recipes
2026-04-01 00:32:49 +08:00
Willie b38f719cdb docs: update v0.18.4 changelog with branch support, sync accuracy, and bug fixes
Adds --branch feature, sync count fix, CLI warning summary,
target dropdown optimistic update, and cached branch lookups
to existing v0.18.4 changelog entry. Syncs website changelog
and release notes.
2026-04-01 00:32:49 +08:00
Willie 94d7ccddef refactor: deduplicate branch helpers and cache per-repo git calls
- check.go: extract urlBranchKey()/splitURLBranch() helpers, used in 5 places
- handler_skills.go: extract enrichSkillBranch() helper, used in 2 handlers
- handler_targets.go: merge duplicate merge/copy resolution into single case
- list.go: cache git.GetCurrentBranch() per-repo instead of per-skill
2026-04-01 00:32:49 +08:00
Willie f01ec9ec12 fix(sync): summarize resolution warnings instead of printing each one
With 25000+ skipped skills (standard naming + name collisions),
the CLI sync output was flooded with per-skill warning lines.

Now prints a concise summary:
  12345 skill(s) skipped (naming validation)
  456 name collision(s) excluded

Applied to both merge and copy sync modes.
2026-04-01 00:32:49 +08:00
Willie 6f70e76758 fix(sync): accurate expectedSkillCount and surface skipped skills
Problem: Sync page showed 'in sync' but Targets page showed
39032/64075 — ~25000 skills silently dropped by name collisions
and SKILL.md validation in standard naming mode.

Root cause: expectedSkillCount used raw filtered count (pre-resolution)
while diff used post-resolution count. The gap was invisible.

Fix:
1. handler_targets.go: expectedSkillCount now uses resolution.Skills
   count (post-collision/validation), matching what sync actually does
2. handler_diff_stream.go: surfaces skippedCount and collisionCount
   in diff response so UI can explain why skills were dropped
3. handler_sync.go: diffTarget struct gains SkippedCount/CollisionCount
4. TargetsPage: shows warning when skills are skipped with collision count
5. SyncPage: shows naming conflict notice in 'in sync' cards
6. API client: Target and DiffTarget types gain optional fields
2026-04-01 00:32:49 +08:00
Willie c75ab36095 fix(ui): optimistic update for target mode/naming dropdowns
Apply setting change to React Query cache immediately on select,
then confirm via API. Rollback cache on error. Eliminates 2s lag
between dropdown change and UI update.
2026-04-01 00:32:49 +08:00
Willie c760206b0e feat(list): show branch in CLI list TUI detail panel 2026-04-01 00:32:49 +08:00
Willie 6e3f7ea124 feat(ui): branch support in web UI
- API client: branch field on Skill type, discover/install/installBatch
- InstallForm: branch input inline with Source (7:3 ratio), git detection
- SkillsPage: branch badge with GitBranch icon in all 3 view modes
- SkillDetailPage: branch metadata row in detail sidebar
2026-04-01 00:32:49 +08:00
Willie 903df9f446 feat(server): add branch to skills API and install handlers
- skillItem struct gains Branch field (json: branch,omitempty)
- handleListSkills and handleGetSkill populate Branch from SkillMeta;
  fall back to git.GetCurrentBranch for tracked repos with empty metadata branch
- handleDiscover, handleInstallBatch, handleInstall all accept Branch in
  request body and propagate it to Source.Branch and InstallOptions.Branch
2026-04-01 00:32:49 +08:00
Willie 67893a402a docs: document --branch flag for install and tracked repositories
Adds --branch to options table, usage examples for branch installs,
and Branch Tracking section in tracked-repositories guide.

Closes #90
2026-04-01 00:32:49 +08:00
Willie db69638e30 feat(install): project mode --branch support and branch display in check
- Set source.Branch in project install path
- Sync branch in project reconcile
- Add Branch to checkRepoResult and RepoCheckOutput for JSON/display
- Read current branch from tracked repos in check

Ref: #90
2026-04-01 00:32:49 +08:00
Willie 354db51928 feat(check): branch-aware remote ref comparison and registry rebuild
- Add GetRemoteRefHash/WithAuth/WithEnv to internal/git/info.go:
  uses git ls-remote with refs/heads/<branch> when branch is set,
  falls back to HEAD when branch is empty
- Add Branch field to URLCheckInput and URLCheckOutput in check/parallel.go;
  ParallelCheckURLs dispatches to GetRemoteRefHashWithAuth when Branch is set
- check.go: group skills by RepoURL@branch composite key so skills on
  different branches of the same repo are checked against the correct ref;
  urlHashMap keyed by same composite key for correct broadcast
- install_config.go (InstallFromConfig): propagate SkillEntryDTO.Branch
  into Source.Branch for both plain and tracked skill phases so registry
  rebuild (install --from-config) respects the recorded branch
2026-04-01 00:32:49 +08:00
Willie 428eb11120 feat(install): persist branch to metadata and registry, read in update
- NewMetaFromSource: set meta.Branch from source.Branch
- installFromDiscoveryImpl: forward discovery.Source.Branch when building
  per-skill Source struct for metadata
- installFromGitSubdir: pass source.Branch to sparseCloneSubdir (was
  hardcoded empty string, causing subdir installs to ignore --branch)
- ReconcileGlobalSkills: sync meta.Branch to registry on both new and
  existing entries
- toSkillEntryDTOs: include Branch field in DTO conversion
- updateRegularSkill / updateSkillFromMeta: restore source.Branch from
  meta before reinstalling, so updates pull from the originally-specified
  branch

Tests: TestInstallBranch_MetadataPersistence, TestInstallBranch_UpdatePreservesBranch
2026-04-01 00:32:49 +08:00
Willie 55ce0fb89e feat(install): pass --branch to discovery clone for regular installs
Source.Branch threads the branch parameter through discovery.
cloneRepo() passes --branch to git clone when set.
source.Branch is set from parsed.opts.Branch in cmdInstall.

Ref: #90
2026-04-01 00:32:49 +08:00
Willie 09a40a4bdf feat(install): pass --branch to git clone for tracked repos
cloneTrackedRepo(), cloneRepoFull(), and sparseCloneSubdir() now accept
a branch parameter. When non-empty, --branch <name> is passed to
git clone. Fallback chain (partial → full) preserved.

Ref: #90
2026-04-01 00:32:49 +08:00
Willie 1c4aeff4e5 feat(install): parse --branch / -b flag
Add --branch / -b flag to install command:
- Flag parsing with value-required and non-empty validation
- Mutual exclusion: --branch rejected for non-git (local path) sources
- Help text added to printInstallHelp()
- Integration tests covering all three error paths
2026-04-01 00:32:49 +08:00