Commit Graph
589 Commits
Author SHA1 Message Date
Willie 5d9a77372d feat(init): label universal as shared agent directory and add coexistence docs
- Change universal description from "(recommended)" to "(shared agent directory)"
  in detect, checklist, and discover flows
- Add FAQ section on using universal alongside npx skills: merge vs copy mode
  differences, name collision caveats, lock file visibility
- Add universal info admonition to supported-targets page
- Add E2E runbook for universal target path verification
- Update CHANGELOG and release notes for v0.16.4
2026-02-28 03:44:02 +08:00
Willie 1a207e6d2c feat(audit): add fetch-with-pipe, ip-address-url, and data-uri rules
Add 5 new audit rules (31 → 36 total) to close detection gaps:

- fetch-with-pipe (HIGH ×3): curl/wget piped to sh/bash/python/node/etc.
  Previously only double-pipe (||) was caught by shell-chain; single
  pipe (|) to interpreters — the classic RCE vector — was undetected.
- ip-address-url (MEDIUM): URLs with raw IP addresses that bypass DNS
  security controls; excludes RFC 1918 and loopback ranges.
- data-uri (HIGH): data: URIs in markdown links that may embed
  executable content.

fetch-with-pipe is suppressed inside markdown code fences (tutorial
context), matching existing behavior for destructive-commands et al.

Includes unit tests (25 cases), code fence suppression test, red team
TC-18 through TC-21, and audit.md documentation updates.
2026-02-28 03:44:02 +08:00
Willie 8997196593 fix(init): correct universal target path and auto-include in init
The universal target pointed to ~/.config/agents/skills (wrong) instead
of ~/.agents/skills, causing `npx skills list` to miss synced skills.

Also auto-recommend universal as a target whenever any CLI is detected
during `init` and `init --discover`, since ~/.agents/ won't exist on
disk until skillshare creates it.

Closes #54
2026-02-28 03:44:02 +08:00
Willie 79f26f2e98 fix(docs): correct broken anchor link in docker-sandbox page
#interactive-playground → #playground to match the actual heading ID.
2026-02-28 03:44:02 +08:00
Willie 1c84866eeb docs: add install duplicate detection docs and v0.16.4 changelog
- Add Duplicate Detection section to install.md (same-repo skip,
  cross-path detection, conflict with different repo)
- Update --force flag description to mention dedup override
- Add v0.16.4 changelog entry to CHANGELOG.md and website
2026-02-28 03:44:02 +08:00
Willie 666091a453 feat(install): add cross-path duplicate detection and same-repo skip
Prevent accidental duplicate installs when the same repo is already
installed at a different path (e.g., --into vs root). Same-repo
reinstalls now show a friendly skip indicator instead of an error.

- Add CheckCrossPathDuplicate() with URL normalization (HTTPS/SSH)
- Add ErrSkipSameRepo sentinel for graceful skip flow control
- Add checkExistingConflict() with repo URL comparison
- Fix --force hint to use repo URL (not per-skill subpath) and
  include --into when applicable
- Add dedup check to Web UI install endpoints (HTTP 409)
- Group skipped skills by directory with repo label in summary
2026-02-28 03:44:02 +08:00
Willie 0f2d66e18a refactor(update): align batch summary with sync-style single-line format
Replace verbose SuccessMsg summary with UpdateSummary() matching
SyncSummary's clean single-line stats format with color coding.
2026-02-28 03:44:02 +08:00
Willie 41fe18b3be fix(update): normalize empty Subdir to "." for root-level skill repos
Root-level skills (SKILL.md at repo root) have meta.Subdir="" but
discoverSkills() returns Path=".". The mismatch caused lookup failure
in batch update, falsely reporting these skills as stale/deleted.
2026-02-28 03:44:02 +08:00
Willie 00cb3ba80e feat(targets): add Verdent AI coding agent
Add Verdent (verdent.ai) as a built-in target with standard skill paths.
Update target count from 49+ to 50+ across README, homepage, and docs.
Sync changelog and release notes with the new target entry.
v0.16.3
2026-02-27 05:39:49 +08:00
Willie 988a9b7213 docs: sync website changelog and update changelog skill to cover both files
The changelog skill previously only updated root CHANGELOG.md, leaving
website/src/pages/changelog.md out of sync. Added Step 6 to the skill
workflow for syncing the website version, and backfilled missing v0.16.2
and v0.16.3 entries into the website changelog.
2026-02-27 05:39:49 +08:00
Willie 217af0782c fix(install): respect quiet mode for tracked config dry-run 2026-02-27 05:39:49 +08:00
Willie dc62efdb40 fix(list,log): skip TUI when async load returns empty results
When list or log TUI loads zero items asynchronously, exit the TUI
immediately and print a plain-text hint instead of showing an empty
interactive screen. Uses an emptyResult flag on the TUI model to
signal the caller after tea.Quit.
2026-02-27 05:39:49 +08:00
Willie cfbcaaff9e fix(uninstall): fix stale summary, skip message, and pluralization UX
After pre-flight filters out dirty tracked repos, recalculate summary
so spinner and confirm prompt use correct noun type. Print skip count
when repos are skipped. Replace all "(s)" patterns with pluralS() for
natural English output ("2 groups" not "2 group(s)"). Add isMixed()
method to avoid magic string comparison on noun().
2026-02-27 05:39:49 +08:00
Willie 87abb6e049 feat(install): replace spinner with tree-style progress and summary output
Switch config install and search install UI from plain spinner to
TreeSpinner with StepResult summary showing installed/skipped/failed
counts and elapsed time. Add git clone progress callback to spinners
so users see real-time cloning status.

- Add Quiet field to InstallOptions for suppressing per-skill output
- Add Skipped field to ConfigInstallResult for accurate summary
- Update integration test assertion to match new summary format
2026-02-27 05:39:49 +08:00
Willie c7f8a86c62 feat(install): group config skills by repo to avoid redundant clones
When a registry has multiple skills from the same git repo,
InstallFromConfig now clones the repo once and installs each skill
from the local clone via InstallFromDiscovery. This mirrors the
optimization already present in search_batch.go for hub installs.

The install flow is restructured into 4 phases:
1. Tracked repos (unchanged, each does its own clone+discover)
2. Grouped plain skills (clone once per repo, install from discovery)
3. Singles (unchanged per-skill Install flow)
4. Reconcile config

Skills that fail to match in grouped discovery fall back to Phase 3.
2026-02-27 05:39:49 +08:00
Willie 2e976233b4 docs: fix alt text for skills screenshot in README 2026-02-27 05:39:49 +08:00
Willie 0a28fcdbdb fix(search): preserve canonical repo source in grouped installs
Use a repo-root source in grouped search installs by normalizing from CloneURL instead of carrying subdir Raw values. This prevents malformed metadata sources (for example duplicated subdir paths) and keeps provider-agnostic behavior for GitHub/GitLab/Bitbucket/Azure and SSH URLs.

Also centralize discovery source formatting for metadata so whole-repo SSH installs use //subdir syntax consistently.

Add regression coverage:
- cmd unit tests for grouped clone source normalization across providers
- install unit tests for discovery source formatting (including SSH)
- integration test in tests/integration that verifies grouped install metadata source round-trips through ParseSource.
2026-02-27 05:39:49 +08:00
Willie 5a111ce8f6 fix(search): use provider-agnostic source for repo-grouped cloning
Replace GitHub-specific GitHubOwner()/GitHubRepo() calls with a
value copy of the parsed source, clearing only Subdir. Fixes empty
Raw/Name for GitLab, Bitbucket, and Azure DevOps batch installs.
2026-02-27 05:39:49 +08:00
Willie f29b4ac1b8 fix(sync): dereference directory symlinks in copy mode and update changelog
Copy mode now resolves directory symlinks to concrete directories,
preventing broken symlinks in targets that use file copying (e.g.,
Windsurf). DirChecksum follows symlinks for consistent hash comparison.
DirMaxMtime disables mtime fast-path for symlink-containing skills to
avoid stale cache hits. Cycle detection prevents infinite recursion.

Also updates CHANGELOG v0.16.3 with previously missing entries:
hub risk badge colors, batch failure output, repo-grouped cloning.
2026-02-27 05:39:49 +08:00
Willie 76482a5c09 feat(search): colorize risk badges in hub TUI with lipgloss
Replace plain-text risk badges with lipgloss-styled colored versions
in the search TUI list and detail panel, matching the severity color
palette used elsewhere. Add CHANGELOG entry for v0.16.3.
2026-02-27 05:39:49 +08:00
Willie 48b670220d fix(search): improve batch install failure output readability
Classify failure details by type (security/ambiguous/not found) with
distinct icons and colors. Truncate long ambiguous path lists and audit
findings to 3 lines + "(+N more)" to prevent screen flooding. Add
breathing room between multi-line entries. Highlight skill names in
bright white for better scanability.

Also includes repo-grouping refactor: skills from the same git repo
are cloned once and installed from the shared clone, with extracted
helpers (groupByRepo, installFromDiscoveryResult, logSkillInstallOp).
2026-02-27 05:39:49 +08:00
Willie dec449a898 fix(search): show git progress detail and reconcile once after batch install
- Show detailed git clone status (cloning 45%, resolving 67%) instead of
  static "installing..." by wiring up install.OnProgress callback
- Only show actively installing skills in progress area (skip queued/done)
- Move per-skill reconcile to single batch-level reconcile at end, fixing
  O(n²) directory walks that caused batch installs to appear stuck
2026-02-27 05:39:49 +08:00
Willie 9ef63572f3 revert(ui): switch progress bar back to pterm ProgressbarPrinter
The custom thread-safe progress bar (progress.go) had width overflow
issues. Revert to pterm's built-in ProgressbarPrinter which handles
terminal width calculation internally. Remove StartProgressWithMaxWidth
in favor of the simpler StartProgress API.
2026-02-27 05:39:49 +08:00
Willie 3a522c7ca9 fix(tui): add breathing room in list and log TUI footers
Add vertical spacing between panels, stats, and help bar in list and
log TUIs to match the audit TUI layout. Adjust panel heights to
compensate for the added lines.
2026-02-27 05:39:49 +08:00
Willie 044a0226aa refactor(ui): replace pterm progress bar with thread-safe implementation
pterm's ProgressbarPrinter has no internal mutex, causing race conditions
when multiple goroutines call Increment() concurrently — the final render
could show a stale count (e.g. 954/955 instead of 955/955). Additionally,
pterm's auto-stop (triggered when Current >= Total) made external Stop()
a no-op, preventing us from controlling the final display.

New progress.go implementation:
- Uses sync/atomic for thread-safe counter updates
- Stop() forces current=total and renders a final frame
- Adds StartProgressWithMaxWidth() to constrain bar width

Also in this commit:
- audit: hide per-skill scan list when TUI is active (summary only)
- audit: extract presentAuditResults() to deduplicate output logic
- audit: align progress bar width with header/summary box
- audit TUI: add breathing room between panels, stats, and help bar
2026-02-27 05:39:49 +08:00
Willie e4956c3ff1 fix(tui): unify layout and visual consistency across TUI panels
- Add colorSkillPath() for progressive luminance on nested skill paths
  (cyan group → gray sub-dirs → white skill name) in list and audit TUIs
- Move filter bar below panels in audit and log TUIs for consistent layout
- Align log TUI left panel width (25%, max 45) with audit TUI proportions
- Show elapsed time on pull/push completion messages
- Use relative paths in audit results for group hierarchy display
- Render license field in green, adjust content overlay spacing
2026-02-27 05:39:49 +08:00
Willie 61f413da2d fix(tui): hard-wrap content to prevent scroll clipping
Glamour tables and long lines can exceed the panel's text width.
Scroll calculations are based on logical line count, but lipgloss
wraps overflowing lines into extra visual rows, clipping the bottom.

Hard-wrap all content with ansi.Hardwrap before storing it, so
logical lines = visual lines and scrolling reaches the end.
Also bump contentViewHeight to termHeight-5 for breathing room.
2026-02-26 22:27:23 +08:00
Willie fe9f40b1b9 fix(tui): account for PaddingLeft in content panel width calculation
contentPanelWidth() returned the lipgloss panel Width which includes
padding, but renderMarkdown used it as the text wrap width. Lines
rendered 1 char too wide would wrap inside the panel, causing the
bottom content to be clipped by MaxHeight — making it impossible to
scroll to the end. Also fixes visual artifacts on table pipe chars
caused by mid-character line wrapping.
2026-02-26 22:27:23 +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 39439d2d70 fix(oplog): check write errors in rewriteEntries to prevent data loss
f.Write return values were silently discarded. On I/O failures (e.g.
ENOSPC), the function would continue and rename an incomplete temp file
over the original log, causing silent data corruption.
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 5186d86a3f fix(log): --stats --cmd audit now reads audit.log instead of operations.log
runLogStats() only checked the --audit flag to pick the log file,
ignoring filter.Cmd. This caused `log --stats --cmd audit` to read
operations.log and report "No log entries" even when audit data existed.

Align with runLog() by also checking f.Cmd == "audit".
2026-02-26 22:27:23 +08:00
Willie c0b3f878da fix(sync,log): canonicalize group key to prevent race; honor max_entries: 0
P1: sync_parallel grouped targets by raw path string, so the same
physical directory with different representations (trailing slash,
relative segments, symlink aliases) could be placed in separate groups
and written concurrently. Resolve paths via filepath.Clean → Abs →
EvalSymlinks (walking up to the nearest existing ancestor when the
leaf doesn't exist yet) before using them as group keys.

P2: LogConfig.MaxEntries was int, making 0 (explicit unlimited)
indistinguishable from "not set". Changed to *int so nil = default
(1000), 0 = unlimited, >0 = user value, <0 = fall back to default.
2026-02-26 22:27:23 +08:00
Willie ace94c8756 feat(diff): rewrite output with action-oriented labels and overall summary
Replace cryptic internal terminology (+/~/- source only, local copy, etc.)
with action-oriented messages that tell users what to do next (→ sync will
add, ⚠ local copies, ← collect will import). Add overall summary line at
top ("N targets need sync, N fully synced"). Show conditional hints that
only mention --force when local copies actually exist. Use full command
names (skillshare sync) in hints.
2026-02-26 22:27:23 +08:00
Willie 0afab5cb7b fix(sync): resolve race condition for targets sharing the same path
Multiple targets (e.g. universal/amp/kimi/replit) share ~/.config/agents/skills.
Parallel sync caused concurrent goroutines to race on os.Symlink for the same
destination, producing "file exists" errors.

Fix: group entries by resolved target path so same-path targets run sequentially
within one goroutine. Different-path targets remain fully parallel.

Also addresses PR #52 review feedback:
- audit: replace O(N²) findElapsed with O(1) index-aligned elapsed slice
- test-brew-upgrade: explicit go check + mktemp -d (replaces || true and /tmp)

Add 6 integration tests covering shared-path race condition, idempotency,
--force mode, mixed paths, filters, and output verification.
2026-02-26 22:27:23 +08:00
Willie e80d921b3b docs: update v0.16.2 changelog with diff command, audit TUI, and performance improvements
Add missing entries for all user-facing changes since v0.16.1:
diff command, interactive audit TUI, list tree sidebar, log delete/stats,
parallel sync, mtime fast-path, cached discovery, batch search progress,
website revamp, and unified TUI palette.
2026-02-26 22:27:23 +08:00
Willie 2a015865fd refactor(tui): unify color palette via shared tc struct and configureDelegate
Consolidate 30+ scattered lipgloss.NewStyle() calls across 6 TUI files
into a single tc (TUI colors) struct in tui_colors.go. Add configureDelegate()
helper to replace repetitive ~8-line delegate setup blocks with one call.

- ac/lc structs now reference tc base colors (Title, Dim, Green, Yellow, Red)
- list_tui detail panel: tracked repo and source URL now use tc.Cyan
- skillItem.Title(): inline color for name (bright white) and badge (green/gray)
- search_tui: enable description row (source + tags visible in list)
- Remove unused lipgloss imports from 4 files
2026-02-26 22:27:23 +08:00
Willie defff26147 feat(audit): add interactive TUI, progress bar, and large-scan UX improvements
- Add bubbletea TUI for multi-skill audit results (side-by-side layout
  with skill list + detail panel, severity sorting, fuzzy filter)
- Add progress bar during parallel scan via onDone callback
- Add --quiet/-q flag to suppress clean skill lines
- Add --yes/-y flag to skip large-scan confirmation prompt (>1000 skills)
- Add --no-tui flag to force plain text output
- Scale parallel workers to NumCPU (bounded 2–32) instead of fixed 8
- Use file cache in content-integrity check to avoid redundant disk reads
- Replace line splitting with streaming scan (avoid full []string alloc)
- Remove snippet truncation (preserve full trimmed line)
- Differentiate LOW (bright blue) and INFO (medium gray) severity colors
- Centralize log TUI color styles into `lc` struct
- Export DisplayWidth and add BoxWithMinWidth/HeaderBoxWithMinWidth for
  aligned header + summary box widths
- Update docs with TUI controls, new flags, and CI/CD auto-skip behavior
2026-02-26 22:27:23 +08:00
Willie 68945493aa fix(test): sync unit test assertions with current output formats
- list_tui_item_test: Title() now includes [local] badge, Description()
  returns "" for local skills (badge moved to Title)
- log_stats_test: renderStatsCLI wraps empty message with ANSI color codes
- install_subdir_license_test: license shown via StepContinue (spaced)
  instead of colon-delimited format
2026-02-26 22:27:23 +08:00
Willie ebda635ec7 feat(search): add batch progress display for multi-skill hub install
When selecting 2+ skills from `search --hub`, replace verbose per-skill
output with a pterm AreaPrinter progress display and final summary.

Single-skill selection retains the existing verbose path (StepStart +
TreeSpinner). The progress display follows the syncProgress/diffProgress
pattern: animated spinner, per-skill status, progress bar, and a
StepResult tree closure.

New file: search_batch.go (collect functions, progress driver, summary)
Modified: search.go (routing), search_tui.go (compact list for batch)
2026-02-26 22:27:23 +08:00
Willie 2b7ff5fa18 style: fix whitespace alignment in list_tui, log_tui, manifest 2026-02-26 22:27:23 +08:00
Willie ebdacd5b1b perf(sync): parallelize project-mode target syncing
Refactor cmdSyncProject to use runParallelSync (bounded semaphore)
instead of sequential per-target loop, matching global-mode behavior.
2026-02-26 22:27:23 +08:00
Willie 93858c1555 feat(diff): group output by (action, reason) for compact summary
When skill count is large (thousands), per-skill diff lines are
unreadable. Group items by (action, reason) instead:
- "local copy" shows count only (too numerous to list)
- Other reasons (content changed, source only, etc.) show count + names
- Sort: add → modify → remove
- Action hints (Run 'sync'...) printed once after all groups

Also:
- Hide progress bar for merge/symlink-only targets (instant diffs)
- Collapse isolated duplicate skill names to single summary line in sync
2026-02-26 22:27:23 +08:00
Willie 6f3a0a8a11 perf(diff): parallelize target scanning with bounded semaphore
Targets are now scanned concurrently (up to 8 workers) instead of
sequentially, reducing diff time from sum-of-all to max-of-slowest.
2026-02-26 22:27:23 +08:00
Willie 0fa1ef3a06 style(diff): add blank line between target list and progress bar 2026-02-26 22:27:23 +08:00
Willie f71d78ed92 feat(diff): combine target list with overall progress bar
Show all targets at once (spinner for active, queued for waiting,
checkmark for done) with an overall progress bar at the bottom
tracking total skills across all targets. Uses AreaPrinter for
the combined display, matching the pterm progress bar visual style.
2026-02-26 22:27:23 +08:00
Willie 223bb0b2f7 refactor(diff): use ui.ProgressBar for scanning progress
Replace custom AreaPrinter + goroutine spinner with the same
ui.StartProgress/Increment progress bar used by install, update,
and check commands. Bar tracks total skills across all targets,
with UpdateTitle showing the current target and skill name.
2026-02-26 22:27:23 +08:00
Willie 341132e7fe feat(diff): replace per-target progress bar with overall progress
Show an overall target progress bar (━━━──── 1/3 targets) at the
bottom of the multi-target progress display instead of per-target
progress bars. Only shown when there are multiple targets.
2026-02-26 22:27:23 +08:00
Willie ab80048efd feat(diff): add progress bar for copy mode targets
Copy mode targets now show a visual progress bar (████░░░░ 33%)
alongside the spinner during scanning. Merge/symlink mode targets
continue showing spinner-only since they complete instantly.
2026-02-26 22:27:23 +08:00