- 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
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
- 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
Add per-target target_naming setting that controls how skill directories
are named in sync targets. 'flat' (default) preserves the existing
flattened __ separator behavior. 'standard' uses the SKILL.md name field
directly, following the Agent Skills specification.
Standard mode:
- Validates SKILL.md names match directory basenames
- Detects and skips name collisions with warnings
- Auto-migrates managed entries when switching from flat to standard
- Preserves legacy entries when bare name is already occupied
Also includes:
- Per-target toggle via CLI (--target-naming), TUI (N key), and Web UI
- Collision output redesigned as deduplicated compact summary
- Config inheritance: global target_naming → per-target override
- JSON schema + UI validation for the new field
Closes#110
diff (CLI, TUI, Web UI) now applies FilterSkillsByTarget before
computing differences, matching the behavior of sync/status/doctor.
Previously, skills with unsupported targets values (e.g. targets: ["*"])
appeared as false 'source only' pending items that sync could never resolve.
- AddPattern returns (bool, error) — single file read, no TOCTOU
- Remove external HasPattern guard in CLI (AddPattern handles it)
- Merge handleDisableSkill/handleEnableSkill into handleToggleSkill
- Fix locking: RLock for discovery, Lock only for file write
- Handle errors from AddPattern/RemovePattern in TUI toggle
- Only write oplog when changes actually occurred
- Inline capitalizeFirst with strings.ToUpper
Analyze page:
- Display skill path (/) instead of flat name (__) in chart, table, dialog
- Widen chart name column from 150px to 220px
- Add skill path as first line in chart tooltip with separator
- Add hover highlight on chart rows
Tooltip component:
- Add followCursor mode that tracks mouse position
- Add viewport boundary detection to prevent clipping
- Measure natural size at (0,0) before clamping position
- Remove break-all to prevent mid-word breaks
Install page:
- Add singleSelect mode to SkillPickerModal (radio UI) when custom name is set
- Add custom name support to batch install API (backend + frontend)
- Remove cross-path duplicate check for batch installs
- Fix: don't show success summary toast when all skills failed
- Fix: keep picker open on install failure
- Preserve source input after install (don't clear on reset)
- Widen SkillPickerModal from md to 2xl
- Align severity badge and description text in warning dialogs
Toast: raise z-index above dialog overlay (z-50 → z-[60])
Go nil slice serializes to JSON null instead of []. When no targets
match, buildGroups() receives null and for...of throws TypeError.
- Backend: use make([]..., 0) so JSON marshal produces []
- Frontend: add ?? [] guard and optional chaining for null safety
Eliminates redundant .git/ directory walks on every LoadRegistry call.
SourceRoot() is now computed once in config.Load() and cached in
cfg.RegistryDir. All 11 call sites use the cached value.
- Add SourceRoot() helper to find git repo root from cfg.Source
- Add MigrateRegistryToSource() for one-time migration
- Update all 11 global-mode LoadRegistry/Save call sites
- registry.yaml now lives in skills/ dir and is tracked by git
Expose per-target context-window budget analysis via the REST API.
The handler discovers source skills with context metadata (desc/body
char counts, lint issues), applies each target's filter/mode rules,
and returns aggregated always-loaded vs on-demand token estimates.
When flatten=true, SyncExtra maps subdirectory files to target root
using filepath.Base(). First file wins on collision, subsequent are
skipped with warnings. Includes config validation, sync-time guard,
CheckSyncStatus collision handling, and CollectExtraFiles support.
Ref: #97
- Change JSON key from 'results' to 'extras' to match frontend type
- Add RLock snapshot pattern matching handleExtras GET handler
- Replace s.extrasSourceDir() with inline resolution using snapshotted values
Previously the GET /api/skillignore handler returned no stats when
the root .skillignore file didn't exist, hiding tracked repo ignores.
Now always runs DiscoverSourceSkillsWithStats so tracked repos'
.skillignore entries are always reported.
Server:
- GET /api/extras returns source_type field
- POST /api/extras accepts optional source field
- extrasSourceDir helper uses ResolveExtrasSourceDir
- Auto-backfill extras_source on create, auto-create dirs on sync
- Fix data race: snapshot ExtrasSource under RLock in handleExtrasDiff
Web UI:
- ExtraCard shows source type badge for non-default sources
- AddExtraModal includes optional source path input
- Comprehensive cache invalidation: config/extras/targets mutations
invalidate all dependent queries across pages
- Add lazy import and route for BatchUninstallPage in App.tsx
(placed before skills/:name to avoid capturing as dynamic param)
- Add "Batch Uninstall" nav entry with Trash2 icon in Layout.tsx MANAGE group
- Add "Batch Uninstall" secondary button next to "New Skill" in SkillsPage header
Batch uninstall with skip-and-continue semantics, registry cleanup,
config reconciliation, and gitignore batch removal. Supports both
global and project mode.
v0.17.5 blocked sync when target directories didn't exist, which
prevented first-time users on fresh CLI installs from syncing.
Sync now auto-creates missing directories and reports what it did
in CLI output, dry-run preview, and the Web UI. Init also creates
target directories when it detects an installed CLI tool.
Web UI: Sync Preview modal stays open after sync with a success
banner instead of immediately closing, so users can review results.
Closes#87
- Add cleanup (os.RemoveAll) on scaffold dir creation failure
- Use skill.ValidNameRe in isValidSkillName (remove duplicate regex)
- Derive canAdvance from nameError instead of re-calling validateName
- Remove redundant total param from ProgressBar (derive from steps.length)
- Fix popstate handler to read event.state.step directly
- Use Plus icon for PageHeader (icon prop is required)
Handles skill creation from the web UI with full validation:
- Name validation (ValidNameRe)
- Pattern validation (must exist in Patterns list)
- ScaffoldDirs validation (must be allowed by the chosen pattern)
- Conflict detection (409 if skill already exists)
Creates SKILL.md from the template engine and optional scaffold
directories with .gitkeep files. Returns 201 with skill metadata
and list of created files. Logs to ops log as "create-skill".
Expose skill design patterns and categories via API for the upcoming
web UI skill creation wizard. Returns the full Patterns and Categories
lists from internal/skill/.
Route registered before GET /api/skills/{name} to avoid path conflict.
When spaHandlerFromDisk receives a non-empty basePath, it pre-computes
a modified index.html with a <script> tag injecting window.__BASE_PATH__.
This allows the frontend to discover its base path at runtime without
build-time configuration. The injection applies to both direct index.html
requests and SPA fallback routes.
Add normalizeBasePath + wrapBasePath to Server so the UI and API can be
served under a URL prefix (e.g. /app). StripPrefix wraps outside
withConfigAutoReload; bare-path requests redirect to path + "/".
Dev mode (no uiDistDir) prints a warning and skips wrapping.
Includes HTTP routing tests for prefix routing, 404 without prefix,
bare-path redirect, multi-level paths, and empty basePath passthrough.
- Remove dead nil check in ignorePayload() (repoFiles already initialized)
- Replace manual map merge loops with maps.Copy in 3 handler sites
- Deduplicate fmt.Sprintf + ui.Success in doctor checkSkillignore
- Extract extractIgnoreSources() helper in SyncPage to DRY two identical
state-setting blocks
The doctor handler shells out to the CLI binary. In global mode it
did not pass -g, so the subprocess auto-detected project mode when
the server's cwd contained .skillshare/config.yaml. This caused
the doctor to check the project source instead of the global source.
Add ignore_root and ignore_repos fields to sync/diff/diff-stream API
responses from IgnoreStats. UI now uses real file paths instead of
heuristic (skill name starts with _) to determine ignore source.
Switch from DiscoverSourceSkills to DiscoverSourceSkillsWithStats so
the sync, diff, and diff-stream endpoints can surface .skillignore
stats (ignored_count, ignored_skills) in their JSON responses.
- ConfigPage: add enabled: tab === 'skillignore' to skip unnecessary
filesystem walk when Config page opens on the config.yaml tab
- handler_skillignore: replace map[string]any with typed structs
(skillignoreResponse, skillignoreStats) for compile-time safety
Go nil slices serialize to JSON null. Add null guard in both the
server handler (emit empty arrays) and the UI (null check before
.length access) to prevent crash after editing .skillignore.
GET returns file existence, raw content, and ignore stats (patterns,
ignored skills). PUT accepts raw content to write or deletes the file
when raw is empty. Both endpoints are mode-aware via s.cfg.Source.
- Extract 14-line duplicated JSON output block from cmdDoctorGlobal and
cmdDoctorProject into shared finalizeDoctorJSON() function
- Define checkPass/checkWarning/checkError constants replacing 42 string
literals across all addCheck() call sites
- Add TODO comment in server handler noting intent to move check logic
into internal/ package
Addresses P1 and P2 from code review on the RWMutex commit:
P1 — Stream handlers now snapshot config under RLock before streaming:
- handleDiffStream: clone Targets map to prevent concurrent map panic
- handleCheckStream, handleAuditStream: snapshot source/projectRoot
- handleUpdateStream: snapshot source (per-item Lock already correct)
P2 — All read handlers now use narrow snapshot instead of defer RUnlock:
- RLock → copy needed fields to locals → RUnlock → do work with locals
- Prevents slow I/O (git fetch, version check, audit scan) from blocking
the auto-reload middleware's exclusive Lock on concurrent requests
Other changes:
- computeTargetDiff takes source parameter (no more s.cfg.Source access)
- Add cloneTargets() helper for safe map copying
- Add writeOpsLogTo/writeAuditLogTo for lock-free oplog writes
The save+reload+error-handling pattern was repeated 8 times across
handler_targets.go (3), handler_extras.go (2), and handler_hub_saved.go
(3). Extract into a single saveAndReloadConfig() method on Server.
One call site in handler_extras.go (extras create) retains separate
save/reload calls because it does MkdirAll between them.
Target mutating handlers (add, remove, update) only called saveConfig()
without the follow-up reloadConfig(), unlike all other mutating handlers
(extras, hub_saved, config). This caused in-memory state to drift from
disk after target include/exclude or mode changes via the UI API.
Add reloadConfig() to all three handlers and tests verifying that
include/exclude filters persist to disk, survive reload, and clear
correctly.
Allow non-technical users to switch branches from the Web UI without
needing a terminal. The dropdown shows local branches first, then
remote-only branches tagged "(remote)".
Backend:
- Add ListLocalBranches, ListRemoteBranches, Checkout to internal/git
- Add GET /api/git/branches (?fetch=true for remote discovery)
- Add POST /api/git/checkout with dirty-check guard + fetch-before-switch
- Oplog instrumentation for checkout operations
Frontend:
- Branch Select dropdown replaces static text when >1 branch exists
- Refresh button to fetch new remote branches on demand
- Dirty state disables switching with visual hint
- Card overflow + z-index fix for playful theme dropdown clipping
Replace the minimal Repo Status Card with a full Repository Info Card
showing remote URL with platform detection (GitHub/GitLab/Bitbucket),
branch tracking info, HEAD commit hash and message, and status badges.
Backend: export GetRemoteURL, add GetHeadMessage and GetTrackingBranch
to internal/git, extend /api/git/status with 4 new fields.
Frontend: new parseRemoteURL utility parses SSH/HTTPS remote URLs and
detects platform by exact hostname match. RepoInfoCard displays parsed
owner/repo with platform icon, clickable link, copy button, and
graceful fallbacks for missing remote or unparseable URLs.