When --track installed a repo whose SKILL.md sits at the repository root
(non-spec layout), the install reported success but:
- .metadata.json gained no entry (cross-machine recovery via metadata broken)
- status --json tracked_repos did not list the repo
Two coupled bugs caused this:
1. cmdInstall gated ReconcileGlobalSkills on len(InstalledSkills) > 0.
Tracked repos with no discoverable nested skills produced an empty
InstalledSkills slice, so reconcile never ran and never detected the
_<name>/.git directory to write a tracked entry.
2. extractTrackedRepos derived repo names from discovered skills, so
repos with zero discoverable skills were silently dropped from status
and list output.
Fix both by:
- Making the post-install reconcile unconditional on success. Reconcile is
idempotent and cheap; gating it on InstalledSkills > 0 created a path
where successful installs left metadata stale.
- Switching extractTrackedRepos to install.GetTrackedRepos (a directory
walk for _-prefixed git repos), the same source-of-truth used by check
and update. Shared across status, status_project, list, and list_project.
Closes#163
Co-authored-by: Claude <noreply@anthropic.com>
Detect overlapping target paths during sync — either two targets
sharing the same primary path, or cross-runtime discovery via the
also_scans table — and surface a brief one-liner pointing users at
`skillshare doctor` for the full breakdown.
Triggers in both CLI (sync.go, sync_project.go) and Web UI (sync API
warnings array, rendered by existing SyncPage warnings card). Detection
logic lives in internal/config/path_overlap.go and is shared between
both paths.
Quiet by design: no output when no overlap exists. JSON output mode
remains untouched.
Add two new doctor checks to detect duplicate-skill problems
surfaced in issue #135:
Layer 1 — checkSharedTargetPaths:
Warns when two or more enabled targets resolve to the same
filesystem path after tilde expansion. Pure metadata check; no
runtime probing. Catches universal/warp/witsy all sharing
~/.agents/skills.
Layer A — checkCrossTargetDiscovery:
Driven by a new also_scans field in targets.yaml that documents
paths a target's runtime reads beyond its primary skills
directory. Sourced from each tool's official docs. Populated
for amp, antigravity, codex, cursor, firebender, kimi, roo.
Warns when an enabled target's also_scans path is the primary
path of another enabled target. Example: enabling codex +
universal warns that Codex's runtime will see ~/.agents/skills
content.
Overlaps are grouped per scanner so a multi-overlap target
(e.g. firebender reading 5 brand dirs for cross-compat) emits
a single warning with indented detail lines.
config:
- New targetAlsoScans struct + AlsoScansGlobal / AlsoScansProject
accessors.
- targets.yaml schema is backward-compatible (optional field).
Layer B (sync engine routing) and Layer C (user-declared
authoritative roots) are intentionally deferred — diagnosis comes
first, behaviour changes only if users actually ask.
Fresh `skillshare init` (global) now writes the v0.19.16 `sources:` map
instead of the legacy top-level fields:
sources:
skills: ~/.config/skillshare/skills
agents: ~/.config/skillshare/agents
What changed:
- cmd/skillshare/init.go: construct Config with Sources{Skills, Agents}
rather than Source/ExtrasSource. The --subdir update path writes to
cfg.Sources.Skills accordingly. The --remote re-init path uses
cfg.EffectiveSkillsSource() for git operations so it works whichever
shape the existing config uses.
- internal/config/config.go: add `,omitempty` to Source field so configs
that only set sources.skills don't get a noisy `source: ""` line.
- tests/integration/extras_test.go: rename TestInit_SetsExtrasSource to
TestInit_WritesSourcesMap and assert the new shape (sources map
present, legacy source/extras_source/agents_source absent).
Existing configs are untouched — legacy fields keep working through
Config.Effective*Source helpers. No auto-migration on Save.
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.
Project-mode 'check agents' previously fell back to .skillshare/agents
when LoadProject failed. With custom sources.agents this could scan
the wrong directory and report green while the configured source is
unchecked. Now returns the load error instead.
ValidateProjectConfig now resolves each target's skills/agents path
and rejects configs where a source aliases or nests with any target
path. Without this guard, sources.skills: .claude/skills with a
claude target makes sync --force delete the source.
check -p now returns an error on LoadProject failure instead of
falling back to .skillshare/skills.
Project-mode disable/enable and new previously fell back to default
.skillshare/{skills,agents} when LoadProject failed. With custom
sources this could write .skillignore/.agentignore or create new
skills in the wrong directory. Now both paths return an error
instead of silently using the default path.
Project uninstall previously fell back to default .skillshare/skills
when config was malformed. With custom sources this could trash skills
from the wrong directory. Now both skill and agent uninstall paths
return an error instead of silently using the default path.
Reorder handleUninstallRepo to move repo to trash before removing the
.gitignore entry, preventing accidental exposure of tracked content
when trashing fails.
ProjectGitignoreTarget now returns empty strings for source paths
outside projectRoot, since parent-relative patterns (../) are invalid
in .gitignore. All six callers guard on empty gitignoreDir and skip
gitignore management for external sources.
reloadConfig now updates s.cfg.Source and s.cfg.AgentsSource from the
refreshed ProjectConfig so project UI handlers see the latest source
directories after a config edit.
Add ProjectGitignoreTarget helper that computes the correct .gitignore
directory and entry prefix based on whether the source path is inside
.skillshare/ or a custom location. All gitignore write and remove
operations (reconcile, install, uninstall, server handlers) now use
this helper instead of hardcoded 'skills/' prefix.
Fix nil projectCfg panics in three server tests that simulate project
mode by setting projectRoot without projectCfg.
Add ProjectSources struct to ProjectConfig with optional skills, agents,
and extras fields. When set, project-mode commands resolve source paths
from these values instead of hardcoded .skillshare/{skills,agents,extras}/.
Config example:
sources:
skills: ./docs/skills
agents: ./docs/agents
Three EffectiveXxxSource(projectRoot) methods provide the central
resolution logic with fallback to defaults. The projectRuntime gateway
and server layer route through these methods, so most commands get
custom source support automatically.
Closes#153
Project mode agent backup (sync --agents, backup -p) creates
.skillshare/backups/ but it was not gitignored — backup artifacts
could be accidentally committed.
Agent backup was added in 95c46ca8 (2026-04-06), after the gitignore
fix in 90c096b8 (2026-03-16) which only covered logs/ and trash/.
- Project mode JSON sync now includes context_cost (was nil)
- Server handler respects symlink mode (skips include/exclude filters)
- checkBudget reports all targets exceeding threshold (not just worst)
- Budget warnings include target name in CLI and UI output
- ConfigPage indentation restored to original 2-space style
DiscoverSourceSkillsWithStats did not set collectContext=true, so
DescChars/BodyChars were always 0 when sync called buildAnalyzeEntries.
Add DiscoverSourceSkillsWithStatsAndContext that enables both ignore
stats and context collection in a single walk, and use it in sync.go
and sync_project.go.
Add --quiet/-q flag to suppress token summary and budget warnings.
Both global and project sync paths call buildAnalyzeEntries after
SyncSummary to display context cost and budget violations.
- Replace three switch statements with a single shells map[string]shellDef
- Add missing --add-agent-{include,exclude} and --remove-agent-{include,exclude}
flags to nushell target completion
- Fix nushell audit using 'target?' instead of 'subcommand?'
- Replace raw fmt.Println with ui.Info in post-install hints
- Use testutil assertion helpers in integration tests
- Verify --install actually writes the file to disk
Bash, zsh, and PowerShell completion scripts now auto-detect aliases
pointing to skillshare (e.g. alias ss=skillshare) and register
completions for them. Also adds powershell/nushell to the shell
options in all completion scripts.
- Add PowerShell and Nushell completion scripts
- Fix bash completion when bash-completion package is not installed
(fallback from _init_completion to manual COMP_WORDS parsing)
Add 'skillshare completion <shell>' command that generates shell
completion scripts. Supports --install flag to auto-write the script
to the correct platform path.
Covers all commands, subcommands, and per-command flags for bash,
zsh, and fish shells.
- install_project.go: pass AzureHosts to temporary Config (was only
passing GitLabHosts, so project-mode direct install ignored azure_hosts)
- update_agents.go: thread ParseOptions through batchUpdateAgents and
reinstallAgent, replacing bare ParseSource with ParseSourceWithOptions
- handler_update.go: use ParseSourceWithOptions with s.parseOpts() for
agent update in web UI
Without this fix, azure_hosts in .skillshare/config.yaml was silently
ignored during project install and agent update, causing on-prem Azure
DevOps URLs to be parsed incorrectly.
Add azure_hosts config parameter (analogous to gitlab_hosts) that allows
users to register self-hosted Azure DevOps Server hostnames so they
receive proper URL parsing without appending .git to clone URLs.
- Add AzureHosts field to Config and ProjectConfig structs
- Add SKILLSHARE_AZURE_HOSTS env var support with merge semantics
- Generalize hostname validation into shared normalizeHostList/mergeHostsFromEnv
- Add azureOnPremPattern regex and parseAzureOnPrem for /_git/ URL routing
- Add isAzureHost for config-based host detection (no auto-detect)
- Update TrackName to handle on-prem Azure DevOps clone URLs
- Wire AzureHosts through InstallContext, ParseOptions, and Server
- Add JSON Schema, UI fieldDocs, and website documentation
- Add 19 new tests covering config, source parsing, and server
Closes#147
Refactors targetListJSON (global and project modes) to use the shared
buildTargetTUIItems + newTargetListJSONItem path, eliminating duplicated
item-building logic and ensuring both modes expose consistent metadata:
- targetNaming: effective naming strategy (flat/nested)
- sync: skill sync summary string
- agentSync: agent sync summary string
Adds assertions in target_agents_test.go and a new integration test
(TestTarget_List_Project_JSON_IncludesSyncMetadata) to cover the new fields.
Add agentLocalCount to target API and CLI JSON output so the UI can
display how many local (non-source) agents exist per target.
- Add LocalCount to AgentSummary, computed via FindLocalAgents
- Surface agentLocalCount in both CLI target list JSON and server API
- Show local agent counts in target detail summaries (CLI + UI)
- Collect button now appears for targets with local agents and routes
to CollectPage with scope=agent query param
- CollectPage reads scope from URL and auto-scans on mount
- Fix BatchUninstallPage: agents tab was collapsing individual agent
names into the repo name via buildApiNames(), causing 'agent not
found' errors; now sends each agent flatName individually
- Invalidate targets + diff queries after successful collect
Root SKILL.md in multi-skill repos has no directory boundary — the entire
repo root is its source, which drags in project infrastructure (src/,
assets/, CI, build scripts). Now when Path="." and descendants exist,
only the SKILL.md file is copied. Children install as independent flat
directories instead of nesting under the root.
Remove orchestrator nesting logic from installSelectedSkills — each skill
now installs at the top level regardless of whether the root is selected.
UpdateNotification() wrote to stdout via fmt.Printf, corrupting JSON
output when --json was passed to commands like search. Machine
consumers got invalid JSON with trailing human-readable text.
Three-layer fix:
1. Move UpdateNotification output to os.Stderr (safety net for any
caller that bypasses the main.go guard).
2. Add isStructuredOutput() that detects all machine-readable modes:
--json, -j, and --format json/sarif/markdown.
3. Skip the update check and trailing newline entirely in main()
when structured output is requested, honouring the contract that
stdout = pure structured data and stderr = empty.
Tests:
- Unit: isStructuredOutput table test (9 cases)
- Unit: UpdateNotification writes only to stderr
- Integration: versioned binary (1.0.0) with seeded cache (9.9.9)
exercises the real update path for search --json, list -j, and
audit --format json — asserts valid JSON stdout + empty stderr.
Closes#129
Two related improvements for issue #124:
1. Source parsing now tracks ExplicitSkill when a blob URL points
directly at a SKILL.md file. Discovery constrains results to
the root skill only, skipping the orchestrator pack/selection
prompt entirely — the user clearly wants that one skill.
2. Single-select (radio) checklist TUI reworked: selection follows
the cursor automatically, space keeps exactly one item active,
enter confirms the focused item. Pre-selected items set the
initial cursor position. This gives immediate visual feedback
and eliminates the confusing empty-selection edge case.
Refs: #124
An orchestrator repository containing a root SKILL.md together with
child SKILL.md directories (e.g. iOfficeAI/OfficeCLI) previously
installed as a single bundled directory that mirrored the git clone:
copying the root dragged every child skill dir into it, and children
marked selected were silently skipped as "included in parent" while
their computed dest paths were never written to.
Make each discovered skill a first-class install:
- New copyDirExcluding() skips subdirectories by slash-normalized
relative path, so a skill directory is copied without duplicating
any nested skill that is itself being installed elsewhere.
- installFromDiscoveryImpl computes the descendant skill paths of the
skill currently being copied and passes them as excludes. For the
root of an orchestrator repo this drops every child skill dir; for
a non-root skill it drops any sub-skill nested inside it.
- installSelectedSkills stops skipping children after the root is
installed. The existing dest-path logic already places each child
under <parentName>/<childName>, so the children are written as
siblings to the root install.
After the fix, a multi-skill repo with N skills produces N independent
installed directories discoverable by sync, updatable individually.
Refs: #124
When a repo contains both a root SKILL.md and child skills, picking
"Select individual skills" previously excluded the root entirely, so
the orchestrator skill could never be installed from the multi-select
UI — users had to resort to --name as a workaround.
Include the root skill in the individual selection list (listed first)
so it is visible and selectable alongside its children.
Refs: #124
Extend install/update with agent-aware --json output and apply the same
audit block-threshold gate skills already use.
Install:
- install --json: imply --force; imply --all only when neither
--skill nor --agent is set (so explicit selectors still work)
- project-mode install now routes through cmdInstallProjectParsed
so --json suppresses UI and emits a pure-JSON payload
- agent installs propagate SourceDir so metadata lands in the
agents root, not the install subdir
- validation error lists --agent / --kind / --branch explicitly
Update agents:
- update agents supports --force, --skip-audit, --audit-threshold
- tracked agent repos + metadata-backed single-file agents now run
the same audit gate as skills; blocks roll back from a temp stage
- JSON output returns the final per-agent status
(updated/skipped/failed/up_to_date/...) by merging check results
with batch update outcomes
Audit:
- auditInstalledAgent shares one helper with auditInstalledSkill
(scan + cleanup callbacks); single-file agent scans now use
audit.ScanFile / ScanFileForProject instead of staging the file
into a temp directory
- UpdateAgentFromDiscovery stages to temp, audits, then renames
atomically (rename already overwrites on POSIX)
Refactors pulled in while reworking these paths:
- extract jsonUISuppressor helper in json_output.go and use it
from install/update/update_agents; collapses 4 copies of the
suppress/restore closure dance and the per-error failJSON block
- drop relPath plumbing from installAgentFromDiscoveryInternal
now that ScanFile doesn't need a staged relative path
- list.go render functions now use theme.ANSI() so NO_COLOR is
respected in plain-text output
Tests:
- add TestInstallAgentFromDiscovery_HighFindingBlocked (unit)
- add TestUpdate_Agents_HighFindingBlockedByThreshold (integration)
- add TestInstall_Project_JSON_Agent_PureJSON,
TestUpdate_Agents_JSON_ReportsFinalStatus
- fix TestList_SKILLSHARE_THEME_Light / TestList_NO_COLOR to
write a config before invoking list
- fix TestTargetList_NoTUI_FallsBackToPlainText assertion to match
the new structured Mode: merge output
- fix TestDoctor_AllGood_PassesAll by pinning SKILLSHARE_THEME=dark
so the no-TTY theme fallback warning doesn't fire
- add list_tui_content_test.go covering light/dark glamour base
- list detail pane now picks LightStyleConfig on light terminals
Docs:
- update install.md, update.md, understand/agents.md for the new
flags, JSON shapes, and agents update workflow
The list TUI had two grouping bugs:
1. Local nested skills (e.g. mma/agent-browser, mma/docker-expert) were
lumped into the "standalone" group because buildGroupedItems keyed on
RepoName, which is empty for non-tracked skills.
2. Agents deep inside a tracked repo (e.g. _vijay-agents/agents/core/x.md,
_vijay-agents/agents/specialized/python/y.md) were split into separate
groups per sub-directory. discoverAndBuildAgentEntries set RepoName to
filepath.Dir(RelPath), producing keys like '_vijay-agents/agents/core'
instead of the tracked repo root.
Fix:
- discoverAndBuildAgentEntries now uses d.RepoRelPath (already computed
by agent discovery) so tracked agents share one visual group regardless
of nesting depth. This also corrects a pre-existing mis-count where
local nested agents were counted as tracked in the summary footer.
- Add skillTopGroup() helper in list_tui_filter.go: tracked → RepoName;
non-tracked nested → first RelPath segment; flat → "" (standalone).
- buildGroupedItems now keys on skillTopGroup() so local nested groups
(mma/*) render as their own bucket instead of standalone.
- sortSkillEntries default sort now groups by top-level bucket first,
placing standalone last, so buildGroupedItems sees contiguous blocks.
- Remove 'if opts.SortBy != ""' gating in both global list paths: sort
must always run to guarantee the TUI grouping invariant.
Tests: 4 new unit tests cover local nested grouping, deep tracked agents,
skillTopGroup cases, and the top-group-aware sort order.
Finishes the theme system migration:
- Deletes cmd/skillshare/tui_colors.go entirely (~152 lines). The
tc struct and tcSevStyle/riskLabelStyle/formatRiskBadgeLipgloss
helpers are all replaced by equivalents in internal/theme.
- Migrates last 6 helper-function callers in audit_tui.go and
search_tui.go.
- Adds checkTheme() to doctor.go with warning status on fallback,
wired into runDoctorChecks() after checkSymlinkSupport.
- Adds theme.Get() call early in main() so OSC 11 probe overhead
happens at startup, not during TUI rendering.
After this commit:
- grep 'lipgloss.Color(' cmd/skillshare/ returns only the hardcoded
brand yellow #D4D93C (logo color)
- grep 'tc.|ac.|lc.' cmd/skillshare/ returns only loop variables
- Full build and test suite pass
Refs: #125
Replaces all tc.* references in 26 files under cmd/skillshare/
with the new internal/theme API. Also removes the file-local ac
struct from audit_tui.go and the lc struct from log_tui.go.
Files touched: analyze_tui.go, analyze_tui_item.go, audit_render.go,
audit_rules_tui.go, audit_tui.go, checklist_tui.go, diff_tui.go,
extras.go, extras_init_tui.go, extras_list_tui.go,
extras_list_tui_item.go, hub.go, install_prompt_tui.go, log_tui.go,
new_tui.go, restore_tui.go, search_batch.go, search_tui.go,
sync.go, sync_agents.go, sync_parallel.go, target_agents_test.go,
target_list_tui.go, trash_tui.go, tui_helpers.go.
tui_colors.go (the tc struct definition file) is kept for now; it
will be deleted in the final cleanup commit along with the doctor
integration and main.go early init call.
Refs: #125
Replaces all tc.* references in list_tui.go, list_tui_item.go, and
list_tui_content.go with the new internal/theme API. Also fixes the
hardcoded lipgloss.Color("15") at list_tui_item.go:296 — the root
cause of issue #125.
NOTE: The codebase does not compile at this commit alone because
other TUIs still reference the tc struct. The full build is
restored in commit 4 of this PR (migration of remaining TUIs and
deletion of legacy palettes). Treat this PR as one atomic change.
Fixes#125
Doctor was passing all discovered agents (including those disabled
via .agentignore) to the agent target drift check, inflating the
expected count. This caused false drift warnings like '33/66 agents
linked' when the 33 missing agents were actually ignored.
Filter with resource.ActiveAgents() before passing to
checkAgentTargetInline, matching the pattern used by sync and
all server handlers.
- diff_agents: detect symlink drift, local copy blocking, fix prune count
- sync_agents: continue to prune targets when source has no agents
instead of returning early, matching skills behavior
- Add audit.CrossSkillResultName constant, use in Go + TS
- Merge toAuditInputs/toAgentAuditInputs into one with isFile param
- Extract discoverForKind() and toInputsForKind() to eliminate 5+ if-else branches
- Simplify launchAuditTUIWithTabs with otherKindFilter dispatch
- Use CROSS_SKILL_NAME constant in AuditPage.tsx
Set RepoName from parent directory for nested agents so
buildGroupedItems creates proper group headers (e.g. demo (27))
instead of putting all agents under standalone.