install.Install persists metadata through its own store instance, leaving
the server's cached skillsStore stale. Freshly installed skills resolved
to a nil metadata entry and rendered with an empty source/type (shown as
"Local" in the UI) until restart. The agent path already reloaded
agentsStore; mirror it for skills across all three install completion
points (batch, tracked repo, single install).
The project-root self-install guard lived only in the CLI handler, so the
web UI could still copy the project root into its own .skillshare/skills/
subtree in project mode. Extract the check into a shared
install.RejectProjectRootLocalInstall and apply it in handleInstall and
handleInstallBatch, returning 400 with the same guidance.
Also restructure the rejection message into a cause line plus an
actionable "Run '...'" hint, matching the project's error convention.
Add local-path resource discovery so install flows can detect agents as well as skills. Preserve nested agent paths and suffixless agent metadata keys during batch install and update, and refresh the UI copy to use resource-aware wording on the install surface.
Three bugs introduced during centralized metadata migration:
1. Batch agent installs via UI wrote metadata to skills/.metadata.json
instead of agents/.metadata.json because handleInstallBatch hard-coded
SourceDir to s.cfg.Source. Override SourceDir with agentsSource() when
body.Kind is agent.
2. CheckAgents used LoadMetadataOrNew which silently converts parse
failures into an empty store, making all tracked agents appear local
and suppressing drift/update diagnostics. Switch to LoadMetadata and
surface corruption as status=error with the parse error message.
3. findMetaEntry only climbed 3 parent directories when searching for
.metadata.json, but --into supports arbitrary nesting depth. Raise
the ceiling to 10 (root sentinel still terminates early).