Commit Graph
31 Commits
Author SHA1 Message Date
Charitarth ChughandClaude Opus 5.5 64c8a3f34e feat: add Nix flake and handle Nix-store installs in upgrade (#764)
* feat: add Nix flake and stop self-upgrade of Nix-store installs

Add flake.nix with packages, overlays.default, checks and a formatter,
building nix/package.nix with the unit tests in the Nix sandbox. The
version comes from the Release Please manifest, so releases need no Nix
edit. A Nix workflow runs `nix flake check` on non-docs changes.

`skillshare upgrade` now detects binaries under /nix/store/ and prints
`nix profile upgrade skillshare` instead of replacing a read-only store
path; update notices and doctor suggest the same command.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(upgrade): give Nix installs the right update path everywhere

The first flake commit sent every /nix/store binary to `nix profile
upgrade`, failed a plain `skillshare upgrade` with exit 1 even when the
CLI was current, and left the dashboard with a generic 500.

- Tell `nix profile` installs (the profile manifest lists the store path)
  from NixOS, Home Manager and overlay installs, which are told to update
  their configuration and rebuild. Detection lives in one helper shared by
  the update notice, doctor, upgrade and the dashboard.
- `upgrade` on Nix reports "already up to date" or prints the hint and
  exits 0; the built-in skill still updates.
- The dashboard runs the upgrade so the skill updates, then answers
  409 `upgrade.nix` with the command when a newer CLI waits on Nix. The
  UI shows localized text for it in all 11 locales.
- Installs skip the unit tests; the flake's checks enable them. postPatch
  lowers only the go directive's patch version and fails evaluation with
  a clear message when go.mod needs a newer Go minor. CI also builds the
  package on macOS.
- Docs, translations, the built-in skill reference and the release topic
  describe the new behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 15:53:57 +08:00
star-nebula 86f89bf242 test(sourcewalk): cover Windows resolved roots (#673)
Windows temporary paths can use a spelling that differs from the path returned by filepath.EvalSymlinks. Canonicalize test roots before relativizing callback paths and restore internal/sourcewalk to the windows-test allow-list.
2026-10-30 20:25:45 +08:00
Rusty Shackleford 5729eee088 feat(project): manage global registrations from the CLI (#603)
Add global project list, show, add, edit, sync and remove so setup scripts
can register repositories without editing YAML or opening the dashboard.
Keep dry runs read-only and report completed work when a target fails.

Reuse the shared project service and sync runners. Include command docs,
translations, completions and regression coverage. Quote overlap hints for
their shell and log partial project syncs consistently with ordinary sync.
2026-10-26 01:38:04 +08:00
Rusty ShacklefordandClaude Opus 5.5 61eedffe1e fix(oplog): keep selected global config logs in the state dir (#609)
SKILLSHARE_CONFIG can select a global config in a directory named
skillshare or .skillshare. Treating it as a project config puts logs and
a .gitignore beside the shared config and labels global logs as project logs.

Exclude selected and read-only global config paths from project routing.
Share the check with the log command so readers and writers agree.
Run the legacy config regression explicitly in Windows CI so it is exercised
without enabling unrelated tests that still need Windows fixes.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 22:55:36 +08:00
Rusty Shackleford d23a44aec9 refactor(projects): share safe dashboard and CLI operations (#602) 2026-10-23 02:07:54 +08:00
star-nebula e10304eb81 test(theme): enable Windows CI coverage (#589)
Correct Unix-only resolution expectations on Windows and pin terminal and renderer state so the package is deterministic. Add theme to the Windows test job to catch future platform regressions. Related to #344.
2026-10-21 23:08:20 +08:00
star-nebula 750059af31 ci(test): cover internal/memory on windows-latest (#575)
The windows-test job lists only the packages verified to pass on Windows, so
that the job is green on arrival. internal/memory never reached that list: it
is absent from #344's set of failing packages, and no commit ever added it,
which leaves its 36 tests unrun on the platform whose binaries are published.

Cross-compiled the package's test binary for windows/amd64 and ran it on a
real Windows host: 36 top-level tests passed, 0 failed, exit code 0. The
symlink call sites in store_test.go skip or drop their subcases when the
privilege is missing, so a runner without Developer Mode cannot fail on them.
2026-10-15 16:53:52 +08:00
Willie 92183d5a09 test(windows): run audit, config, install, mcp and cmd tests on Windows CI
These packages were left out of the windows-test job because of failures
that came from test assumptions (POSIX paths, permission bits, HOME,
bash shims posing as git), not product behavior. Fix them and add the
packages to the list so they stay green.

Two failures were real product bugs:
- swapStagedIntoSource named its backup like the temp that
  sourcefs.MoveIn creates beside it. On a coarse clock (Windows) both
  names matched, the failed move removed the temp and with it the
  backup, and the old skill was lost.
- MetadataStore.GetByPath looked up OS-native paths in slash-form keys,
  so `update --group` missed nested skills on Windows.

The test sandbox now also sets USERPROFILE, which os.UserHomeDir reads
on Windows; tests were reading the real profile.

Refs #344
2026-10-06 10:46:37 +08:00
Willie 8e9ef1c806 test(sync): make the tests pass on Windows and run them in CI
Ten tests assumed POSIX behaviour:

- Five asserted os.ModeSymlink, but Windows links with a junction;
  check utils.IsLinkMode instead.
- Two used `/abs/...` as an absolute path, which has no volume on
  Windows; give the fixtures one.
- Windows has no permission bits to preserve, so the 0600 check is
  skipped there.
- Reading a file as a directory reports not-exist on Windows, which
  prune ignores, so that prune-error test is skipped there.
- A single-file extension relies on the shebang and the executable bit,
  so ListExtensions finds only directory extensions on Windows, as the
  extras docs describe.

Add ./internal/sync and ./internal/trash to the windows-test package
list so they stay green.

Refs #344
2026-10-06 09:40:50 +08:00
Willie 3ba95ef49e feat(plugin): add npm packages from pi.dev through Pi (#363)
* chore(design): export dashboard tokens for design tools

Mockup tools read a design system's tokens.json rather than our CSS, so
designs drifted from the dashboard's Clean theme. The script derives the
tokens from components.css, and CI runs its test so a new color
variable without a usage note fails instead of silently going missing.

* feat(plugin): add npm packages from pi.dev through Pi

Pi packages on pi.dev are npm packages, which Plugins could not add:
it only took local or Git sources, so users had to install them with Pi
and import them. `plugin add npm:<package>` now hands them to
`pi install` for Pi targets and records the binding like an import.

Skillshare can't fetch or review an npm package, and Pi runs its install
scripts, so the preview says so, discover refuses npm sources, and only
targets that run pi itself take them. Pi keeps one entry per package
name, so another version replaces it in place and keeps its extension
filters; Skillshare records the new entry so a reinstall restores them,
and refuses a package another Skillshare package already manages, since
removing one would remove both. Pinned versions are skipped on update
because pi update keeps them.

The dashboard accepts npm sources, a pasted `pi install` command or a
pi.dev address, lists only Pi targets, and the Pi Extensions tab links
to adding a package with that target selected. Pi packages show Pi's
mark in the plugin list.

A blocked change now keeps its own reason when the Agent's CLI is also
missing, and the message key always matches the message the CLI prints.

* fix(plugin): keep npm package names and accept pi by path

The default name of an npm package went through the file-path rule, which
cut its last dot segment as an extension: npm:foo.bar was recorded as foo,
and adding npm:foo.bar@1.2.3 later derived foo.bar and was refused as
another package managing the same Pi entry. npm names are now taken from
the package spec.

A Pi account whose CLI is an absolute path to pi was treated as running
another executable, so it could not take npm packages. It now uses the
same path- and platform-aware check as the Pi Extensions tab.

* docs(wiki): add a pull-requests topic for Codex review rounds

Handling Codex's review was only known from practice: confirm each
finding, fix it with a failing test first, reply in its thread, ask for
another review, and follow up until it answers. Writing it down keeps
agents from resolving threads, amending pushed commits, or stopping at
the 👀 that only means the review is still running.

* feat(ui): give the Extras AGENTS.md and Memory tabs one layout

The two tabs shared a page but looked like different products: the header
shifted between them, notes sat in a joined box with an icon toolbar, and
agents showed as an icon strip in a side card. Switching tabs felt jarring.

Memory now follows the AGENTS.md layout: a sticky list column with search,
the note's name with Edit and a More actions menu, the same preview box,
and Use with agents as one row per tool under the note. Long notes open
collapsed like shared files do. The AGENTS.md list gains a search box and
the same sticky column. The Memory tab label stays English in every locale,
like AGENTS.md. Docs and screenshots follow the new layout.

* chore(docs): add a script that serves the Memory screenshot homes

The Memory how-to screenshots came from demo homes that were never
recorded, so reshooting them meant rebuilding the data by hand. The script
rebuilds the fresh and the populated home inside the devcontainer, serves
each behind the Vite dev server, and hands the port back to air afterwards.

* fix(plugin): refuse npm sources Pi can't resolve

validNpmSource accepted specs such as npm:foo/bar, npm:foo@ and names
containing "..", which Pi's own parser rejects. They passed preview, and
Apply recorded a pending binding before pi install failed, leaving an
entry every later sync retried. Validate with the same grammar the Pi
settings reader uses, which also covers a scope without a package name.

* fix(ui): show the default name when adding an npm package to Pi

The name field for an npm source was blank, so it looked like a name was
missing. Leaving it empty records the package name without its version or
scope, as the git flow already shows; the field now shows that name as its
placeholder.
2026-10-04 00:43:43 +08:00
star-nebulaandWillie 3c440ceee2 ci(test): test the packages that already pass on windows-latest (#351)
Releases publish windows_amd64 and windows_arm64 archives, and `_windows.go`
files compile only on Windows, yet every job in this workflow runs on Linux or
macOS: a Windows-only regression reaches users at release time instead of at
review.

Start the coverage with the 15 packages that pass on windows-latest today, so
the job is green on arrival rather than a permanent red check. The 14 packages
that fail there are listed in #344 with the failures behind them, and each fix
adds its package back to this list.

-race stays off because the race detector needs a C toolchain on Windows;
ubuntu and macOS already run the raced suite. -count=1 keeps a cached result
from reporting a pass for a package that never ran.

Co-authored-by: Willie <egg358358@gmail.com>
2026-10-03 13:22:38 +08:00
Willie 031c33c1b1 ci(test): skip the duplicate push run for release commits (#319)
Merging a Release PR ran the full Test suite twice on the same commit:
once for the push to main, and once from Release Please, which calls
Test with the exact merge SHA before tagging. Skip the push run for
chore(main): release commits; the release gate still runs every job.

The Release PR's own runs stay, because their matrix checks are
required by branch protection, and a skipped matrix job never reports
its per-OS check names, which would block the merge.

A newer push to a pull request now cancels that pull request's running
tests instead of finishing a superseded run.

Validation: actionlint v1.7.12 on all workflows, and a simulation of
every job's condition for push, release gate, pull request, fork pull
request and schedule events against the current workflow.
2026-10-02 03:57:06 +08:00
Willie 654cceb768 ci(release): keep the UI archive out of GoReleaser's dirty check (#320)
Packaging the v0.23.2 draft failed with "git is in a dirty state" on
the untracked skillshare-ui-dist.tar.gz. The old --skip=validate hid
this until the release automation removed it. Exclude the archive in
the checkout's .git/info/exclude rather than .gitignore, because a
rebuild checks out an existing tag whose .gitignore cannot change,
and keep GoReleaser's validation on.

Validation: actionlint, and GoReleaser v2.18.2 on a clone of v0.23.2
with a stand-in UI archive: without the exclude it reproduces the CI
error; with it, release --skip=publish builds all six archives and
lists the UI archive in checksums.txt.
2026-10-02 03:56:30 +08:00
Willie 4ff5316789 ci(release): deploy the website only from a published release
Pushes to main deployed the website immediately, so docs for unreleased
features went live before the release that ships them. Publish Release now
deploys the released tag after publication, the same way it calls Docker
Publish, and only the Cloudflare secrets are passed to the deploy.

Website Pages can still be dispatched with a tag or branch to redeploy or
ship a docs-only fix.

Validation: actionlint on all workflows and ai-context check.
2026-10-02 02:29:47 +08:00
Willie 1fe668ec54 ci(release): add reviewed version PRs and manual publication
Create Release Please PRs, synchronize release metadata, and test the exact merge commit before tagging and building an unpublished draft.

Verify release artifacts before manual publication and keep Homebrew and Docker distribution tied to the approved version. Document explicit version overrides and squash-merge behavior in the release skills and runbook.

Validation: make check, 12 release helper tests, actionlint, and an isolated six-platform GoReleaser build with artifact verification.
2026-10-02 01:53:47 +08:00
Willie dc3a2b8b1f chore(toolchain): update frontend dependencies and pnpm
Refresh the UI build stack and align local, container, and release workflows on pnpm 12.6.0. Record the approved esbuild install script and repair UI dependencies on initialized devcontainer starts.
2026-09-30 00:12:18 +08:00
Willie fe6584bc67 ci(website): build the docs only for pushes to main
Pull requests that touched website/ ran the full docs build, and a fork's
PR waited for approval to run it. Pushes to main still build and deploy,
so a broken link fails that run instead of the PR.

A newer push now cancels a run still in progress, so an older build
can no longer deploy stale docs over a newer one.
2026-09-27 19:28:48 +08:00
Willie 262e639701 docs: add task-routed agent wiki
Add a shared instruction kernel and byte-budgeted topic router so agents load only task-relevant repository guidance. Wire drift checks into local and CI workflows and point project skills at the routed topics.
2026-09-25 02:32:37 +08:00
Willie fee069841b ci(website): split build and deploy jobs 2026-06-11 11:41:46 +08:00
Willie 5d60242585 ci: skip tests for docs-only changes 2026-06-11 11:24:35 +08:00
Willie 68639be975 ci(website): deploy to cloudflare pages 2026-06-11 11:06:10 +08:00
Willie 855d74fbac ci: add red team jobs with nightly schedule
Run red team tests on push/PR. Signal tests (mutation + rules-disable)
run on push, nightly cron, and manual dispatch only.
2026-02-23 04:18:01 +08:00
Willie 7e5682ee73 ci: append contributors section to release notes
Add post-GoReleaser step that queries GitHub Compare API for commit
authors between tags, excludes bots and maintainer (runkids), and
appends a ## Contributors section with @mentions to the release body.

Uses RELEASE_TEMPLATE.md with envsubst (scoped to two variables) to
keep the format editable outside the workflow YAML.
2026-02-22 15:13:10 +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 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 5df04bdc36 chore: gitignore internal/server/dist/ and auto-create placeholder on build
Build artifacts (favicon, logos, index.html) were tracked in git to
satisfy go:embed, causing noisy diffs after `make ui-build`. Now the
entire dist/ is gitignored and `make build` auto-creates a minimal
placeholder index.html when dist is missing, so fresh clones still
compile without a frontend build step.

CI workflows updated to use `make build` instead of bare `go build`
to pick up the placeholder logic.
2026-02-08 16:12:43 +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 3ec3c3060a ci: add docker sandbox CI jobs and release test gate
- Add workflow_call trigger to test.yaml for reusable workflow support
- Add docker-sandbox-offline and docker-sandbox-online CI jobs
- Gate release.yaml behind test.yaml so all tests must pass before
  GoReleaser runs
2026-02-07 23:13:08 +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
Willie 165ffad36d feat: enable Homebrew tap support 2026-01-14 19:57:06 +08:00
Willie b3b7bcf0fc feat: initial release of skillshare
Share skills across AI CLI tools (Claude Code, Codex, Cursor, Gemini, OpenCode)
with a single source directory and symlinks.

Commands:
- init: Initialize with source directory, auto-detect CLI tools
- sync: Migrate existing skills and create symlinks
- status: Show target status
- target: Manage targets (add/remove/list)
2026-01-14 18:09:36 +08:00