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.
Move 5 skills from .claude/commands/ to .skillshare/skills/ so contributors
can share them via `skillshare sync -p`. Each skill has clear responsibility:
- cli-e2e-test: run isolated E2E tests in devcontainer
- codebase-audit: read-only cross-validation of code/docs/tests
- implement-feature: TDD workflow with E2E runbook generation
- update-docs: sync website docs with code changes
- changelog: generate CHANGELOG entries (RELEASE_NOTES maintainer-only)
Also:
- .gitignore: allow .skillshare/skills/, config.yaml, .gitignore to be tracked
- .skillignore: block .skillshare/skills/* from external install discovery
- ai_docs/tests/README.md: content merged into cli-e2e-test skill
Update CHANGELOG.md and RELEASE_NOTES_0.15.5.md with user-visible
changes from recent commits: uninstall --all flag, compact grouped
audit findings, structured SectionLabel output, and MultiSelect
filter text fix.
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
- SectionLabel(): dim section headers for visual grouping in batch output
- StepFail(): preserve pre-styled ANSI labels instead of double-wrapping
- Spinner Success/Warn: skip elapsed suffix when <50ms (avoids noise in tests)
- InstallOptions.AuditVerbose field for --audit-verbose flag plumbing
- Update install integration test assertions for batch compact format
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.
New guide covering 5 principles for writing reliable skills:
determinism first, CLI wrapper pattern, progressive disclosure,
risk-matched complexity, and interface-first design. Draws from
Peter Steinberger's CLI-first practices and Pahud Hsieh's
"SKILL + single binary CLI" paradigm.
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
Improve block/risk/severity display in the audit page:
- Stats grid: color-coded backgrounds, zero-value muting with opacity
- Triage panel: structured 3-column layout with mini progress bar
- SkillAuditCard: BlockStamp (red tilted stamp vs green pass pill)
and RiskMeter (dashed box with horizontal bar + score)
- FindingRow: left border severity stripe, code snippets as torn
paper notes with wobbly borders and slight rotation
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.
Replace simple regex-based markdown link extraction with a full
structural parser that handles inline links with titles, autolinks,
reference-style links, HTML anchors, multiline links, and correctly
skips code fences, inline code spans, and image links.
This ensures external-link and source-repository-link audit rules
match all Markdown link syntax variants while avoiding false positives
from code examples and images.
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).
--diff works for both tracked repos (git diff) and regular skills (hash
comparison) but docs only mentioned tracked repos. Also document the
audit risk score display in CLI/Web UI after updates, and add missing
flags (--diff, --skip-audit, --group) to built-in skill reference.
Air installed via `go install` lands in GOPATH/bin, not GOROOT/bin.
Resolve the path dynamically with fallback auto-install. Also replace
deprecated `bin` with `entrypoint` in .air.toml.
test-redteam-signal verifies the red team suite detects intentional
code mutations. test-redteam-rules-signal verifies it fails when
critical builtin audit rules are disabled.
Return auditRiskScore and auditRiskLabel in update results so the
dashboard can show security posture after both tracked-repo and
regular-skill updates. auditGateTrackedRepo now returns the audit
result alongside the blocked indicator.
Air needs time to compile before the server is ready. Add a
wait-for-port loop (max 30s) so the dashboard URL is only shown
after the API is actually listening.
For project mode, use SKILLSHARE_UI_EXEC_PREFIX to cd into the
project directory before exec'ing the binary, since skillshare ui -p
relies on os.Getwd() and air must build from /workspace.
Air watches cmd/ and internal/ for .go changes and auto-rebuilds.
Uses env vars (SKILLSHARE_UI_HOST, SKILLSHARE_UI_FLAGS) so the same
config works for both local dev and devcontainer.
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