Commit Graph
471 Commits
Author SHA1 Message Date
Willie 86ff94fa8a fix(target): check prefixed naming when turning skills back on
Skills-off targets may now keep prefixed naming under a merge mode, but
target --skills=true and the dashboard's skills toggle flipped them on
without checking, so the next sync skipped the target and its agents.
Refuse to turn skills on while the effective naming needs copy mode.
2026-10-09 11:47:51 +08:00
Willie 0782395634 fix(config): skip the naming-mode check for targets with skills off
A target with skills disabled syncs no skill but still syncs agents,
yet prefixed naming with a merge mode marked it invalid, so sync and
the dashboard dropped it before agent sync. Check naming against mode
only when skills are enabled, for targets, projects and the mode PATCH.
2026-10-09 11:41:27 +08:00
Willie a9e3613282 fix(target): add global targets in copy mode when they would inherit prefixed
Top-level prefixed naming with a merge global mode is valid while every
target overrides copy, but target add (CLI, dashboard, and Agent config
directories) wrote new targets without a mode, so they inherited the
invalid pair and failed at sync. Share one rule for global and project
additions: write copy mode when the inherited naming needs it.
2026-10-09 11:26:40 +08:00
Willie 7b676502a5 fix(target): add project targets in copy mode under prefixed naming
A project target defaults to merge mode and target add has no mode
option, so adding one to a project whose top-level target_naming is
prefixed reported success and then failed validation at sync. Give the
new target copy mode in both the CLI and the dashboard API.
2026-10-09 11:17:48 +08:00
Willie e1889e4f6b fix(server): check unexpanded projects before changing the global mode
A project whose folder is missing expands into no target, so the
dashboard's mode PATCH never saw its skills settings and could move the
global mode off copy under a project inheriting prefixed naming. Run
the project naming check against the requested mode as well.
2026-10-09 11:07:11 +08:00
Willie 0477f1e837 fix(diff): report a target naming migration as a rename
After target_naming changes, sync renames the managed entry in place,
but diff looked only under the new name, so the CLI and the dashboard
showed the skill as new while hiding the old entry. Resolve the legacy
entry and report it as a rename instead.
2026-10-09 10:29:36 +08:00
Willie 73eb44ee36 Merge remote-tracking branch 'origin/main' into runkids/feat-497-prefixed-naming
# Conflicts:
#	ui/src/i18n/locales/de.json
#	ui/src/i18n/locales/en.json
#	ui/src/i18n/locales/es.json
#	ui/src/i18n/locales/fa.json
#	ui/src/i18n/locales/fr.json
#	ui/src/i18n/locales/id.json
#	ui/src/i18n/locales/ja.json
#	ui/src/i18n/locales/ko.json
#	ui/src/i18n/locales/pt-BR.json
#	ui/src/i18n/locales/zh-CN.json
#	ui/src/i18n/locales/zh-TW.json
#	ui/src/pages/TargetDetailPage.test.tsx
#	ui/src/pages/TargetDetailPage.tsx
2026-10-09 09:48:45 +08:00
Willie eabe5fbc10 test(api): cover skillsSharedWith in the targets list
Code review of the target-page warning found the new targets API field
only had a unit test on the config helper. The handler is what the UI
reads, so check that it names targets writing the same skills folder and
leaves out one that writes elsewhere.

Release-As: 0.25.4
2026-10-09 01:28:28 +08:00
Willie 06b37d0fcf feat(api): list the targets that share a target's skills folder
The target page needs to know which other targets write to the same
skills folder to warn when an unsaved mode or naming change would make
their syncs undo each other. Re-implementing the server's folder
normalisation (home expansion, path cleaning) in TypeScript would drift
from config.SkillsFolderConflicts, so the targets API now returns
skillsSharedWith, built from the same skillsFolder helper.
2026-10-09 01:25:04 +08:00
Willie 92f3d809c0 fix(server): refuse a global mode that breaks inherited prefixed naming
Targets that set prefixed naming but inherit the skills mode depend on the
global mode staying copy. Changing it from the dashboard left those targets
invalid until the next sync reported them; the global mode setter now runs
the same copy-only check the per-target setters do.
2026-10-09 00:58:34 +08:00
Willie 226c5c9a74 feat(target): offer prefixed naming in the CLI, dashboard and schemas
The new naming has to be choosable wherever naming already is: target
--target-naming, the target list TUI, the dashboard target page, shell
completions and the config schemas. Each setter checks the copy-only rule
before saving, for a naming change and for a mode change on a prefixed
target, so an invalid pair never reaches the config file and only surfaces
later as a failed sync.
2026-10-09 00:47:20 +08:00
Willie 35f3bb0e28 feat(sync): add target_naming: prefixed for copy-mode targets
Two tracked repos that ship a skill with the same name cannot both reach a
tool today: standard drops both, flat keeps both folders but tools list
skills by name:. Prefixed gives a skill inside a tracked repo the folder and
name: <repo>-<name> in the copy, so both stay usable and the name shows
where the skill came from. It is copy-only because a merge symlink points
at the source, where name: must not change; config validation rejects it
elsewhere, per target, like extension does.

Switching naming used to know only the flat name as the old one, so
standard <-> prefixed would orphan entries. The migration now checks the
skill's name under every naming, and the copy manifest records the naming
that produced each entry: a switch finds the exact old entry, and a renamed
copy is re-copied so its name: matches even when the source is unchanged.
Manifests without the record fall back to flat, standard, prefixed in turn.
A rename is written to the manifest at once, so a later failure cannot
leave the renamed folder looking user-owned.
2026-10-09 00:44:47 +08:00
Willie 366fb236c1 fix(sync): flag shared skills folders whose mode or naming differ
Two targets writing one skills folder with different target_naming or
mode undo each other on every sync (flat links vs standard names, merge
vs copy), but only include/exclude were compared, so sync and doctor
fell back to the generic shared-path hint.

Compare the effective mode and target naming too, so an unset value
equals the default it resolves to. The global default mode is not
carried on the target, so SkillsFolderConflicts takes it from its three
callers. The warning now says "different settings" instead of "different
filters".

Fixes #498
2026-10-09 00:28:34 +08:00
Willie 18d6b11347 test: test each rule once, in the package that owns it
Many integration and handler tests re-checked rules that internal/
packages already test, duplicated each other, or ran no product code at
all (a few re-implemented the logic inline, two could never fail). They
slowed the suite without catching anything new.

Delete those, keeping tests for CLI wiring, JSON output, exit codes,
project/global mode and cmd-only logic. Move the agents/extras overlap
check into sync.AgentTargetPaths so the CLI and the server share one
implementation and it is covered by unit tests instead of seven
integration tests.
2026-10-08 16:41:09 +08:00
Willie 36113be45e fix(extras): prune a symlink target only when it links to the source
The CLI's `--remove-target --prune` removed a symlink-mode target no matter
where it pointed, while the dashboard removed it only when it still linked
to the extra's source folder. A user who repointed that link at their own
folder could lose it from the CLI. Both now go through one shared
sync.ClearExtraTarget, so the safer rule applies everywhere; the CLI warns
and leaves anything that is not a link to the source instead of failing.

Refs #491
2026-10-08 16:19:32 +08:00
Willie e1aaf343fe Merge branch 'main' into runkids/extras-mode-rules 2026-10-08 16:17:56 +08:00
Willie b90bf2086f Merge pull request #493 from runkids/runkids/extras-sync-api
refactor(extras): pass targets to sync and filter them in one discovery function
2026-10-08 16:17:22 +08:00
Willie d61b25bcf2 refactor(extras): apply target filters in one discovery function
The extras diff, list, status and remove-target commands and the
server's list and diff handlers each discovered an extra's source and
then filtered it with ExtraTargetFiles. A new view that forgot the
filter step would silently show the wrong file count or status.

DiscoverExtraTargetFiles now discovers and filters in one call and
returns the unmatched-include warnings that sync reports. Every caller,
including sync itself, uses it, and ExtraTargetFiles is gone. No
behavior change.

Refs #487
2026-10-08 16:08:03 +08:00
Willie 7a4103b9a8 refactor(extras): validate every mode change and share special extra names
cmdExtrasMode only ran ValidateExtraConfig behind a growing list of
conditions, so each new restriction needed another clause. For a plain
folder extra the full check adds only the mode-name and flatten+symlink
rules, which sync already rejects, so validating unconditionally cannot
refuse a config that syncs today.

The agents and memory extra names were string literals in sync, the
server handlers, the memory store, and the CLI. They now live in
internal/config, and the rename guard moves to ValidateExtraRename so a
future CLI rename reuses it instead of copying the check.

Refs #489
2026-10-08 16:08:03 +08:00
Willie dde1dc6ef7 refactor(extras): keep target mode rules in config
The rules "an extension forces copy mode" and "symlink mode drops
include/exclude" were re-implemented in the create, edit-target, and
quick mode handlers. ExtraTargetConfig.EffectiveMode and Normalize now
hold them in one place, and the handlers call those instead. API
behavior is unchanged: edit-target still clears filters on symlink,
quick mode still rejects symlink when the target has filters, and an
extension still forces copy.

Refs #488
2026-10-08 16:08:03 +08:00
Willie 7740ee8798 fix(extras): relink symlinks to a missing source and accept negated includes
- Pointing a symlink-mode extra at a new source after its old folder was
  moved or deleted left the target broken: the old link no longer resolved,
  so it was not recognised as ours, and the next sync skipped it as pointing
  elsewhere. The link text is now compared with the old source as well.
- A negated include such as "!draft.md" only narrows earlier rules, so on
  its own it never matches and was always reported as matching no file.
  Negations are no longer checked for matches.

Refs #435
2026-10-08 15:52:47 +08:00
Willie 72ce921eeb fix(extras): validate hand-written filters and keep links when a save fails
- Sync validation skipped directory extras, so a malformed include such as
  "[" written in the config matched nothing and merge sync pruned every
  link. Extras with include/exclude now go through ValidateExtraConfig.
- The dashboard's quick Mode menu could switch a filtered target to symlink
  and save filters that every later sync rejects. That change is now
  validated with the target's filters and refused.
- Changing an extra's source removed the links into the old folder before
  saving the config, so a failed save left working targets broken. The
  config is saved first.

Refs #435
2026-10-08 15:44:39 +08:00
Willie a9ae5349a2 feat(extras): choose which files each target syncs, and edit targets in place
A directory extra used to sync every file to every target, so a tool that
only wanted a few docs got the whole folder. Each target can now set
gitignore-style include/exclude patterns, matched on the path inside the
source. Merge targets prune links to files that stop matching; copy targets
keep earlier copies, since nothing records which copied files are ours.
Filters are rejected for symlink mode and single-file extras, and sync warns
when an include matches nothing.

The dashboard previously forced users to delete and re-add a target or an
extra to change it. Edit target now changes the folder, file name, mode,
flatten and filters with a live preview; Edit extra renames an extra or
points it at another source folder. A moved target or source drops the
links left at the old place and syncs right away.

CLI: --include/--exclude on extras init, and --add-include, --add-exclude,
--remove-include, --remove-exclude on extras <name>.

Refs #435
2026-10-08 15:31:51 +08:00
Willie bd7e67fffd fix(git): report unmatched include filters from the sync after a pull
The pull response copied only the sync's warnings, so with unmatched
include filters moved to their own field, the Git Sync page stopped saying
that a filter selected nothing after its automatic sync. The pull response
now carries them and the page shows the same notice as the Sync page.
2026-10-08 15:06:59 +08:00
Willie 47be5105f5 fix(sync): link each target's unmatched filter and ignore blank includes
Two global targets with the same unmatched filter were merged into one
notice whose Edit filter link opened only the first target, leaving the
other unfixed. Only a project's targets share a filter, so other targets
now keep their own notice and link.

A target whose includes were an unmatched pattern plus a blank entry was
not marked as getting no skills, because the check counted the raw list
while filtering drops blanks. It now counts the effective patterns.
2026-10-08 14:48:29 +08:00
Willie 5d5b0f3efb feat(sync): explain include filters that select no skill
The dashboard showed the CLI's raw line, "api-server@claude: include pattern
"*review*" matches no skill in the source", once per target. It named a
config field, did not say the target ends up with no skills, and gave no way
to fix it. Sync now returns these as structured entries; the Sync page
groups a project's targets into one localized notice that says what happens
and links to where the filter is edited. The CLI line also says the filter
adds nothing to the target.
2026-10-08 14:26:41 +08:00
Willie a686ee910f fix(server): install config entries into the project source in project mode
The dashboard's install-from-config context read the global skills source
from s.cfg, which stays global in project mode. Missing entries were checked
against the global folder and installed there instead of the project's
.skillshare/skills. Use the project-aware skillsSource and reload the
metadata store from that same folder before reconciling.
2026-10-08 12:26:26 +08:00
Willie e3af6274fc feat(install): install config entries from the dashboard and name repos by owner
Bare `skillshare install` already restores everything .metadata.json records
but the disk lacks, yet the dashboard could only re-clone missing tracked
repos through a separate rehydrate path. Expose the CLI's install-from-config
flow instead (GET /api/install/missing, POST /api/install/from-config) so both
surfaces share one detection and one installer, and drop the old
missingTrackedRepos plumbing from update responses.

The install summary now counts tracked repos and their skills apart from
standalone skills, since "Installed 1 skill" hid a whole repo. New tracked
repos are named `_<owner>-<repo>` so two `skills` repos no longer collide;
existing installs keep their names. `check` passes the stale status through
so the dashboard can offer to prune skills deleted upstream.
2026-10-08 12:01:42 +08:00
Willie 8bf43f2480 fix(update): clean the name before the single-update skill lookup
Codex review of #481 round two: POST /api/update looked up an exact skill
with the raw name before resolving a repo. The shared helper now accepts
`org/team/`, so with a skill at org/team beside org/_team the raw lookup
missed the skill and the shorthand updated the repo. Clean the name once
at the top of updateSingleByKind so the skill lookup and repo resolution
see the same name.
2026-10-08 00:05:10 +08:00
Willie 414d193114 fix(update): keep an existing skill ahead of the nested shorthand
Codex review of #481 found three problems with the shorthand change:

- `update org/team -p` and the dashboard stream updated the org/_team
  repo even when a skill exists at org/team, which used to win because
  the shorthand was not rewritten there. FindTrackedCheckoutUnlessSkill
  skips the nested shorthand when a directory exists at the typed path;
  plain names keep their repo-first behavior.
- Global `update team/` cleaned the name for repo matching but not for
  skill matching, so it silently updated `_team` instead of reporting the
  skill/repo collision that `update team` reports. resolveByBasename now
  cleans the name once for both.
- The update.md example sits in the Project Mode section but lacked -p
  (also in the four translations).
2026-10-07 23:58:43 +08:00
Willie 84ed67b13d fix(update): accept the org/team shorthand for --into repos in every entry point
A repo installed with `--track --into org` lives at `org/_team`. Only
POST /api/update accepted `org/team`; the dashboard stream and
`update -p` prefixed the whole name (`_org/team`), and global `update`
compared the full name with the basename, so each reported not found.

Move the candidate rule (the name as typed, then `_` added to the last
segment, never leaving the source root) into install.FindTrackedCheckout
and the basename match into install.MatchTrackedRepos, and use them from
the single update, the stream, project and global CLI update. A shorthand
resolves to its own `org/_team`, never to a top-level `_team`; plain names
and full paths keep their behavior.
2026-10-07 23:51:37 +08:00
Willie 0be5164159 fix(update): use the tracked checkout rule in every update and reconcile path
#474 made install.IsTrackedCheckout (a _-prefixed git repo) the rule for what
a tracked repo is, but several paths still treated any git checkout as one, so
the same directory was classified differently depending on the entry point. An
unprefixed checkout, including a submodule or worktree whose .git is a file,
could be pulled as a tracked repo from the dashboard batch stream, the CLI
--group and project-mode name resolution, and the dashboard single update's
direct-path lookup, and reconcile wrote tracked: true for it.

All of them now use IsTrackedCheckout, so an unprefixed checkout updates as a
regular skill or is skipped, while _-prefixed repos, including --into repos
such as org/_team, still update as tracked repos.

Reconcile no longer registers an unprefixed checkout as tracked or creates an
entry for it from the git remote. An existing entry that an older reconcile
flagged tracked on such a checkout is kept with its source and branch; only the
flag is cleared on the next reconcile, so no user data is removed.

Fixes #476
2026-10-07 23:10:13 +08:00
Willie 84688b6e37 fix(update): keep --into repo metadata refresh on its own entry
With --into repos from #472, org/_team and a top-level _team can share a
basename. When org/_team had no entry of its own, the root-skill hash
refresh found _team's entry through GetByPath's basename-only fallback and
overwrote its hashes, which later broke _team's integrity and up-to-date
checks. The refresh now only touches the repo's own entry (exact key, or a
legacy basename key with the matching group).

resolveTrackedRepo built the prefixed --into candidate with filepath.Join,
so on Windows the dashboard result came back as org\_team while #472 made
every other repo name slash-form, and the UI could not match the row.
2026-10-07 22:47:33 +08:00
Willie e589336bef Merge origin/main (#472) into runkids/473-tracked-repo-update
Resolve the conflict in getTrackedReposImpl by keeping both sides: the
IsTrackedCheckout rule from this branch and the slash-form paths #472
returns for --into repos (org/_repo). Add a GetUpdatableSkills test for a
rewritten --into checkout next to a top-level one.
2026-10-07 22:46:15 +08:00
Willie 3479c42420 fix(update): share the tracked checkout rule and tighten the repair
Simplify and code-review passes over #474 found the fix spread over
several definitions of "tracked repo" and three holes in the repair.

One install.IsTrackedCheckout (a _-prefixed git checkout) now backs
GetTrackedRepos, GetUpdatableSkills, the dashboard routing and the repair.
GetUpdatableSkills skipping such entries replaces the two CLI resolver
filters, so `skillshare check` and the dashboard Updates tab no longer list
a rewritten repo a second time as a regular skill. The repair checks that
one path instead of walking the whole source tree.

- Reconcile sets tracked on a checkout again without dropping type or
  repo_url, so a rewritten entry that went through it was never cleaned.
  The repair now also runs when those regular-install fields remain.
- The repair used GetByPath, whose basename fallback can return another
  top-level item's entry; it now uses the repo's own key.
- A tracked entry whose checkout is gone fell through to the basename
  fallback of resolveTrackedRepo and pulled a different repo with the same
  basename. It now reports the repo as missing on disk.
2026-10-07 22:33:54 +08:00
Willie 51d0a1e5e9 fix(update): repair tracked repo entries rewritten as regular installs
The old dashboard update rewrote a tracked repo's metadata entry as a
regular install: tracked was dropped and type, repo_url and version were
added. Those repos stayed broken after the routing fix, because
`skillshare update <repo>` found the name twice (as a repo and as a
regular skill) and refused it, and nothing restored the entry.

The shared tracked-repo update now restores such an entry to what
install --track records (source, branch, group, tracked) when its path is
a checkout GetTrackedRepos lists, so regular skills are never touched.
CLI name and glob resolution skip a regular-skill match whose path is
already a tracked repo, so the update can reach that repair.

Codex review: the routing fix sent every git checkout with metadata to
the tracked-repo update, including standalone skills installed as a full
checkout, whose regular update records the new version and commit.
Their version stayed stale and update checks kept reporting an update.
Only tracked entries and _-prefixed checkouts now skip the regular path.
2026-10-07 22:16:56 +08:00
Willie 72f2e31664 fix(server): update tracked repos as repos from the dashboard
A tracked repo's own metadata entry carries a Source, so updateSingleByKind
sent it to updateRegularSkill. The reinstall reported isRepo false and
rewrote the entry without tracked: true, after which `skillshare update
<repo>` found the name twice (as a repo and as a regular skill) and refused
to update it. Route tracked entries and git checkouts to the tracked-repo
update before the regular-skill branch.

Closes #473
2026-10-07 22:10:48 +08:00
Willie f9ed43611d fix: keep git folders inside a tracked repo out of repo uninstall
Batch uninstall treated any name whose last segment starts with "_" and
is a git checkout as a tracked repo. A submodule such as
_team/vendor/_lib inside a tracked repo matched, so the dashboard could
move it out of the repo's checkout, leaving the repo dirty for update.
The fallback for "_"-prefixed names had the same hole before --into
support. --into folders cannot start with "_" (validate.IntoPath), so a
repo name may have "_" only in its last segment; both checks now use
that rule.

Also, the list TUI gave the root skill of an --into repo (RelPath equal
to RepoName, e.g. org/_team) the group "org"; it now has no group, like
a top-level repo's root skill.
2026-10-07 21:41:43 +08:00
Willie d15d9d794c fix: use the --into repo path in skill counts, list groups and the tree
Codex review of #472 found three views still deriving a skill's repo
from the first path segment:

- Skill counts in `list`, human-readable `status` and the dashboard
  overview matched `<repo>/` prefixes, so an `org/_team` repo whose only
  skill is its root SKILL.md counted zero, and `status` disagreed with
  `status --json`. They now compare RepoRelPath with the repo name.
- The list TUI took the group as the second path segment, so a skill at
  org/_team/skills/vue got group `_team` instead of `skills` and the
  `g:` filter missed it. The group is now the first segment below
  RepoName. Test fixtures that used a RepoName unrelated to RelPath now
  use the repo path, as real entries do.
- The dashboard tree treated only top-level `_` folders as repo roots,
  and merged `org / _team / skills` into one row, so an --into repo had
  no update or uninstall actions in Tree view. buildTree now marks repo
  roots from each skill's repo path, and a merged chain stops at one.
2026-10-07 21:35:05 +08:00
Willie c9b649143d refactor: return slash repo paths and simplify --into repo lookup
GetTrackedRepos returned OS-native paths, so every caller that compared
them with slash paths (RepoRelPath, dashboard repoPath, metadata keys)
had to convert first. Two callers in install_queries already did, and
this branch added four more. It now returns slash paths on every OS,
matching GetMissingTrackedRepos; filepath.Join and filepath.Base accept
them on Windows, and `update org/_repo` now also matches by full path
there. The per-call-site conversions are gone.

Smaller cleanups in the same code:
- repoOf takes the slash relPath and looks up prefixes by substring, so
  the walk no longer splits and joins per directory;
- repo .skillignore matchers are keyed by the same slash rel path, so
  isSkillIgnored no longer needs walkRoot;
- batch uninstall uses utils.IsTrackedRepoDir instead of a literal "_";
- the dashboard uses repoOf where it spelled out isInRepo && folderOf;
- the new tests reuse postBatchUninstall and share one --into sandbox.
2026-10-07 21:35:05 +08:00
Willie d861696be6 test(server): keep nested repo uninstall inside the source
Batch uninstall now accepts nested repo names such as org/_team. If org
is a link that the follow policy does not follow, the name resolves to a
repo outside the source. uninstall's sourcefs move-out check already
refuses it; this test pins that boundary so a later change to name
resolution cannot remove a repo outside the source.
2026-10-07 21:24:31 +08:00
Willie 4dd62d4ce5 fix: treat tracked repos installed with --into as repos
`install --track --into org` clones to org/_repo, but skill discovery
only marked a skill as in-repo when the first path segment started with
"_". Everything downstream also assumed the repo name was that first
segment. Skills of such a repo were therefore treated as loose skills:
no source in the dashboard, not grouped under the repo, a skill count of
0 in `status`, and an install hint that pointed at the wrong name.

Discovery now records each skill's tracked repo root (RepoRelPath). A
first-segment "_" folder still counts as before; a deeper one counts
only when the walk saw it as a git clone, so a plain org/_drafts folder
stays a folder. The repo's .skillignore is looked up by the same root.

Consumers move from "first segment" to that root:
- the API exposes it as repoPath, and the dashboard groups, updates and
  uninstalls repos by it;
- `list` and `status` use it for repo names and counts;
- batch uninstall accepts a nested repo name, so the dashboard can still
  remove an --into repo now that its skills are in-repo;
- repo names sent to the dashboard by check and update-all use slash
  paths, so they match repoPath on Windows too;
- the install hint suggests `skillshare update org/_repo`.

Fixes #470
2026-10-07 21:23:26 +08:00
Willie 8b350ed6d0 fix(server): report tracked repo source for nested skills
Tracked repo metadata is keyed by the repo directory (e.g. "_skills"),
but skills inside the repo are discovered with their full path
("_skills/skills/engineering/tdd"). The lookup found no entry for them,
so /api/resources returned an empty source and the dashboard's update
cards showed "tracked" without owner/repo. Repos whose SKILL.md sits at
the root matched the key directly and looked fine, which is why the
issue appeared to correlate with partial clones.

Nested repo skills now fall back to the repo's tracked entry. They also
ignore a bare-basename match, which GetByPath keeps for legacy short
keys but which can belong to an unrelated top-level skill of the same
name. GetByPath itself is unchanged because update, uninstall and check
depend on its current behavior.

Fixes #467
2026-10-07 20:51:39 +08:00
Willie 2481179424 Merge branch 'main' into runkids/458-opencode-env 2026-10-07 12:52:39 +08:00
Willie 834f88efb9 fix(doctor): compare resolved skills when judging OpenCode overlap
OpenCode loads skill files concurrently, so which copy of a name wins
is not fixed; its own folder does not reliably win. A source skill
synced to both folders is harmless anyway because both copies have
the same content. Count only source skills in OpenCode's folder, so a
local skill there no longer marks a same-named skill from another
folder as already present.

The comparison used each target's filtered selection, which skips the
target_naming: standard validation and collision handling sync applies.
When two skills named dev collide in OpenCode's standard folder, sync
writes neither there, yet a claude target filtered to one of them
still delivered it to OpenCode and no warning appeared. Use the
resolved skills that sync writes instead.

Refs #458
2026-10-07 11:10:30 +08:00
Willie d055f9c22a fix(doctor): warn about OpenCode overlap only when skills leak
OpenCode reads .claude/skills and .agents/skills first and its own
skills folder last, keeping the last skill of each name. A skill synced
to both opencode and claude therefore loads once, yet doctor and the
sync summary warned on every setup with both targets, with no way to
silence it.

The real effect is different: skills kept out of opencode by targets:
or include/exclude still reach it through another target's folder.
For opencode, count only those skills, name them in doctor, and point
at OpenCode's OPENCODE_DISABLE_CLAUDE_CODE_SKILLS and
OPENCODE_DISABLE_EXTERNAL_SKILLS. Other runtimes keep the old check
until their rule for same-named skills is verified.

Refs #458
2026-10-07 11:00:05 +08:00
Willie 080bb3e5e4 fix(server): guard the dashboard raw config save in project mode
PUT /api/config wrote the raw editor content with os.WriteFile, which
follows a symlinked config.yaml. In project mode a link to a config
outside the project was overwritten, bypassing the boundary the other
config writers now enforce. Route this write through ConfigWritePath
and answer 400 with the link named.
2026-10-07 10:36:22 +08:00
Willie f2f663689b fix(install): warn about submodules on tracked updates
The CLI and dashboard update a tracked repo through update.TrackedRepo,
which never looked for submodules. A pull that turned a skill directory
into a submodule reported success and the skill vanished on the next
sync. TrackedRepoResult now carries the skipped-submodule warnings and
both callers show them.

Refs #433
2026-10-07 09:35:59 +08:00
Willie cdac248e96 fix(install): strip secrets from any submodule URL and show warnings in the dashboard
Redact query, fragment and userinfo from relative, scp-style and malformed .gitmodules URLs too, clean the subdir before matching gitlinks so vendor//up is caught, and return discovery warnings from /api/discover so the install dialog shows skipped submodules.
2026-10-07 02:10:03 +08:00
Willie 0117161c8b Merge remote-tracking branch 'origin/main' into runkids/436-managed-instruction-block 2026-10-07 01:13:44 +08:00