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
- 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')
- 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)
Problem: Sync page showed 'in sync' but Targets page showed
39032/64075 — ~25000 skills silently dropped by name collisions
and SKILL.md validation in standard naming mode.
Root cause: expectedSkillCount used raw filtered count (pre-resolution)
while diff used post-resolution count. The gap was invisible.
Fix:
1. handler_targets.go: expectedSkillCount now uses resolution.Skills
count (post-collision/validation), matching what sync actually does
2. handler_diff_stream.go: surfaces skippedCount and collisionCount
in diff response so UI can explain why skills were dropped
3. handler_sync.go: diffTarget struct gains SkippedCount/CollisionCount
4. TargetsPage: shows warning when skills are skipped with collision count
5. SyncPage: shows naming conflict notice in 'in sync' cards
6. API client: Target and DiffTarget types gain optional fields
Add per-target target_naming setting that controls how skill directories
are named in sync targets. 'flat' (default) preserves the existing
flattened __ separator behavior. 'standard' uses the SKILL.md name field
directly, following the Agent Skills specification.
Standard mode:
- Validates SKILL.md names match directory basenames
- Detects and skips name collisions with warnings
- Auto-migrates managed entries when switching from flat to standard
- Preserves legacy entries when bare name is already occupied
Also includes:
- Per-target toggle via CLI (--target-naming), TUI (N key), and Web UI
- Collision output redesigned as deduplicated compact summary
- Config inheritance: global target_naming → per-target override
- JSON schema + UI validation for the new field
Closes#110
diff (CLI, TUI, Web UI) now applies FilterSkillsByTarget before
computing differences, matching the behavior of sync/status/doctor.
Previously, skills with unsupported targets values (e.g. targets: ["*"])
appeared as false 'source only' pending items that sync could never resolve.
- Remove dead nil check in ignorePayload() (repoFiles already initialized)
- Replace manual map merge loops with maps.Copy in 3 handler sites
- Deduplicate fmt.Sprintf + ui.Success in doctor checkSkillignore
- Extract extractIgnoreSources() helper in SyncPage to DRY two identical
state-setting blocks
Add ignore_root and ignore_repos fields to sync/diff/diff-stream API
responses from IgnoreStats. UI now uses real file paths instead of
heuristic (skill name starts with _) to determine ignore source.
Switch from DiscoverSourceSkills to DiscoverSourceSkillsWithStats so
the sync, diff, and diff-stream endpoints can surface .skillignore
stats (ignored_count, ignored_skills) in their JSON responses.
Addresses P1 and P2 from code review on the RWMutex commit:
P1 — Stream handlers now snapshot config under RLock before streaming:
- handleDiffStream: clone Targets map to prevent concurrent map panic
- handleCheckStream, handleAuditStream: snapshot source/projectRoot
- handleUpdateStream: snapshot source (per-item Lock already correct)
P2 — All read handlers now use narrow snapshot instead of defer RUnlock:
- RLock → copy needed fields to locals → RUnlock → do work with locals
- Prevents slow I/O (git fetch, version check, audit scan) from blocking
the auto-reload middleware's exclusive Lock on concurrent requests
Other changes:
- computeTargetDiff takes source parameter (no more s.cfg.Source access)
- Add cloneTargets() helper for safe map copying
- Add writeOpsLogTo/writeAuditLogTo for lock-free oplog writes
Replace sequential POST loops and blocking useQuery calls with
Server-Sent Events for real-time progress feedback on Update, Check,
and Diff operations. Extract shared helpers to reduce duplication:
- initSSE() in middleware.go consolidates SSE preamble across 4 handlers
- createSSEStream() in client.ts unifies EventSource lifecycle management
- StreamProgressBar component replaces 3 near-identical progress bars
- handleDiff now delegates to computeTargetDiff (eliminates ~150 lines)
- Paginate audit results (20 cards + 10 findings per card) to prevent
DOM overload with large skill counts