35 Commits
Author SHA1 Message Date
Willie 9a7ee1b6f7 fix: address code review findings (3 important + 5 suggestions)
- 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
2026-02-28 03:44:02 +08:00
Willie 429e67a88c fix(audit): downgrade data-uri severity to MEDIUM 2026-02-28 03:44:02 +08:00
Willie 1a207e6d2c feat(audit): add fetch-with-pipe, ip-address-url, and data-uri rules
Add 5 new audit rules (31 → 36 total) to close detection gaps:

- fetch-with-pipe (HIGH ×3): curl/wget piped to sh/bash/python/node/etc.
  Previously only double-pipe (||) was caught by shell-chain; single
  pipe (|) to interpreters — the classic RCE vector — was undetected.
- ip-address-url (MEDIUM): URLs with raw IP addresses that bypass DNS
  security controls; excludes RFC 1918 and loopback ranges.
- data-uri (HIGH): data: URIs in markdown links that may embed
  executable content.

fetch-with-pipe is suppressed inside markdown code fences (tutorial
context), matching existing behavior for destructive-commands et al.

Includes unit tests (25 cases), code fence suppression test, red team
TC-18 through TC-21, and audit.md documentation updates.
2026-02-28 03:44:02 +08:00
Willie caa525b8aa feat(website): complete website revamp — Diátaxis IA, blog, recipes, quickstarts
Restructure the entire documentation site following the Diátaxis framework
(Learn / How-to / Understand / Reference) with new content across 110 files.

## Information Architecture (M1)
- Move all docs to Diátaxis directory structure (learn/, how-to/, understand/, reference/)
- Add client-redirects plugin for old URL compatibility
- Rewrite sidebar, navbar, and footer to match new IA
- Update all internal cross-references

## Homepage + Quickstarts (M2)
- Add scenario entry cards to homepage with hand-drawn design
- 5 quickstart pages: Claude Code, GitHub Copilot (with copy mode recommendation),
  Codex, Multiple Tools, Dev Containers, Playground

## Blog + Changelog (M3)
- Enable Docusaurus blog plugin with authors.yml
- 5 blog posts: 5-min tutorial, managing 50+ skills, skillshare vs vercel/skills
  comparison, team sharing patterns, write your first skill
- Static /changelog page from CHANGELOG.md

## Recipes + Philosophy (M4)
- 5 recipe pages: CI/CD validation, enterprise skills, project setup,
  cross-machine sync, team onboarding
- 3 philosophy pages: why-local-first, security-first, sync-modes-explained

## Content Polish
- Cross-validate all content against CLI source (19 inaccuracies fixed)
- Lowercase "skillshare" throughout (avoid brand conflict with Skillshare Inc.)
- Add registry.yaml to file structure and Key Paths docs
- Highlight multi-platform git support (GitHub, GitLab, Bitbucket, Gitea,
  Azure DevOps, AtomGit, Codeberg)
- Standardize brew install command
- Add AsciinemaPlayer component (cast recordings pending)
2026-02-26 22:27:23 +08:00
Willie cd3361f43d feat(build): add Windows ARM64 cross-compile script
For testing on UTM Windows VMs. Scans common shared folder
locations and presents interactive picker when multiple found.

  make build-windows SHARED=~/Downloads
  mise run build:windows ~/Downloads
2026-02-26 22:27:23 +08:00
Willie ed709efb57 fix(ci): update redteam-signal to match handler split
v0.16.0 moved update rollback logic from update.go to
update_handlers.go and changed the error message format.
Update the mutation target file and perl regex pattern so
the signal test finds the expected 2 mutation points.
2026-02-25 07:06:26 +08:00
Willie f8205a27a8 refactor(install): prefer sparse checkout over GitHub API for subdir install
Swap fast path order: sparse checkout is now fast path 1 (works for all
hosts including file://), GitHub Contents API is fast path 2 (fallback
when sparse is unavailable or fails). Also reset subdirPath on sparse
failure to ensure proper fallback chain.

Fix red team helpers to inject -g flag after subcommand, preventing
.skillshare/ auto-detection from hijacking global-mode tests.

Add blocked section assertions to TestUpdate_BatchAll_FailsOnMalicious.
2026-02-25 07:02:54 +08:00
Willie edd5bab6d0 fix(ci): harden redteam signal mutation script 2026-02-23 04:23:53 +08:00
Willie 3ad814d3ba fix: add audit gate to install --track and tracked repo updates
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.
2026-02-23 04:18:01 +08:00
Willie 13691861e4 feat: add structural markdown link parsing for audit rules
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.
2026-02-23 04:18:01 +08:00
Willie 00c3fd146c test: add red team signal tests for mutation and rules-disable
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.
2026-02-23 04:18:01 +08:00
Willie 0af0df57bf test: add red-team phase5 and harden hash path validation 2026-02-23 04:18:01 +08:00
Willie ae6620e484 docs: add supply-chain security lifecycle flowchart to security guide
Mermaid flowchart showing 3 phases: Install gate (audit + hash pinning),
Update gate (post-pull audit + auto-rollback), Integrity verification
(SHA-256 hash comparison). Color-coded nodes for pass/block/warning states.
2026-02-23 04:18:01 +08:00
Willie 5c44acd7d1 test: add red team E2E script for supply-chain security validation
Repeatable bash-based test exercising all audit patterns (CRITICAL→INFO),
update gate rollback, content hash integrity, and batch blast radius.

- scripts/red_team_test.sh: main entry (setup + 4 phases + summary)
- scripts/red_team/: split phases + shared helpers
- Makefile/mise.toml: add `test-redteam` target
- docker/sandbox/Dockerfile: add jq for JSON assertions
2026-02-23 04:18:01 +08:00
Willie 52f55c8521 fix: pull merges by default when both sides have skills, audit resolves nested skill names
- firstPull: attempt merge instead of blocking when both local and
  remote have skills; override merge.ff=only with -c merge.ff=false
- auditSkillByName: fall back to collectInstalledSkillPaths for
  short-name resolution of nested skills (e.g. security/audit-demo-*)
- Add external-link and dangling-link demo skills to sandbox content
2026-02-22 15:13:10 +08:00
Willie 7f742278f0 refactor(build): simplify Make/mise targets from 34 to 21
Sandbox (8→2): consolidate into `make playground` + `playground-down`,
add scripts/sandbox.sh wrapper for advanced ops (up/down/shell/reset/
status/logs/bare).

Test (7→5): remove test-cover and test-install from Make (still
available via scripts directly).

Dev Docker (3→2): merge dev-docker-up and dev-docker-watch into
`make dev-docker` (defaults to Compose Watch for auto-rebuild),
keep dev-docker-down.

Update all docs references: README, CLAUDE.md, quick-reference,
docker-sandbox guide, ui command page.
2026-02-20 22:13:33 +08:00
Willie 1b5056d0ea refactor(docker): unify versions, consolidate init scripts, add sandbox-logs
- Add `make sandbox-logs` / `mise run sandbox:logs` convenience target
- Unify Docker build versions via ARG: Node 24, pnpm 10.28.0, Go 1.25.5
- Extract shared demo content to scripts/create-demo-content.sh, slim down
  setup.sh and sandbox_playground_up.sh from ~150 duplicated lines each
- Move devcontainer scripts (ui, ui-p, docs) to .devcontainer/bin/
  (source-controlled, survives make clean) with auto mode-switching
2026-02-20 12:22:02 +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
Willie 3830543309 feat: auto-commit and auto-pull on init, improve git UX
Init now creates an initial commit (including .gitignore) so that
push/pull work immediately after setup. When a remote is configured,
init fetches and auto-pulls existing skills from the remote.

- Always create initial commit in doGitInit (fixes stale untracked
  .gitignore blocking pull)
- Add ensureGitIdentity: set repo-local fallback when git user.name
  is not configured, with hint to set global config
- Add tryPullAfterRemoteSetup: fetch remote after adding origin,
  auto-pull if remote has content and local is empty
- Add hintGitRemoteError: context-aware hints for SSH, URL, and
  network errors in push/pull
- Show Pro tip only when built-in skill is installed
- Sandbox: add --bare mode (skip auto-init), --volumes for down
  (full reset), and sandbox-reset / sandbox:reset targets
- Docs: update init flow diagram, cross-machine-sync guide,
  push/pull prerequisites, getting-started, troubleshooting
2026-02-13 14:21:36 +08:00
Willie a1a3bafe9e docs: document --into flag and add nested skills to playground
Update 5 website docs to cover the new --into install flag:
- commands/install.md: options table, quick examples, common scenarios
- guides/organizing-skills.md: new "Install Directly into Folders" section
- guides/project-setup.md: --into example in Step 3
- reference/file-structure.md: nested skill in source directory tree
- concepts/project-skills.md: --into in project directory structure

Reorganize playground demo skills into nested subdirectories
(security/, devops/, demos/, guides/) so users see the feature
out of the box.
2026-02-13 14:21:36 +08:00
Willie 57e7b68131 feat: group shared-path agents in project init UI
Multiple agents (Amp, Codex, Copilot, Gemini, Goose, Kimi, OpenCode,
Replit) all map to .agents/skills in project mode. Previously init -p
showed each as a separate selectable entry pointing to the same directory,
which was redundant and confusing.

Now targets sharing a project path are collapsed into a single group entry
(e.g. "agents") with member names shown in parentheses. Discover uses
path-based dedup so an existing "amp" entry correctly prevents the
"agents" group from appearing as new. --select accepts both canonical
and member names for backward compatibility.

- Add project_name/project_path to agents meta-target in targets.yaml
- Add GroupedProjectTargets() in config package with unit tests
- Rewrite detect/list/prompt/discover in init_project.go
- Add agents target to playground demo project
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 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 570195d1a2 feat: enhance skill template, improve search UX, and harden playground
- new: redesign SKILL.md template based on Anthropic's skill-building
  guide — description now includes WHAT+WHEN trigger format, step-based
  instructions (Gather/Execute/Validate), examples, and troubleshooting
- search: prompt for keyword when run without arguments instead of
  auto-browsing popular skills
- playground: default shell to $HOME (/sandbox-home) and mount source
  as read-only to prevent accidental host file modifications
2026-02-09 21:43:10 +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 380907b320 feat(website): redesign with hand-drawn aesthetic and update README logo
Overhaul the documentation site with a hand-drawn design system:
- Custom CSS with paper textures, wobbly borders, and sketchy shadows
- Hero section with dashed ring, sparkle decorations, and floating animation
- Card components with post-it accent colors and tape decorations
- Replace README logo with hero-style version (ring + sparkles + paper bg)
2026-02-09 11:43:27 +08:00
Willie e38a396ee0 docs: add web dashboard to built-in skillshare skill
Add "web dashboard", "skillshare ui" triggers to description for skill
activation. Add Web UI row to commands table. Create references/ui.md
with usage, flags, dashboard pages, project mode differences, REST API
endpoints, and Docker instructions.
2026-02-08 17:25:21 +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 503ee8af24 refactor: DRY up Docker sandbox scripts with shared entrypoint and boilerplate
- Add docker/sandbox/entrypoint.sh to auto-copy /ui-dist → internal/server/dist/
  when missing, fixing the gitignore regression for all Docker workflows
- Add scripts/_sandbox_common.sh with shared SCRIPT_DIR, PROJECT_ROOT,
  COMPOSE_FILE, and require_docker() function
- Refactor all 5 sandbox scripts to source _sandbox_common.sh
- Use YAML extension fields (x-sandbox-common) in docker-compose.sandbox.yml
  to eliminate duplicated service config
- Break sandbox_playground_up.sh one-liner into readable steps, add
  skillshare-ui alias and init hint
- Change test.sh to use `make build` for placeholder consistency
2026-02-08 16:32:28 +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 Hung e7a5419209 feat: add one-line install script
- Add install.sh for curl-based installation (macOS/Linux)
- Add scripts/test_install.sh for sandbox testing
- Update README with Quick Install section
2026-01-15 23:47:25 +08:00
Willie f55e056fa4 feat: add comprehensive sandbox integration tests
Add complete integration test coverage for all CLI commands with
isolated sandbox environments that run on every change.

Changes:
- Add testutil package for sandbox test infrastructure
- Add 77 integration tests covering all commands (init, sync, status,
  diff, backup, restore, pull, doctor, target, version, help)
- Update CI workflow to run integration tests on Ubuntu and macOS
- Add SKILLSHARE_CONFIG env var support for test isolation
- Add mise.toml for task management
- Move scripts to scripts/ directory
2026-01-14 22:35:33 +08:00