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.
auditRepoKey now groups any nested path (e.g. demo/code-reviewer.md)
by its first segment, not just tracked repo prefixes starting with _.
This gives agents the same directory grouping as the Resources page.
Project mode was missing agentsSourcePath assignment, causing
Agents(0) in TUI even when agents exist. Also simplifies the
kind-based source selection to use the existing override at line 217.
Agents are individual .md files discovered by resource.AgentKind{}.Discover(),
but audit was using collectInstalledSkillPaths() which calls
sync.DiscoverSourceSkillsLite() — designed for skill directories. Then
ParallelScan() called ScanSkill() which expects directories, not files.
Changes:
- Add IsFile flag to audit.SkillInput; when set, ParallelScan uses
ScanFile/ScanFileForProject instead of ScanSkill variants
- Add collectInstalledAgentPaths() using resource.AgentKind{}.Discover()
and resource.ActiveAgents() for proper agent file discovery
- Add toAgentAuditInputs() helper that sets IsFile=true
- Branch on kindAgents in auditInstalled(), auditFiltered(), and
launchAuditTUIWithTabs() to use agent-specific discovery and inputs
- Add discoverAuditAgents() in server handler and update
resolveAuditSource() to return isAgents flag
- Update handleAuditAll, handleAuditStream to use agent-aware discovery
and build SkillInput with IsFile=true for agents
Two-tab TUI following list_tui.go pattern. Tab/Shift+Tab cycles
between Skills and Agents tabs. Initial tab matches CLI argument.
Secondary kind scanned lazily when TUI launches via auditTUIContext.
Also adds agentsSourcePath param to auditInstalled/auditFiltered
and launchAuditTUIWithTabs helper for dual-kind scanning.
Thread kind parameter through auditInstalled, auditFiltered, and
auditSkillByName. All output text now uses Noun() for correct
skill(s)/agent(s) display. Set Result.Kind on all scan results.
Also update audit_project.go callers to pass kindSkills.
- audit.Result gains a Kind string field ("skill"|"agent", set by caller)
so callers can tag results for display without touching the scan engine
- resourceKindFilter gets Noun(count) and SingularNoun() helpers to produce
correct singular/plural display nouns per resource type
- audit command switches from parseKindArgWithAll to parseKindArg, dropping
the --all flag and its two help-text lines; agents subcommand is the way
to target agents explicitly
Without the explicit -g flag, cmdSyncExtras falls back to auto-detection
which picks project mode when cwd contains .skillshare/config.yaml,
causing 'sync --all -g' to display project extras messages instead of
global ones. Mirrors the project-mode path that already passes -p.
Backend:
- PATCH /api/targets/:name accepts agent_include/agent_exclude fields
- POST /api/sync-matrix/preview returns agent entries with kind=agent
- GET /api/overview returns agentsSource and extrasSource paths
- Fix ResolveProjectTargets to resolve Agents sub-key (path + filters)
- Add agent filter CLI flags: --add-agent-include, --add-agent-exclude,
--remove-agent-include, --remove-agent-exclude, --agent-mode
- Unify target list JSON/TUI to show agent info and filters
Frontend:
- FilterStudioPage: kind-driven single-context view (?kind=skill|agent)
- KindBadge: use design system tokens (ss-badge + wobble in playful)
- TargetsPage: link to Filter Studio with ?kind= param
- ResourceDetailPage: capitalize type labels (Local, GitHub)
- ResourcesPage: sync activeTab from URL searchParams on navigation
- DashboardPage: show agents/extras source dirs, link skills card
with ?tab=skills for reliable tab switching
- API client: extend updateTarget and previewSyncMatrix for agent filters
Tests:
- Agent include/exclude round-trip persistence
- Invalid agent pattern returns 400
- Preview with agent entries and kind field
- No agent entries for targets without agent path
- CLI target agent filter integration tests
Add agent auto backup to syncAgentsGlobal and syncAgentsProject so that
agent targets are backed up before destructive sync operations, matching
the existing auto backup behavior for skills.
Previously only 'skillshare sync' (skills path) and 'target remove'
had auto backup for agents (added in 693f75cc). The agent-only sync
paths ('skillshare sync agents' and 'skillshare sync agents -p') had
no auto backup at all.
Extract resolveAgentBackupPath() in restore_tui.go to replace 3 identical
inline agent path resolution blocks (~30 lines removed). The new helper
delegates to the canonical resolveAgentTargetPath() with builtin fallback.
Add agent directory backup before sync (backupTargetsBeforeSync) and
before target removal (backupTargets) so agent data is preserved alongside
skill backups. Extract resolveGlobalAgentBackupContextFromCfg to avoid
redundant config.Load() when config is already available.
Split status word from detail in displayTargetStatus. Only the status
word (merged/drift/linked) gets color, detail text uses dim. Reduces
the "wall of green" effect in doctor output.
Agents always use merge mode (symlink-per-file). Add [merge] prefix to
agent sub-item detail in status and doctor for consistency with skills.
Also refactor doctor displayTargetStatus to use sub-item format
(target name as header, skills/agents as indented sub-items).
Combine "source exists" and "targets reachable" into one line:
✓ rules: 4 files, 1/1 targets OK
Only show target details when there are unreachable targets.
Move agent target checks from standalone "Checking environment" output
into the "Checking targets" section as indented sub-items under each
target, matching the unified layout from status.
Also fix project mode doctor using wrong agents source path
(was falling back to global instead of project .skillshare/agents/).
Restructure status command output for both -g and -p modes:
- Remove "(project)" suffix from all section headers (logo already shows it)
- Merge agents source info into Source section alongside skills
- Show agents as sub-items under each target instead of a separate section
- Remove standalone printAgentStatus/printProjectAgentStatus (dead code)
- Simplify cmdStatus: remove kind parameter since status always shows all
- JSON output unchanged (backward compatible)
- Switch delegate to single-line mode (showDesc: false) with ▌ prefix bar
- Merge description info into Title() for both target and extra items
- Add ─ Targets (N) ── and ─ Extras (N) ── group headers with counts
- Add spacer row between Targets and Extras sections
- Skip separator on initial selection and filter reset
- Update status test to reflect always-show-both behavior
Remove kind filter (agents/--all) from status command — it now defaults
to showing everything, matching diff behavior. Status is a read-only
overview command; users expect the full picture without extra flags.
- Remove parseKindArgWithAll from cmdStatus, hardcode kindAll
- Update help text and usage examples
- Simplify tests: merge agents/all variants into default tests
- Update runbook steps 9-11 → 9-10
Migrate from "ss list all" syntax to "ss list --all" across all commands
that support kind filtering (list, sync, status, check, audit, backup,
restore, trash).
- Remove "all" as a recognized positional keyword in parseKindArg
- Add extractAllFlag and parseKindArgWithAll helpers
- Update help text, usage examples, and runbook
- Update all integration tests to use --all flag
- Accept trashBase parameter in cmdUninstallAgents instead of
hardcoding AgentTrashDir(), enabling correct project vs global
trash routing from all call sites
- Use displayName (not internal t.Name) when trashing agents
- Sort list by RelPath instead of Name so grouped skills stay together
- Update printUsage to reflect agent support across commands
(list, sync, check, update, diff, collect, trash, audit)
Align agent target naming with the skills-style __ flattening so nested agents do not collide by basename in flat agent directories. Add unit and project-mode integration coverage to verify repeated syncs stay stable and no longer report false updates.
Extract resolveProjectPath() helper to centralize ~ expansion and
relative-to-project-root resolution. Fixes extras sync and agent
target path resolution in project mode when paths are relative.
Add integration tests for sync --all agents/extras overlap detection
in both global and project modes.
In the All (resources) tab:
- Show [S] prefix for skills and [A] prefix for agents
- Group items by kind: skills first, agents second
- Each kind block preserves original repo grouping with
kind-prefixed headers (e.g. 'Skills · standalone')
In Skills/Agents tabs: no prefix shown (context is clear).
Detail panel now shows 'Skill' or 'Agent' kind label in the
status bits alongside remote/local/tracked.
Spinner message is now tab-aware: 'Loading resources/skills/agents'.
Implementation uses a shared *listTab pointer between the model
and delegate so the delegate reads current tab state without
needing SetDelegate() on every tab switch.
Production code no longer reads or writes .skillshare-meta.json sidecars:
- InstallAgentFromDiscovery: write to centralized store via WriteMetaToStore
- agent_check.go: read from centralized store passed as parameter
- handler_skills.go: read agents from s.agentsStore
- audit.go: readMetaFileHashes reads from parent .metadata.json
- analyzer_metadata.go: extract findMetaEntry to deduplicate walk logic
- uninstall_agents.go: remove entry from centralized store on uninstall
- batchUpdateAgents: pass store to reinstallAgent, remove dead field
- Replace LoadMetadata+nil guard with LoadMetadataOrNew across 6 files
reinstallAgent previously called install.Install() which expects
directory-based skill installation. Agent sources point to .md files,
so the subdir resolver rejected them.
Now uses DiscoverFromGit/DiscoverFromGitSubdir + InstallAgentFromDiscovery
which correctly handles single-file agent copies. Also preserves the
original repo subdir scope for monorepo installs and reconstructs the
correct destination subdirectory for grouped agents.
All call sites that looked up metadata entries using filepath.Base()
now use store.GetByPath(relPath) which handles both full-path keys
and legacy basename+group keys transparently.
Also fixes makeInstallOpts() to set SourceDir from updateContext,
preventing nested skill updates from writing metadata to wrong dir.
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
- Dual-write in WriteMeta: also writes to .metadata.json for backward compat
- Migration looks in parent dir for registry.yaml
- Group uninstall matches entries by Group field + full path
- Sync test uses MetadataStore instead of registry.yaml
- All integration tests pass (0 FAIL)
Replace every remaining call to the old per-skill metadata API
(ReadMeta, RefreshMetaHashes, config.LoadRegistry) with the centralized
MetadataStore across 10 files:
Server handlers:
- handler_check.go: use s.skillsStore.Get() instead of ReadMeta
- handler_check_stream.go: same pattern as handler_check.go
- handler_skills_batch.go: use s.skillsStore.RefreshHashes() + Save()
CLI commands:
- check.go: load store once in collectCheckItems, use MetadataEntry
- doctor.go: load store once in checkSkillIntegrity
- list.go: load store once in buildSkillEntries (replaces parallel ReadMeta)
- uninstall.go: use skillsStore for display/dry-run/finalize
- uninstall_project.go: same pattern, remove config.LoadRegistry
- update_batch.go: pruneRegistry now uses MetadataStore
Hub:
- hub/index.go: load store once in BuildIndex
The only remaining ReadMeta call is in a test file
(search_batch_meta_roundtrip_test.go) which tests the shim itself.