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.
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.
* feat(install): pin GitHub tree/blob URLs to their ref
Hub entries only carry a source URL, so a team hub had no way to pin a
third-party skill to a reviewed tag or commit. The parser already read
tree/<ref>/ and blob/<ref>/ URLs but discarded the ref, installing from
the default branch instead of the version the URL names.
Keep that ref as Source.Branch. An explicit --branch (CLI) or branch
(API body) still overrides it; the server handlers now only override
when a branch is given. Batch installs group by repo and ref so two
pinned versions of one repo get separate clones.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* docs(install): describe pinning hub sources to a tag or commit
Explain that a GitHub tree/<ref>/ source URL pins the install, in both
the hub index guide and the install reference.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat(install): pin GitLab/Bitbucket URLs and resolve refs containing "/"
Pinning should not depend on the host, so GitLab (-/tree/<ref>/) and
Bitbucket (src/<ref>/) web URLs now keep their ref too.
Taking the first path segment as the ref broke branch names containing
"/": tree/feature/x/skills/foo cloned branch "feature" and failed. When
the first segment is not a branch or tag on the remote, the longest
matching one is used instead. A ref the remote does not have fails
with a hint to use --branch, rather than silently installing the
default branch. A saved branch that covers more of the path (from
--branch or config) moves the subdir without asking the remote.
The grouped-install round-trip test pinned -/tree/main/ against a repo
on master; the ref used to be ignored, so its branch is now renamed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* docs(install): cover GitLab, Bitbucket and "/" branches in URL pinning
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(install): keep web URL refs correct on reinstall, --branch and grouping
Review of the slash-branch resolution found four gaps:
- A saved branch equal to the whole URL tail (tree/feature/x) did not
move the subdir back, so every reinstall or update looked for "x".
- An unrelated --branch with a slash-branch URL kept the parse-time
subdir (x/skills/foo) instead of the URL's real one.
- Grouped installs copy the source to a repo root; resolution then put
the subdir back and discovery looked under a doubled path. Grouping
also keyed on the unresolved first segment, so tree/feature/x and
tree/feature/y could share one clone. Web URLs with a ref now install
on their own, and resolution leaves a repo-root copy at its root.
- A skill named after the parse-time subdir kept that name once the
path turned out to be all ref (tree/feature/x named the skill "x").
The unknown-ref error now reads as a missing ref first, since a stale
ref (tree/master after a rename) is more common than a slash branch.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(update): keep legacy installs on the default branch
Skills installed before URL refs were honoured got the default branch
and recorded no branch. Single-skill update re-parses the recorded
source, so it moved them to the URL's ref (or failed on a stale one,
with a hint to pass --branch, which update does not accept), while
update --all rebuilds from RepoURL and kept the default branch.
ApplyRecordedBranch treats an empty recorded branch as the remote
default and drops the URL's ref. It replaces the branch handling at
every site that reinstalls from recorded metadata: CLI and server
update for skills and agents, and tracked-repo rehydration.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* perf(search): share one clone across pinned hub skills from a repo
Any web URL with a path after its ref installed on its own, so a hub
listing many tree/<tag>/ skills from one repo cloned it once per skill.
groupByRepo now resolves each URL's ref before grouping, with a
RemoteRefs cache that lists each remote's refs once, and groups by
repo and resolved ref. Only refs containing "/" (whose subdir the
discovery match cannot re-derive) and refs that fail to resolve still
install alone. A resolved source is marked settled so the grouped
clone does not resolve it again, and ApplyRecordedBranch settles the
subdir from a recorded branch without asking the remote.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Willie <egg358358@gmail.com>
config.yaml records which skills a project wants, but not which commit
each one resolved to, so two teammates running `install -p` a week apart
could end up with different skill contents.
Project mode now writes .skillshare/skills.lock.json next to the config.
`install -p` checks out the locked commit for skills and tracked repos,
and brings an already installed skill to the lock when they differ.
`update -p` and the dashboard move a pin only for skills whose commit
actually changed, so a stale local copy cannot roll the team back, and
uninstall drops the pin. A locked value is only honoured when it is a
full SHA for the same source, since it ends up as a git argument.
InstallOptions.Force carried two meanings: "overwrite what is already
there" and "proceed despite audit findings". Update paths set Force
unconditionally to overwrite a staged temp dir, so they had to leave it
off to keep the audit gate alive -- which swallowed the caller's --force
and made the gate impossible to override from either the CLI or the web
UI.
Split the audit intent into InstallOptions.AuditOverride and route every
gate through it alone. Entry points translate --force explicitly, so a
missed one degrades to "force has no effect" rather than "audit is
bypassed". Scan failures stay fail-closed regardless: accepting known
findings is not the same as being unable to learn any.
This also closes two paths that bypassed the gate outright, since both
inherited Force for overwrite reasons alone: install --json and grouped
batch updates.
In the web UI, Force Retry now appears only on failures force can
actually resolve -- a permission-denied unlink previously offered a
button that could never succeed -- and CLI-only flag hints are stripped
from messages rendered there.
Behaviour change: a --force at install time no longer exempts later
updates from the audit gate; it is a one-off decision per command.
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.
The mixed-tracked-repo recovery path used a fragile substring match on
the error message and re-cloned the repo via /discover to count skills
and agents. Both problems share one root cause: the counts InferTrackedKind
already computed during the failed first install were thrown away.
- Add install.TrackKindAmbiguousError carrying the discovered Skills /
Agents counts. InferTrackedKind returns it on the ambiguous branch.
Error() preserves the legacy message verbatim so CLI output is unchanged.
- Server handleInstall track branch uses errors.As to detect it and emits
writeCodedError with stable code 'install.track_kind_ambiguous' plus
skills/agents counts in error_params.
- UI replaces the substring match with an ApiError.code check and reads
counts straight from err.params, skipping the second /discover clone.
- Add unit tests asserting errors.As, count fidelity, and explicit-kind
short-circuit (no clone).
Net result: 2 clones instead of 3 on the mixed-track recovery path, and a
stable cross-language contract instead of a brittle English substring.
Make the v0.19.16 sources map actually do something: route all path
reads through Config.EffectiveSkillsSource() / EffectiveAgentsSource() /
EffectiveExtrasSource() so users who set sources.skills / sources.agents /
sources.extras get the configured paths everywhere.
Mechanical changes (~50 files):
- cmd/skillshare/**: replace cfg.Source / cfg.ExtrasSource reads with
cfg.EffectiveSkillsSource() / cfg.EffectiveExtrasSource()
- internal/server/**: replace s.cfg.Source / s.cfg.ExtrasSource reads
with the same helpers; server.skillsSource() / gitignoreDir() use the
global-mode helper
- internal/config/config_validate.go: validate using EffectiveSkillsSource
while still rejecting configs that set neither field explicitly
- internal/config/reconcile.go, registry.go: read via helpers
Behavioral fixes (paired with the migration):
- extras init / extras source / POST /api/extras no longer silently
backfill the legacy extras_source field — the runtime fallback inside
EffectiveExtrasSource() handles it. This stops surprise diffs in users'
config.yaml after running extras commands.
- extras source command writes back to whichever field the user already
configured (sources.extras if set, otherwise legacy extras_source) so
the update is not shadowed.
- source_type in /api/extras and extras list correctly reports "default"
vs "extras_source" by inspecting the raw (unresolved) configured value;
sources.extras counts as configured for this purpose.
UI:
- ui/src/lib/fieldDocs.ts: neutralize sources / sources.* descriptions
so they describe both project and global modes (Phase 5).
Preserved (intentional):
- Direct writes to cfg.Source / cfg.AgentsSource / cfg.ExtrasSource in
init, migrate.go, cloneForSave, and server.reloadConfig — these are
raw-field writes, not path reads.
- Updated test expectations for the removed backfills.
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).
Code quality fixes from review:
- Extract RemoveByNames() to eliminate copy-paste in uninstall Phase 7
- Add MetadataKindSkill/MetadataKindAgent constants
- Remove dual-write shim (findSkillsRoot + writeMetaToCentralized)
- install_apply.go uses WriteMetaToStore with SourceDir (no sidecar)
- Move LoadMetadata out of walk loops (P0 efficiency fix)
- isGroupDir accepts store parameter to avoid redundant loads
- Add SourceDir to InstallOptions for --into group support
- Add Tab/Shift+Tab to cycle All/Skills/Agents tabs with count badges
- Tab bar renders at top with bold+underline cyan active, dim inactive
- Tab acts as pre-filter composing with text filter via AND logic
- Cache tab-filtered items in applyFilter() to avoid per-frame recomputation
- Add tabNoun() method to consolidate noun switches across title/filter bar
Agent install --into support:
- Support --into flag for agent install (CLI, server, project mode)
- Support --into=value syntax in addition to --into value
- Server handler_skills uses recursive AgentKind.Discover() for nested agents
- Fix agent metadata read path: use file basename instead of frontmatter name
- Sync --all flag now includes agent sync (not just extras)
Agent content viewer:
- Agents render full-width without sidebar (single .md file, no tree needed)
- Simplified help text and keyboard handling for agent content view
Agent uninstall fixes:
- Use discovery-based resolution instead of hardcoded name+.md path lookup
- Support matching by Name, FlatName, RelPath, or trimmed RelPath
- Compressed confirmation display (list format, max 20 shown)
UI polish:
- Help bar keys highlighted in dim cyan, descriptions in dim gray
- Align 'No items.' text with list title via PaddingLeft(2)
Add Config.HasAgentTarget() helper that checks if any configured target
has an agents path set.
handler_install: append warning to install summary when agents are
installed but no targets support them.
handler_sync: after sync completes, check if agents exist in source
but no targets have agent paths — add warning to response.
SkillPickerModal: use items-start + mt-1.5 on checkbox/radio to align
with first line of multi-line content (name + path).
handler_install: summary message uses 'agents' when kind is agent,
instead of always saying 'skills'.
Backend (handler_install.go):
- handleInstallBatch checks body.Kind field; when 'agent', uses
InstallAgentFromDiscovery() writing to agentsSource() instead of
skills source directory.
Frontend (client.ts):
- installBatch accepts optional kind param.
Frontend (InstallForm.tsx):
- handleBatchInstall detects kind from selected items and passes
kind='agent' to the API when installing agents.
Backend (handler_install.go):
- handleDiscover now returns agents[] alongside skills[] with kind field
- needsSelection true when agents are present
Frontend (client.ts):
- Add DiscoveredAgent type and agents field to DiscoverResult
Frontend (InstallForm.tsx):
- Mixed repo: show kind selector dialog (Skills/Agents buttons)
- Pure agent repo: map agents to skill picker format directly
- After kind selection, open existing SkillPickerModal with filtered items
Spec/design/tasks updated with kind-first selection decision.
handler_sync: add Kind field to diff stream item struct.
handler_audit: add Kind field to audit stream result.
handler_check: add Kind field to check stream result.
handler_update: add Kind field to update stream result.
handler_install: add Kind field to install request for agent support.
- skillItem struct gains Branch field (json: branch,omitempty)
- handleListSkills and handleGetSkill populate Branch from SkillMeta;
fall back to git.GetCurrentBranch for tracked repos with empty metadata branch
- handleDiscover, handleInstallBatch, handleInstall all accept Branch in
request body and propagate it to Source.Branch and InstallOptions.Branch
Analyze page:
- Display skill path (/) instead of flat name (__) in chart, table, dialog
- Widen chart name column from 150px to 220px
- Add skill path as first line in chart tooltip with separator
- Add hover highlight on chart rows
Tooltip component:
- Add followCursor mode that tracks mouse position
- Add viewport boundary detection to prevent clipping
- Measure natural size at (0,0) before clamping position
- Remove break-all to prevent mid-word breaks
Install page:
- Add singleSelect mode to SkillPickerModal (radio UI) when custom name is set
- Add custom name support to batch install API (backend + frontend)
- Remove cross-path duplicate check for batch installs
- Fix: don't show success summary toast when all skills failed
- Fix: keep picker open on install failure
- Preserve source input after install (don't clear on reset)
- Widen SkillPickerModal from md to 2xl
- Align severity badge and description text in warning dialogs
Toast: raise z-index above dialog overlay (z-50 → z-[60])
Addresses P1 and P2 from code review on the RWMutex commit:
P1 — Stream handlers now snapshot config under RLock before streaming:
- handleDiffStream: clone Targets map to prevent concurrent map panic
- handleCheckStream, handleAuditStream: snapshot source/projectRoot
- handleUpdateStream: snapshot source (per-item Lock already correct)
P2 — All read handlers now use narrow snapshot instead of defer RUnlock:
- RLock → copy needed fields to locals → RUnlock → do work with locals
- Prevents slow I/O (git fetch, version check, audit scan) from blocking
the auto-reload middleware's exclusive Lock on concurrent requests
Other changes:
- computeTargetDiff takes source parameter (no more s.cfg.Source access)
- Add cloneTargets() helper for safe map copying
- Add writeOpsLogTo/writeAuditLogTo for lock-free oplog writes
Self-managed GitLab instances on custom domains (e.g., git.company.com)
without "gitlab" in the hostname were parsed with 2-segment owner/repo
split instead of full-path repo. Users can now declare extra GitLab
hostnames in config so the parser treats them like gitlab.com (nested
subgroup support).
- Add `gitlab_hosts` field to both global and project Config structs
- Validate entries at load time (reject scheme, path, port, empty)
- Add `ParseOptions` / `ParseSourceWithOptions` to thread hosts into parser
- Add `isGitLabHost()` helper combining built-in + custom host detection
- Extend `InstallContext` interface with `GitLabHosts()` method
- Update all ParseSource call sites (install, search, update, server)
- Add JSON schemas for both config files
- Add unit tests for config validation and source parsing
- Add E2E runbook for devcontainer verification
- Document in configuration reference and URL formats appendix
Include skill description from SKILL.md frontmatter in the discover API
response, add the optional description field to the DiscoveredSkill
TypeScript interface, and render it inline in the SkillPickerModal.
Filter search also matches against descriptions. The --into directory
input already existed in InstallForm, so no change was needed there.
handleDiscover and handleInstallBatch now use DiscoverFromGitSubdir
when the source URL contains a subdirectory path, enabling the skill
picker modal to appear for multi-skill subdirectories.
Fix SkillPickerModal content disappearing on checkbox click caused by
Card's overflow-hidden creating a scroll container — browser's
scrollIntoView on the sr-only input would scroll content out of view.
Use overflow-clip instead to preserve border-radius clipping without
creating a scroll context.
Issue #56 (workaround)
Prevent accidental duplicate installs when the same repo is already
installed at a different path (e.g., --into vs root). Same-repo
reinstalls now show a friendly skip indicator instead of an error.
- Add CheckCrossPathDuplicate() with URL normalization (HTTPS/SSH)
- Add ErrSkipSameRepo sentinel for graceful skip flow control
- Add checkExistingConflict() with repo URL comparison
- Fix --force hint to use repo URL (not per-skill subpath) and
include --into when applicable
- Add dedup check to Web UI install endpoints (HTTP 409)
- Group skipped skills by directory with repo label in summary
Port the project-mode skill manifest pattern to global mode so
`config.yaml` supports a `skills:` section and `skillshare install`
(no args) installs all listed remote skills.
- Rename ProjectSkill → SkillEntry (shared by both modes)
- Add Skills []SkillEntry to global Config with validation
- Add ReconcileGlobalSkills() to auto-sync manifest after install
- Wire no-arg install, auto-reconcile on all install paths
(including search → install), and uninstall cleanup
- Update server handlers for global reconciliation
- Update docs, tests, and CHANGELOG
Allow installing skills into subdirectories for organized folder
structures. Works with all install modes (direct, discovery, tracked)
in both global and project mode.
- Add Into field to InstallOptions and IntoPath() validation
- Update 4 dest-path construction points in CLI with destWithInto()
- Update InstallTrackedRepo for --into prefix in dest and gitignore
- Rewrite ReconcileProjectSkills to use filepath.WalkDir (recursive)
- Add --into to Web UI install handler, API client, and form
- Add 5 integration tests covering local, multi-level, validation,
project mode, and no-source rejection
- Add oplog write helpers to server (oplog_helper.go) and instrument
all handler_*.go endpoints with ops/audit logging
- Improve audit CLI with structured auditRunSummary and severity counts
- Enhance log CLI with richer filtering and detail display
- Improve sync CLI with drift detection summaries in oplog
- Reorder web UI sidebar nav by user workflow (core → acquire → distribute → maintain → monitor)
- Enhance LogPage with better formatting and filtering
- Add server oplog unit tests (logging_test.go, log_test.go)
- Update docs for log command and quick-reference
Add oplog package (internal/oplog) that records every mutating command
(install, uninstall, sync, push, pull, collect, backup, restore, update,
audit) as a JSONL entry with timestamp, status, duration, and args.
- CLI: `skillshare log` with --audit, --tail, --clear, --project flags
- API: GET/DELETE /api/log endpoints with type and limit params
- Web UI: LogPage with ops/audit tabs, table view, clear and refresh
- Instrumentation across 12 command handlers (CLI + server)
The web dashboard now fully supports project-level skills. When launched
with `-p` or when `.skillshare/config.yaml` is auto-detected, the UI
adapts: Git Sync and Backup pages are hidden, Config edits the project
config, Install reconciles ProjectConfig.Skills[], and targets resolve
from project-level definitions.
Server: add NewProject constructor, IsProjectMode/configPath/saveConfig/
reloadConfig helpers, branch all handlers for project mode.
Frontend: AppContext propagates isProjectMode, Layout filters nav items,
Git/Backup pages show unavailable message, Config/Dashboard adapt.
Extract ReconcileProjectSkills to internal/config for reuse by both CLI
and server. Add unit tests and integration tests for project UI.
Update docs, README, and Docker playground with project mode demo project
and skillshare-ui-p alias.
Single-binary web UI for visual skill management — React 19 + Vite
frontend embedded via go:embed, Go net/http REST API backend (30+
endpoints). Includes dashboard, skills browser, targets, sync, collect,
search, install, config editor, backup/restore, and git sync pages.
Also adds Bitbucket/GitLab URL parsing for install, git operations
library, skill version checking, CI frontend build steps, Docker
sandbox support, and website docs for the ui command.