Commit Graph
545 Commits
Author SHA1 Message Date
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 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 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 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 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 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 353f0cb068 fix(ui): match audit tab style to resources page
Replace the button-style tabs (filled bg, border-2) in AuditPage with
the underline+icon+badge style used by ResourcesPage, TrashPage, and
BatchUninstallPage for visual consistency across tabbed pages.

- Use nav with role=tablist and aria-selected for accessibility
- Add Puzzle/Bot icons matching ResourcesPage tabs
- Show count badge only when data is available (tab.count != null)
- Apply ss-resource-tab class for shared underline transition style
2026-04-09 14:46:02 +08:00
Willie 833fc86632 feat(ui): add Skills/Agents tab bar to audit page
Tab bar switches between skills and agents audit scans. Each tab
caches results independently. API calls include ?kind parameter.
Display text dynamized for skill/agent context.
2026-04-09 14:36:32 +08:00
Willie 2475acd35e feat(ui): add agent support to batch uninstall and trash pages
- Add agent-mode batch uninstall handler with kind-based routing
  in handler_uninstall.go (skill/agent dispatch)
- Add Skills/Agents tab navigation to BatchUninstallPage and TrashPage
  with per-tab filtering and scoped empty states
- Extract SourceBadge component to replace duplicated getTypeLabel /
  skillTypeLabel helpers across ResourcesPage, ResourceDetailPage,
  BatchUninstallPage, and AnalyzePage
- Add kind field to BatchUninstallRequest API type
- Capitalize badge labels for consistency (tracked → Tracked, etc.)
2026-04-09 13:48:30 +08:00
Willie 5836a8802f feat: add agent filter support to Filter Studio, targets CLI, and overview API
Backend:
- PATCH /api/targets/:name accepts agent_include/agent_exclude fields
- POST /api/sync-matrix/preview returns agent entries with kind=agent
- GET /api/overview returns agentsSource and extrasSource paths
- Fix ResolveProjectTargets to resolve Agents sub-key (path + filters)
- Add agent filter CLI flags: --add-agent-include, --add-agent-exclude,
  --remove-agent-include, --remove-agent-exclude, --agent-mode
- Unify target list JSON/TUI to show agent info and filters

Frontend:
- FilterStudioPage: kind-driven single-context view (?kind=skill|agent)
- KindBadge: use design system tokens (ss-badge + wobble in playful)
- TargetsPage: link to Filter Studio with ?kind= param
- ResourceDetailPage: capitalize type labels (Local, GitHub)
- ResourcesPage: sync activeTab from URL searchParams on navigation
- DashboardPage: show agents/extras source dirs, link skills card
  with ?tab=skills for reliable tab switching
- API client: extend updateTarget and previewSyncMatrix for agent filters

Tests:
- Agent include/exclude round-trip persistence
- Invalid agent pattern returns 400
- Preview with agent entries and kind field
- No agent entries for targets without agent path
- CLI target agent filter integration tests
2026-04-09 03:50:28 +08:00
Willie 3db5e02137 feat(ui): redesign Targets page with equal Skills/Agents sections and modal picker
- Promote agents from nested dashed box to equal-level section panels
  with same visual treatment as skills (bg panel, label, controls)
- Move StatusBadge from card header into per-section labels
- Add agent mode dropdown (PATCH /api/targets/{name} now accepts agent_mode)
- Unify agent filter text to match skills pattern (All N agents / N/M agents)
- Add agentPath to available targets API and Add Target flow
- Convert inline Add Target form to DialogShell modal (max-h-[60vh])
- Add Agents Path input for custom targets and selected target preview
- Show both Skills/Agents paths in picker rows for supported targets
2026-04-09 03:13:49 +08:00
Willie f5af6c3909 feat(ui): unify skills/agents under /resources route and API
- Rename route /skills → /resources (pages, detail, new)
- Rename API /api/skills → /api/resources with response keys
  skills → resources, skill → resource
- Rename SkillDetailPage → ResourceDetailPage, variable skill → resource
- KindBadge: show full 'Skill'/'Agent' text, remove size prop
- Show 'local' type badge when source type is empty
- Dashboard: remove Sync Mode stat card, use 4-col grid
- Resources: remove redundant Skills/Agents filter chips (tabs handle it)
- Agent audit: add ?kind=agent support to /api/audit endpoint
- Agent sync matrix: include agents in /api/sync-matrix with
  builtin target path fallback and include/exclude filtering
- FilterAgents: new function in internal/sync/filter.go
- Agent sync: apply include/exclude filters before syncing
2026-04-09 01:26:30 +08:00
Willie 081348d39b refactor(collect): unify skills/agents flow with collectPlan + generics
Replace duplicated runCollectSkills/runCollectAgents (~110 lines of 95%
identical code) with a single runCollectPlan function driven by a
collectPlan struct + toCollectResources[T] generic converter.

Key changes:

- Add collectPlan/collectResources types and runCollectPlan unified flow
- Add toCollectResources[T] generic to bridge typed slices into the
  shared pipeline (scan → display → dry-run → confirm → pull → render)
- Replace fragile err.Error() == "already exists in source" string
  matching with ErrAlreadyExists sentinel error + errors.Is()
- Move os.MkdirAll from per-agent PullAgent to PullAgents (call once)
- Add FindLocalAgents/PullAgent/PullAgents to match FindLocalSkills API
- Add target selection, --force/--dry-run/--json support for agent collect
- Add integration tests for agent collect (target filter, dry-run, force,
  JSON, oplog, project mode)
- Update collect.md, agents.md, ui.md docs for agent collect support
2026-04-09 00:36:39 +08:00
Willie 43c5154a78 Flatten nested agent sync names
Align agent target naming with the skills-style __ flattening so nested agents do not collide by basename in flat agent directories. Add unit and project-mode integration coverage to verify repeated syncs stay stable and no longer report false updates.
2026-04-08 20:52:29 +08:00
Willie 5f7d9adad3 fix(ui): resolve TypeScript errors — add ResourceTab type, useSearchParams import, tab filtering 2026-04-07 19:14:43 +08:00
Willie ca73b40e0f feat: warn when agents installed/synced but no targets support agents
Add Config.HasAgentTarget() helper that checks if any configured target
has an agents path set.

handler_install: append warning to install summary when agents are
installed but no targets support them.

handler_sync: after sync completes, check if agents exist in source
but no targets have agent paths — add warning to response.
2026-04-07 18:05:40 +08:00
Willie e6e41c117b fix(ui): use props instead of parent scope vars in FolderTreeView
activeItems/activeTab are not accessible inside the FolderTreeView
sub-component. Use the skills prop (already passed) instead.
2026-04-07 18:05:40 +08:00
Willie 974c3d51b1 fix(ui): agent detail hides Files, tab persists to localStorage, folder view labels
SkillDetailPage: hide Files card when skill.kind === 'agent' (single
file, redundant info).

ResourcesPage:
- Tab selection persists to localStorage, restored on revisit.
- Folder view summary: '2 agents in 1 folder' (not 'skills').
- Folder tree: FileText icon for agents, Puzzle for skills.
- Grid card: FileText icon for agents.
2026-04-07 18:05:40 +08:00
Willie 9be0ea001b fix: agent list metadata, detail lookup, card icon, and time format
handler_skills list: read agent metadata directly via os.ReadFile
instead of install.ReadMeta (which appends subdirectory). Fixes agents
showing as 'local' instead of 'github'.

handler_skills detail: strip .md from URL param before agent lookup.
Fixes 'skill not found: content-marketer.md' error.

handler_skills: use time.RFC3339 instead of hardcoded format string.

ResourcesPage: use FileText icon for agents, Folder for skills.
2026-04-07 18:05:40 +08:00
Willie 6c339da80d fix(ui): align checkbox with first text line and fix install summary label
SkillPickerModal: use items-start + mt-1.5 on checkbox/radio to align
with first line of multi-line content (name + path).

handler_install: summary message uses 'agents' when kind is agent,
instead of always saying 'skills'.
2026-04-07 18:05:40 +08:00
Willie 9ffc7bb52f fix(ui): center-align checkbox with skill name in picker modal 2026-04-07 18:05:40 +08:00
Willie da4f460a90 fix(ui): dynamic picker modal title based on resource kind
Show 'Select Agents to Install' when all items are agents,
'Select Resources to Install' for mixed, 'Select Skills to Install'
for skills-only.
2026-04-07 18:05:40 +08:00
Willie a2d3b47e46 fix(install): discover agents in subdir URLs and fix single-item kind routing
Backend (install_discovery.go):
- Add discoverAgents() call to all 3 subdir discovery paths (sparse
  checkout, GitHub API, full clone fallback). Previously only whole-repo
  discovery detected agents.

Frontend (InstallForm.tsx):
- Single-skill fast path now checks hasAgents before auto-installing.
  When agents exist alongside a single skill, falls through to the
  kind selector instead of silently installing as skill.
2026-04-07 18:05:40 +08:00
Willie 60489b3a0d fix(install): route agent installs to agents source directory
Backend (handler_install.go):
- handleInstallBatch checks body.Kind field; when 'agent', uses
  InstallAgentFromDiscovery() writing to agentsSource() instead of
  skills source directory.

Frontend (client.ts):
- installBatch accepts optional kind param.

Frontend (InstallForm.tsx):
- handleBatchInstall detects kind from selected items and passes
  kind='agent' to the API when installing agents.
2026-04-07 18:05:40 +08:00
Willie e4301f5781 feat(ui,api): kind-first install flow for mixed repos + discover agents
Backend (handler_install.go):
- handleDiscover now returns agents[] alongside skills[] with kind field
- needsSelection true when agents are present

Frontend (client.ts):
- Add DiscoveredAgent type and agents field to DiscoverResult

Frontend (InstallForm.tsx):
- Mixed repo: show kind selector dialog (Skills/Agents buttons)
- Pure agent repo: map agents to skill picker format directly
- After kind selection, open existing SkillPickerModal with filtered items

Spec/design/tasks updated with kind-first selection decision.
2026-04-07 18:05:40 +08:00
Willie d690408df9 fix(ui): increase spacing between Resources header and tabs 2026-04-07 18:05:40 +08:00
Willie 273277c2d6 fix(ui): use Layers icon for Resources header to avoid tab icon duplication 2026-04-07 18:05:40 +08:00
Willie 84c60314d5 fix(ui): remove redundant count subtitle from Resources page header
Counts are already shown in the tab badges — subtitle now shows
a static description instead of duplicating the numbers.
2026-04-07 18:05:40 +08:00
Willie d3851b1a69 refactor(ui): underline tabs with playful theme support for resource tabs
Replace SegmentedControl with proper underline tab pattern:
- nav[role=tablist] with button[role=tab][aria-selected]
- 3px bottom border indicator, semibold text, count badge pill
- Gap-6 spacing between tabs for breathing room

Playful theme enhancements:
- Wavy SVG border-image for the tab bar bottom border (dark mode variant)
- Active tab count badge inverts to pencil bg + paper text
- Wobble border-radius on count badge via --radius-wobble-badge

Clean theme: minimal underline with pencil color active state.
2026-04-07 18:05:40 +08:00
Willie 79b717e115 fix(ui): use ss-segmented classes for resource tabs to inherit playful theme
Replace raw button underline tabs with ss-segmented + ss-segmented-item
classes. This hooks into the existing playful theme CSS which applies
wobbly border-radius, hard offset shadows, and pencil-colored active
state — matching the hand-drawn aesthetic of other segmented controls.

Uses non-connected variant (gap between buttons) to visually
distinguish from the sub-filter pills below.
2026-04-07 18:05:40 +08:00
Willie e5d512fb67 refactor(ui): replace SegmentedControl with underline tabs for Skills/Agents
Use underline tab pattern for Skills/Agents primary navigation:
- Border-bottom indicator on active tab (pencil color)
- Icon + label + count for each tab
- Sits between page header and sticky toolbar
- Clear visual hierarchy: underline tabs (primary) vs pill filters (secondary)

Removes the connected SegmentedControl that was visually identical
to the sub-filters, causing hierarchy confusion.
2026-04-07 18:05:40 +08:00
Willie c61033a143 refactor(ui): use connected SegmentedControl style for Skills/Agents tabs
Move resource type toggle into the sticky toolbar row alongside the
view toggle. Use connected + size='md' SegmentedControl matching the
grid/folder/table view toggle design (icon + text label, white active
background, shared border container).

Removes the separate tab section above the toolbar — both controls
now live in the same horizontal bar for a cleaner, more compact layout.
2026-04-07 18:05:40 +08:00
Willie eff9647def refactor(ui): rename SkillsPage to ResourcesPage with Skills/Agents tabs
Rename SkillsPage.tsx to ResourcesPage.tsx. Page title changed to
'Resources' with subtitle showing both skill and agent counts.

Add top-level SegmentedControl tabs (Skills | Agents) for switching
between resource types. Each tab has its own count badge. Sub-filters
(All/Tracked/GitHub/Local) apply within the active tab.

Tab selection persists via ?tab=agents URL param. Dashboard stat cards
link to /resources and /resources?tab=agents.

Route: /resources is the primary path; /skills kept as alias.
Nav sidebar: 'Skills' → 'Resources' with Layers icon.
Keyboard shortcut 's' → /resources.
Tour updated for resource-oriented language.
2026-04-07 18:05:40 +08:00
Willie abd2328b9a feat(ui): add KindBadge to CollectPage and BatchUninstallPage
CollectPage: show kind badge next to local skill names in scan results.
BatchUninstallPage: show kind badge next to each skill in uninstall list.
2026-04-07 18:05:40 +08:00
Willie 2f4021fc6a feat: add kind badge to list TUI and remaining frontend pages
list_tui_item: show [A] badge prefix for agents in terminal list view.
list.go: add Kind field to skillEntry and skillJSON structs.

SyncPage: add kind badge to diff items using DiffTarget.items.kind.
AuditPage: add kind badge to audit result cards.
UpdatePage: add kind badge to update result items.
SkillPickerModal: add kind badge in skill picker.
client.ts: add kind to DiffTarget items and AuditResult types.
2026-04-07 18:05:40 +08:00
Willie 6659898cc2 feat: add kind badge to SkillDetailPage and kind arg to audit command
SkillDetailPage: import KindBadge, show kind badge (S/A) next to skill
name in the detail header.

audit: add parseKindArg() for 'skillshare audit agents' syntax. Kind
filter parsing ready, actual agent-only filtering to be wired.
2026-04-07 18:05:40 +08:00
Willie 4c43506df3 feat: agent detail endpoint, project reconcile, and TrashPage badge
handler_skills: skill detail endpoint falls back to agents source when
skill not found. Returns agent .md file content and kind='agent'.

project_reconcile: add ReconcileProjectAgents() to scan agents source,
update registry with kind='agent' entries, and batch-update
.skillshare/.gitignore for agent files and metadata.

TrashPage: add KindBadge next to trashed item names with 'skill'
fallback for old trash items without kind field.
2026-04-07 18:05:40 +08:00
Willie 017dc22f3e feat: add --kind agent to enable/disable and agent path to TargetsPage
enable.go: support --kind agent flag to route enable/disable operations
to .agentignore instead of .skillignore. Works in both global and project
modes. Oplog entries now include kind field.

TargetsPage.tsx: show agent path below skill path when target has
agentPath. Display agent linked count alongside skill counts.
2026-04-07 18:05:40 +08:00
Willie 9a053a35b6 feat(ui): add agent stat card, kind filter tabs, and kind fields to API handlers
DashboardPage: add Agents stat card with Bot icon and accent color,
linking to /skills?kind=agent.

SkillsPage: add Skills/Agents filter tabs alongside existing filters.
KindBadge displayed on each skill card. matchFilter supports kind-based
filtering with accurate filter counts.

handler_collect: add kind field to localSkillItem response.
handler_uninstall: add kind field to batch request and result structs.
2026-04-07 18:05:40 +08:00
Willie 5536cac794 feat(ui): add agent kind types to API client and KindBadge component
Update TypeScript types to match backend agent support:
- Skill: add kind field ('skill' | 'agent')
- Overview: add agentCount field
- Target: add agentPath, agentLinkedCount, agentExpectedCount
- AuditFinding: add optional kind field
- TrashedSkill: add optional kind field

Update listSkills() to accept optional kind filter param (?kind=agent).

Add KindBadge component rendering [S] (info) or [A] (accent) badges
using the existing Badge component.
2026-04-07 18:05:40 +08:00