Commit Graph
1205 Commits
Author SHA1 Message Date
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
Willie 9f3832637a feat(ui): implement full AnalyzePage with dashboard, chart, and table
Replace placeholder with complete analyze dashboard:
- PageHeader with BarChart3 icon, dynamic subtitle, refresh button
- Loading/error/empty states using shared components
- Target group merging with SegmentedControl for multi-group switching
- 4 summary cards (skills, always-loaded, on-demand, quality issues)
- Top-10 heaviest skills horizontal bar chart with P25/P75 coloring
- Lint issues summary panel with clickable rule filtering
- Full skill table with sortable columns, search, lint filter badge
- Expandable rows showing token breakdown, metadata, and description
2026-03-26 19:20:52 +08:00
Willie 920feabff6 feat(ui): add analyze API types, route, and nav item
Wire up frontend infrastructure for the Analyze page:
- Add AnalyzeResponse/AnalyzeTarget/AnalyzeSkill/AnalyzeLintIssue types
- Add api.analyze() method calling GET /analyze
- Register /analyze route with lazy-loaded AnalyzePage
- Add Analyze nav item (BarChart3 icon) in SECURITY & MAINTENANCE group
- Create placeholder AnalyzePage component
2026-03-26 19:20:52 +08:00
Willie fe3e72fe38 feat(ui): add GET /api/analyze endpoint
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.
2026-03-26 19:20:52 +08:00
Willie d377e6bbf6 refactor(analyze): simplify lint engine and fix review findings
- Eliminate double YAML parse: extend calcContextFromContent to return
  name, remove parseFrontmatterName helper
- Pre-compute lint icons (lintIconError/lintIconWarning) to avoid
  lipgloss.NewStyle() allocation per render frame
- Use tc.Red/tc.Yellow for Quality section icons (consistency)
- Extract check type string constants (checkFieldEmpty, etc.)
- Panic on embedded rule load failure instead of silent nil return
- Rename "Targets: all" to "Restricted to" (only shown when set)
- Fix struct field alignment (gofmt)
2026-03-26 19:20:52 +08:00
Willie d404eda70e test(analyze): add integration test for JSON lint output 2026-03-26 19:20:52 +08:00
Willie 10415a72f7 feat(analyze): add Quality section and lint icons to TUI 2026-03-26 19:20:52 +08:00
Willie deb834ce99 refactor(analyze): remove Context category bar from TUI 2026-03-26 19:20:52 +08:00
Willie 57ce3f507f feat(analyze): wire lint into discovery and analyze data flow
Populate LintIssues during skill discovery (collectContext path) and
propagate them through analyzeSkillEntry so JSON output includes lint
findings per skill.
2026-03-26 19:20:52 +08:00
Willie f5e5588290 test(analyze): add unit tests for all 7 lint rules 2026-03-26 19:20:52 +08:00
Willie 2e43e3726c feat(analyze): add lint rules YAML and LintSkill engine 2026-03-26 19:20:52 +08:00
Willie bb30924e05 refactor(analyze): merge identical targets into groups in TUI
Targets with no include/exclude filters share the same skill set, so
showing them individually is redundant and causes layout overflow.

Group targets by (SkillCount, AlwaysLoaded, OnDemandMax) into
analyzeTargetGroup entries. Title shows "N targets" instead of listing
all names. Target bar is hidden when only one group exists.
2026-03-26 19:20:52 +08:00
Willie 78ba5c7282 refactor(analyze): polish TUI rendering and add docs
- Fix nil pointer panic when WindowSizeMsg arrives before data loaded
- Fix TestAnalyze_Verbose: create 12 skills to match analyzeTopN=10
- Unify left panel with shared renderPrefixRow (▌ prefix bar style)
- Right-align token counts in skill list rows
- Pre-compute colored dots to avoid per-render lipgloss allocations
- Add category tab bar at top for future analysis categories
- Improve target bar separator (│ → ·) and footer spacing
- Extract renderFooter to eliminate viewSplit/viewVertical duplication
- Add analyze command reference page and sidebar/index entries
2026-03-26 19:20:52 +08:00
Willie 977d76109e feat(ui): add sticky search filter to Update page
Add a search input with sticky positioning to filter the update list
when many skills have updates. Select All now operates on filtered
results only, and uses a shared toggleAll helper with Set-based lookup.
2026-03-26 19:20:52 +08:00
Willie 42dd4e4882 test(analyze): add sort cycling and target switch unit tests 2026-03-26 19:20:52 +08:00
Willie e88c32bcbc feat(analyze): implement interactive TUI with target switching and detail panel 2026-03-26 19:20:52 +08:00