Commit Graph
52 Commits
Author SHA1 Message Date
Willie 9ee5324689 feat: enhance security audit thresholds, logging, and UI 2026-02-13 14:21:36 +08:00
Willie aa43f94892 feat: add --into flag for skill install command
Allow installing skills into subdirectories for organized folder
structures. Works with all install modes (direct, discovery, tracked)
in both global and project mode.

- Add Into field to InstallOptions and IntoPath() validation
- Update 4 dest-path construction points in CLI with destWithInto()
- Update InstallTrackedRepo for --into prefix in dest and gitignore
- Rewrite ReconcileProjectSkills to use filepath.WalkDir (recursive)
- Add --into to Web UI install handler, API client, and form
- Add 5 integration tests covering local, multi-level, validation,
  project mode, and no-source rejection
2026-02-13 14:21:36 +08:00
Willie 3873960d84 feat: support nested skills in uninstall command
Previously `skillshare uninstall vue-best-practices` failed when the
skill lived under an organizational folder (e.g. frontend/vue/).
Now both global and project mode fall back to a basename search across
nested directories, matching the behavior already in check/update.

- Add resolveNestedSkillDir() with ambiguity detection
- Use as fallback in resolveUninstallTarget (global) and
  cmdUninstallProject (project)
- Also matches _name variant for nested tracked repos
- Add integration tests for basename and full-path uninstall
2026-02-13 14:21:36 +08:00
Willie 2c982848c5 feat: classify HIGH audit findings as warnings and refresh docs/playground 2026-02-11 10:10:09 +08:00
Willie fbcec80788 feat: externalize audit rules to YAML with user customization
Move 17 hardcoded audit rules from Go structs to embedded rules.yaml,
enabling community PRs on rule definitions without recompilation.

Add user-customizable audit rules at two levels:
- Global: ~/.config/skillshare/audit-rules.yaml
- Project: .skillshare/audit-rules.yaml

Merge semantics: built-in → global → project. Users can append new
rules, override existing ones by id, or disable them (enabled: false).

Replace hardcoded localhostURL check with generic exclude regex field
on rules. Add --init-rules flag to scaffold a starter rules file.

Public API (ScanSkill, ScanContent, Finding, Result) unchanged —
callers require zero modifications.
2026-02-11 03:40:54 +08:00
Willie 98db20a9a0 test: add !online build tag to offline integration tests
Prevent test-docker and test-docker-online from running the same 36
offline integration tests. Each offline test file now has
`//go:build !online` so the two sets are mutually exclusive:
- default (no tag): 36 offline tests only
- -tags online: online tests only
2026-02-11 03:40:54 +08:00
Willie 18a4177973 test: add online integration tests for install, update, and search
Cover real GitHub operations that were previously untested:
- install clone (subdir skill)
- install --track (full repo)
- update tracked repo (freshly cloned → up to date)
- search with conditional GITHUB_TOKEN skip

Also pass GITHUB_TOKEN into sandbox-online container and remove
the -run filter so all online-tagged tests run automatically.
2026-02-11 03:40:54 +08:00
Willie 348102d5a9 feat: make built-in skill opt-in for init and upgrade
Built-in skillshare skill was auto-installed during `init` and
unconditionally refreshed by `upgrade --skill`. This caused
unintended pushes and surprised new users who didn't need it.

Changes:
- init: add --skill/--no-skill flags, prompt [y/N] (default N)
- upgrade: decouple --skill from --force, prompt when not installed
- Add 4 new integration tests for the opt-in behavior
- Update existing tests to use --no-skill or --force as needed
- Document all non-interactive init flags in website docs
2026-02-11 03:40:54 +08:00
Willie 84ba16802d feat: add log filtering, improve log UX, and custom dropdown
- Add --cmd, --status, --since, --json flags to CLI log command
- Auto-skip irrelevant log section when --cmd narrows to one file
- Add blank line separator between log entries for readability
- API returns totalAll and commands for smarter frontend filtering
- Custom HandSelect dropdown matching hand-drawn design system
- Empty state distinguishes "no matching entries" from "no entries"
- Update website docs and built-in skill reference with new flags
2026-02-11 03:40:54 +08:00
Willie 7287b68921 feat: make -v output mise-parseable for registry support
`skillshare version` keeps the ASCII logo, while `-v`/`--version`
now outputs `skillshare v<version>` — the plain-text format that
mise's registry test expects (`skillshare v{{version}}`).

Add registry/skillshare.toml for the upcoming jdx/mise PR.
2026-02-11 03:03:46 +08:00
Willie f49b3999bc feat: enrich install and audit logs with mode/path and installed skills 2026-02-10 11:51:09 +08:00
Willie 4c48556094 fix: remove audit false positives from built-in skill and trim description
The built-in skillshare skill's references/audit.md contained real threat
strings (curl to evil URL, base64 decode pipe, prompt injection text) in
example output snippets, causing `skillshare audit` to flag itself. Remove
the offending `> ...` snippet lines while keeping the finding messages.

Also trim SKILL.md description from 1039 to 959 chars (under Codex 1024
limit) by removing redundant trigger phrases already covered by other entries.

Add integration test that copies the real built-in skill into a sandbox and
verifies `skillshare audit skillshare` produces zero findings.
2026-02-10 11:46:39 +08:00
Willie 4d620f25fd feat: improve log view and project log ignore defaults 2026-02-10 04:52:52 +08:00
Willie e5813cc7e0 feat: add oplog instrumentation to all API handlers, improve audit/log/sync CLI
- Add oplog write helpers to server (oplog_helper.go) and instrument
  all handler_*.go endpoints with ops/audit logging
- Improve audit CLI with structured auditRunSummary and severity counts
- Enhance log CLI with richer filtering and detail display
- Improve sync CLI with drift detection summaries in oplog
- Reorder web UI sidebar nav by user workflow (core → acquire → distribute → maintain → monitor)
- Enhance LogPage with better formatting and filtering
- Add server oplog unit tests (logging_test.go, log_test.go)
- Update docs for log command and quick-reference
2026-02-10 03:50:03 +08:00
Willie f2017a35aa feat: fix tracked repo discovery, improve naming, and unify project list
Sync discovery (DiscoverSourceSkills) was skipping all hidden directories
via utils.IsHidden(), causing skills inside .curated/ and .system/ (like
openai/skills) to be invisible after install. Now only .git is skipped,
matching the install-time discovery that was already fixed in 8ec5306.

Tracked repo naming now uses owner-repo format (e.g., _openai-skills
instead of _skills) via new Source.TrackName() method, preventing
collisions between repos that share the same basename.

Project-mode `list` command now uses recursive DiscoverSourceSkills()
instead of shallow os.ReadDir(), aligning with global list and web UI
behavior so tracked repo skills are visible everywhere.

Also includes CHANGELOG for v0.11.0, README updates, docs improvements,
and minor UI nav reorder.
2026-02-10 03:13:21 +08:00
Willie 5a65993304 feat: add operation log — JSONL-based persistent audit trail for CLI, API, and web UI
Add oplog package (internal/oplog) that records every mutating command
(install, uninstall, sync, push, pull, collect, backup, restore, update,
audit) as a JSONL entry with timestamp, status, duration, and args.

- CLI: `skillshare log` with --audit, --tail, --clear, --project flags
- API: GET/DELETE /api/log endpoints with type and limit params
- Web UI: LogPage with ops/audit tabs, table view, clear and refresh
- Instrumentation across 12 command handlers (CLI + server)
2026-02-10 02:56:59 +08:00
Willie 8ec53065b5 feat(install): fix hidden-dir discovery, add fuzzy search, and improve install UX
discoverSkills() skipped all dot-prefixed dirs, causing repos like
openai/skills (which use .curated/ and .system/) to find 0 skills.
Fix: only skip .git, traverse all other hidden dirs.

CLI --skill flag now falls back to fuzzy matching (via lithammer/fuzzysearch)
when exact match fails. Single fuzzy match auto-selects; ambiguous matches
show "did you mean" suggestions.

UI SkillPickerModal gains a filter input (autofocus, substring on name+path)
that appears for >5 skills. Select All toggles only filtered skills.

Batch install toast fix: always show summary toast even when some skills
are blocked by security audit (previously early-returned with no feedback).
Audit dialog now targets only blocked skills for force-retry.

CLI output for mixed results: use warning banner instead of success,
show failures first, condense >10 successes into a single line.
2026-02-10 02:23:16 +08:00
Willie 4d17ff5d57 feat: add security audit — scan engine, CLI, install hooks, web UI, and docs
Scan skills for prompt injection, data exfiltration, credential access,
destructive commands, obfuscation, and suspicious URLs. CRITICAL findings
block installation by default; HIGH/MEDIUM shown as warnings.

- Scan engine: internal/audit with regex-based pattern matching
- CLI: `skillshare audit [name]` with per-skill progress and summary
- Install hooks: auto-scan after copy, block on CRITICAL unless --force
- Web UI: AuditPage with run/rescan, InstallForm shows ConfirmDialog
  for audit blocks (force-retry) and warning details
- ConfirmDialog: add `wide` prop, hide cancel when cancelText is empty
- Reduced false positives: rm -rf only flags root/glob, skip localhost
  URLs, exclude `fetch` as English word, hidden-unicode downgraded to HIGH
- README: add audit section, update screenshots, unify image sizes,
  add audit to Why/Comparison/Daily Commands
- Docs: audit command page, install security scanning section, FAQ,
  common errors, daily workflow, sidebar, landing page, intro
- Blog specs: add audit sections to Dev.to and Medium drafts
2026-02-10 01:53:55 +08:00
Willie 8604ab278e feat(ui): add Trash page, trash API handlers, and CLI delete/empty commands
- Add Web UI Trash page with list, restore, delete, and empty actions
- Add 4 server handlers (handler_trash.go) with dual-mode support
- Fix handleUninstallSkill/handleUninstallRepo to use trash.MoveToTrash
  instead of os.RemoveAll (bug fix: uninstall via UI now soft-deletes)
- Add trash delete/empty CLI subcommands with integration tests
- Show Uninstall button for all skills in SkillDetailPage (not just
  tracked/installed ones)
- Update confirm dialog wording to reflect soft-delete behavior
- Update docs with new trash subcommands
2026-02-09 23:19:28 +08:00
Willie 3a920610f2 feat: add trash (soft-delete) for uninstall with 7-day retention
Replace permanent deletion with soft-delete: uninstall now moves skills
to a trash directory instead of using os.RemoveAll. Skills are retained
for 7 days and automatically cleaned up during sync/uninstall operations.

- Add internal/trash package (MoveToTrash, List, Cleanup, Restore, FindByName)
- Add `skillshare trash list` and `skillshare trash restore <name>` commands
- Show reinstall hint from metadata when uninstalling remote skills
- Add trash status to `skillshare doctor` output
- Opportunistic cleanup of expired items during sync and uninstall
- Support both global (~/.config/skillshare/trash/) and project (.skillshare/trash/) modes
- 10 unit tests + 10 integration tests
- Update docs: uninstall, trash, doctor, FAQ, file-structure, sync, daily-workflow
2026-02-09 22:46:36 +08:00
Willie 0c49860d63 feat: add project mode labels, privacy-first messaging, and UI polish
- Add (project) labels to status, sync, collect, target, and uninstall
  headers for clear mode distinction (matching list/target list pattern)
- Add ui.WithModeLabel() helper for shared functions that run in both modes
- Update uninstall confirmation prompt: "from the project?" in project mode
- Add "Privacy-first" to README Why section and website homepage
- Replace "Unified Source" card with "Privacy-First" card on website
- Unify Quick Actions card heights with h-full in DashboardPage
- Add frontend rebuild note to Docker sandbox docs
2026-02-09 21:08:03 +08:00
Willie 14bd568b9a feat: add project mode support to web dashboard (skillshare ui -p)
The web dashboard now fully supports project-level skills. When launched
with `-p` or when `.skillshare/config.yaml` is auto-detected, the UI
adapts: Git Sync and Backup pages are hidden, Config edits the project
config, Install reconciles ProjectConfig.Skills[], and targets resolve
from project-level definitions.

Server: add NewProject constructor, IsProjectMode/configPath/saveConfig/
reloadConfig helpers, branch all handlers for project mode.

Frontend: AppContext propagates isProjectMode, Layout filters nav items,
Git/Backup pages show unavailable message, Config/Dashboard adapt.

Extract ReconcileProjectSkills to internal/config for reuse by both CLI
and server. Add unit tests and integration tests for project UI.

Update docs, README, and Docker playground with project mode demo project
and skillshare-ui-p alias.
2026-02-08 17:15:59 +08:00
Willie afc932c2bf feat: make upgrade --skill always refresh and overwrite 2026-02-08 16:23:02 +08:00
Willie 092fb14f8a feat: add web dashboard with embedded React SPA (skillshare ui)
Single-binary web UI for visual skill management — React 19 + Vite
frontend embedded via go:embed, Go net/http REST API backend (30+
endpoints). Includes dashboard, skills browser, targets, sync, collect,
search, install, config editor, backup/restore, and git sync pages.

Also adds Bitbucket/GitLab URL parsing for install, git operations
library, skill version checking, CI frontend build steps, Docker
sandbox support, and website docs for the ui command.
2026-02-08 05:08:30 +08:00
Willie 080e29e0ff feat: add docker sandbox test/playground workflows and docs 2026-02-07 21:55:20 +08:00
Willie bf41422659 fix(install): naming behavior and docs 2026-02-07 21:08:36 +08:00
Willie 78924f08ea fix(backup): replace filepath.Walk with os.ReadDir to handle Windows junctions
filepath.Walk fails on Windows NTFS junctions with "Incorrect function"
because os.Lstat returns nil info, bypassing all junction-detection logic
and crashing the entire backup for that target. This means one unreadable
junction prevents ALL local skills from being backed up.

Replace with os.ReadDir + os.Lstat so junctions are identified and skipped
before any read attempt. Also add Windows CI and unit tests for copyDir.

Fixes runkids/skillshare#7
2026-02-07 00:35:11 +08:00
Willie 6650a8c670 style: fix docs formatting 2026-02-05 13:41:27 +08:00
Willie 0162bddfde feat: add per-target sync mode support for project mode
Allow project targets to set mode individually (merge or symlink),
mirroring global behavior. Default remains merge.

- Add Mode field to ProjectTargetEntry with YAML marshal/unmarshal
- Add mode branching in project sync (reuses syncMergeMode/syncSymlinkMode)
- Support --mode flag in target info for project targets
- Mode-aware unlink in target remove
- Unify project sync UI with global sync output format
- Update docs to reflect per-target mode support
2026-02-05 13:20:12 +08:00
Willie e922f31f5a fix(install): preserve nested structure for orchestrator skills
- Fix bug where child skills were flattened to root instead of nesting under parent
- Add two-stage UX: "Install entire pack" or "Select individual skills"
- Root skill installs first, children marked as "included in parent"
- Add tests for orchestrator nesting and individual child installation
2026-02-01 08:27:20 +08:00
Willie a739902ac2 feat!: rename pull <target> to collect, simplify pull for git-only
BREAKING CHANGE: Command restructure for clearer symmetry

- Local sync: sync/collect (Source ↔ Targets)
- Remote sync: push/pull (Source ↔ Git Remote)

Changes:
- Add `collect` command (was `pull <target>`)
- Simplify `pull` to git remote only (was `pull --remote`)
- Add spinner effects to pull and push commands
- Update all documentation and skill references
- Add CHANGELOG.md
- Update help examples with practical workflows

Migration:
  pull claude     → collect claude
  pull --all      → collect --all
  pull --remote   → pull
2026-01-31 20:52:09 +08:00
Willie Hung bf286f1d88 fix(upgrade): add Windows zip support
- Handle .zip format for Windows releases (vs .tar.gz for others)
- Add extractFromZip() and refactor extraction logic
- Update test to use --force flag for upgrade flow
2026-01-31 03:40:34 +08:00
Willie Hung 33eb894063 test(help): update assertions to match new help format
Update help_test.go to check for "CORE COMMANDS" instead of
deprecated "Usage:" and "Commands:" strings after the help
output was redesigned with ASCII art and command grouping.
2026-01-30 13:44:31 +08:00
Willie Hung 0f114dc298 feat: add new command to create skill templates
- `skillshare new <name>` creates SKILL.md with frontmatter
- Validates skill name (lowercase, hyphens, underscores)
- Converts kebab-case to Title Case for headings
- Supports --dry-run to preview
- Update docs/targets.md with ASCII art diagram
2026-01-28 17:24:58 +08:00
Willie Hung 9fbfe0e88a fix: resolve box rendering issues and improve list UI
- Add displayWidth() to calculate visible string width excluding ANSI codes
- Fix box padding calculation in Box, WarningBox, SummaryBox, UpdateNotification
- Disable git color output in GetCommitsBetween to prevent ANSI codes in commit hashes
- Improve list command: dynamic name alignment, add icons, remove duplicate separators
2026-01-25 02:49:54 +08:00
Willie Hung f60d46c4f5 feat: remove ss symlink, add alias docs
- Remove automatic ss symlink creation from install.sh and upgrade
- Add optional alias setup instructions to README
- Update skill version to 0.6.4
2026-01-21 01:11:30 +08:00
Willie Hung d43afa5269 feat: add discover mode for init command
- Add --discover flag to detect new agents
- Add --select flag for non-interactive mode (AI use)
- Use survey.MultiSelect for interactive target selection
- Update init.md with discover flags documentation
- Add 8 test cases for discover functionality
2026-01-21 00:42:05 +08:00
Willie Hung fd4387460a feat: Team Edition - tracked repos, nested skills, collision detection
## New Features
- Tracked repositories: `install --track` to clone team skill repos
- Nested skills: organize in folders, auto-flatten on sync (work/api → work__api)
- Name collision detection: warns when multiple skills share same SKILL.md name
- Auto-pruning: orphaned symlinks cleaned on sync
- Custom naming: `--name` flag for tracked repos

## Changes
- Require target path to exist when adding targets
- Add sync reminder after adding target
- Improve pruning messages (broken vs orphan symlinks)
- Add `{team}:{name}` naming convention recommendation

## Files
- New: update.go, gitignore.go, frontmatter.go
- Updated: sync.go, install.go, uninstall.go, validate.go
- Docs: README.md, SKILL.md
2026-01-20 01:56:07 +08:00
Willie Hung aaae299f9e feat: require target path to exist and show sync reminder
- Change TargetPath validation to return error when path doesn't exist
  instead of just a warning
- Add sync reminder message after successful target add
- Add TestTargetPath unit tests and integration test for non-existent path
2026-01-19 22:18:08 +08:00
Willie Hung ffc9c50237 fix: download entire skillshare skill directory instead of just SKILL.md
Use install.Install() to clone the entire skill directory including
references/ and scripts/ subdirectories.
2026-01-16 22:28:27 +08:00
Willie Hung 729369c4d0 fix: add --skill flag to upgrade tests to avoid GitHub API rate limits in CI 2026-01-16 22:16:27 +08:00
Willie Hung 4af34fe695 feat: rename update to upgrade with CLI self-update support
- Rename `update` command to `upgrade`
- Add CLI binary self-update from GitHub releases
- Add `--cli` and `--skill` flags to upgrade specific components
- Detect Homebrew installation and use `brew install` instead
- Refactor SKILL.md with progressive disclosure pattern
- Split references into separate files (status, sync, install, etc.)
- Move run.sh to skills/skillshare/scripts/
- Fix --update flag to auto-reinstall when git pull not possible

BREAKING CHANGE: `skillshare update` is now `skillshare upgrade`
2026-01-16 22:12:03 +08:00
Willie Hung 96585a7626 fix: show informative messages when remote already exists
- Show message when remote is already configured with same URL
- Show warning and hint when trying to set different remote
- Show warning when git is not initialized
- Add tests for all edge cases
2026-01-16 03:00:19 +08:00
Willie Hung a4c863bb51 test: add tests for init --remote on existing config
Verify that --remote flag works when config already exists:
- Adds git remote successfully
- Dry-run shows what would be done without changes
2026-01-16 02:57:25 +08:00
Willie Hung c9e71fb16e test: add integration tests for pull --remote flag
Add 5 tests covering:
- No git repo error handling
- No remote configured error
- Uncommitted changes detection
- Dry-run mode preview
- Actual pull with sync to targets
2026-01-16 02:55:14 +08:00
Willie Hung 0b5b1dd48b fix: skip duplicate check for merge mode targets
Merge mode allows local skills by design. Only check for duplicates
in symlink mode targets where local copies are unexpected.
2026-01-16 02:00:40 +08:00
Willie Hung 6f2b51d75d fix: track warnings separately from errors in doctor summary
Doctor now distinguishes between errors (broken symlinks, missing source)
and warnings (uncommitted git changes, duplicate skills). Summary shows
"N warning(s)" instead of "All checks passed!" when warnings exist.
2026-01-16 01:44:48 +08:00
Willie Hung ccdc34d0cf feat: enhance doctor command with comprehensive checks
Add new diagnostic checks:
- Git status: uncommitted changes, remote configuration
- Skill validation: detect skills without SKILL.md
- Broken symlinks: find invalid symlinks in targets
- Duplicate skills: warn about same skill in multiple locations
- Backup status: show last backup time
- Version check: notify if newer version available
2026-01-16 01:32:12 +08:00
Willie Hung 4337bf7890 feat: add update command for built-in skill
- Add `skillshare update` to download latest skill from GitHub
- Download skill during init with fallback if offline
- Remove embedded template approach
- Add integration tests for update command
- Update README with update command docs
2026-01-16 00:52:31 +08:00
Willie Hung 6f5f5460fe feat: add uninstall and list commands
- uninstall: remove skills from source with confirmation prompt
- list: show installed skills with source info
- --verbose flag for detailed output
- integration tests for both commands
- README documentation
2026-01-15 23:36:55 +08:00