Any per-target config problem, such as a skills path that is a file or
an unknown mode, made `skillshare sync`, `sync -p` and the dashboard
refuse to sync anything. That contradicts the policy that sync runs
every target and reports the ones that failed. Sync now validates the
config as a whole first and still stops on global problems (source,
global mode or naming, git_root, extras); a target whose own settings
are invalid is skipped for skills and agents and reported as failed
("invalid config" in CLI output and --json details, part "config" in
the dashboard's failed list). Config validation on save is unchanged.
The log counted only skills targets as failed. The CLI wrote its sync
entry before `sync --all` ran agents, `sync agents` logged empty stats,
and the dashboard left agent failures out of targets_failed, so a run
that lost a target's agents still read "ok" and Last sync could not
say what failed. CLI and dashboard now log once after every part ran:
targets_failed counts each failed target once, the new failed_targets
lists their names, and targets_total is every target in scope.
A dashboard sync that lost a target reported it only as a warning
string, next to backup notes and prune hints, under a "Sync complete"
toast, so a partial failure was easy to miss and nothing said how to fix
it. The sync API now returns a "failed" list (target, part, error, the
matching warning text, and whether a symlink conflict caused it);
"warnings" is unchanged. The Sync page shows failed targets first with
their part and error, offers Turn on Force for a symlink conflict,
marks the target in the change list, and toasts a warning instead of
success.
runSync threw at the first extras target with an error, after skills
and agents had already synced. The Sync page then dropped their result
and warnings, never wrote MCP, and showed one error without naming the
extra or target. It now collects every failed extras target and carries
on, matching `sync --all`; the page lists each as "<extra> → <target>:
<error>".
Since 191bdec3 a dashboard sync keeps going after a skills target
fails, but the Sync row only described the happy path. It now says what
the page actually shows: failures as warnings with the run marked
partial, an error when every skills target fails, and an extras failure
that stops before MCP is written.
uninstall has failed a tracked repo whose git status cannot be read
since 8e5a09c4, but --help still listed only the uncommitted-changes
check. The tracked repositories page also said a dirty repo only warns
and that the directory is removed, while uninstall stops unless --force
and moves the repo to trash.
uninstall now fails a tracked repo whose git status cannot be read
unless --force, but the command page and built-in skill still described
only the uncommitted-changes check. The recent list, status, sync,
update and uninstall changes were also English-only, while this site
updates every locale alongside the English page.
The recent refactors consolidated sync loops into internal/sync runners,
server body decoding into decodeJSON, and UI kind queries into kindQuery.
Without pointers in the topics an agent would likely reimplement these
inline and reintroduce the drift the refactors removed.
Global and project uninstall each carried their own resolve, preflight,
confirm, execute, gitignore and finalize steps, about 1700 lines in two
files that had drifted. One runUninstallSkills flow now serves both,
with an uninstallMode struct holding what differs: source and trash
dirs, config, glob and --json support, prompt and hint wording, gitignore
handling, and project lock pruning.
Output, prompts, JSON, oplog entries and exit codes are unchanged; the
characterization tests from 60732db3 pass as before. The one change in
how it runs: project mode now checks tracked repos' git status in
parallel like global, printing the same lines in the same order once the
checks finish.
On the .skillignore and .agentignore tabs, Revert reset the config.yaml
editor and left the ignore file's edits in place, so the button looked
like it did nothing. It now resets whichever file the tab has open.
resources.ts and audit.ts appended ?kind= unencoded while backups.ts
encoded it. Every call now uses kindQuery in http.ts, which encodes.
Today's kind values are fixed words, so requests do not change; the
helper keeps a future value from breaking the query string.
The project wrapper logged every call, including --help (recorded as a
skill named "--help"), resolve errors, declined prompts and dry runs, and
always with zero succeeded, so a partial uninstall never showed as
partial. Project uninstall now logs once when it has run, with the real
succeeded count, exactly like global. The project list TUI, which calls
it directly, now logs its uninstalls too, as the global one already did.
Project uninstall had its own name resolver that turned every problem
into "not found", hiding that a name matched several nested skills or
pointed at a file. It now uses the global resolver, so both modes report
the same specific errors; only the not-found wording still names the
project's skills directory.
Close to thirty components and pages each spelled out the same query key,
fetcher and stale time for these shared queries. They now call one hook
per query and pass only what differs per page: enabled flags, polling,
and the MCP stale time, which pages already disagreed on and keep.
uninstall, update, status, list and the Web API now report "failed to
check git status: <err>", but the error was only "exit status 128"
because IsDirty dropped what git printed on stderr. The message now says
why git status failed, such as a corrupt index.
status and list discarded the error from the uncommitted-changes check,
so a tracked repo whose git status could not be read was shown as
up-to-date. They now show it as unknown with a warning naming the repo
and error; status --json sets the existing status and message fields.
The commands still succeed, since they only report.
Project uninstall backfills logs/, trash/ and backups/ into a gitignore
for projects created before v0.17.3. Since 60e19f96 ensureProjectGitignore
takes the .skillshare directory, but this caller still passed the project
root, so those entries landed in the project's own .gitignore.
About 57 handlers decoded request bodies with no size limit, and the few
that had one each picked their own. They now go through decodeJSON with a
1 MiB default; handlers that need more keep their larger limit. An
oversized body gets 413 instead of whatever the handler returned for bad
JSON (MCP and plugin requests used to answer 400). Every other decode
error keeps the handler's existing status and message.
Before merging the two uninstall flows, pin where they differ today
(glob expansion, resolve errors, --json support, preflight messages,
prompts, dry-run and gitignore output, lock pruning, oplog) so the merge
and the fixes that follow show up as deliberate test changes.
ConfigPage repeated the same load, dirty-tracking, save and reset state
for config.yaml, .skillignore and .agentignore. One hook now holds it,
with tests, and each editor passes only its own save call.
The discard check for the extensions tab no longer reads the .agentignore
dirty flag, which the old three-way ternary returned for any other tab.
update discarded the error from the uncommitted-changes check, so a repo
whose git status could not be read was treated as clean and pulled over
whatever local edits it had. It now fails that repo with "failed to check
git status: <err>" unless --force, matching uninstall and the Web API.
Batch update counts these as failed instead of skipped and exits non-zero.
The audit and log TUIs each hard-coded 70 columns in three places as the
width below which they drop to a vertical layout. It is now one named
constant next to tuiMinSplitWidth, the separate 80-column threshold the
list and trash TUIs use.
The skip added in b062a113 was only tested in global mode, where agent
target paths are absolute. Project mode resolves relative paths against
the project root, so it gets its own test.
audit.go had grown to 1821 lines mixing result scoring, skill and content
scanning, markdown link checks and content integrity. Each now lives in
its own file, matching how the tests were already split. Code is moved
verbatim; only package and import headers were added.
hub (five subcommands) and search still inlined the auto-mode check that
resolveAutoMode already implements, so a change to auto-detection would
have to be repeated in six more places.
Search kept its own name check, which rejected mixed-case names such as
"MySkill" that install happily accepts, so those skills never showed up
in results. It now uses validate.SkillName, the rule install applies.
Names install rejects, such as a leading underscore, stay hidden.
`sync extras` already exits non-zero and logs "partial" when a target
fails, but `sync --all` only printed a warning and exited 0, and its
--json path ignored extras errors entirely. The Web API always logged
"ok". Both now follow the CLI: `sync --all` exits non-zero on an extras
failure in text and JSON, global and project, without holding back MCP;
the Web API oplog records the error count with status "partial", or
"error" when every target that ran failed. The HTTP status stays 200.
After the server fixes, the CLI's collect*SyncResult functions and the
Web API loop ran the same merge/copy/symlink and prune logic twice. Both
now call sync.SyncSkillTarget and only render its result: the CLI keeps
its parallel grouping and progress output, the server stays sequential.
The stats helpers this orphaned are removed.
The server's "pruned" list is now always an array; it could be null
when a prune removed nothing.
The CLI skips targets of the "agents" extra whose path the agents sync
already writes to, so the two syncs do not fight over the same folder.
The Web API synced them anyway. It now builds the same set of agent
target paths and marks those targets with skipped_by "agents", the CLI's
JSON field name; existing response fields are unchanged.
Global sync created a missing extras source, project sync and `sync
--all` skipped it, and the Web API created it while ignoring any
MkdirAll error. Creating an empty source only hides a misconfigured path,
so every caller now skips the extra and tells the user to create the
directory. The Web API reports the hint in a new per-extra "warnings"
field; existing response fields are unchanged.
In symlink mode the Web API called SyncTarget directly, so a target
symlink pointing somewhere else was handled differently from `skillshare
sync`: no conflict message, and force had no effect. It now checks the
link first like the CLI. Without force the target fails with "conflict -
symlink points to X (use --force to override)" and counts as a failed
target; with force the link is replaced.
The Web API dropped the error from pruning orphaned skills and never
passed on the prune's own warnings, so a dashboard sync could leave stale
entries behind with no sign of it. It now reports them the way the CLI
does: "<target>: prune failed: <err>" followed by the prune warnings.
The Web API returned 500 at the first skills target that failed, so
every target after it was left unsynced and agents, extras and MCP never
ran. It now follows the CLI: the failing target becomes a
"<target>: sync failed: <err>" warning, the rest still sync, and the
oplog records the real targets_failed count with status "partial". When
every skills target fails the request is still an error, so single-target
setups keep seeing one.
Global sync, project sync, `sync --all` and the Web API each carried a
copy of the extras target loop, and the server inlined its own mode
switch. All four now call sync.RunExtraTargets, and the TUI calls the
exported sync.SyncExtraTarget.
This is a pure refactor. The caller differences (missing-source policy,
agent-overlap skip, path resolution, error precedence) are options on
the runner, and characterization tests pin them so the follow-up fixes
show up as deliberate test changes.
Both the CLI and the Web API discarded the error from pruning orphaned
agents, so a target whose directory could not be read looked clean while
stale links stayed behind. The shared runner now turns the error into a
"<target>: agents prune failed: <err>" warning, which both callers
already render. The sync itself still counts, matching how skills treat
prune failures.
The CLI and the Web API each carried their own filter, sync or transform,
then prune loop for agents, and the copies had started to drift. Both now
call sync.RunAgentSync and render its per-target results as before.
This is a pure refactor: characterization tests pin the server's 200 with
warnings on a per-target failure, the CLI's non-zero exit, the server's
silent skip of targets without an agents path, and the merge of agent
lists into the skills row. Prune errors are now returned in the result
but still ignored by both callers; surfacing them is a separate fix.
When git status failed, the CLI printed a warning and uninstalled the
repo anyway. A repo that cannot be read may still hold uncommitted
work, so moving it to trash risked losing it without the dirty-check
prompt. Without --force, that repo now fails with "failed to check git
status: <err>" and is counted as failed; clean items in the same batch
are still removed. --force keeps proceeding with a warning. This
matches the Web API since 20ae89a8.
The project uninstall test that asserted the old warn-and-continue
behavior now asserts the block.
Reduce repeated fixtures while retaining CLI flag, output, pruning,
copy-mode, and combined source/target symlink coverage. Keep manifest
orphan pruning and exercise repeated sync through both symlinked paths.
Removed integration cases and their retained unit coverage:
- TestSync_MergeMode_IncludeFilter -> TestFilterSkills_IncludeOnly.
- TestSync_MergeMode_ExcludeFilter -> TestFilterSkills_ExcludeOnly.
- TestSync_Pruning_PreservesLocalDirectories -> TestPruneOrphanLinks_KeepsLocal.
- TestSync_Agents_IncludeFilter -> TestFilterAgents_IncludeOnly.
- TestSync_Agents_ExcludeFilter -> TestFilterAgents_ExcludeOnly.
- TestSync_Agents_GlobExcludePattern -> TestFilterAgents_ExcludeOnly and
TestFilterSkills_GlobPatterns (shared flat-name matcher).
- TestSync_SourceDirIsSymlink -> TestSyncTargetMerge_SourceIsSymlink.
- TestSync_TargetDirIsSymlink -> TestSyncTargetMerge_TargetIsSymlink.
For the removed TestInstall_SkillIgnore_* cases, internal/skillignore
retains the following semantic coverage:
- ExcludesMatchedSkills -> TestMatch_ExactMatch and TestMatch_NoMatch.
- GroupPattern -> TestMatch_GroupPrefix and TestMatcherMatch parent
directory inheritance cases.
- PrecisePathInGroup -> TestMatcherMatch contains / is anchored cases;
also folded into the retained Git-discovery WildcardPattern test.
- DoubleStarPattern -> TestMatcherMatch double-star cases and
TestDiscoverSourceSkills_IgnorePatterns/DoubleStarPattern.
- DirOnlyPattern -> TestMatcherMatch directory-only cases,
TestRegressions/#83_trailing_slash, and
TestDiscoverSourceSkills_IgnorePatterns/DirOnlyPattern.
- CharClassPattern -> TestMatcherMatch character-class cases and
TestDiscoverSourceSkills_IgnorePatterns/CharClassPattern.
- CombinedPatterns -> TestMatcherMatch negation cases,
TestReadPatterns_ParsesFile, and TestRegressions.
Keep Git discovery wildcard and negation tests, including nested paths
and traversal into an ignored parent with a negated child.
Convert five TestDiscoverSourceSkills_*Pattern functions into matching
named subtests of TestDiscoverSourceSkills_IgnorePatterns, preserving
all fixtures and asserting the exact retained skill set. Preserve the
separate Lite traversal and WithStats behavior tests.
Convert all 18 Test{MoveToTrash,MoveAgentToTrash,Restore,RestoreAgent}
_RejectsTraversal_* cases into identically named subtests under their
respective Test*_RejectsTraversal functions. Retain every malicious
input, rejection assertion, and canary check.
Validation (Linux devcontainer):
- make build
- go test ./tests/integration/... ./internal/sync/... ./internal/trash/... -count=1
- make check
- git diff --check (host)
All passed.
ResourcesPage.tsx had 1301 lines and was the second most changed
dashboard file. Pure sorting and grouping helpers sat next to the page
state, and ResourceDetailPage imported the uninstall dialog from
another page.
The React-free helpers now live in lib/resourceGrouping.ts with focused
tests, and UninstallDialog lives in components/resources/. The page is
286 lines shorter, and its behavior and markup are unchanged.
Nothing in the repository calls these three unauthenticated wrappers.
Every caller uses the WithAuth or WithEnv variants, which stay. Removing
them means new code cannot pick the variant that silently skips token
auth.
The dashboard check fetched the remote HEAD without credentials when a
skill had no pinned branch. Private repos therefore reported an error in
the dashboard while the CLI check, which uses
GetRemoteHeadHashWithAuth, succeeded. The pinned-branch path already
used auth, and the default-branch path now matches it.
Twelve Bubble Tea screens built the same "/ " filter input and pasted
the same key handling. esc clears the filter and re-applies it, enter
locks it in, and typing re-applies it only when the text changed. A fix
to that behavior had to be made in every screen, and the shared filter
bar renderer lived in list_tui.go even though every TUI used it.
newTUIFilterInput and handleTUIFilterKey now hold that logic in
tui_helpers.go, next to renderTUIFilterBar, and focused tests cover the
key rules. The target list keeps its own handler because its enter and
typing behavior differ. The hard-coded split width of 70 in the log and
audit screens is left as is, because changing it would change layout.
Install, batch install, tracked-repo install, uninstall and rehydrate
each repeated the same nine-line block to reconcile the project or
global skills config. reconcileSkillsConfig now holds that block, so a
change to reconcile behavior or logging is made once instead of five
times. Each caller still passes its own source directory, so behavior
is unchanged.
The dashboard check reimplemented the CLI's per-repo check but fetched
without the HTTPS token and ignored git status errors. Private tracked
repos could fail in the dashboard while `skillshare check` worked, and a
repo whose status could not be read showed as up to date. Both check
endpoints now call check.ParallelCheckRepos, the same code the CLI uses.
The JSON and SSE response shape does not change.
Batch uninstall treated a failed dirty check as clean and moved the
repo to trash. Without force, that item now fails with the git error
instead. This is stricter than the CLI, which only warns and continues.
Batch target updates ignored metadata save failures and still reported
success, so an override could silently disappear on the next reload.
They now return 500.
client.ts had grown to 1835 lines of types and calls for every page. In
six months it changed in 71 commits, more than any other source file,
so almost every dashboard change had to edit one oversized file.
The transport now lives in http.ts, and each domain has its own call
module and type file. client.ts stays as a barrel that composes the
same api object. The 124 exported names and 145 api keys are
unchanged, so importers and the tests that mock api/client need no
edits. Domain modules import from http.ts, not from client.ts, which
avoids an import cycle through the barrel.
syncTarget and syncTargetWithSkills had no callers, so the merge, copy
and symlink helpers behind them were unreachable. That was 256 lines
kept alive next to the parallel sync path that replaced them, and
readers had to work out which path was real.
Twenty-five commands also repeated the same seven lines that turn
modeAuto into project or global mode. resolveAutoMode keeps that rule
in one place. Commands whose auto-detection differs, such as hub,
search, backup, init and plugin, are left unchanged.
The in-sync and ignored lists were grouped earlier, but the list of
resources that exist only in targets was still one comma-joined line.
It merged every target's names, so a reader could not tell which target
held a resource before collecting it.
Each target now gets its own group with its logo chip and count, and
each name carries a skill or agent icon.
The picked tool drew a rounded inset ink ring inside the list, which
looked like a card dropped into the rows and clashed with the dashed
separators in Playful. It now uses .ss-r.sel, the tinted fill that the
collect and install dialogs already use for a selected row.
The server put a fixed English sentence into the sync warnings, so the
dashboard showed it untranslated in every locale. The sync response now
reports the overlap as a path_overlap count, and the dashboard renders
it from the locale files with a button that opens the Health Check page.
The pull flow keeps the English sentence because it only shows raw
warning strings.