Commit Graph
57 Commits
Author SHA1 Message Date
Willie aa4b3ec311 feat(ui): improve update page empty state and targets sync mode UX
- UpdatePage: replace EmptyState with postit card, add phase state
  machine (idle/updating/done), per-item status tracking with
  staggered animations, and result summary panel
- HandSelect: add optional description field to SelectOption, render
  multi-line dropdown items with description text
- TargetsPage: add sync mode descriptions, widen dropdown (w-32→w-44),
  add dashed border separator above sync mode row
2026-02-28 20:56:34 +08:00
Willie f7483fdbe7 feat(ui): add dedicated update page with batch selection 2026-02-28 20:56:34 +08:00
Willie ba7752f85d feat(ui): enhance install skill picker with descriptions and into-dir field
Include skill description from SKILL.md frontmatter in the discover API
response, add the optional description field to the DiscoveredSkill
TypeScript interface, and render it inline in the SkillPickerModal.
Filter search also matches against descriptions. The --into directory
input already existed in InstallForm, so no change was needed there.
2026-02-28 20:56:34 +08:00
Willie 6def2a254a feat(ui): add security overview card to dashboard
Enhance the existing Security Audit section on the Dashboard with:
- Risk label badge (clean/low/medium/high/critical) next to the title
- Severity breakdown badges (CRITICAL/HIGH/MEDIUM/LOW/INFO) for non-zero counts
- ShieldAlert icon in red when CRITICAL findings exist
- Card variant="accent" highlight when CRITICAL findings are present
- Green "All Clear" message with ShieldCheck icon when no findings
- Renamed section title from "Security Audit" to "Security Overview"
- Renamed last stat box from "Critical" to "Failed" for accuracy
2026-02-28 20:56:34 +08:00
Willie 18cfaa984c feat(ui): add sync mode selector to targets page 2026-02-28 20:56:34 +08:00
Willie 208b34d8a0 fix(ui): add accessibility improvements — aria-labels, focus trap, ErrorBoundary, htmlFor 2026-02-28 20:56:34 +08:00
Willie b24a80f861 feat(ui): add dark theme with toggle, aligned to website color palette
- Add .dark CSS variable overrides (warm brown bg, gold primary, muted shadows)
- Add ThemeContext with localStorage persistence and prefers-color-scheme detection
- Add theme toggle button (sun/moon) fixed at top-right of main content
- Replace all bg-white with bg-surface for theme-aware backgrounds
- Rewrite CodeMirror theme to use @lezer/highlight HighlightStyle for proper
  syntax highlighting in both light and dark modes
- Convert design.ts shadows from hardcoded hex to CSS variable references
- Add dark: variants for elements that need different active states per theme
- Add postit/tracked CSS custom properties with dark mode translucent overrides
2026-02-28 19:15:57 +08:00
Willie a37c458740 fix(ui): support subdir URL discovery and fix modal scroll-away bug
handleDiscover and handleInstallBatch now use DiscoverFromGitSubdir
when the source URL contains a subdirectory path, enabling the skill
picker modal to appear for multi-skill subdirectories.

Fix SkillPickerModal content disappearing on checkbox click caused by
Card's overflow-hidden creating a scroll container — browser's
scrollIntoView on the sr-only input would scroll content out of view.
Use overflow-clip instead to preserve border-radius clipping without
creating a scroll context.

Issue #56 (workaround)
2026-02-28 18:26:48 +08:00
Willie 96f65725dd fix(ui): compare last_operation timestamps as dates, not strings
RFC3339 string comparison fails with different timezone offsets.
Parse to Date before comparing to ensure correct ordering.
2026-02-26 22:27:23 +08:00
Willie 32a5794b6c fix(ui): compute stats from both ops and audit logs on all tab
The stats bar only fetched ops stats when the all tab was active,
producing misleading analytics (e.g. audit commands showing rows but
zero in the stats panel). Now fetches both sources and merges them
client-side via useMemo.
2026-02-26 22:27:23 +08:00
Willie fbab56f86b feat(ui): add log stats bar with success rate and command breakdown
Wire up the new GET /api/log/stats endpoint in the frontend:
- api.getLogStats() + CommandStats/LogStatsResponse types in client.ts
- logStats query key in queryKeys.ts
- LogStatsBar component on Log page showing success rate, top 4
  commands with ok/error/partial counts, and last operation badge
- Stats bar respects tab (ops/audit) and active filters
- Refresh and clear actions invalidate both log and log-stats queries
2026-02-26 22:27:23 +08:00
Willie 29e97fcb4b feat(ui): migrate to TanStack Query and virtualize SkillsPage
Replace custom useApi hook with @tanstack/react-query across all 14
pages and InstallForm. Add react-virtuoso VirtuosoGrid to SkillsPage
for handling 46K+ skills without freezing the browser.

Key changes:
- Add queryClient with shared defaults (staleTime, gcTime, retry)
- Add centralized queryKeys factory for prefix-based invalidation
- Wire QueryClientProvider + ReactQueryDevtools in App.tsx
- Migrate AppContext to useQuery (shares cache with DashboardPage)
- Migrate all pages: useApi → useQuery, handlers → invalidateQueries
- SkillsPage grid view: VirtuosoGrid with useWindowScroll, overscan,
  ScrollSeekPlaceholder, and React.memo on card components
- Add resolve.dedupe for React to prevent duplicate instance in dev
- Add vendor-tanstack-query manual chunk for build splitting
- Delete unused useApi.ts hook
2026-02-25 07:02:54 +08:00
Willie a50639b0b6 feat(ui): enhance restore modal with validation preview and conflict warnings
Modal now calls /api/restore/validate on open to show backup size,
symlink status, and file conflicts before confirming. Button text
dynamically changes to "Restore (overwrite)" when conflicts exist.
Removes hardcoded force:true — only sends force when user acknowledges.
2026-02-25 07:02:54 +08:00
Willie 0af62f5aaa feat(ui): add validateRestore API type and function 2026-02-25 07:02:54 +08:00
Willie c9e10faeb7 feat(log): record update command options in oplog and add dedicated formatters
logUpdateOp now captures mode, all, force, dry_run, skip_audit, threshold,
and diff flags. Dedicated formatUpdateLogPairs/Detail formatters replace the
generic fallback in both the TUI log viewer and the web UI LogPage.
2026-02-25 07:02:54 +08:00
Willie a0ebbde1de refactor(ui): use raw bytes in backup API and extract shared formatSize
Return sizeBytes (int64) instead of sizeMB (float64) from backup API
so the frontend controls display formatting. CLI backup commands now
use the existing formatBytes() helper for human-friendly output.

Extract duplicate formatSize() from CollectPage and TrashPage into
shared ui/src/lib/format.ts utility.
2026-02-25 07:02:54 +08:00
Willie ca60592447 fix(ui): remove unused threshold param from BlockStamp 2026-02-23 04:18:01 +08:00
Willie d2b085a20b feat(ui): redesign audit page with enhanced visual hierarchy
Improve block/risk/severity display in the audit page:
- Stats grid: color-coded backgrounds, zero-value muting with opacity
- Triage panel: structured 3-column layout with mini progress bar
- SkillAuditCard: BlockStamp (red tilted stamp vs green pass pill)
  and RiskMeter (dashed box with horizontal bar + score)
- FindingRow: left border severity stripe, code snippets as torn
  paper notes with wobbly borders and slight rotation
2026-02-23 04:18:01 +08:00
Willie bd76ec9aa5 feat: surface audit risk score in update API and UI
Return auditRiskScore and auditRiskLabel in update results so the
dashboard can show security posture after both tracked-repo and
regular-skill updates. auditGateTrackedRepo now returns the audit
result alongside the blocked indicator.
2026-02-23 04:18:01 +08:00
Willie 684b0da971 docs: add v0.15.4 changelog, update SKILL.md, README, and UI for supply-chain security
- Add v0.15.4 CHANGELOG entry (audit gate, content hash pinning, --diff,
  source-repository-link rule, severity-based risk floor, bug fixes)
- Bump SKILL.md version to v0.15.4 with supply-chain security keywords
- Update README Recent Updates table to reference v0.15.4
- Fix security.md rule count 25→31 to match audit.md
- DashboardPage: include blocked count in update summary toast
- SkillDetailPage: show ConfirmDialog on blocked update with
  "Skip Audit & Update" retry option
2026-02-23 04:18:01 +08:00
Willie a0bfe9958a fix: batch update error propagation, skip-audit passthrough, and security hardening (#39)
- P1: Batch/all update now returns non-zero when repos are blocked by
  security audit (fail-closed for CI pipelines)
- P2: Pass --skip-audit to regular skill update via InstallOptions
- P2: Add path containment check in content integrity to prevent
  directory traversal via crafted file_hashes keys
- P3: Switch git diff parsing to NUL-delimited (-z) for safe handling
  of special filenames
2026-02-23 04:18:01 +08:00
Willie 3b721ee3e2 feat(sync): add copy mode for AI CLIs that can't follow symlinks
Add a third sync mode (`copy`) that copies skills as real files instead
of symlinks, with a `.skillshare-manifest.json` tracking managed skills
and SHA256 checksums for incremental updates.

- Manifest-based tracking: skip unchanged, update modified, --force all
- Pruning: remove managed copies no longer in source
- Mode conversion: bidirectional merge↔copy and symlink↔copy
- Full command support: sync, status, doctor, diff, target, collect
- Server API + Web UI: targets list, drift detection, filter editing
- include/exclude filters work in both merge and copy modes
- 12 integration tests covering all acceptance criteria
- Documentation updated across 13 pages

Closes #31
2026-02-21 06:07:35 +08:00
Willie 080377ff85 feat(ui): show license field in SkillDetailPage manifest box
Parse and display the license frontmatter from SKILL.md in the
manifest section, matching the existing name/description pattern.
2026-02-18 22:23:50 +08:00
Willie 2dfe57a213 chore: improve list skills UX 2026-02-16 00:41:24 +08:00
Willie a29e198725 feat: add target filter CLI, skill-level targets field, and Web UI support
- CLI: `target <name> --add-include/--add-exclude/--remove-include/--remove-exclude`
- SKILL.md `targets` frontmatter restricts sync to specified targets
- Cross-mode matching (e.g. "claude" matches "claude-code" project target)
- Web UI: inline filter editor on Targets page, target badges on Skills pages
- API: PATCH /api/targets/{name} for filter updates
- Fix drift detection in doctor/status/handler to account for skill-level targets
- `check` warns about unknown target names in skill-level targets field
- Docs: update skill-format, target command, configuration, creating-skills
2026-02-15 23:29:30 +08:00
Willie 3f8aff5dfc style: replace Kalam/Patrick Hand with Inter for readability
Closes #25 — fonts were too fancy and hard to read.

Website (docs):
- Replace Kalam with Inter for all headings and UI elements
- Remove unused Patrick Hand import
- Keep Kalam only for homepage hero title (brand identity)
- Reduce font-weight 700→600 on small uppercase labels
  (footer titles, admonition headings, supported CLIs)

Web UI (dashboard):
- Replace Patrick Hand (body) and Kalam (headings) with Inter
- Switch CodeMirror gutter from Patrick Hand to monospace
- Fix include badge contrast: bg-blue-light → bg-info-light
2026-02-14 18:10:50 +08:00
Willie bd75ef8939 feat: support target include/exclude filters across sync, UI, and docs 2026-02-14 00:21:48 +08:00
Willie e5da171976 feat: add reminders and hub PR CTA 2026-02-13 14:57:18 +08:00
Willie 0b03a4e2fc fix(search): remove 20-result cap for hub search and add scroll-to-load
Hub search was capped at 20 results because it shared the same
normalizeLimit() path as GitHub search. Hub indexes are static JSON
(~100 entries), so returning all results is expected.

- Remove normalizeLimit() from hub search path; limit=0 means no limit
- Backend defaults to limit=0 for hub requests, 20 for GitHub
- CLI uses limit=0 when --hub is set without explicit --limit
- Frontend searchHub() no longer sends a limit parameter
- Replace IIFE rendering with useMemo for stable filter results
- Add IntersectionObserver-based scroll-to-load (20 items per batch)
2026-02-13 14:21:37 +08:00
Willie 0bd79a438e feat: add hub persistence to config for CLI and Web UI
Hub sources are now saved in config.yaml (both global and project),
replacing the Web UI's localStorage-based approach. This allows CLI
and UI to share the same hub list.

- Add HubConfig/HubEntry types and helper methods (resolve, add, remove)
- Add CLI subcommands: hub add/list/remove/default
- Search --hub now resolves saved labels (e.g. --hub team)
- Add REST API endpoints for hub CRUD (GET/PUT/POST/DELETE /api/hub/saved)
- Migrate SearchPage from localStorage to server API calls
2026-02-13 14:21:37 +08:00
Willie 30fb64ddea feat(ui): add tag badges and client-side filter to search results
Display #tag accent badges on hub search result cards and add an
inline filter input that matches against name, description, and tags.
Filter resets automatically on new searches.
2026-02-13 14:21:37 +08:00
Willie 6253099d7d fix: correct hub help text, gofmt alignment, and missing tags type
- Fix --index-url → --hub in hub index help text
- Fix gofmt struct field alignment in SearchResult after adding Tags
- Add missing tags field to frontend SearchResult TypeScript interface
2026-02-13 14:21:37 +08:00
Willie 88847ea3ae feat: add skill field to hub schema for multi-skill repo support
Hub JSON entries can now specify a `skill` field to target a specific
skill within a multi-skill repo. CLI auto-passes -s flag, Web UI
skips the picker modal when skill is specified.

Also adds Community Hub section to search docs with link to
runkids/skillshare-hub.
2026-02-13 14:21:37 +08:00
Willie 19141990fa refactor(ui): extract hub management into modal dialog
Move hub add/delete operations from inline UI into a dedicated
HubManagerModal component. SearchPage now shows a dropdown selector
with a "Manage" button, separating frequent (select) from infrequent
(add/delete) operations. Fix dropdown overflow by adding
!overflow-visible to the hub selector Card.
2026-02-13 14:21:37 +08:00
Willie cd81a01f99 docs: add hub index guide, command reference, and rename to skillshare-hub.json
Rename default output from index.json to skillshare-hub.json for
uniqueness. Add website docs for hub command and hub index guide.
Update search command docs with --index-url section. Add hub and
hub-index to sidebar.
2026-02-13 14:21:37 +08:00
Willie d2854ed621 feat(ui): add private index search with multi-index management
Add /api/hub/index endpoint and index_url support to /api/search.
SearchPage now has GitHub/Private Index mode tabs with localStorage
persistence. Built-in "Current Skills" index plus user-managed
custom indexes with URL dedup and add/delete flow.
2026-02-13 14:21:37 +08:00
Willie f209d72fbc fix: prevent table overflow on supported-targets page
Long code paths (e.g. Xcode target paths) broke layout by pushing
the table beyond its container. Override white-space on td code to
allow wrapping, and add overflow-x: auto as a safety net.
2026-02-13 14:21:37 +08:00
Willie d8699762ad fix: use deep skill count in init and prevent null files in git status API
- init: replace shallow os.ReadDir count with DiscoverSourceSkills()
  to correctly count nested skills by SKILL.md presence
- handler_git: guard against nil slice from GetDirtyFiles() overwriting
  the initialized empty slice, which serialized as JSON null
- GitSyncPage: add optional chaining on status.files for defense
2026-02-13 14:21:36 +08:00
Willie 9ee5324689 feat: enhance security audit thresholds, logging, and UI 2026-02-13 14:21:36 +08:00
Willie af43a57ae2 feat: add JavaScript/TypeScript syntax highlighting in file viewer
Install @codemirror/lang-javascript and support .js, .ts, .jsx, .tsx,
.mjs, .mts, .cjs, .cts with proper language modes (including JSX and
TypeScript flags).
2026-02-13 14:21:36 +08:00
Willie e0c9499c14 fix: parse YAML block scalars in frontmatter and use CodeMirror for all file types
Two related UI fixes for the skill detail page:

1. YAML block scalar parsing: description fields using >-, >, |, |-
   syntax showed the raw indicator instead of the parsed value. Fix
   both frontend (parseScalarValue) and backend (ParseFrontmatterField)
   to recognize block indicators and read indented continuation lines.

2. File viewer: non-markdown files (.py, .sh, etc.) rendered as plain
   <pre> without line numbers or highlighting. Now all non-markdown
   files use CodeMirror, with Python syntax highlighting via
   @codemirror/lang-python.
2026-02-13 14:21:36 +08:00
Willie 3a132ab72e fix: update nested skills by full relative path in Web UI
The Update button on SkillDetailPage passed only the skill basename
(e.g. "ascii-box-check") instead of the full relative path
("utils/ascii-box-check"), causing "not found as tracked repo or
updatable skill" errors for nested skills.

- Frontend: use skill.relPath instead of skill.name for non-repo skills
- Backend: rewrite getServerUpdatableSkills with filepath.WalkDir so
  Update All also discovers nested skills
2026-02-13 14:21:36 +08:00
Willie aa43f94892 feat: add --into flag for skill install command
Allow installing skills into subdirectories for organized folder
structures. Works with all install modes (direct, discovery, tracked)
in both global and project mode.

- Add Into field to InstallOptions and IntoPath() validation
- Update 4 dest-path construction points in CLI with destWithInto()
- Update InstallTrackedRepo for --into prefix in dest and gitignore
- Rewrite ReconcileProjectSkills to use filepath.WalkDir (recursive)
- Add --into to Web UI install handler, API client, and form
- Add 5 integration tests covering local, multi-level, validation,
  project mode, and no-source rejection
2026-02-13 14:21:36 +08:00
Willie 2c982848c5 feat: classify HIGH audit findings as warnings and refresh docs/playground 2026-02-11 10:10:09 +08:00
Willie 927bad707e feat: add audit rules Web UI page with create/edit support
Add REST API (GET/PUT/POST /api/audit/rules) for managing custom
audit-rules.yaml through the web dashboard. Extract template and
validation logic from CLI into reusable audit package functions
(ValidateRulesYAML, InitRulesFile, DefaultRulesTemplate). Frontend
provides CodeMirror YAML editor with dirty tracking, file creation
flow, and mode-aware path display. Sidebar nav gains overflow scroll.
2026-02-11 04:36:58 +08:00
Willie 84ba16802d feat: add log filtering, improve log UX, and custom dropdown
- Add --cmd, --status, --since, --json flags to CLI log command
- Auto-skip irrelevant log section when --cmd narrows to one file
- Add blank line separator between log entries for readability
- API returns totalAll and commands for smarter frontend filtering
- Custom HandSelect dropdown matching hand-drawn design system
- Empty state distinguishes "no matching entries" from "no entries"
- Update website docs and built-in skill reference with new flags
2026-02-11 03:40:54 +08:00
Willie e5813cc7e0 feat: add oplog instrumentation to all API handlers, improve audit/log/sync CLI
- Add oplog write helpers to server (oplog_helper.go) and instrument
  all handler_*.go endpoints with ops/audit logging
- Improve audit CLI with structured auditRunSummary and severity counts
- Enhance log CLI with richer filtering and detail display
- Improve sync CLI with drift detection summaries in oplog
- Reorder web UI sidebar nav by user workflow (core → acquire → distribute → maintain → monitor)
- Enhance LogPage with better formatting and filtering
- Add server oplog unit tests (logging_test.go, log_test.go)
- Update docs for log command and quick-reference
2026-02-10 03:50:03 +08:00
Willie 14bb54d6bd fix(log): show target count in sync log details
CLI formatLogDetail and Web UI formatDetail now display the "targets"
arg as "N target(s)" so sync entries are no longer blank in Details.
2026-02-10 03:16:04 +08:00
Willie f2017a35aa feat: fix tracked repo discovery, improve naming, and unify project list
Sync discovery (DiscoverSourceSkills) was skipping all hidden directories
via utils.IsHidden(), causing skills inside .curated/ and .system/ (like
openai/skills) to be invisible after install. Now only .git is skipped,
matching the install-time discovery that was already fixed in 8ec5306.

Tracked repo naming now uses owner-repo format (e.g., _openai-skills
instead of _skills) via new Source.TrackName() method, preventing
collisions between repos that share the same basename.

Project-mode `list` command now uses recursive DiscoverSourceSkills()
instead of shallow os.ReadDir(), aligning with global list and web UI
behavior so tracked repo skills are visible everywhere.

Also includes CHANGELOG for v0.11.0, README updates, docs improvements,
and minor UI nav reorder.
2026-02-10 03:13:21 +08:00
Willie 5a65993304 feat: add operation log — JSONL-based persistent audit trail for CLI, API, and web UI
Add oplog package (internal/oplog) that records every mutating command
(install, uninstall, sync, push, pull, collect, backup, restore, update,
audit) as a JSONL entry with timestamp, status, duration, and args.

- CLI: `skillshare log` with --audit, --tail, --clear, --project flags
- API: GET/DELETE /api/log endpoints with type and limit params
- Web UI: LogPage with ops/audit tabs, table view, clear and refresh
- Instrumentation across 12 command handlers (CLI + server)
2026-02-10 02:56:59 +08:00