Commit Graph
2703 Commits
Author SHA1 Message Date
Willie 03cde2b098 fix(doctor): keep the overlap warning for symlink-mode writers
A symlink-mode target folder is the source itself, so it also exposes
skills that .skillignore hides. Doctor, sync, and the dashboard pass
discovery results without those skills, so a symlink-mode claude
target looked harmless to OpenCode even when OpenCode loaded an
ignored skill through it. Treat that pairing as unknown and keep the
previous warning, unless OpenCode links the source as well.

Refs #458
2026-10-07 11:16:30 +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 658e40a07b Merge pull request #462 from runkids/runkids/460-plugin-config-write
fix(plugin): keep symlinked config.yaml and normalize plugin sources
2026-10-07 10:30:06 +08:00
Willie 503247b004 Merge branch 'main' into runkids/460-plugin-config-write 2026-10-07 10:29:56 +08:00
Willie f1c7c5d184 fix(plugin): expand every folded tilde form and keep dangling config links
FoldHomePathWith writes ~\plug on Windows and a bare ~ for the home
directory itself, but canonicalSource only expanded ~/, so with
preserve_tilde_on_save those sources came back relative on the next
load and update or sync could not resolve them.

When config.yaml is a symlink whose target does not exist yet, as a
dotfiles manager may create before first use, EvalSymlinks fails and
the save renamed over the link again. Follow the link to its intended
target so the first save creates that file, as Config.Save already does.

Refs #460
2026-10-07 10:02:56 +08:00
Willie 49b43b228c fix(plugin): keep symlinked config.yaml and normalize plugin sources
Plugin saves wrote a temp file next to config.yaml and renamed it over
the path. When config.yaml is a symlink into a dotfiles folder, the
rename replaced the link with a regular file, so the shared config
never received the change and the machine silently forked. The plugin
writer also skipped preserve_tilde_on_save, saving sources as absolute
home paths. The one-time legacy target migrations for global and
project configs used the same temp+rename and replaced links as well.

Plugin sources were compared as raw strings. The snapshot owner marker
records the absolute path from add, so a config that spells the same
folder as ~/... failed every update with "snapshot ownership conflict".
For Agents whose snapshot location hashes the source, the new spelling
silently created a second snapshot instead.

Resolve the symlink before writing, normalize sources once where the
plugin section is decoded so owner checks and snapshot paths agree,
and fold sources back to ~ on save when preserve_tilde_on_save is set.

Refs #460
Refs #461
2026-10-07 09:56:48 +08:00
Willie 0429a801bb Merge pull request #459 from runkids/runkids/433-submodule-detect
fix(install): refuse git submodule paths instead of installing empty dirs
2026-10-07 09:44:12 +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 0a484083e5 fix(install): warn about submodules on direct whole-repo installs
CLI search results install a repo-root skill through installFromGit without discovery, so the skipped-submodule warning has to come from that path too.
2026-10-07 02:46:26 +08:00
Willie 79bb10658a fix(install): strip submodule URL userinfo before query and fragment
A ? or # inside the userinfo used to cut away the @ before it was found, leaving the credential in place.
2026-10-07 02:40:48 +08:00
Willie b1b5bcc375 fix(install): fail closed when submodules cannot be listed and warn on tracked updates
A failed or timed-out git ls-tree used to look like a repo without submodules, letting an empty submodule path through; the refusal check now reports the failure while warnings stay best effort. Tracked updates also warn about submodules in the pulled tree.
2026-10-07 02:36:44 +08:00
Willie 6607b82e2b fix(install): escape submodule diagnostics and match ancestors by filesystem identity
Gitlink paths and .gitmodules URLs come from an untrusted repo, so quote them with %q to keep newlines and terminal escapes out of CLI output. Compare each ancestor of the subdir with the gitlink directory by os.SameFile instead of a byte-length prefix, so case and Unicode-normalization variants that open the same directory are caught.
2026-10-07 02:29:48 +08:00
Willie 39a6241b33 fix(install): refuse tracked submodule paths and fold case only where the filesystem does
A --track install with an explicit kind skips discovery, so check the subdir after the tracked clone and remove it on refusal. Match a case variant of a gitlink path only when it opens the same directory, so Linux keeps a real Vendor/Up next to a vendor/up gitlink. Strip everything before the last @ in a submodule URL so malformed and scheme-relative values fail closed.
2026-10-07 02:22:10 +08:00
Willie f1900251d3 fix(install): match submodule paths case-insensitively and warn on search installs
On Windows and macOS a case variant such as Vendor/Up opens the empty submodule checkout, so compare gitlink paths with EqualFold. Search results that install straight from discovery now show its warnings too.
2026-10-07 02:15:21 +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 1971e9dfc4 test(install): compare submodule URL with forward slashes on Windows
git writes the .gitmodules file URL with forward slashes, so a backslash temp path never matched.
2026-10-07 02:04:59 +08:00
Willie e4b72cb554 fix(install): hide credentials in submodule URLs shown to the user
.gitmodules may hold an authenticated URL; drop userinfo, query and fragment before it reaches warnings, errors or API responses.
2026-10-07 02:03:26 +08:00
Willie b7265d6496 fix(install): refuse git submodule paths instead of installing empty dirs
skillshare never fetches submodules, so a gitlink is an empty directory
after any clone. Installing that path reported success with nothing in
it, a path inside it failed with a misleading "does not exist", and
whole-repo discovery dropped its skills without a word.

Refuse a subdir that is or lies inside a submodule, naming the
submodule, its pinned commit and upstream URL, and warn for each
submodule skipped by whole-repo discovery and --track.

Refs #433

Release-As: 0.25.1
2026-10-07 01:58:59 +08:00
Willie 3ad4b68962 Merge pull request #451 from runkids/runkids/436-managed-instruction-block
feat(extras): prepend and append modes for single-file extras
2026-10-07 01:42:09 +08:00
Willie 9ebee9b442 Merge remote-tracking branch 'origin/main' into runkids/436-managed-instruction-block
# Conflicts:
#	ui/src/components/instructions/ProjectSharedFiles.tsx
#	ui/src/components/instructions/SharedInstructions.tsx
2026-10-07 01:35:22 +08:00
Willie e881987beb Merge pull request #456 from runkids/runkids/arch-dashboard
refactor(ui): named invalidation events, shared review dialog, plugins flow module, i18n key checks
2026-10-07 01:30:08 +08:00
Willie 748352e571 Merge branch 'main' into runkids/arch-dashboard 2026-10-07 01:22:49 +08:00
Willie 06ddca6689 Merge remote-tracking branch 'origin/main' into runkids/436-managed-instruction-block 2026-10-07 01:22:15 +08:00
Willie ec17ab71e3 fix(ui): keep the floating action bar on one line
The bar is position: fixed with left: 50%, so its shrink-to-fit width is
capped at the space right of its left edge, half the viewport. Content
wider than that wrapped inside the fixed 46px height, as seen on the Pi
and OMP pending-changes bars. Size it to its content and cap it at the
viewport instead.
2026-10-07 01:14:12 +08:00
Willie 0117161c8b Merge remote-tracking branch 'origin/main' into runkids/436-managed-instruction-block 2026-10-07 01:13:44 +08:00
Willie 696e9fd1b7 Merge pull request #455 from runkids/runkids/arch-442-uninstall
refactor(uninstall): run the CLI and dashboard through one operation
2026-10-07 01:13:17 +08:00
Willie fe4fcba122 Merge branch 'main' into runkids/arch-442-uninstall 2026-10-07 01:07:38 +08:00
Willie 9d74bc039f Merge pull request #454 from runkids/runkids/arch-443-tracked-update
refactor(update): one operation for tracked-repo update and the post-pull audit gate
2026-10-07 01:07:18 +08:00
Willie 5f49b00516 Merge branch 'main' into runkids/arch-443-tracked-update 2026-10-07 01:01:32 +08:00
Willie e5a1781ea5 Merge pull request #452 from runkids/runkids/arch-444-check-resolution
refactor(check): resolve update status in internal/check
2026-10-07 01:01:14 +08:00
Willie 3875c16e26 docs(extras): describe how prepend and append blocks behave and fail
The pages added with the block modes covered what they write, not what
the review fixes made them do. The sharing guide still said sync
overwrites a modified target, which is wrong for a block: sync stops
until the edit is collected or the block is rewritten.

The guide, the extras reference and the built-in skill now cover the
block's Collect and Rewrite choices, block statuses, the target file
dialog, what a mode change removes, how restore treats a block, and
the cases a block target is refused. Common errors gains an Extras
section for the four new messages. The --mode help of extras init,
--add-target and the mode command listed only import among the
single-file modes; it now lists prepend and append too.

Refs #436
2026-10-07 00:59:14 +08:00
Willie a165bf7cf9 Merge branch 'main' into runkids/arch-444-check-resolution 2026-10-07 00:56:06 +08:00
Willie 803447aa04 Merge pull request #453 from runkids/runkids/arch-450-memory-guidance
refactor(memory): move guidance plan and apply out of the dashboard handler
2026-10-07 00:55:46 +08:00
Willie d3d6b57f22 Merge branch 'main' into runkids/arch-450-memory-guidance 2026-10-07 00:50:20 +08:00
Willie 275131f94c Merge pull request #457 from runkids/runkids/arch-449-frontmatter
refactor(utils): locate frontmatter in one place under a named policy
2026-10-07 00:50:13 +08:00
Willie ede7f29aea fix(extras): read written blocks back and keep user lines in block-created files
Two gaps found by the fifth Codex review of #451:

- A source line that reads as a block marker, such as an unfenced
  end marker, was copied into the body, so the freshly written target
  parsed as damaged and every later sync, collect and detach failed.
  The block is now parsed back before writing, and a source whose block
  would not read back as itself is refused.
- When a block had created the target and the user then added lines
  outside it, switching to symlink or copy kept the "created" record,
  so restoring the link later removed the file and the user's lines
  with it. Those lines are now recorded as the restore point.

Refs #436
2026-10-07 00:43:13 +08:00
Willie 15dc6f47e3 fix(extras): guard block targets against source links, open fences and sibling reordering
Four gaps found by the fourth Codex review of #451:

- The check that refuses a target linked to another extra's source ran
  for import only, so a prepend or append target linked that way had
  its block written straight into that source. It now runs for every
  mode that edits the target in place.
- Switching a target with a damaged block to symlink or copy recorded
  the damaged block as the user's restore point, so detaching later
  brought it back. Recording the restore point now fails on a damaged
  block.
- Appending to a file that ends inside an open code fence put the begin
  marker inside that fence, so the next sync missed the block and
  appended another. Such an append is refused. Separately, a block body
  with an unclosed fence now ends at the end marker whose body matches
  the block's hash, even when the user's own code follows.
- A second prepend block counted its sibling above it as misplacing it,
  so each sync moved one ahead of the other. Placement now ignores other
  managed blocks on the same side.

Refs #436
2026-10-07 00:37:40 +08:00
Willie 2e9f14da49 feat(ui): let the dashboard force a refused tracked-repo uninstall
DELETE /api/repos/{name} now refuses a repo with uncommitted changes or
unreadable git status, and the Dashboard page never sent force, so those
repos could not be removed from it at all.

The two refusals force overrides now carry their own error code. The
page still sends the first request without force; on either code the
confirmation says why and retries with force only when the user
confirms. Other refusals, such as a linked folder that is itself a
skill, keep the plain error because force does not change them.

Refs #442
2026-10-07 00:35:03 +08:00
Willie 279be8aba6 fix(utils): stream ParseSkillName and ParseFrontmatterField to their key
On main these two readers scanned SKILL.md line by line and returned at
the line they were looking for, keeping nothing. After the refactor they
first collected the whole frontmatter block, so a large block cost its
full size on every call even when name came first, and an unclosed one
cost the rest of the file. Sync, target naming and listing call them
once per skill or agent. Reported by Codex review on #457.

The per-line rule (which line opens and which closes the block) moves
into blockWalk, which locateFrontmatter and the new scanLenientBlock
both use, so the streaming path and the byte locator cannot drift.
ParseSkillName and ParseFrontmatterField stop at their key again; the
list and fields readers collect the block as they always did. Results
are unchanged for every entry point.

Refs #449
2026-10-07 00:34:47 +08:00
Willie 876e165f25 fix(extras): refuse damaged blocks and plan block defaults without the leaving files
Five gaps found by the third Codex review of #451:

- Switching a target with a damaged block (a deleted end marker) to
  import ignored the parse error and added the @ line, so the tool read
  the stale block as well. The switch now fails until the block is
  repaired.
- Detaching such a target reported success without touching the file,
  so Assign dropped the connection and left the block with nothing
  configured to remove it. Detach now returns the error.
- PlanAssign decided whether a non-import target could take several
  files, and Assign chose each new file's mode, from the extras before
  the files being detached were gone. Removing the only block holder
  while adding two files therefore passed the plan, then gave both new
  files a link, the second replacing the first. The plan now detaches
  first and Assign applies the modes the plan validated.
- When the last block left a file it had created but the user had since
  added lines to, the created record stayed, so a later link attach and
  restore deleted the user's file. The attach record is cleared once no
  managed block or import line remains.
- A source with a fence that never closes swallowed the block's own end
  marker on the next parse, so a freshly written target read as
  damaged. An open block's end marker now ends it when the fence never
  closes.

Refs #436
2026-10-07 00:30:34 +08:00
Willie 9cc4996fdd test(check): skip the fake-git auth test on Windows
TestGitRemoteHash_DefaultBranchUsesAuth puts an extensionless shell
script named git first on PATH. On Windows exec.LookPath only resolves
names with a PATHEXT extension, so the script is ignored and the real
git.exe probes github.com, which answers "repository not found" for the
made-up repository. The auth env is built without any platform branch,
so the product path is unaffected; only the test double cannot work
there. Skip it for the same reason the fake-git tests in
internal/install/source_fallback_test.go already do.

Refs #444
2026-10-07 00:26:12 +08:00
Willie 90f161fef0 perf(utils): keep only the frontmatter block when reading by path
Rebuilding the path readers on the shared locator made them read the
whole SKILL.md into memory, where they used to scan line by line and
stop at the closing delimiter. They run once per skill or agent during
sync and listing, so a large body, or a large file with no frontmatter
at all, now cost its full size on every call.

readHead goes back to a bufio.Scanner and keeps the lines from the
opening delimiter to the closing one, nothing before and nothing after.
Reading through the real Scanner also replaces the code that imitated
its quirks (64 KiB line cap, one \r dropped per line); ReadSkillBody,
which needs the body, takes them from scanLines. An unclosed block is
still kept to the end of the file, as the list and fields readers always
did.

Review follow-ups in the same files: RewriteFrontmatterList no longer
copies the content to a string and back, ParseFrontmatterField's two
loops no longer share an index, and the tests share one file helper.
Results are unchanged for every entry point.

Refs #449
2026-10-07 00:25:32 +08:00
Willie e40c634d2b test(i18n): close the gaps review found in the key checks
Review showed three ways a missing key still passed:

- t('sync.changes') passed because the counted base was accepted for
  any string; a string passed straight to t() must now be a key itself.
- plural('typo.key', n) was only seen when its first word was a known
  namespace; strings passed straight to plural() are now checked for
  both forms.
- The Go test listed the values that complete "plugins.problem." by
  hand, so a new case in automationProblem passed; the values now come
  from that function's switch.

The files of config paths were also skipped by every check; they are
now skipped only where config paths look like keys, so their t() calls
are checked again.

Refs #448
2026-10-07 00:23:02 +08:00
Willie 7cdec347ec refactor(ui): use the keyed-text helper where the rule was still inline
Two places still wrote out 'translate the backend key, else show its
text' by hand next to keyedText, so the rule had three copies. The Pi
package test also rebuilt the set of Pi targets for every package on
every render; it is now built once per inventory, as before the flow
moved out of the page.

Refs #446
2026-10-07 00:23:02 +08:00
Willie 19c670df12 refactor(ui): drop the audit key no query uses any more
The audit query of a skill is keyed by name and kind, and its cache is
cleared by the ['audit', 'skill'] prefix. The name-only key lost its last
caller when the key literals moved into queryKeys.ts, and read as the real
query key while matching none exactly.

Refs #445
2026-10-07 00:23:02 +08:00
Willie c88b7ff341 fix(extras): drop the old representation when a target enters or leaves a block mode
The mode picker stores the new mode before syncing, so the block and
import handlers saw the previous mode's output as the user's content:
copy → prepend kept the whole copied source beside the new block,
import → prepend kept the @ line, and prepend → import kept the block.
The tool then read the instructions twice, and detaching removed only
the new representation.

Entering a block mode now rebuilds a leftover copy from the attach-time
base (backing up an edited copy as a mode-switch drift, as import does)
and drops this extra's @ line; entering import mode drops this extra's
block, keeping a hand-edited one as a drift backup.

Refs #436
2026-10-07 00:21:01 +08:00
Willie 764ca7f9c0 fix(uninstall): keep a grouped skill's legacy metadata key on review
Review of the shared uninstall operation found that RemoveByNames still
matched a bare key: removing top-level "foo" pruned the legacy entry
"foo" with Group "frontend", which belongs to the installed
frontend/foo. Entries are now matched by their full path only.

Also from review: a dry run no longer runs git status for tracked
repos (it reports no git state), the unused Outcome.Removed is gone,
the two single-item handlers share one status mapping, and the CLI
reports a single target in one place instead of three flag checks.

Refs #442
2026-10-07 00:20:20 +08:00
Willie 7bc61698ee refactor(update): load metadata only for root-skill repos, report once
The dashboard update of N tracked repos loaded the metadata store 2N times
under the server lock, and each load walks the whole source tree. The refresh
now returns before loading when the repo has no root SKILL.md, reports
whether it saved a change, and the server reloads its store only then,
through the existing reloadSkillsStore.

The CLI single-repo path tracked its output with two flags and a OnceFunc.
The caller hook now runs once for every outcome, so the spinner stop, the
discard warning and the pull summary live in one place and print in the same
order as before.

auditGateFailClosed rebuilt three of its messages by hand; they are
AuditGateError's own wording with another subject, so both now come from one
function.

Refs #443
2026-10-07 00:20:06 +08:00
Willie 1de30fbc38 feat(instructions): tint managed blocks in the target file dialog
The source view of a target's file showed the block markers as plain
comments, so which lines skillshare manages, and which block had been
edited by hand, took reading the markers. Each managed block is now
tinted, a block the target reports as modified in the warning tone, and
the dialog says what the block is or offers Collect and Reapply for the
edited one, as the row does.

Refs #436
2026-10-07 00:18:40 +08:00