Mode changes, attach and the other AGENTS.md actions returned English
sentences, so a zh-TW dashboard showed "backed up ... before replacing
it" and "... is a directory" untranslated. Warnings are now
{code, params, message} and every instructions error carries a code,
so the dashboard shows them from i18n and falls back to the English
message for unknown codes. CLI output is unchanged.
Also from the Windows re-test:
- replacing a user's junction says so and where it pointed;
- status, doctor and sync agree on identical unowned copies (kept, not
linked), and an identical copy no longer suggests --force;
- the targets list shows a Developer Mode tooltip when file links are
unavailable;
- file names are taken from Windows paths too.
Refs #299
Exploratory CLI, dashboard and real-Windows testing of single-file extras
found paths that corrupted another shared file, lost user content, or
reported the wrong state.
- One shared file per link/copy target is now enforced in config
validation, so the CLI, sync and API all refuse it; an import is never
written through a link into another shared file (409
instructions_target_held in the API).
- Restore recreates an original Windows junction as a junction, which
needs no privilege, and remove restores before saving config so a
failed restore no longer orphans the record.
- Imports into dotfiles links, damaged managed blocks, repointed links
and CRLF files keep the user's content; project imports use paths
relative to the file so a moved repo keeps working.
- Mode and assign responses carry sync warnings; dry-run says when an
edit would be backed up; invalid modes no longer show as healthy.
- An edited copy reports modified, identical unowned copies count as
synced without being owned, and relative project links no longer show
drift.
- sync extras --json exits non-zero on errors; extras <name> --help
works; --add-target gains --as; detach messages match behavior.
Refs #299
Review of the file-link fallback found paths that lost or misreported
user data:
- An identical local file was adopted as a skillshare copy and later
pruned without backup. Only files sync writes are tracked now.
- Clearing all own text in import mode was treated as no record, so
switching back resurrected the attach-time content.
- The mode API saved the new mode and returned success when a directory
blocked the sync; it now keeps the old mode and returns 409.
- Restore preview promised a delete for files restore leaves alone; both
now share one ownership decision.
- Prune forgot ownership even when removing the copy failed.
Refs #299
createLink always tried `mklink /J` first. mklink does not check the
source type, so agents, single-file extras such as a shared AGENTS.md, and
per-file extras links became directory junctions that point at a file:
Explorer shows a folder and tools cannot read it. Sync then compared only
the link destination and kept the broken junction forever.
Files now get real symlinks only. When the OS cannot create them (Windows
without Developer Mode, non-elevated), file-based link modes fall back to
copies at the mode level, so status, doctor, the API and later syncs all
see an effective `copy` mode. Fallback copies are tracked by hash so they
keep updating and pruning without touching the user's own files, and turn
back into links once links work. Single-file extras remember what they last
wrote, so an unedited copy is replaced silently instead of producing a
drift backup on every source edit, and switching a target back to import
restores the user's attach-time content plus the import block.
Includes a Windows runbook and script, verified on a Windows 11 ARM64 VM
with and without symlink rights.
Refs #299
In copy mode, sync --force can push source over target, but collect
skipped every file already in source, so edits made directly in a
copy-mode target could not be pulled back. collect --force now
overwrites those files; identical ones are still skipped.
Collect also replaced collected files with symlinks regardless of mode,
turning copy-mode targets into symlinks. Copy-mode targets now keep
their files, in the CLI and the extras TUI.
With flatten, two target files sharing a basename map to one source
file; the second is now reported instead of overwriting the first under
--force. --from paths are matched after expanding ~ and cleaning, so a
spelling that differs from config no longer drops the target's mode.
Refs #291
UI (Extras page):
- Label per-target flatten/extension/mode controls with column headers
- Render flatten as a dropdown so it matches the adjacent selects
- Collapse the add-target form behind a button and widen the path input
- Confirm before removing a target
- Polish layout: tinted icon, inset source chip, hover rows, aligned columns
Components:
- Select: bound the dropdown width so long option descriptions wrap instead
of stretching the popup across the page
- Toast: render messages multi-line, widen the container, and give
error/warning toasts more time to read
Sync feedback:
- Restructure extras sync-failure toasts into readable lines and fix the
contradictory "N more errors" count (new nMoreErrors translation)
CLI/server:
- Match extra target paths by resolved absolute path (handles ~ vs /home)
when adding, removing, or updating targets
The /api/extras/diff path resolved the copy mode but ignored a transform
extension's output_ext, so buildExtrasDiffItems compared source relative
paths against the target directory. After a .md -> .toml transform sync,
the diff looked for the original .md name and reported false drift, even
though the status path already handled this.
Export ApplyOutputExt as the single source of truth for source->target
filename mapping (previously unexported applyOutputExt) and use it in the
diff path so sync, status, and diff all agree on the transformed name.
A transform-mode dry-run counted every file as synced without inspecting the target, so it claimed it would sync files that a real non-force sync would skip. Report an existing real file (under the transformed name) as a skip needing --force, mirroring the non-dry-run path. The dry-run still never spawns the extension subprocess, so content is compared conservatively by existence rather than by output.
The previous conflict guard lumped symlinks and directories together and
os.RemoveAll'd both unconditionally, so a real directory sitting at a
generated output path (e.g. a.toml/keep.txt) was silently deleted during
`sync extras` even without --force — more destructive than the copy/merge
path, where syncOneExtraFile only auto-replaces symlinks.
Transform conflict handling now mirrors copy semantics exactly:
- symlink → auto-replace (os.Remove, link only)
- directory→ skip unless --force; with --force, replace wholesale (os.RemoveAll)
- file → idempotent if identical, else skip unless --force
Also fix the real deleter: pruneExtraOrphans descended into a skipped
conflict directory and pruned its contents as orphans. It now SkipDirs any
directory occupying a claimed output path, leaving it fully untouched.
Adds regression tests for the directory-conflict skip and the forced
replacement.
Transform-extension sync previously wrote each generated file via
runExtensionFile unconditionally, so a regular local target file (e.g. a
hand-edited hello.toml) could be overwritten from hello.md without --force,
violating the same conflict contract that copy/merge modes honor.
- Split runExtension (subprocess → bytes) from runExtensionFile (writes),
and have syncExtraTransform apply the conflict/force rules: idempotent
when identical, skipped on conflict without --force, overwrite with
--force, and auto-replace leftover symlinks.
- Centralize the copy-only mode rule in SyncExtra so the API and CLI reject
extension+merge/symlink identically; align the server sync handler's mode
normalization (EffectiveMode's "merge" default no longer leaks through).
- CLI `extras list` no longer short-circuits to an "extension" status before
existence/drift checks. Status is now computed via output_ext-aware
CheckSyncStatus; a new Extension field carries the display label, decoupled
from sync status (plain-text + TUI rendering updated).
- Roll back the optimistic cache update in the UI mode-change handler on
failure (fixes the unused-var build break).
Adds regression tests covering conflict skip/force/idempotent/symlink-replace
and non-copy mode rejection.
Installed-skill source dirs carry a .metadata.json tracking store. Extras
discovery walked it like user content, so a transform extension renamed it
to .metadata.toml in the target. Skip the reserved file in
DiscoverExtraFiles so it is never synced or transformed in any mode.
CheckSyncStatus compared each source file against targetDir/<source-name>,
but a transform extension renames output (foo.md -> foo.toml), so the
.toml file was never found and the target was always reported as drift —
even right after a successful sync. Thread the extension's output_ext
through CheckSyncStatus so the expected target filename matches the
transformed output. The web list now resolves the spec to pass it.
Two correctness improvements from Codex review:
1. EvalSymlinks before relative-link decisions: shouldUseRelative and
createLink now resolve symlinked ancestors via EvalSymlinks so that
a project opened through a symlinked workspace, or a target dir that
traverses a symlink, produces correct relative paths (or falls back
to absolute when paths diverge from the project root).
2. Atomic reformat via reformatLink: instead of remove→create (which
loses the link on createLink failure), reformat now creates a temp
link and renames it over the original. On Unix this is atomic; on
Windows it falls back to remove→create when rename fails.
Tests added for symlinked project root, divergent target symlink,
and reformatLink atomic swap.
filepath.Abs(dest) on a relative readlink result resolves against CWD,
not the symlink's parent directory. This broke the 'already correct'
check when comparing relative symlinks to absolute source paths.
Add resolveReadlink() helper that joins relative targets with
filepath.Dir(linkPath) before calling filepath.Abs.
Also check os.Remove errors in all reformat paths instead of ignoring
them silently.
Addresses PR #122 review feedback.
sync previously skipped symlinks that pointed to the correct source,
even if their format (absolute vs relative) didn't match the expected
mode. This meant existing absolute symlinks in project mode were never
converted to relative on subsequent syncs.
Add linkNeedsReformat(dest, wantRelative) helper that checks whether
the raw readlink result has the wrong format. All four 'already
correct' skip points now check format and recreate when mismatched:
- SyncTargetMergeWithSkills (skills merge mode)
- SyncTarget (skills symlink mode)
- syncExtraSymlinkMode (extras directory symlink)
- syncOneExtraFile (extras per-file merge)
Global mode is unaffected: shouldUseRelative returns false, so
linkNeedsReformat never triggers on absolute links.
Also fix macOS /var → /private/var path mismatch in
TestSyncProject_RelativeSymlinks by EvalSymlinks on expected path.
Replace direct os.Symlink calls in extras.go with createLink, gaining:
- Relative symlink support in project mode
- Windows junction fallback for extras (previously missing)
Thread projectRoot through SyncExtra, CollectExtraFiles, and all callers.
Ref: #120
When flatten=true, SyncExtra maps subdirectory files to target root
using filepath.Base(). First file wins on collision, subsequent are
skipped with warnings. Includes config validation, sync-time guard,
CheckSyncStatus collision handling, and CollectExtraFiles support.
Ref: #97
Add ability to change sync mode of an extra's target across all three
interfaces: CLI (`extras mode`/shorthand `extras <name> --mode`),
TUI (`M` key with mode picker overlay), and Web UI (inline Select
dropdown per target with PATCH /api/extras/{name}/mode endpoint).
Fix sync behavior so symlinks from a previous mode are auto-replaced
without --force, while regular files still require explicit --force.
Consolidate sync mode list into config.ExtraSyncModes single source
of truth. Fix Select component missing disabled prop and add viewport
collision detection with useLayoutEffect.
Includes 8 integration tests covering mode command happy path, error
cases, shorthand syntax, and mode-switch sync behavior.
- Move checkExtrasSyncStatus to sync.CheckSyncStatus (shared)
- Add sync.EffectiveMode helper to replace inline mode defaults
- Add config.ValidateExtraMode to centralize mode validation
- Fix sync --all --json outputting two separate JSON objects
by merging extras into the skills JSON output
- Fix swallowed JSON decode error in handleExtrasSync
- Remove dead symlink check in CollectExtraFiles (filepath.Walk
follows symlinks so the check was unreachable)
- Fix integration test extras paths to use extras/<name>/ layout
- Add contentEqual() byte comparison for copy-mode idempotency check:
re-running sync extras no longer marks identical copies as conflicts
- Restore mode default in CLI handler so display shows "(merge)"
instead of "()" for targets with no explicit mode
- Fix bug: pass `rest` (not `args`) to cmdSyncExtras in --all path
- Return error from cmdSyncExtras when totalErrors > 0
- Remove empty if-block dead code in syncOneExtraFile
- Remove redundant mode default (SyncExtra already defaults to merge)
- Consolidate capitalize/capitalizeFirst into single Unicode-safe helper
- Remove trivial copyExtraFile wrapper, call copyFile directly
- Warn when --all is used in project mode (extras are global only)
- Cache os.UserHomeDir() at package level for shortenPath
- Use source file set instead of per-file os.Stat in pruneExtraOrphans