713 Commits
Author SHA1 Message Date
Willie f255c4a28b fix: scope agent installation to the requested filter (#183)
Installing a specific skill from a mixed repo dragged in every agent.
The -a/--agent handler implicitly set Kind=agent, but -s/--skill never
set Kind=skill, so installDiscoveredAgents could not tell that the user
had narrowed the install — and it looped over every discovered agent
without applying the -a name filter.

Fix the install path so agents track the user's intent:

- -s/--skill (without -a) installs only the named skills, no agents.
- -s/--skill with -a installs only the named agents, via selectAgents,
  matching the pure-agent path.
- --all/--yes still installs everything.
- An unknown -a name fails the whole command before any skill is
  installed (validated up front against the discovered agents, including
  repos with no agents at all), so automation never sees a half-success.

Add integration tests covering each case.

Fixes #183
2026-06-01 14:42:24 +08:00
Letiancheng Lee 50e6cb885f feat: add target removal hints to doctor suggestions 2026-05-31 22:49:02 +08:00
Willie 85cc972f95 docs(doctor): document suggestions field; refine remediation wording
Follow-up to eb99118d (doctor overlap suggestions):

- Document the optional `suggestions` JSON field in doctor.md with an example

- Clarify shared-paths wording: the listed targets are all current collisions, not "the others"

- Print the cross-target suggestion after overlap detail lines for a more natural read order
2026-05-31 20:56:37 +08:00
TiR eb99118dc5 Add doctor overlap remediation suggestions 2026-05-31 20:53:18 +08:00
Willie 4d08690d36 fix(review): address PR #174 review feedback
- handler_git: dashboard Pull auto-sync now uses EffectiveSkillsSource()
  instead of the git_root scope dir, so it no longer mangles skill rel
  paths (skills/foo -> skills__foo) when git_root is root/agents/extras
- extension: run the transform subprocess via CommandContext with a 30s
  timeout so a hung extension can't block sync indefinitely
- md-toml.js (codex-agents, gemini-commands): escape values via
  JSON.stringify so control characters produce valid TOML basic strings
- gitroot: quote paths in the commit/push mv guidance so paths with spaces
  can be pasted safely
- extras list + extras server handlers: warn when an extension fails to
  resolve instead of silently falling back and reporting false drift

Lock-contention suggestions on handleSetGitRoot/handleAbsorbNested are not
applied: this is a single-user localhost dashboard, and dropping the write
lock around .git-mutating operations trades safety for negligible throughput.
2026-05-30 19:23:12 +08:00
Willie 2f6f6bd052 fix(git): enforce root-scope safety on commit/push instead of warning
Root-scope git operations detected hazards but proceeded anyway, letting
preventable mistakes reach the remote:

- Nested git repos were only warned about, then committed/pushed as empty
  submodules (silent data loss). Now commit/push abort (CLI non-zero exit,
  server 400) until the nested repos are disabled, and the web UI disables
  the commit/push buttons while any are present.
- The pre-stage safety sweep ran before the dry-run check, so `--dry-run`
  wrote .gitignore and ran `git rm --cached config.yaml`. The sweep/guard is
  now strictly read-only on dry-run and only reports what would change.
- Server git endpoints used EffectiveGitRoot() without validating git_root,
  so a hand-edited invalid scope silently fell back to skills. They now share
  a gitSource() guard that rejects invalid scopes with 400, mirroring the
  CLI's resolveGitRoot.
2026-05-30 19:23:12 +08:00
Willie 7419bc74d2 fix(extras): resolve extension target mode consistently in CLI and server
The dashboard computed extension target status with EffectiveMode, which defaults an empty mode to merge, so a valid transform extension target (extension set, no explicit mode) was always reported as drift. Introduce sync.ResolveExtensionMode as the single source of truth (empty/copy resolve to copy, anything else errors) and use it across the CLI, sync, status, and diff paths.
2026-05-30 19:23:12 +08:00
Willie fc07a3c3ea fix(config): reject invalid git_root scope keyword
An unknown git_root value silently fell back to the skills scope via ScopeDir's default case, so a typo like "agnets" made commit/push/pull operate on the wrong repository without any warning. Validate the scope at the commit/push/pull entry point (resolveGitRoot) and in ValidateConfig, reusing the existing ValidGitRoot check backed by a new ValidGitRoots list.
2026-05-30 19:23:12 +08:00
Willie eda9ac75a4 feat(git-root): guard root scope against submodule traps and config leaks
At the root git_root scope, `git add -A` over the config base directory
records any subdirectory that has its own .git (e.g. the skills source) as
an empty submodule, and can commit the machine-specific config.yaml.

- Detect nested repos and warn before commit/push (CLI) or surface them on
  the Git Sync page with a one-click "Disable nested .git" action (UI),
  which renames .git to .git.disabled (reversible) and drops any stale
  gitlink from the index so the directory's files track as normal blobs.
- Keep config.yaml out of a root-scope repo automatically: ensure it is
  ignored and untrack it (git rm --cached) before staging, on both the CLI
  and the web UI commit/push paths.
- Expose nestedRepos/configTracked in GET /api/git/status and add
  POST /api/git/absorb-nested (validated against detected nested repos).
2026-05-30 19:23:12 +08:00
Willie e158f77f03 fix(init): route --remote through validated git.SetOrAddRemote
The CLI addRemote ran a raw "git remote add origin <url>" with the
user-supplied URL, sharing the argv flag-smuggling risk just fixed in the
git package. Delegate to git.SetOrAddRemote so the --remote flag goes
through the same leading-dash rejection and "--" terminator, removing the
duplicated exec path.
2026-05-30 19:23:12 +08:00
Willie 5807a4c743 feat(init): set remote during headless git_root scope switch
Combining --git-root <scope> with --remote <url> on an already-initialized
setup now switches the scope and wires the remote onto the new scope's repo
in one command, instead of warning and ignoring --git-root. Reuses the
existing scope-switch and remote-configuration paths back to back.
2026-05-30 19:23:12 +08:00
Willie 9ca77bd12e feat(init): friendlier error for global-only git flags in project mode
Project init rejected --git-root (and other git flags) with a bare 'unknown
option', which is confusing when the user just forgot that git integration is
global-only — easy to hit when the current directory has a .skillshare/ and
init auto-detects project mode. Match git-related flags (--git-root, --git,
--no-git, --remote) explicitly and explain they are global-only, pointing at
'skillshare init -g <flag>'. Add TestInitProject_GitRootFlag_RejectedAsGlobalOnly.
2026-05-30 19:23:12 +08:00
Willie 314e2b2df4 feat(init): switch git_root scope headlessly on an existing setup
Previously 'skillshare init --git-root <scope>' on an already-initialized
setup either errored with 'already initialized' (no --remote) or warned and
ignored the flag (with --remote), so there was no non-interactive way to
change the scope after init — only the web UI or a manual config edit.

handleExistingInit now treats 'init --git-root <scope>' (without --remote) as
a headless scope switch via switchGitRootScope: it inits a repo at the new
scope directory (reusing one already there, sharing doGitInitIfAbsent with the
fresh-init and server paths) and persists git_root. It does not relocate an
existing repo — switching scope means 'version a different directory', not
'move history'. Combined with --remote the flag still falls through to the
remote path, now pointing users at the standalone form instead of a bare
'ignored' warning.

Update the mismatch guidance to offer 'skillshare init --git-root <scope>' as
the first fix, and revise the git_root docs (configuration + init) to document
the headless switch, superseding the earlier 'must re-run init / not supported'
wording. Add TestGitRoot_SwitchScopeAfterInit.
2026-05-30 19:23:12 +08:00
Willie 9fb7b1eca4 docs(git-root): clarify how to change scope after init; fix misleading mismatch guidance
The mismatch guidance told users to re-run 'skillshare init', but init warns
and ignores --git-root once a repo already exists, so it never relocates the
repo. Reword the CLI message to state the real options: run 'git init' at the
new scope dir for a fresh history, or 'mv <old>/.git <new>/.git' to keep
history, or set git_root to match the existing repo.

Add a 'Changing the scope after init' section to the git_root config reference
and point the commit/push/pull pages at it, replacing the same misleading
're-run init' phrasing.
2026-05-30 19:23:12 +08:00
Willie 32fd08c692 feat(list): filter skills by enabled/disabled status in list TUI
Large skill lists made it hard to spot which skills are disabled via
.skillignore. Add a status filter to `skillshare list`: press `s` to
cycle the All -> Enabled -> Disabled view, shown as a `Status:` chip
beside the tab bar. The `s:enabled` / `s:disabled` filter token is also
supported for combining status with other tags (e.g. `t:tracked
s:disabled`). Toggling a skill's state while a status filter is active
re-applies the filter so it leaves the view.

Closes #172
2026-05-30 19:23:12 +08:00
Willie 372dd65768 fix(extras): enforce --force contract and consistent status for transform extensions
Transform-extension sync previously wrote each generated file via
runExtensionFile unconditionally, so a regular local target file (e.g. a
hand-edited hello.toml) could be overwritten from hello.md without --force,
violating the same conflict contract that copy/merge modes honor.

- Split runExtension (subprocess → bytes) from runExtensionFile (writes),
  and have syncExtraTransform apply the conflict/force rules: idempotent
  when identical, skipped on conflict without --force, overwrite with
  --force, and auto-replace leftover symlinks.
- Centralize the copy-only mode rule in SyncExtra so the API and CLI reject
  extension+merge/symlink identically; align the server sync handler's mode
  normalization (EffectiveMode's "merge" default no longer leaks through).
- CLI `extras list` no longer short-circuits to an "extension" status before
  existence/drift checks. Status is now computed via output_ext-aware
  CheckSyncStatus; a new Extension field carries the display label, decoupled
  from sync status (plain-text + TUI rendering updated).
- Roll back the optimistic cache update in the UI mode-change handler on
  failure (fixes the unused-var build break).

Adds regression tests covering conflict skip/force/idempotent/symlink-replace
and non-copy mode rejection.
2026-05-30 19:23:12 +08:00
Willie f88044e2cc fix(extras): report synced status for transform targets
CheckSyncStatus compared each source file against targetDir/<source-name>,
but a transform extension renames output (foo.md -> foo.toml), so the
.toml file was never found and the target was always reported as drift —
even right after a successful sync. Thread the extension's output_ext
through CheckSyncStatus so the expected target filename matches the
transformed output. The web list now resolves the spec to pass it.
2026-05-30 19:23:12 +08:00
Willie 9aa09de9c0 fix(extras): apply transform extension on all sync paths
The web UI sync handler, sync --all --json, and the extras TUI sync all
passed a nil ExtensionSpec to SyncExtra, so a target's configured
extension was silently ignored — files were copied verbatim (e.g. .md
stayed .md instead of being transformed to .toml). Resolve the per-target
extension on each path, mirroring the regular CLI sync. Add a server
regression test asserting the transform runs (output renamed to .toml).
2026-05-30 19:23:12 +08:00
Willie fcbfd39be2 refactor(extensions): describe and rename built-ins by output
md2codex / md2gemini named the *input* (markdown) and read poorly. Rename
the bundled extensions after what they produce: codex-agents and
gemini-commands. Turn the BuiltinExtensions catalog into structs carrying
a human-readable description so the dashboard can explain each one before
install, and propagate the new names across tests and docs.
2026-05-30 19:23:12 +08:00
Willie c200349540 feat(cmd): skip extension targets in collect; label them in list 2026-05-30 19:23:12 +08:00
Willie 519f7f9412 feat(cmd): apply extension transform during extras sync 2026-05-30 19:23:12 +08:00
Willie aa309d52d7 feat(cmd): resolve extension value and validate transform mode 2026-05-30 19:23:12 +08:00
Willie 425c32d489 refactor(sync): thread extension spec param through SyncExtra 2026-05-30 19:23:12 +08:00
Willie e51134af24 feat(git-root): surface scope mismatch in UI and document git_root field
Add Config.GitRootMismatch() as the single source of truth for detecting
when the git repo lives at a different scope than git_root configures, and
reuse it across the CLI guidance, the server status response (scopeMismatch
/mismatchScope/mismatchDir), and a new warning banner on the Git Sync page.

Document git_root in the config structure-view field docs (fieldDocs) and the
GitStatus client type, and add the gitSync.scope.* / gitSync.mismatch.* i18n
keys across all locales to keep dictionary parity.

Cover the behavior with config, server handler, and CLI integration tests:
push/pull honor the root scope (agents files reach the remote, config.yaml
stays untracked), POST /git/root inits+persists the scope and rejects invalid
scopes and project mode, and git status reports scope mismatches.
2026-05-30 19:23:12 +08:00
Willie 16c6e8ec8d feat(server): git operations honor git_root scope + POST /git/root to switch scope
- extract shared git.InitScopeRepo/WriteScopeGitignore/EnsureLocalIdentity (UI-free)
- cmd init delegates to the shared helpers (no logic duplication)
- handler_git operations use EffectiveGitRoot; status exposes the scope
- new POST /api/git/root inits a repo at the target scope dir + persists git_root
2026-05-30 19:23:12 +08:00
Willie 9e371f2dde refactor(git-root): enforce config.yaml exclusion, dedupe scope mapping, warn on scope change
- writeInitGitignore now appends config.yaml to a pre-existing root .gitignore
  if missing (enforces the safety guarantee instead of best-effort)
- single source of truth config.ScopeDir; EffectiveGitRoot/scopeDir/gitRootScopes delegate
- warn when --git-root is passed with --remote on an already-initialized repo
- use 0o644 and check WriteFile errors; add tests for the append + agents scope
2026-05-30 19:23:12 +08:00
Willie 757a6c0074 feat(init): scope-aware git init with interactive picker and root .gitignore 2026-05-30 19:23:12 +08:00
Willie 9cad34f3b2 feat(pull): operate on configured git_root scope 2026-05-30 19:23:12 +08:00
Willie e4287f3061 feat(push): operate on configured git_root scope 2026-05-30 19:23:12 +08:00
Willie abeeb93dbe feat(commit): operate on configured git_root scope 2026-05-30 19:23:12 +08:00
Willie a41accc00c feat(cli): add resolveGitRoot scope resolver with mismatch detection 2026-05-30 19:23:12 +08:00
Willie 0becff010e feat: add local commit command 2026-05-27 15:10:00 +08:00
Willie a2f958d288 feat(ui): background mode, in-place upgrade, and PWA support
Three user-visible additions to the web dashboard, plus the CLI surface
needed to drive them.

* `skillshare ui start` / `skillshare ui stop` — run the dashboard as a
  managed background process. Re-running start reuses the existing
  healthy process; stop uses the remembered host/port. Foreground
  `skillshare ui` keeps working unchanged. Process tracking lives in
  ui_process_{unix,windows,other}.go via a PID + current-state file.
* `--app` — opens the dashboard in a Chromium app-mode window (Chrome,
  Edge, Brave) on macOS, Windows, and Linux for a separate Dock/taskbar
  entry without browser chrome.
* In-place upgrade from the browser — the Update dialog and the Doctor
  page's Version card now expose an Update now button. Backed by two
  new endpoints (POST /api/upgrade, POST /api/restart in
  handler_restart_upgrade.go); the browser polls GET /api/health and
  reloads once the new server is ready. Dev builds short-circuit with
  `devMode: true` and a simulated restart so the flow can be exercised
  without rebuilding the binary.
* Progressive Web App — site.webmanifest, app icons (192/512), and a
  minimal service worker registered from main.tsx. Supporting browsers
  can install the dashboard as a standalone desktop app.
* Doctor Version card redesign — state-coloured icon (blue when an
  update is available, green when up to date), explicit
  `current → latest` delta, Update button only when there is something
  to upgrade.
* i18n — translate "DEV mode" in zh-TW / zh-CN / ko (previously left
  as raw English).

Adds CHANGELOG.md and website changelog entries for v0.19.20 and
refreshes website/docs/reference/commands/ui.md to document the new
modes, --app flag, new REST endpoints, and the in-place upgrade flow.
2026-05-24 01:21:06 +08:00
Willie c60bfd3c08 chore: release v0.19.19 2026-05-23 01:18:38 +08:00
WillieandClaude a61a0e3bea fix(install): include root SKILL.md in tracked repo discovery
After Phase A (210605ea) fixed metadata + status display for tracked
repos with a root-level SKILL.md, three output gaps remained:

- 'Found 0 skill(s)' on install (should be 1 — root SKILL.md counts)
- 'tracked_repos[].skill_count' was 0 (same root-case)
- 'Run sync' suggestion appeared even when no skill was discovered

Root cause: install/update used discoverSkills(destPath, false) which
walks the tracked repo's own root, treating the root SKILL.md at
relPath='.' as ignored. But 'skillshare sync' walks the source
directory; the same SKILL.md inside _<name>/ has relPath='_<name>'
(not '.') and is discovered as a normal skill. The two walkers used
the same helper with different includeRoot settings and produced
inconsistent counts.

Changes:

- installTrackedRepoImpl and updateTrackedRepo: switch to
  discoverSkills(repoPath, true) so SkillCount matches sync's view.

- buildTrackedRepoJSON: when counting skills per repo, accept both
  RelPath='<repo>/...' (nested) and RelPath='<repo>' (root-only).

- handleTrackedRepoInstall: suppress the 'Run sync' next-step when
  the repo had no skills/agents discovered.

Closes #163

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-22 11:29:01 +08:00
WillieandClaude 210605ea4e fix(install): persist metadata for tracked repos with root-level SKILL.md
When --track installed a repo whose SKILL.md sits at the repository root
(non-spec layout), the install reported success but:

- .metadata.json gained no entry (cross-machine recovery via metadata broken)
- status --json tracked_repos did not list the repo

Two coupled bugs caused this:

1. cmdInstall gated ReconcileGlobalSkills on len(InstalledSkills) > 0.
   Tracked repos with no discoverable nested skills produced an empty
   InstalledSkills slice, so reconcile never ran and never detected the
   _<name>/.git directory to write a tracked entry.

2. extractTrackedRepos derived repo names from discovered skills, so
   repos with zero discoverable skills were silently dropped from status
   and list output.

Fix both by:

- Making the post-install reconcile unconditional on success. Reconcile is
  idempotent and cheap; gating it on InstalledSkills > 0 created a path
  where successful installs left metadata stale.

- Switching extractTrackedRepos to install.GetTrackedRepos (a directory
  walk for _-prefixed git repos), the same source-of-truth used by check
  and update. Shared across status, status_project, list, and list_project.

Closes #163

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-22 10:57:55 +08:00
Willie 4d7011983c feat(sync): warn on skill path overlap with one-line hint
Detect overlapping target paths during sync — either two targets
sharing the same primary path, or cross-runtime discovery via the
also_scans table — and surface a brief one-liner pointing users at
`skillshare doctor` for the full breakdown.

Triggers in both CLI (sync.go, sync_project.go) and Web UI (sync API
warnings array, rendered by existing SyncPage warnings card). Detection
logic lives in internal/config/path_overlap.go and is shared between
both paths.

Quiet by design: no output when no overlap exists. JSON output mode
remains untouched.
2026-05-22 01:00:54 +08:00
Willie 88a1bd50a4 feat(doctor): warn on shared paths and cross-target discovery
Add two new doctor checks to detect duplicate-skill problems
surfaced in issue #135:

Layer 1 — checkSharedTargetPaths:
  Warns when two or more enabled targets resolve to the same
  filesystem path after tilde expansion. Pure metadata check; no
  runtime probing. Catches universal/warp/witsy all sharing
  ~/.agents/skills.

Layer A — checkCrossTargetDiscovery:
  Driven by a new also_scans field in targets.yaml that documents
  paths a target's runtime reads beyond its primary skills
  directory. Sourced from each tool's official docs. Populated
  for amp, antigravity, codex, cursor, firebender, kimi, roo.

  Warns when an enabled target's also_scans path is the primary
  path of another enabled target. Example: enabling codex +
  universal warns that Codex's runtime will see ~/.agents/skills
  content.

  Overlaps are grouped per scanner so a multi-overlap target
  (e.g. firebender reading 5 brand dirs for cross-compat) emits
  a single warning with indented detail lines.

config:
  - New targetAlsoScans struct + AlsoScansGlobal / AlsoScansProject
    accessors.
  - targets.yaml schema is backward-compatible (optional field).

Layer B (sync engine routing) and Layer C (user-declared
authoritative roots) are intentionally deferred — diagnosis comes
first, behaviour changes only if users actually ask.
2026-05-21 23:49:40 +08:00
Willie 8e0117a29d feat(init): emit sources map for new global configs (Phase 4)
Fresh `skillshare init` (global) now writes the v0.19.16 `sources:` map
instead of the legacy top-level fields:

  sources:
    skills: ~/.config/skillshare/skills
    agents: ~/.config/skillshare/agents

What changed:
- cmd/skillshare/init.go: construct Config with Sources{Skills, Agents}
  rather than Source/ExtrasSource. The --subdir update path writes to
  cfg.Sources.Skills accordingly. The --remote re-init path uses
  cfg.EffectiveSkillsSource() for git operations so it works whichever
  shape the existing config uses.
- internal/config/config.go: add `,omitempty` to Source field so configs
  that only set sources.skills don't get a noisy `source: ""` line.
- tests/integration/extras_test.go: rename TestInit_SetsExtrasSource to
  TestInit_WritesSourcesMap and assert the new shape (sources map
  present, legacy source/extras_source/agents_source absent).

Existing configs are untouched — legacy fields keep working through
Config.Effective*Source helpers. No auto-migration on Save.
2026-05-21 14:54:24 +08:00
Willie 996d00e342 feat(config): migrate consumers to Effective*Source helpers (Phase 3+5)
Make the v0.19.16 sources map actually do something: route all path
reads through Config.EffectiveSkillsSource() / EffectiveAgentsSource() /
EffectiveExtrasSource() so users who set sources.skills / sources.agents /
sources.extras get the configured paths everywhere.

Mechanical changes (~50 files):
- cmd/skillshare/**: replace cfg.Source / cfg.ExtrasSource reads with
  cfg.EffectiveSkillsSource() / cfg.EffectiveExtrasSource()
- internal/server/**: replace s.cfg.Source / s.cfg.ExtrasSource reads
  with the same helpers; server.skillsSource() / gitignoreDir() use the
  global-mode helper
- internal/config/config_validate.go: validate using EffectiveSkillsSource
  while still rejecting configs that set neither field explicitly
- internal/config/reconcile.go, registry.go: read via helpers

Behavioral fixes (paired with the migration):
- extras init / extras source / POST /api/extras no longer silently
  backfill the legacy extras_source field — the runtime fallback inside
  EffectiveExtrasSource() handles it. This stops surprise diffs in users'
  config.yaml after running extras commands.
- extras source command writes back to whichever field the user already
  configured (sources.extras if set, otherwise legacy extras_source) so
  the update is not shadowed.
- source_type in /api/extras and extras list correctly reports "default"
  vs "extras_source" by inspecting the raw (unresolved) configured value;
  sources.extras counts as configured for this purpose.

UI:
- ui/src/lib/fieldDocs.ts: neutralize sources / sources.* descriptions
  so they describe both project and global modes (Phase 5).

Preserved (intentional):
- Direct writes to cfg.Source / cfg.AgentsSource / cfg.ExtrasSource in
  init, migrate.go, cloneForSave, and server.reloadConfig — these are
  raw-field writes, not path reads.
- Updated test expectations for the removed backfills.
2026-05-21 14:49:11 +08:00
Willie 8731554456 fix: fail closed on config load error in agents check
Project-mode 'check agents' previously fell back to .skillshare/agents
when LoadProject failed. With custom sources.agents this could scan
the wrong directory and report green while the configured source is
unchecked. Now returns the load error instead.
2026-05-20 18:28:32 +08:00
Willie bb3745b8f5 fix: reject source/target path overlap and fail closed in check
ValidateProjectConfig now resolves each target's skills/agents path
and rejects configs where a source aliases or nests with any target
path. Without this guard, sources.skills: .claude/skills with a
claude target makes sync --force delete the source.

check -p now returns an error on LoadProject failure instead of
falling back to .skillshare/skills.
2026-05-20 18:24:41 +08:00
Willie 4f908a171e fix: fail closed on config load error in enable/disable/new commands
Project-mode disable/enable and new previously fell back to default
.skillshare/{skills,agents} when LoadProject failed. With custom
sources this could write .skillignore/.agentignore or create new
skills in the wrong directory. Now both paths return an error
instead of silently using the default path.
2026-05-20 18:02:58 +08:00
Willie 49abc19eef fix: fail closed on config load error in destructive uninstall commands
Project uninstall previously fell back to default .skillshare/skills
when config was malformed. With custom sources this could trash skills
from the wrong directory. Now both skill and agent uninstall paths
return an error instead of silently using the default path.
2026-05-20 17:09:24 +08:00
Willie 5b7ca8ba3d fix: trash before gitignore cleanup and skip gitignore for external sources
Reorder handleUninstallRepo to move repo to trash before removing the
.gitignore entry, preventing accidental exposure of tracked content
when trashing fails.

ProjectGitignoreTarget now returns empty strings for source paths
outside projectRoot, since parent-relative patterns (../) are invalid
in .gitignore. All six callers guard on empty gitignoreDir and skip
gitignore management for external sources.
2026-05-20 16:34:02 +08:00
Willie 0c010c55f4 fix: wire custom sources into server reload and gitignore paths
reloadConfig now updates s.cfg.Source and s.cfg.AgentsSource from the
refreshed ProjectConfig so project UI handlers see the latest source
directories after a config edit.

Add ProjectGitignoreTarget helper that computes the correct .gitignore
directory and entry prefix based on whether the source path is inside
.skillshare/ or a custom location. All gitignore write and remove
operations (reconcile, install, uninstall, server handlers) now use
this helper instead of hardcoded 'skills/' prefix.

Fix nil projectCfg panics in three server tests that simulate project
mode by setting projectRoot without projectCfg.
2026-05-20 16:12:02 +08:00
Willie 68d5eadc0b feat: support custom project source directories via sources map
Add ProjectSources struct to ProjectConfig with optional skills, agents,
and extras fields. When set, project-mode commands resolve source paths
from these values instead of hardcoded .skillshare/{skills,agents,extras}/.

Config example:
  sources:
    skills: ./docs/skills
    agents: ./docs/agents

Three EffectiveXxxSource(projectRoot) methods provide the central
resolution logic with fallback to defaults. The projectRuntime gateway
and server layer route through these methods, so most commands get
custom source support automatically.

Closes #153
2026-05-20 15:42:53 +08:00
Willie 9307fc521c chore: release v0.19.12 2026-05-14 23:43:43 +08:00
Willie fb821b7328 fix(project): add backups/ to .skillshare/.gitignore managed dirs
Project mode agent backup (sync --agents, backup -p) creates
.skillshare/backups/ but it was not gitignored — backup artifacts
could be accidentally committed.

Agent backup was added in 95c46ca8 (2026-04-06), after the gitignore
fix in 90c096b8 (2026-03-16) which only covered logs/ and trash/.
2026-05-13 03:49:40 +08:00
Willie 56fafb53e0 fix: preserve update metadata keys for symlinked sources 2026-05-12 21:10:08 +08:00