Commit Graph
654 Commits
Author SHA1 Message Date
Willie 0580bd79bd feat(ui): add a refresh button to the Hubs page (#814)
The Hubs page keeps a hub's skill list for two minutes and does not
refetch on window focus. The server reads the index fresh on every
request (git hubs are re-cloned), so after someone pushes an updated
skillshare-hub.json the only way to see it was to wait or reload the
whole page.

A refresh icon button next to the filter refetches the list on demand.
It spins and is disabled while loading; the current list stays on screen,
and a failed fetch shows the existing error note above it. Your own
(draft) Hubs are local and do not get the button.
2026-11-09 18:08:25 +08:00
Willie 2bc791ed19 perf(plugin): check every plugin at once and skip sources that did not move (#812)
* perf(plugin): check every plugin at once and skip sources that did not move

The Plugins page's update check read every Agent CLI, cloned and hashed
every source, and asked npm about every package one after another, so it
grew with each plugin added. A single Agent CLI that stopped answering
held the whole page at "Checking for updates" with no way to tell which
plugin was stuck.

The check now asks every Agent and checks every plugin at the same time.
Plugins share one read of each Agent and each source, so an Agent with
many plugins is still asked once, and a plugin waits only on its own
Agents, including when proving its own leftover installs. Before downloading a remote source with no pinned ref, the
check asks the remote which commit its default branch points at with
`git ls-remote` and reports no update when that is the installed commit.
A check of three unchanged GitHub plugins on two Agents went from 4.3s
with three clones to 0.6s with none.

The dashboard reads the check from a new stream, GET
/api/plugins/check/stream, that sends each plugin as soon as it is
checked. The page marks rows as they arrive and counts progress in the
header. The stream stops waiting after 60 seconds: a plugin bound to an
Agent that has not answered by then shows "Check failed" with the
reason, and plugins on other Agents are unaffected. There is no limit on
how many plugins run together, because plugins waiting on a hung Agent
would otherwise hold every slot and starve the rest.

A cancelled command did not return when the Agent CLI was a shim that
starts the real client, such as an npm, mise or volta wrapper: killing
the shim left the child holding its output, so the command waited until
the child exited and no timeout took effect. Commands now stop waiting
for output two seconds after they are cancelled; a command that exits on
its own while a helper keeps its output open still counts as answered.

* fix(ui): offer every update the Plugins page shows in the update dialog

The header counted updates from the per-plugin marks, but the update
dialog offered only the targets in the last completed check's plan. Two
cases left the header saying Update N with nothing to tick in the dialog:
a first check that broke off after finding an update never set the plan,
and a recheck that could not reach an Agent kept that Agent's earlier
update while the plan said blocked.

The dialog's plan is now derived from each plugin's last answer together
with the kept updates, so a kept update stands in for the blocked or
missing answer and both always agree. A broken-off check also keeps the
answers it did receive.
2026-11-09 15:06:55 +08:00
Willie e9dc4d0360 feat(server)!: answer only at localhost, IP addresses and trusted origins (#811)
DNS rebinding lets a page point its own domain at the user's machine,
which makes its requests same-origin to the dashboard, so the CSRF
guard cannot refuse them. Only the MCP, Hooks and Plugins routes
required a localhost or IP Host, so such a page could still install,
sync and push. That rule also blocked those three pages for people who
run the dashboard behind their own reverse proxy (#809).

The dashboard now answers every route only at localhost, an IP address,
the --host name, and origins given with --trusted-origin or
SKILLSHARE_UI_TRUSTED_ORIGINS. Configuration stays outside config.yaml
so the dashboard cannot widen its own trust through its config API. A
trusted origin must match the Host with its scheme, and an Origin
header, when sent, must be that origin. A refused browser gets a page
with the exact setting to copy, the API gets it in the error, and the
server log names each refused Host once.

BREAKING CHANGE: a dashboard opened by a domain name, such as a reverse
proxy, a Tailscale or mDNS name, or a Docker service name, now returns
403 on every page until that address is trusted, for example with
`skillshare ui start --trusted-origin https://skills.example.com`.

Release-As: 0.30.0
2026-11-09 11:59:50 +08:00
Willie ec9b3e688c fix(server): refuse dashboard changes sent from other sites (#810)
A web page can submit a form or a no-cors fetch to the local dashboard
without a CORS preflight, and the handlers accept a text/plain or empty
body. Only the MCP, Hooks and Plugins routes checked where a request
came from, so any site the user visited could add targets, install,
sync, commit, push or upgrade, whenever the browser let the request
reach localhost.

Every POST, PUT, PATCH and DELETE now needs Fetch Metadata, when sent,
to say same-origin, and Origin, when sent, to match the Host. A client
that sends neither, such as curl, is unchanged, because a page cannot
make a browser omit both on a cross-origin request. The update stream
runs updates over GET, as EventSource only opens GET, so it gets the
same check.

The nginx example now forwards $http_host, which keeps the port, since
a proxy that drops it would now fail every change, not only MCP.
2026-11-09 11:08:43 +08:00
Willie ac49959f83 docs(hooks): note the dashboard Hooks page needs localhost or an IP
The Hooks page uses the same DNS rebinding guard as the MCP page
(requireLocalHooks), so through a domain name or a reverse proxy its
requests return 403. The reverse proxy note only mentioned MCP, so a
user behind a proxy had no warning that Hooks would fail too.
2026-11-09 10:24:38 +08:00
Willie bfbc06a664 fix(plugin): keep Codex off packages and folders it cannot use (#808)
The Claude manifest fallback from #806 offered Codex more than it can
install:

- A Claude package whose only parts are ones Codex does not read, such
  as agents, was offered to Codex with no components, so Codex would
  install an empty plugin.
- When Codex's own catalog pointed at a folder it rejects, the whole
  candidate could be replaced by the Claude catalog's folder, which now
  carries a Codex fallback. Codex reads only its own catalog, so it
  would never install from that folder.

#806 also stopped every Agent from using a later catalog's folder when
the first one was rejected. Only Codex needs that, since only Codex
reads one catalog exclusively, so other Agents get the old behaviour
back.
2026-11-09 10:04:33 +08:00
Nathan Vale 6e1fc67d71 fix(plugin): discover Codex-compatible Claude manifests (#806)
Codex accepts Claude plugin manifests natively, but discovery omitted
Codex for packages such as Matt Pocock's skills. Select that supported
fallback without rewriting package resources or invocation policies.

Match native root and manifest precedence, retain rejected own-catalog
packages, and add discovery and snapshot regression coverage.

Refs #805
2026-11-09 09:54:01 +08:00
Willie f3dec2fde9 docs(ui): describe the filter preview search
The dashboard reference walked through each Targets page control but
not the search box #799 added above the include/exclude preview, which
is also shared by project pages and the Extras Edit target dialog.

Release-As: 0.29.2
2026-11-08 14:45:06 +08:00
Willie 03f6f42aae docs(audit): clarify symlink scanning for direct-file and agent audits
The #796 wording attached "including direct-file and agent audits" to the
special-target error, so the sentence read as a repeated list and no longer
said that links to ordinary files keep text scanning in those audits. The
translations had dropped that scope entirely. Split it into two sentences
and restore the scope in every locale.
2026-11-07 23:20:47 +08:00
Rusty Shackleford c19ff80611 fix(audit): reject special targets before reading content (#796)
A named pipe can block collection, integrity hashing or uncached skill
metadata reads indefinitely. Require resolved regular files at each read
boundary while preserving symlink accounting and integrity evidence.

Cover the paths with bounded FIFO regressions and generated filesystem
cases, and update the Nix vendor hash and integrity-rule documentation.
2026-11-07 10:39:19 +08:00
Willieandsim 51107fb1ac fix(projects): save new projects in config.yaml again (#793)
* fix(projects): save new projects in config.yaml again

v0.29.0 wrote every project add, edit and remove to a machine-local
registry, so a project added on one machine never reached config.yaml
or the other machines that share it (#792). Most people share one
config.yaml and expect a new project to follow it.

config.yaml is the default again. Machine-local storage stays as an
explicit choice: --machine-local on add, or projects_storage:
machine-local for every new project, with --shared to override it.
The new share command moves a local project into config.yaml, and
localize still copies one to this machine. Edits and removals stay in
the layer that owns the project; removing a local copy of a
config.yaml project keeps config.yaml's version unless --shared asks
to remove both, so one machine cannot silently drop a project for
the others. Exclusions written by v0.29.0 are left as they are.

The dashboard picks storage once, in the Add project dialog, and
offers the two removal choices only where both copies exist. Moving a
project between layers stays a CLI command, so the detail page keeps
one job.

Closes #792

* fix(projects): recheck both layers after a confirmation, sync the saved key

remove and share ask before taking the config lock, then compared only
the merged entry after locking. A share or localize from another
terminal moves a project between layers without changing that entry, so
a remove confirmed for this machine's copy could then delete config.yaml's
declaration for every machine, and a confirmed share could overwrite
config.yaml settings changed meanwhile. The recheck now compares the
owning layer and config.yaml's declaration too (ProjectLayerState).

Re-adding a project that v0.29.0 hid restores config.yaml's own key,
which can be spelled differently from the folder given to add (~/app
versus an absolute path). add --sync looked the project up by the given
spelling and failed with "project not found" after saving it; it now
syncs the key that was saved.

* test(projects): make the layer tests hold on Windows

The mutation-sequence test looked the shared project up by
filepath.Join, but the fixture spells config.yaml's key $ROOT/app;
on Windows the two spellings differ, so the lookup found nothing.
It now asks the config for the key it uses.

The remove save-failure test blocked the local registry, but removing a
config.yaml project now writes config.yaml. On Linux the registry check
still failed with ENOTDIR first, which hid the mismatch; on Windows that
reads as a missing file and the save went through. The test now blocks
config.yaml, as the edit save-failure test does, and its hook no longer
shadows the config path with the target path.

---------

Co-authored-by: sim <sim@example.invalid>
2026-11-06 23:49:30 +08:00
Willieandsim 2c41fa57cc fix(ui): let any git source switch branch on the skill detail page (#790)
A skill installed from a non-default branch of an SSH or other-host
remote (git@host:o/r.git, Gitea, self-hosted HTTPS) could not switch
back to main: the Branch picker was greyed out with "This source can
only use its default branch" (#787). The picker reused /api/hub/refs,
which only lists refs for GitHub, GitLab and Bitbucket web URLs because
a hub entry pins its ref in the URL. Reinstalling from a branch does
not need that; the update endpoint already accepts any git source.

/api/hub/refs now takes anyGit, which lists a non-pinnable git source's
refs while still reporting pinnable=false. The detail page asks for it
under its own query key; the hub editors keep the old request, so they
run no extra ls-remote for sources they cannot pin.

Closes #787

Co-authored-by: sim <sim@example.invalid>
2026-11-06 21:19:50 +08:00
sim 3ab92f35b2 docs: fill gaps found in the 0.29.0 docs sweep
Checking every user-visible change since v0.28.4 against the docs
found these gaps:

- ui.md: GET /api/audit now returns warnings and incomplete; an
  incomplete scan warns instead of reporting all clear and appears
  under Needs attention; a project branch switch records the branch in
  .skillshare/config.yaml. Also fixes a lowercase sentence start.
- audit-engine.md: Markdown and SARIF carry the per-resource coverage
  counts added in #756.
- audit-rules.md: the files row pointed at a "File Scoping" section
  that does not exist; it now links to File Applicability.
- log.md: project localize logs a localize action.
- built-in skill: how an unreadable followed source link is reported.

Translations are updated to match.
2026-11-06 15:56:42 +08:00
Willieandsim ddc33fb8c7 feat(audit): keep an incomplete scan visible in Markdown, the TUI and the dashboard (#786)
* feat(audit): show unfollowed source links in Markdown and the TUI

When a followed source link could not be read, only text output (and
JSON's warnings/incomplete fields) said so. A Markdown report looked
like a full scan, and the TUI covered the warnings printed before it
opened, so a partial scan read as complete there. Item 25 of #746 asks
for incomplete status to stay visible in human reports, including
under --min-severity.

Markdown now ends its summary with a "Source links not followed"
section, led by an "Incomplete scan" line when a link could not be
read. The TUI summary line starts with the count in the warning
colour. JSON and SARIF are unchanged.

* feat(ui): mark a partial audit scan on the dashboard

The audit API dropped the source-link warnings the scan collected, so
the dashboard showed a scan that skipped an unreadable followed link as
complete. Item 25 of #746 asks for incomplete status to stay visible in
every human report, the dashboard included.

GET /api/audit and the stream's done event now carry warnings and
incomplete with the same meaning as `audit --format json`, and the
Audit page shows the count beside the Skills/Agents tabs.

* feat(ui): stop calling an incomplete audit scan all clear

After a scan that skipped an unreadable followed source link, the
Audit page still toasted "no dangerous content" and the Dashboard's
Quick Scan toasted "All clear", while the home page showed nothing,
so a partial scan still read as a clean one there.

Both toasts now warn that the scan is incomplete, and the home page's
"Needs attention" list gets a row linking to the Audit page. One
helper words the note for the Audit page label, both toasts and the
row.

---------

Co-authored-by: sim <sim@example.invalid>
2026-11-06 14:55:35 +08:00
Willieandsim 9c916df663 fix(audit): keep clean resources visible under a display floor (#785)
With --min-severity set, the TUI dropped every result without visible
findings, so clean skills disappeared from the list and the tab count
shrank, while text and Markdown output kept them. The rule now lives in
audit.HiddenByFloor and both the TUI and text output use it: a floor
hides only a result whose findings all fall below it and that is not
blocked.

The dashboard severity buttons label themselves with the English
severity, matching the badge they show, so the six translated label
keys added for them are gone. AuditPage.test.tsx again asserts the
exact coverage line and count instead of any three digits, and drops a
rendered test that only checked translated labels. The audit-engine
paragraph about --min-severity now appears in all four translations.

Co-authored-by: sim <sim@example.invalid>
2026-11-06 14:21:21 +08:00
4b31eccb93 feat(audit): add a display-only minimum severity (#751)
Reduce audit report noise without changing full findings, risk scores, severity gates or machine output. Reuse existing severity ordering and dashboard selection, and keep visible/hidden counts and incomplete-scan status explicit in human reports.

Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Willie <egg358358@gmail.com>
2026-11-06 14:08:22 +08:00
1c27090fd7 feat(audit): inspect bundled hooks and settings (#752)
* feat(audit): inspect bundled hooks and settings

Bundled declarations can schedule commands and broaden permissions outside SKILL.md, while ordinary scanning skips hidden settings. Inspect the four explicit paths with bounded root-confined reads and structured findings so existing audit policy can review their potential execution.

Keep activation conditional and redact arbitrary arguments before reports. Register rule metadata through the existing structure analyzer and cover benign twins, parse gaps, source links, policy overrides, CLI/API output and a synthetic E2E runbook.

Co-Authored-By: GPT-6.1 Sol <noreply@openai.com>

* refactor(audit): parse bundled hook commands with a shell parser

The hand-written lexer for hook commands grew six similar quote and
paren scanners, and each review round found another shell form it
missed (comments after line continuations, nested backticks, `time -p`).
Parsing with mvdan.cc/sh/v3/syntax follows quoting, comments,
substitutions, loops, functions and heredocs the way bash does, so the
analyzer walks every call in the syntax tree instead. The wrapper table
(sudo, env, timeout, xargs, bash -c, git) and the POST and destination
rules are unchanged, now applied to unquoted argv words. A script fed to
a shell on stdin (`bash <<'EOF'`, `bash <<<`) is parsed like `bash -c`.

Statements before a syntax error are still inspected. bash runs some
forms the parser rejects (an array element assigned before a command),
so a rejected command also gets a word-level network check next to its
coverage gap, rather than dropping to MEDIUM.

The dependency adds about 0.26 MB to the release binary; vendorHash
follows the new go.sum.

* fix(audit): bound nested shell parsing and skip stdin data

A script nested in a substitution was inspected twice, once by reparsing
the outer shell's argument and once by walking the outer syntax tree, so
each `bash <<< "$(...)"` or `bash -c "$(...)"` level doubled the work and
a hook under 1 KB could stall an audit. Results are now remembered per
script text and depth, and one hook command may parse at most 1 MiB of
source in total, since deep nesting still costs quadratic time with the
cache alone. Past the budget the command is classified word by word and
gets a coverage gap, as a rejected command does.

Stdin was also treated as a script whenever a shell had a heredoc or
here-string, but `bash -c 'cat' <<<` or `bash ./script.sh <<<` hands it
to something else as data, which turned a lifecycle hook into a false
HIGH. Stdin is now parsed only for `-s`, or when there is neither `-c`
nor a script file operand. Option values (`-euo pipefail`, `-O extglob`,
`--rcfile f`) are not mistaken for a script file.

---------

Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: sim <sim@example.invalid>
2026-11-06 13:56:53 +08:00
Willieandsim 5e90cf4b71 feat(ui): show a skill's branch and switch it from the detail page (#784)
* feat(ui): show a skill's branch and switch it from the detail page

A skill installed with --branch looked the same in the dashboard as one
from the default branch, and moving it to another branch meant a manual
reinstall from the CLI (#783).

The list, tiles, tree pane and Updates tab now tag the branch a skill was
installed from. The detail page lists the source's branches; picking one
confirms, then reinstalls through POST /api/update with a new `branch`
field, so the audit gate and the local-changes check still apply and a
branch without the skill leaves the install in place.

In project mode, reconciling config.yaml only added missing skills, so a
reinstall from another branch (the switch, or install --branch --force)
left config.yaml naming the old branch while the lock pinned the new
commit. Reconcile now moves the declared branch with the record.

Closes #783

* fix(update): make branch switches install the requested branch safely

Codex review of #784 found four ways a switch could misreport or lose work:

- A root skill installed as a full clone took the pull fast path on later
  switches, pulling its current branch instead of the requested one. The fast
  path now applies only when the checkout is already on that branch.
- A branch whose skill folder lacks SKILL.md replaced the skill with a plain
  folder. A staged update now refuses a candidate without SKILL.md when the
  installed copy has one, and keeps the install.
- Reconciling config.yaml from local metadata could rewrite a teammate's
  newer branch declaration back to a stale one on an unrelated install. The
  generic reconcile change is reverted; the switch updates only the switched
  skill's declaration.
- The config editor cache kept the old branch after a switch, so a later save
  could undo it. A successful switch now invalidates the config query.

---------

Co-authored-by: sim <sim@example.invalid>
2026-11-05 22:44:03 +08:00
Rusty Shackleford 5dd9925c98 fix(projects): keep registrations in machine-local state (#769)
Keep machine-specific project changes out of shared configuration while preserving shared registrations and making their origin visible. Handle missing replicated roots and preserve startup maintenance for mutating commands.
2026-11-05 15:23:28 +08:00
8d0a675b57 feat(audit): identify disguised executable headers (#756)
Extension and size filters could hide native executables and Python bytecode
inside document, image and cache paths. Classify bounded headers before those
filters, retain source boundaries, and report opaque and oversized file counts
separately from auditable text.

Keep archive signatures and uncertain headers informational rather than claiming
runtime analysis. Honor analyzer selection for file and dashboard scans, and
cover renamed payloads and benign twins with synthetic fixtures and fuzzing.

Implements item 7 of #746.

Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: sim <sim@example.invalid>
2026-11-05 14:55:46 +08:00
d699c3ef14 feat(audit): detect sensitive destinations and unsafe deserialization (#753)
Existing URL and code-execution signatures miss cloud metadata access and
language-specific deserializers. Add scoped static evidence and inspect safe
YAML and torch options within each call so safe siblings cannot hide risks.

Validate and preserve file applicability across overrides, scans and rule
listings. Collect PHP scripts and propagate rule-load errors so malformed
filters cannot silently disable global scanning. Document the policy and
limits with paired regressions, fuzzing and an isolated CLI runbook.

Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: sim <sim@example.invalid>
Co-authored-by: Willie <egg358358@gmail.com>
2026-11-05 14:47:04 +08:00
4ededca4dd feat(audit): check bundled reference containment (#754)
Required local references can currently escape a skill bundle or fail silently
when written as images and explicit code paths. Resolve them within the declared
root without reading external targets, retain dangling-link compatibility, and
share the findings and rule controls with doctor. Keep metadata and integrity
fallback reads within the same root so they cannot reopen skipped symlinks.

Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Willie <egg358358@gmail.com>
2026-11-05 14:37:33 +08:00
9b5824806e feat(audit): detect whitespace padding that hides instructions (#755)
Long blank spans and repeated filler can move meaningful instructions out
of view during skill review. Add four padding signals under the static
analyzer with Markdown exemptions and original-source line mapping.

Reuse rule overlays so global and project toggles and severity/confidence
overrides also govern this file-level detector. Cover threshold boundaries,
benign examples, optimized scans, reports and CLI rule controls.

Implements item 17 of #746.

Co-authored-by: GPT-6.1 Sol <noreply@openai.com>
Co-authored-by: Willie <egg358358@gmail.com>
2026-11-05 14:31:23 +08:00
Willie c677291e3d feat(herdr): hide disabled rows, group In sync by source, and split the panel into testable modules (#782)
* feat(herdr): hide disabled rows and group In sync by source

A source with many disabled skills buries the few rows that need
attention, and a long In sync list gives no sense of where skills
came from.

- Disabled rows are hidden by default; "Show disabled · n" lists them
  again and the choice is kept. A disabled hook with pending changes
  stays visible because it still needs a sync.
- In sync skills and agents can be grouped by their source repository
  (By source) or shown flat (List); a source with one row stays a
  plain row, and a filter opens every group.
- Opened plugin and MCP rows show their source, version and targets
  instead of an empty detail area.

* refactor(herdr): move the panel's logic out of main.js into testable modules

The bugs fixed in #773, #774 and #775 sat in main.js code that imports
Herdr, so node could not test it: the detached-job polling, the busy
state, and perform's op chain. Only model.js's parsing had tests.

Each concern now lives in a module that takes Herdr's functions as
arguments, so herdr/tests runs it:

- jobs.js runs skillshare: short reads as one exec, longer work
  detached and polled, with the sweep of old job folders and one
  JOB_MINUTES limit shared with SWEEP.
- channel.js carries requests, notices and one lock per machine
  through shared values. The install dialog used to check only a
  global busy string and then run without the lock; it now takes
  that machine's lock. Holders refresh the lock before each command
  and an untouched lock expires after a minute, because a dialog's
  task ends without cleanup when it closes.
- operations.js holds what each request runs and the conflict
  handling of a pull; perform only takes the lock and shows progress
  and the result.
- loader.js reads the Resources data and the Machines cards, and runs
  status alongside the snapshots.
2026-11-05 10:40:11 +08:00
Willie 4ede32f3e2 docs(herdr): point setup at the Herdr layouts listing
The skillshare layout is now published at herdr.dev/layouts, where one
agent prompt installs it without copying files by hand. Offer that path
first in the Herdr guide (all locales) and the panel README, and keep
the manual steps for anyone who wants to merge blocks into their own
layout.
2026-11-05 10:24:37 +08:00
Rusty Shackleford 5d05335853 feat(herdr): add a Hooks tab to the skillshare panel (#780)
* feat(herdr): add Hooks tab with confirmed entry actions

Show hook declarations and planned changes alongside the other resource kinds, reusing sync --all. Keep nested roots and cleanup status read-only, and confirm enable, disable and remove before saving.

Cover inventory states and scoped action arguments with fixtures; update panel documentation and translated kind lists.

* fix(herdr): preserve hook diagnostics and cleanup failures

Keep inactive reasons and plan warnings visible independently of file actions. Retain an inventory status row when cleanup preview fails after the final declaration is removed, and format root conflicts without an empty target prefix.

Add producer-shaped regression fixtures and document confirmed actions and CLI/dashboard conflict recovery across the panel guides.

* fix(herdr): separate hook notices from named resources

Keep diagnostic notices visible and filtered without inflating entry counts or groups. Propagate root-wide conflicts to affected entries and preserve inactive reasons independently of file alignment.

Show full nested root identities and offer scoped Sync for unnamed native writes. Cover projection and scoped snapshot reads with fixture-only tests, and align panel guides and translations.

* fix(herdr): distinguish unknown hook status from pending sync

Show entries with missing previews outside sync groups and report each scope error once. Preserve disabled state beside runtime diagnostics and omit unchanged targets from pending summaries while retaining expanded details.

Regress the confirmed presentation failures before fixing them, consolidate overlapping fixtures without dropping distinct checks, and align panel guides and translations. Keep source action eligibility because the CLI previews each changed draft.
2026-11-05 09:20:30 +08:00
Willie 53a3207a17 fix(update): keep an agent's source when updating it (#778)
* fix(update): keep an agent's source when updating it

After the first `update agents`, an agent's recorded source became
`/agents/<name>.md` with type `unknown-subdir` and no repo URL, so
`check agents` stopped looking upstream and later changes never arrived
(#777).

The batch path rebuilt the repository source from the clone URL, subdir
and branch only, leaving Raw and Type empty, and the metadata written
back was built from that empty Raw. The fallback reinstall and the
dashboard update kept the agent's full source as Raw while clearing the
subdir, so the written source repeated the agent path.

AgentRepoSource now rebuilds the repository source once, by cutting the
agent path off the recorded source, and all three paths use it, so the
source written back is the one install recorded.

Agents whose metadata was already rewritten have no repository left in
it and need to be installed again.

* fix(check): compare each agent at its own branch and report unchecked agents

Agent update checks gave wrong answers in several cases next to #777:

- Agents from one repository were compared with the first agent's
  version, so an older agent sharing a repo with a current one never
  showed its update.
- The installed branch was never sent to the remote, so an agent pinned
  to a non-default branch was compared with the default branch head.
- A tracked agent repo records its full commit while the remote hash is
  abbreviated, so a fresh clone always read as update_available; its
  checked-out branch was also ignored.
- `update agents` printed "All agents are up to date" and exited 0 when
  agents could not be checked at all: an unreachable remote, unreadable
  metadata, or a source erased by the #777 bug.

Each agent is now compared with its own version at its own branch, and
an agent whose source the old bug erased reports an error asking for a
reinstall, since its metadata no longer names a repository. Update lists
the agents it could not check and exits non-zero, counting them apart
from agents that failed to update. The docs describe the error status
and the reinstall fix.

* fix(update): repair dashboard-doubled agent sources and share the update flow

Review of the previous commits found gaps in recovering agents that
earlier updates broke, and in how the two update handlers report them:

- A dashboard update before the #777 fix appended the agent path to its
  source a second time. Those agents keep their repo URL, so check offers
  an update, but discovery then failed on the doubled path. Every copy of
  the path is now cut, and the update writes the source back correctly.
- On the dashboard, an agent whose source the CLI bug erased failed with
  "invalid source: source cannot be empty". AgentRepoSource now returns
  the same reinstall error check shows, and both use one detector.
- When every tracked agent was such an erased agent, no remote was asked,
  so the "Checking agents" spinner was never stopped and drew over the
  error rows. It is now stopped once the check returns.
- The global and project handlers repeated the check-and-update flow,
  and the project copy had already drifted (no dry-run log entry, spinner
  in --json). Both now run one shared flow.

Tests cover the erased agent next to an updatable one in global, --json,
--dry-run and project mode, and the doubled and erased sources in
AgentRepoSource.
2026-11-04 22:15:55 +08:00
Willie 11add19544 feat(ui): note how Nix updates the CLI in the update dialog (#771)
* feat(ui): show the install's own upgrade command in the update dialog

The update dialog always offered `skillshare upgrade` for the terminal.
On Nix that command only prints advice, and Homebrew users are better
served by `brew upgrade skillshare`, so the right command appeared only
after a click on Update returned an error.

/api/version now detects the install method, reports its command as
upgradeCommand, and looks up the latest version the way the CLI update
notice does for that method. The dialog shows that command, or the
existing "update your Nix configuration and rebuild" text when a Nix
configuration provides skillshare, so no new translations are needed.

* fix(ui): keep `skillshare upgrade` in the update dialog, add only a Nix note

Review of the previous commit found three regressions:

- `skillshare upgrade` already runs `brew upgrade` on Homebrew and also
  updates the built-in skill. Showing `brew upgrade skillshare` (or the
  nix profile command) instead broke the case where only the skill is
  outdated: the shown command updates nothing.
- /api/version looked up the latest version through `brew info` on
  Homebrew, inside the request with no timeout. Homebrew's auto-update
  could stall the dialog, and a server without brew on PATH never showed
  an update.
- The rendered dialog tests only checked shown text, which
  wiki/frontend.md says to leave to screenshots.

The dialog keeps `skillshare upgrade` and the GitHub lookup. /api/version
reports nixUpgradeCommand only for Nix installs, and when a newer CLI is
pending the dialog adds the existing Nix advice under the command. The
decision lives in nixUpdateNote, unit-tested in upgradeError.test.ts.
2026-11-04 16:51:03 +08:00
Willie 4fd4058be2 test(upgrade): cover the Nix branches of upgrade and doctor (#768)
#764 changed how upgrade and doctor treat Nix-store binaries but only
tested the version and server layers. A later edit to upgradeCLIBinary
could start replacing a store binary, or drop the note the dashboard
matches for its 409, without any test failing. Two package variables
let the tests fake the executable path and the latest release.

The ui.md pages said /api/upgrade refuses Nix installs. It still
updates the built-in skill and answers 409 only when a newer CLI is
waiting, and the dialog shows `skillshare upgrade` until clicked.
2026-11-04 16:07:55 +08:00
Willie 16de1df814 feat(herdr): add a skillshare panel for Herdr (#766)
Herdr users run several agents side by side and had to leave it to see
which skills need an update or a sync. The panel brings that view, plus
install, update, uninstall, audit hand-off and source repository sync,
into a Herdr layout node so it survives space switches.

Install audits its own shallow clone first, because install --json names
a blocked skill without its findings; a block shows them before anything
is written. Pull conflicts show both versions side by side, and
.metadata.json merges per entry with the same rule as MergeMetadata so
installs from both machines are kept.

model.js has no Herdr imports, so make test-herdr covers it in make check
and CI. Docs gain a learn/with-herdr page with translations and a README
highlight, and the context router loads herdr/AGENTS.md with frontend.
2026-11-04 16:01:45 +08:00
Charitarth ChughandClaude Opus 5.5 64c8a3f34e feat: add Nix flake and handle Nix-store installs in upgrade (#764)
* feat: add Nix flake and stop self-upgrade of Nix-store installs

Add flake.nix with packages, overlays.default, checks and a formatter,
building nix/package.nix with the unit tests in the Nix sandbox. The
version comes from the Release Please manifest, so releases need no Nix
edit. A Nix workflow runs `nix flake check` on non-docs changes.

`skillshare upgrade` now detects binaries under /nix/store/ and prints
`nix profile upgrade skillshare` instead of replacing a read-only store
path; update notices and doctor suggest the same command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(upgrade): give Nix installs the right update path everywhere

The first flake commit sent every /nix/store binary to `nix profile
upgrade`, failed a plain `skillshare upgrade` with exit 1 even when the
CLI was current, and left the dashboard with a generic 500.

- Tell `nix profile` installs (the profile manifest lists the store path)
  from NixOS, Home Manager and overlay installs, which are told to update
  their configuration and rebuild. Detection lives in one helper shared by
  the update notice, doctor, upgrade and the dashboard.
- `upgrade` on Nix reports "already up to date" or prints the hint and
  exits 0; the built-in skill still updates.
- The dashboard runs the upgrade so the skill updates, then answers
  409 `upgrade.nix` with the command when a newer CLI waits on Nix. The
  UI shows localized text for it in all 11 locales.
- Installs skip the unit tests; the flake's checks enable them. postPatch
  lowers only the go directive's patch version and fails evaluation with
  a clear message when go.mod needs a newer Go minor. CI also builds the
  package on macOS.
- Docs, translations, the built-in skill reference and the release topic
  describe the new behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 15:53:57 +08:00
Rusty Shackleford 8153025beb fix(plugins): reconcile OMP source replacements in one sync (#758)
A returning machine can retain an old runtime link after shared plugin intent changes source. Review its verified scoped cleanup together with replacement, then remove the old link before installing the new source while retaining shared cache and settings.

Preserve the original recipe identity when cleanup of a pending-only installation fails, so retries still reconcile the replacement. Add filesystem-backed regressions, Hegel ownership properties and a two-machine native CLI runbook.
2026-11-04 00:08:22 +08:00
Willie d41188bbde fix(project): gitignore install metadata in project mode (#760)
Since v0.19.12 the docs say a project's skills/.metadata.json is
gitignored, but no code ever wrote that rule, so `git add .skillshare`
picked it up (#759). The file records this machine's installs (hashes,
timestamps) for folders that are themselves ignored; teammates already
share config.yaml and skills.lock.json, so committing it only adds noise
and merge conflicts.

ReconcileProjectSkills runs after every project install (CLI, search,
dashboard, move, trash), so it now adds the rule for the skills and
agents sources, at the path ProjectGitignoreTarget computes. Projects
initialized earlier and custom sources get it on their next install.
AdoptMovedProjectSkills is untouched, so `sync -p` still leaves
.gitignore alone (#547). Global mode keeps committing its metadata.

The docs that list the project .gitignore contents now name the
metadata files, and project-skills explains the one-time
`git rm --cached` for projects that already committed it.

Closes #759
2026-11-03 23:37:58 +08:00
Willie b35793e79f fix(audit): stop flagging ignore arrays and typed root parameters (#750)
prompt-injection-1 reported a JS `ignore: ['**/*.test.vue']` option and a
Python `root: Path, lang_filter: set[str] | None = None` parameter as
CRITICAL prompt overrides, which blocked `update --all` for vuejs-ai and
dotnet skills. The #376 exclusion only covered scalars, root paths and
ignore objects.

The exclude now also accepts an inline ignore array of quoted items
without spaces, and a typed root parameter whose types are capitalized or
builtin names, followed only by further `name: Type` parameters. Both are
limited to the key whose real configs use them, so `admin: Execute`,
`system: Path, Ignore` and comma-joined word lists stay CRITICAL.

Closes #749
2026-11-02 21:05:54 +08:00
Rusty Shackleford 65af9c17b7 feat(audit): detect narrow prose risk directives (#711)
* feat(audit): detect narrow prose risk directives

* fix(audit): honor link confidence and narrow refusal rule

Apply configured confidence to Markdown link findings and require safety-related evidence in anti-refusal directives to avoid ordinary compliance false positives.

* fix(audit): address prose and confidence review feedback

Narrow prose matches, preserve overrides when enabling rules, and expose effective confidence to rule consumers. Expand Markdown coverage and synchronize the audit guidance.

* fix(audit): retain scheduled payload detection

Keep detecting directives that schedule a payload while excluding ordinary payload processor terminology.

* fix(audit): preserve prose detection recall

Recognize concise disclosure and safety override directives while retaining benign exclusions. Share the confidence default and cover replacement overlays.

* fix(audit): detect quantified refusal directives

Retain detection when a directive refers to any or every user request while preserving benign security discussion.
2026-11-02 16:31:56 +08:00
Rusty Shackleford c6ec6bc7c9 fix(audit): distinguish execution errors from findings (#686)
* fix(audit): distinguish execution errors from findings

Return a separate exit code for audit errors so CI can tell an incomplete scan from a threshold finding. Preserve partial reports and give scan errors precedence when both occur.

* fix(audit): keep list and abort exit codes consistent

Preserve audit execution-error classification when list delegates to audit, so both global and project actions exit 2. Treat declining a large scan as a clean cancellation before any scanning or error logging.

Cover both paths with real terminal regressions and keep the documented exit-code contract aligned across translations.
2026-11-02 15:13:44 +08:00
Willie 51d299ff07 fix(check): ignore OS metadata files when detecting local changes (#744)
Finder writes .DS_Store into any folder it opens, and Explorer writes
Thumbs.db and desktop.ini. These counted as skill content, so opening an
installed skill in a file manager made check report it as modified, hid
update_available, and made update skip it unless run with --force, which
also lowers the audit threshold.

Skip them when hashing a skill, drop hashes earlier versions recorded for
them (from .metadata.json and from legacy sidecar migration), and keep
audit integrity from reporting them. Their content is still audited.

Closes #743
2026-11-01 20:16:09 +08:00
Willie e3ab0cbeff docs(mcp): describe the Agent logos on enabled global server rows
The project MCP tab now shows which Agents load an enabled global server
(cc4c9e43), but the reference only described the logos on servers that
are off. Document both before 0.28.2 ships.
2026-10-31 21:16:24 +08:00
Willie b3a7fc5263 feat(ui): copy another project's MCP server into a project (#681)
Adding a server a user already set up in another project meant typing it
in again. The project MCP tab's Add server dialog now has a "From another
project" tab that fills the form from a server another mcp.projects root
has. The copy leaves out that project's targets, so it follows this
project's Agents. Off switches are not offered.

Closes #678
2026-10-31 18:17:44 +08:00
Willie 78a8dc7c0d fix(trash): keep install metadata when restoring from the trash (#680)
* fix(trash): keep install metadata when restoring from the trash

Uninstall pruned a skill's, tracked repo's or agent's entry from the
central .metadata.json, and only the files went to the trash, so a
restore brought back a remote install as a local one: update and check
no longer knew its source (#679).

Uninstall now saves the entries it prunes, with their audit acceptances
and target overrides, beside the trash entry, re-keyed to the trash
name so they match where restore puts the item. uninstall.Restore and
RestoreAgent merge them back after the files return, and every restore
path (CLI, trash TUI, dashboard) goes through them; the dashboard
passes its cached store so it does not go stale. The saved copy is
taken with the same rule RemoveByNames uses and copies each entry, so
legacy repo-group entries are kept and re-keying never touches the
live store.

In project mode uninstall also drops the skill's .gitignore rule and
lock pin, so a skill restore reconciles the project skills afterwards.

trash.Delete removes an entry with its saved metadata, and replaces the
direct RemoveAll calls in delete, empty and the 7-day cleanup. Items
trashed before this change have no saved metadata and still restore as
local.

* fix(trash): keep live records of another path when restoring metadata

A legacy store keys a grouped skill by its basename, so the saved copy of
frontend/foo was keyed "foo". If a different skill was installed as
root-level foo while frontend/foo sat in the trash, restoring it replaced
the root skill's record and lost its source.

Extract now writes full source-relative keys (legacy repo-group entries
keep theirs, since their Group is not their path), and Merge keeps a live
entry whose key names a different path instead of overwriting it. Merge
is shared by skill and agent restore, so both are covered.
2026-10-31 17:25:04 +08:00
Rusty Shackleford 00abba4727 feat(mcp): allow plain HTTP on trusted private networks (#675)
* feat(mcp): allow plain HTTP on trusted private networks

Containerized MCP gateways need to reach a skills server directly on a private network without adding a TLS terminator. Add an explicit flag and matching serve config opt-in, retain bearer authentication and the secure default, and warn when plaintext transport is enabled.

* fix(mcp): require explicit HTTP transport opt-in

Keep insecure HTTP opt-in in the container command so repository configuration cannot enable it. Reject the flag without HTTP, align translated examples, and cover startup warnings and authentication in the runbook and transport tests.
2026-10-31 04:24:16 +08:00
Rusty Shackleford da3383ed5f fix(plugins): separate shared intent from local installation state (#660)
* fix(plugins): separate shared intent from machine-local receipts

Shared configs currently carry native paths, reviewed snapshots and pending
failures, so one host can publish local progress over another host's target
selection. Persist versioned declarations separately from local applied and
pending receipts, and reconcile reviewed installs, imports and cleanup against
this machine's native inventory without rewriting intent during sync/update.

Keep snapshot names and adapter safeguards, move the operation lock locally,
validate legacy adoption with local evidence, and invalidate approval on local
state or native-context changes. Preserve source recipes after native adoption,
require local import for absent native-only targets, and document the shared
writer upgrade boundary in schemas and translated references.

Cover two-host behavior, generated legacy fixtures, failure/recovery, stale
intent, cleanup, npm recipes and the existing CLI/API/UI consumers with focused
resource-capped tests. Fixes #651.

* fix(plugins): preserve intent and ownership across host transitions

Repeat-add must retain shared target selection, and update previews must resolve
the requested ref before reviewing fresh or replacement installs. Keep disabled
targets on the uninstall path and reject refs unsupported by native-only/npm
intent before they can produce invalid shared declarations.

Block changed-context add/import before Pi registration preparation so a new
account cannot overwrite the old receipt. Preserve unresolved legacy bindings
as passive private proof candidates before rewriting shared YAML, retaining
original intent/store for later verified adoption and cleanup. Never compose
these hints as executable state, and persist their explicit resolution.

Cover the five review classes, native/private failure boundaries, requested-ref
retry, and original-context hint proofs with isolated focused regressions.
Keep local format v1 and baseline account validation unchanged. Refs #651.

* fix(plugins): allow receipt-only orphan cleanup to complete

An installation already removed on this host can retain a local receipt when
another host removes or replaces shared intent. Sync correctly plans forget,
but native command verification rejects that metadata-only action and blocks
all targets before the receipt can be cleared.

Exclude forget from native command verification while retaining host inventory
checks and OMP scoped cleanup preparation. The existing completion path then
persists receipt deletion, including pending work and passive legacy hints.

Cover the cross-host disable/re-enable/remove walk, five native adapters,
failed work with a legacy hint, and absent source replacement alongside a
healthy target. Assert Apply completion, unchanged shared bytes/mtime, and a
quiet second sync. Refs #651.

* fix(plugin): reconcile ref intent across inventory consumers

Validate explicit ref changes before disabled targets can save them and reuse
one reviewed discovery throughout a preview. Surface shared ref changes as local
reconciliation work while preserving the applied native identity and receipts.

Reuse scoped legacy proofs for Pi extension ownership and make full inventory
the dashboard's authoritative package/host pair. Cover invalid and replacement
refs, read-only ownership, and shared-state properties without new persisted
state or dependencies.

* test(plugin): repair and consolidate host-state fixtures

Create source intent and a pending imported Claude update through supported
operations so direct and batch updates exercise the intended fixture. Keep the
marketplace-loss case locally owned before testing its skipped reinstall.

Consolidate cross-host repeat-add and requested-ref replacement/orphan retries
at their existing owners, retaining failure recovery and shared-byte checks.
Trim duplicate HTTP and translated-text assertions from consumer tests.

* fix(plugin): reconcile legacy snapshot reads and native imports

Resolve legacy snapshot ownership through existing scoped proofs before listing,
reading or discovering cached source files. Keep adoption read-only and limit
proof work to the requested package and targets; current receipts need no CLI.

Only preserve reviewed source metadata on reimport when intent remains source
managed. Native-only intent must not resurrect an older Git source after a
same-ID local import. Retain identity mismatch and reviewed-source safeguards.

Remove the unused source-folding helper left by the old shared runtime writer.

* Preserve reviewed package versions locally

* Fix reviewed package version lifecycle

* fix(plugin): report missing local imports in doctor

Show the local-import instruction instead of claiming a skipped imported
plugin is healthy. Preserve the missing-CLI warning and shared config bytes.

Keep fixture native settings inside scratch XDG directories and serialize
the fake CLI calls used by concurrent inventories. Update assertions to
separate shared declarations from local versions and native IDs, and align
the raw-write audit with private plugin state and operation locks.

* test(plugin): use declarations for doctor source fixture

The missing-CLI case has no native ID, so encode it with the version 2
declaration schema. Keep the native-only import case in legacy syntax.

* fix(plugin): install shared sources from reviewed snapshots

When a source target is already declared, first sync must install its
reviewed local snapshot even if the native client has a package from the
same marketplace. Keep explicit add adoption and native-only import intact.

Extend the existing two-host adoption check to cover an independent native
installation on the second host and verify a quiet subsequent sync.

* fix(plugin): preserve reviewed retries and native collision boundaries

Retry a pending source update through the existing reviewed update path,
so a rolled-back native failure cannot clear progress at the old snapshot.
Record default-source versions for add, sync, and update while retaining
the recipe fingerprint and generic-version checks for target overrides.

Keep explicit native adoption, but block shared Claude sources when an
independent same-name native plugin could shadow their hooks. Extract the
existing adoption decision so the preview function becomes smaller.

* test(plugin): respect OMP update safety in version control

Check generic and target versions during review, then confirm the existing
OMP upgrade guard preserves the installed and default-source versions.

* fix(plugin): declare first local native imports explicitly

A first local import into a shared source target now changes that target
to native-only intent while preserving its sync selection. Verified source
reimports retain their reviewed source and the preview discloses conversion.

Cover the explicit import, local sync, and other-host cleanup flow, and
remove the unconsumed internal observation assertion from the OMP test.

* docs(plugin): explain first local import intent changes

Describe the shared native-only target conversion and its effect on other
machines, while distinguishing verified source reimports.

* fix(plugin): verify checked sources before native reinstalls

A checked update that becomes an install after native removal must still
match the source digest the user approved. Reject moved or unchecked
sources before native work, and allow a stable approved reinstall.

Clear completed reinstalls from dashboard update availability while keeping
failed targets available for retry. Cover both native presence states in
the existing checked-update tests and the dashboard outcome rule.

* fix(plugin): guard replacement before cleanup

* fix(plugin): refresh discovery for each manager action

A later Add action must review the current source even when the manager
previously observed that source. Keep discovery sharing across one action
while ending its cache before the next wizard invocation.

Exercise a fresh source version after an earlier Add preview without TTY
input or native writes, using an unavailable client to stop at review.

* test(plugin): cover desired checks and final update outcomes

Consolidate checked batch approval and dashboard completion tests while
retaining removed-native, digest, version and approval controls. Reproduce
stale shared recipes and failed or unfinished replacement installs.

* test(plugin): make stale source discovery observable

Remove the old repository before native-only and npm desired checks so
those existing cases cannot pass by reading the applied source.

* fix(plugin): check desired source and final outcome

* test(plugin): bind checked updates to the observed recipe

Reproduce a shared candidate change with equal version, commit and digest,
and preserve a freshly checked replacement whose native ID differs. Use
actual check observations in approval and native update controls, reject
missing source identity, and verify the UI carries the observation through.

* fix(plugin): bind checked update to source recipe

* fix(ui): classify npm recipes as Pi packages

* fix(plugin): retain legacy removal intent during migration

Omit pending removals from shared declarations while retaining original local ownership proof so sync retries cleanup.

Verification: focused regression passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* fix(plugin): keep imports local to an existing shared recipe

Adopt a native installation into its local receipt without converting the shared source target or removing other machines installations.

Verification: focused import regressions passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* fix(plugin): capture legacy evidence on first read

Persist passive hints before another machine writes v2 and save verified adoption on reads. Apply reuses preview receipts instead of querying every legacy binding again. Document the per-machine pre-migration read.

Verification: migration regressions passed in isolated Linux Codex container runs, not the devcontainer (GOMAXPROCS=4, -p=4).

* fix(plugin): target named declarations in interactive imports

Offer unresolved package names in dashboard and TUI imports and pass the selected name in single and batch requests. Drop display-only rendered assertions.

Verification: 47 UI tests passed with at most four workers in an isolated Linux Codex container, not the devcontainer.

* fix(plugin): localize shared intent plan guidance

Add message keys for local imports, account changes, cleanup and native collisions across all dashboard locales. Localized guidance contains no CLI flags.

Verification: failing localization regression now passes in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* refactor(plugin): reuse preview inventory and guard apply boundaries

Capture hints on first load without persisting in-memory adoption during preview, keeping approval revisions stable. Apply reuses preview inventory. Reuse accountEnv and guard applyChange plus native write boundaries without inspecting argv.

Verification: migration, receipt, account and sync regressions passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* test(plugin): organize host state coverage around lifecycle scenarios

Group migration, ref drift, account context and cleanup tests behind shared host fixtures and public Preview/Apply assertions. Cover Codex, Cursor, Antigravity and project scopes; add second-machine doctor coverage and the two-machine runbook. Consolidate package-version tests and remove the unused private-record fixture.

Verification: focused plugin regressions passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4).

* docs(plugin): explain local imports and per-machine migration

Document local receipts, per-machine review and commit pinning, config-path state identity and the required legacy read on every machine. Align sharing, doctor, troubleshooting, file-layout and four translated plugin references; restore schema editing guidance.

Verification: context-router check passed. Runtime verification uses an isolated Linux Codex container, not the devcontainer.

* refactor(plugin): separate unrelated review scope

Move project OMP configuration, plugin list ordering, and npm Pi classification to independent local branches based on upstream/main. Keep the shared intent change focused and cover named import selection in the pure flow helper.

The three local branches have passing builds in a Linux Codex container, not the devcontainer, with isolated test homes and capped parallelism.

* perf(plugin): avoid recapturing v2 state on reads

Only compare and persist passive migration hints when legacy bindings exist. Native v2 reads need no state serialization for migration.

Verification: pending removal and first-read/import regressions passed in a Linux Codex container, not the devcontainer, with isolated HOME/XDG/TMPDIR and GOMAXPROCS=4 GOFLAGS=-p=4.

* docs(plugin): clarify native marketplace repair after import

A local import receipt is not a reviewed reinstall source. Correct the remaining troubleshooting instruction and its four translations to require native-client repair, and align the nearby code comment.

Validation: checked against prepareChange, context-router check and git diff --check passed. Verification for this review ran in a Linux Codex container, not the devcontainer.

* fix(plugins): preserve local ownership across shared intent changes

Retain completed legacy migration markers so unchanged v1 YAML cannot
uninstall a later manual reinstall. Serialize read-side hint persistence
with native operations and keep local imports when shared recipes change.
Require explicit dashboard import names and validate recipe identities.

Correct schema descriptions, messages, CLI ref status, translated migration
guidance and runbooks. Add failing-first Preview/Apply regressions and a
real two-ssenv CLI lifecycle script.

* fix(plugins): preserve migration history and show retained import guidance

Mark existing legacy hints and receipts as captured before cleanup so state
from the previous serializer cannot re-adopt a later manual installation.
Keep recipe-change guidance in unchanged sync outcomes and visible dashboard
rows, and resolve nested OpenCode entries through their package manifest.

Cover public migration, ref, account, import and message contracts across
adapters. Correct the real two-host Cursor assertions, explicit dashboard
selection flow, and remaining localized guidance.

* fix(plugins): retain explicit OpenCode entry during import matching

Standalone OpenCode packages can rely on a reviewed explicit entry rather
than an SDK dependency. Preserve that entry when reading native package
identity so matching nested imports remain supported.

* fix(plugins): preserve migrated imports and verify native entry identity

Recognize older native-only receipts by their existing declaration
fingerprint so remote source recipe edits cannot replace migrated imports.
Keep managed npm receipts distinct through their source fingerprints.

Only borrow an ancestor OpenCode package identity when its resolved entry
is the actual registered file. Retain nested and explicit entry support.
Add public two-host migration and mismatching-entry regressions.

* fix(plugins): retain imported ownership through repeated adds

Persist inferred imported ownership when a matching add refreshes the
receipt intent, so later shared recipe changes still preserve local
native installations. Keep the legacy replacement regression aligned
with that ownership contract while retaining removed-intent cleanup.

Reject missing or unstatable absolute OpenCode entries before identity
matching rather than falling back to the file name. Cover both paths
through public Preview and Apply regressions.

* test(plugins): isolate OpenCode adapter fixtures from host config

Keep native registration fixtures inside their fake agent home by setting
XDG_CONFIG_HOME and clearing inherited OpenCode overrides. Ambient config
writes can otherwise leak into config-discovery tests in other packages.

Cover the XDG, file, directory and inline override cases with temporary
config sentinels, while retaining the existing MCP listing expectation.

* fix(plugin): let local imports return to the shared source

Add a local unimport action that removes only this machine’s installation and receipt while preserving the shared source declaration. Keep retained-import guidance visible across matching adds, list, doctor and dashboard consumers.

Avoid idle OMP guidance and unchanged legacy-read locks, preserve localized errors, keep import identity checks offline, and normalize OpenCode drive URLs. Cover the A/B transition and align translations, runbooks and environment cleanup.

* fix(plugin): complete unimport validation and guidance

Reject missing targets before planning local unimports and share per-target eligibility with the wizard. Make native uninstall effects explicit in help and translated docs, preserve structured update guidance, and cover error paths and shell completion.
2026-10-31 04:23:20 +08:00
Krishnaswamy Subramanian 7ec788dea4 feat(mcp): accept agy and antigravity-cli as MCP targets (#670)
The agy CLI keeps its MCP servers in the file the antigravity client
writes, and plugins and hooks already call it antigravity-cli, but
mcp --target and --from rejected that name. Map agy and
antigravity-cli to antigravity when the flags are parsed, so the
source still stores one client name.

Document the aliases in the MCP command reference, its four
translations and the built-in skill reference.

Closes #669
2026-10-30 02:02:05 +08:00
Rusty ShacklefordandWillie 85bcf589a7 feat(sync): recognize and route agent-specific skill variants (#649)
* docs(proposals): propose agent-specific skill variants

Tracked repositories can ship different files for the same skill across
agents. Counting and syncing each copy independently sends incompatible
instructions to every target unless users maintain routing filters.

Propose repository-scoped logical identity and exact variant routing while
preserving source files, explicit controls, and existing naming behavior.
Leave activation and compatibility decisions for maintainer review.

Refs #648

* docs(proposals): clarify variant routing compatibility

Explain how recognition affects universal-only targets and how existing
per-variant overrides preserve the desired routing. Fix the precedence
between variant identity and generic host-style path inference.

Include analyze, move, and catalog consumers while preserving physical
identifiers and actual context-cost accounting.

Refs #648

* docs(proposals): clarify activation assumptions and scope

Make acceptance cases conditional on maintainer-approved recognition being
enabled for the tracked source. Separate the provisional implementation
estimate from this proposal-only PR so its size is clear.

Refs #648

* docs(proposals): qualify naming and opt-in assumptions

State that the reproduced routing behavior uses default flat target
naming. Leave any opt-in surface with the maintainer's activation decision
without ruling out future CLI or config fields.

Refs #648

* feat: recognize and route tracked agent skill variants

Count tracked variants as logical skills in source and repository summaries,
while preserving physical paths, sync operations, and context costs. Select
matching canonical agent variants, including account targets, through shared
discovery and selection with existing explicit routing precedence.

Refs #648

* fix: count logical skills in sync inventory summaries

Use shared logical and physical inventory counts in global and project sync
closing lines while preserving each target's operation totals.

Refs #648

* fix: preserve variant routing diagnostics across previews

Resolve target selections once so CLI and server previews keep ambiguity
reasons and physical skip counts. Explain managed variants removed by
automatic agent routing, and report logical inventory in doctor.

Keep warning rows read-only, document upgrade recovery in translated
filtering references, and remove the optional README-only addition.

Refs #648

* fix: align sync matrix previews with shared variant selection

Classify the full source selection once per target so matrix previews honor
canonical aliases, account identity, exact-agent routing, and ambiguous
variant skips. Preserve each rejected physical path's existing diagnostic
and draft filter disambiguation; skipped preview rows remain read-only.

Refs #648

* test: expect singular skill wording in doctor source checks

Keep the undiscovered-link count assertion aligned with logical source
inventory formatting for one skill in global and project mode.

Refs #648

* fix: retain selection diagnostics in catalog and diff verdicts

Report warning-only diff targets as requiring attention while preserving
local-only folder semantics. Reuse shared per-path selection diagnostics
in target-scoped catalogs without applying target naming to served paths.

Compute source counts once in summary callers and require variant counts
in the source status formatter.

Refs #648

* test: tighten tracked variant preview fixtures

Use a real committed tracked repository for status counts, verify sync
preview banners retain server warnings, and use emitted ambiguity reason
text in target preview fixtures.

Refs #648

* fix(sync): keep agent variants in shared target folders

Compatible targets sharing a skills folder need a combined selection so
Codex and universal do not prune one another in merge or copy mode.
Carry every shared reader through selection, pruning and previews,
including project targets, account identities and path aliases.

Require a matching skill suffix under two distinct agents before
inferring variants, keeping ordinary agent-named categories unrestricted.
Separate naming warnings from ambiguous selection in diff and explain
ambiguous removals. Add global/project regression coverage for repeated
sync, target-only sync, status JSON, diff and API consumers.

* fix(variants): align consumer counts, hints and diagnostics

Use logical source counts in list, tracked install and init summaries while matching audit caches against physical variants. Restore localized dashboard skip hints and explain symlink routing limits in status and doctor, including project and JSON output.

Document paired-agent detection and compatible shared-folder selection in the proposal, built-in skill and English plus translated command pages. Add focused regressions for the affected consumers.

* fix(sync): cover initial sync and ignored variant diagnostics

Init syncs a fresh in-memory config, so resolve shared target identities
before its first sync as well as when loading saved configuration.

A whole-directory symlink exposes ignored skills too. Diagnose agent
variants using physical inventory when active discovery has none, while
keeping logical counts and merge/copy selection restricted to enabled
skills. Cover global/project JSON status and doctor with regressions.

Reuse sourcewalk directory and canonical-path helpers so traversal guards
remain enforced and path resolution has a single existing owner.

* fix(variants): address conversion, counts and selection diagnostics

Ignore runtime agent identities when comparing convertible project targets and count logical skills during init. Keep selection warnings separate from naming warnings and preserve agent-named parent skills as ordinary skills.

Cover account sync/prune, project ambiguity and overrides in merge/copy modes, and init/status agreement. Focused verification ran in an isolated Linux Codex container, not the devcontainer, as authorized.

* refactor(variants): remove obsolete selection helpers

Remove the unused FilterSkillsByTarget wrapper and prune agent parameter, cache canonical target aliases once, and restore catalog skip ordering to avoid an unrelated behavior change. Completes the optional cleanup from PR 649 review.

* fix(ui): expose localized variant selection diagnostics

Show target warnings with source paths, localize ambiguity across preview and detail consumers, and let skipped preview rows add a physical exclude pattern. Show tracked repository variant counts alongside logical skills.

Drop display-only rendered cases while retaining mutation protection and plain TypeScript logic coverage. Inspect target states in Clean/Playful light/dark and Traditional Chinese.

* docs(variants): explain diagnostics and add sync runbook

Document doctor variant_routing and logical/physical counts, diff selection skips, and the nested parent-skill boundary. Keep all four command translations aligned and add isolated account/project E2E scenarios.

Both runbook steps passed in the authorized Linux Codex container with separate HOME/XDG/TMPDIR fixtures. Website typecheck and all five locale builds passed.

* test(config): use native paths in project conversion fixture

The shared-agent regression fixture appended slash-separated suffixes to Windows temporary paths, so project path matching returned no candidates. Build each path with filepath.Join and preserve all conversion assertions.

Focused project configuration tests passed in the authorized isolated Linux Codex container, not the devcontainer. Windows CI verifies the platform-specific fixture correction.

* fix(ui): recompute shared skill routing for filter previews

Evaluate edited include/exclude settings in the complete target map before
classifying the draft, so a formerly shared folder no longer keeps its old
union when the filters differ. Preserve the saved target configuration.

* fix(mcp): keep parent skills when peer variants route elsewhere

Do not treat an otherwise eligible variant for another agent as an unserved
nested skill. Continue blocking parent publication for explicitly filtered,
disabled, ambiguous, or invalid children so filters still hide their files.

* fix(ui): distinguish agent selection from naming skips

Expose separate naming and selection skip counts on target summaries.
Show each applicable remedy in target details and sync previews so ambiguity
keeps its filter/override guidance alongside naming and collision hints.

* fix(list): include disabled rows in tracked repository counts

Count the complete inventory that list displays, including ignored skills
and physical variants, without changing the enabled counts used by status,
install, or sync. Clone rows before counting to preserve disabled state.

* docs: align variant counts and routing recovery guidance

Show logical skill and physical variant counts in list/install documentation
and keep the four translations aligned with the filtering examples. Explain
that agent-named skill parents keep ordinary nested skills and retain the
devcontainer-only runbook environment. Removal warnings now recommend a
source-local override, since include filters cannot undo agent routing.

* fix(mcp): preserve explicit target restrictions on nested variants

Limit the differently routed child exemption to automatic layout inference.
Frontmatter targets and dashboard source-local overrides must still prevent
a parent from publishing files explicitly restricted to another target.

* fix(ui): fill target name in naming warning guidance

Pass the current target name when rendering localized warning hints so the
same naming guidance shown beside the controls does not expose a placeholder
in the warning banner. Verified in the populated target preview.

---------

Co-authored-by: Willie <egg358358@gmail.com>
2026-10-29 16:47:38 +08:00
Willie 23c9453f87 fix(update): serialize checkout updates across skillshare processes (#666)
Two dashboards (or a dashboard and the CLI) serving the same source ran
"Update all" at once. The server mutex only covers one process, so both
pulled into the same checkouts: one saw the other's half-applied merge as
"local changes would be overwritten", and concurrent fetches into a
blob:none clone failed with "fetch-pack: invalid index-pack output".
update.TrackedRepo, install --track --update, and the in-place pull of a
git-installed skill now hold a flock in the checkout's git directory; a
second process waits up to a minute, then fails with a clear message.

Force on a git-installed skill only skipped the local-modification check
and then ran a plain pull, which refused to merge over the edits the docs
say --force discards. It now fetches and resets to upstream, so a failed
fetch still keeps the edits. Followed checkouts keep pulling, since they
must be clean and may hold the user's unpushed commits.

The pull error dropped the file list git indents under it, and the
finished-update subtitle said everything was up to date even when items
had failed.
2026-10-29 16:20:30 +08:00
Rusty Shackleford 51fa8d14b3 fix(sync): summarize missing registered project roots (#665)
Shared configs can register roots that exist on other machines. Replace the per-root warning flood with one count and a hint to project list, which already exposes each missing folder in text and JSON. Keep root skipping and sync JSON unchanged.
2026-10-29 16:13:28 +08:00
Rusty Shackleford 89ae7068d5 fix(config): honor OMP agent directory for default skills path (#652)
* fix(config): honor OMP skills directory overrides

OMP reads global skills below PI_CODING_AGENT_DIR, but unpinned built-in
targets still selected the default home. Resolve that runtime default
without changing the canonical template used to derive named accounts.

Keep account scan paths independent of the override and document explicit
path precedence in target guidance and its existing translations.

* fix(config): preserve inferred OMP paths across saves

Saving an unpinned OMP target serialized its resolved skills path, so a
later agent-directory override no longer selected the native location.
Track this fallback with the existing derived-path marker so config saves
preserve its inferred status while explicit paths remain pinned.

Cover save/reload after environment changes and filter edits, and fold
redundant account and project-alias checks into their existing cases.

* docs(config): clarify when OMP skills paths stay fixed

Initialization and target addition save their selected destination, while
an OMP entry with no configured skills path follows later environment
changes. Clarify that distinction in public and built-in target guidance
and all four existing translations.

Keep project alias coverage in its existing owner test and remove
redundant OMP matcher and generic save assertions.

* test(config): normalize explicit OMP account paths

The explicit-path fixture combines a native temporary root with a forward
slash suffix. Clean the actual path for comparison so mixed separators
match the native expected path on Windows, retaining the original path
in failure output.

* test(config): use portable OMP whitespace override fixture

Windows normalizes a directory component ending in a space during native
absolute-path resolution. Use a leading-space component to preserve the
check that override values are not trimmed without depending on trailing
space filename behavior.

* fix(config): preserve default OMP home in account shells

Keep plain OMP skills on the canonical home when its environment override
matches a declared account, so the unfiltered default target cannot bypass
account filters. Share account-aware defaults with discovery and dashboard
selection, and keep canonical account templates separate from runtime homes.

Require an OMP install before automatic detection because Pi shares the same
override. Trim surrounding whitespace, ignore relative overrides, and retain
explicit saved paths. Cover account filtering, aliases, symlinks, saves,
discovery, and existing environment-selected file homes with regressions.
2026-10-28 21:06:52 +08:00
Krishnaswamy Subramanian eb9b2b28f9 feat(plugin): add --all flag to plugin update and enable antigravity-cli updates (#656)
* Add --all flag to plugin update and enable agy

Add -a/--all to skillshare plugin update so users can update all
tracked plugins in a single command without tying slow target CLI runs
to skillshare update --all or sync --all.

- Reject --all outside plugin update or when combined with a plugin
  name or --source-ref
- Share source repository discoveries and discovery errors across the
  Preview and Apply lifecycle via Service.WithDiscoveryCache so multi-
  plugin marketplaces are cloned at most once per command
- Isolate source, manifest, and target failures per binding when --all
  is active so healthy plugins update while partial failures exit
  non-zero and leave failed bindings unchanged in config.yaml
- Skip unfiltered OMP bindings during --all updates so sibling targets
  on the same package still update without failing the batch
- Enable plugin update for antigravity-cli while skipping disabled
  plugins when agy extensions list reports an entry as disabled

Closes #653

* Add plugin update --all to docs and completions

Advertise -a/--all for skillshare plugin across all five shell
completion scripts and document the bulk update workflow and
antigravity-cli update support in the user and built-in skill docs.

- Add --all and -a to plugin completions in bash, zsh, fish,
  PowerShell, and Nushell with TestPluginCompletionsIncludeAllFlag
- Document update [NAME | --all], -a/--all, and antigravity-cli source
  updates in website/docs/reference/commands/plugin.md (and its
  zh-Hans, zh-Hant, ja, and ko translations), sharing-plugins.md, and
  quick-reference.md
- Document plugin update --all and antigravity-cli enablement checks in
  skills/skillshare/references/plugins.md

* Require known enabled state for native updates

Require a matching EnabledKnown && Enabled inventory entry before
updating copilot or antigravity-cli bindings, and align the localized
plugin workflow pages with the English docs.

- Skip copilot and antigravity-cli updates in Service.Preview and
  refuse reinstallation in applyNativeTarget when the binding is absent
  from native inventory or not known to be enabled
- Cover absent native inventory in
  TestAntigravityCLIUpdateRespectsEnablement
- Synchronize plugin update [name | --all] and Antigravity CLI update
  guidance across the ja, ko, zh-Hans, and zh-Hant copies of
  quick-reference.md and sharing-plugins.md
2026-10-27 20:57:43 +08:00
Willie efc492fd7a fix(update): audit tracked candidates before publication (#647)
* fix(update): audit tracked candidates before publication

Prevent rejected tracked-update bytes from becoming readable through published target links by staging and auditing a private candidate before updating the active checkout. Publish the exact approved revision without a second upstream pull.

Preserve sparse state, audit metadata, followed checkouts, and compatible edits. Recover staged and unstaged changes after failed forced publication, including deletions, renames, and sparse exclusions. Cover the boundary deterministically and align error messages and localized documentation.

* fix(update): preserve local bytes across Git line-ending conversion

Overlay dirty worktree bytes after staging candidate patches so core.autocrlf does not silently rewrite local edits. Cover staged, unstaged, and cancelled worktree changes while retaining their index state.

Make permission-failure coverage explicitly POSIX-only and compare private checkout contents to their original bytes. Align red-team assertions with candidate rejection and register private temporary cleanup with the raw-write guard.

* test(install): normalize checkout after configuring line endings

Windows fixtures initially inherit core.autocrlf=true. Reset the isolated checkout after selecting the subtest setting so changing it to false does not turn untouched upstream files into local edits.
2026-10-26 15:59:32 +08:00
Rusty Shackleford 5729eee088 feat(project): manage global registrations from the CLI (#603)
Add global project list, show, add, edit, sync and remove so setup scripts
can register repositories without editing YAML or opening the dashboard.
Keep dry runs read-only and report completed work when a target fails.

Reuse the shared project service and sync runners. Include command docs,
translations, completions and regression coverage. Quote overlap hints for
their shell and log partial project syncs consistently with ordinary sync.
2026-10-26 01:38:04 +08:00