Commit Graph
1496 Commits
Author SHA1 Message Date
Willie 36e22477fe feat(theme): add internal/theme package with palettes and detection
Introduces a unified light/dark terminal theme system:
- Theme struct with sync.Once-backed Get()/Reset() singleton
- darkPalette (softened Primary from 15 to 252) and lightPalette
  (new, WCAG AA compliant against white backgrounds)
- Style constructors (Primary, Muted, Accent, Success, Warning,
  Danger, Info, Title, SelectedRow, Badge, Severity)
- ANSISet for plain CLI output
- Resolution precedence: NO_COLOR > SKILLSHARE_THEME > OSC 11 probe
  > dark fallback
- 300ms timeout on OSC 11 probe with documented goroutine leak tradeoff
- canDetect() gate for non-TTY, CI, TERM=dumb, Windows-safe
- WCAG contrast tests as regression guard for future palette edits

NO_COLOR env var follows the no-color.org spec: only activates when
set AND non-empty (empty string does not enable no-color mode).

This commit adds the package but does not migrate any existing
callers. The next commits migrate list TUIs (fixes #125), plain CLI
output, and remaining TUIs.

Refs: #125
2026-04-10 14:26:44 +08:00
Willie 275fe3eece test(testutil): add RunCLIEnv helper for env-var-based CLI tests
Enables upcoming theme system tests that need to run the CLI with
custom SKILLSHARE_THEME or NO_COLOR env vars.
2026-04-10 14:15:11 +08:00
Willie 8d8434d6d8 fix(ui): remove pop-in check progress bar to avoid layout shift
The large StreamProgressBar appeared between the PageHeader and the tab
bar when checking started, pushing the whole list down. Loading state
is already conveyed by the Check All / Check Selected button spinners
and the per-item 'Checking' badges, so the big bar was redundant.
2026-04-10 13:40:43 +08:00
Willie c501e55c1d fix(ui): propagate tracked repo check status to all items in the repo
Check results were keyed by repo directory name (e.g. _awesome-claude-agents)
while UI items used per-skill names (api-architect, backend-developer, ...).
applyCheckResult now iterates updatable items and maps each repo's status
to all items belonging to it, so tracked repo entries no longer get stuck
in the Checking state.
2026-04-10 12:00:33 +08:00
Willie 17ab4aaeb2 feat(ui): add skills/agents tabs and group-based sort to UpdatePage 2026-04-10 11:55:14 +08:00
Willie 03a7b7ab13 refactor(ui): fix quality issues in UpdatePage — EventSource leak, dedup status cards, shared glob utility
- Store api.updateAllStream() return value in esRef so unmount cleanup
  closes both check and update EventSource connections
- Extract ItemStatusCard component to deduplicate ~50 lines of per-item
  status card rendering between updating and done phases
- Wrap successCount/skippedCount/blockedCount/errorCount in a single
  useMemo pass instead of 4 separate .filter() calls
- Move globToRegex to ui/src/lib/glob.ts shared utility, imported by
  both UpdatePage and BatchUninstallPage
2026-04-10 03:56:33 +08:00
Willie 7537872743 fix(ui): address spec compliance issues in UpdatePage
- CheckItemStatus: change from flat string union to interface with
  status, message?, and behind? fields; applyCheckResult now preserves
  repo.behind and repo.message; CheckStatusBadge renders 'N behind'
- Done phase: blocked items now show Force Retry button (variant=warning)
- Search filter: add globToRegex for glob pattern matching (* and ?)
- Check button loading: track checkMode ('all'|'selected'|null) state
  so loading spinner shows on the correct button regardless of selection
2026-04-10 03:48:29 +08:00
Willie 49dcbd01c8 fix(doctor): exclude disabled agents from drift count
Doctor was passing all discovered agents (including those disabled
via .agentignore) to the agent target drift check, inflating the
expected count. This caused false drift warnings like '33/66 agents
linked' when the 33 missing agents were actually ignored.

Filter with resource.ActiveAgents() before passing to
checkAgentTargetInline, matching the pattern used by sync and
all server handlers.
2026-04-10 03:42:18 +08:00
Willie 3df973c8bb feat(ui): redesign UpdatePage with selecting/updating/done phases
Replace the old idle/updating/done flow with a new three-phase state machine:

- selecting: Virtuoso checkbox list of all tracked + GitHub skills with
  sticky search bar, SegmentedControl type filter (All/Tracked/GitHub),
  Select All/Deselect All, and per-item CheckStatusBadge
- updating: StreamProgressBar + per-item status cards with auto-scroll
- done: Summary card with badges + per-item result cards with
  Force Retry/Purge buttons + Back to List

Key changes:
- No auto-check on mount; manual Check All / Check Selected buttons
- Check results stored in Map<string, CheckItemStatus> with 6 states
- Unified selection via Set<string> (no split repos/skills)
- Repo deduplication in handleUpdate (same repo = one update)
- Action buttons in PageHeader (not bottom bar)
- No confirm dialog before update
- useQuery for skills list (replaces inline SSE-only check)
2026-04-10 03:41:20 +08:00
Willie 0efdb643b2 feat(ui): add .agentignore tab to Config page
Add GET/PUT /api/agentignore endpoints mirroring the existing
skillignore API, backed by skillignore.ReadAgentIgnoreMatcher()
and resource.AgentKind{}.Discover() for ignore stats.

On the frontend, extend the Config page with a third tab for
editing .agentignore. Generalize the former SkillignoreTab into
a shared IgnoreTab component with a kind prop, and extend
AssistantPanel to show ignored agents in the sidebar.
2026-04-10 03:38:43 +08:00
Willie 379407e3dd fix(ui): use GitBranch icon instead of folder for tracked repos in tree view
Tracked repo folders now show a single GitBranch icon replacing the
folder icon, avoiding the awkward two-icon layout.
2026-04-10 03:22:55 +08:00
Willie abeb5b9392 fix(ui): unify resource terminology and compact action bars
- Rename 'Uninstall Skills' → 'Uninstall Resources' on BatchUninstallPage
- Rename 'Pull local skills' → 'Pull local resources' on CollectPage
- Rename 'Push your skills' → 'Push resources' on SyncPage
- Compact Sync/Collect action bars: inline SegmentedControl + button
  on the same row instead of stacked vertically
- Replace badge grid sync summary with inline text stats (dot-separated)
  showing totals with a secondary skill/agent breakdown line
- Simplify 'all in sync' state to single-line inline layout
2026-04-10 03:15:03 +08:00
Willie 0838ee6367 fix(ui): replace Track badge with GitBranch icon in tree view
The badge looked out of place in the folder tree. A subtle GitBranch
icon integrates better with the tree aesthetic.
2026-04-10 03:14:20 +08:00
Willie 8970a5ee56 fix(ui): sort table view by group/repo before name
Items from the same tracked repo or directory group are now sorted
together instead of being interleaved alphabetically by name alone.
2026-04-10 03:13:15 +08:00
Willie 7a319fa8f3 fix(ui): remove duplicate Track badge from card view
The Track badge in SkillPostit was redundant with the existing Tracked
indicator at the bottom. Revert to Users icon — Track badge is only
used in the folder tree view.
2026-04-10 03:12:15 +08:00
Willie cbbfcde390 fix(ui): improve Sync page stats layout and ignored section grouping
- Replace flex-wrap badge layout with CSS Grid for aligned KindBadge rows
- Fix ignored count showing only skills instead of total (skills + agents)
- Group ignored items by kind (skill/agent) with KindBadge sub-headers
- Increase spacing between groups for better visual hierarchy
2026-04-10 02:38:44 +08:00
Willie 0e314e19e3 fix(ui): apply Track badge and name formatting to sticky folder header 2026-04-10 02:26:47 +08:00
Willie 3c4d057950 refactor(ui): centralize display name formatting via resourceNames utilities
Replace 25+ inline .replace(/__/g, '/') calls with shared utilities:
- formatSkillDisplayName() for flat name → path conversion
- formatTrackedRepoName() for tracked repo name display (strip _ + unflatten)
- formatAgentDisplayName() for agent names (.md removal + unflatten)

Consolidate error toasts into single summary in DashboardPage update-all.
Remove duplicate displayPath() in BatchUninstallPage (was reimplementing
formatSkillDisplayName).

Backend: refactor agentIgnorePayload to accept pre-discovered agents,
eliminating duplicate filesystem traversal in sync/diff handlers.
2026-04-10 02:25:27 +08:00
Willie 92d5fc66ba fix(agents): exclude convention files and respect agents/ subdir in tracked repos
Agent discovery was treating non-agent files (CLAUDE.md, AGENTS.md, etc.)
as agent resources when they appeared in tracked repos.

Two fixes:
- Expand ConventionalExcludes with 7 well-known convention filenames
  (CLAUDE.md, AGENTS.md, GEMINI.md, COPILOT.md, CONTRIBUTING.md,
  CODE_OF_CONDUCT.md, SUPPORT.md)
- For tracked repos with an agents/ subdirectory, only discover files
  inside agents/ — skip repo root files and other subdirs (docs/, etc.)

Also includes UI polish:
- Display flat names (__ separator) as path separators in toasts/labels
- Consolidate batch install errors into single toast
- Show .agentignore state in sync diff/preview responses
- Track badge + friendly repo name in resource list/folder tree
2026-04-10 02:14:15 +08:00
Willie 5c99a1cb9f feat(ui): audit cache invalidation, agent target display, UX polish
- auditCache: centralized cache with installed-count staleness check
- resourceNames: agent display name formatting (strip .md suffix)
- AuditPage: skip audit when 0 installed, show empty state per kind
- clearAuditCache on install/uninstall/update across all pages
- ResourcesPage: agent target summary, context menu for agents
- FilterStudioPage: agent display name in preview search
- SkillPickerModal: accessible radio button (button element)
- fieldDocs: agents sub-keys no longer marked reserved
- Integration tests: diff/sync prune after uninstall-all, tracked agent install
2026-04-10 02:05:23 +08:00
Willie da000c4d07 feat(server): agent tracked repo install, prune-on-empty, audit guards
- appendAgentDiffs helper deduplicates diff/stream agent logic
- handler_agent_diff: skip local copies, junction-aware checks
- handler_sync: prune orphan agents even when source is empty
- handler_install: tracked agent repo auto-detection and routing
- handler_skills: expose RepoRelPath and Targets for agents
- handler_skills_batch: agent target assignment via frontmatter
- handler_sync_matrix: pass agent Targets to ClassifySkillForTarget
- handler_update: tracked agent repo git pull update
- handler_audit: guard empty/missing source dirs gracefully
- Tests for all of the above
2026-04-10 02:05:13 +08:00
Willie 40dca838db fix(cli): agent diff drift detection and sync prune when source empty
- diff_agents: detect symlink drift, local copy blocking, fix prune count
- sync_agents: continue to prune targets when source has no agents
  instead of returning early, matching skills behavior
2026-04-10 02:05:06 +08:00
Willie b23425aafd feat(cli): tracked agent repo support in install, check, update, doctor
- install: --agent + --track validation, InferTrackedKind dispatch
- install_handlers: agent kind routing, renderTrackedAgentRepoMeta
- check: enrich tracked agents with remote status (update_available, dirty)
- update_agents: batchUpdateAgents with tracked repo git pull
- list: agent repo URL fallback via RepoRelPath
- doctor: filter-aware agent count, project mode version check
2026-04-10 02:05:01 +08:00
Willie 7e30699eaa feat: add tracked agent repo discovery and install support
- DiscoveredResource gains RepoRelPath and Targets fields
- AgentKind.Discover populates RepoRelPath via findTrackedRepoRelPath
- AgentCheckResult gains RepoPath and dirty status for tracked repos
- InferTrackedKind auto-detects pure-agent repos for --track install
- TrackedRepoResult reports AgentCount and Agents list
2026-04-10 02:04:55 +08:00
Willie b8a189ba58 Improve resource install agent support
Add local-path resource discovery so install flows can detect agents as well as skills. Preserve nested agent paths and suffixless agent metadata keys during batch install and update, and refresh the UI copy to use resource-aware wording on the install surface.
2026-04-10 01:26:40 +08:00
Willie 35fcb7475b feat(ui): add SegmentedControl for agent scope on Collect page
CollectPage now has Skills/Agents/Both scope selector matching
SyncPage pattern. Scan and collect operations pass kind to API.
Selected set uses 3-segment key (target/kind/name) to prevent
collision between skills and agents with same name.
2026-04-10 00:28:39 +08:00
Willie bf2aff0059 feat(ui): extend collect API client with kind parameter
collectScan now accepts optional kind param for agent scanning.
collect method items accept optional kind field.
2026-04-10 00:25:53 +08:00
Willie 4b37f1f21d feat(server): extend collect endpoint to pull agents via kind field
collectSkillRef now has optional kind field. Items with kind=agent
are resolved against agent target paths and pulled via PullAgents().
Results from skills and agents are merged into a single response.

Oplog tracks skill and agent counts separately for observability.
2026-04-10 00:25:25 +08:00
Willie 4834e4580d feat(server): extend collect scan to support kind=agent parameter
handleCollectScan now accepts ?kind=skill|agent query parameter.
When kind=agent, scans for local agent files in agent target dirs.
When kind is empty, scans for both skills and agents.
2026-04-10 00:20:01 +08:00
Willie a73d55dc26 refactor: extract agent helpers and simplify duplicated patterns
- Extract agent_helpers.go: kind constants, discoverActiveAgents(),
  resolveAgentPath(), builtinAgentTargets(), mergeAgentDiffItems()
- Replace 3 inline agent path resolution blocks with resolveAgentPath()
- Replace 3 inline agent discovery blocks with discoverActiveAgents()
- Replace 2 inline diff merge blocks with mergeAgentDiffItems()
- Fix handleSync prune triple-scan: capture index from merge pass
- Frontend: replace 10 filter() calls with single useMemo reduce pass
- Use kind constants instead of raw strings across all server files
2026-04-10 00:02:53 +08:00
Willie d4bd0a66df docs(sync,diff): fix agent sync description and add agent diff section
- Fix sync.md: 'sync' defaults to skills only, not skills+agents
- Fix --all flag description: syncs skills + agents + extras
- Add 'sync agents' to usage examples
- Add Agent Diff section to diff.md with usage examples
2026-04-09 23:56:03 +08:00
Willie 294be5f08a docs(ui): update sync page and API description for kind param
- Sync page now has scope selector (Skills / Agents / Both)
- POST /api/sync accepts kind param
2026-04-09 23:53:25 +08:00
Willie 568d2b7f64 fix: address code review findings
- Fix data race: read agentsSource inside RLock in handleDiffStream
- Validate kind param in handleSync (reject invalid values)
- Add test for symlink-points-elsewhere agent diff case
- Always show KindBadge on DiffItemRow (default to 'skill')
2026-04-09 23:50:42 +08:00
Willie 3dfbff7f53 feat(ui): add sync scope control and kind-separated summary
- SegmentedControl with Skills / Agents / Both options (default: Both)
- Sync button text and API kind param change with selection
- Diff summary shows separate skill/agent counts with KindBadge
- Split button labels (Force Sync) also reflect scope
2026-04-09 23:44:33 +08:00
Willie dfd69b7ea0 feat(ui): add kind param to sync API client
Accepts 'skill' | 'agent' to control sync scope.
2026-04-09 23:42:36 +08:00
Willie d1ac3dd649 feat(server): support kind param in POST /api/sync
Accept 'kind' field in sync request body:
- 'skill': sync skills only (current behavior)
- 'agent': sync agents only via SyncAgents()
- '' (empty): sync both skills and agents

Agent sync uses existing SyncAgents/PruneOrphanAgentLinks/PruneOrphanAgentCopies.
Remove agent-exists-but-no-target warning (now obsolete).
2026-04-09 23:41:16 +08:00
Willie 55e2e0e5b3 feat(server): include agent diffs in handleDiff and handleDiffStream
- Discover agents from agentsSource() and compute per-target diffs
- Merge agent diff items into existing target results
- Set Kind='skill' on all existing skill diff items
- Set Kind='agent' on all agent diff items
- Targets without agentPath are skipped (matches CLI behavior)
2026-04-09 23:38:37 +08:00
Willie 335092066f feat(server): add computeAgentTargetDiff for agent diff in UI
Port agent diff logic from CLI (diff_agents.go) to server package.
Returns []diffItem with Kind='agent' for link/update/prune/local actions.
2026-04-09 23:34:21 +08:00
Willie aaabc3ad88 refactor: simplify audit code — constants, dedup helpers, cache pattern
- Add audit.CrossSkillResultName constant, use in Go + TS
- Merge toAuditInputs/toAgentAuditInputs into one with isFile param
- Extract discoverForKind() and toInputsForKind() to eliminate 5+ if-else branches
- Simplify launchAuditTUIWithTabs with otherKindFilter dispatch
- Use CROSS_SKILL_NAME constant in AuditPage.tsx
2026-04-09 16:23:01 +08:00
Willie f0f371c604 fix(list): group agents by directory in TUI
Set RepoName from parent directory for nested agents so
buildGroupedItems creates proper group headers (e.g. demo (27))
instead of putting all agents under standalone.
2026-04-09 16:07:07 +08:00
Willie ed924c9193 fix(list): fix tab bar clipped off screen in split layout
Panel height calculation was off by 1 (subtracted 7 but actual
overhead is 8 lines), causing the tab bar to be pushed above the
visible terminal area.
2026-04-09 16:02:05 +08:00
Willie ff1aedfd1a fix(audit): group agents by directory in TUI
auditRepoKey now groups any nested path (e.g. demo/code-reviewer.md)
by its first segment, not just tracked repo prefixes starting with _.
This gives agents the same directory grouping as the Resources page.
2026-04-09 15:41:29 +08:00
Willie 33cbd17ddc fix(audit): show 'No skills/agents' instead of 'No items' in TUI
Set list item name per tab so empty state shows contextual message.
Also align empty state text with left padding matching list title.
2026-04-09 15:39:18 +08:00
Willie 4c0674ddc1 fix(audit): set agentsSourcePath in project mode for TUI tab
Project mode was missing agentsSourcePath assignment, causing
Agents(0) in TUI even when agents exist. Also simplifies the
kind-based source selection to use the existing override at line 217.
2026-04-09 15:38:02 +08:00
Willie 486f13513e fix(audit): exclude _cross-skill from TUI tab counts
Filter out synthetic _cross-skill result before passing to TUI.
Fixes Skills(7) showing when only 6 real skills were scanned.
2026-04-09 15:35:45 +08:00
Willie 12490620b0 fix(ui): audit card icon color follows max severity
Icon/border color now maps to the highest severity finding in the card:
CRITICAL → red, HIGH/MEDIUM → orange, LOW → blue, INFO → gray.
Previously all non-blocked cards used the same orange regardless of
severity, making it impossible to gauge severity at a glance.
2026-04-09 15:29:10 +08:00
Willie e1c6549129 fix(ui): fix audit summary mixing agent counts with finding counts
Summary line now shows only consistent metrics:
- scanned/passed/blocked/with findings (all agent-level)
- total finding count (clearly labeled)
Removed low/info severity counts that were confusing because they
counted findings while adjacent numbers counted agents.
2026-04-09 15:24:44 +08:00
Willie 01a6f662c6 fix(ui): exclude _cross-skill from audit card count and show separately
Cross-skill analysis is a synthetic result, not an actual scanned
resource. Separating it fixes the mismatch between summary counts
(e.g. '4 warnings') and visible card count (was showing 5 cards).
Now shown as a distinct 'Cross-resource analysis' section.
2026-04-09 15:14:57 +08:00
Willie 91eabf3369 feat(ui): cache audit results with React Query
SSE scan results are written to query cache on completion. Navigating
away and back shows cached results instead of requiring a re-scan.
Cache expires after 5 minutes (staleTimes.audit). Per-kind cache keys
ensure skills and agents results are independent.
2026-04-09 15:02:46 +08:00
Willie 40347477d5 fix(audit): scan all agents including disabled ones
Security audit should scan ALL agents regardless of .agentignore
status — disabled agents may still contain threats.
2026-04-09 14:49:24 +08:00