Commit Graph
1233 Commits
Author SHA1 Message Date
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
Willie 8def337c05 feat(install): add Branch field to InstallOptions, SkillMeta, SkillEntry, SkillEntryDTO 2026-04-01 00:32:49 +08:00
Willie ccdafd3293 feat(sync): add target_naming config option (flat/standard)
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
2026-04-01 00:32:49 +08:00
Willie ab64d3d1c3 docs: add v0.18.4 changelog and release notes
Folder tree view, agent target paths, setup-skillshare action.
2026-04-01 00:32:49 +08:00
Willie f0f15ce15a refactor(targets): restructure targets.yaml to nested per-kind format
Unify global_name/project_name into single name field and move flat
paths into skills: { global, project } nested block. All 56 targets
converted with zero public API signature changes.

Add targetPathPair sub-struct and agents: block for v1 agent targets
(claude, cursor, opencode, augment). New DefaultAgentTargets() and
ProjectAgentTargets() functions return only targets with agent paths.

Update all internal consumers: DefaultTargets, ProjectTargets,
LookupProjectTarget, GroupedProjectTargets, MatchesTargetName,
KnownTargetNames, resolveTargetPaths, ProjectTargetDotDirs.

ProjectTargetDotDirs now collects dot-dirs from both skill and agent
project paths to prevent discovery from scanning agent target copies.
2026-03-30 18:32:33 +08:00
Willie bca035fdfa docs: add GitHub Actions setup-skillshare to README installation section 2026-03-30 18:30:26 +08:00
Willie 50df8b0526 docs: update CI/CD recipes to use setup-skillshare action
- ci-cd-skill-validation: setup-skillshare@v1 as primary method,
  manual curl install as fallback option
- security: simplified CI audit example using the action
- Link to GitHub Marketplace listing
2026-03-30 18:30:26 +08:00
Willie d2716e14b1 feat(ui): replace grouped view with folder tree view
Virtualized tree with multi-level expand/collapse, hover metadata
tooltips, Expand/Collapse All buttons, search-aware auto-expansion,
sticky folder header, indent guides, and localStorage persistence.

Also: Tooltip delay/followCursor fix, skill detail button layout fix.

Ref #108
2026-03-30 16:35:05 +08:00
Pulkit Kathuria 179189975b Support custom INSTALL_DIR variable in install.sh 2026-03-30 11:21:26 +08:00
Willie 8c65881ad4 fix(upgrade): split unix-only sudo code behind build tags for Windows compat
Move needsSudo, execFunc, and reexecWithSudo to upgrade_unix.go with
//go:build !windows. Add upgrade_windows.go with no-op stubs.
Fixes GoReleaser Windows build failure (undefined: unix.Access).
v0.18.3
2026-03-29 05:14:35 +08:00
Willie 3b5571f4be refactor(config): use 2-space YAML indentation for all config output
Replace yaml.Marshal (4-space default) with marshalYAML helper using
yaml.Encoder.SetIndent(2) across config, project config, and registry.
Matches industry standard (Kubernetes, Docker Compose, GitHub Actions)
and reduces excessive nesting depth in targets with skills sub-keys.
2026-03-29 05:00:42 +08:00
Willie 1016a155db fix(diff): filter out skills with SKILL.md targets mismatch
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.
2026-03-29 04:59:23 +08:00
Willie fe44ffa7b1 fix(config): use atomic write-to-temp + rename for migration persistence
Prevents config file corruption if os.WriteFile fails mid-write
(e.g., disk full). Writes to .tmp first, then renames atomically.

Addresses review feedback from #106.
2026-03-29 04:59:23 +08:00
Willie 58a78ab131 docs: add v0.18.3 changelog, enable/disable docs, and release notes
- New enable/disable command reference page with examples and Mermaid diagrams
- Update command index, list, upgrade, and filtering docs for new features
- Add enable page to sidebar under Skill Management
- Update SKILL.md with enable/disable recipes and version bump to v0.18.3
- Sync changelog to website, update README latest note
- Document upgrade auto-sudo, TUI E key toggle, and [disabled] label
2026-03-29 04:59:23 +08:00
Willie e0d0313b0d refactor: simplify enable/disable after code review
- 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
2026-03-29 04:59:23 +08:00
Willie 621b5c7ac6 test: integration tests for enable/disable and collect mode inheritance 2026-03-29 04:59:23 +08:00
Willie 18fac69e56 fix(collect): resolve inherited mode and stale manifest on copy→merge switch 2026-03-29 04:59:23 +08:00
Willie cc2f0ee516 feat(list-tui): show disabled skills with E key toggle 2026-03-29 04:59:23 +08:00
Willie af1f62b62e feat: add enable/disable API, UI button, and disabled field 2026-03-29 04:59:23 +08:00
Willie a3459f4cd7 feat: add enable/disable CLI commands
Friendly interface for .skillignore. Supports skill names and glob
patterns. Dual-mode (--project/--global). Dry-run support.
Does not auto-sync — prompts user to run sync.
2026-03-29 04:59:23 +08:00
Willie f51cc8106b feat(sync): add DiscoverSourceSkillsAll with Disabled field
New discovery function that includes .skillignore-d skills marked with
Disabled=true. Existing discovery functions are unchanged — Disabled
defaults to false for backward compatibility.
2026-03-29 04:59:23 +08:00
Willie 14c2b9e97e feat(skillignore): add AddPattern/RemovePattern/HasPattern helpers
File-level write operations for .skillignore. Creates file if missing,
prevents duplicates, preserves comments and blank lines.
2026-03-29 04:59:23 +08:00
Willie f4d35af80f test: comprehensive migration compat and validation tests
- config_resource_test.go: global TargetConfig new format, old format
  migration, empty object, SkillsConfig/AgentsConfig accessors,
  mixed-format merge + no-overwrite
- project_resource_test.go: project target new format, old format,
  string form, MarshalYAML variants, accessors, mixed-format merge
- registry_kind_test.go: Kind field, EffectiveKind default/explicit,
  persistence round-trip, old format without kind
- migration_compat_test.go: 50+ cases covering all old config patterns:
  global Load() path (persist, ~ expansion, built-in backfill),
  project LoadProject + ResolveProjectTargets (string, flat, alias,
  custom), round-trip no-flat-keys assertion, mixed-format merge edges
- config_validate_test.go: pathless custom target rejection for both
  global and project mode, built-in target acceptance
2026-03-29 04:59:23 +08:00
Willie 7a247dd086 chore(schemas/ui): update JSON schemas and fieldDocs for skills/agents format
- config.schema.json: inline skills definition with examples, agents
  marked as reserved, remove unused resourceTargetConfig def
- project-config.schema.json: same treatment for project targets
- registry.schema.json: add kind enum (skill|agent), reserved note
- fieldDocs.ts: new targets.skills.* entries, targets.agents.* reserved,
  legacy flat fields marked [Legacy]
2026-03-29 04:59:23 +08:00
Willie 41dd81b7f2 refactor: migrate all callers to SkillsConfig() / EnsureSkills()
44 files across CLI commands, sync engine, and server handlers now use
SkillsConfig() for reads and EnsureSkills() for writes instead of
accessing flat TargetConfig fields directly.

Key changes:
- sync engine (SyncTargetMerge/Copy/Symlink): reads sc := target.SkillsConfig()
- target commands: filter add/remove and mode set use EnsureSkills()
- target TUI: mode picker, filter ops, detail panel all via SkillsConfig()
- server handlers: backup, restore, targets, sync, diff, collect, analyze
- init/init_project: new target creation uses Skills sub-key
- doctor, status, diff: target display reads from SkillsConfig()
- computeTargetDiff: accepts config.TargetConfig directly (was anon struct)
2026-03-29 04:59:23 +08:00
Willie 9d38216246 refactor(config): update project filter test to use SkillsConfig()
Existing test asserted flat Include/Exclude fields which are now empty
after migration. Updated to read from SkillsConfig() and resolved
target's SkillsConfig().
2026-03-29 04:59:23 +08:00
Willie 8258f8b27b feat(config): add skills/agents sub-keys to TargetConfig with auto-migration
Add ResourceTargetConfig struct for per-resource-kind target settings.
Both global TargetConfig and project ProjectTargetEntry gain Skills and
Agents sub-keys alongside legacy flat fields.

Migration:
- migrateTargetConfigs() (global) and UnmarshalYAML (project) move flat
  path/mode/include/exclude into skills: sub-key on load
- Mixed format (flat + skills) merges without overwriting existing values
- EnsureSkills() clears flat fields after promotion
- Auto-persists migrated format on first Load/LoadProject

Validation:
- Known built-in targets can omit skills.path (backfilled from defaults)
- Custom targets must specify skills.path explicitly
- Load() backfills built-in default paths for known targets

Accessors: SkillsConfig(), AgentsConfig(), EnsureSkills(), IsEmpty()
2026-03-29 04:59:23 +08:00
Willie 9f7181a86d chore: update readme 2026-03-29 02:52:46 +08:00
Willie 7125a251d9 feat(upgrade): auto-detect sudo requirement for CLI upgrade
When the binary is installed in a non-writable directory (e.g. /usr/local/bin),
upgrade now automatically re-executes with sudo instead of failing with a
permission error.

Uses unix.Access() to check directory writability and unix.Exec() to replace
the process with sudo. Skipped on Windows.

Ref: #105
2026-03-29 02:52:46 +08:00
Pulkit Kathuria 43f99e770a fix(pull): update info message from git stash to git stash -u
Include untracked files in stash suggestion, matching git status --porcelain scope.

Co-authored-by: Pulkit Kathuria <kevincobain2000@gmail.com>
Closes #104
2026-03-29 02:52:46 +08:00
Willie 80f5266e24 fix(ui): replace --- text with full-width hr in analyze tooltip
Tooltip content prop now accepts ReactNode instead of string only.
Analyze page skill tooltip uses an <hr> element for a clean separator.
2026-03-28 15:26:55 +08:00
Willie 41967309af docs: add v0.18.2 changelog, release notes, bump skill version v0.18.2 2026-03-28 02:54:53 +08:00
Willie a5b2425565 refactor(ui): extract helpers in UpdatePage for reuse and correctness
- Extract patchItem() to deduplicate 6 setItemStatuses map calls
- Extract invalidateSkillData() to deduplicate 3 query invalidation pairs
- Extract isStaleError() checking both backend stale patterns
- Derive completedCount from individual counts instead of extra filter
2026-03-28 02:52:01 +08:00
Willie 56bffa7d25 feat(ui): improve update page with sticky progress bar, auto-scroll, and purge
- Replace static 'Updating...' text with sticky StreamProgressBar showing
  real-time progress (completed/total, percentage, ETA)
- Auto-scroll to the currently updating item via scrollIntoView
- Add visual distinction for failed (danger bg) and blocked (warning bg) items
- Show error messages in red with font-medium for better readability
- Add Purge button for skills whose subdirectory no longer exists in repo
- Change Force button to Force Retry with danger variant for other errors
2026-03-28 02:47:06 +08:00
Willie e2106ba06f fix(analyze): remove redundant path line from skill detail dialog
Title already shows skill.path, so the separate path paragraph
was duplicating information.
2026-03-28 02:33:15 +08:00
Willie 44420a8b84 feat(ui): improve analyze display, install picker, and tooltip UX
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])
2026-03-28 02:30:50 +08:00
Willie bb029f7950 fix(analyze): handle null targets array in API response
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
2026-03-28 01:55:25 +08:00
Willie 3ee5d0bb83 docs: add v0.18.1 changelog, release notes, bump skill version
- CHANGELOG.md: v0.18.1 entry (filter, registry move, init fix)
- website/src/pages/changelog.md: synced
- skills/skillshare/SKILL.md: version → v0.18.1
- specs/RELEASE_NOTES_0.18.1.md: maintainer release notes
v0.18.1
2026-03-27 02:24:19 +08:00
Willie b6b7ae8caa docs: add --filter to analyze quick-reference entry 2026-03-27 02:20:21 +08:00
Willie dbce8ffa20 fix: update registry.yaml path and clean up formatting
Update registry.yaml path references from ~/.config/skillshare/
to ~/.config/skillshare/skills/ in schema description, quick
reference docs, and migration guide. Fix whitespace alignment
in lint.go constants and remove blank line in skill.go imports.
2026-03-27 02:17:54 +08:00
Willie 0f7f6101fb fix(analyze): pass icon component ref to EmptyState, not JSX element 2026-03-27 02:06:33 +08:00
Willie 8b8254d837 style(analyze): use EmptyState component for no-match state 2026-03-27 02:03:42 +08:00
Willie bb4787b198 style(analyze): add slide/fade animation to summary bar and table rows
Summary bar uses opacity + max-height transition (200ms ease-out)
for smooth appear/disappear. Table rows use fade-in animation (150ms)
when filter results change.
2026-03-27 00:43:42 +08:00
Willie 545b8c0728 style(analyze): fix table height to prevent layout shift on filter 2026-03-27 00:41:22 +08:00
Willie 6523363337 refactor(analyze): extract skillMatchesFilter, cache filtered sums
- Extract skillMatchesFilter() helper to deduplicate relPath matching
  logic between filterAnalyzeSkills() and TUI applyFilter()
- Cache filteredDescChars/filteredBodyChars in applyFilter() so
  renderStatsLine() reads cached values instead of iterating on
  every render (also fixes incorrect sums when list is paginated)
- Use filterAnalyzeSkills summary in plain-text path instead of
  manually re-summing chars
2026-03-27 00:40:59 +08:00
Willie fb044d68a6 feat(analyze): add filtered token summary bar to Web UI
Shows always-loaded, on-demand, and total token sums for the current
search/filter result set using mini stat chips with icon + label + value.
Appears only when a filter is active. Search matches on path (relPath)
to support group filtering. Lint filter badge shows readable rule name.
2026-03-27 00:33:36 +08:00
Willie 2ba561f667 feat(analyze): dynamic token sums in TUI stats line
renderStatsLine() now computes always-loaded, on-demand, and total
token sums from the currently filtered items instead of showing
fixed target totals. Shows N/M format when filter is active.
Filter now matches on relPath (supports group paths like frontend/).
--filter flag pre-populates the TUI filter input.
2026-03-26 23:51:03 +08:00
Willie ffdded311f feat(analyze): add --filter flag with filtered_summary in JSON output
Support case-insensitive substring filter on skill relPath.
When --filter is set, JSON output includes filtered_summary with
always_loaded, on_demand, and total token counts for matched skills.

Ref: Discussion #99
2026-03-26 23:47:28 +08:00
Willie eabb556cc6 refactor(config): cache SourceRoot in Config.RegistryDir
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.
2026-03-26 23:32:15 +08:00