From 366fb236c1d4edbb67645613bd49a31d176031da Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 9 Oct 2026 00:27:06 +0800 Subject: [PATCH 01/12] fix(sync): flag shared skills folders whose mode or naming differ Two targets writing one skills folder with different target_naming or mode undo each other on every sync (flat links vs standard names, merge vs copy), but only include/exclude were compared, so sync and doctor fell back to the generic shared-path hint. Compare the effective mode and target naming too, so an unset value equals the default it resolves to. The global default mode is not carried on the target, so SkillsFolderConflicts takes it from its three callers. The warning now says "different settings" instead of "different filters". Fixes #498 --- cmd/skillshare/doctor_shared_paths.go | 4 +- cmd/skillshare/sync_overlap_hint.go | 4 +- cmd/skillshare/sync_overlap_hint_test.go | 2 +- internal/config/path_overlap.go | 33 ++++++++---- internal/config/path_overlap_test.go | 50 +++++++++++++++++-- internal/server/handler_sync.go | 8 +-- skills/skillshare/references/targets.md | 2 +- tests/integration/sync_shared_path_test.go | 4 +- ui/src/i18n/locales/de.json | 2 +- ui/src/i18n/locales/en.json | 2 +- ui/src/i18n/locales/es.json | 2 +- ui/src/i18n/locales/fa.json | 2 +- ui/src/i18n/locales/fr.json | 2 +- ui/src/i18n/locales/id.json | 2 +- ui/src/i18n/locales/ja.json | 2 +- ui/src/i18n/locales/ko.json | 2 +- ui/src/i18n/locales/pt-BR.json | 2 +- ui/src/i18n/locales/zh-CN.json | 2 +- ui/src/i18n/locales/zh-TW.json | 2 +- ui/src/pages/SyncPage.test.tsx | 2 +- website/docs/reference/commands/doctor.md | 2 +- website/docs/reference/commands/sync.md | 2 +- website/docs/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/reference/commands/sync.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/reference/commands/sync.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/reference/commands/sync.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/reference/commands/sync.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- 35 files changed, 109 insertions(+), 52 deletions(-) diff --git a/cmd/skillshare/doctor_shared_paths.go b/cmd/skillshare/doctor_shared_paths.go index 0b8da5238..69af581d9 100644 --- a/cmd/skillshare/doctor_shared_paths.go +++ b/cmd/skillshare/doctor_shared_paths.go @@ -99,7 +99,7 @@ func checkSharedTargetPaths(cfg *config.Config, result *doctorResult, isProject }) conflicts := make(map[string]config.SkillsFolderConflict) - for _, c := range config.SkillsFolderConflicts(cfg.Targets) { + for _, c := range config.SkillsFolderConflicts(cfg.Targets, cfg.Mode) { conflicts[c.Path] = c } @@ -109,7 +109,7 @@ func checkSharedTargetPaths(cfg *config.Config, result *doctorResult, isProject detail := fmt.Sprintf("%s ← %s", c.path, strings.Join(c.targets, ", ")) suggestion := sharedTargetPathsSuggestion(c.path, c.targets, isProject) if conflict, ok := conflicts[c.path]; ok { - detail += " (different filters, so they undo each other on every sync)" + detail += " (different settings, so they undo each other on every sync)" suggestion = folderConflictSuggestion(conflict, isProject) } ui.Warning("Shared path %s", detail) diff --git a/cmd/skillshare/sync_overlap_hint.go b/cmd/skillshare/sync_overlap_hint.go index 5ca9b4789..9c0140150 100644 --- a/cmd/skillshare/sync_overlap_hint.go +++ b/cmd/skillshare/sync_overlap_hint.go @@ -20,8 +20,8 @@ func printSyncOverlapHint(targets map[string]config.TargetConfig, isProject, jso return } explained := map[string]bool{} - for _, c := range config.SkillsFolderConflicts(targets) { - ui.Warning("%s sync skills to %s with different filters, so each sync undoes the other", + for _, c := range config.SkillsFolderConflicts(targets, defaultMode) { + ui.Warning("%s sync skills to %s with different settings, so each sync undoes the other", joinAnd(c.Targets), shortenPath(c.Path)) for _, name := range c.Stop { fmt.Println(ui.DimText(" keep one: " + skillsOffCommand(name, isProject))) diff --git a/cmd/skillshare/sync_overlap_hint_test.go b/cmd/skillshare/sync_overlap_hint_test.go index 8c426269e..76e056c4b 100644 --- a/cmd/skillshare/sync_overlap_hint_test.go +++ b/cmd/skillshare/sync_overlap_hint_test.go @@ -18,7 +18,7 @@ func TestPrintSyncOverlapHint_NamesConflictAndFix(t *testing.T) { out := captureStdout(t, func() { printSyncOverlapHint(targets, true, false, "", nil) }) for _, want := range []string{ - "codex and universal sync skills to " + filepath.FromSlash("/tmp/agents/skills") + " with different filters, so each sync undoes the other", + "codex and universal sync skills to " + filepath.FromSlash("/tmp/agents/skills") + " with different settings, so each sync undoes the other", "keep one: skillshare target codex --skills=false -p", } { if !strings.Contains(out, want) { diff --git a/internal/config/path_overlap.go b/internal/config/path_overlap.go index b90ce853a..a423d9617 100644 --- a/internal/config/path_overlap.go +++ b/internal/config/path_overlap.go @@ -98,8 +98,8 @@ func SkillsPathKeptBy(targets map[string]TargetConfig, name string, leaving map[ } // SkillsFolderConflict is a skills folder that two or more targets with skills -// on sync into with different include or exclude filters, so each sync -// undoes the others' links. Keep is the target to leave on; Stop the rest. +// on sync into with different include or exclude filters, mode or target +// naming, so each sync undoes the others' links. Keep is the target to leave on; Stop the rest. type SkillsFolderConflict struct { Path string `json:"path"` Targets []string `json:"targets"` @@ -108,10 +108,11 @@ type SkillsFolderConflict struct { } // SkillsFolderConflicts returns the shared skills folders whose targets' -// filters differ, sorted by path. Targets with identical settings agree on -// the folder's contents and are not a conflict. universal is kept when it is -// in the group, otherwise the alphabetically first target. -func SkillsFolderConflicts(targets map[string]TargetConfig) []SkillsFolderConflict { +// filters, mode or target naming differ, sorted by path. defaultMode is the +// global mode a target without its own inherits. Targets with identical +// settings agree on the folder's contents and are not a conflict. universal +// is kept when it is in the group, otherwise the alphabetically first target. +func SkillsFolderConflicts(targets map[string]TargetConfig, defaultMode string) []SkillsFolderConflict { byFolder := make(map[string][]string) for name, tc := range targets { if !tc.SkillsConfig().IsEnabled() { @@ -132,7 +133,7 @@ func SkillsFolderConflicts(targets map[string]TargetConfig) []SkillsFolderConfli differ := false for _, n := range names[1:] { other := targets[n] - if !sameSkillsSettings(first.SkillsConfig(), other.SkillsConfig()) { + if !sameSkillsSettings(first.SkillsConfig(), other.SkillsConfig(), defaultMode) { differ = true break } @@ -156,8 +157,22 @@ func SkillsFolderConflicts(targets map[string]TargetConfig) []SkillsFolderConfli return out } -func sameSkillsSettings(a, b ResourceTargetConfig) bool { - return sameSet(a.Include, b.Include) && sameSet(a.Exclude, b.Exclude) +func sameSkillsSettings(a, b ResourceTargetConfig, defaultMode string) bool { + return effectiveMode(a.Mode, defaultMode) == effectiveMode(b.Mode, defaultMode) && + EffectiveTargetNaming(a.TargetNaming) == EffectiveTargetNaming(b.TargetNaming) && + sameSet(a.Include, b.Include) && sameSet(a.Exclude, b.Exclude) +} + +// effectiveMode mirrors the sync package's mode resolution: the target's own, +// then the global default, then merge. +func effectiveMode(mode, defaultMode string) string { + if mode != "" { + return mode + } + if defaultMode != "" { + return defaultMode + } + return "merge" } func sameSet(a, b []string) bool { diff --git a/internal/config/path_overlap_test.go b/internal/config/path_overlap_test.go index 37992b7f8..e124baf9c 100644 --- a/internal/config/path_overlap_test.go +++ b/internal/config/path_overlap_test.go @@ -67,7 +67,7 @@ func TestSkillsFolderConflicts_DifferentFilters(t *testing.T) { "universal": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Exclude: []string{"feature-radar*"}}}, "codex": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills/"}}, "claude": {Skills: &ResourceTargetConfig{Path: "/tmp/claude/skills"}}, - }) + }, "") want := []SkillsFolderConflict{{Path: "/tmp/agents/skills", Targets: []string{"codex", "universal"}, Keep: "universal", Stop: []string{"codex"}}} if !slices.EqualFunc(got, want, conflictEqual) { t.Errorf("SkillsFolderConflicts = %+v, want %+v", got, want) @@ -78,7 +78,7 @@ func TestSkillsFolderConflicts_SameSettingsNoConflict(t *testing.T) { got := SkillsFolderConflicts(map[string]TargetConfig{ "universal": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Include: []string{"a", "b"}}}, "codex": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Include: []string{"b", "a"}}}, - }) + }, "") if len(got) != 0 { t.Errorf("expected no conflict, got %+v", got) } @@ -89,18 +89,60 @@ func TestSkillsFolderConflicts_DifferentFiltersKeepsFirstName(t *testing.T) { "warp": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Include: []string{"x*"}}}, "amp": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills"}}, "witsy": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills"}}, - }) + }, "") want := []SkillsFolderConflict{{Path: "/tmp/agents/skills", Targets: []string{"amp", "warp", "witsy"}, Keep: "amp", Stop: []string{"warp", "witsy"}}} if !slices.EqualFunc(got, want, conflictEqual) { t.Errorf("SkillsFolderConflicts = %+v, want %+v", got, want) } } +func TestSkillsFolderConflicts_DifferentTargetNaming(t *testing.T) { + got := SkillsFolderConflicts(map[string]TargetConfig{ + "aflat": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Mode: "merge", TargetNaming: "flat"}}, + "bstd": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Mode: "merge", TargetNaming: "standard"}}, + }, "") + want := []SkillsFolderConflict{{Path: "/tmp/agents/skills", Targets: []string{"aflat", "bstd"}, Keep: "aflat", Stop: []string{"bstd"}}} + if !slices.EqualFunc(got, want, conflictEqual) { + t.Errorf("SkillsFolderConflicts = %+v, want %+v", got, want) + } +} + +func TestSkillsFolderConflicts_DifferentMode(t *testing.T) { + got := SkillsFolderConflicts(map[string]TargetConfig{ + "amerge": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Mode: "merge"}}, + "bcopy": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Mode: "copy"}}, + }, "") + want := []SkillsFolderConflict{{Path: "/tmp/agents/skills", Targets: []string{"amerge", "bcopy"}, Keep: "amerge", Stop: []string{"bcopy"}}} + if !slices.EqualFunc(got, want, conflictEqual) { + t.Errorf("SkillsFolderConflicts = %+v, want %+v", got, want) + } +} + +func TestSkillsFolderConflicts_UnsetEqualsDefault(t *testing.T) { + got := SkillsFolderConflicts(map[string]TargetConfig{ + "unset": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills"}}, + "explicit": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Mode: "merge", TargetNaming: "flat"}}, + }, "") + if len(got) != 0 { + t.Errorf("expected no conflict, got %+v", got) + } +} + +func TestSkillsFolderConflicts_UnsetModeInheritsDefault(t *testing.T) { + got := SkillsFolderConflicts(map[string]TargetConfig{ + "unset": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills"}}, + "explicit": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Mode: "copy"}}, + }, "copy") + if len(got) != 0 { + t.Errorf("expected no conflict, got %+v", got) + } +} + func TestSkillsFolderConflicts_IgnoresSkillsOff(t *testing.T) { got := SkillsFolderConflicts(map[string]TargetConfig{ "universal": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Exclude: []string{"x"}}}, "codex": disabledAt("/tmp/agents/skills"), - }) + }, "") if len(got) != 0 { t.Errorf("expected no conflict with skills off, got %+v", got) } diff --git a/internal/server/handler_sync.go b/internal/server/handler_sync.go index 45d313d03..338b03ccf 100644 --- a/internal/server/handler_sync.go +++ b/internal/server/handler_sync.go @@ -140,8 +140,8 @@ type syncOutcome struct { // folderConflicts returns the skills folders whose targets undo each other's // sync, never nil, plus how many targets overlap in a way they don't explain. // harmless is passed on to config.DetectPathOverlap. -func folderConflicts(targets map[string]config.TargetConfig, isProject bool, harmless func(scanner, writer string) bool) ([]config.SkillsFolderConflict, int) { - conflicts := config.SkillsFolderConflicts(targets) +func folderConflicts(targets map[string]config.TargetConfig, isProject bool, defaultMode string, harmless func(scanner, writer string) bool) ([]config.SkillsFolderConflict, int) { + conflicts := config.SkillsFolderConflicts(targets, defaultMode) explained := map[string]bool{} for _, c := range conflicts { for _, name := range c.Targets { @@ -406,7 +406,7 @@ func (s *Server) syncResources(start time.Time, dryRun, force bool, kind, projec } s.writeOpsLog("sync", status, start, logArgs, "") - conflicts, overlap := folderConflicts(s.cfg.Targets, s.IsProjectMode(), + conflicts, overlap := folderConflicts(s.cfg.Targets, s.IsProjectMode(), globalMode, ssync.HarmlessOverlap(s.cfg.Targets, globalMode, allSkills)) // Targets sync from a map; a fixed order keeps the dashboard's notices still. slices.SortFunc(unmatched, func(a, b unmatchedInclude) int { return strings.Compare(a.Target, b.Target) }) @@ -614,7 +614,7 @@ func (s *Server) handleDiff(w http.ResponseWriter, r *http.Request) { globalMode := s.cfg.Mode ignorePatterns := ssync.EffectiveFileIgnorePatterns(s.cfg.Ignore) targets := s.cloneTargets() - conflicts, _ := folderConflicts(targets, s.IsProjectMode(), nil) + conflicts, _ := folderConflicts(targets, s.IsProjectMode(), globalMode, nil) s.mu.RUnlock() if globalMode == "" { diff --git a/skills/skillshare/references/targets.md b/skills/skillshare/references/targets.md index 449a9c3c4..60c4fffee 100644 --- a/skills/skillshare/references/targets.md +++ b/skills/skillshare/references/targets.md @@ -77,7 +77,7 @@ a folder an enabled target also writes to is left alone. `sync`/`diff`/`status`/ skip the target's skills. `--skills` cannot be combined with include/exclude flags in one command. Works with `-p`. -When `sync` warns that two targets "sync skills to with different filters, so each +When `sync` warns that two targets "sync skills to with different settings, so each sync undoes the other", run the `skillshare target --skills=false` it prints. ## Project Targets (`-p`) diff --git a/tests/integration/sync_shared_path_test.go b/tests/integration/sync_shared_path_test.go index 9ee928750..9009cd0b7 100644 --- a/tests/integration/sync_shared_path_test.go +++ b/tests/integration/sync_shared_path_test.go @@ -280,7 +280,7 @@ targets: } // TestSync_SharedPath_DifferentFiltersWarns covers two targets sharing a -// skills folder with different filters: each sync undoes the other, so sync +// skills folder with different settings: each sync undoes the other, so sync // names them and says how to keep one. func TestSync_SharedPath_DifferentFiltersWarns(t *testing.T) { sb := testutil.NewSandbox(t) @@ -305,7 +305,7 @@ targets: result := sb.RunCLI("sync") result.AssertSuccess(t) - result.AssertOutputContains(t, "codex and universal sync skills to ~/.agents/skills with different filters, so each sync undoes the other") + result.AssertOutputContains(t, "codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other") result.AssertOutputContains(t, "keep one: skillshare target codex --skills=false") result.AssertOutputNotContains(t, "Skill path overlap") } diff --git a/ui/src/i18n/locales/de.json b/ui/src/i18n/locales/de.json index e98096b87..12762179d 100644 --- a/ui/src/i18n/locales/de.json +++ b/ui/src/i18n/locales/de.json @@ -1899,7 +1899,7 @@ "sync.local.hint": "Die Synchronisierung lässt sie unberührt. Sammeln holt sie in deine Quelle.", "sync.local.collect": "Sammeln", "sync.forceHint": "Dateien ersetzen, die in einem Ziel bearbeitet wurden", - "sync.folderConflict.text": "{names} synchronisieren Skills mit unterschiedlichen Filtern in denselben Ordner {path}, sodass jede Synchronisierung die andere rückgängig macht.", + "sync.folderConflict.text": "{names} synchronisieren Skills mit unterschiedlichen Einstellungen in denselben Ordner {path}, sodass jede Synchronisierung die andere rückgängig macht.", "sync.folderConflict.stop": "Skills für {name} nicht mehr synchronisieren", "sync.error.showDetails": "Diagnose anzeigen", "sync.error.hideDetails": "Diagnose ausblenden", diff --git a/ui/src/i18n/locales/en.json b/ui/src/i18n/locales/en.json index c8b101ce0..248951ddb 100644 --- a/ui/src/i18n/locales/en.json +++ b/ui/src/i18n/locales/en.json @@ -1899,7 +1899,7 @@ "sync.local.hint": "Sync leaves them alone. Collect brings them into your source.", "sync.local.collect": "Collect", "sync.forceHint": "Replace files that were edited inside a target", - "sync.folderConflict.text": "{names} sync skills to the same folder {path} with different filters, so each sync undoes the other.", + "sync.folderConflict.text": "{names} sync skills to the same folder {path} with different settings, so each sync undoes the other.", "sync.folderConflict.stop": "Stop syncing skills for {name}", "sync.error.showDetails": "Show diagnostics", "sync.error.hideDetails": "Hide diagnostics", diff --git a/ui/src/i18n/locales/es.json b/ui/src/i18n/locales/es.json index d1f8b9561..b7930944b 100644 --- a/ui/src/i18n/locales/es.json +++ b/ui/src/i18n/locales/es.json @@ -1899,7 +1899,7 @@ "sync.local.hint": "La sincronización no los toca. Recopilar los trae a tu origen.", "sync.local.collect": "Recopilar", "sync.forceHint": "Reemplazar archivos editados dentro de un destino", - "sync.folderConflict.text": "{names} sincronizan skills en la misma carpeta {path} con filtros distintos, así que cada sincronización deshace la otra.", + "sync.folderConflict.text": "{names} sincronizan skills en la misma carpeta {path} con ajustes distintos, así que cada sincronización deshace la otra.", "sync.folderConflict.stop": "Dejar de sincronizar skills con {name}", "sync.error.showDetails": "Mostrar diagnóstico", "sync.error.hideDetails": "Ocultar diagnóstico", diff --git a/ui/src/i18n/locales/fa.json b/ui/src/i18n/locales/fa.json index 8488df55c..9cf2b0e0c 100644 --- a/ui/src/i18n/locales/fa.json +++ b/ui/src/i18n/locales/fa.json @@ -1899,7 +1899,7 @@ "sync.local.hint": "همگام‌سازی به آن‌ها دست نمی‌زند. جمع‌آوری آن‌ها را به منبع شما می‌آورد.", "sync.local.collect": "جمع‌آوری", "sync.forceHint": "فایل‌هایی را که داخل هدف ویرایش شده‌اند جایگزین کن", - "sync.folderConflict.text": "{names} Skills را با فیلترهای متفاوت در یک پوشه ({path}) همگام‌سازی می‌کنند، بنابراین هر همگام‌سازی کار دیگری را خنثی می‌کند.", + "sync.folderConflict.text": "{names} Skills را با تنظیمات متفاوت در یک پوشه ({path}) همگام‌سازی می‌کنند، بنابراین هر همگام‌سازی کار دیگری را خنثی می‌کند.", "sync.folderConflict.stop": "توقف همگام‌سازی Skills برای {name}", "sync.error.showDetails": "نمایش جزئیات عیب‌یابی", "sync.error.hideDetails": "پنهان کردن جزئیات عیب‌یابی", diff --git a/ui/src/i18n/locales/fr.json b/ui/src/i18n/locales/fr.json index 14ddd4e67..a28458652 100644 --- a/ui/src/i18n/locales/fr.json +++ b/ui/src/i18n/locales/fr.json @@ -1899,7 +1899,7 @@ "sync.local.hint": "La synchronisation n'y touche pas. Collecter les ramène dans votre source.", "sync.local.collect": "Collecter", "sync.forceHint": "Remplacer les fichiers modifiés dans une cible", - "sync.folderConflict.text": "{names} synchronisent les skills dans le même dossier {path} avec des filtres différents : chaque synchronisation annule l’autre.", + "sync.folderConflict.text": "{names} synchronisent les skills dans le même dossier {path} avec des paramètres différents : chaque synchronisation annule l’autre.", "sync.folderConflict.stop": "Arrêter de synchroniser les skills vers {name}", "sync.error.showDetails": "Afficher le diagnostic", "sync.error.hideDetails": "Masquer le diagnostic", diff --git a/ui/src/i18n/locales/id.json b/ui/src/i18n/locales/id.json index 3b5927892..d76ff5e3b 100644 --- a/ui/src/i18n/locales/id.json +++ b/ui/src/i18n/locales/id.json @@ -1899,7 +1899,7 @@ "sync.local.hint": "Sinkronisasi tidak menyentuhnya. Kumpulkan membawanya ke sumber Anda.", "sync.local.collect": "Kumpulkan", "sync.forceHint": "Ganti file yang diedit di dalam target", - "sync.folderConflict.text": "{names} menyinkronkan skill ke folder yang sama {path} dengan filter berbeda, sehingga setiap sinkronisasi membatalkan yang lain.", + "sync.folderConflict.text": "{names} menyinkronkan skill ke folder yang sama {path} dengan pengaturan berbeda, sehingga setiap sinkronisasi membatalkan yang lain.", "sync.folderConflict.stop": "Berhenti menyinkronkan skill ke {name}", "sync.error.showDetails": "Tampilkan diagnostik", "sync.error.hideDetails": "Sembunyikan diagnostik", diff --git a/ui/src/i18n/locales/ja.json b/ui/src/i18n/locales/ja.json index 2f841596a..4cc8c1f9f 100644 --- a/ui/src/i18n/locales/ja.json +++ b/ui/src/i18n/locales/ja.json @@ -1899,7 +1899,7 @@ "sync.local.hint": "同期では変更されません。収集するとソースに取り込めます。", "sync.local.collect": "収集", "sync.forceHint": "ターゲット内で編集されたファイルを置き換えます", - "sync.folderConflict.text": "{names} は同じフォルダ {path} に異なるフィルターで Skills を同期しているため、同期のたびに互いの結果を打ち消します。", + "sync.folderConflict.text": "{names} は同じフォルダ {path} に異なる設定で Skills を同期しているため、同期のたびに互いの結果を打ち消します。", "sync.folderConflict.stop": "{name} の Skills の同期を停止", "sync.error.showDetails": "診断情報を表示", "sync.error.hideDetails": "診断情報を隠す", diff --git a/ui/src/i18n/locales/ko.json b/ui/src/i18n/locales/ko.json index 4312dd8b1..f73d70484 100644 --- a/ui/src/i18n/locales/ko.json +++ b/ui/src/i18n/locales/ko.json @@ -1899,7 +1899,7 @@ "sync.local.hint": "동기화는 이 항목을 건드리지 않습니다. 수집하면 소스로 가져옵니다.", "sync.local.collect": "수집", "sync.forceHint": "대상 안에서 수정된 파일을 교체합니다", - "sync.folderConflict.text": "{names}이(가) 같은 폴더 {path}에 서로 다른 필터로 Skills를 동기화해서, 동기화할 때마다 서로의 결과를 되돌립니다.", + "sync.folderConflict.text": "{names}이(가) 같은 폴더 {path}에 서로 다른 설정으로 Skills를 동기화해서, 동기화할 때마다 서로의 결과를 되돌립니다.", "sync.folderConflict.stop": "{name}의 Skills 동기화 중지", "sync.error.showDetails": "진단 표시", "sync.error.hideDetails": "진단 숨기기", diff --git a/ui/src/i18n/locales/pt-BR.json b/ui/src/i18n/locales/pt-BR.json index 0b2c15389..5d25c4f16 100644 --- a/ui/src/i18n/locales/pt-BR.json +++ b/ui/src/i18n/locales/pt-BR.json @@ -1899,7 +1899,7 @@ "sync.local.hint": "A sincronização não mexe neles. Coletar traz para a sua origem.", "sync.local.collect": "Coletar", "sync.forceHint": "Substituir arquivos editados dentro de um destino", - "sync.folderConflict.text": "{names} sincronizam skills na mesma pasta {path} com filtros diferentes, então cada sincronização desfaz a outra.", + "sync.folderConflict.text": "{names} sincronizam skills na mesma pasta {path} com configurações diferentes, então cada sincronização desfaz a outra.", "sync.folderConflict.stop": "Parar de sincronizar skills com {name}", "sync.error.showDetails": "Mostrar diagnóstico", "sync.error.hideDetails": "Ocultar diagnóstico", diff --git a/ui/src/i18n/locales/zh-CN.json b/ui/src/i18n/locales/zh-CN.json index ba06c21e3..170b234f2 100644 --- a/ui/src/i18n/locales/zh-CN.json +++ b/ui/src/i18n/locales/zh-CN.json @@ -1899,7 +1899,7 @@ "sync.local.hint": "同步不会动它们,收集可以将其纳入来源。", "sync.local.collect": "收集", "sync.forceHint": "替换在目标中修改过的文件", - "sync.folderConflict.text": "{names} 同步到同一个文件夹 {path},但筛选不同,每次同步都会互相加回、删掉。", + "sync.folderConflict.text": "{names} 同步到同一个文件夹 {path},但设置不同,每次同步都会互相加回、删掉。", "sync.folderConflict.stop": "停止同步 {name} 的 Skills", "sync.error.showDetails": "显示诊断信息", "sync.error.hideDetails": "隐藏诊断信息", diff --git a/ui/src/i18n/locales/zh-TW.json b/ui/src/i18n/locales/zh-TW.json index 8930a192f..32315dff8 100644 --- a/ui/src/i18n/locales/zh-TW.json +++ b/ui/src/i18n/locales/zh-TW.json @@ -1899,7 +1899,7 @@ "sync.local.hint": "同步不會動到它們,收集可以將其納入來源。", "sync.local.collect": "收集", "sync.forceHint": "取代在目標中修改過的檔案", - "sync.folderConflict.text": "{names} 同步到同一個資料夾 {path},但篩選不同,每次同步都會互相加回、刪掉。", + "sync.folderConflict.text": "{names} 同步到同一個資料夾 {path},但設定不同,每次同步都會互相加回、刪掉。", "sync.folderConflict.stop": "停止同步 {name} 的 Skills", "sync.error.showDetails": "顯示診斷資訊", "sync.error.hideDetails": "隱藏診斷資訊", diff --git a/ui/src/pages/SyncPage.test.tsx b/ui/src/pages/SyncPage.test.tsx index f870b146e..ee10a3102 100644 --- a/ui/src/pages/SyncPage.test.tsx +++ b/ui/src/pages/SyncPage.test.tsx @@ -44,7 +44,7 @@ describe('Sync page folder conflicts', () => { , ); - expect(await screen.findByText(/codex and universal sync skills to the same folder .*\.agents\/skills with different filters, so each sync undoes the other\./)).toBeInTheDocument(); + expect(await screen.findByText(/codex and universal sync skills to the same folder .*\.agents\/skills with different settings, so each sync undoes the other\./)).toBeInTheDocument(); await user.click(screen.getByRole('button', { name: 'Stop syncing skills for codex' })); await user.click(await screen.findByRole('button', { name: 'Stop syncing' })); await waitFor(() => expect(api.updateTarget).toHaveBeenCalledWith('codex', { skills_enabled: false })); diff --git a/website/docs/reference/commands/doctor.md b/website/docs/reference/commands/doctor.md index 173851346..187bebcbe 100644 --- a/website/docs/reference/commands/doctor.md +++ b/website/docs/reference/commands/doctor.md @@ -151,7 +151,7 @@ Resolution: disable one of the overlapping targets, or set a distinct path with When the targets sharing a path have different `include` or `exclude` filters, each sync adds what one target wants and prunes what another filters out, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: ```text -! Shared path ~/.agents/skills ← codex, universal (different filters, so they undo each other on every sync) +! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) suggestion: Keep universal syncing skills to ~/.agents/skills and stop the rest with `skillshare target codex --skills=false`. ``` diff --git a/website/docs/reference/commands/sync.md b/website/docs/reference/commands/sync.md index 9c57fba02..9dc1e0578 100644 --- a/website/docs/reference/commands/sync.md +++ b/website/docs/reference/commands/sync.md @@ -353,7 +353,7 @@ targets: - In symlink mode, filters are ignored - In copy mode, filters work the same way as merge mode - `sync` removes existing source-linked or managed entries that are now excluded -- Targets that share one folder need the same filters; otherwise each sync undoes the other and `sync` warns (see [`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) +- Targets that share one folder need the same filters, mode and target naming; otherwise each sync undoes the other and `sync` warns (see [`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) See [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters) for full details. diff --git a/website/docs/troubleshooting/common-errors.md b/website/docs/troubleshooting/common-errors.md index ee5778061..3a8017dd7 100644 --- a/website/docs/troubleshooting/common-errors.md +++ b/website/docs/troubleshooting/common-errors.md @@ -126,7 +126,7 @@ skillshare restore **Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters. Each sync adds what one target wants and removes what the other filters out, so the folder never settles. `sync` names them: ``` -! codex and universal sync skills to ~/.agents/skills with different filters, so each sync undoes the other +! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other keep one: skillshare target codex --skills=false ``` diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index 6fbb5255d..8c4c7f17d 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -151,7 +151,7 @@ Doctor は、ランタイムのピッカーに到達する前に、Skill 重複 パスを共有する Target 同士で `include`、`exclude` のフィルターが異なる場合、同期のたびに一方の Target が必要とするものが追加され、もう一方がフィルターで除外したものが削除されます。そのためフォルダが落ち着かず、`sync` には同じ保留中の変更が表示され続けます。Doctor はこのケースを示し、Target を削除する代わりに 1 つ(`universal` が含まれていればそれ)を残して残りの Skills 同期をオフにするよう提案します: ```text -! Shared path ~/.agents/skills ← codex, universal (different filters, so they undo each other on every sync) +! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) suggestion: Keep universal syncing skills to ~/.agents/skills and stop the rest with `skillshare target codex --skills=false`. ``` diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/sync.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/sync.md index c4df8494a..fe20a8bc6 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/sync.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/sync.md @@ -345,7 +345,7 @@ targets: - symlink mode では、フィルターは無視されます - copy mode では、フィルターは merge mode と同じように動作します - `sync` は、除外されるようになった既存の source-linked または管理対象のエントリを削除します -- 同じフォルダを共有する target には同じフィルターが必要です。そうでないと、各 sync が互いの結果を打ち消し合い、`sync` が警告を表示します([`sync` が同じ変更を表示し続ける](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes) を参照) +- 同じフォルダを共有する target には同じフィルター、mode、target naming が必要です。そうでないと、各 sync が互いの結果を打ち消し合い、`sync` が警告を表示します([`sync` が同じ変更を表示し続ける](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes) を参照) 詳細は [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters) を参照してください。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index be03b6967..deffb436b 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -135,7 +135,7 @@ skillshare restore **原因:** 2 つの Target が、異なる `include` または `exclude` フィルターで同じフォルダに Skill を Sync している。各 Sync が一方の Target の必要な Skill を追加し、もう一方のフィルターで除外される Skill を削除するため、フォルダの状態が安定しません。`sync` は該当する Target を表示します: ``` -! codex and universal sync skills to ~/.agents/skills with different filters, so each sync undoes the other +! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other keep one: skillshare target codex --skills=false ``` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index 0aeca558d..a46db0d68 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -151,7 +151,7 @@ Doctor는 런타임 피커에 도달하기 전에 두 가지 종류의 중복 sk 경로를 공유하는 target들의 `include`, `exclude` 필터가 서로 다르면, 동기화할 때마다 한 target이 원하는 항목이 추가되고 다른 target이 필터로 제외한 항목이 삭제됩니다. 그래서 폴더가 안정되지 않고 `sync`에 같은 대기 중 변경이 계속 표시됩니다. Doctor는 이 경우를 표시하고, target을 제거하는 대신 하나(`universal`이 포함되어 있으면 그것)만 남기고 나머지는 Skills 동기화를 끄도록 제안합니다: ```text -! Shared path ~/.agents/skills ← codex, universal (different filters, so they undo each other on every sync) +! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) suggestion: Keep universal syncing skills to ~/.agents/skills and stop the rest with `skillshare target codex --skills=false`. ``` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/sync.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/sync.md index 219b14950..ab9ee3052 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/sync.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/sync.md @@ -346,7 +346,7 @@ targets: - symlink mode에서는 filter가 무시됩니다 - copy mode에서 filter는 merge mode와 동일하게 동작합니다 - `sync`는 이제 제외된 기존 source-linked 또는 managed entry를 제거합니다 -- 하나의 폴더를 공유하는 target들은 같은 filter를 사용해야 합니다. 그렇지 않으면 매번 sync가 서로의 결과를 되돌리며, `sync`가 경고를 표시합니다([`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes) 참고) +- 하나의 폴더를 공유하는 target들은 같은 filter, mode, target naming을 사용해야 합니다. 그렇지 않으면 매번 sync가 서로의 결과를 되돌리며, `sync`가 경고를 표시합니다([`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes) 참고) 자세한 내용은 [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters)을 참고하세요. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index b547ffbc2..7586e480b 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -126,7 +126,7 @@ skillshare restore **Cause:** 두 target이 서로 다른 `include` 또는 `exclude` filter로 같은 폴더에 skill을 sync합니다. 매번 sync할 때마다 한 target이 원하는 것은 추가되고 다른 target이 걸러내는 것은 제거되므로, 폴더가 안정되지 않습니다. `sync`가 해당 target을 알려줍니다: ``` -! codex and universal sync skills to ~/.agents/skills with different filters, so each sync undoes the other +! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other keep one: skillshare target codex --skills=false ``` diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index 408a6cb14..ffee31663 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -152,7 +152,7 @@ Doctor 会在两类重复 skill 风险到达运行时选择器之前将其标记 如果共用路径的 targets 的 `include` 或 `exclude` 筛选不同,每次同步都会加入一个 target 需要的内容、再删掉另一个 target 过滤掉的内容,文件夹永远不会稳定,`sync` 也会一直显示同样的待同步变更。Doctor 会标出这种情况,并建议只保留一个 target(如果其中有 `universal` 就保留它)、其余的关闭 skills 同步,而不是移除 target: ```text -! Shared path ~/.agents/skills ← codex, universal (different filters, so they undo each other on every sync) +! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) suggestion: Keep universal syncing skills to ~/.agents/skills and stop the rest with `skillshare target codex --skills=false`. ``` diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/sync.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/sync.md index 41aeb1979..b1c98c0c8 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/sync.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/sync.md @@ -367,7 +367,7 @@ targets: - 在 symlink 模式下,filters 会被忽略 - 在 copy 模式下,filters 的行为方式与 merge 模式相同 - `sync` 会移除已被排除、但之前是 source-linked 或受管理的条目 -- 共用同一个文件夹的多个 target 需要相同的 filters;否则每次 sync 都会撤销另一个 target 的结果,`sync` 会发出警告(参见 [`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) +- 共用同一个文件夹的多个 target 需要相同的 filters、mode 和 target naming;否则每次 sync 都会撤销另一个 target 的结果,`sync` 会发出警告(参见 [`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) 完整细节参见 [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters)。 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 1ef212aa6..39ebc5b6d 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -126,7 +126,7 @@ skillshare restore **原因:** 两个 Target 以不同的 `include` 或 `exclude` 过滤器把 skills 同步到同一个文件夹。每次 sync 都会加入其中一个 Target 需要的内容,又移除另一个 Target 过滤掉的内容,所以这个文件夹永远无法稳定下来。`sync` 会指出是哪两个 Target: ``` -! codex and universal sync skills to ~/.agents/skills with different filters, so each sync undoes the other +! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other keep one: skillshare target codex --skills=false ``` diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index 2b20a94c2..f5d548c38 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -151,7 +151,7 @@ Doctor 會在兩類重複 skill 風險到達 runtime picker 之前先標示出 若共用路徑的 targets 其 `include` 或 `exclude` 篩選不同,每次同步都會加入一個 target 要的內容、再刪掉另一個 target 過濾掉的內容,資料夾永遠不會穩定,`sync` 也會一直顯示同樣的待同步變更。Doctor 會標出這種情況,並建議只保留一個 target(若其中有 `universal` 就保留它)、其他的關閉 skills 同步,而不是移除 target: ```text -! Shared path ~/.agents/skills ← codex, universal (different filters, so they undo each other on every sync) +! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) suggestion: Keep universal syncing skills to ~/.agents/skills and stop the rest with `skillshare target codex --skills=false`. ``` diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/sync.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/sync.md index 0fa250dce..d95834dc0 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/sync.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/sync.md @@ -345,7 +345,7 @@ targets: - 在 symlink mode 中,filters 會被忽略 - 在 copy mode 中,filters 的運作方式與 merge mode 相同 - `sync` 會移除現在已被排除、但先前是 source-linked 或受管理的條目 -- 共用同一個資料夾的 targets 需要相同的 filters;否則每次同步都會抵銷另一個 target 的結果,`sync` 會發出警告(見 [`sync` 一直顯示相同的變更](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) +- 共用同一個資料夾的 targets 需要相同的 filters、mode 與 target naming;否則每次同步都會抵銷另一個 target 的結果,`sync` 會發出警告(見 [`sync` 一直顯示相同的變更](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) 完整細節見 [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters)。 diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 1340cadac..f780dd7c0 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -126,7 +126,7 @@ skillshare restore **原因:** 兩個 Target 把 Skill 同步到同一個資料夾,但 `include` 或 `exclude` filters 不同。每次同步都會加入其中一個 Target 要的 Skill,同時移除另一個 Target 過濾掉的 Skill,所以資料夾永遠不會穩定下來。`sync` 會指出是哪兩個 Target: ``` -! codex and universal sync skills to ~/.agents/skills with different filters, so each sync undoes the other +! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other keep one: skillshare target codex --skills=false ``` From 06a0d36536d4cd83f884a0ee33122c23d8667f65 Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 9 Oct 2026 00:29:08 +0800 Subject: [PATCH 02/12] docs(i18n): say shared-folder conflicts cover mode and naming too The warning now reads "different settings", but the explanatory prose around it in the doctor and common-errors pages still described the conflict as include/exclude filters only. Name mode and target_naming there as well, in English and the four translated doc sets. --- website/docs/reference/commands/doctor.md | 2 +- website/docs/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/website/docs/reference/commands/doctor.md b/website/docs/reference/commands/doctor.md index 187bebcbe..ef909ee9a 100644 --- a/website/docs/reference/commands/doctor.md +++ b/website/docs/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor flags two classes of duplicate-skill risk before they reach the runtime p Resolution: disable one of the overlapping targets, or set a distinct path with `skillshare target --path `. -When the targets sharing a path have different `include` or `exclude` filters, each sync adds what one target wants and prunes what another filters out, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: +When the targets sharing a path have different `include` or `exclude` filters, `mode`, or `target_naming`, each sync adds what one target wants and prunes what another filters out, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/docs/troubleshooting/common-errors.md b/website/docs/troubleshooting/common-errors.md index 3a8017dd7..74493f3fa 100644 --- a/website/docs/troubleshooting/common-errors.md +++ b/website/docs/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} -**Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters. Each sync adds what one target wants and removes what the other filters out, so the folder never settles. `sync` names them: +**Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters, `mode`, or `target_naming`. Each sync adds what one target wants and removes what the other filters out, so the folder never settles. `sync` names them: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index 8c4c7f17d..dd3f958cb 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor は、ランタイムのピッカーに到達する前に、Skill 重複 解決方法: 重複している Target のいずれかを無効化するか、`skillshare target --path ` で別のパスを設定してください。 -パスを共有する Target 同士で `include`、`exclude` のフィルターが異なる場合、同期のたびに一方の Target が必要とするものが追加され、もう一方がフィルターで除外したものが削除されます。そのためフォルダが落ち着かず、`sync` には同じ保留中の変更が表示され続けます。Doctor はこのケースを示し、Target を削除する代わりに 1 つ(`universal` が含まれていればそれ)を残して残りの Skills 同期をオフにするよう提案します: +パスを共有する Target 同士で `include`、`exclude` のフィルター、`mode`、`target_naming` のいずれかが異なる場合、同期のたびに一方の Target が必要とするものが追加され、もう一方がフィルターで除外したものが削除されます。そのためフォルダが落ち着かず、`sync` には同じ保留中の変更が表示され続けます。Doctor はこのケースを示し、Target を削除する代わりに 1 つ(`universal` が含まれていればそれ)を残して残りの Skills 同期をオフにするよう提案します: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index deffb436b..e42718fb9 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -132,7 +132,7 @@ skillshare restore ### `sync` が同じ変更を表示し続ける {#sync-keeps-showing-the-same-changes} -**原因:** 2 つの Target が、異なる `include` または `exclude` フィルターで同じフォルダに Skill を Sync している。各 Sync が一方の Target の必要な Skill を追加し、もう一方のフィルターで除外される Skill を削除するため、フォルダの状態が安定しません。`sync` は該当する Target を表示します: +**原因:** 2 つの Target が、`include` / `exclude` フィルター、`mode`、`target_naming` のいずれかが異なる状態で同じフォルダに Skill を Sync している。各 Sync が一方の Target の必要な Skill を追加し、もう一方のフィルターで除外される Skill を削除するため、フォルダの状態が安定しません。`sync` は該当する Target を表示します: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index a46db0d68..5c2c4ce5a 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor는 런타임 피커에 도달하기 전에 두 가지 종류의 중복 sk 해결 방법: 중복된 target 중 하나를 비활성화하거나, `skillshare target --path `로 별도의 경로를 설정하십시오. -경로를 공유하는 target들의 `include`, `exclude` 필터가 서로 다르면, 동기화할 때마다 한 target이 원하는 항목이 추가되고 다른 target이 필터로 제외한 항목이 삭제됩니다. 그래서 폴더가 안정되지 않고 `sync`에 같은 대기 중 변경이 계속 표시됩니다. Doctor는 이 경우를 표시하고, target을 제거하는 대신 하나(`universal`이 포함되어 있으면 그것)만 남기고 나머지는 Skills 동기화를 끄도록 제안합니다: +경로를 공유하는 target들의 `include`, `exclude` 필터, `mode`, `target_naming`이 서로 다르면, 동기화할 때마다 한 target이 원하는 항목이 추가되고 다른 target이 필터로 제외한 항목이 삭제됩니다. 그래서 폴더가 안정되지 않고 `sync`에 같은 대기 중 변경이 계속 표시됩니다. Doctor는 이 경우를 표시하고, target을 제거하는 대신 하나(`universal`이 포함되어 있으면 그것)만 남기고 나머지는 Skills 동기화를 끄도록 제안합니다: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 7586e480b..93af07488 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} -**Cause:** 두 target이 서로 다른 `include` 또는 `exclude` filter로 같은 폴더에 skill을 sync합니다. 매번 sync할 때마다 한 target이 원하는 것은 추가되고 다른 target이 걸러내는 것은 제거되므로, 폴더가 안정되지 않습니다. `sync`가 해당 target을 알려줍니다: +**Cause:** 두 target이 서로 다른 `include`/`exclude` filter, `mode` 또는 `target_naming`으로 같은 폴더에 skill을 sync합니다. 매번 sync할 때마다 한 target이 원하는 것은 추가되고 다른 target이 걸러내는 것은 제거되므로, 폴더가 안정되지 않습니다. `sync`가 해당 target을 알려줍니다: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index ffee31663..4922a2764 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -149,7 +149,7 @@ Doctor 会在两类重复 skill 风险到达运行时选择器之前将其标记 解决方法:禁用其中一个重叠的 target,或用 `skillshare target --path ` 设置一个独立的路径。 -如果共用路径的 targets 的 `include` 或 `exclude` 筛选不同,每次同步都会加入一个 target 需要的内容、再删掉另一个 target 过滤掉的内容,文件夹永远不会稳定,`sync` 也会一直显示同样的待同步变更。Doctor 会标出这种情况,并建议只保留一个 target(如果其中有 `universal` 就保留它)、其余的关闭 skills 同步,而不是移除 target: +如果共用路径的 targets 的 `include` 或 `exclude` 筛选、`mode` 或 `target_naming` 不同,每次同步都会加入一个 target 需要的内容、再删掉另一个 target 过滤掉的内容,文件夹永远不会稳定,`sync` 也会一直显示同样的待同步变更。Doctor 会标出这种情况,并建议只保留一个 target(如果其中有 `universal` 就保留它)、其余的关闭 skills 同步,而不是移除 target: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 39ebc5b6d..3f308ac06 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} -**原因:** 两个 Target 以不同的 `include` 或 `exclude` 过滤器把 skills 同步到同一个文件夹。每次 sync 都会加入其中一个 Target 需要的内容,又移除另一个 Target 过滤掉的内容,所以这个文件夹永远无法稳定下来。`sync` 会指出是哪两个 Target: +**原因:** 两个 Target 以不同的 `include`/`exclude` 过滤器、`mode` 或 `target_naming` 设置把 skills 同步到同一个文件夹。每次 sync 都会加入其中一个 Target 需要的内容,又移除另一个 Target 过滤掉的内容,所以这个文件夹永远无法稳定下来。`sync` 会指出是哪两个 Target: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index f5d548c38..a6b085005 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor 會在兩類重複 skill 風險到達 runtime picker 之前先標示出 解決方式:停用其中一個重疊的 target,或使用 `skillshare target --path ` 設定不同的路徑。 -若共用路徑的 targets 其 `include` 或 `exclude` 篩選不同,每次同步都會加入一個 target 要的內容、再刪掉另一個 target 過濾掉的內容,資料夾永遠不會穩定,`sync` 也會一直顯示同樣的待同步變更。Doctor 會標出這種情況,並建議只保留一個 target(若其中有 `universal` 就保留它)、其他的關閉 skills 同步,而不是移除 target: +若共用路徑的 targets 其 `include` 或 `exclude` 篩選、`mode` 或 `target_naming` 不同,每次同步都會加入一個 target 要的內容、再刪掉另一個 target 過濾掉的內容,資料夾永遠不會穩定,`sync` 也會一直顯示同樣的待同步變更。Doctor 會標出這種情況,並建議只保留一個 target(若其中有 `universal` 就保留它)、其他的關閉 skills 同步,而不是移除 target: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index f780dd7c0..10b334910 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` 一直顯示相同的變更 {#sync-keeps-showing-the-same-changes} -**原因:** 兩個 Target 把 Skill 同步到同一個資料夾,但 `include` 或 `exclude` filters 不同。每次同步都會加入其中一個 Target 要的 Skill,同時移除另一個 Target 過濾掉的 Skill,所以資料夾永遠不會穩定下來。`sync` 會指出是哪兩個 Target: +**原因:** 兩個 Target 把 Skill 同步到同一個資料夾,但 `include` 或 `exclude` filters、`mode` 或 `target_naming` 不同。每次同步都會加入其中一個 Target 要的 Skill,同時移除另一個 Target 過濾掉的 Skill,所以資料夾永遠不會穩定下來。`sync` 會指出是哪兩個 Target: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other From 588d29c79d381b3f695017aa5528d588ff3557da Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 9 Oct 2026 00:37:28 +0800 Subject: [PATCH 03/12] fix(sync): ignore target naming for symlink targets sharing a folder Codex review on #499: two targets on one folder that both resolve to symlink mode were reported as a conflict when their target_naming differed. Symlink mode links the whole folder to the source and never uses per-skill names, so the naming cannot make them undo each other. Compare naming only when the shared mode is not symlink. --- internal/config/path_overlap.go | 12 +++++++++--- internal/config/path_overlap_test.go | 10 ++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/internal/config/path_overlap.go b/internal/config/path_overlap.go index a423d9617..c9f3715a3 100644 --- a/internal/config/path_overlap.go +++ b/internal/config/path_overlap.go @@ -158,9 +158,15 @@ func SkillsFolderConflicts(targets map[string]TargetConfig, defaultMode string) } func sameSkillsSettings(a, b ResourceTargetConfig, defaultMode string) bool { - return effectiveMode(a.Mode, defaultMode) == effectiveMode(b.Mode, defaultMode) && - EffectiveTargetNaming(a.TargetNaming) == EffectiveTargetNaming(b.TargetNaming) && - sameSet(a.Include, b.Include) && sameSet(a.Exclude, b.Exclude) + mode := effectiveMode(a.Mode, defaultMode) + if mode != effectiveMode(b.Mode, defaultMode) { + return false + } + // symlink mode links the whole folder to the source, so skill names never apply. + if mode != "symlink" && EffectiveTargetNaming(a.TargetNaming) != EffectiveTargetNaming(b.TargetNaming) { + return false + } + return sameSet(a.Include, b.Include) && sameSet(a.Exclude, b.Exclude) } // effectiveMode mirrors the sync package's mode resolution: the target's own, diff --git a/internal/config/path_overlap_test.go b/internal/config/path_overlap_test.go index e124baf9c..c06082214 100644 --- a/internal/config/path_overlap_test.go +++ b/internal/config/path_overlap_test.go @@ -118,6 +118,16 @@ func TestSkillsFolderConflicts_DifferentMode(t *testing.T) { } } +func TestSkillsFolderConflicts_SymlinkIgnoresTargetNaming(t *testing.T) { + got := SkillsFolderConflicts(map[string]TargetConfig{ + "aflat": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Mode: "symlink", TargetNaming: "flat"}}, + "bstd": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", TargetNaming: "standard"}}, + }, "symlink") + if len(got) != 0 { + t.Errorf("expected no conflict, got %+v", got) + } +} + func TestSkillsFolderConflicts_UnsetEqualsDefault(t *testing.T) { got := SkillsFolderConflicts(map[string]TargetConfig{ "unset": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills"}}, From 7e6649f2c55758f51212bed72c865634892acc24 Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 9 Oct 2026 00:41:40 +0800 Subject: [PATCH 04/12] docs(sync): say target naming doesn't matter for symlink targets Codex review on #499: after 588d29c7 the conflict check skips target_naming when the shared mode is symlink, but the doctor, sync and troubleshooting pages (and their translations) still said any naming difference makes shared targets undo each other. That could lead users to turn off a valid symlink target, so qualify the rule. --- internal/config/path_overlap.go | 2 +- website/docs/reference/commands/doctor.md | 2 +- website/docs/reference/commands/sync.md | 2 +- website/docs/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/reference/commands/sync.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/reference/commands/sync.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/reference/commands/sync.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/reference/commands/sync.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/internal/config/path_overlap.go b/internal/config/path_overlap.go index c9f3715a3..da96942f2 100644 --- a/internal/config/path_overlap.go +++ b/internal/config/path_overlap.go @@ -108,7 +108,7 @@ type SkillsFolderConflict struct { } // SkillsFolderConflicts returns the shared skills folders whose targets' -// filters, mode or target naming differ, sorted by path. defaultMode is the +// filters, mode or (outside symlink mode) target naming differ, sorted by path. defaultMode is the // global mode a target without its own inherits. Targets with identical // settings agree on the folder's contents and are not a conflict. universal // is kept when it is in the group, otherwise the alphabetically first target. diff --git a/website/docs/reference/commands/doctor.md b/website/docs/reference/commands/doctor.md index ef909ee9a..af660e6ee 100644 --- a/website/docs/reference/commands/doctor.md +++ b/website/docs/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor flags two classes of duplicate-skill risk before they reach the runtime p Resolution: disable one of the overlapping targets, or set a distinct path with `skillshare target --path `. -When the targets sharing a path have different `include` or `exclude` filters, `mode`, or `target_naming`, each sync adds what one target wants and prunes what another filters out, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: +When the targets sharing a path have different `include` or `exclude` filters, `mode`, or `target_naming` (naming only matters outside `symlink` mode, which links the whole folder), each sync adds what one target wants and prunes what another filters out, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/docs/reference/commands/sync.md b/website/docs/reference/commands/sync.md index 9dc1e0578..74fec5788 100644 --- a/website/docs/reference/commands/sync.md +++ b/website/docs/reference/commands/sync.md @@ -353,7 +353,7 @@ targets: - In symlink mode, filters are ignored - In copy mode, filters work the same way as merge mode - `sync` removes existing source-linked or managed entries that are now excluded -- Targets that share one folder need the same filters, mode and target naming; otherwise each sync undoes the other and `sync` warns (see [`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) +- Targets that share one folder need the same filters, mode and target naming (naming only matters outside `symlink` mode); otherwise each sync undoes the other and `sync` warns (see [`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) See [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters) for full details. diff --git a/website/docs/troubleshooting/common-errors.md b/website/docs/troubleshooting/common-errors.md index 74493f3fa..a63bc808d 100644 --- a/website/docs/troubleshooting/common-errors.md +++ b/website/docs/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} -**Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters, `mode`, or `target_naming`. Each sync adds what one target wants and removes what the other filters out, so the folder never settles. `sync` names them: +**Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters, `mode`, or `target_naming` (naming only matters outside `symlink` mode, which links the whole folder). Each sync adds what one target wants and removes what the other filters out, so the folder never settles. `sync` names them: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index dd3f958cb..1333b67a5 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor は、ランタイムのピッカーに到達する前に、Skill 重複 解決方法: 重複している Target のいずれかを無効化するか、`skillshare target --path ` で別のパスを設定してください。 -パスを共有する Target 同士で `include`、`exclude` のフィルター、`mode`、`target_naming` のいずれかが異なる場合、同期のたびに一方の Target が必要とするものが追加され、もう一方がフィルターで除外したものが削除されます。そのためフォルダが落ち着かず、`sync` には同じ保留中の変更が表示され続けます。Doctor はこのケースを示し、Target を削除する代わりに 1 つ(`universal` が含まれていればそれ)を残して残りの Skills 同期をオフにするよう提案します: +パスを共有する Target 同士で `include`、`exclude` のフィルター、`mode`、`target_naming` のいずれかが異なる場合(命名は `symlink` 以外のモードでのみ影響します。`symlink` はフォルダ全体をリンクするためです)、同期のたびに一方の Target が必要とするものが追加され、もう一方がフィルターで除外したものが削除されます。そのためフォルダが落ち着かず、`sync` には同じ保留中の変更が表示され続けます。Doctor はこのケースを示し、Target を削除する代わりに 1 つ(`universal` が含まれていればそれ)を残して残りの Skills 同期をオフにするよう提案します: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/sync.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/sync.md index fe20a8bc6..bd767bd0c 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/sync.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/sync.md @@ -345,7 +345,7 @@ targets: - symlink mode では、フィルターは無視されます - copy mode では、フィルターは merge mode と同じように動作します - `sync` は、除外されるようになった既存の source-linked または管理対象のエントリを削除します -- 同じフォルダを共有する target には同じフィルター、mode、target naming が必要です。そうでないと、各 sync が互いの結果を打ち消し合い、`sync` が警告を表示します([`sync` が同じ変更を表示し続ける](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes) を参照) +- 同じフォルダを共有する target には同じフィルター、mode、target naming が必要です(命名は `symlink` 以外のモードでのみ影響します)。そうでないと、各 sync が互いの結果を打ち消し合い、`sync` が警告を表示します([`sync` が同じ変更を表示し続ける](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes) を参照) 詳細は [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters) を参照してください。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index e42718fb9..19813cbc7 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -132,7 +132,7 @@ skillshare restore ### `sync` が同じ変更を表示し続ける {#sync-keeps-showing-the-same-changes} -**原因:** 2 つの Target が、`include` / `exclude` フィルター、`mode`、`target_naming` のいずれかが異なる状態で同じフォルダに Skill を Sync している。各 Sync が一方の Target の必要な Skill を追加し、もう一方のフィルターで除外される Skill を削除するため、フォルダの状態が安定しません。`sync` は該当する Target を表示します: +**原因:** 2 つの Target が、`include` / `exclude` フィルター、`mode`、`target_naming` のいずれかが異なる状態で(命名は `symlink` 以外のモードでのみ影響します。`symlink` はフォルダ全体をリンクするためです)同じフォルダに Skill を Sync している。各 Sync が一方の Target の必要な Skill を追加し、もう一方のフィルターで除外される Skill を削除するため、フォルダの状態が安定しません。`sync` は該当する Target を表示します: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index 5c2c4ce5a..f6cf8d468 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor는 런타임 피커에 도달하기 전에 두 가지 종류의 중복 sk 해결 방법: 중복된 target 중 하나를 비활성화하거나, `skillshare target --path `로 별도의 경로를 설정하십시오. -경로를 공유하는 target들의 `include`, `exclude` 필터, `mode`, `target_naming`이 서로 다르면, 동기화할 때마다 한 target이 원하는 항목이 추가되고 다른 target이 필터로 제외한 항목이 삭제됩니다. 그래서 폴더가 안정되지 않고 `sync`에 같은 대기 중 변경이 계속 표시됩니다. Doctor는 이 경우를 표시하고, target을 제거하는 대신 하나(`universal`이 포함되어 있으면 그것)만 남기고 나머지는 Skills 동기화를 끄도록 제안합니다: +경로를 공유하는 target들의 `include`, `exclude` 필터, `mode`, `target_naming`이 서로 다르면 (이름 규칙은 `symlink` 모드가 아닐 때만 영향을 줍니다. `symlink`는 폴더 전체를 링크하기 때문입니다), 동기화할 때마다 한 target이 원하는 항목이 추가되고 다른 target이 필터로 제외한 항목이 삭제됩니다. 그래서 폴더가 안정되지 않고 `sync`에 같은 대기 중 변경이 계속 표시됩니다. Doctor는 이 경우를 표시하고, target을 제거하는 대신 하나(`universal`이 포함되어 있으면 그것)만 남기고 나머지는 Skills 동기화를 끄도록 제안합니다: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/sync.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/sync.md index ab9ee3052..10082c52c 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/sync.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/sync.md @@ -346,7 +346,7 @@ targets: - symlink mode에서는 filter가 무시됩니다 - copy mode에서 filter는 merge mode와 동일하게 동작합니다 - `sync`는 이제 제외된 기존 source-linked 또는 managed entry를 제거합니다 -- 하나의 폴더를 공유하는 target들은 같은 filter, mode, target naming을 사용해야 합니다. 그렇지 않으면 매번 sync가 서로의 결과를 되돌리며, `sync`가 경고를 표시합니다([`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes) 참고) +- 하나의 폴더를 공유하는 target들은 같은 filter, mode, target naming을 사용해야 합니다 (이름 규칙은 `symlink` 모드가 아닐 때만 영향을 줍니다). 그렇지 않으면 매번 sync가 서로의 결과를 되돌리며, `sync`가 경고를 표시합니다([`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes) 참고) 자세한 내용은 [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters)을 참고하세요. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 93af07488..2d0288dc4 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} -**Cause:** 두 target이 서로 다른 `include`/`exclude` filter, `mode` 또는 `target_naming`으로 같은 폴더에 skill을 sync합니다. 매번 sync할 때마다 한 target이 원하는 것은 추가되고 다른 target이 걸러내는 것은 제거되므로, 폴더가 안정되지 않습니다. `sync`가 해당 target을 알려줍니다: +**Cause:** 두 target이 서로 다른 `include`/`exclude` filter, `mode` 또는 `target_naming`으로 (이름 규칙은 `symlink` 모드가 아닐 때만 영향을 줍니다. `symlink`는 폴더 전체를 링크하기 때문입니다) 같은 폴더에 skill을 sync합니다. 매번 sync할 때마다 한 target이 원하는 것은 추가되고 다른 target이 걸러내는 것은 제거되므로, 폴더가 안정되지 않습니다. `sync`가 해당 target을 알려줍니다: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index 4922a2764..c2600883e 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -149,7 +149,7 @@ Doctor 会在两类重复 skill 风险到达运行时选择器之前将其标记 解决方法:禁用其中一个重叠的 target,或用 `skillshare target --path ` 设置一个独立的路径。 -如果共用路径的 targets 的 `include` 或 `exclude` 筛选、`mode` 或 `target_naming` 不同,每次同步都会加入一个 target 需要的内容、再删掉另一个 target 过滤掉的内容,文件夹永远不会稳定,`sync` 也会一直显示同样的待同步变更。Doctor 会标出这种情况,并建议只保留一个 target(如果其中有 `universal` 就保留它)、其余的关闭 skills 同步,而不是移除 target: +如果共用路径的 targets 的 `include` 或 `exclude` 筛选、`mode` 或 `target_naming` 不同(命名只在 `symlink` 以外的模式有影响,`symlink` 会直接链接整个文件夹),每次同步都会加入一个 target 需要的内容、再删掉另一个 target 过滤掉的内容,文件夹永远不会稳定,`sync` 也会一直显示同样的待同步变更。Doctor 会标出这种情况,并建议只保留一个 target(如果其中有 `universal` 就保留它)、其余的关闭 skills 同步,而不是移除 target: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/sync.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/sync.md index b1c98c0c8..7fd8c71ef 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/sync.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/sync.md @@ -367,7 +367,7 @@ targets: - 在 symlink 模式下,filters 会被忽略 - 在 copy 模式下,filters 的行为方式与 merge 模式相同 - `sync` 会移除已被排除、但之前是 source-linked 或受管理的条目 -- 共用同一个文件夹的多个 target 需要相同的 filters、mode 和 target naming;否则每次 sync 都会撤销另一个 target 的结果,`sync` 会发出警告(参见 [`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) +- 共用同一个文件夹的多个 target 需要相同的 filters、mode 和 target naming(命名只在 `symlink` 以外的模式有影响);否则每次 sync 都会撤销另一个 target 的结果,`sync` 会发出警告(参见 [`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) 完整细节参见 [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters)。 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 3f308ac06..4120c1dda 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} -**原因:** 两个 Target 以不同的 `include`/`exclude` 过滤器、`mode` 或 `target_naming` 设置把 skills 同步到同一个文件夹。每次 sync 都会加入其中一个 Target 需要的内容,又移除另一个 Target 过滤掉的内容,所以这个文件夹永远无法稳定下来。`sync` 会指出是哪两个 Target: +**原因:** 两个 Target 以不同的 `include`/`exclude` 过滤器、`mode` 或 `target_naming` 设置(命名只在 `symlink` 以外的模式有影响,`symlink` 会直接链接整个文件夹)把 skills 同步到同一个文件夹。每次 sync 都会加入其中一个 Target 需要的内容,又移除另一个 Target 过滤掉的内容,所以这个文件夹永远无法稳定下来。`sync` 会指出是哪两个 Target: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index a6b085005..66872e9ad 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor 會在兩類重複 skill 風險到達 runtime picker 之前先標示出 解決方式:停用其中一個重疊的 target,或使用 `skillshare target --path ` 設定不同的路徑。 -若共用路徑的 targets 其 `include` 或 `exclude` 篩選、`mode` 或 `target_naming` 不同,每次同步都會加入一個 target 要的內容、再刪掉另一個 target 過濾掉的內容,資料夾永遠不會穩定,`sync` 也會一直顯示同樣的待同步變更。Doctor 會標出這種情況,並建議只保留一個 target(若其中有 `universal` 就保留它)、其他的關閉 skills 同步,而不是移除 target: +若共用路徑的 targets 其 `include` 或 `exclude` 篩選、`mode` 或 `target_naming` 不同(命名只在 `symlink` 以外的模式有影響,`symlink` 會直接連結整個資料夾),每次同步都會加入一個 target 要的內容、再刪掉另一個 target 過濾掉的內容,資料夾永遠不會穩定,`sync` 也會一直顯示同樣的待同步變更。Doctor 會標出這種情況,並建議只保留一個 target(若其中有 `universal` 就保留它)、其他的關閉 skills 同步,而不是移除 target: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/sync.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/sync.md index d95834dc0..303489d4c 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/sync.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/sync.md @@ -345,7 +345,7 @@ targets: - 在 symlink mode 中,filters 會被忽略 - 在 copy mode 中,filters 的運作方式與 merge mode 相同 - `sync` 會移除現在已被排除、但先前是 source-linked 或受管理的條目 -- 共用同一個資料夾的 targets 需要相同的 filters、mode 與 target naming;否則每次同步都會抵銷另一個 target 的結果,`sync` 會發出警告(見 [`sync` 一直顯示相同的變更](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) +- 共用同一個資料夾的 targets 需要相同的 filters、mode 與 target naming(命名只在 `symlink` 以外的模式有影響);否則每次同步都會抵銷另一個 target 的結果,`sync` 會發出警告(見 [`sync` 一直顯示相同的變更](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) 完整細節見 [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters)。 diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 10b334910..039668ecc 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` 一直顯示相同的變更 {#sync-keeps-showing-the-same-changes} -**原因:** 兩個 Target 把 Skill 同步到同一個資料夾,但 `include` 或 `exclude` filters、`mode` 或 `target_naming` 不同。每次同步都會加入其中一個 Target 要的 Skill,同時移除另一個 Target 過濾掉的 Skill,所以資料夾永遠不會穩定下來。`sync` 會指出是哪兩個 Target: +**原因:** 兩個 Target 把 Skill 同步到同一個資料夾,但 `include` 或 `exclude` filters、`mode` 或 `target_naming` 不同(命名只在 `symlink` 以外的模式有影響,`symlink` 會直接連結整個資料夾)。每次同步都會加入其中一個 Target 要的 Skill,同時移除另一個 Target 過濾掉的 Skill,所以資料夾永遠不會穩定下來。`sync` 會指出是哪兩個 Target: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other From 549d4d892761430ead910927812f65fe17484ab8 Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 9 Oct 2026 00:45:12 +0800 Subject: [PATCH 05/12] docs(sync): describe shared-folder conflicts beyond filters Codex review on #499: the troubleshooting and doctor pages explained the conflict as one target adding what the other filters out, and offered "give both targets the same filters" as a fix. When the conflict comes from mode or target naming, that fix does nothing and the explanation doesn't match what happens (entries renamed, links swapped for copies). Describe the conflict as each sync undoing the other's work and say all three settings must agree, in English and the four translations. --- website/docs/reference/commands/doctor.md | 2 +- website/docs/troubleshooting/common-errors.md | 4 ++-- .../current/reference/commands/doctor.md | 2 +- .../current/troubleshooting/common-errors.md | 4 ++-- .../current/reference/commands/doctor.md | 2 +- .../current/troubleshooting/common-errors.md | 4 ++-- .../current/reference/commands/doctor.md | 2 +- .../current/troubleshooting/common-errors.md | 4 ++-- .../current/reference/commands/doctor.md | 2 +- .../current/troubleshooting/common-errors.md | 4 ++-- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/website/docs/reference/commands/doctor.md b/website/docs/reference/commands/doctor.md index af660e6ee..050cec1b4 100644 --- a/website/docs/reference/commands/doctor.md +++ b/website/docs/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor flags two classes of duplicate-skill risk before they reach the runtime p Resolution: disable one of the overlapping targets, or set a distinct path with `skillshare target --path `. -When the targets sharing a path have different `include` or `exclude` filters, `mode`, or `target_naming` (naming only matters outside `symlink` mode, which links the whole folder), each sync adds what one target wants and prunes what another filters out, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: +When the targets sharing a path have different `include` or `exclude` filters, `mode`, or `target_naming` (naming only matters outside `symlink` mode, which links the whole folder), each sync redoes the folder the way one target wants and undoes the other's work, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/docs/troubleshooting/common-errors.md b/website/docs/troubleshooting/common-errors.md index a63bc808d..7d3690354 100644 --- a/website/docs/troubleshooting/common-errors.md +++ b/website/docs/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} -**Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters, `mode`, or `target_naming` (naming only matters outside `symlink` mode, which links the whole folder). Each sync adds what one target wants and removes what the other filters out, so the folder never settles. `sync` names them: +**Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters, `mode`, or `target_naming` (naming only matters outside `symlink` mode, which links the whole folder). Each sync redoes the folder the way one target wants and undoes the other's work (adding or removing filtered skills, renaming entries, or switching links and copies), so the folder never settles. `sync` names them: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other @@ -137,7 +137,7 @@ skillshare target codex --skills=false --dry-run skillshare target codex --skills=false ``` -In the dashboard, the **Sync** page shows the same warning with a button that stops syncing skills for that target. Giving both targets the same filters also works. +In the dashboard, the **Sync** page shows the same warning with a button that stops syncing skills for that target. Giving both targets the same filters, mode and target naming also works. ### `sync seems stuck or slow` diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index 1333b67a5..c7d65a339 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor は、ランタイムのピッカーに到達する前に、Skill 重複 解決方法: 重複している Target のいずれかを無効化するか、`skillshare target --path ` で別のパスを設定してください。 -パスを共有する Target 同士で `include`、`exclude` のフィルター、`mode`、`target_naming` のいずれかが異なる場合(命名は `symlink` 以外のモードでのみ影響します。`symlink` はフォルダ全体をリンクするためです)、同期のたびに一方の Target が必要とするものが追加され、もう一方がフィルターで除外したものが削除されます。そのためフォルダが落ち着かず、`sync` には同じ保留中の変更が表示され続けます。Doctor はこのケースを示し、Target を削除する代わりに 1 つ(`universal` が含まれていればそれ)を残して残りの Skills 同期をオフにするよう提案します: +パスを共有する Target 同士で `include`、`exclude` のフィルター、`mode`、`target_naming` のいずれかが異なる場合(命名は `symlink` 以外のモードでのみ影響します。`symlink` はフォルダ全体をリンクするためです)、同期のたびに一方の Target の設定どおりにフォルダが書き直され、もう一方の結果が打ち消されます。そのためフォルダが落ち着かず、`sync` には同じ保留中の変更が表示され続けます。Doctor はこのケースを示し、Target を削除する代わりに 1 つ(`universal` が含まれていればそれ)を残して残りの Skills 同期をオフにするよう提案します: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 19813cbc7..efa969a93 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -132,7 +132,7 @@ skillshare restore ### `sync` が同じ変更を表示し続ける {#sync-keeps-showing-the-same-changes} -**原因:** 2 つの Target が、`include` / `exclude` フィルター、`mode`、`target_naming` のいずれかが異なる状態で(命名は `symlink` 以外のモードでのみ影響します。`symlink` はフォルダ全体をリンクするためです)同じフォルダに Skill を Sync している。各 Sync が一方の Target の必要な Skill を追加し、もう一方のフィルターで除外される Skill を削除するため、フォルダの状態が安定しません。`sync` は該当する Target を表示します: +**原因:** 2 つの Target が、`include` / `exclude` フィルター、`mode`、`target_naming` のいずれかが異なる状態で(命名は `symlink` 以外のモードでのみ影響します。`symlink` はフォルダ全体をリンクするためです)同じフォルダに Skill を Sync している。各 Sync が一方の Target の設定どおりにフォルダを書き直し、もう一方の結果を打ち消す(フィルター対象の Skill の追加や削除、名前の変更、リンクとコピーの切り替え)ため、フォルダの状態が安定しません。`sync` は該当する Target を表示します: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other @@ -146,7 +146,7 @@ skillshare target codex --skills=false --dry-run skillshare target codex --skills=false ``` -ダッシュボードの **Sync** ページにも同じ警告が表示され、その Target の Skill の Sync を停止するボタンがあります。両方の Target に同じフィルターを設定する方法でも解決できます。 +ダッシュボードの **Sync** ページにも同じ警告が表示され、その Target の Skill の Sync を停止するボタンがあります。両方の Target に同じフィルター、mode、target naming を設定する方法でも解決できます。 ### `sync seems stuck or slow` diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index f6cf8d468..5180742b6 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor는 런타임 피커에 도달하기 전에 두 가지 종류의 중복 sk 해결 방법: 중복된 target 중 하나를 비활성화하거나, `skillshare target --path `로 별도의 경로를 설정하십시오. -경로를 공유하는 target들의 `include`, `exclude` 필터, `mode`, `target_naming`이 서로 다르면 (이름 규칙은 `symlink` 모드가 아닐 때만 영향을 줍니다. `symlink`는 폴더 전체를 링크하기 때문입니다), 동기화할 때마다 한 target이 원하는 항목이 추가되고 다른 target이 필터로 제외한 항목이 삭제됩니다. 그래서 폴더가 안정되지 않고 `sync`에 같은 대기 중 변경이 계속 표시됩니다. Doctor는 이 경우를 표시하고, target을 제거하는 대신 하나(`universal`이 포함되어 있으면 그것)만 남기고 나머지는 Skills 동기화를 끄도록 제안합니다: +경로를 공유하는 target들의 `include`, `exclude` 필터, `mode`, `target_naming`이 서로 다르면 (이름 규칙은 `symlink` 모드가 아닐 때만 영향을 줍니다. `symlink`는 폴더 전체를 링크하기 때문입니다), 동기화할 때마다 한 target의 설정대로 폴더를 다시 쓰고 다른 target의 결과를 되돌립니다. 그래서 폴더가 안정되지 않고 `sync`에 같은 대기 중 변경이 계속 표시됩니다. Doctor는 이 경우를 표시하고, target을 제거하는 대신 하나(`universal`이 포함되어 있으면 그것)만 남기고 나머지는 Skills 동기화를 끄도록 제안합니다: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 2d0288dc4..8e87a70df 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} -**Cause:** 두 target이 서로 다른 `include`/`exclude` filter, `mode` 또는 `target_naming`으로 (이름 규칙은 `symlink` 모드가 아닐 때만 영향을 줍니다. `symlink`는 폴더 전체를 링크하기 때문입니다) 같은 폴더에 skill을 sync합니다. 매번 sync할 때마다 한 target이 원하는 것은 추가되고 다른 target이 걸러내는 것은 제거되므로, 폴더가 안정되지 않습니다. `sync`가 해당 target을 알려줍니다: +**Cause:** 두 target이 서로 다른 `include`/`exclude` filter, `mode` 또는 `target_naming`으로 (이름 규칙은 `symlink` 모드가 아닐 때만 영향을 줍니다. `symlink`는 폴더 전체를 링크하기 때문입니다) 같은 폴더에 skill을 sync합니다. 매번 sync할 때마다 한 target의 설정대로 폴더를 다시 쓰고 다른 target의 결과를 되돌리므로(필터된 skill 추가나 제거, 이름 변경, 링크와 복사본 전환), 폴더가 안정되지 않습니다. `sync`가 해당 target을 알려줍니다: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other @@ -137,7 +137,7 @@ skillshare target codex --skills=false --dry-run skillshare target codex --skills=false ``` -대시보드의 **Sync** 페이지에도 같은 경고가 표시되며, 해당 target의 skill 동기화를 중지하는 버튼이 함께 제공됩니다. 두 target에 같은 filter를 지정해도 해결됩니다. +대시보드의 **Sync** 페이지에도 같은 경고가 표시되며, 해당 target의 skill 동기화를 중지하는 버튼이 함께 제공됩니다. 두 target에 같은 filter, mode, target naming을 지정해도 해결됩니다. ### `sync seems stuck or slow` diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index c2600883e..9314fea38 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -149,7 +149,7 @@ Doctor 会在两类重复 skill 风险到达运行时选择器之前将其标记 解决方法:禁用其中一个重叠的 target,或用 `skillshare target --path ` 设置一个独立的路径。 -如果共用路径的 targets 的 `include` 或 `exclude` 筛选、`mode` 或 `target_naming` 不同(命名只在 `symlink` 以外的模式有影响,`symlink` 会直接链接整个文件夹),每次同步都会加入一个 target 需要的内容、再删掉另一个 target 过滤掉的内容,文件夹永远不会稳定,`sync` 也会一直显示同样的待同步变更。Doctor 会标出这种情况,并建议只保留一个 target(如果其中有 `universal` 就保留它)、其余的关闭 skills 同步,而不是移除 target: +如果共用路径的 targets 的 `include` 或 `exclude` 筛选、`mode` 或 `target_naming` 不同(命名只在 `symlink` 以外的模式有影响,`symlink` 会直接链接整个文件夹),每次同步都会按其中一个 target 的设置重写文件夹、抵消另一个 target 的结果,文件夹永远不会稳定,`sync` 也会一直显示同样的待同步变更。Doctor 会标出这种情况,并建议只保留一个 target(如果其中有 `universal` 就保留它)、其余的关闭 skills 同步,而不是移除 target: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 4120c1dda..5c03826f4 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} -**原因:** 两个 Target 以不同的 `include`/`exclude` 过滤器、`mode` 或 `target_naming` 设置(命名只在 `symlink` 以外的模式有影响,`symlink` 会直接链接整个文件夹)把 skills 同步到同一个文件夹。每次 sync 都会加入其中一个 Target 需要的内容,又移除另一个 Target 过滤掉的内容,所以这个文件夹永远无法稳定下来。`sync` 会指出是哪两个 Target: +**原因:** 两个 Target 以不同的 `include`/`exclude` 过滤器、`mode` 或 `target_naming` 设置(命名只在 `symlink` 以外的模式有影响,`symlink` 会直接链接整个文件夹)把 skills 同步到同一个文件夹。每次 sync 都会按其中一个 Target 的设置重写文件夹,抵消另一个 Target 的结果(加入或移除被过滤的 skills、改名,或在链接与副本之间切换),所以这个文件夹永远无法稳定下来。`sync` 会指出是哪两个 Target: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other @@ -137,7 +137,7 @@ skillshare target codex --skills=false --dry-run skillshare target codex --skills=false ``` -在仪表板中,**Sync** 页面会显示同样的警告,并提供一个按钮,用来停止为该 Target 同步 skills。让两个 Target 使用相同的过滤器也同样可行。 +在仪表板中,**Sync** 页面会显示同样的警告,并提供一个按钮,用来停止为该 Target 同步 skills。让两个 Target 使用相同的过滤器、mode 和 target naming 也同样可行。 ### `sync seems stuck or slow` diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index 66872e9ad..51705a310 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor 會在兩類重複 skill 風險到達 runtime picker 之前先標示出 解決方式:停用其中一個重疊的 target,或使用 `skillshare target --path ` 設定不同的路徑。 -若共用路徑的 targets 其 `include` 或 `exclude` 篩選、`mode` 或 `target_naming` 不同(命名只在 `symlink` 以外的模式有影響,`symlink` 會直接連結整個資料夾),每次同步都會加入一個 target 要的內容、再刪掉另一個 target 過濾掉的內容,資料夾永遠不會穩定,`sync` 也會一直顯示同樣的待同步變更。Doctor 會標出這種情況,並建議只保留一個 target(若其中有 `universal` 就保留它)、其他的關閉 skills 同步,而不是移除 target: +若共用路徑的 targets 其 `include` 或 `exclude` 篩選、`mode` 或 `target_naming` 不同(命名只在 `symlink` 以外的模式有影響,`symlink` 會直接連結整個資料夾),每次同步都會照其中一個 target 的設定重寫資料夾、抵銷另一個 target 的結果,資料夾永遠不會穩定,`sync` 也會一直顯示同樣的待同步變更。Doctor 會標出這種情況,並建議只保留一個 target(若其中有 `universal` 就保留它)、其他的關閉 skills 同步,而不是移除 target: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 039668ecc..447cdf671 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` 一直顯示相同的變更 {#sync-keeps-showing-the-same-changes} -**原因:** 兩個 Target 把 Skill 同步到同一個資料夾,但 `include` 或 `exclude` filters、`mode` 或 `target_naming` 不同(命名只在 `symlink` 以外的模式有影響,`symlink` 會直接連結整個資料夾)。每次同步都會加入其中一個 Target 要的 Skill,同時移除另一個 Target 過濾掉的 Skill,所以資料夾永遠不會穩定下來。`sync` 會指出是哪兩個 Target: +**原因:** 兩個 Target 把 Skill 同步到同一個資料夾,但 `include` 或 `exclude` filters、`mode` 或 `target_naming` 不同(命名只在 `symlink` 以外的模式有影響,`symlink` 會直接連結整個資料夾)。每次同步都會照其中一個 Target 的設定重寫資料夾,抵銷另一個 Target 的結果(加入或移除被過濾的 Skill、改名,或在連結與複本之間切換),所以資料夾永遠不會穩定下來。`sync` 會指出是哪兩個 Target: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other @@ -137,7 +137,7 @@ skillshare target codex --skills=false --dry-run skillshare target codex --skills=false ``` -在 dashboard 中,**Sync** 頁面會顯示相同的警告,並附上一個按鈕,可停止該 Target 的 Skill 同步。讓兩個 Target 使用相同的 filters 也可以解決。 +在 dashboard 中,**Sync** 頁面會顯示相同的警告,並附上一個按鈕,可停止該 Target 的 Skill 同步。讓兩個 Target 使用相同的 filters、mode 與 target naming 也可以解決。 ### `sync seems stuck or slow` From 8a24ff9211a60169c179e2f6f637c20868cf08a1 Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 9 Oct 2026 00:55:53 +0800 Subject: [PATCH 06/12] refactor(sync): treat symlink targets on one folder as never conflicting A /simplify pass on #499 found the symlink exception too narrow: symlink mode links the whole folder to the source and reads neither target naming nor include/exclude, yet two symlink targets with different filters were still reported as undoing each other. State the rule once (same symlink mode means same folder contents) instead of exempting only naming, and resolve the mode with cmp.Or like sync's isSymlinkMode rather than a local copy of the sync package's resolver. Docs now say none of these settings matter in symlink mode. --- internal/config/path_overlap.go | 38 +++++++------------ internal/config/path_overlap_test.go | 10 +++++ website/docs/reference/commands/doctor.md | 2 +- website/docs/reference/commands/sync.md | 2 +- website/docs/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/reference/commands/sync.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/reference/commands/sync.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/reference/commands/sync.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- .../current/reference/commands/doctor.md | 2 +- .../current/reference/commands/sync.md | 2 +- .../current/troubleshooting/common-errors.md | 2 +- 17 files changed, 39 insertions(+), 39 deletions(-) diff --git a/internal/config/path_overlap.go b/internal/config/path_overlap.go index da96942f2..57c2c9ce1 100644 --- a/internal/config/path_overlap.go +++ b/internal/config/path_overlap.go @@ -1,6 +1,7 @@ package config import ( + "cmp" "path/filepath" "slices" "sort" @@ -98,8 +99,8 @@ func SkillsPathKeptBy(targets map[string]TargetConfig, name string, leaving map[ } // SkillsFolderConflict is a skills folder that two or more targets with skills -// on sync into with different include or exclude filters, mode or target -// naming, so each sync undoes the others' links. Keep is the target to leave on; Stop the rest. +// on sync into with different settings, so each sync undoes the others' +// links. Keep is the target to leave on; Stop the rest. type SkillsFolderConflict struct { Path string `json:"path"` Targets []string `json:"targets"` @@ -108,10 +109,10 @@ type SkillsFolderConflict struct { } // SkillsFolderConflicts returns the shared skills folders whose targets' -// filters, mode or (outside symlink mode) target naming differ, sorted by path. defaultMode is the -// global mode a target without its own inherits. Targets with identical -// settings agree on the folder's contents and are not a conflict. universal -// is kept when it is in the group, otherwise the alphabetically first target. +// settings differ, sorted by path. defaultMode is the global mode a target +// without its own inherits. Targets with identical settings agree on the +// folder's contents and are not a conflict. universal is kept when it is in +// the group, otherwise the alphabetically first target. func SkillsFolderConflicts(targets map[string]TargetConfig, defaultMode string) []SkillsFolderConflict { byFolder := make(map[string][]string) for name, tc := range targets { @@ -158,27 +159,16 @@ func SkillsFolderConflicts(targets map[string]TargetConfig, defaultMode string) } func sameSkillsSettings(a, b ResourceTargetConfig, defaultMode string) bool { - mode := effectiveMode(a.Mode, defaultMode) - if mode != effectiveMode(b.Mode, defaultMode) { + mode := cmp.Or(a.Mode, defaultMode, "merge") + if mode != cmp.Or(b.Mode, defaultMode, "merge") { return false } - // symlink mode links the whole folder to the source, so skill names never apply. - if mode != "symlink" && EffectiveTargetNaming(a.TargetNaming) != EffectiveTargetNaming(b.TargetNaming) { - return false + // symlink mode links the whole folder to the source, so no per-skill setting applies. + if mode == "symlink" { + return true } - return sameSet(a.Include, b.Include) && sameSet(a.Exclude, b.Exclude) -} - -// effectiveMode mirrors the sync package's mode resolution: the target's own, -// then the global default, then merge. -func effectiveMode(mode, defaultMode string) string { - if mode != "" { - return mode - } - if defaultMode != "" { - return defaultMode - } - return "merge" + return EffectiveTargetNaming(a.TargetNaming) == EffectiveTargetNaming(b.TargetNaming) && + sameSet(a.Include, b.Include) && sameSet(a.Exclude, b.Exclude) } func sameSet(a, b []string) bool { diff --git a/internal/config/path_overlap_test.go b/internal/config/path_overlap_test.go index c06082214..5a458ab0f 100644 --- a/internal/config/path_overlap_test.go +++ b/internal/config/path_overlap_test.go @@ -128,6 +128,16 @@ func TestSkillsFolderConflicts_SymlinkIgnoresTargetNaming(t *testing.T) { } } +func TestSkillsFolderConflicts_SymlinkIgnoresFilters(t *testing.T) { + got := SkillsFolderConflicts(map[string]TargetConfig{ + "universal": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Mode: "symlink", Exclude: []string{"x"}}}, + "codex": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills", Mode: "symlink"}}, + }, "") + if len(got) != 0 { + t.Errorf("expected no conflict, got %+v", got) + } +} + func TestSkillsFolderConflicts_UnsetEqualsDefault(t *testing.T) { got := SkillsFolderConflicts(map[string]TargetConfig{ "unset": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills"}}, diff --git a/website/docs/reference/commands/doctor.md b/website/docs/reference/commands/doctor.md index 050cec1b4..fda968821 100644 --- a/website/docs/reference/commands/doctor.md +++ b/website/docs/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor flags two classes of duplicate-skill risk before they reach the runtime p Resolution: disable one of the overlapping targets, or set a distinct path with `skillshare target --path `. -When the targets sharing a path have different `include` or `exclude` filters, `mode`, or `target_naming` (naming only matters outside `symlink` mode, which links the whole folder), each sync redoes the folder the way one target wants and undoes the other's work, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: +When the targets sharing a path have different `include` or `exclude` filters, `mode`, or `target_naming` (none of these matter in `symlink` mode, which links the whole folder), each sync redoes the folder the way one target wants and undoes the other's work, so the folder never settles and `sync` keeps showing the same pending changes. Doctor marks these and suggests turning skills off for all but one target (`universal` when it is one of them) instead of removing a target: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/docs/reference/commands/sync.md b/website/docs/reference/commands/sync.md index 74fec5788..616e4e7f8 100644 --- a/website/docs/reference/commands/sync.md +++ b/website/docs/reference/commands/sync.md @@ -353,7 +353,7 @@ targets: - In symlink mode, filters are ignored - In copy mode, filters work the same way as merge mode - `sync` removes existing source-linked or managed entries that are now excluded -- Targets that share one folder need the same filters, mode and target naming (naming only matters outside `symlink` mode); otherwise each sync undoes the other and `sync` warns (see [`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) +- Targets that share one folder need the same filters, mode and target naming (none of these matter in `symlink` mode); otherwise each sync undoes the other and `sync` warns (see [`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) See [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters) for full details. diff --git a/website/docs/troubleshooting/common-errors.md b/website/docs/troubleshooting/common-errors.md index 7d3690354..502287d18 100644 --- a/website/docs/troubleshooting/common-errors.md +++ b/website/docs/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} -**Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters, `mode`, or `target_naming` (naming only matters outside `symlink` mode, which links the whole folder). Each sync redoes the folder the way one target wants and undoes the other's work (adding or removing filtered skills, renaming entries, or switching links and copies), so the folder never settles. `sync` names them: +**Cause:** Two targets sync skills into the same folder with different `include` or `exclude` filters, `mode`, or `target_naming` (none of these matter in `symlink` mode, which links the whole folder). Each sync redoes the folder the way one target wants and undoes the other's work (adding or removing filtered skills, renaming entries, or switching links and copies), so the folder never settles. `sync` names them: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index c7d65a339..7697c07a4 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor は、ランタイムのピッカーに到達する前に、Skill 重複 解決方法: 重複している Target のいずれかを無効化するか、`skillshare target --path ` で別のパスを設定してください。 -パスを共有する Target 同士で `include`、`exclude` のフィルター、`mode`、`target_naming` のいずれかが異なる場合(命名は `symlink` 以外のモードでのみ影響します。`symlink` はフォルダ全体をリンクするためです)、同期のたびに一方の Target の設定どおりにフォルダが書き直され、もう一方の結果が打ち消されます。そのためフォルダが落ち着かず、`sync` には同じ保留中の変更が表示され続けます。Doctor はこのケースを示し、Target を削除する代わりに 1 つ(`universal` が含まれていればそれ)を残して残りの Skills 同期をオフにするよう提案します: +パスを共有する Target 同士で `include`、`exclude` のフィルター、`mode`、`target_naming` のいずれかが異なる場合(`symlink` モードはフォルダ全体をリンクするため、これらの設定は影響しません)、同期のたびに一方の Target の設定どおりにフォルダが書き直され、もう一方の結果が打ち消されます。そのためフォルダが落ち着かず、`sync` には同じ保留中の変更が表示され続けます。Doctor はこのケースを示し、Target を削除する代わりに 1 つ(`universal` が含まれていればそれ)を残して残りの Skills 同期をオフにするよう提案します: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/sync.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/sync.md index bd767bd0c..6dcb947d0 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/sync.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/sync.md @@ -345,7 +345,7 @@ targets: - symlink mode では、フィルターは無視されます - copy mode では、フィルターは merge mode と同じように動作します - `sync` は、除外されるようになった既存の source-linked または管理対象のエントリを削除します -- 同じフォルダを共有する target には同じフィルター、mode、target naming が必要です(命名は `symlink` 以外のモードでのみ影響します)。そうでないと、各 sync が互いの結果を打ち消し合い、`sync` が警告を表示します([`sync` が同じ変更を表示し続ける](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes) を参照) +- 同じフォルダを共有する target には同じフィルター、mode、target naming が必要です(`symlink` モードではこれらの設定は影響しません)。そうでないと、各 sync が互いの結果を打ち消し合い、`sync` が警告を表示します([`sync` が同じ変更を表示し続ける](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes) を参照) 詳細は [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters) を参照してください。 diff --git a/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index efa969a93..7d5249653 100644 --- a/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/ja/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -132,7 +132,7 @@ skillshare restore ### `sync` が同じ変更を表示し続ける {#sync-keeps-showing-the-same-changes} -**原因:** 2 つの Target が、`include` / `exclude` フィルター、`mode`、`target_naming` のいずれかが異なる状態で(命名は `symlink` 以外のモードでのみ影響します。`symlink` はフォルダ全体をリンクするためです)同じフォルダに Skill を Sync している。各 Sync が一方の Target の設定どおりにフォルダを書き直し、もう一方の結果を打ち消す(フィルター対象の Skill の追加や削除、名前の変更、リンクとコピーの切り替え)ため、フォルダの状態が安定しません。`sync` は該当する Target を表示します: +**原因:** 2 つの Target が、`include` / `exclude` フィルター、`mode`、`target_naming` のいずれかが異なる状態で(`symlink` モードはフォルダ全体をリンクするため、これらの設定は影響しません)同じフォルダに Skill を Sync している。各 Sync が一方の Target の設定どおりにフォルダを書き直し、もう一方の結果を打ち消す(フィルター対象の Skill の追加や削除、名前の変更、リンクとコピーの切り替え)ため、フォルダの状態が安定しません。`sync` は該当する Target を表示します: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index 5180742b6..7f20dd96b 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor는 런타임 피커에 도달하기 전에 두 가지 종류의 중복 sk 해결 방법: 중복된 target 중 하나를 비활성화하거나, `skillshare target --path `로 별도의 경로를 설정하십시오. -경로를 공유하는 target들의 `include`, `exclude` 필터, `mode`, `target_naming`이 서로 다르면 (이름 규칙은 `symlink` 모드가 아닐 때만 영향을 줍니다. `symlink`는 폴더 전체를 링크하기 때문입니다), 동기화할 때마다 한 target의 설정대로 폴더를 다시 쓰고 다른 target의 결과를 되돌립니다. 그래서 폴더가 안정되지 않고 `sync`에 같은 대기 중 변경이 계속 표시됩니다. Doctor는 이 경우를 표시하고, target을 제거하는 대신 하나(`universal`이 포함되어 있으면 그것)만 남기고 나머지는 Skills 동기화를 끄도록 제안합니다: +경로를 공유하는 target들의 `include`, `exclude` 필터, `mode`, `target_naming`이 서로 다르면 (`symlink` 모드는 폴더 전체를 링크하므로 이 설정들은 영향을 주지 않습니다), 동기화할 때마다 한 target의 설정대로 폴더를 다시 쓰고 다른 target의 결과를 되돌립니다. 그래서 폴더가 안정되지 않고 `sync`에 같은 대기 중 변경이 계속 표시됩니다. Doctor는 이 경우를 표시하고, target을 제거하는 대신 하나(`universal`이 포함되어 있으면 그것)만 남기고 나머지는 Skills 동기화를 끄도록 제안합니다: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/sync.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/sync.md index 10082c52c..6df548605 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/sync.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/sync.md @@ -346,7 +346,7 @@ targets: - symlink mode에서는 filter가 무시됩니다 - copy mode에서 filter는 merge mode와 동일하게 동작합니다 - `sync`는 이제 제외된 기존 source-linked 또는 managed entry를 제거합니다 -- 하나의 폴더를 공유하는 target들은 같은 filter, mode, target naming을 사용해야 합니다 (이름 규칙은 `symlink` 모드가 아닐 때만 영향을 줍니다). 그렇지 않으면 매번 sync가 서로의 결과를 되돌리며, `sync`가 경고를 표시합니다([`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes) 참고) +- 하나의 폴더를 공유하는 target들은 같은 filter, mode, target naming을 사용해야 합니다 (`symlink` 모드에서는 이 설정들이 영향을 주지 않습니다). 그렇지 않으면 매번 sync가 서로의 결과를 되돌리며, `sync`가 경고를 표시합니다([`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes) 참고) 자세한 내용은 [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters)을 참고하세요. diff --git a/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 8e87a70df..431783d9c 100644 --- a/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/ko/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} -**Cause:** 두 target이 서로 다른 `include`/`exclude` filter, `mode` 또는 `target_naming`으로 (이름 규칙은 `symlink` 모드가 아닐 때만 영향을 줍니다. `symlink`는 폴더 전체를 링크하기 때문입니다) 같은 폴더에 skill을 sync합니다. 매번 sync할 때마다 한 target의 설정대로 폴더를 다시 쓰고 다른 target의 결과를 되돌리므로(필터된 skill 추가나 제거, 이름 변경, 링크와 복사본 전환), 폴더가 안정되지 않습니다. `sync`가 해당 target을 알려줍니다: +**Cause:** 두 target이 서로 다른 `include`/`exclude` filter, `mode` 또는 `target_naming`으로 (`symlink` 모드는 폴더 전체를 링크하므로 이 설정들은 영향을 주지 않습니다) 같은 폴더에 skill을 sync합니다. 매번 sync할 때마다 한 target의 설정대로 폴더를 다시 쓰고 다른 target의 결과를 되돌리므로(필터된 skill 추가나 제거, 이름 변경, 링크와 복사본 전환), 폴더가 안정되지 않습니다. `sync`가 해당 target을 알려줍니다: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index 9314fea38..c9d6f78bb 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -149,7 +149,7 @@ Doctor 会在两类重复 skill 风险到达运行时选择器之前将其标记 解决方法:禁用其中一个重叠的 target,或用 `skillshare target --path ` 设置一个独立的路径。 -如果共用路径的 targets 的 `include` 或 `exclude` 筛选、`mode` 或 `target_naming` 不同(命名只在 `symlink` 以外的模式有影响,`symlink` 会直接链接整个文件夹),每次同步都会按其中一个 target 的设置重写文件夹、抵消另一个 target 的结果,文件夹永远不会稳定,`sync` 也会一直显示同样的待同步变更。Doctor 会标出这种情况,并建议只保留一个 target(如果其中有 `universal` 就保留它)、其余的关闭 skills 同步,而不是移除 target: +如果共用路径的 targets 的 `include` 或 `exclude` 筛选、`mode` 或 `target_naming` 不同(`symlink` 模式会直接链接整个文件夹,这些设置都不影响),每次同步都会按其中一个 target 的设置重写文件夹、抵消另一个 target 的结果,文件夹永远不会稳定,`sync` 也会一直显示同样的待同步变更。Doctor 会标出这种情况,并建议只保留一个 target(如果其中有 `universal` 就保留它)、其余的关闭 skills 同步,而不是移除 target: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/sync.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/sync.md index 7fd8c71ef..de87bbbf8 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/sync.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/sync.md @@ -367,7 +367,7 @@ targets: - 在 symlink 模式下,filters 会被忽略 - 在 copy 模式下,filters 的行为方式与 merge 模式相同 - `sync` 会移除已被排除、但之前是 source-linked 或受管理的条目 -- 共用同一个文件夹的多个 target 需要相同的 filters、mode 和 target naming(命名只在 `symlink` 以外的模式有影响);否则每次 sync 都会撤销另一个 target 的结果,`sync` 会发出警告(参见 [`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) +- 共用同一个文件夹的多个 target 需要相同的 filters、mode 和 target naming(`symlink` 模式下这些设置都不影响);否则每次 sync 都会撤销另一个 target 的结果,`sync` 会发出警告(参见 [`sync` keeps showing the same changes](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) 完整细节参见 [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters)。 diff --git a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 5c03826f4..3880aee18 100644 --- a/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` keeps showing the same changes {#sync-keeps-showing-the-same-changes} -**原因:** 两个 Target 以不同的 `include`/`exclude` 过滤器、`mode` 或 `target_naming` 设置(命名只在 `symlink` 以外的模式有影响,`symlink` 会直接链接整个文件夹)把 skills 同步到同一个文件夹。每次 sync 都会按其中一个 Target 的设置重写文件夹,抵消另一个 Target 的结果(加入或移除被过滤的 skills、改名,或在链接与副本之间切换),所以这个文件夹永远无法稳定下来。`sync` 会指出是哪两个 Target: +**原因:** 两个 Target 以不同的 `include`/`exclude` 过滤器、`mode` 或 `target_naming` 设置(`symlink` 模式会直接链接整个文件夹,这些设置都不影响)把 skills 同步到同一个文件夹。每次 sync 都会按其中一个 Target 的设置重写文件夹,抵消另一个 Target 的结果(加入或移除被过滤的 skills、改名,或在链接与副本之间切换),所以这个文件夹永远无法稳定下来。`sync` 会指出是哪两个 Target: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md index 51705a310..e8382097e 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/doctor.md @@ -148,7 +148,7 @@ Doctor 會在兩類重複 skill 風險到達 runtime picker 之前先標示出 解決方式:停用其中一個重疊的 target,或使用 `skillshare target --path ` 設定不同的路徑。 -若共用路徑的 targets 其 `include` 或 `exclude` 篩選、`mode` 或 `target_naming` 不同(命名只在 `symlink` 以外的模式有影響,`symlink` 會直接連結整個資料夾),每次同步都會照其中一個 target 的設定重寫資料夾、抵銷另一個 target 的結果,資料夾永遠不會穩定,`sync` 也會一直顯示同樣的待同步變更。Doctor 會標出這種情況,並建議只保留一個 target(若其中有 `universal` 就保留它)、其他的關閉 skills 同步,而不是移除 target: +若共用路徑的 targets 其 `include` 或 `exclude` 篩選、`mode` 或 `target_naming` 不同(`symlink` 模式會直接連結整個資料夾,這些設定都不影響),每次同步都會照其中一個 target 的設定重寫資料夾、抵銷另一個 target 的結果,資料夾永遠不會穩定,`sync` 也會一直顯示同樣的待同步變更。Doctor 會標出這種情況,並建議只保留一個 target(若其中有 `universal` 就保留它)、其他的關閉 skills 同步,而不是移除 target: ```text ! Shared path ~/.agents/skills ← codex, universal (different settings, so they undo each other on every sync) diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/sync.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/sync.md index 303489d4c..777e59f92 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/sync.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/sync.md @@ -345,7 +345,7 @@ targets: - 在 symlink mode 中,filters 會被忽略 - 在 copy mode 中,filters 的運作方式與 merge mode 相同 - `sync` 會移除現在已被排除、但先前是 source-linked 或受管理的條目 -- 共用同一個資料夾的 targets 需要相同的 filters、mode 與 target naming(命名只在 `symlink` 以外的模式有影響);否則每次同步都會抵銷另一個 target 的結果,`sync` 會發出警告(見 [`sync` 一直顯示相同的變更](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) +- 共用同一個資料夾的 targets 需要相同的 filters、mode 與 target naming(`symlink` 模式下這些設定都不影響);否則每次同步都會抵銷另一個 target 的結果,`sync` 會發出警告(見 [`sync` 一直顯示相同的變更](/docs/troubleshooting/common-errors#sync-keeps-showing-the-same-changes)) 完整細節見 [Configuration](/docs/reference/targets/configuration#include--exclude-target-filters)。 diff --git a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md index 447cdf671..b8b27a2f5 100644 --- a/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md +++ b/website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/troubleshooting/common-errors.md @@ -123,7 +123,7 @@ skillshare restore ### `sync` 一直顯示相同的變更 {#sync-keeps-showing-the-same-changes} -**原因:** 兩個 Target 把 Skill 同步到同一個資料夾,但 `include` 或 `exclude` filters、`mode` 或 `target_naming` 不同(命名只在 `symlink` 以外的模式有影響,`symlink` 會直接連結整個資料夾)。每次同步都會照其中一個 Target 的設定重寫資料夾,抵銷另一個 Target 的結果(加入或移除被過濾的 Skill、改名,或在連結與複本之間切換),所以資料夾永遠不會穩定下來。`sync` 會指出是哪兩個 Target: +**原因:** 兩個 Target 把 Skill 同步到同一個資料夾,但 `include` 或 `exclude` filters、`mode` 或 `target_naming` 不同(`symlink` 模式會直接連結整個資料夾,這些設定都不影響)。每次同步都會照其中一個 Target 的設定重寫資料夾,抵銷另一個 Target 的結果(加入或移除被過濾的 Skill、改名,或在連結與複本之間切換),所以資料夾永遠不會穩定下來。`sync` 會指出是哪兩個 Target: ``` ! codex and universal sync skills to ~/.agents/skills with different settings, so each sync undoes the other From 06b37d0fcf5224c880e647a3b236d1e7e3763120 Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 9 Oct 2026 01:25:04 +0800 Subject: [PATCH 07/12] feat(api): list the targets that share a target's skills folder The target page needs to know which other targets write to the same skills folder to warn when an unsaved mode or naming change would make their syncs undo each other. Re-implementing the server's folder normalisation (home expansion, path cleaning) in TypeScript would drift from config.SkillsFolderConflicts, so the targets API now returns skillsSharedWith, built from the same skillsFolder helper. --- internal/config/path_overlap_test.go | 18 ++++++++++++++++++ internal/config/skills_readers.go | 21 +++++++++++++++++++++ internal/server/handler_targets.go | 4 ++++ ui/src/api/types/targets.ts | 2 ++ 4 files changed, 45 insertions(+) diff --git a/internal/config/path_overlap_test.go b/internal/config/path_overlap_test.go index 5a458ab0f..d88e42d48 100644 --- a/internal/config/path_overlap_test.go +++ b/internal/config/path_overlap_test.go @@ -171,3 +171,21 @@ func TestSkillsFolderConflicts_IgnoresSkillsOff(t *testing.T) { func conflictEqual(a, b SkillsFolderConflict) bool { return filepath.ToSlash(a.Path) == filepath.ToSlash(b.Path) && a.Keep == b.Keep && slices.Equal(a.Targets, b.Targets) && slices.Equal(a.Stop, b.Stop) } + +func TestSkillsSharedWith(t *testing.T) { + targets := map[string]TargetConfig{ + "universal": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills"}}, + "codex": {Skills: &ResourceTargetConfig{Path: "/tmp/agents/skills/"}}, + "off": disabledAt("/tmp/agents/skills"), + "claude": {Skills: &ResourceTargetConfig{Path: "/tmp/claude/skills"}}, + } + if got := SkillsSharedWith(targets, "universal"); !slices.Equal(got, []string{"codex"}) { + t.Errorf("SkillsSharedWith(universal) = %v, want [codex]", got) + } + if got := SkillsSharedWith(targets, "off"); got != nil { + t.Errorf("SkillsSharedWith(off) = %v, want nil for a target with skills off", got) + } + if got := SkillsSharedWith(targets, "claude"); got != nil { + t.Errorf("SkillsSharedWith(claude) = %v, want nil", got) + } +} diff --git a/internal/config/skills_readers.go b/internal/config/skills_readers.go index 023880367..556b6f0ec 100644 --- a/internal/config/skills_readers.go +++ b/internal/config/skills_readers.go @@ -33,6 +33,27 @@ func SkillsAlsoReadBy(targets map[string]TargetConfig, name, projectRoot string) return names } +// SkillsSharedWith names the other targets with skills on that write to the +// same skills folder as target name, or nil when name has skills off itself. +func SkillsSharedWith(targets map[string]TargetConfig, name string) []string { + tc, ok := targets[name] + if !ok || !tc.SkillsConfig().IsEnabled() { + return nil + } + folder := skillsFolder(tc) + if folder == "" { + return nil + } + var names []string + for other, otc := range targets { + if other != name && otc.SkillsConfig().IsEnabled() && skillsFolder(otc) == folder { + names = append(names, other) + } + } + sort.Strings(names) + return names +} + // SkillsReadFrom names the configured targets with skills on whose skills // folder the built-in tool name reads. name need not be configured, so the // add-target list can say a tool already sees another target's skills. diff --git a/internal/server/handler_targets.go b/internal/server/handler_targets.go index 7812b0146..b24e5910b 100644 --- a/internal/server/handler_targets.go +++ b/internal/server/handler_targets.go @@ -49,6 +49,9 @@ type targetItem struct { // skills off whose tool reads this target's folder. SkillsReadFrom []string `json:"skillsReadFrom,omitempty"` SkillsAlsoReadBy []string `json:"skillsAlsoReadBy,omitempty"` + // SkillsSharedWith names the other targets with skills on that write to this + // target's skills folder, so the page can warn when their settings differ. + SkillsSharedWith []string `json:"skillsSharedWith,omitempty"` } var removeTargetPath = os.Remove @@ -172,6 +175,7 @@ func (s *Server) handleListTargets(w http.ResponseWriter, r *http.Request) { item.Status = status.String() } item.SkillsAlsoReadBy = config.SkillsAlsoReadBy(targets, name, projectRoot) + item.SkillsSharedWith = config.SkillsSharedWith(targets, name) var agentSummary *targetsummary.AgentSummary if isProjectMode { diff --git a/ui/src/api/types/targets.ts b/ui/src/api/types/targets.ts index e8a9ac9d6..caf54a129 100644 --- a/ui/src/api/types/targets.ts +++ b/ui/src/api/types/targets.ts @@ -67,6 +67,8 @@ export interface Target { skillsReadFrom?: string[]; /** Targets with skills off that read this target's skills folder. */ skillsAlsoReadBy?: string[]; + /** Other targets with skills on that write to this target's skills folder. */ + skillsSharedWith?: string[]; } export interface SkillsDetach { From c7905decde512d3b09bf772377b22865da35fd30 Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 9 Oct 2026 01:25:09 +0800 Subject: [PATCH 08/12] feat(ui): show which settings differ in the Sync page folder conflict The notice said two targets sync into one folder "with different settings" but not which ones, so users could not tell what to change (mode, naming or filters) to keep both. Under the existing sentence and stop buttons it now lists only the settings that differ as a small grid, keep target first, with a link to the target page to change them. Symlink targets show n/a for naming and filters, matching the server rule that those settings do not apply there. The names-as-links sentence is shared with the target page's reader notes. --- .../components/sync/FolderConflictNotice.tsx | 77 +++++++++++++++++++ ui/src/components/targets/FilterSection.tsx | 33 ++++---- ui/src/i18n/locales/de.json | 7 ++ ui/src/i18n/locales/en.json | 7 ++ ui/src/i18n/locales/es.json | 7 ++ ui/src/i18n/locales/fa.json | 7 ++ ui/src/i18n/locales/fr.json | 7 ++ ui/src/i18n/locales/id.json | 7 ++ ui/src/i18n/locales/ja.json | 7 ++ ui/src/i18n/locales/ko.json | 7 ++ ui/src/i18n/locales/pt-BR.json | 7 ++ ui/src/i18n/locales/zh-CN.json | 7 ++ ui/src/i18n/locales/zh-TW.json | 7 ++ ui/src/pages/SyncPage.test.tsx | 19 ++++- ui/src/pages/SyncPage.tsx | 13 +--- 15 files changed, 193 insertions(+), 26 deletions(-) create mode 100644 ui/src/components/sync/FolderConflictNotice.tsx diff --git a/ui/src/components/sync/FolderConflictNotice.tsx b/ui/src/components/sync/FolderConflictNotice.tsx new file mode 100644 index 000000000..8736feeef --- /dev/null +++ b/ui/src/components/sync/FolderConflictNotice.tsx @@ -0,0 +1,77 @@ +import { TriangleAlert } from 'lucide-react'; +import type { FolderConflict, Target } from '../../api/client'; +import { useI18n, useT } from '../../i18n'; +import { shortenHome } from '../../lib/paths'; +import Button from '../Button'; +import { NAMES, TargetLinks } from '../targets/FilterSection'; +import { joinList } from '../targets/targetView'; + +/** Include and exclude as a short phrase; sorted, because the server compares them as sets. */ +function filterSummary(x: Target, t: ReturnType, locale: string) { + const parts = [ + x.include.length > 0 && t('sync.folderConflict.filters.include', { names: joinList([...x.include].sort(), locale) }), + x.exclude.length > 0 && t('sync.folderConflict.filters.exclude', { names: joinList([...x.exclude].sort(), locale) }), + ].filter(Boolean); + return parts.length > 0 ? parts.join(' · ') : t('sync.folderConflict.filters.all'); +} + +/** A folder that targets sync into with different settings: what to stop, and which settings differ. */ +export default function FolderConflictNotice({ conflict, targets, onStop }: { conflict: FolderConflict; targets: Target[]; onStop: (name: string) => void }) { + const t = useT(); + const { locale } = useI18n(); + // The target kept first, as its column. + const columns = [conflict.keep, ...conflict.stop].map((name) => targets.find((x) => x.name === name)).filter((x): x is Target => !!x); + // Symlink links the whole folder, so naming and filters say nothing there (null). + const rows = [ + { key: 'mode', label: 'targetDetail.syncMode', tag: true, value: (x: Target) => x.mode }, + { key: 'naming', label: 'targetDetail.naming', tag: true, value: (x: Target) => (x.mode === 'symlink' ? null : x.targetNaming) }, + { key: 'filters', label: 'sync.folderConflict.filters', tag: false, value: (x: Target) => (x.mode === 'symlink' ? null : filterSummary(x, t, locale)) }, + ].filter((r) => new Set(columns.map(r.value).filter((v) => v !== null)).size > 1); + + return ( +
+
+ + {t('sync.folderConflict.text', { names: joinList(conflict.targets, locale), path: shortenHome(conflict.path) })} + {conflict.stop.map((name) => ( + + ))} +
+ {rows.length > 0 && ( +
+ + {columns.map((x) => )} + + + + ))} + + + + {rows.map((r) => ( + + + {columns.map((x) => { + const v = r.value(x); + return ( + + ); + })} + + ))} + +
+ {x.name === conflict.keep ? t('sync.folderConflict.keeps', { name: x.name }) : x.name} +
{t(r.label)} + {v === null ? t('sync.folderConflict.na') : r.tag ? {v} : v} +
+
+
+ )} +
+ ); +} diff --git a/ui/src/components/targets/FilterSection.tsx b/ui/src/components/targets/FilterSection.tsx index 67c0c7718..2c37fb541 100644 --- a/ui/src/components/targets/FilterSection.tsx +++ b/ui/src/components/targets/FilterSection.tsx @@ -177,27 +177,34 @@ export function ModePicker({ kind, mode, onChange, disabled }: { kind: Kind; mod } // Stands in for the names in a sentence, which are then put back as links. -const NAMES = '\u0000'; +export const NAMES = '\u0000'; + +/** A sentence with its NAMES placeholder replaced by links to those targets. */ +export function TargetLinks({ sentence, names }: { sentence: string; names: string[] }) { + const t = useT(); + const [before, after = ''] = sentence.split(NAMES); + return ( +

+ {before} + {names.map((n, i) => ( + + {i > 0 && t('instructions.shared.listSep')} + {n} + + ))} + {after} +

+ ); +} /** Other targets tied to this folder, as a note so it does not read as a filter pattern. */ function TargetRow({ sentence, names }: { sentence: string; names: string[] }) { - const t = useT(); - const [before, after = ''] = sentence.split(NAMES); return (
-

- {before} - {names.map((n, i) => ( - - {i > 0 && t('instructions.shared.listSep')} - {n} - - ))} - {after} -

+
); } diff --git a/ui/src/i18n/locales/de.json b/ui/src/i18n/locales/de.json index 12762179d..a777460fc 100644 --- a/ui/src/i18n/locales/de.json +++ b/ui/src/i18n/locales/de.json @@ -1901,6 +1901,13 @@ "sync.forceHint": "Dateien ersetzen, die in einem Ziel bearbeitet wurden", "sync.folderConflict.text": "{names} synchronisieren Skills mit unterschiedlichen Einstellungen in denselben Ordner {path}, sodass jede Synchronisierung die andere rückgängig macht.", "sync.folderConflict.stop": "Skills für {name} nicht mehr synchronisieren", + "sync.folderConflict.keeps": "{name} · schreibt weiter", + "sync.folderConflict.filters": "Filter", + "sync.folderConflict.filters.include": "enthält {names}", + "sync.folderConflict.filters.exclude": "schließt {names} aus", + "sync.folderConflict.filters.all": "alle Skills", + "sync.folderConflict.na": "entfällt", + "sync.folderConflict.hint": "Nur die abweichenden Zeilen sind aufgeführt. Um beide beizubehalten, gib {names} auf der Zielseite dieselben Einstellungen.", "sync.error.showDetails": "Diagnose anzeigen", "sync.error.hideDetails": "Diagnose ausblenden", "sync.last.title": "Letzte Skills-/Agents-Sync", diff --git a/ui/src/i18n/locales/en.json b/ui/src/i18n/locales/en.json index 248951ddb..f0d2a8939 100644 --- a/ui/src/i18n/locales/en.json +++ b/ui/src/i18n/locales/en.json @@ -1901,6 +1901,13 @@ "sync.forceHint": "Replace files that were edited inside a target", "sync.folderConflict.text": "{names} sync skills to the same folder {path} with different settings, so each sync undoes the other.", "sync.folderConflict.stop": "Stop syncing skills for {name}", + "sync.folderConflict.keeps": "{name} · keeps writing", + "sync.folderConflict.filters": "Filters", + "sync.folderConflict.filters.include": "includes {names}", + "sync.folderConflict.filters.exclude": "excludes {names}", + "sync.folderConflict.filters.all": "all skills", + "sync.folderConflict.na": "n/a", + "sync.folderConflict.hint": "Only the rows that differ are listed. To keep both, give {names} the same settings on the target page.", "sync.error.showDetails": "Show diagnostics", "sync.error.hideDetails": "Hide diagnostics", "sync.last.title": "Last skills and agents sync", diff --git a/ui/src/i18n/locales/es.json b/ui/src/i18n/locales/es.json index b7930944b..3eb92f8ec 100644 --- a/ui/src/i18n/locales/es.json +++ b/ui/src/i18n/locales/es.json @@ -1901,6 +1901,13 @@ "sync.forceHint": "Reemplazar archivos editados dentro de un destino", "sync.folderConflict.text": "{names} sincronizan skills en la misma carpeta {path} con ajustes distintos, así que cada sincronización deshace la otra.", "sync.folderConflict.stop": "Dejar de sincronizar skills con {name}", + "sync.folderConflict.keeps": "{name} · sigue escribiendo", + "sync.folderConflict.filters": "Filtros", + "sync.folderConflict.filters.include": "incluye {names}", + "sync.folderConflict.filters.exclude": "excluye {names}", + "sync.folderConflict.filters.all": "todos los skills", + "sync.folderConflict.na": "n/d", + "sync.folderConflict.hint": "Solo se muestran las filas que difieren. Para conservar ambos, da a {names} los mismos ajustes en la página del destino.", "sync.error.showDetails": "Mostrar diagnóstico", "sync.error.hideDetails": "Ocultar diagnóstico", "sync.last.title": "Última sync de skills y agents", diff --git a/ui/src/i18n/locales/fa.json b/ui/src/i18n/locales/fa.json index 9cf2b0e0c..7cb8e67f0 100644 --- a/ui/src/i18n/locales/fa.json +++ b/ui/src/i18n/locales/fa.json @@ -1901,6 +1901,13 @@ "sync.forceHint": "فایل‌هایی را که داخل هدف ویرایش شده‌اند جایگزین کن", "sync.folderConflict.text": "{names} Skills را با تنظیمات متفاوت در یک پوشه ({path}) همگام‌سازی می‌کنند، بنابراین هر همگام‌سازی کار دیگری را خنثی می‌کند.", "sync.folderConflict.stop": "توقف همگام‌سازی Skills برای {name}", + "sync.folderConflict.keeps": "{name} · همچنان می‌نویسد", + "sync.folderConflict.filters": "فیلترها", + "sync.folderConflict.filters.include": "شامل {names}", + "sync.folderConflict.filters.exclude": "به‌جز {names}", + "sync.folderConflict.filters.all": "همه Skills", + "sync.folderConflict.na": "ندارد", + "sync.folderConflict.hint": "فقط ردیف‌هایی که تفاوت دارند فهرست شده‌اند. برای نگه داشتن هر دو، همین تنظیمات را در صفحه هدف برای {names} هم بگذارید.", "sync.error.showDetails": "نمایش جزئیات عیب‌یابی", "sync.error.hideDetails": "پنهان کردن جزئیات عیب‌یابی", "sync.last.title": "آخرین همگام‌سازی skills و agents", diff --git a/ui/src/i18n/locales/fr.json b/ui/src/i18n/locales/fr.json index a28458652..ce6bcab41 100644 --- a/ui/src/i18n/locales/fr.json +++ b/ui/src/i18n/locales/fr.json @@ -1901,6 +1901,13 @@ "sync.forceHint": "Remplacer les fichiers modifiés dans une cible", "sync.folderConflict.text": "{names} synchronisent les skills dans le même dossier {path} avec des paramètres différents : chaque synchronisation annule l’autre.", "sync.folderConflict.stop": "Arrêter de synchroniser les skills vers {name}", + "sync.folderConflict.keeps": "{name} · continue d’écrire", + "sync.folderConflict.filters": "Filtres", + "sync.folderConflict.filters.include": "inclut {names}", + "sync.folderConflict.filters.exclude": "exclut {names}", + "sync.folderConflict.filters.all": "tous les skills", + "sync.folderConflict.na": "s.o.", + "sync.folderConflict.hint": "Seules les lignes qui diffèrent sont listées. Pour garder les deux, donnez à {names} les mêmes paramètres sur la page de la cible.", "sync.error.showDetails": "Afficher le diagnostic", "sync.error.hideDetails": "Masquer le diagnostic", "sync.last.title": "Dernière synchro skills et agents", diff --git a/ui/src/i18n/locales/id.json b/ui/src/i18n/locales/id.json index d76ff5e3b..ab6fd6256 100644 --- a/ui/src/i18n/locales/id.json +++ b/ui/src/i18n/locales/id.json @@ -1901,6 +1901,13 @@ "sync.forceHint": "Ganti file yang diedit di dalam target", "sync.folderConflict.text": "{names} menyinkronkan skill ke folder yang sama {path} dengan pengaturan berbeda, sehingga setiap sinkronisasi membatalkan yang lain.", "sync.folderConflict.stop": "Berhenti menyinkronkan skill ke {name}", + "sync.folderConflict.keeps": "{name} · tetap menulis", + "sync.folderConflict.filters": "Filter", + "sync.folderConflict.filters.include": "menyertakan {names}", + "sync.folderConflict.filters.exclude": "mengecualikan {names}", + "sync.folderConflict.filters.all": "semua skill", + "sync.folderConflict.na": "n/a", + "sync.folderConflict.hint": "Hanya baris yang berbeda yang ditampilkan. Agar keduanya tetap jalan, beri {names} pengaturan yang sama di halaman target.", "sync.error.showDetails": "Tampilkan diagnostik", "sync.error.hideDetails": "Sembunyikan diagnostik", "sync.last.title": "Sync skills dan agents terakhir", diff --git a/ui/src/i18n/locales/ja.json b/ui/src/i18n/locales/ja.json index 4cc8c1f9f..0efff041b 100644 --- a/ui/src/i18n/locales/ja.json +++ b/ui/src/i18n/locales/ja.json @@ -1901,6 +1901,13 @@ "sync.forceHint": "ターゲット内で編集されたファイルを置き換えます", "sync.folderConflict.text": "{names} は同じフォルダ {path} に異なる設定で Skills を同期しているため、同期のたびに互いの結果を打ち消します。", "sync.folderConflict.stop": "{name} の Skills の同期を停止", + "sync.folderConflict.keeps": "{name} · 書き込みを続ける", + "sync.folderConflict.filters": "フィルター", + "sync.folderConflict.filters.include": "{names} を含める", + "sync.folderConflict.filters.exclude": "{names} を除外", + "sync.folderConflict.filters.all": "すべてのスキル", + "sync.folderConflict.na": "対象外", + "sync.folderConflict.hint": "異なる行だけを表示しています。両方を残すには、ターゲットのページで {names} に同じ設定を指定してください。", "sync.error.showDetails": "診断情報を表示", "sync.error.hideDetails": "診断情報を隠す", "sync.last.title": "前回の skills・agents 同期", diff --git a/ui/src/i18n/locales/ko.json b/ui/src/i18n/locales/ko.json index f73d70484..bca20c18d 100644 --- a/ui/src/i18n/locales/ko.json +++ b/ui/src/i18n/locales/ko.json @@ -1901,6 +1901,13 @@ "sync.forceHint": "대상 안에서 수정된 파일을 교체합니다", "sync.folderConflict.text": "{names}이(가) 같은 폴더 {path}에 서로 다른 설정으로 Skills를 동기화해서, 동기화할 때마다 서로의 결과를 되돌립니다.", "sync.folderConflict.stop": "{name}의 Skills 동기화 중지", + "sync.folderConflict.keeps": "{name} · 계속 기록", + "sync.folderConflict.filters": "필터", + "sync.folderConflict.filters.include": "{names} 포함", + "sync.folderConflict.filters.exclude": "{names} 제외", + "sync.folderConflict.filters.all": "모든 skill", + "sync.folderConflict.na": "해당 없음", + "sync.folderConflict.hint": "다른 항목만 표시합니다. 둘 다 유지하려면 대상 페이지에서 {names}에 같은 설정을 지정하세요.", "sync.error.showDetails": "진단 표시", "sync.error.hideDetails": "진단 숨기기", "sync.last.title": "마지막 skills 및 agents 동기화", diff --git a/ui/src/i18n/locales/pt-BR.json b/ui/src/i18n/locales/pt-BR.json index 5d25c4f16..f1d4bc800 100644 --- a/ui/src/i18n/locales/pt-BR.json +++ b/ui/src/i18n/locales/pt-BR.json @@ -1901,6 +1901,13 @@ "sync.forceHint": "Substituir arquivos editados dentro de um destino", "sync.folderConflict.text": "{names} sincronizam skills na mesma pasta {path} com configurações diferentes, então cada sincronização desfaz a outra.", "sync.folderConflict.stop": "Parar de sincronizar skills com {name}", + "sync.folderConflict.keeps": "{name} · continua gravando", + "sync.folderConflict.filters": "Filtros", + "sync.folderConflict.filters.include": "inclui {names}", + "sync.folderConflict.filters.exclude": "exclui {names}", + "sync.folderConflict.filters.all": "todos os skills", + "sync.folderConflict.na": "n/d", + "sync.folderConflict.hint": "Só as linhas que diferem são listadas. Para manter os dois, dê a {names} as mesmas configurações na página do destino.", "sync.error.showDetails": "Mostrar diagnóstico", "sync.error.hideDetails": "Ocultar diagnóstico", "sync.last.title": "Última sync de skills e agents", diff --git a/ui/src/i18n/locales/zh-CN.json b/ui/src/i18n/locales/zh-CN.json index 170b234f2..91e90b8e5 100644 --- a/ui/src/i18n/locales/zh-CN.json +++ b/ui/src/i18n/locales/zh-CN.json @@ -1901,6 +1901,13 @@ "sync.forceHint": "替换在目标中修改过的文件", "sync.folderConflict.text": "{names} 同步到同一个文件夹 {path},但设置不同,每次同步都会互相加回、删掉。", "sync.folderConflict.stop": "停止同步 {name} 的 Skills", + "sync.folderConflict.keeps": "{name} · 持续写入", + "sync.folderConflict.filters": "筛选", + "sync.folderConflict.filters.include": "包含 {names}", + "sync.folderConflict.filters.exclude": "排除 {names}", + "sync.folderConflict.filters.all": "所有 Skills", + "sync.folderConflict.na": "不适用", + "sync.folderConflict.hint": "只列出有差异的项。要同时保留两者,请到目标页面把 {names} 的设置改成一致。", "sync.error.showDetails": "显示诊断信息", "sync.error.hideDetails": "隐藏诊断信息", "sync.last.title": "上次 skills 与 agents 同步", diff --git a/ui/src/i18n/locales/zh-TW.json b/ui/src/i18n/locales/zh-TW.json index 32315dff8..7b74f85f6 100644 --- a/ui/src/i18n/locales/zh-TW.json +++ b/ui/src/i18n/locales/zh-TW.json @@ -1901,6 +1901,13 @@ "sync.forceHint": "取代在目標中修改過的檔案", "sync.folderConflict.text": "{names} 同步到同一個資料夾 {path},但設定不同,每次同步都會互相加回、刪掉。", "sync.folderConflict.stop": "停止同步 {name} 的 Skills", + "sync.folderConflict.keeps": "{name} · 持續寫入", + "sync.folderConflict.filters": "篩選", + "sync.folderConflict.filters.include": "包含 {names}", + "sync.folderConflict.filters.exclude": "排除 {names}", + "sync.folderConflict.filters.all": "所有 Skills", + "sync.folderConflict.na": "不適用", + "sync.folderConflict.hint": "只列出有差異的項目。要同時保留兩者,請到目標頁面把 {names} 的設定改成一致。", "sync.error.showDetails": "顯示診斷資訊", "sync.error.hideDetails": "隱藏診斷資訊", "sync.last.title": "上次 skills 與 agents 同步", diff --git a/ui/src/pages/SyncPage.test.tsx b/ui/src/pages/SyncPage.test.tsx index ee10a3102..1ea53d8c0 100644 --- a/ui/src/pages/SyncPage.test.tsx +++ b/ui/src/pages/SyncPage.test.tsx @@ -17,9 +17,9 @@ vi.mock('../api/client', async (load) => ({ vi.mock('../api/mcp', async (load) => ({ ...await load(), mcpApi: { list: vi.fn() } })); vi.mock('../api/hooks', async (load) => ({ ...await load(), hooksApi: { list: vi.fn(() => Promise.reject(new Error('offline'))) } })); -const target = (name: string) => ({ +const target = (name: string, over: Partial = {}) => ({ name, path: '/home/me/.agents/skills', mode: 'merge', targetNaming: 'flat', status: 'merged', linkedCount: 3, localCount: 0, - include: [], exclude: [], expectedSkillCount: 3, skillsEnabled: true, + include: [], exclude: [], expectedSkillCount: 3, skillsEnabled: true, ...over, }) as Target; describe('Sync page folder conflicts', () => { @@ -49,6 +49,21 @@ describe('Sync page folder conflicts', () => { await user.click(await screen.findByRole('button', { name: 'Stop syncing' })); await waitFor(() => expect(api.updateTarget).toHaveBeenCalledWith('codex', { skills_enabled: false })); }); + + it('lists only the settings that differ, keep target first, and links the one to change', async () => { + vi.mocked(api.listTargets).mockResolvedValue({ targets: [target('codex', { mode: 'copy', exclude: ['feature-radar*'] }), target('universal')], sourceSkillCount: 3 }); + render( + + + , + ); + const columns = await screen.findAllByRole('columnheader'); + expect(columns.map((c) => c.textContent)).toEqual(['universal · keeps writing', 'codex']); + expect(screen.getAllByRole('rowheader').map((r) => r.textContent)).toEqual(['Sync mode', 'Filters']); + const cells = screen.getAllByRole('cell').map((c) => c.textContent); + expect(cells).toEqual(['merge', 'copy', 'all skills', 'excludes feature-radar*']); + expect(screen.getByRole('link', { name: 'codex' })).toHaveAttribute('href', '/targets/codex'); + }); }); describe('Sync page last sync', () => { diff --git a/ui/src/pages/SyncPage.tsx b/ui/src/pages/SyncPage.tsx index 5010a5349..e5d901824 100644 --- a/ui/src/pages/SyncPage.tsx +++ b/ui/src/pages/SyncPage.tsx @@ -15,6 +15,7 @@ import { hookLabel, hookMessage, rootName } from '../components/hooks/hooksView' import MCPNotices from '../components/mcp/MCPNotices'; import { describeMessage, mcpClient, targetLabel } from '../components/mcp/mcpView'; import { changeSets, countChanges, countEdited, discardable, receivesSkill, tally, extraGroups, groupByFolder, groupInSync, HOOKS_CHANGED, hooksGroups, MCP_CHANGED, mcpGroups, otherWarnings, resourceGroups, runSync, type ChangeGroup, type Part, type RowIcon, type SyncFailure } from '../components/sync/syncView'; +import FolderConflictNotice from '../components/sync/FolderConflictNotice'; import SyncResult from '../components/sync/SyncResult'; import UnmatchedNotices from '../components/sync/UnmatchedNotices'; import SyncError from '../components/sync/SyncError'; @@ -333,17 +334,7 @@ export default function SyncPage() { {t('sync.openDoctor')} )} - {conflicts.map((c) => ( -
- - {t('sync.folderConflict.text', { names: joinList(c.targets, locale), path: shortenHome(c.path) })} - {c.stop.map((name) => ( - - ))} -
- ))} + {conflicts.map((c) => )} {!loading && !diff.error && groups.length > 0 && (
From 5f81209c6cc540ddc8fc1ca4c652992ff721b1c9 Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 9 Oct 2026 01:25:09 +0800 Subject: [PATCH 09/12] feat(ui): warn on the target page when settings clash with a shared folder Changing sync mode or naming on a target whose skills folder another target also writes silently set up the conflict that the Sync page only reported after saving. The target page now compares the draft with each sharing target and, under the control that causes it, says the other target's value and offers "Use like ". Nothing shows when both resolve to symlink or the draft matches. The symlink mode copy now also says naming does not apply there. --- ui/src/i18n/locales/de.json | 5 +- ui/src/i18n/locales/en.json | 5 +- ui/src/i18n/locales/es.json | 5 +- ui/src/i18n/locales/fa.json | 5 +- ui/src/i18n/locales/fr.json | 5 +- ui/src/i18n/locales/id.json | 5 +- ui/src/i18n/locales/ja.json | 5 +- ui/src/i18n/locales/ko.json | 5 +- ui/src/i18n/locales/pt-BR.json | 5 +- ui/src/i18n/locales/zh-CN.json | 5 +- ui/src/i18n/locales/zh-TW.json | 5 +- ui/src/pages/TargetDetailPage.test.tsx | 65 ++++++++++++++++++++++++++ ui/src/pages/TargetDetailPage.tsx | 23 ++++++++- 13 files changed, 131 insertions(+), 12 deletions(-) create mode 100644 ui/src/pages/TargetDetailPage.test.tsx diff --git a/ui/src/i18n/locales/de.json b/ui/src/i18n/locales/de.json index a777460fc..76e62c50a 100644 --- a/ui/src/i18n/locales/de.json +++ b/ui/src/i18n/locales/de.json @@ -1784,10 +1784,13 @@ "targetDetail.mode.merge.skill": "Ein Symlink pro Skill. Skills, die du in diesem Ziel erstellt hast, bleiben unberührt.", "targetDetail.mode.merge.agent": "Ein Symlink pro Agent-Datei. Agents, die du in diesem Ziel erstellt hast, bleiben unberührt.", "targetDetail.mode.copy": "Echte Kopien. Für Tools, die Symlinks nicht folgen können.", - "targetDetail.mode.symlink": "Der ganze Ordner wird zu einem Symlink. Filter gelten in diesem Modus nicht.", + "targetDetail.mode.symlink": "Der ganze Ordner wird zu einem Symlink. Filter und Benennung gelten in diesem Modus nicht.", "targetDetail.naming": "Benennung", "targetDetail.namingFlat": "Verschachtelte Skills bekommen flache, mit __ verbundene Namen.", "targetDetail.namingStandard": "Skills verwenden den Namen aus SKILL.md.", + "targetDetail.shared.mode": "{other} synchronisiert ebenfalls Skills nach {path}, mit {theirs}. Mit {mine} würde jede Synchronisierung die andere rückgängig machen.", + "targetDetail.shared.naming": "{other} synchronisiert ebenfalls Skills nach {path}, mit {theirs}-Benennung. Mit {mine} würde jede Synchronisierung die andere rückgängig machen.", + "targetDetail.shared.use": "{value} wie {other} verwenden", "targetDetail.skipped.one": "{count} Skill kann die Standardbenennung nicht nutzen und wird übersprungen. Probiere flat.", "targetDetail.skipped.other": "{count} Skills können die Standardbenennung nicht nutzen und werden übersprungen. Probiere flat.", "targetDetail.collect": "Sammeln", diff --git a/ui/src/i18n/locales/en.json b/ui/src/i18n/locales/en.json index f0d2a8939..08c60cfce 100644 --- a/ui/src/i18n/locales/en.json +++ b/ui/src/i18n/locales/en.json @@ -1784,10 +1784,13 @@ "targetDetail.mode.merge.skill": "One symlink per skill. Skills you made inside this target are left alone.", "targetDetail.mode.merge.agent": "One symlink per agent file. Agents you made inside this target are left alone.", "targetDetail.mode.copy": "Real copies. For tools that cannot follow symlinks.", - "targetDetail.mode.symlink": "The whole folder becomes one symlink. Filters do not apply in this mode.", + "targetDetail.mode.symlink": "The whole folder becomes one symlink. Filters and naming do not apply in this mode.", "targetDetail.naming": "Naming", "targetDetail.namingFlat": "Nested skills get flat names joined with __.", "targetDetail.namingStandard": "Skills use the name from SKILL.md.", + "targetDetail.shared.mode": "{other} also syncs skills to {path}, with {theirs}. With {mine}, each sync would undo the other.", + "targetDetail.shared.naming": "{other} also syncs skills to {path}, with {theirs} naming. With {mine}, each sync would undo the other.", + "targetDetail.shared.use": "Use {value} like {other}", "targetDetail.skipped.one": "{count} skill can't use standard naming and is skipped. Try flat.", "targetDetail.skipped.other": "{count} skills can't use standard naming and are skipped. Try flat.", "targetDetail.collect": "Collect", diff --git a/ui/src/i18n/locales/es.json b/ui/src/i18n/locales/es.json index 3eb92f8ec..3d8c768cb 100644 --- a/ui/src/i18n/locales/es.json +++ b/ui/src/i18n/locales/es.json @@ -1784,10 +1784,13 @@ "targetDetail.mode.merge.skill": "Un enlace simbólico por skill. Los skills que creaste dentro de este destino no se tocan.", "targetDetail.mode.merge.agent": "Un enlace simbólico por archivo de agent. Los agents que creaste dentro de este destino no se tocan.", "targetDetail.mode.copy": "Copias reales. Para herramientas que no pueden seguir enlaces simbólicos.", - "targetDetail.mode.symlink": "La carpeta completa se convierte en un enlace simbólico. Los filtros no se aplican en este modo.", + "targetDetail.mode.symlink": "La carpeta completa se convierte en un enlace simbólico. Los filtros y los nombres no se aplican en este modo.", "targetDetail.naming": "Nombres", "targetDetail.namingFlat": "Los skills anidados reciben nombres planos unidos con __.", "targetDetail.namingStandard": "Los skills usan el nombre de SKILL.md.", + "targetDetail.shared.mode": "{other} también sincroniza skills en {path}, con {theirs}. Con {mine}, cada sincronización desharía la otra.", + "targetDetail.shared.naming": "{other} también sincroniza skills en {path}, con nombres {theirs}. Con {mine}, cada sincronización desharía la otra.", + "targetDetail.shared.use": "Usar {value} como {other}", "targetDetail.skipped.one": "{count} skill no puede usar nombres estándar y se omite. Prueba flat.", "targetDetail.skipped.other": "{count} skills no pueden usar nombres estándar y se omiten. Prueba flat.", "targetDetail.collect": "Recopilar", diff --git a/ui/src/i18n/locales/fa.json b/ui/src/i18n/locales/fa.json index 7cb8e67f0..46180004a 100644 --- a/ui/src/i18n/locales/fa.json +++ b/ui/src/i18n/locales/fa.json @@ -1784,10 +1784,13 @@ "targetDetail.mode.merge.skill": "یک symlink برای هر اسکیل. اسکیل‌هایی که داخل این هدف ساخته‌اید دست نمی‌خورند.", "targetDetail.mode.merge.agent": "یک symlink برای هر فایل Agent. Agentهایی که داخل این هدف ساخته‌اید دست نمی‌خورند.", "targetDetail.mode.copy": "کپی واقعی. برای ابزارهایی که نمی‌توانند symlink را دنبال کنند.", - "targetDetail.mode.symlink": "کل پوشه یک symlink می‌شود. فیلترها در این حالت اعمال نمی‌شوند.", + "targetDetail.mode.symlink": "کل پوشه یک symlink می‌شود. فیلترها و نام‌گذاری در این حالت اعمال نمی‌شوند.", "targetDetail.naming": "نام‌گذاری", "targetDetail.namingFlat": "اسکیل‌های تودرتو نام تخت با __ می‌گیرند.", "targetDetail.namingStandard": "اسکیل‌ها از نام داخل SKILL.md استفاده می‌کنند.", + "targetDetail.shared.mode": "{other} هم Skills را در {path} همگام‌سازی می‌کند، با {theirs}. با {mine}، هر همگام‌سازی کار دیگری را خنثی می‌کند.", + "targetDetail.shared.naming": "{other} هم Skills را در {path} همگام‌سازی می‌کند، با نام‌گذاری {theirs}. با {mine}، هر همگام‌سازی کار دیگری را خنثی می‌کند.", + "targetDetail.shared.use": "استفاده از {value} مثل {other}", "targetDetail.skipped.one": "{count} اسکیل نمی‌تواند از نام‌گذاری standard استفاده کند و نادیده گرفته می‌شود. flat را امتحان کنید.", "targetDetail.skipped.other": "{count} اسکیل نمی‌توانند از نام‌گذاری standard استفاده کنند و نادیده گرفته می‌شوند. flat را امتحان کنید.", "targetDetail.collect": "جمع‌آوری", diff --git a/ui/src/i18n/locales/fr.json b/ui/src/i18n/locales/fr.json index ce6bcab41..13ced05a1 100644 --- a/ui/src/i18n/locales/fr.json +++ b/ui/src/i18n/locales/fr.json @@ -1784,10 +1784,13 @@ "targetDetail.mode.merge.skill": "Un lien symbolique par skill. Les skills créés dans cette cible ne sont pas touchés.", "targetDetail.mode.merge.agent": "Un lien symbolique par fichier d’agent. Les agents créés dans cette cible ne sont pas touchés.", "targetDetail.mode.copy": "De vraies copies. Pour les outils qui ne suivent pas les liens symboliques.", - "targetDetail.mode.symlink": "Tout le dossier devient un lien symbolique. Les filtres ne s’appliquent pas dans ce mode.", + "targetDetail.mode.symlink": "Tout le dossier devient un lien symbolique. Les filtres et le nommage ne s’appliquent pas dans ce mode.", "targetDetail.naming": "Nommage", "targetDetail.namingFlat": "Les skills imbriqués reçoivent des noms à plat joints par __.", "targetDetail.namingStandard": "Les skills utilisent le nom de SKILL.md.", + "targetDetail.shared.mode": "{other} synchronise aussi des skills vers {path}, avec {theirs}. Avec {mine}, chaque synchronisation annulerait l’autre.", + "targetDetail.shared.naming": "{other} synchronise aussi des skills vers {path}, avec le nommage {theirs}. Avec {mine}, chaque synchronisation annulerait l’autre.", + "targetDetail.shared.use": "Utiliser {value} comme {other}", "targetDetail.skipped.one": "{count} skill ne peut pas utiliser le nommage standard et est ignoré. Essayez flat.", "targetDetail.skipped.other": "{count} skills ne peuvent pas utiliser le nommage standard et sont ignorés. Essayez flat.", "targetDetail.collect": "Collecter", diff --git a/ui/src/i18n/locales/id.json b/ui/src/i18n/locales/id.json index ab6fd6256..517da535a 100644 --- a/ui/src/i18n/locales/id.json +++ b/ui/src/i18n/locales/id.json @@ -1784,10 +1784,13 @@ "targetDetail.mode.merge.skill": "Satu symlink per skill. Skill yang Anda buat di dalam target ini tidak diubah.", "targetDetail.mode.merge.agent": "Satu symlink per file agent. Agent yang Anda buat di dalam target ini tidak diubah.", "targetDetail.mode.copy": "Salinan asli. Untuk alat yang tidak bisa mengikuti symlink.", - "targetDetail.mode.symlink": "Seluruh folder menjadi satu symlink. Filter tidak berlaku dalam mode ini.", + "targetDetail.mode.symlink": "Seluruh folder menjadi satu symlink. Filter dan penamaan tidak berlaku dalam mode ini.", "targetDetail.naming": "Penamaan", "targetDetail.namingFlat": "Skill bertingkat mendapat nama datar yang digabung dengan __.", "targetDetail.namingStandard": "Skill memakai nama dari SKILL.md.", + "targetDetail.shared.mode": "{other} juga menyinkronkan skill ke {path}, dengan {theirs}. Dengan {mine}, setiap sinkronisasi akan membatalkan yang lain.", + "targetDetail.shared.naming": "{other} juga menyinkronkan skill ke {path}, dengan penamaan {theirs}. Dengan {mine}, setiap sinkronisasi akan membatalkan yang lain.", + "targetDetail.shared.use": "Pakai {value} seperti {other}", "targetDetail.skipped.one": "{count} skill tidak bisa memakai penamaan standard dan dilewati. Coba flat.", "targetDetail.skipped.other": "{count} skill tidak bisa memakai penamaan standard dan dilewati. Coba flat.", "targetDetail.collect": "Kumpulkan", diff --git a/ui/src/i18n/locales/ja.json b/ui/src/i18n/locales/ja.json index 0efff041b..82b152f1c 100644 --- a/ui/src/i18n/locales/ja.json +++ b/ui/src/i18n/locales/ja.json @@ -1784,10 +1784,13 @@ "targetDetail.mode.merge.skill": "スキルごとに 1 つの symlink。このターゲット内で作ったスキルはそのままです。", "targetDetail.mode.merge.agent": "Agent ファイルごとに 1 つの symlink。このターゲット内で作った Agent はそのままです。", "targetDetail.mode.copy": "実ファイルのコピー。symlink をたどれないツール向けです。", - "targetDetail.mode.symlink": "フォルダー全体を 1 つの symlink にします。このモードではフィルターは適用されません。", + "targetDetail.mode.symlink": "フォルダー全体を 1 つの symlink にします。このモードではフィルターと命名は適用されません。", "targetDetail.naming": "命名", "targetDetail.namingFlat": "ネストしたスキルは __ でつないだフラット名になります。", "targetDetail.namingStandard": "スキルは SKILL.md の名前を使います。", + "targetDetail.shared.mode": "{other} も {path} に Skills を同期していて、{theirs} を使っています。{mine} にすると、同期のたびに互いの結果を打ち消します。", + "targetDetail.shared.naming": "{other} も {path} に Skills を同期していて、命名は {theirs} です。{mine} にすると、同期のたびに互いの結果を打ち消します。", + "targetDetail.shared.use": "{other} に合わせて {value} にする", "targetDetail.skipped.one": "{count} 件のスキルは standard 命名を使えないためスキップされます。flat を試してください。", "targetDetail.skipped.other": "{count} 件のスキルは standard 命名を使えないためスキップされます。flat を試してください。", "targetDetail.collect": "収集", diff --git a/ui/src/i18n/locales/ko.json b/ui/src/i18n/locales/ko.json index bca20c18d..c1b9b157d 100644 --- a/ui/src/i18n/locales/ko.json +++ b/ui/src/i18n/locales/ko.json @@ -1784,10 +1784,13 @@ "targetDetail.mode.merge.skill": "skill마다 symlink 하나. 이 대상 안에서 만든 skill은 그대로 둡니다.", "targetDetail.mode.merge.agent": "agent 파일마다 symlink 하나. 이 대상 안에서 만든 agent는 그대로 둡니다.", "targetDetail.mode.copy": "실제 복사본. symlink를 따라가지 못하는 도구용입니다.", - "targetDetail.mode.symlink": "폴더 전체가 symlink 하나가 됩니다. 이 모드에서는 필터가 적용되지 않습니다.", + "targetDetail.mode.symlink": "폴더 전체가 symlink 하나가 됩니다. 이 모드에서는 필터와 이름 규칙이 적용되지 않습니다.", "targetDetail.naming": "이름 지정", "targetDetail.namingFlat": "중첩된 skill은 __로 이은 평면 이름을 받습니다.", "targetDetail.namingStandard": "skill은 SKILL.md의 이름을 사용합니다.", + "targetDetail.shared.mode": "{other}도 {path}에 Skills를 동기화하며 {theirs}를 사용합니다. {mine}을(를) 쓰면 동기화할 때마다 서로의 결과를 되돌립니다.", + "targetDetail.shared.naming": "{other}도 {path}에 Skills를 동기화하며 이름 규칙은 {theirs}입니다. {mine}을(를) 쓰면 동기화할 때마다 서로의 결과를 되돌립니다.", + "targetDetail.shared.use": "{other}처럼 {value} 사용", "targetDetail.skipped.one": "skill {count}개는 standard 이름을 쓸 수 없어 건너뜁니다. flat을 사용해 보세요.", "targetDetail.skipped.other": "skill {count}개는 standard 이름을 쓸 수 없어 건너뜁니다. flat을 사용해 보세요.", "targetDetail.collect": "수집", diff --git a/ui/src/i18n/locales/pt-BR.json b/ui/src/i18n/locales/pt-BR.json index f1d4bc800..99d0d1d97 100644 --- a/ui/src/i18n/locales/pt-BR.json +++ b/ui/src/i18n/locales/pt-BR.json @@ -1784,10 +1784,13 @@ "targetDetail.mode.merge.skill": "Um symlink por skill. As skills criadas dentro deste destino não são alteradas.", "targetDetail.mode.merge.agent": "Um symlink por arquivo de agent. Os agents criados dentro deste destino não são alterados.", "targetDetail.mode.copy": "Cópias reais. Para ferramentas que não seguem symlinks.", - "targetDetail.mode.symlink": "A pasta inteira vira um symlink. Os filtros não se aplicam neste modo.", + "targetDetail.mode.symlink": "A pasta inteira vira um symlink. Filtros e nomes não se aplicam neste modo.", "targetDetail.naming": "Nomes", "targetDetail.namingFlat": "Skills aninhadas recebem nomes planos unidos por __.", "targetDetail.namingStandard": "Skills usam o nome do SKILL.md.", + "targetDetail.shared.mode": "{other} também sincroniza skills em {path}, com {theirs}. Com {mine}, cada sincronização desfaria a outra.", + "targetDetail.shared.naming": "{other} também sincroniza skills em {path}, com nomes {theirs}. Com {mine}, cada sincronização desfaria a outra.", + "targetDetail.shared.use": "Usar {value} como {other}", "targetDetail.skipped.one": "{count} skill não pode usar nomes standard e é ignorada. Tente flat.", "targetDetail.skipped.other": "{count} skills não podem usar nomes standard e são ignoradas. Tente flat.", "targetDetail.collect": "Coletar", diff --git a/ui/src/i18n/locales/zh-CN.json b/ui/src/i18n/locales/zh-CN.json index 91e90b8e5..1992fdeb7 100644 --- a/ui/src/i18n/locales/zh-CN.json +++ b/ui/src/i18n/locales/zh-CN.json @@ -1784,10 +1784,13 @@ "targetDetail.mode.merge.skill": "每个 Skill 一个 symlink。在这个目标里创建的 Skill 不受影响。", "targetDetail.mode.merge.agent": "每个 Agent 文件一个 symlink。在这个目标里创建的 Agent 不受影响。", "targetDetail.mode.copy": "真实副本。适用于无法跟随 symlink 的工具。", - "targetDetail.mode.symlink": "整个文件夹变成一个 symlink。此模式下筛选不生效。", + "targetDetail.mode.symlink": "整个文件夹变成一个 symlink。此模式下筛选和命名不生效。", "targetDetail.naming": "命名", "targetDetail.namingFlat": "嵌套 Skill 使用以 __ 连接的扁平名称。", "targetDetail.namingStandard": "Skill 使用 SKILL.md 中的名称。", + "targetDetail.shared.mode": "{other} 也把 Skills 同步到 {path},使用 {theirs}。改用 {mine} 后,每次同步都会抵消对方的结果。", + "targetDetail.shared.naming": "{other} 也把 Skills 同步到 {path},命名为 {theirs}。改用 {mine} 后,每次同步都会抵消对方的结果。", + "targetDetail.shared.use": "和 {other} 一样使用 {value}", "targetDetail.skipped.one": "{count} 个 Skill 无法使用 standard 命名而被跳过。试试 flat。", "targetDetail.skipped.other": "{count} 个 Skill 无法使用 standard 命名而被跳过。试试 flat。", "targetDetail.collect": "收集", diff --git a/ui/src/i18n/locales/zh-TW.json b/ui/src/i18n/locales/zh-TW.json index 7b74f85f6..0e31ddfa0 100644 --- a/ui/src/i18n/locales/zh-TW.json +++ b/ui/src/i18n/locales/zh-TW.json @@ -1784,10 +1784,13 @@ "targetDetail.mode.merge.skill": "每個 Skill 一個 symlink。在這個目標裡建立的 Skills 不受影響。", "targetDetail.mode.merge.agent": "每個 Agent 檔案一個 symlink。在這個目標裡建立的 Agents 不受影響。", "targetDetail.mode.copy": "實體副本。適用於無法跟隨 symlink 的工具。", - "targetDetail.mode.symlink": "整個資料夾變成一個 symlink。這個模式下篩選不會生效。", + "targetDetail.mode.symlink": "整個資料夾變成一個 symlink。這個模式下篩選與命名不會生效。", "targetDetail.naming": "命名", "targetDetail.namingFlat": "巢狀 Skill 使用以 __ 串接的扁平名稱。", "targetDetail.namingStandard": "Skill 使用 SKILL.md 裡的名稱。", + "targetDetail.shared.mode": "{other} 也把 Skills 同步到 {path},使用 {theirs}。改用 {mine} 後,每次同步都會抵銷對方的結果。", + "targetDetail.shared.naming": "{other} 也把 Skills 同步到 {path},命名為 {theirs}。改用 {mine} 後,每次同步都會抵銷對方的結果。", + "targetDetail.shared.use": "和 {other} 一樣使用 {value}", "targetDetail.skipped.one": "{count} 個 Skill 無法使用 standard 命名而被略過。試試 flat。", "targetDetail.skipped.other": "{count} 個 Skills 無法使用 standard 命名而被略過。試試 flat。", "targetDetail.collect": "收集", diff --git a/ui/src/pages/TargetDetailPage.test.tsx b/ui/src/pages/TargetDetailPage.test.tsx new file mode 100644 index 000000000..27dcf4a38 --- /dev/null +++ b/ui/src/pages/TargetDetailPage.test.tsx @@ -0,0 +1,65 @@ +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { render, screen } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import { MemoryRouter, Route, Routes } from 'react-router-dom'; +import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { api, type Target } from '../api/client'; +import { ToastProvider } from '../components/Toast'; +import { I18nProvider } from '../i18n'; +import TargetDetailPage from './TargetDetailPage'; + +const offline = vi.hoisted(() => () => Promise.reject(new Error('offline'))); +vi.mock('../api/client', async (load) => ({ + ...await load(), + api: { + listTargets: vi.fn(), previewSyncMatrix: vi.fn(() => Promise.resolve({ entries: [] })), availableTargets: vi.fn(offline), + getTargetInstructions: vi.fn(offline), listTargetFiles: vi.fn(offline), listExtraExtensions: vi.fn(offline), updateTarget: vi.fn(), + }, +})); +vi.mock('../api/mcp', async (load) => ({ ...await load(), mcpApi: { list: vi.fn(offline) } })); +vi.mock('../api/hooks', async (load) => ({ ...await load(), hooksApi: { list: vi.fn(offline) } })); + +const target = (name: string, over: Partial = {}) => ({ + name, path: '/home/me/.agents/skills', mode: 'merge', targetNaming: 'flat', status: 'merged', linkedCount: 3, localCount: 0, + include: [], exclude: [], expectedSkillCount: 3, skillsEnabled: true, ...over, +}) as Target; + +function renderPage(codex: Partial, universal: Partial = {}) { + vi.mocked(api.listTargets).mockResolvedValue({ + targets: [target('codex', { skillsSharedWith: ['universal'], ...codex }), target('universal', { skillsSharedWith: ['codex'], ...universal })], + sourceSkillCount: 3, + }); + render( + + + } /> + + , + ); +} + +describe('Target page shared skills folder', () => { + beforeEach(() => vi.clearAllMocks()); + + it('warns under the mode picker and sets the draft to the other target\'s mode', async () => { + const user = userEvent.setup(); + renderPage({ mode: 'copy' }); + expect(await screen.findByText(/universal also syncs skills to .*\.agents\/skills, with merge\. With copy, each sync would undo the other\./)).toBeInTheDocument(); + await user.click(screen.getByRole('button', { name: 'Use merge like universal' })); + expect(screen.queryByText(/each sync would undo the other/)).toBeNull(); + }); + + it('warns under the naming control, and only once the modes agree', async () => { + const user = userEvent.setup(); + renderPage({ targetNaming: 'standard' }); + expect(await screen.findByText(/universal also syncs skills to .*\.agents\/skills, with flat naming\. With standard, each sync would undo the other\./)).toBeInTheDocument(); + await user.click(screen.getByRole('button', { name: 'Use flat like universal' })); + expect(screen.queryByText(/each sync would undo the other/)).toBeNull(); + }); + + it('stays quiet when both resolve to symlink, whatever the naming', async () => { + renderPage({ mode: 'symlink', targetNaming: 'standard' }, { mode: 'symlink' }); + await screen.findByText('Sync mode'); + expect(screen.queryByText(/each sync would undo the other/)).toBeNull(); + }); +}); diff --git a/ui/src/pages/TargetDetailPage.tsx b/ui/src/pages/TargetDetailPage.tsx index e209fcbfe..bbfd93ebb 100644 --- a/ui/src/pages/TargetDetailPage.tsx +++ b/ui/src/pages/TargetDetailPage.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import { Link, useNavigate, useParams, useSearchParams } from 'react-router-dom'; import { keepPreviousData, useQuery, useQueryClient } from '@tanstack/react-query'; -import { ArrowDownToLine, CirclePause, Folder, Plus, Target as TargetIcon } from 'lucide-react'; +import { ArrowDownToLine, CirclePause, Folder, Plus, Target as TargetIcon, TriangleAlert } from 'lucide-react'; import { api, type Target } from '../api/client'; import Button from '../components/Button'; import CollectDialog from '../components/CollectDialog'; @@ -164,6 +164,25 @@ function TargetEditor({ target, targets }: { target: Target; targets: Target[] } const setFiltersFor = (next: { include: string[]; exclude: string[] }) => setDraft(agent ? { ...draft, agentInclude: next.include, agentExclude: next.exclude } : { ...draft, ...next }); const local = agent ? target.agentLocalCount ?? 0 : target.localCount; + // Another target writing this folder with other settings than the draft: each sync would undo the other's. + const sharing = (target.skillsSharedWith ?? []).map((n) => targets.find((x) => x.name === n)).filter((x): x is Target => !!x); + const modeClash = agent ? undefined : sharing.find((o) => o.mode !== draft.mode); + // Symlink links the whole folder, so naming only matters once the modes agree on something else. + const namingClash = modeClash ? undefined : sharing.find((o) => o.targetNaming !== draft.naming); + const sharedNote = (o: Target, field: 'mode' | 'naming') => { + const theirs = field === 'mode' ? o.mode : o.targetNaming; + return ( +
+ +
+ {t(`targetDetail.shared.${field}`, { other: o.name, path: shortenHome(target.path), theirs, mine: draft[field] })} + +
+
+ ); + }; const tabCount = (k: (typeof tabs)[number]) => k === 'skill' && !skillsOn ? null : (k === 'mcp' ? mcp.data && serverCount(mcp.data, client) @@ -312,6 +331,7 @@ function TargetEditor({ target, targets }: { target: Target; targets: Target[] }

{t('targetDetail.syncMode')}

setDraft(agent ? { ...draft, agentMode: m } : { ...draft, mode: m })} disabled={saving || (agent && draft.agentExtension !== '')} /> + {modeClash && sharedNote(modeClash, 'mode')}
{!agent && draft.mode !== 'symlink' && ( @@ -323,6 +343,7 @@ function TargetEditor({ target, targets }: { target: Target; targets: Target[] }
setDraft({ ...draft, naming })} options={[{ value: 'flat', label: 'flat' }, { value: 'standard', label: 'standard' }]} /> + {namingClash && sharedNote(namingClash, 'naming')} {saved.naming === 'standard' && (target.skippedSkillCount ?? 0) > 0 && ( {t(plural('targetDetail.skipped', target.skippedSkillCount), { count: target.skippedSkillCount })} )} From eabe5fbc10f278397f3caba62b4470f29e9a9d44 Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 9 Oct 2026 01:27:48 +0800 Subject: [PATCH 10/12] test(api): cover skillsSharedWith in the targets list Code review of the target-page warning found the new targets API field only had a unit test on the config helper. The handler is what the UI reads, so check that it names targets writing the same skills folder and leaves out one that writes elsewhere. Release-As: 0.25.4 --- internal/server/handler_targets_skills_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/internal/server/handler_targets_skills_test.go b/internal/server/handler_targets_skills_test.go index a5eee2385..5ed379661 100644 --- a/internal/server/handler_targets_skills_test.go +++ b/internal/server/handler_targets_skills_test.go @@ -44,6 +44,7 @@ type skillsTargetItem struct { SkillsEnabled bool `json:"skillsEnabled"` SkillsReadFrom []string `json:"skillsReadFrom"` SkillsAlsoReadBy []string `json:"skillsAlsoReadBy"` + SkillsSharedWith []string `json:"skillsSharedWith"` LinkedCount int `json:"linkedCount"` } @@ -99,6 +100,19 @@ func TestSkillsOffPreview_SharedFolder(t *testing.T) { } } +func TestListTargets_NamesTargetsSharingASkillsFolder(t *testing.T) { + shared := filepath.Join(t.TempDir(), "agents", "skills") + s, _ := newTestServerWithTargets(t, map[string]string{"universal": shared, "codex": shared, "claude": filepath.Join(t.TempDir(), "claude", "skills")}) + + items := listSkillsTargets(t, s) + if !slices.Equal(items["universal"].SkillsSharedWith, []string{"codex"}) || !slices.Equal(items["codex"].SkillsSharedWith, []string{"universal"}) { + t.Errorf("universal = %+v, codex = %+v", items["universal"], items["codex"]) + } + if len(items["claude"].SkillsSharedWith) != 0 { + t.Errorf("claude = %+v, want no sharing", items["claude"]) + } +} + func TestUpdateTarget_SkillsOffDetachesAndPersists(t *testing.T) { s, _, _, gemini := newSkillsOffServer(t) From dd3cc06e2b1382f85babbad9a8916257529c8800 Mon Sep 17 00:00:00 2001 From: Willie Date: Fri, 9 Oct 2026 01:41:24 +0800 Subject: [PATCH 11/12] fix(ui): warn on the target page when only the shared filters differ Codex review on #499: when two targets on one skills folder agreed on mode and naming but had different include/exclude, the target page showed no note, so it looked settled while the Sync page still reported the conflict and each sync kept pruning the other's entries. Compare the draft filters with every target sharing the folder (outside symlink mode, which ignores them) and offer to copy the other target's filters. --- ui/src/i18n/locales/de.json | 2 ++ ui/src/i18n/locales/en.json | 2 ++ ui/src/i18n/locales/es.json | 2 ++ ui/src/i18n/locales/fa.json | 2 ++ ui/src/i18n/locales/fr.json | 2 ++ ui/src/i18n/locales/id.json | 2 ++ ui/src/i18n/locales/ja.json | 2 ++ ui/src/i18n/locales/ko.json | 2 ++ ui/src/i18n/locales/pt-BR.json | 2 ++ ui/src/i18n/locales/zh-CN.json | 2 ++ ui/src/i18n/locales/zh-TW.json | 2 ++ ui/src/pages/TargetDetailPage.test.tsx | 8 ++++++++ ui/src/pages/TargetDetailPage.tsx | 13 +++++++++++++ 13 files changed, 43 insertions(+) diff --git a/ui/src/i18n/locales/de.json b/ui/src/i18n/locales/de.json index 76e62c50a..701eb428a 100644 --- a/ui/src/i18n/locales/de.json +++ b/ui/src/i18n/locales/de.json @@ -1791,6 +1791,8 @@ "targetDetail.shared.mode": "{other} synchronisiert ebenfalls Skills nach {path}, mit {theirs}. Mit {mine} würde jede Synchronisierung die andere rückgängig machen.", "targetDetail.shared.naming": "{other} synchronisiert ebenfalls Skills nach {path}, mit {theirs}-Benennung. Mit {mine} würde jede Synchronisierung die andere rückgängig machen.", "targetDetail.shared.use": "{value} wie {other} verwenden", + "targetDetail.shared.filters": "{other} synchronisiert ebenfalls Skills nach {path}, mit anderen Filtern. Jede Synchronisierung würde wieder hinzufügen oder entfernen, was die andere herausfiltert.", + "targetDetail.shared.useFilters": "Dieselben Filter wie {other} verwenden", "targetDetail.skipped.one": "{count} Skill kann die Standardbenennung nicht nutzen und wird übersprungen. Probiere flat.", "targetDetail.skipped.other": "{count} Skills können die Standardbenennung nicht nutzen und werden übersprungen. Probiere flat.", "targetDetail.collect": "Sammeln", diff --git a/ui/src/i18n/locales/en.json b/ui/src/i18n/locales/en.json index 08c60cfce..ff34db003 100644 --- a/ui/src/i18n/locales/en.json +++ b/ui/src/i18n/locales/en.json @@ -1791,6 +1791,8 @@ "targetDetail.shared.mode": "{other} also syncs skills to {path}, with {theirs}. With {mine}, each sync would undo the other.", "targetDetail.shared.naming": "{other} also syncs skills to {path}, with {theirs} naming. With {mine}, each sync would undo the other.", "targetDetail.shared.use": "Use {value} like {other}", + "targetDetail.shared.filters": "{other} also syncs skills to {path}, with different filters. Each sync would add back or remove what the other filters out.", + "targetDetail.shared.useFilters": "Use the same filters as {other}", "targetDetail.skipped.one": "{count} skill can't use standard naming and is skipped. Try flat.", "targetDetail.skipped.other": "{count} skills can't use standard naming and are skipped. Try flat.", "targetDetail.collect": "Collect", diff --git a/ui/src/i18n/locales/es.json b/ui/src/i18n/locales/es.json index 3d8c768cb..e5f7bfd28 100644 --- a/ui/src/i18n/locales/es.json +++ b/ui/src/i18n/locales/es.json @@ -1791,6 +1791,8 @@ "targetDetail.shared.mode": "{other} también sincroniza skills en {path}, con {theirs}. Con {mine}, cada sincronización desharía la otra.", "targetDetail.shared.naming": "{other} también sincroniza skills en {path}, con nombres {theirs}. Con {mine}, cada sincronización desharía la otra.", "targetDetail.shared.use": "Usar {value} como {other}", + "targetDetail.shared.filters": "{other} también sincroniza skills en {path}, con otros filtros. Cada sincronización volvería a añadir o quitaría lo que la otra filtra.", + "targetDetail.shared.useFilters": "Usar los mismos filtros que {other}", "targetDetail.skipped.one": "{count} skill no puede usar nombres estándar y se omite. Prueba flat.", "targetDetail.skipped.other": "{count} skills no pueden usar nombres estándar y se omiten. Prueba flat.", "targetDetail.collect": "Recopilar", diff --git a/ui/src/i18n/locales/fa.json b/ui/src/i18n/locales/fa.json index 46180004a..c8d4fa69f 100644 --- a/ui/src/i18n/locales/fa.json +++ b/ui/src/i18n/locales/fa.json @@ -1791,6 +1791,8 @@ "targetDetail.shared.mode": "{other} هم Skills را در {path} همگام‌سازی می‌کند، با {theirs}. با {mine}، هر همگام‌سازی کار دیگری را خنثی می‌کند.", "targetDetail.shared.naming": "{other} هم Skills را در {path} همگام‌سازی می‌کند، با نام‌گذاری {theirs}. با {mine}، هر همگام‌سازی کار دیگری را خنثی می‌کند.", "targetDetail.shared.use": "استفاده از {value} مثل {other}", + "targetDetail.shared.filters": "{other} هم Skills را در {path} همگام‌سازی می‌کند، با فیلترهای متفاوت. هر همگام‌سازی چیزی را که دیگری فیلتر می‌کند دوباره اضافه یا حذف می‌کند.", + "targetDetail.shared.useFilters": "استفاده از همان فیلترهای {other}", "targetDetail.skipped.one": "{count} اسکیل نمی‌تواند از نام‌گذاری standard استفاده کند و نادیده گرفته می‌شود. flat را امتحان کنید.", "targetDetail.skipped.other": "{count} اسکیل نمی‌توانند از نام‌گذاری standard استفاده کنند و نادیده گرفته می‌شوند. flat را امتحان کنید.", "targetDetail.collect": "جمع‌آوری", diff --git a/ui/src/i18n/locales/fr.json b/ui/src/i18n/locales/fr.json index 13ced05a1..ad90c3c82 100644 --- a/ui/src/i18n/locales/fr.json +++ b/ui/src/i18n/locales/fr.json @@ -1791,6 +1791,8 @@ "targetDetail.shared.mode": "{other} synchronise aussi des skills vers {path}, avec {theirs}. Avec {mine}, chaque synchronisation annulerait l’autre.", "targetDetail.shared.naming": "{other} synchronise aussi des skills vers {path}, avec le nommage {theirs}. Avec {mine}, chaque synchronisation annulerait l’autre.", "targetDetail.shared.use": "Utiliser {value} comme {other}", + "targetDetail.shared.filters": "{other} synchronise aussi des skills vers {path}, avec d’autres filtres. Chaque synchronisation rajouterait ou retirerait ce que l’autre filtre.", + "targetDetail.shared.useFilters": "Utiliser les mêmes filtres que {other}", "targetDetail.skipped.one": "{count} skill ne peut pas utiliser le nommage standard et est ignoré. Essayez flat.", "targetDetail.skipped.other": "{count} skills ne peuvent pas utiliser le nommage standard et sont ignorés. Essayez flat.", "targetDetail.collect": "Collecter", diff --git a/ui/src/i18n/locales/id.json b/ui/src/i18n/locales/id.json index 517da535a..fa67c2716 100644 --- a/ui/src/i18n/locales/id.json +++ b/ui/src/i18n/locales/id.json @@ -1791,6 +1791,8 @@ "targetDetail.shared.mode": "{other} juga menyinkronkan skill ke {path}, dengan {theirs}. Dengan {mine}, setiap sinkronisasi akan membatalkan yang lain.", "targetDetail.shared.naming": "{other} juga menyinkronkan skill ke {path}, dengan penamaan {theirs}. Dengan {mine}, setiap sinkronisasi akan membatalkan yang lain.", "targetDetail.shared.use": "Pakai {value} seperti {other}", + "targetDetail.shared.filters": "{other} juga menyinkronkan skill ke {path}, dengan filter yang berbeda. Setiap sinkronisasi akan menambahkan kembali atau menghapus apa yang disaring yang lain.", + "targetDetail.shared.useFilters": "Pakai filter yang sama dengan {other}", "targetDetail.skipped.one": "{count} skill tidak bisa memakai penamaan standard dan dilewati. Coba flat.", "targetDetail.skipped.other": "{count} skill tidak bisa memakai penamaan standard dan dilewati. Coba flat.", "targetDetail.collect": "Kumpulkan", diff --git a/ui/src/i18n/locales/ja.json b/ui/src/i18n/locales/ja.json index 82b152f1c..45fb534dd 100644 --- a/ui/src/i18n/locales/ja.json +++ b/ui/src/i18n/locales/ja.json @@ -1791,6 +1791,8 @@ "targetDetail.shared.mode": "{other} も {path} に Skills を同期していて、{theirs} を使っています。{mine} にすると、同期のたびに互いの結果を打ち消します。", "targetDetail.shared.naming": "{other} も {path} に Skills を同期していて、命名は {theirs} です。{mine} にすると、同期のたびに互いの結果を打ち消します。", "targetDetail.shared.use": "{other} に合わせて {value} にする", + "targetDetail.shared.filters": "{other} も {path} に Skills を同期していて、フィルターが異なります。同期のたびに、もう一方が除外したものを追加し直したり削除したりします。", + "targetDetail.shared.useFilters": "{other} と同じフィルターにする", "targetDetail.skipped.one": "{count} 件のスキルは standard 命名を使えないためスキップされます。flat を試してください。", "targetDetail.skipped.other": "{count} 件のスキルは standard 命名を使えないためスキップされます。flat を試してください。", "targetDetail.collect": "収集", diff --git a/ui/src/i18n/locales/ko.json b/ui/src/i18n/locales/ko.json index c1b9b157d..f9039bf07 100644 --- a/ui/src/i18n/locales/ko.json +++ b/ui/src/i18n/locales/ko.json @@ -1791,6 +1791,8 @@ "targetDetail.shared.mode": "{other}도 {path}에 Skills를 동기화하며 {theirs}를 사용합니다. {mine}을(를) 쓰면 동기화할 때마다 서로의 결과를 되돌립니다.", "targetDetail.shared.naming": "{other}도 {path}에 Skills를 동기화하며 이름 규칙은 {theirs}입니다. {mine}을(를) 쓰면 동기화할 때마다 서로의 결과를 되돌립니다.", "targetDetail.shared.use": "{other}처럼 {value} 사용", + "targetDetail.shared.filters": "{other}도 {path}에 Skills를 동기화하며 필터가 다릅니다. 동기화할 때마다 다른 target이 걸러낸 항목을 다시 추가하거나 제거합니다.", + "targetDetail.shared.useFilters": "{other}와 같은 필터 사용", "targetDetail.skipped.one": "skill {count}개는 standard 이름을 쓸 수 없어 건너뜁니다. flat을 사용해 보세요.", "targetDetail.skipped.other": "skill {count}개는 standard 이름을 쓸 수 없어 건너뜁니다. flat을 사용해 보세요.", "targetDetail.collect": "수집", diff --git a/ui/src/i18n/locales/pt-BR.json b/ui/src/i18n/locales/pt-BR.json index 99d0d1d97..cb350f8d5 100644 --- a/ui/src/i18n/locales/pt-BR.json +++ b/ui/src/i18n/locales/pt-BR.json @@ -1791,6 +1791,8 @@ "targetDetail.shared.mode": "{other} também sincroniza skills em {path}, com {theirs}. Com {mine}, cada sincronização desfaria a outra.", "targetDetail.shared.naming": "{other} também sincroniza skills em {path}, com nomes {theirs}. Com {mine}, cada sincronização desfaria a outra.", "targetDetail.shared.use": "Usar {value} como {other}", + "targetDetail.shared.filters": "{other} também sincroniza skills em {path}, com outros filtros. Cada sincronização adicionaria de volta ou removeria o que a outra filtra.", + "targetDetail.shared.useFilters": "Usar os mesmos filtros que {other}", "targetDetail.skipped.one": "{count} skill não pode usar nomes standard e é ignorada. Tente flat.", "targetDetail.skipped.other": "{count} skills não podem usar nomes standard e são ignoradas. Tente flat.", "targetDetail.collect": "Coletar", diff --git a/ui/src/i18n/locales/zh-CN.json b/ui/src/i18n/locales/zh-CN.json index 1992fdeb7..e26facd88 100644 --- a/ui/src/i18n/locales/zh-CN.json +++ b/ui/src/i18n/locales/zh-CN.json @@ -1791,6 +1791,8 @@ "targetDetail.shared.mode": "{other} 也把 Skills 同步到 {path},使用 {theirs}。改用 {mine} 后,每次同步都会抵消对方的结果。", "targetDetail.shared.naming": "{other} 也把 Skills 同步到 {path},命名为 {theirs}。改用 {mine} 后,每次同步都会抵消对方的结果。", "targetDetail.shared.use": "和 {other} 一样使用 {value}", + "targetDetail.shared.filters": "{other} 也把 Skills 同步到 {path},但筛选不同。每次同步都会把对方筛掉的内容加回来或删掉。", + "targetDetail.shared.useFilters": "使用和 {other} 相同的筛选", "targetDetail.skipped.one": "{count} 个 Skill 无法使用 standard 命名而被跳过。试试 flat。", "targetDetail.skipped.other": "{count} 个 Skill 无法使用 standard 命名而被跳过。试试 flat。", "targetDetail.collect": "收集", diff --git a/ui/src/i18n/locales/zh-TW.json b/ui/src/i18n/locales/zh-TW.json index 0e31ddfa0..0e6f7f7bd 100644 --- a/ui/src/i18n/locales/zh-TW.json +++ b/ui/src/i18n/locales/zh-TW.json @@ -1791,6 +1791,8 @@ "targetDetail.shared.mode": "{other} 也把 Skills 同步到 {path},使用 {theirs}。改用 {mine} 後,每次同步都會抵銷對方的結果。", "targetDetail.shared.naming": "{other} 也把 Skills 同步到 {path},命名為 {theirs}。改用 {mine} 後,每次同步都會抵銷對方的結果。", "targetDetail.shared.use": "和 {other} 一樣使用 {value}", + "targetDetail.shared.filters": "{other} 也把 Skills 同步到 {path},但篩選不同。每次同步都會把對方篩掉的內容加回來或刪掉。", + "targetDetail.shared.useFilters": "使用和 {other} 相同的篩選", "targetDetail.skipped.one": "{count} 個 Skill 無法使用 standard 命名而被略過。試試 flat。", "targetDetail.skipped.other": "{count} 個 Skills 無法使用 standard 命名而被略過。試試 flat。", "targetDetail.collect": "收集", diff --git a/ui/src/pages/TargetDetailPage.test.tsx b/ui/src/pages/TargetDetailPage.test.tsx index 27dcf4a38..d9d7c1a7b 100644 --- a/ui/src/pages/TargetDetailPage.test.tsx +++ b/ui/src/pages/TargetDetailPage.test.tsx @@ -57,6 +57,14 @@ describe('Target page shared skills folder', () => { expect(screen.queryByText(/each sync would undo the other/)).toBeNull(); }); + it('warns under the filters when only they differ, and copies the other target\'s filters', async () => { + const user = userEvent.setup(); + renderPage({ exclude: ['feature-radar*'] }); + expect(await screen.findByText(/universal also syncs skills to .*\.agents\/skills, with different filters\. Each sync would add back or remove what the other filters out\./)).toBeInTheDocument(); + await user.click(screen.getByRole('button', { name: 'Use the same filters as universal' })); + expect(screen.queryByText(/with different filters/)).toBeNull(); + }); + it('stays quiet when both resolve to symlink, whatever the naming', async () => { renderPage({ mode: 'symlink', targetNaming: 'standard' }, { mode: 'symlink' }); await screen.findByText('Sync mode'); diff --git a/ui/src/pages/TargetDetailPage.tsx b/ui/src/pages/TargetDetailPage.tsx index bbfd93ebb..1ff3476d1 100644 --- a/ui/src/pages/TargetDetailPage.tsx +++ b/ui/src/pages/TargetDetailPage.tsx @@ -169,6 +169,8 @@ function TargetEditor({ target, targets }: { target: Target; targets: Target[] } const modeClash = agent ? undefined : sharing.find((o) => o.mode !== draft.mode); // Symlink links the whole folder, so naming only matters once the modes agree on something else. const namingClash = modeClash ? undefined : sharing.find((o) => o.targetNaming !== draft.naming); + const sameList = (a: string[], b: string[]) => a.length === b.length && [...a].sort().join('\n') === [...b].sort().join('\n'); + const filtersClash = modeClash || draft.mode === 'symlink' ? undefined : sharing.find((o) => !sameList(o.include, draft.include) || !sameList(o.exclude, draft.exclude)); const sharedNote = (o: Target, field: 'mode' | 'naming') => { const theirs = field === 'mode' ? o.mode : o.targetNaming; return ( @@ -299,6 +301,17 @@ function TargetEditor({ target, targets }: { target: Target; targets: Target[] } )} + {!agent && filtersClash && ( +
+ +
+ {t('targetDetail.shared.filters', { other: filtersClash.name, path: shortenHome(target.path) })} + +
+
+ )}