Replace cfg *config.Config with sourcePath string in updateTrackedRepo and
updateRegularSkill. Add projectRoot param for mode-aware audit scanning.
Delete updateSingleProjectSkill and updateProjectTrackedRepo from
update_project.go — project mode now uses the same shared handlers.
All three duplicated 3-phase batch loops (tracked repos → grouped skills →
standalone skills) are now unified through executeBatchUpdate(). This
eliminates the local `target` struct in updateAllProjectSkills and ~160
lines of duplicated orchestration code.
Add updateContext struct with mode-aware auditScanFn() and makeInstallOpts().
Unify updateTrackedRepoQuick (add scanFn param) and updateSkillFromMeta
(accept InstallOptions) between global/project modes. Delete
updateProjectTrackedRepoQuick and updateProjectSkillFromMeta.
Delete parseProjectInstallArgs (identical copy) and projectInstallArgs type
from install_project.go. Both modes now share parseInstallArgs. The "no source
→ reject flags" check moved from parser to cmdInstall caller. Project mode
gains --audit-verbose support for free.
Move ~360 lines of skill selection UI functions (promptMultiSelect,
promptLargeRepoSelection, fuzzy filtering, etc.) to a dedicated file.
Pure structural move with no behavior changes.
Move ~820 lines of audit-related types, vars, and 30 functions from the
2608-line install.go monolith into a dedicated file. Pure structural move
with no behavior changes — same package, identical signatures.
Return sizeBytes (int64) instead of sizeMB (float64) from backup API
so the frontend controls display formatting. CLI backup commands now
use the existing formatBytes() helper for human-friendly output.
Extract duplicate formatSize() from CollectPage and TrashPage into
shared ui/src/lib/format.ts utility.
On TTY, `skillshare log` now launches a bubbletea TUI (same pattern as
`list`) with fuzzy filtering by timestamp/command/status/source/detail,
keyboard navigation, and a colorized detail panel showing structured
args per entry. Operations and audit entries are merged and sorted by
time in the combined view.
Also refactors the 979-line log.go into three focused files:
- log.go (303) — entry, dispatch, help
- log_format.go (495) — data→string conversion, logArg* helpers
- log_render.go (189) — TTY/non-TTY terminal output
Other changes:
- --no-tui flag to skip TUI and print plain text
- Shared applyTUIFilterStyle() for cyan filter cursor in both TUIs
- Update website docs and built-in skill references
Allow users to trigger audit, update, or uninstall directly from
the interactive list TUI via Shift-key shortcuts (A/U/X), avoiding
the need to exit and manually type commands.
Replace basic text output with bubbletea-based interactive TUI for the
list command. Falls back to plain text with --no-tui or non-TTY output.
- Bubbletea TUI: fuzzy filtering, keyboard navigation, detail panel
- Detail panel: description (SKILL.md), disk path, files, synced targets
- Search: `skillshare list <pattern>` filters by name/path/source
- Filter: `--type git|local` to filter by installation type
- Sort: `--sort name|date|type` with mode-specific defaults
- JSON: `--json` for CI/scripting consumption
- Pager: less/more wrapper for --no-tui plain text output
- 29 integration tests covering all new functionality
UpdateSkillsFromRepo was using filepath.Join(sourceDir, meta.Subdir) to
derive the local destination, but meta.Subdir is the repo-internal path
(e.g. "skills/foo") which may differ from the local install path ("foo/").
This created leaked copies at sourceDir/skills/foo/ alongside the correct
sourceDir/foo/, doubling the skill count on subsequent scans.
Change skillTargets from []string to map[string]string where key is the
repo subdir (for discovery lookup) and value is the local absolute path
(provided by the caller who already knows where the skill is installed).
Grouped skills batch path calls UpdateSkillsFromRepo which clones the
repo via DiscoverFromGitWithProgress — but OnProgress was nil so the
progress bar froze during clone then jumped on completion.
Wire OnProgress callback to forward git transfer lines into the
progress bar title, and add a 50ms render delay in the inner per-skill
loop so pterm can flush each step to the terminal. Both guarded by
IsTTY() to avoid overhead in CI/pipe contexts.
Remove hardcoded preferredModeHintTargets list that only suggested copy
mode for specific targets (cursor, antigravity, copilot, opencode).
Instead, show a generic symlink compatibility hint whenever any target
uses merge or symlink mode — guiding users to switch to copy mode if
their tool cannot read symlinked skills.
standardized the command-line interface to ensure professional visual
consistency, accurate path reporting, and synchronized audit logic across
all modes.
Visual and UX Enhancements:
- Adaptive Skill Cards: Redesigned the bulky summary box into a compact card
that correctly reports relative installation paths and handles missing
descriptions with fallback messaging.
- Connected Hierarchical Trees: Implemented a standardized tree layout
(StepStart, StepContinue, StepResult) for all single-item tasks, integrating
success status and execution duration as final nodes.
- Intelligent Audit UI: Optimized 'Audit Findings' headers to perfectly align
with risk results, ensuring no empty sections appear on CLEAN results.
- Ephemeral Progress Tracking: Configured spinners to auto-indent within the
hierarchical structure and disappear completely upon completion to maintain
clean terminal logs.
Logic and Reliability Fixes:
- Path Parity: Fixed a bug where the '--into' flag was not accurately
reflected in the UI cards during installation.
- Audit Completeness: Restored missing security scans for certain Git-based
installation paths.
- Code Parity: Unified recursive discovery and display logic between Global
and Project update modes.
Validation:
- Successfully verified with 'make check' (all 150+ unit and integration
tests passing).
Refactor updateAllProjectSkills to use filepath.Walk, ensuring nested
skills (e.g. 'frontend/react-best-practices') are correctly discovered
and updated.
Changes:
- Discovery: Implement recursive scanning for both tracked repos and
regular skills with metadata.
- Logic: Unified target collection ensures consistent counting and
execution between single and batch update paths.
- Test: Sync TestSkillshareWrapper_ProjectModeRedirectsFromWorkspaceRoot
to match the updated redirection message.
- Validation: Verified with 'make check' (all unit and integration
tests passing).
Batch update (>1 target) now always uses a progress bar with the
current skill name displayed, replacing per-item spinners that
produced excessive output. Audit results are collected during the
batch and summarised after the progress bar completes.
Also adds UpdateTitle to install's progress bar loop so large
batch installs show which skill is being processed.
Clarify audit blocking output for tracked repository installs and updates.
Changes:
- update tracked install audit block errors to state findings were detected in tracked repository
- update tracked update audit block and rollback messages with tracked repository context
- when tracked install is blocked by audit, show spinner state as Blocked by security audit instead of Failed to clone
- enhance blocked audit summary rendering to append in tracked repository when the error context indicates a tracked repo
- add unit test coverage for tracked repository context in blocked audit rendering
Verification:
- go test ./cmd/skillshare ./internal/install -count=1
- go build -o bin/skillshare ./cmd/skillshare && SKILLSHARE_TEST_BINARY=/Users/williehung/Developer/Apps/github/skillshare/bin/skillshare go test ./tests/integration -run TestInstall_Track_BlocksCritical -count=1
Implement remaining Issue 46 optimizations and developer experience fixes.
Install and update optimization:
- optimize install --track for subdirectory sources by attempting sparse checkout first while preserving git metadata
- fallback to existing tracked clone strategy on sparse capability or sparse path errors
- clean sparse created destination before fallback clone to avoid destination already exists failures
- improve tracked install spinner wording for subdir sources
- add tracked subdir unit tests for sparse success and sparse to full clone fallback
Progress user experience:
- normalize git progress lines by stripping volatile transfer rate suffix
- dedupe and throttle spinner and tree spinner update frequency to reduce tty flicker
- add unit tests for spinner progress normalization and throttling behavior
GitHub API messaging:
- improve rate limit guidance to suggest setting token env vars or using gh auth login
Devcontainer isolation:
- make ssenv enter command mode run from isolated environment cwd
- fix setup global init detection to use skillshare status global mode
- add auto mode hint in devcontainer wrapper when workspace project config takes precedence
E2E and tests:
- expand Issue 46 runbook with install, install track, update, no token fallback, sparse paths, and isolation checks
- update compact warning output test expectations to match current grouped warning rendering
Verification:
- go test internal install package
- go test internal install sparse and tracked subdir tests
- go test internal ui package
- go test cmd skillshare package
- go build skillshare binary and run integration TestInstall_Subdir
- run tracked subdir tests inside devcontainer
Implement Issue #46 across install/update paths to reduce perceived hangs and improve subdir installation performance on large repositories.
Main changes:
- Add git progress streaming primitives in internal/install/git_progress.go.
- runGitCommandWithProgress supports stderr streaming callbacks in TTY mode.
- scanGitProgress handles both CR and LF progress delimiters.
- Thread InstallOptions.OnProgress through clone/pull/discovery/install/update paths.
- Keep non-TTY behavior quiet to avoid noisy logs.
- Add TreeSpinner.Update for live message updates.
- Add progress-aware git update APIs in internal/git/info.go:
- PullWithProgress and ForcePullWithProgress (keep PullWithEnv/ForcePullWithEnv for compatibility).
- Introduce shared GitHub client utilities in internal/github/client.go.
- Centralize token lookup, request construction, and rate-limit handling.
- Refactor internal/search/search.go to use shared client while preserving compatibility aliases.
- Add GitHub/GHE API subdir fast path in internal/install/github_download.go.
- github.com => api.github.com
- github-like enterprise hosts => https://<host>/api/v3
- On API failure, emit warning and fallback to git-based flows.
- Add sparse checkout fallback for non-GitHub subdir sources in internal/install/sparse_checkout.go.
- Use filter+no-checkout+depth=1 then sparse-checkout set + checkout.
- Extend discovery/install metadata plumbing.
- DiscoveryResult now includes CommitHash and Warnings.
- install/discover subdir paths preserve warnings and commit hashes from API/sparse/full-clone flows.
- Preserve compatibility and UX expectations.
- Keep existing action strings (for tests/UI stability).
- Keep legacy discover/pull APIs as wrappers around new progress-aware variants.
- Improve --track download efficiency.
- Track clone now attempts --filter=blob:none --depth 1 --single-branch first.
- Falls back to full clone only on remote capability mismatch, not on auth/not-found errors.
CLI wiring:
- cmd/skillshare/install.go
- TTY handlers now pass progress callbacks and use with-progress discover APIs.
- Subdir handler shows API-vs-clone stage messages and renders discovery fallback warnings.
- cmd/skillshare/update.go and cmd/skillshare/update_project.go
- Use PullWithProgress/ForcePullWithProgress for tracked repos.
- Ensure reinstall/update install flows forward progress callbacks.
Tests added/updated:
- internal/install/git_progress_test.go
- internal/install/github_download_test.go
- internal/install/sparse_checkout_test.go
- internal/install/tracked_clone_test.go
- internal/install/source_test.go (GitHubOwner/GitHubRepo coverage)
- internal/git/info_test.go (PullWithProgress/ForcePullWithProgress)
- tests/integration/install_subdir_optimization_test.go
- tests/integration/install_online_test.go (GitHub API subdir case)
Validation performed:
- go test ./internal/install -count=1
- go test ./internal/git -run 'Test.*Pull.*' -count=1
- go build -o bin/skillshare ./cmd/skillshare && SKILLSHARE_TEST_BINARY="/Users/williehung/Developer/Apps/github/skillshare/bin/skillshare" go test ./tests/integration -run 'TestInstall_Subdir|TestUpdate_' -count=1
- go build -o bin/skillshare ./cmd/skillshare && SKILLSHARE_TEST_BINARY="/Users/williehung/Developer/Apps/github/skillshare/bin/skillshare" go test ./tests/integration -run 'TestInstall_Track_|TestUpdate_TrackedRepo' -count=1
- go test -tags online ./tests/integration -run TestInstall_GitHubSubdirViaAPI -count=1
- make lint
- make test
MatchesTargetName now falls back to path comparison when name-based
matching fails, so targets sharing the same project_path (e.g. codex
and universal both using .agents/skills) correctly match in
FilterSkillsByTarget.
PruneOrphanLinks records user-created directories in LocalDirs instead
of emitting misleading "unknown directory" warnings, and syncMergeMode
counts them toward the local skill total.
Single-item paths (tracked repo, regular skill) now use StepStart/StepContinue
for a flowing style consistent with install. Batch paths use ui.Header for a
simple one-line title. HeaderBox is retained only for audit and log commands
where a bordered report frame is appropriate.
- Rewrite renderInstallWarnings with summary-first layout: counts + threshold status on top
- Group duplicate findings by (severity, message), show "× N" with locations
- Strip redundant "audit " prefix under Audit Findings section
- Show compact top-5 groups by default, full list with --audit-verbose
- Add renderAuditRiskOnly for batch mode (just risk score)
- Wire update single-item/batch paths (global + project) to shared renderers
- Remove renderUpdateAuditResult (all callers migrated)
- Update test assertions for new output format
Replace fmt.Println() separators with ui.SectionLabel("Next Steps") in
single-item handlers across update, update_project, install (config-based),
install_project, uninstall, uninstall_project, and trash restore. This
completes the unified SectionLabel pattern across all command output paths.
Remove the useSections (len > 10) gate from all batch result display
functions across install, update, update_project, uninstall, and
uninstall_project. SectionLabel is now always shown regardless of
result count, ensuring consistent visual structure for small batches
(e.g. --skill selecting 1 item from a multi-skill repo).
Add ui.SectionLabel("Next Steps") before next-steps info in all 4 single-item
install handlers (tracked repo, git discovery, git subdir, direct) to align
with the batch install / update / uninstall UI pattern.
Intercept audit.ErrBlocked in single-item handlers and display structured output
(SectionLabel + StepFail + detail lines) instead of dumping the raw error. The
returned error is now a short one-liner so main.go prints a clean summary.
- Global update: use SectionLabel for Summary/Next Steps when >10 skills
- Project batch update: add HeaderBox, track skipped count, show
summary box with updated/skipped/security-failed/total counts
Support bulk uninstall via 'skillshare uninstall --all' in both global
and project modes. Uses glob-based discovery to find all skills and
tracked repos, with --dry-run preview and --force to skip confirmation.
- Parse --all with mutual exclusion vs skill names and --group
- Global: discover skills + tracked repos from source directory
- Project: discover from .skillshare/skills/ directory
- Prune orphan symlinks from targets after removal
- Integration tests for --all, --all --dry-run, and conflict errors
- Update uninstall docs with --all examples
- Add AI runbook for uninstall --all glob testing
Large repos (900+ skills) produced overwhelming output in three areas:
1. Dry-run skill list: 4 loops replaced with printSkillListCompact()
- ≤20: show all (unchanged); >20: first 10 + "... and N more"
2. --audit-verbose batch warnings (displayInstallResults):
- ≤20 skills with warnings: full verbose (unchanged)
- >20: compact summary + HIGH/CRITICAL findings only from top 20
skills; LOW/MEDIUM/INFO summarized as "also: LOW=N"
3. --audit-verbose blocked failures:
- ≤20 blocked: full message (unchanged)
- >20: first 20 verbose, rest compact
New helpers: printSkillListCompact, renderInstallWarningsHighCriticalOnly,
sortResultsByHighCritical, countSkillsWithWarnings, hasHighCriticalWarnings.
- Extend .skillshare-manifest.json tracking from copy mode to merge mode.
- Update PruneOrphanLinks to prioritize manifest records over naming patterns.
- Ensure SyncTargetMerge writes to manifest for all linked/updated skills.
- Add integration tests for uninstall + sync orphan directory cleanup.
- Maintain backward compatibility for targets without existing manifests.
Closes#42
Some AI CLIs (Cursor, Antigravity, Copilot, OpenCode) skip symlinks
when scanning skill directories, causing symlinked skills to be
silently ignored during auto-discovery.
Changes:
- `init --mode <merge|copy|symlink>` / `-m`: set default sync mode at
init time (global and project); interactive prompt when TTY detected
- `init --discover --mode`: applies mode only to newly added targets,
leaving existing targets unchanged
- Per-target mode hint after `sync` and `doctor`: suggests `copy` for
known compatibility-sensitive targets (cursor → antigravity →
copilot → opencode); suppressed when only claude/codex configured
- Neutral decision matrix in sync-modes.md for constraint-based choice
- By-target override examples in target.md, sync.md, first-sync.md
- Integration tests for mode flag, discover+mode, hint presence/absence
InstallTrackedRepo and updateTrackedRepo had no security audit,
allowing --track to bypass all supply-chain checks. This adds
auditTrackedRepo (removes repo on block for fresh installs) and
auditTrackedRepoUpdate (git reset rollback for updates), plus
input validation, testable removeAll, and hardened error handling
across audit/install/uninstall paths.
Merge auditGateAfterPull and auditGateAfterPullProject into a single
function by accepting an auditScanFunc callback. Callers pass either
audit.ScanSkill directly or a closure capturing projectRoot for
project-mode scans. Removes ~50 lines of duplicated security logic.
Addresses PR #43 review feedback (code duplication in audit gate).
Regular skills (non-git, metadata-based) now support --diff flag using
hash-based file comparison, display audit results after update, and
properly enforce the audit gate by not passing Force to inner Install.
- cmd/skillshare/update_test.go: table-driven test covering all
isSecurityError keywords (security audit, post-update audit,
rolled back, rollback failed) and negative cases
- internal/server/handler_update_test.go: three tests for
auditGateTrackedRepo: rollback failure warning on HIGH findings,
rollback failure warning on scan error, and clean repo returns nil
- handler_update.go: check git.ResetHard return value; if rollback
fails, append explicit warning to blocked message instead of
silently claiming rolled back
- update.go: add "post-update audit" to isSecurityError keywords
so install.Install audit failures are correctly classified as
security blocks in batch exit code
When a group directory (e.g. `fix-review`) was uninstalled as a whole,
only the directory name was checked against config entries. But skills
in the manifest use FullName format (`group/skill`), so the exact match
never hit. Now uses prefix matching to also remove member skill entries.
- P1: Batch/all update now returns non-zero when repos are blocked by
security audit (fail-closed for CI pipelines)
- P2: Pass --skip-audit to regular skill update via InstallOptions
- P2: Add path containment check in content integrity to prevent
directory traversal via crafted file_hashes keys
- P3: Switch git diff parsing to NUL-delimited (-z) for safe handling
of special filenames
Supply-chain hardening Phase 2:
- Add post-pull audit gate: HIGH/CRITICAL findings auto-rollback in
non-interactive mode (fail-closed), prompt in TTY mode
- Use full 40-char commit hashes for reliable rollback (avoids short-hash ambiguity)
- Add --skip-audit flag to bypass the gate when risk is accepted
- Add --diff flag to show file-level change summary after tracked repo update
- Add GetChangedFiles() and ResetHard() git helpers
- Add audit gate in install --update git-pull path to prevent bypass
Supply-chain hardening Phase 1:
- Add source-repository-link-0 rule (HIGH) to detect [source repository](url) patterns
- Exclude source-repo labels from external-link-0 to prevent double-reporting
- Introduce risk floor: RiskLabel = max(score-label, severity-floor) so a
single HIGH finding produces "high" risk instead of "low"
- Apply severity floor to CLI summary, server API summary, and per-result risk