Commit Graph
1220 Commits
Author SHA1 Message Date
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
Willie 1ceccb936c fix(e2e): add step_setup cd $HOME to prevent workspace pollution
mdproof runs with cwd=/workspace which has .skillshare/config.yaml,
triggering project mode auto-detection. step_setup ensures every
step runs from the isolated HOME instead.
2026-03-26 23:11:43 +08:00
Willie acedd77f20 docs: update registry.yaml path and init --remote behavior
- registry.yaml now lives in skills/ dir (synced via git)
- Updated file-structure, declarative-manifest, appendix, init docs
- Added migration note for v0.19+ users
2026-03-26 23:06:37 +08:00
Willie ebe2851882 test(e2e): add runbooks for registry migration and init skip prompt
- New: registry_source_dir_migration_runbook.md (6 steps, all pass)
- New: init_skip_skill_prompt_runbook.md (4 steps, all pass)
- Updated: registry paths in existing runbooks to use skills/ dir
2026-03-26 23:01:19 +08:00
Willie 9a433723bd fix(test): update registry.yaml path in integration tests
Tests now look for registry.yaml in source dir instead of config dir,
matching the new registry location.
2026-03-26 22:50:03 +08:00
Willie b3bbfc0469 test: add registry migration and source dir integration tests
Verify MigrateRegistryToSource behaviour end-to-end:
- old-only: registry.yaml is moved from config dir to source dir
- both-exist: old file is kept, new file unchanged, warning printed
- global mode fresh sandbox: registry.yaml never written to config dir
2026-03-26 22:44:44 +08:00
Willie a7de6a3a69 feat(registry): move registry.yaml to source dir for git sync (#103)
- 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
2026-03-26 22:42:00 +08:00
Willie 3a978e17d2 fix(init): skip skill prompt when remote has skills (#102)
setupGitRemote now returns bool indicating remote had skills.
When true, skip installSkillIfNeeded — user will get skills
via 'skillshare pull' instead of being prompted.
2026-03-26 22:31:35 +08:00
Willie eb8ef0bc15 docs: update README latest release to v0.18.0 and add contributor
Update Recent Updates callout to v0.18.0 (context analysis, skill
quality lint, analyze TUI, Web UI Analyze page).

Add richardwhatever to Contributors section.
2026-03-26 19:35:21 +08:00
Willie 64ed9b046e feat(analyze): add malformed-frontmatter lint rule and polish UI/TUI
- Surface YAML parse errors from calcContextFromContent as a new
  "malformed-frontmatter" lint issue instead of silently ignoring them
- Fix help text to say "Top 10" (was "Top 5") matching actual constant
- Shorten TUI list title to target name only; move skill count to
  stats line so the header no longer wraps on narrow terminals
- Truncate long skill names in TUI to keep token counts visible
- Change "All Skills" icon block to green (matches Skills summary card)
v0.18.0
2026-03-26 19:20:52 +08:00
Willie f7e04f1961 docs: add v0.18.0 changelog, release notes, and analyze docs
Add CHANGELOG and website changelog entries for v0.18.0 covering
the new analyze command, skill quality lint, TUI, Web UI Analyze
page, and Update page improvements.

Update analyze.md with lint rules table, quality section, and
updated JSON output example. Add analyze to built-in skill
description and Quick Lookup table. Bump skill version to v0.18.0.

Fix TUI list title to show skill count in stats line instead of
title, and truncate long skill names to keep token count visible.
2026-03-26 19:20:52 +08:00
Willie 89df6d2904 fix(ui): center pin decoration on playful theme detail cards
Use percentage-based positioning (left: 50% + translateX) instead of
fixed pixel offsets (right: 18px / left: 22px) so pins stay centered
regardless of card width. Add nth-child variation at 40%/60%.
2026-03-26 19:20:52 +08:00
Willie ae3989276c feat(ui): add token breakdown to skill detail and polish AnalyzePage
AnalyzePage:
- Add "View Skill Detail" link in skill dialog for quick navigation
- Simplify subtitle (remove redundant useMemo with identical branches)
- Replace prevFiltered anti-pattern with useEffect for pagination reset
- Remove unused border/bg fields from summary card data

SkillDetailPage:
- Show estimated token count in stats bar with desc/body breakdown
- Hover tooltip shows full breakdown (~4 chars/token estimate)
2026-03-26 19:20:52 +08:00
Willie 9ecd78e157 feat(ui): redesign AnalyzePage and unify dialog styling across all modals
Redesign AnalyzePage with improved visual hierarchy, accessible colors,
and consistent styling. Unify all dialog/modal components to use a shared
DialogShell with border-2 border-pencil + hard-offset shadow pattern,
removing Card wrappers that caused inconsistent appearance.

AnalyzePage improvements:
- Summary cards with Audit-style icon blocks and semantic colors
- Bar chart uses info blue (not red) with uniform opacity
- Skill detail shown in dialog instead of inline expand
- Table matches Skills page table view (dashed borders, pagination)
- Quality Issues section with readable rule names and proportion bars
- Help dialog explaining page purpose and token calculation
- All colors use CSS variables for dark mode compatibility

Dialog unification (11 files):
- DialogShell: add bg-surface, border-2 border-pencil, padding prop,
  createPortal to body, CSS shadow rules
- Migrate KeyboardShortcutsModal from inline to DialogShell
- Remove Card wrappers from ConfirmDialog, SkillPickerModal,
  HubManagerModal, SyncPreviewModal, UpdateDialog, ExtrasPage
- FileViewerModal: padding=none with manual header padding
2026-03-26 19:20:52 +08:00