Commit Graph
153 Commits
Author SHA1 Message Date
Willie d1d528f192 feat: add --audit flag to hub index for security risk enrichment
Enrich hub index with per-skill audit scores so teammates can assess
skill safety before installing. Uses existing audit.ScanSkill() engine
(25 rules, 0-100 risk score) without modifying the audit package.

- SkillEntry gains riskScore (*int), riskLabel, auditedAt (omitempty)
- BuildIndex accepts variadic auditSkills param (backward compatible)
- search index deserializes and displays risk badges in hub results
- Schema stays v1; fields omitted when --audit not used
2026-02-22 08:08:35 +08:00
Willie ce5ba1442c fix: strip "v" prefix from skill version to prevent "vv" display
SKILL.md frontmatter may contain "version: v0.15.0" (with v prefix),
but callers already prepend "v" when formatting. Normalize at the
source by trimming the prefix in both ReadLocalSkillVersion and
FetchRemoteSkillVersion.
2026-02-22 08:08:35 +08:00
Willie cea26ea7fb feat: add dangling local markdown link detection to audit
Scan .md files in skill directories for broken relative links during
audit. Targets that don't exist on disk produce a LOW severity finding
(pattern: dangling-link). External URLs, anchors, and fragments are
skipped.

Integrated into the existing walk (zero extra IO) and disableable via
audit-rules.yaml (- id: dangling-link / enabled: false). The init-rules
template, built-in skill reference, and website docs are updated.
2026-02-21 21:12:51 +08:00
Willie 836f1b498b refactor: dedupe git helpers and isolate test state 2026-02-21 21:12:51 +08:00
Willie 03e35a1719 test: isolate oplog tests with per-test XDG state 2026-02-21 21:12:51 +08:00
Willie 89055804ff fix: harden pull/push first-sync flow and add regression coverage 2026-02-21 21:12:51 +08:00
Willie 6b8c38455c fix: overhaul push/pull/init git remote flow
Fixes multiple issues with the cross-machine sync workflow reported
in runkids/skillshare#35:

- push/pull auto-detect missing upstream and set it on first use
  (push uses -u, pull uses fetch + reset + set-upstream-to)
- First pull checks local/remote skill directories before resetting;
  refuses to overwrite local skills unless --force is passed
- init --remote auto-initializes git when config exists but .git does not
- HTTPS token auth (GITHUB_TOKEN, GITLAB_TOKEN, etc.) injected into
  push, pull, and init remote fetch
- init --help shows init-specific flags and examples
- Remote repos with only files (README) no longer misdetected as
  having skills (uses git ls-tree -d)
- Error hints suggest skillshare init --remote instead of raw git
2026-02-21 21:12:51 +08:00
Willie 62b215fd53 fix: keep devcontainer project mode out of workspace root 2026-02-21 06:07:35 +08:00
Willie 3e218266b4 fix: add HTTPS token auth to check paths 2026-02-21 06:07:35 +08:00
Willie 15e2b6db58 fix: add HTTPS token auth to update pull paths 2026-02-21 06:07:35 +08:00
Willie a972a0c943 feat(install): add HTTPS token auth for private repos
Automatically detect GITHUB_TOKEN, GITLAB_TOKEN, BITBUCKET_TOKEN, or
SKILLSHARE_GIT_TOKEN and inject credentials via transient GIT_CONFIG_*
env vars during clone and pull. Tokens are never persisted to disk.

Key changes:
- Platform detection (GitHub/GitLab/Bitbucket) with per-platform
  username conventions (x-access-token, oauth2, x-token-auth)
- GIT_CONFIG_COUNT safe append — reads existing count to avoid
  overriding CI pipeline git config entries
- Token-aware error messages: "no token" shows 3 options (SSH, env
  var, credential helper); "token rejected" suggests checking
  permissions and expiry
- sanitizeTokens redacts all credential values (including
  BITBUCKET_USERNAME) from stderr before surfacing errors
- gitPull also injects auth via getRemoteURL(), fixing the previous
  limitation where update failed after HTTPS+token install
2026-02-21 06:07:35 +08:00
Willie 5b25fa6845 fix(sync): propagate errors in DirChecksum instead of swallowing them
Unreadable files or unresolvable paths now cause DirChecksum to return
an error rather than silently producing an incomplete checksum.

Ref: PR #33 review (gemini-code-assist)
2026-02-21 06:07:35 +08:00
Willie d7d4804312 fix(sync): handle non-directory entries in copy mode
- SyncTargetCopy replaces non-directory managed entries with proper
  skill directories; skips local non-directory entries unless --force
- CheckStatusCopy only counts managed entries that are actual
  directories on disk
- diff and server diff handlers report "target entry is not a
  directory" for both managed and unmanaged non-directory entries
- Add tests for non-directory edge cases in sync, diff, and target info
2026-02-21 06:07:35 +08:00
Willie eb6b4cb650 fix(sync): verify target directory exists before trusting manifest
- P1: diff now checks target skill directory exists before comparing
  checksums; deleted directories are reported as "missing" instead of
  being silently treated as synced
- P2: CheckStatusCopy counts only managed entries that exist on disk,
  so target info shows accurate managed count
- Add tests for deleted target dir detection and manifest/disk mismatch
2026-02-21 06:07:35 +08:00
Willie 854b90e1b0 fix(sync): fix copy mode diff, target info, and project remove bugs
- P1: diff now compares checksums to detect content drift in copy mode
- P2: diff routes on config mode instead of manifest presence
- P2: project target remove cleans up manifest file
- P3: target info uses mode-appropriate status check (copy/merge/symlink)
- Export DirChecksum for use by diff and server handlers
- Add 4 integration tests covering all fixed scenarios
2026-02-21 06:07:35 +08:00
Willie 3b721ee3e2 feat(sync): add copy mode for AI CLIs that can't follow symlinks
Add a third sync mode (`copy`) that copies skills as real files instead
of symlinks, with a `.skillshare-manifest.json` tracking managed skills
and SHA256 checksums for incremental updates.

- Manifest-based tracking: skip unchanged, update modified, --force all
- Pruning: remove managed copies no longer in source
- Mode conversion: bidirectional merge↔copy and symlink↔copy
- Full command support: sync, status, doctor, diff, target, collect
- Server API + Web UI: targets list, drift detection, filter editing
- include/exclude filters work in both merge and copy modes
- 12 integration tests covering all acceptance criteria
- Documentation updated across 13 pages

Closes #31
2026-02-21 06:07:35 +08:00
Willie be9ac8945c refactor(targets): rename agents→universal, fix kimi/replit paths
- Rename "agents" target to "universal" with backward-compat alias
- Fix kimi global_path: ~/.kimi/skills → ~/.config/agents/skills
  (matches official docs recommended path)
- Add replit global_name and global_path (~/.config/agents/skills)
- Prefer "universal" as canonical name in GroupedProjectTargets
- Update tests for new naming and kimi as universal group member
2026-02-20 13:59:34 +08:00
Willie 072b077971 feat: add JSON Schema for config YAML files
Enable IDE autocompletion, validation, and hover docs for config.yaml
by adding JSON Schema support via yaml-language-server directive.

- Add schemas/config.schema.json (global) and project-config.schema.json
- Prepend schema comment in Config.Save() and ProjectConfig.Save()
- Add unit and integration tests for schema comment roundtrip
- Document IDE setup in configuration.md
2026-02-18 23:58:45 +08:00
Willie 47dc9495fe fix: enforce install flag validation and project uninstall preflight 2026-02-18 22:23:50 +08:00
Willie d1379cbc36 test: split audit tests by concern 2026-02-18 22:23:50 +08:00
Willie b1ede8d918 fix: handle errors from ReconcileGlobalSkills, filepath.Walk, and remove redundant applyExclude
Address PR #29 review feedback:
- Log warnings on ReconcileGlobalSkills/ReconcileProjectSkills failures
  instead of silently discarding errors
- Propagate filepath.Walk callback errors in uninstall group/nested resolution
- Remove redundant applyExclude call in selectSkills (callers already filter)
2026-02-18 22:23:50 +08:00
Willie bd4c9700be feat: support group matching in .skillignore via path-based comparison
Change matchSkillIgnore to compare against skill path instead of name,
enabling patterns like "feature-radar" to exclude all skills under
that group directory. Precise paths like "feature-radar/helper" still
target individual skills. Backward compatible — flat skills have
path == name so existing patterns work unchanged.
2026-02-18 22:23:50 +08:00
Willie 1ff2fe6881 feat: add group field to SkillEntry for organized skill placement
The --into flag information was previously encoded only in the name
field (e.g. name: frontend/pdf), causing config-based install to fail
because validate.SkillName() rejects slashes. Add an explicit group
field to separate placement from identity, with automatic migration
of legacy slash-in-name entries.

- Add Group field, FullName(), and EffectiveParts() to SkillEntry
- Update reconcilers to write new format and migrate legacy entries
- Fix installFromGlobalConfig/installFromProjectConfig to use
  EffectiveParts() for validation and FullName() for path construction
- Fix uninstall config cleanup to match via FullName()
- Add unit tests for SkillEntry helpers and reconciler group behavior
- Add 5 integration tests for group field end-to-end flows
- Document group field in declarative-manifest.md
2026-02-18 22:23:50 +08:00
Willie 001fff0c77 feat: add .skillignore, --exclude flag, and license display for install
Implement three install features with full documentation:

- .skillignore: repo-level file to hide skills from discovery (exact
  match + trailing wildcard). Applied during git repo discovery before
  any selection prompt.
- --exclude: CLI flag to skip specific skills during multi-skill install.
  Filters before the interactive prompt so excluded skills never appear.
  Warns when used with direct local-path installs (not applicable).
- License display: shows SKILL.md license frontmatter in selection
  prompts and single-skill confirmation screen.

Add 7 integration tests, 2 new doc pages (declarative-manifest,
url-formats), and cross-reference updates across 6 existing doc pages.
2026-02-18 22:23:50 +08:00
Willie 1d0633aa35 feat: expand audit rules with 6 new security patterns
Add detection for real-world attack vectors that were missing from the
audit engine: dynamic code evaluation (eval/exec/Function), Python shell
execution (os.system/subprocess), environment variable leaking
(process.env), prompt injection hidden in HTML comments, and escape
sequence obfuscation (hex/unicode). Each rule includes false-positive
guards (e.g. evaluate() excluded from eval rule, NODE_ENV excluded from
env-access). Also backfills insecure-http and shell-chain rules that
were missing from the website docs table.
2026-02-18 22:23:50 +08:00
Willie 57099849da feat: add Firebender as a supported target
Firebender is a coding agent for JetBrains IDEs with native skills support.
Paths: ~/.firebender/skills
(global), .firebender/skills (project). Update target count to 49+.
2026-02-18 22:23:50 +08:00
Willie 15586425c8 fix: sync agent target paths with upstream and document push/pull vs config
- antigravity: global_skills → skills
- augment: rules → skills
- goose project: .agents/skills → .goose/skills (upstream main)
- Update supported-targets.md to match
- Add "Alternative: Install from Config" section to cross-machine-sync
  with comparison table (push/pull vs install from config)
- Add cross-reference tip in install.md
- Bump CHANGELOG version to 0.13.3
2026-02-18 22:23:50 +08:00
Willie 7abe17cc2c feat: add declarative skill manifest for global mode
Port the project-mode skill manifest pattern to global mode so
`config.yaml` supports a `skills:` section and `skillshare install`
(no args) installs all listed remote skills.

- Rename ProjectSkill → SkillEntry (shared by both modes)
- Add Skills []SkillEntry to global Config with validation
- Add ReconcileGlobalSkills() to auto-sync manifest after install
- Wire no-arg install, auto-reconcile on all install paths
  (including search → install), and uninstall cleanup
- Update server handlers for global reconciliation
- Update docs, tests, and CHANGELOG
2026-02-18 22:23:50 +08:00
Willie 76e1f6e3a9 fix: prune broken external symlinks after data migration (#28)
After data migration (e.g. XDG path change), target symlinks still
point to old source path. PruneOrphanLinks treated these as "external"
and always preserved them, even with --force.

- Auto-remove broken external symlinks (target no longer exists)
- Pass force flag to PruneOrphanLinks; force removes valid external symlinks
- Use utils.PathHasPrefix for Windows case-insensitive path comparison
2026-02-16 15:23:03 +08:00
Willie d99653025c refactor: unify CacheDir into config package and document all platform paths
Move GetCacheDir() from version package to config.CacheDir(), consistent
with BaseDir()/DataDir()/StateDir() pattern including Windows fallback.
Add XDG_CACHE_HOME and cache paths to website docs.
2026-02-16 12:58:28 +08:00
Willie cb9db75dfb fix: improve dev mode placeholder with actionable instructions
Show exact commands (cd ui && pnpm run dev, make ui-dev) instead of
a vague mention of Vite, so developers know how to start the frontend.
2026-02-16 12:29:53 +08:00
Willie 9c51630b85 fix: bind port before opening browser to avoid connecting to stale server
Split ListenAndServe into Listen + Serve so port conflicts are detected
before the browser is opened.  Previously, openBrowser ran first and
could connect to an old skillshare ui process on the same port.
2026-02-16 12:28:03 +08:00
Willie e3f501d16f fix: redirect XDG vars into sandbox to prevent CI test leakage
Ubuntu CI runners set XDG_CONFIG_HOME system-wide, causing
config.BaseDir() in subprocesses to resolve outside the sandbox.
Redirect XDG_CONFIG_HOME/DATA_HOME/STATE_HOME to sandbox paths
so every test exercises the XDG codepath with proper isolation.
2026-02-16 12:08:05 +08:00
Willie eed0bdaa24 fix: report migration outcomes and rewrite source after windows move 2026-02-16 11:20:31 +08:00
Willie 0bf84493cc feat: split XDG data/state dirs and add Windows legacy migration
Separate backups/trash into XDG_DATA_HOME and logs into XDG_STATE_HOME
instead of keeping everything under XDG_CONFIG_HOME. Add automatic
migration at startup to move existing data to the new locations.

Fix Windows path resolution: DataDir() and StateDir() now fall back to
%AppData% on Windows (matching BaseDir()), preventing incorrect use of
~/.local/share and ~/.local/state paths.

Add MigrateWindowsLegacyDir() to move pre-v0.13.0 data from
~\.config\skillshare\ to %AppData%\skillshare\ on Windows.

Update doctor, oplog, backup, trash, and all tests/docs accordingly.
2026-02-16 10:41:14 +08:00
Willie 41e822d979 feat: remove go:embed, serve UI exclusively via runtime download
Replace the embedded SPA (go:embed + build tags) with runtime download
from GitHub Releases. The binary no longer bundles UI assets — they are
downloaded on first `skillshare ui` launch and cached at
~/.cache/skillshare/ui/<version>/.

- Delete embed.go / embed_dev.go; add spa_disk.go with placeholder handler
- Simplify ensureUIAvailable(): cache check before dev-mode fallback
- Pre-download UI assets in `skillshare upgrade` (best-effort)
- Remove Node stages from production and CI Dockerfiles
- Keep Node stage in sandbox for playground UI cache pre-population
- Remove ui-embed-check CI job and -tags dev build flag
- Update Makefile, mise.toml, GoReleaser, release workflow
2026-02-16 02:58:22 +08:00
Willie 80c2d52fef feat: respect XDG Base Directory Specification (#26)
Add config.BaseDir() as single source of truth for base directory
resolution. Replace all hardcoded ~/.config/skillshare paths.

Path resolution priority:
  1. SKILLSHARE_CONFIG env var (unchanged)
  2. $XDG_CONFIG_HOME/skillshare (any platform)
  3. %AppData%/skillshare (Windows only)
  4. ~/.config/skillshare (Linux, macOS fallback)

- Add config.BaseDir() with XDG_CONFIG_HOME + Windows %AppData% support
- Update BackupDir(), TrashDir(), init default source to use BaseDir()
- Show resolved base directory in doctor output
- Add unit tests and integration tests for XDG override
- Document XDG_CONFIG_HOME and update Windows paths in docs
2026-02-16 01:23:36 +08:00
Willie da50912307 feat: fuzzy resolve subdirectory when exact path not found in repo
When installing from a monorepo where skills live in a nested directory
(e.g. skills/vue-best-practices/), specifying just the skill name as
subdir (owner/repo/vue-best-practices) would fail because the exact
path doesn't exist at the repo root. Now resolveSubdir scans all
SKILL.md files and matches by basename, falling back gracefully with
an ambiguity error when multiple candidates share the same name.
2026-02-16 00:54:10 +08:00
Willie 403aafb254 feat: unify project target names with global names, add aliases for backward compat
Project targets now use the same short names as global targets (e.g.,
"claude" instead of "claude-code"). Old project_name values are preserved
as aliases so existing configs continue to work.

- Add Aliases field to targetSpec (deprecated, remove once safe)
- Update 11 targets in targets.yaml: project_name = global_name
- LookupProjectTarget falls back to alias lookup
- Fix 3 callers that bypassed LookupProjectTarget
- Extend MatchesTargetName and KnownTargetNames with alias support
- Add TestLookupProjectTarget_Alias
- Update all integration tests, docs, CLI help, and FAQ
2026-02-16 00:08:59 +08:00
Willie a29e198725 feat: add target filter CLI, skill-level targets field, and Web UI support
- CLI: `target <name> --add-include/--add-exclude/--remove-include/--remove-exclude`
- SKILL.md `targets` frontmatter restricts sync to specified targets
- Cross-mode matching (e.g. "claude" matches "claude-code" project target)
- Web UI: inline filter editor on Targets page, target badges on Skills pages
- API: PATCH /api/targets/{name} for filter updates
- Fix drift detection in doctor/status/handler to account for skill-level targets
- `check` warns about unknown target names in skill-level targets field
- Docs: update skill-format, target command, configuration, creating-skills
2026-02-15 23:29:30 +08:00
Willie d30d90af76 feat: update Homebrew install to homebrew-core and detect missing UI
- Update Homebrew command from tap (runkids/tap/skillshare) to
  homebrew-core (brew install skillshare) in README, website homepage,
  and getting-started docs
- Add note that Homebrew build is CLI-only (no web dashboard)
- Add IsUIBuilt() detection in embed.go/embed_dev.go to check for
  placeholder UI at startup
- Show CLI warning with install instructions when skillshare ui is
  run on a build without the frontend
- Add Homebrew Note section to commands/ui.md with migration steps
2026-02-15 16:18:26 +08:00
Willie 43d12b11c1 feat: per-target collision detection with filter-aware reporting
Collision checks previously ran on all skills before target filters,
producing false positive warnings when users route same-named skills
to different targets via include/exclude. Now collision detection
runs per-target after filtering, downgrading to info when filters
correctly isolate duplicates.

- Add CheckNameCollisionsForTargets() to internal/sync
- Replace collision blocks in sync.go and sync_project.go
- Show human-readable filter summary per merge target
- Add unit tests (5 cases) and integration test
- Update docs with new two-tier collision output examples
2026-02-14 18:35:21 +08:00
Willie 137fb84abf fix: correct droid and copilot skill paths per official docs
- droid (Factory AI): ~/.agents/skills → ~/.factory/skills,
  .agents/skills → .factory/skills
  Ref: https://docs.factory.ai/cli/configuration/skills

- copilot (GitHub Copilot): .agents/skills → .github/skills
  Ref: https://docs.github.com/en/copilot/concepts/agents/about-agent-skills
2026-02-14 02:30:35 +08:00
Willie 61d6c213ef feat: add Deep Agents CLI as supported target
Global: ~/.deepagents/agent/skills/
Project: .deepagents/skills/

Ref: https://docs.langchain.com/oss/python/deepagents/cli/overview
2026-02-14 02:22:30 +08:00
Willie 7faae6122a fix: correct opencode project skill path to .opencode/skills
Per OpenCode docs (https://opencode.ai/docs/skills/), workspace skills
should be at .opencode/skills/, not .agents/skills/.
2026-02-14 02:19:37 +08:00
Willie f771feb939 fix: correct gemini-cli project skill path to .gemini/skills
Per Gemini CLI docs (https://geminicli.com/docs/cli/skills/), workspace
skills should be at .gemini/skills/, not .agents/skills/.
2026-02-14 02:18:20 +08:00
Willie bd75ef8939 feat: support target include/exclude filters across sync, UI, and docs 2026-02-14 00:21:48 +08:00
Willie ffd9d43589 fix: target remove now properly cleans up merge mode symlinks
CLI unlinkMergeMode() used exact name matching (sourcePath + entryName)
to identify managed symlinks, which failed for nested skills (flat name
like _team__frontend__ui doesn't match source path _team/frontend/ui)
and orphaned symlinks. Changed to PathHasPrefix-based detection that
checks if a symlink points anywhere under the source directory.

Server handleRemoveTarget() only handled symlink mode (entire dir is a
symlink). Added merge mode branch with unlinkMergeSymlinks() that
iterates target entries and removes symlinks pointing under source.
2026-02-13 22:35:41 +08:00
Willie 5739e59ab6 docs: clarify dev workflow and fix sandbox/dev runtime issues
- Distinguish two dev workflows: make ui-dev (local Go) vs
  dev-docker-up + pnpm run dev (no Go required)
- Add auto-init to dev profile so container doesn't crash on first run
- Add --cap-add ALL to playground volume init (cap_drop blocks chmod)
- Document port 19420 conflict between playground and dev profile
- Add docker-build vs docker-build-multiarch explanation and GHCR pull examples
- Increase git command timeout to 180s for constrained Docker networks
- Increase online test timeout to 300s
- Align Makefile help text formatting
2026-02-13 15:52:53 +08:00
Willie c4a0c64911 feat(docker): add graceful shutdown, security hardening, production/CI images, and dev profile
Server improvements:
- Graceful shutdown with SIGTERM/SIGINT (10s grace period)
- HTTP timeouts (ReadHeader 5s, Read 15s, Write 30s, Idle 60s)
- Health endpoint now returns version and uptime

Compose security hardening:
- read_only filesystem, cap_drop ALL, no-new-privileges
- Resource limits (2 CPU / 2G memory), tmpfs for /tmp
- Playground healthcheck via /api/health

New Docker images:
- docker/production/ — lightweight debian-slim with tini, non-root user, healthcheck
- docker/ci/ — minimal image for skill validation in pipelines
- .github/workflows/docker-publish.yml — multi-arch GHCR publishing on tag push

Script improvements:
- DRY: test_docker.sh --online flag replaces duplicate test_docker_online.sh
- _sandbox_common.sh: Compose v2 version check with install suggestions
- .dockerignore: exclude website/, .github/, editor files

New targets:
- sandbox-status, dev-docker-up/down, docker-build, docker-build-multiarch

Docs updated: CLAUDE.md, README.md, website docker guide with use cases
2026-02-13 15:29:52 +08:00