Commit Graph
2762 Commits
Author SHA1 Message Date
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 87d1924bbe Merge pull request #475 from runkids/runkids/fix-audit-markdown-context
fix(audit): reduce false positives in Markdown examples
2026-10-07 23:35:55 +08:00
Willie 27f4b1f61c Merge branch 'main' into runkids/fix-audit-markdown-context 2026-10-07 23:25:52 +08:00
Willie c1fe1b39a8 Merge pull request #477 from runkids/runkids/476-tracked-checkout-rule
fix(update): use the tracked checkout rule in every update and reconcile path
2026-10-07 23:25:30 +08:00
Willie 75a732ae91 Merge branch 'main' into runkids/fix-audit-markdown-context 2026-10-07 23:21:55 +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 2922026264 fix(audit): preserve exclusions for custom disclosure rules
Track phrase exclusions as built-in rule metadata so a full custom regex replacement retains normal whole-line exclusion behavior. Keep phrase exclusions when only severity or enabled state is overridden.

Add raw-content and Markdown regression coverage. Verified with make check, four CLI E2E steps, the five-locale website build, and the context-router check.
2026-10-07 22:59:12 +08:00
Willie 111b0ce441 Merge pull request #474 from runkids/runkids/473-tracked-repo-update
fix(server): update tracked repos as repos from the dashboard
2026-10-07 22:54:55 +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 e55ec290b7 fix(audit): preserve shell flows across Markdown boundaries
Parse complete Markdown source without HTML blocks for shell analysis so blank lines inside raw HTML cannot split taint flows. Retain rendered context separately for SDK severity decisions. Normalize tab-separated fence metadata with strings.Fields so shell blocks remain auditable. Cover both regressions in unit tests and the CLI runbook.
2026-10-07 22:46:38 +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 8dee3108f3 Merge remote-tracking branch 'origin/main' into runkids/fix-audit-markdown-context 2026-10-07 22:35:50 +08:00
Willie aee75b69d6 fix(audit): distinguish SDK examples from prompt injection
Avoid blocking legitimate Markdown SDK parameters and ambiguous disclosure advice by default while retaining visible HIGH findings and strict-policy gating. Preserve explicit concealment, custom severity overrides, and shell dataflow coverage in HTML and comments. Add regression coverage and document rule-ID compatibility.
2026-10-07 22:35:50 +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 d617fc22a6 Merge pull request #472 from runkids/runkids/470-into-tracked-repos
fix: treat tracked repos installed with --into as repos
2026-10-07 22:14:12 +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 504713b065 fix(uninstall): refuse removing part of a tracked repo's checkout
The CLI removed any skill or folder inside a tracked repo on its own:
`skillshare uninstall _team/foo` moved the skill out of the repo's
checkout, and `_team/vendor/_lib` (a submodule) was even treated as a
tracked repo because the CLI marks every git checkout as one. Either way
the repo was left dirty for the next update. The dashboard already
refused single skills inside a repo, but the rule lived only in its
handler.

The rule now lives in internal/uninstall, which both the CLI and the
dashboard go through: an item below a "_"-prefixed git checkout fails
with ErrInsideRepo in Preflight and Run, even with --force. A followed
source link is the user's own checkout, so skills below it can still be
removed one at a time.

The uninstall reference documents the rule and how to name a repo
installed with --into, with ja/ko/zh-Hans/zh-Hant translations.
2026-10-07 21:51:41 +08:00
Willie 371561ef9f fix(ui): give a repo-root skill its tracked repo row in the tree
A tracked repo whose skill is its root SKILL.md has relPath equal to its
repo path (org/_team, or _team). buildTree placed the skill under the
parent folder only, so the repo node was never created: Tree view showed
no repo row, update action or repo context menu for it. The skill now
sits in its repo's own folder, which gives top-level repos with a root
SKILL.md that row as well.
2026-10-07 21:42:32 +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 91914517a0 Merge pull request #469 from runkids/runkids/467-tracked-repo-source
fix(server): report tracked repo source for nested skills
2026-10-07 21:06:57 +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 ec6d3dbf11 docs: add French, German, Spanish and Brazilian Portuguese READMEs
Readers in these languages had only the English README. The language
bar follows the CONTRIBUTING order by language code, and the release
skill now lists the new files so their Latest callout is updated with
the others.
2026-10-07 15:41:50 +08:00
Willie 2cda6eecc4 Merge pull request #466 from runkids/release-please--branches--main
chore(main): release 0.25.1
v0.25.1
2026-10-07 15:13:50 +08:00
Willie b74dcea307 docs(changelog): keep the reviewed 0.25.1 entry only
The first 0.25.1 Release PR (#440) was merged but never tagged, because its verification hit the stale redteam-signal script. Release Please regenerated the entry above the reviewed one; drop the duplicate.
2026-10-07 14:46:49 +08:00
github-actions[bot] 0d74083000 chore(release): synchronize release metadata 2026-10-07 06:46:09 +00:00
github-actions[bot] b5e05ca19f chore(main): release 0.25.1 2026-10-07 06:46:04 +00:00
Willie 52ca5f3ba3 test(redteam): inject the signal mutation into the shared audit gate
The tracked-repo update refactor moved the rollback decision from
update_handlers.go into install.AuditGate.Run, so the mutation found
nothing to replace and redteam-signal failed every push to main,
including the 0.25.1 release verification. Install and update now both
decide through that one gate, so one mutation point covers them.
2026-10-07 14:37:57 +08:00
Willie 932e35a61e Merge pull request #440 from runkids/release-please--branches--main
chore(main): release 0.25.1
2026-10-07 14:25:28 +08:00
Willie 459c49a54b docs(changelog): rewrite 0.25.1 notes for users
The generated entry listed every commit, with duplicates from merge
commits and internal refactors. Group it by what changes for users.
2026-10-07 14:19:06 +08:00
Willie d882f05848 docs: cover forced tracked-repo uninstall and project MCP source boundary
The dashboard now asks again and force-uninstalls a tracked repo with
uncommitted changes or an unreadable git status, and a project's
sources.mcp file is refused when it resolves outside the project. The
ui and mcp command pages did not say either.
2026-10-07 14:12:59 +08:00
github-actions[bot] 6934aa41f4 chore(release): synchronize release metadata 2026-10-07 05:51:57 +00:00
github-actions[bot] b7ec96d974 chore(main): release 0.25.1 2026-10-07 05:51:54 +00:00
Willie 3b8d495153 Merge pull request #464 from runkids/runkids/458-opencode-env
fix(doctor): warn about OpenCode overlap only when skills leak
2026-10-07 13:50:59 +08:00
Willie 0b0240904a Merge pull request #465 from runkids/runkids/mcp-source-boundary
fix(mcp): keep project MCP source writes inside the project
2026-10-07 13:36:06 +08:00
Willie 920b18510a fix(doctor): count only folders with SKILL.md as hand-kept skills
An empty or cache folder in claude's skills folder was reported as a
skill OpenCode loads, and any same-named path in OpenCode's folder hid
a real one. OpenCode loads only folders with SKILL.md, so check for it
on both sides.

Refs #458
2026-10-07 13:07:25 +08:00
Willie 2ec925b880 fix(mcp): treat skillshare/config.yaml as a project config too
configProjectRoot matched only <root>/.skillshare/config.yaml, so a
project that keeps its config in the visible skillshare/ folder was
treated as a global config and its MCP saves skipped the project
boundary entirely, config.yaml included. Match every project config
folder name through projectdir.IsName.
2026-10-07 13:04:58 +08:00
Willie cc2d07d7db fix(mcp): keep project MCP source writes inside the project
A project config can name any YAML file in sources.mcp. A cloned
repository could point it at a file outside the project, such as the
global config or the global MCP source, and the next project-mode MCP
change or 0.23.0 migration rewrote that file. Saves now check the
external source against the project root, as config.yaml already is.
Reading a shared file outside the project still works.

The check also needs the right root. Deriving it from the external
file's path would accept a sibling of the project, so the root is now
passed in. A global config acting for a project in mcp.projects is no
longer treated as a project config, so a dotfile link to it keeps
working instead of being refused.
2026-10-07 13:01:31 +08:00
Willie 3ec60a3732 fix(doctor): count skills kept by hand in another target's folder
The leak check compared only source skills, so a skill the user keeps
in ~/.claude/skills (which merge mode preserves) passed as harmless,
although OpenCode loads it. Read the writer's folder too and count
entries sync did not put there and OpenCode's own folder lacks.

The wording no longer says these skills are left out by filters, and
the suggestion asks to sync them to opencode, which fits both causes.

Refs #458
2026-10-07 12:58:22 +08:00
Willie 2481179424 Merge branch 'main' into runkids/458-opencode-env 2026-10-07 12:52:39 +08:00
Willie 448a120f3e test(doctor): check cross-target discovery against a real OpenCode
Unit tests encode our reading of OpenCode's loader. This runbook
installs opencode-ai and compares `opencode debug skill` with doctor's
cross_target_discovery result, so a change in OpenCode's discovery or
env switches shows up as a failing step instead of a wrong warning.

Refs #458
2026-10-07 12:41:46 +08:00
Willie 4bca097f17 refactor(targets): write also_scans as one entry per scanned folder
disabled_by_env keyed env switches by path, so OpenCode's lists were
written twice (global and project) and every key had to match a path
listed above it, guarded only by a test. Each entry now holds a
folder's global path, project path and off_when_env together.

The loader expands entries into the same global/project lists as
before; a dump of all 79 targets is identical, order included.

Refs #458
2026-10-07 12:38:13 +08:00
Willie c3c9e06f44 docs(doctor): note when the OpenCode leak check falls back
A symlink-mode writer exposes the whole source, so doctor cannot tell
which skills OpenCode receives from that folder and keeps the general
warning. The page said the check only lists leaked skills, which is
not true in that setup.

Refs #458
2026-10-07 12:15:28 +08:00
Willie 20807579a1 refactor(doctor): keep OpenCode's one-skill-per-name fact in targets.yaml
The rule that OpenCode loads one skill per name lived in a Go map
while its other facts (also_scans, disabled_by_env) live in
targets.yaml. Move it there as one_skill_per_name so a newly verified
runtime needs only a data change.

Also fold doctor's two cross-target warning branches into one, so the
leak and generic messages cannot drift apart, and reuse cmp.Or for the
symlink-mode check.

Refs #458
2026-10-07 11:46:19 +08:00
Willie 8606dc4940 feat(doctor): honor OpenCode switches that turn off external skills
With OPENCODE_DISABLE_CLAUDE_CODE_SKILLS set, OpenCode does not read
.claude/skills, yet doctor still warned that skills leak in through
it, so a user who had already fixed the leak could never clear the
warning.

Record in targets.yaml which environment variables turn off each
also_scans folder and skip those folders in RuntimeScanPaths when a
variable is true in skillshare's environment, read the way OpenCode
reads it. doctor, sync, the dashboard and readsFrom then agree, and
doctor says which variable caused the skip, because OpenCode may run
with another environment. The doctor hint now comes from the same
table.

Refs #458
2026-10-07 11:40:51 +08:00
Willie 211efa0ee6 fix(doctor): suggest the OpenCode switch that covers the leaking folder
OPENCODE_DISABLE_CLAUDE_CODE_SKILLS only skips .claude/skills. When
skills leak through .agents/skills, for example from a universal
target, offering it as an option left OpenCode loading them after the
user followed the advice. Offer only OPENCODE_DISABLE_EXTERNAL_SKILLS
whenever .agents/skills is involved.

Refs #458
2026-10-07 11:22:49 +08:00