pterm's cursor package writes hide/show ANSI codes (\x1b[?25l/h)
directly to os.Stdout, bypassing WithWriter(). The previous fix
(SetProgressWriter to stderr) was insufficient because pterm still
created progress bar objects that triggered cursor.Hide()/Show().
Add SuppressProgressToStderr() which both redirects ProgressWriter
and forces isProgressTTY() to return false, preventing pterm
components from being instantiated at all. Extract assertNoANSI
test helper and cover all three structured formats (JSON, SARIF,
Markdown).
Also update pre-commit E2E runbook with steps 10-11 (framework
integration tests) and add pre-commit-hook recipe to sidebar.
Replace nested pair-checking loop with set-based approach:
- Single pass builds capability sets (credReaders, netSenders, etc.)
- Each rule checks non-empty sets → one summary finding per rule
- 100k skills: ~15ms vs ~30s+ (benchmark included)
- Use DiscoverSourceSkillsLite for audit discovery (skip frontmatter)
- Use patternDataflowTaint constant instead of raw string
Previously the audit TUI "/" filter only matched skill names. Now it
also searches risk label, status (blocked/warning/clean), max severity,
finding pattern names, and finding file names — making it easy to narrow
down results like `/critical`, `/exec-command`, or `/blocked`.
P1: SARIF startLine=0 is invalid per spec — GitHub Code Scanning rejects
it. Use *sarifRegion pointer with omitempty so findings without line
numbers (tier, cross-skill, analyzability, content-integrity) produce
valid SARIF output without a region field.
P2: Server audit endpoint (handleAuditAll) now calls CrossSkillAnalysis
after collecting results, matching CLI behavior. Previously the API
returned only per-skill findings without cross-skill interaction checks.
Also guard fmt.Println() in auditFiltered() for structured output
consistency (same fix as auditInstalled in previous commit).
Two issues caused red team test failures after --format flag introduction:
1. ss_capture helper merged stderr into stdout (2>&1), so the --json
deprecation warning poisoned JSON parsing by jq. Fix: capture stderr
to a temp file separately from stdout.
2. Two unguarded fmt.Println() calls in auditInstalled() printed blank
lines to stdout even in JSON/SARIF/markdown mode. Fix: wrap in
if !jsonOutput guard.
Also migrate all 39 --json invocations in red team tests to --format json
since --json is deprecated.
- Add --format markdown for self-contained audit reports (GitHub Issues/PRs)
- Simplify pterm box rendering: replace DefaultBox with separator-line style
- Remove unused SkillBox, SummaryBox, SkillDisplay, wrapText helpers
- Color Box titles cyan (consistent with HeaderBox)
- Add breathing room: blank lines around progress bar and after summary
- Show "skillshare audit (project)" header title in project mode
- Append elapsed time to cross-skill synthetic results to fix slice mismatch
Two individually harmless skills can form an attack chain when installed
together (e.g., one reads credentials, another has network access).
After per-skill scans complete, the audit engine now extracts a capability
profile from each Result and checks for dangerous cross-skill combinations:
- cross-skill-exfiltration (HIGH): credential reader + network sender
- cross-skill-privilege-network (MEDIUM): privilege commands + network
- cross-skill-stealth (HIGH): stealth skill alongside high-risk skill
Rules only fire for complementary pairs (each skill lacks the other's
capability) to avoid duplicating per-skill findings. Results appear as
synthetic "_cross-skill" entry in all output formats (text, JSON, SARIF, TUI).
Classify every shell command in skill files into 6 behavioral tiers
(read-only, mutating, destructive, network, privilege, stealth) as an
orthogonal dimension to pattern-based severity. This lets audit report
"what kind of actions" a skill performs, not just "which known patterns
it matches."
- Add tier engine with 80+ command mappings and stealth regex patterns
- Detect tiers in scripts and Markdown fenced code blocks separately
- Generate combination findings: T2+T3→HIGH, T5→CRITICAL, T3>5→MEDIUM
- Display tier profile in CLI text, TUI detail panel, and JSON/API output
- Exclude .skillshare-meta.json from totalBytes to fix analyzability ratio
- Document tier definitions, profile output, and combination findings
Analyzability score measures what percentage of a skill's content is
auditable plaintext vs binary/non-scannable. Surfaces in CLI text
output, JSON, SARIF, and Web UI API responses.
- Add TotalBytes, AuditableBytes, Analyzability fields to audit.Result
- Emit INFO-level low-analyzability finding when score < 70%
- Show "Auditable: X%" in per-skill and summary text output
- Expose analyzability in server API (auditResultResponse + auditSummary)
- Add .pre-commit-hooks.yaml for pre-commit framework integration
- Add pre-commit hook recipe docs and audit.md cross-references
Previously --format json/sarif completely suppressed spinner and progress
bar, making the CLI appear frozen during long scans.
Now spinner/progress output is redirected to stderr via ProgressWriter,
so progress indicators remain visible while structured data stays clean
on stdout. This follows the Unix convention: data → stdout, diagnostics
→ stderr.
Also:
- Extract fileTTY() shared helper (DRY IsTTY + isProgressTTY)
- Add format constants (formatText/JSON/SARIF) and isStructured()
- Capture/restore previous ProgressWriter in defer (defensive)
- Add --format <text|json|sarif> flag to audit command
- Deprecate --json in favor of --format json (with stderr warning)
- SARIF output uses ToSARIF() from internal/audit/sarif.go
- Suppress UI (spinners, progress bars) for all structured outputs
- Update auditPath/auditSkillByName to accept format string
- Update help text with new flag and examples
- Add 3 integration tests: FormatSARIF, FormatJSON, JSONDeprecation
filepath.Walk/WalkDir silently skip symlinked root directories because
os.Lstat sees the root as a non-directory symlink and never enters it.
This affected update, uninstall, reconcile, and server handlers when
the source directory was a symlink (common with dotfiles managers).
Extract ResolveSymlink() from sync.go into internal/utils/path.go and
apply it at every filepath.Walk/WalkDir callsite on source/target dirs.
Also add containment guards to resolveGroupSkills (uninstall) and
resolveGroupUpdatable (update) to reject group directories that are
symlinks pointing outside the source tree.
Upgrade prompts ("Install built-in skill?" and "Upgrade to vX?")
left their input lines visible after the user responded, breaking
the tree-drawing structure. Add ui.ClearLines() to erase prompt
lines via ANSI cursor-up + clear-line, so StepEnd connects cleanly
to the preceding tree node. No-op on non-TTY.
When a target directory is an external symlink (e.g., dotfiles manager
pointing ~/.claude/skills/ elsewhere), sync previously deleted it
unconditionally during symlink→merge/copy mode conversion. This also
affected DiscoverSourceSkills which failed to traverse symlinked source
directories because filepath.Walk uses Lstat on root.
Changes:
- Add resolveWalkRoot() helper; use in both Discover functions so
filepath.Walk enters symlinked source directories
- Add isSymlinkToSource() to distinguish source-pointing symlinks
(symlink mode residue, safe to remove) from external symlinks
- Pass explicit sourcePath to SyncTargetMergeWithSkills and
SyncTargetCopyWithSkills for reliable symlink origin detection
- Fix FindLocalSkills to use utils.ResolveLinkTarget (handles relative
symlinks correctly) and follow external symlinks for scanning
- Fix CheckStatusMerge to follow external symlinks instead of returning
StatusConflict
- Add 17 unit tests and 6 integration tests covering symlinked source,
target, both, chained symlinks, idempotency, prune, and pull
os.ReadDir failure was silently ignored, causing otherTargets to be 0
and triggering removal of the entire timestamp directory instead of
just the target subdirectory. Now returns an error early.
Also adds diff TUI expand test from previous session.
- Add loading spinner while computing file diffs (prevents TUI freeze)
- Compute file diffs in parallel using sync.WaitGroup
- Support expanding "local only" and "remove" items (not just modify/add)
- Populate dstDir on remove/orphan items for file listing
- Relax ensureFiles to work with dstDir-only entries
- Add stale result guard when navigating during async load
Homebrew formula updates lag GitHub Releases by hours/days, causing
Homebrew users to see "update available" when `brew upgrade` says
already up-to-date. Now detect install method from executable path
and query `brew info --json=v2` for Homebrew installs instead of
the GitHub Release API.
- Add InstallMethod type with DetectInstallMethod() and
FetchBrewLatestVersion() in internal/version/homebrew.go
- Check() accepts InstallMethod to branch fetch strategy
- UpdateNotification() accepts upgradeCmd (shows correct command)
- UpgradeCommand() method on InstallMethod centralizes the mapping
- doctor.go reuses versioncheck.Check() (fixes semver string
comparison bug in old fetchUpdateMessage)
- Remove duplicated isHomebrewInstall() from upgrade.go
- Skip post-command version check for doctor (has its own)
- Remove duplicated RateLimitError, newGitHubRequest, newGitHubClient,
checkRateLimit from internal/version — now uses internal/github client,
which also fixes missing `gh auth token` fallback for version checks
- Add GH_TOKEN as fallback in install.resolveToken() for GitHub platform,
matching github.GetToken() resolution order (GITHUB_TOKEN → GH_TOKEN)
- Add GH_TOKEN to sanitizeTokens() redaction list
- Extract shared IsAuthError() in install/auth.go; push.go and
wrapGitError() both delegate to it (adds "Access denied" coverage)
- Consolidate shouldFallback*TrackedClone auth checks via isAuthOrAccessError()
- Thread single *http.Client through search.Search() and all callees,
reducing ~60 redundant TLS handshakes to connection-pooled reuse
- Pass *http.Client to downloadFile() instead of creating per-file clients
- Replace sourceHost() with extractHost() (same package, identical purpose)
- Remove unused isGitRepo() alias; callers use IsGitRepo() directly
- Extract shared formatDurationShort, truncateStr, renderHorizontalSplit,
tuiMinSplitWidth into tui_helpers.go; replace 5 truncate and 3 relative
time duplicates across cmd/skillshare with thin wrappers
- Remove duplicate applyRestoreDetailScroll from restore_tui.go
- Cache detail panel content in restore_tui.go and trash_tui.go to avoid
filesystem I/O (recursive walks, SKILL.md reads) on every bubbletea
render frame — recompute only on selection change or mutation
- Remove dead ListBackupVersions call in startDelete whose result was
discarded
- Extract shared applyDetailScroll into tui_helpers.go (was duplicated
across diff_tui.go, log_tui.go, audit_tui.go)
- Create utils.FileHash and utils.FileHashFormatted, replacing private
copies in install/meta.go and audit/audit.go
- Export install.MetaFileName constant, use from diff_file.go
- Replace double SHA-256 in fileContentsEqual with streaming byte compare
for early-exit efficiency
- Add 1MB size cap to generateUnifiedDiff to prevent performance issues
- Move noTUI into diffRenderOpts struct, simplifying function signatures
- Remove dead field diffTUIModel.results (never read)
- Replace hand-rolled countOccurrences with strings.Count
- Skip latestMtime() walk for merge mode (symlinks make it misleading)
- Fix ensureFiles() nil cache miss (return non-nil empty slice)
- Cache sorted items + categories in TUI model (avoid per-render recompute)
- Add expand state (Enter key toggle) for file-level diff display
- Show file list with +/-/~ icons for add/delete/modify files
- Show colored unified diff (green/red/cyan) for modified files
- Add source/target mtime rows in detail header
- Replace "Actions" section with "Next Steps" using prominent styling
- Update list item description with sync/local breakdown
- Add stat counts (err/diff/ok) to TUI title bar
- Fix freeze: defer file walk to Enter toggle instead of every render
- Fix gofmt in trash_tui.go and restore.go
- Add files, srcDir, dstDir fields to copyDiffEntry for lazy file diff
- Add srcMtime, dstMtime to targetDiffResult for time display
- Add ensureFiles() lazy loader and latestMtime() helper
- Pass sourceMap through collectMergeDiff for source path resolution
- Use named struct literals throughout collect functions
Implement diffSkillFiles to walk source/destination directories and
detect add/modify/delete changes at the file level. Uses SHA-256 for
content comparison and sergi/go-diff for unified text diffs. Includes
binary detection, git-style stat rendering, and 9 unit tests.
Left panel shows target list with status icons (✓/!/✗), right panel
displays categorized diff details for the selected target. Supports
filter (/), detail scroll (Ctrl+d/u), and narrow terminal fallback.
Add --no-tui flag for plain text output; non-TTY auto-falls back.
Both commands were missing parseModeArgs(), causing -g to be
misinterpreted as a target name. Now -g is accepted silently
(global is default) and -p returns a clear error.
Support glob patterns (*, ?, [...]) in skill name arguments across all
three commands. Matching is case-insensitive.
- install: --skill and --exclude flags support glob (e.g. -s "core-*")
- update: positional names support glob (e.g. update "core-*")
- uninstall: positional names support glob (e.g. uninstall "core-*")
Shared helpers isGlobPattern() and matchGlob() extracted to helpers.go
to avoid duplication. Includes 25 new tests and updated docs.
- trash_tui: delete and empty confirmations now render in red
- list_tui: uninstall confirmation now renders in red
- Consistent with restore_tui delete confirmation pattern
Add --help/-h handling for both backup and restore commands.
Add d key in restore TUI to delete selected backup with red
confirmation prompt and success message.
Interactive two-phase TUI: target picker → version list with left-right
split panel layout. Includes detail panel with skill diffs, descriptions,
and target state. Wires no-args restore to TUI dispatch with --no-tui
fallback.
Add bubbletea-based TUI with multi-select, fuzzy filter, and inline
restore/delete/empty operations. Follows the same dispatch pattern as
list and log: JSON → TUI (TTY + items + !--no-tui) → plain text.
Follow-up to PR #58: check_project.go now extracts custom target names
from project config and passes them to findUnknownSkillTargets, matching
the global-mode fix. Also surfaces config load errors as warnings instead
of silently ignoring them. Adds integration tests for check and doctor
(global + project mode) verifying no false "unknown target" warnings.
findUnknownSkillTargets only checked the built-in targets.yaml list,
causing false warnings for custom targets defined in config.yaml.
Pass configured target names from global/project config into the
validation so user-defined targets are recognized.
Previously, `skillshare upgrade` via Homebrew only showed "Upgraded" with
no version info, and skill downloads had the same issue. Now all upgrade
paths display clear version transitions:
- Homebrew: "Upgraded v0.16.3 → v0.16.5" or "Already up to date ✓"
- Direct download: "Upgraded v0.16.3 → v0.16.5" (was "Upgraded to v0.16.5")
- Skill install: "Installed v0.16.5" (new) or "Upgraded v0.1.0 → v0.16.5"
Also records toVersion in oplog for Homebrew upgrades.
status: single DiscoverSourceSkills pass shared across printSourceStatus,
printTrackedReposStatus, and printTargetsStatus; extractTrackedRepos
replaces GetTrackedRepos Walk; targetStatusResult carries syncedCount
so drift check reuses getMerge/CopyStatusDetail results.
doctor: single DiscoverSourceSkills pass shared across 5 check functions
(checkSource, checkSkillsValidity, checkSkillTargetsField, checkSyncDrift,
checkDuplicateSkills); cachedTargetStatus map lets checkSyncDrift reuse
checkTargets results; checkForUpdates network request runs in goroutine
overlapping local I/O.
Both commands show a spinner during discovery to avoid appearing frozen
on large skill sets.
Remove 2-space indent from spinner Success/Fail/Warn and
SuccessMsg/ErrorMsg so they align with other ui.Success output.
Move backup after discovery in sync so it is skipped when there
are 0 skills to sync — no point backing up if nothing will change.
- Fix non-TTY progress bar not incrementing for grouped skills in Phase 2
- Fix Unicode truncation in UpdateTitle using runewidth instead of len()
- Fix IP address regex missing end-of-line bare IPs (add $ anchor)
- Fix gofmt alignment in updateTarget struct comments
- Extract sliceHasName[T] generic helper to deduplicate universal detection
- Add nil meta defensive warning with skipped count in grouped updates
- Replace hand-rolled contains/containsStr with strings.Contains in tests
- Add red team TC-20b for inline code fetch-with-pipe detection
Optimize grouped repo updates by skipping reinstall when installed metadata already matches remote state (commit match, or subdir tree-hash match when HEAD moved).
Emit per-skill grouped progress events so the batch progress bar advances continuously instead of appearing stuck at 0%.
When skipping by tree-hash match, best-effort refresh meta.Version to latest commit to keep status/version output current.
Add unit tests covering commit/tree-hash skip behavior and metadata version refresh.
Drop the fixed 50ms sleep in the grouped batch update iteration. On very large update --all runs this sleep dominates runtime (for example ~90 minutes at ~108k skills) without improving correctness.
This keeps progress updates intact while eliminating artificial throttling in TTY mode.
- Add PhaseHeader UI helper for "[1/3] Pulling N tracked repos..." labels
- Show phase headers between batch update phases when 2+ phases exist
- Skip phase headers when only 1 phase (avoids meaningless "[1/1]")
- Lazily start progress bar after first phase header to fix ordering
- Add scanning spinner during filepath.Walk for large skill sets
- Cache metadata in updateTarget to avoid redundant ReadMeta calls
UpdateGitIgnore/RemoveFromGitIgnore were called per-skill inside loops,
re-reading the entire .gitignore each time. With large files (100K+ lines
in project mode), this caused O(N×M) complexity and process hangs.
- Add UpdateGitIgnoreBatch and RemoveFromGitIgnoreBatch (single read/write)
- ReconcileProjectSkills: collect entries during walk, batch-update once
- uninstall (global + project): batch-remove after loop, not per-iteration
- Fix spinner WithRemoveWhenDone in StartSpinnerWithSteps
- Add E2E runbook for gitignore batch performance validation
When pull calls cmdSync with empty args in a directory containing
.skillshare/config.yaml, auto-detection incorrectly switches to
project mode. Pass --global explicitly since pull always operates
on the global source.
A/U/X shortcuts now show a confirmation overlay (→ skillshare <action>
<flag> <skill>, Proceed? [Y/n]) before executing. This prevents
accidental actions and lets users see the exact command.
Global mode dispatch now passes -g to audit/update/uninstall, fixing
auto-detect misidentifying as project mode when .skillshare/ exists
in cwd. Uninstall adds --force to skip double confirmation since
the TUI already confirmed.