feat(herdr): show extras and memory notes in the panel (#961)

The panel read skills, agents, MCP servers, plugins and hooks, but not
extras, which `sync --all` also syncs. An extra waiting for a sync was
not shown, so Overview could say everything was in sync when it wasn't.

Extras are now a sixth kind, read per scope with `extras list --json`
and `extras memory list --json`. Overview counts them, and an extra
whose target is not `synced` waits for a sync like an MCP server, so
the existing Sync button covers it. Library has an Extras tab with file
extras, folder extras and memory notes. A preview shows the file, or a
folder's files, with its frontmatter, and the targets with their mode
and status. Nothing new can be changed from the panel.

An extra's target is named by the target whose skills folder shares
its parent folder, as the dashboard names it, else by its path. In a
project, `status` reports absolute target paths while extras keep the
config's relative ones, so those are resolved against the project
folder first. Targets that share a skills folder, such as codex and
universal at ~/.agents/skills, come from `status` in no fixed order, so
the first by name names the extra's target.

An extra whose source is missing (`source_exists` is false, or a target
reports `no source`) is not something a sync can fix: `doctor` reports
it as an error, `diff` marks it failed and the dashboard shows it in
red. It goes under Need a look as "source missing", which now holds
more than hook notices, so Overview's title for it is "NEED A LOOK".
With nothing waiting, Overview says how many extras need a look instead
of "Everything is in sync", and the preview says the source is missing
instead of offering a Try again that can't help.

Memory notes never wait for a sync, so a failed memory read, as on a
CLI before 0.24, leaves the sync state confirmed and Sync available.
When that read has never answered, the Extras count is the extras that
were read.

The memory folder also appears as an extra of its own, as it does in
the dashboard's Folders & files.

Refs #930


* fix(herdr): keep missing-source extras on Overview and list only synced files

Review of #961 found two gaps. While extras were read again, or after
`extras list` failed, a missing-source extra turned "unknown" and was
shown neither under Need a look nor under Sync status unconfirmed. It
now waits under Sync status unconfirmed, like other rows whose read is
pending.

A folder extra's preview listed its files with the skill reader, which
skips only the top-level .git. Extras sync skips every .git folder and
every .metadata.json (DiscoverExtraFiles), and .metadata.json sorted
first, so it could open as the default document. The preview now lists
the folder as extras sync sees it.

Refs #930
This commit is contained in:
Eirik Corneliussen
2026-11-20 21:39:53 +08:00
committed by GitHub
parent 0cc1c25d67
commit cbc3614b71
18 changed files with 471 additions and 132 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
# skillshare
A skillshare button and panel added to your existing Herdr window. See which skills, agents, MCP servers, plugins and hooks need an update or a sync in the focused project's source and your global source. Preview, install with an audit first, update, sync, enable or disable, uninstall, hand an audit to an agent, sync the source repository and check every machine. Your status bar, usage meters, sidebar, theme and other panels stay as they are.
A skillshare button and panel added to your existing Herdr window. See which skills, agents, MCP servers, plugins, hooks and extras need an update or a sync in the focused project's source and your global source. Preview, install with an audit first, update, sync, enable or disable, uninstall, hand an audit to an agent, sync the source repository and check every machine. Your status bar, usage meters, sidebar, theme and other panels stay as they are.
![skillshare](preview.png)
@@ -9,8 +9,8 @@ A skillshare button and panel added to your existing Herdr window. See which ski
- A 118px **skillshare** button beside the existing tab bar. It uses the 16px skillshare mark and the selected background while the panel is open.
- A 400px panel beside the work area, resizable from 380 to 720px. Its 44px header shows the folder, machine, CLI version, Update panel when available and a close button.
- **Overview**, **Library** and **Machines** tabs. In a project, All · Project · Global selects the scope; outside one, Global is shown.
- Overview answers with Everything is in sync, targets/resources waiting, or Syncing. A Sync button handles pending work. Five counts open Library by kind; up to six target lines show what waits. Hovering a collapsed count opens the remaining target lines.
- Library has kind tabs, a filter, Sync and Install. Its scrollable list groups unknown, needs-attention, needs-sync, update, in-sync and disabled rows. In-sync skills and agents fold by source, with a List switch. Each row opens a preview; update rows also have Update.
- Overview answers with Everything is in sync, targets/resources waiting, extras that need a look, or Syncing. A Sync button handles pending work. Six counts (Skills, Agents, MCP, Plugins, Hooks, Extras) open Library by kind; up to six target lines show what waits. Hovering a collapsed count opens the remaining target lines.
- Library has kind tabs, a filter, Sync and Install. Its scrollable list groups unknown, needs-attention, needs-sync, update, in-sync and disabled rows. In-sync skills and agents fold by source, with a List switch. Extras lists file and folder extras and memory notes; an extra whose source is missing needs attention. Each row opens a preview; update rows also have Update.
- Machines shows one card per Herdr machine: version, remote/source/target state, doctor warnings and Pull and sync or Sync both ways. A newer CLI version offers Update.
- A 34px notice line appears during work or after an outcome. A 40px footer shows the source repository state and opens its actions.
- Previews use Document/Settings/About, Targets and Details tabs where applicable. Install, audit results, source actions, conflict resolution, enable/disable, uninstall and updates use confirmation overlays.
@@ -20,9 +20,9 @@ A skillshare button and panel added to your existing Herdr window. See which ski
- The button toggles the panel and the close button hides it. Open/closed state survives space switches and restarts.
- The panel follows the shown space's machine and focused terminal's folder. `.skillshare/config.yaml` or `skillshare/config.yaml` enables project scope beside global scope.
- It refreshes every 20 seconds while shown, checks resource updates every 10 minutes and checks the latest published panel release hourly. Hidden panels do no work. Resource reads appear independently; pending or failed reads remain unconfirmed instead of claiming everything is in sync.
- It refreshes every 20 seconds while shown, checks resource updates every 10 minutes and checks the latest published panel release hourly. Hidden panels do no work. Resource reads appear independently; pending or failed reads remain unconfirmed instead of claiming everything is in sync. Memory notes never wait for a sync, so a failed memory read leaves sync states confirmed; if the memory read fails before any notes have been read, the Extras count is the extras already read. Skillshare before 0.24 has no memory list.
- Sync applies pending scopes and plugin changes. Hook conflicts block all resource sync until resolved. Hook notices do not inflate named-entry counts.
- Preview reads skill/agent files or MCP settings, hiding secret values. Skills and agents offer Update, Diff, Enable/Disable, Uninstall and Ask agent to audit; declared hooks offer Enable, Disable and Remove. Destructive actions and audit hand-offs ask first.
- Preview reads skill/agent files, MCP settings, an extra's file or folder, or a memory note, hiding secret values. Skills and agents offer Update, Diff, Enable/Disable, Uninstall and Ask agent to audit; declared hooks offer Enable, Disable and Remove. Destructive actions and audit hand-offs ask first.
- Install takes a repository URL, uses the CLI's dry-run plan to choose skills, audits a separate clone and installs only after a passing audit or explicit Install anyway confirmation. A failed command remains a failure even when some items were installed.
- Source actions offer Pull, Commit and push and Sync both ways. Conflicting files show both versions for a per-file choice; skill metadata merges per entry.
- Requests show their intended outcomes while pending, then reconcile with CLI reads. Errors restore the last known rows. Work is serialized per machine; different machines can run independently.
+23 -6
View File
@@ -3,7 +3,7 @@
// and the tests pass a fake machine.
// io.job(args, { on, cwd, script }): skillshare (or a script of ours) run detached;
// io.run(args, { on, cwd }): a short read; io.sh(script, args, on): one exec of a script.
import { GIT_STATUS, PROJECT, READ_SKILL, READ_FILE, LATEST_RELEASE, releaseTag, parseJSON, failure, flag, parseGitStatus, driftFrom, targetDrift, splitFrontmatter, mcpServer } from "./model.js";
import { GIT_STATUS, PROJECT, READ_SKILL, READ_EXTRA, READ_FILE, LATEST_RELEASE, releaseTag, parseJSON, failure, flag, parseGitStatus, driftFrom, targetDrift, splitFrontmatter, mcpServer } from "./model.js";
const scopesOf = (project) => (project ? ["project", "global"] : ["global"]);
const at = (on, project, scope) => ({ on, cwd: scope === "project" ? project : null });
@@ -17,9 +17,10 @@ export async function findProject({ sh }, on, folders) {
// Each read publishes independently. Keep the previous values during refresh, but track
// pending and failed sections separately so a stale value never claims a fresh sync verdict.
export async function loadResources(io, on, project, network, progress = () => {}, previous = {}) {
const commands = { list: ["list", "--all"], diff: ["diff"], mcp: ["mcp", "list"], plugins: ["plugin", "list"], hooks: ["hooks", "list"], status: ["status"] };
const commands = { list: ["list", "--all"], diff: ["diff"], mcp: ["mcp", "list"], plugins: ["plugin", "list"], hooks: ["hooks", "list"], extras: ["extras", "list"], memory: ["extras", "memory", "list"], status: ["status"] };
const raw = {};
for (const scope of scopesOf(project)) raw[scope] = { ...previous[scope], pending: Object.keys(commands), errors: {}, took: {}, error: null };
// root: the project folder, which a project's relative extras paths start from.
for (const scope of scopesOf(project)) raw[scope] = { ...previous[scope], pending: Object.keys(commands), errors: {}, took: {}, error: null, root: scope === "project" ? project : null };
let git = null, version = null;
const snapshot = () => ({ raw: Object.fromEntries(Object.entries(raw).map(([scope, one]) => [scope, { ...one, pending: [...one.pending], errors: { ...one.errors }, took: { ...one.took } }])), git, version,
error: Object.entries(raw).flatMap(([scope, one]) => Object.entries(one.errors).map(([name, message]) => `${scope} ${name}: ${message}`)).join("\n") || null });
@@ -35,7 +36,7 @@ export async function loadResources(io, on, project, network, progress = () => {
if (r.code !== 0 || value == null || (name === "list" && !Array.isArray(value))) throw new Error(failure(r, `skillshare ${args.join(" ")}`));
if (name === "status") {
status = value;
Object.assign(one, { targets: names(value.targets), skillTargets: names((value.targets ?? []).filter((x) => x.skills_enabled !== false)), agentTargets: names(value.agents?.targets) });
Object.assign(one, { targets: names(value.targets), targetPaths: (value.targets ?? []).map((x) => ({ name: x.name, path: x.path })), skillTargets: names((value.targets ?? []).filter((x) => x.skills_enabled !== false)), agentTargets: names(value.agents?.targets) });
if (scope === "global") version = value.version ?? null;
} else one[name] = value;
} catch (e) {
@@ -96,10 +97,26 @@ export async function loadLatestRelease({ sh }) {
return releaseTag((await sh(LATEST_RELEASE)).stdout);
}
// What a preview shows beyond the row: a skill's files and SKILL.md, an agent's file, or an MCP
// server's settings (mcpPath is the MCP source file). { files, dir, meta, body } | { server } | { error }.
// What a preview shows beyond the row: a skill's files and SKILL.md, an agent's file, an MCP
// server's settings (mcpPath is the MCP source file), or an extra's files.
// { files, dir, meta, body } | { server } | { gone } | { error }; an extra's also names the file shown.
export async function loadPreview(io, on, project, item, mcpPath) {
if (item.kind === "mcp") return { server: mcpPath ? mcpServer((await io.sh(READ_FILE, [mcpPath], on)).stdout, item.name) : null };
if (item.kind === "extras") {
// A missing source has nothing to read, and reading again won't change that.
if (item.sourceMissing) return { gone: `${item.file ? `${item.dir}/${item.file}` : item.dir} is missing. Create it, or remove the extra.` };
if (item.extra !== "folder") return { files: [item.file], file: item.file, dir: item.dir, ...(await loadFile(io, on, item.dir, item.file)) };
// A folder lists only the files extras sync sends, and shows its SKILL.md, which READ_EXTRA
// already read, else its first file. A folder holds no SKILL.md as a rule, so READ_EXTRA
// ending non-zero is not an error here.
const r = await io.sh(READ_EXTRA, [item.dir], on), cut = r.stdout.indexOf("@@\n");
if (cut < 0) return { error: `${item.dir} could not be read.` };
const files = r.stdout.slice(0, cut).split("\n").filter(Boolean), text = r.stdout.slice(cut + 3);
if (text && !files.includes("SKILL.md")) files.unshift("SKILL.md");
if (!files.length) return { error: `${item.dir} has no files to show.` };
if (files.includes("SKILL.md")) return { files, file: "SKILL.md", dir: item.dir, ...splitFrontmatter(text) };
return { files, file: files[0], dir: item.dir, ...(await loadFile(io, on, item.dir, files[0])) };
}
const st = parseJSON((await io.run(["status", "--json", flag(item.scope)], at(on, project, item.scope))).stdout);
const base = item.kind === "agents" ? st?.agents?.source : st?.source?.path;
if (!base) return { error: "skillshare did not say where this source is." };
+25 -21
View File
@@ -11,7 +11,7 @@ import { v_flex, h_flex, InputState, Input, TextView, HoverCard } from "gpui-bas
import { exec, hc, run, spaces, agents, focused, machines, shared, setShared, theme, settings, layout, openOverlay, closeOverlay, nextCommand, readTextFile, knownAgents, props as blockProps } from "herdr";
import {
KINDS, SCOPES, DISCOVER, AUDIT,
parseJSON, lastLine, failure, flag, sourceLine, buildItems, shownRows, endedRequests, afterRead, afterChecks, hookArgs, toggleArgs, rowState, previewTargets, eligibleTargets, targetList, waitsForSync, syncScopes, overviewAnswer, resourceProgress, remoteLine, waitingNames, mapLanes, needsBothWays, filterItems, groupItems, sourceGroups, counts,
parseJSON, lastLine, failure, flag, sourceLine, buildItems, shownRows, endedRequests, afterRead, afterChecks, hookArgs, toggleArgs, rowState, previewTargets, eligibleTargets, targetList, waitsForSync, needsLook, syncScopes, overviewAnswer, resourceProgress, remoteLine, waitingNames, mapLanes, needsBothWays, filterItems, groupItems, sourceGroups, counts,
cloneUrl, installResult, newerVersion, panelUpdate, updateState, ago, auditMessage, parseDiscover, parseAudit,
} from "./model.js";
import { createRunner, withShell } from "./jobs.js";
@@ -494,13 +494,13 @@ export default class Skillshare extends View {
const failed = Boolean(this.error || progress.errors.length) && !progress.available && !progress.pending.length;
const byLabel = (a, b) => a.label.localeCompare(b.label);
const waiting = all.filter((i) => !i.notice && (i.state === "sync" || i.state === "missing")).sort(byLabel);
const updates = all.filter((i) => !i.notice && i.state === "update").sort(byLabel), notices = all.filter((i) => i.notice);
const updates = all.filter((i) => !i.notice && i.state === "update").sort(byLabel), notices = all.filter(needsLook);
const pending = [...waiting, ...notices.filter((i) => i.pending)];
const targets = targetList(this.raw, scope, this.items), lag = targets.list.filter((x) => x.n);
const busy = this.busyAt(ctx.on), moving = Boolean(busy) && /^Sync/.test(channel.textAt(ctx.on) ?? "");
const { kind: answer, headline, sub } = overviewAnswer({ loading, failed, error: this.error, moving, reading: progress.pending, incomplete: progress.incomplete, pending: pending.length, lag, total: kc.all, targets: targets.list.length });
const { kind: answer, headline, sub } = overviewAnswer({ loading, failed, error: this.error, moving, reading: progress.pending, incomplete: progress.incomplete, pending: pending.length, lag, total: kc.all, targets: targets.list.length, broken: all.filter((i) => i.state === "broken").length });
const mark = { loading: () => icon("ring", 20, t.muted).spin(900), failed: () => icon("alert", 20, t.ansi1), moving: () => icon("ring", 20, t.blocked).spin(900),
waiting: () => icon("alert", 20, t.blocked), ok: () => icon("check", 20, t.ansi2) }[answer]();
waiting: () => icon("alert", 20, t.blocked), look: () => icon("alert", 20, t.blocked), ok: () => icon("check", 20, t.ansi2) }[answer]();
const hot = new Set(pending.map((x) => x.kind));
const sync = () => request({ op: "sync", on: ctx.on, project: this.project, scopes: syncScopes(this.items, this.raw, scope), plugins: waiting.some((i) => i.kind === "plugins") });
const hero = v_flex().flex_none().px(14).py(16).gap(14).border_b(1).border_color(t.border)
@@ -518,11 +518,11 @@ export default class Skillshare extends View {
else {
const sections = [];
const group = (id, label, color, rows) => { if (rows.length) sections.push(this.groupHeader(t, id, `${label} · ${rows.length}`, color, null), ...rows); };
const unconfirmed = all.filter((i) => i.state === "unknown" && ["sync", "missing", "update"].includes(i.cachedState)).sort(byLabel);
const unconfirmed = all.filter((i) => i.state === "unknown" && ["sync", "missing", "update", "broken"].includes(i.cachedState)).sort(byLabel);
group("unconfirmed", "SYNC STATUS UNCONFIRMED", t.muted, unconfirmed.map((i) => this.row(t, i, showScope, ctx)));
group("waiting", "WAITING TO SYNC", t.blocked, waiting.map((i) => this.row(t, i, showScope, ctx)));
group("update", "UPDATE AVAILABLE", t.accent, updates.map((i) => this.row(t, i, showScope, ctx)));
group("notices", "HOOKS NEED A LOOK", t.muted, notices.map((i) => this.row(t, i, showScope, ctx)));
group("notices", "NEED A LOOK", t.muted, notices.map((i) => this.row(t, i, showScope, ctx)));
// Machines appear here once the Machines tab has read them; the panel does not check them unasked.
const behind = Object.values(this.machines).filter((m) => !m.checking && !m.error && !m.missing && (m.git?.behind || m.drift > 0));
group("machines", "MACHINES", t.muted, behind.map((m) => line(t, `machine-${m.label}`, dot(t.blocked), m.label,
@@ -540,7 +540,7 @@ export default class Skillshare extends View {
const all = this.items, scope = this.project ? this.scope : "global";
const kc = counts(filterItems(all, { scope, kind: null, query: "" }));
const listed = filterItems(all, { scope, kind: this.kind, query: this.query });
const groups = groupItems(listed), notices = listed.filter((i) => i.notice), unknown = listed.filter((i) => !i.notice && i.state === "unknown");
const groups = groupItems(listed), notices = listed.filter(needsLook), unknown = listed.filter((i) => !i.notice && i.state === "unknown");
const live = groups.ok.filter((i) => i.state !== "off"), off = groups.ok.filter((i) => i.state === "off");
const showScope = Boolean(this.project) && scope === "all";
@@ -657,7 +657,7 @@ export default class Skillshare extends View {
// A row is a name and one short state. Everything else, and every action, is in its preview.
row(t, item, showScope, ctx) {
const color = item.notice || item.diagnostic ? t.blocked : { update: t.accent, sync: t.blocked, missing: t.ansi1, ok: t.ansi2, off: t.muted }[item.state] ?? t.muted;
const color = needsLook(item) || item.diagnostic ? t.blocked : { update: t.accent, sync: t.blocked, missing: t.ansi1, ok: t.ansi2, off: t.muted }[item.state] ?? t.muted;
const update = item.state === "update" && !item.doing && (item.kind === "skills" || item.kind === "agents") && !this.busyAt(ctx.on)
? secondary(`update-${item.key}`, "Update", t, (_e, cx) => { cx.stop_propagation(); request({ op: "update", on: ctx.on, project: this.project, updates: [{ kind: item.kind, scope: item.scope, name: item.update, label: item.label }] }); }, { h: 24, px: 9, size: S().label })
: null;
@@ -825,7 +825,7 @@ export default class Skillshare extends View {
await asked; this.leaving = true; cx.notify();
await cx.sleep(150); closeOverlay(p.overlay);
});
if (p.role === "preview") { this.doc = null; this.file = null; this.pane = "main"; if (!p.item.notice && ["skills", "agents", "mcp"].includes(p.item.kind)) this.loadDoc(cx); }
if (p.role === "preview") { this.doc = null; this.file = null; this.pane = "main"; if (!p.item.notice && ["skills", "agents", "mcp", "extras"].includes(p.item.kind)) this.loadDoc(cx); }
if (p.role === "install") {
this.step = "url"; this.scope = p.scope ?? "global"; this.found = []; this.picked = new Set(); this.error = null; this.discovering = false;
this.dir = null; this.prog = null;
@@ -850,7 +850,7 @@ export default class Skillshare extends View {
const p = blockProps() ?? {};
this.doc = { loading: true };
cx.spawn(async (cx) => {
try { this.doc = await loadPreview(machineIO(cx), p.on, p.project, p.item, p.mcpPath); this.file = this.doc.files?.includes("SKILL.md") ? "SKILL.md" : this.doc.files?.[0] ?? null; }
try { this.doc = await loadPreview(machineIO(cx), p.on, p.project, p.item, p.mcpPath); this.file = this.doc.file ?? (this.doc.files?.includes("SKILL.md") ? "SKILL.md" : this.doc.files?.[0] ?? null); }
catch (e) { this.doc = { error: String(e?.message ?? e) }; }
cx.notify();
});
@@ -871,15 +871,15 @@ export default class Skillshare extends View {
// pane has to share its width with a list of something else.
renderPreview(t, p, close) {
const it = p.item, d = this.doc ?? {}, skillish = it.kind === "skills" || it.kind === "agents";
const kindName = { skills: "Skill", agents: "Agent", mcp: "MCP server", plugins: "Plugin", hooks: it.notice ? "Hooks" : "Hook" }[it.kind];
const color = it.notice ? t.blocked : { update: t.accent, sync: t.blocked, missing: t.ansi1, ok: t.ansi2, off: t.muted }[it.state] ?? t.muted;
const kindName = { skills: "Skill", agents: "Agent", mcp: "MCP server", plugins: "Plugin", hooks: it.notice ? "Hooks" : "Hook", extras: it.extra === "note" ? "Memory note" : "Extra" }[it.kind];
const color = needsLook(it) ? t.blocked : { update: t.accent, sync: t.blocked, missing: t.ansi1, ok: t.ansi2, off: t.muted }[it.state] ?? t.muted;
const tag = (text, c) => h_flex().h(22).px(9).flex_none().items_center().rounded(11).bg(t.selected).text_size(S().label).text_color(c).child(text);
const tags = [it.state === "update" ? tag(it.behind ? `Update available · ↓${it.behind}` : "Update available", t.accent) : null,
it.state === "sync" || it.state === "missing" ? tag("Needs sync", t.blocked) : null, it.state === "off" ? tag("Disabled", t.muted) : null];
it.state === "sync" || it.state === "missing" ? tag("Needs sync", t.blocked) : null, it.state === "off" ? tag("Disabled", t.muted) : null, it.state === "broken" ? tag("Source missing", t.blocked) : null];
const sub = [kindName, it.scope, it.root, it.notice || it.kind === "hooks" || it.kind === "mcp" ? null : it.src, p.on].filter(Boolean).join(" · ");
const targets = p.targets ?? [], waiting = targets.filter((r) => r.warn), whom = it.kind === "hooks" || it.kind === "plugins" ? "agent" : "target";
const panes = it.notice ? [] : [["main", { skills: "Document", agents: "Document", mcp: "Settings", hooks: "Definition", plugins: "About" }[it.kind]],
["targets", `${whom === "agent" ? "Agents" : "Targets"} ${targets.length}`], skillish ? ["details", "Details"] : null].filter(Boolean);
const panes = it.notice ? [] : [["main", { skills: "Document", agents: "Document", mcp: "Settings", hooks: "Definition", plugins: "About", extras: "Document" }[it.kind]],
it.extra === "note" ? null : ["targets", `${whom === "agent" ? "Agents" : "Targets"} ${targets.length}`], skillish ? ["details", "Details"] : null].filter(Boolean);
const pane = panes.some(([k]) => k === this.pane) ? this.pane : "main";
const quietNote = (text) => div().flex_none().text_size(S().label).text_color(t.muted).child(text);
@@ -894,6 +894,10 @@ export default class Skillshare extends View {
if (waitingFor) {
body = [scroll("pane", page([v_flex().gap(12).loop("opacity", PULSE)
.children([220, 520, 480, 340].map((w) => bone(t, w))).child(div().h(8)).children([160, 500, 420, 460, 260].map((w) => bone(t, w)))]))];
} else if (d.gone && pane !== "targets") {
// Nothing to retry: the source is missing until someone creates it or removes the extra.
body = [scroll("pane", v_flex().pt(110).gap(10).items_center().child(icon("alert", 22, t.blocked)).child(div().text_size(S().dialog).font_semibold().child("The source is missing"))
.child(div().px(40).text_size(S().secondary).text_color(t.muted).child(d.gone)))];
} else if (d.error && pane !== "targets") {
body = [scroll("pane", v_flex().pt(110).gap(10).items_center().child(icon("alert", 22, t.ansi1)).child(div().text_size(S().dialog).font_semibold().child("This could not be read"))
.child(div().px(40).text_size(S().secondary).text_color(t.muted).child(d.error)).child(secondary("retry", "Try again", t, (_e, cx) => this.loadDoc(cx))))];
@@ -903,13 +907,13 @@ export default class Skillshare extends View {
it.blocker ? quietNote("Resolve with the CLI or the dashboard. Sync validates again before it applies anything.") : null]))];
} else if (pane === "targets") {
// The Overview map's grammar, for this one thing: it on top, a line down to each place it goes.
const lane = (r, i) => mapLane(t, i === targets.length - 1, t.popover, syncLine(t, r.warn ? "wait" : "ok"), [dot(it.state === "unknown" ? t.muted : r.warn ? t.blocked : t.ansi2), agentIcon(t, r.name, 16),
const lane = (r, i) => mapLane(t, i === targets.length - 1, t.popover, syncLine(t, r.warn ? "wait" : "ok"), [dot(it.state === "unknown" || it.state === "broken" ? t.muted : r.warn ? t.blocked : t.ansi2), agentIcon(t, r.name, 16),
div().flex_1().min_w(0).truncate().font_medium().child(r.name),
r.text !== "in sync" ? div().flex_none().text_size(S().label).text_color(r.warn ? t.blocked : t.muted).child(r.text) : icon("check", 13, t.muted)]);
const said = it.state === "unknown" ? "Sync status unconfirmed" : it.state === "off" ? "Disabled, so it is not sent anywhere" : !targets.length ? `No ${whom}s yet` : waiting.length ? `${waiting.length} of ${plural(targets.length, whom)} waiting for a sync` : `In sync with ${plural(targets.length, whom)}`;
const how = { mcp: "Sync writes this server into each target's own MCP file.", hooks: "One definition. Sync writes each agent's native hook file.", plugins: "Each agent installs the plugin; skillshare keeps them the same." }[it.kind];
const said = it.state === "unknown" ? "Sync status unconfirmed" : it.state === "broken" ? "Source missing, so a sync can't send it" : it.state === "off" ? "Disabled, so it is not sent anywhere" : !targets.length ? `No ${whom}s yet` : waiting.length ? `${waiting.length} of ${plural(targets.length, whom)} waiting for a sync` : `In sync with ${plural(targets.length, whom)}`;
const how = { mcp: "Sync writes this server into each target's own MCP file.", hooks: "One definition. Sync writes each agent's native hook file.", plugins: "Each agent installs the plugin; skillshare keeps them the same.", extras: "Sync puts the extra's files in each target folder, in its mode." }[it.kind];
body = [scroll("pane", page([
h_flex().gap(8).items_center().child(it.state === "unknown" ? icon("alert", 16, t.muted) : waiting.length ? icon("alert", 16, t.blocked) : icon("check", 16, targets.length && it.state !== "off" ? t.ansi2 : t.muted)).child(div().text_size(S().dialog).font_semibold().child(said)),
h_flex().gap(8).items_center().child(it.state === "unknown" ? icon("alert", 16, t.muted) : waiting.length || it.state === "broken" ? icon("alert", 16, t.blocked) : icon("check", 16, targets.length && it.state !== "off" ? t.ansi2 : t.muted)).child(div().text_size(S().dialog).font_semibold().child(said)),
targets.length ? v_flex().pt(6)
.child(h_flex().h(52).px(14).gap(10).items_center().rounded(10).border_1().border_color(t.border).bg(t.chrome)
.child(dot(color, 9, it.state === "missing" || it.state === "off")).child(div().flex_1().min_w(0).truncate().font_semibold().child(it.label)).child(quietNote([kindName, it.scope].join(" · "))))
@@ -918,14 +922,14 @@ export default class Skillshare extends View {
} else if (pane === "details") {
body = [scroll("pane", page([d.meta?.length ? card(d.meta) : quietNote("This file declares no frontmatter."),
d.dir ? sectionLabel(t, "LOCATION") : null, d.dir ? monoBox(t, "where", d.dir) : null]))];
} else if (skillish) {
} else if (skillish || it.kind === "extras") {
const fileRow = (f) => div().id(`file-${f}`).h(28).mx(8).px(10).flex().flex_none().items_center().rounded(6).font_family(mono()).text_size(S().label)
.text_color(f === this.file ? t.foreground : t.muted).when(f === this.file, (el) => el.bg(t.selected)).when(f !== this.file, (el) => el.cursor_pointer().hover((s) => s.bg(t.hover)))
.on_click((_e, cx) => this.openFile(f, cx)).child(div().truncate().child(f));
const doc = d.plain ? monoBox(t, `doc-${this.file}`, d.body ?? "") : TextView.markdown(`doc-${this.file ?? it.key}`, d.body ?? "");
// Only a skill with more than its SKILL.md gets a file list; otherwise the document has the width.
body = [(d.files?.length ?? 0) > 1 ? div().id("files").w(196).h_full().flex_none().overflow_y_scrollbar().border_r(1).border_color(t.border)
.child(v_flex().py(10).gap(1).children(d.files.map(fileRow))) : null, scroll("pane", page([doc]))];
.child(v_flex().py(10).gap(1).children(d.files.map(fileRow))) : null, scroll("pane", page([it.kind === "extras" && d.meta?.length ? card(d.meta) : null, doc]))];
} else if (it.kind === "mcp") {
body = [scroll("pane", page([d.server?.length ? card(d.server) : quietNote("skillshare's MCP source has no settings for this server on this machine."),
quietNote("Secret values stay hidden. The preview shows names only.")]))];
+58 -14
View File
@@ -1,7 +1,7 @@
// What the panel shows, built from the skillshare CLI's JSON and git's porcelain output.
// No Herdr imports, so `node --test herdr/tests` runs it.
export const KINDS = [["skills", "Skills"], ["agents", "Agents"], ["mcp", "MCP"], ["plugins", "Plugins"], ["hooks", "Hooks"]];
export const KINDS = [["skills", "Skills"], ["agents", "Agents"], ["mcp", "MCP"], ["plugins", "Plugins"], ["hooks", "Hooks"], ["extras", "Extras"]];
export const SCOPES = [["all", "All"], ["project", "Project"], ["global", "Global"]];
// Long work runs detached, its output kept in a temp folder (out, err, code, pid) that the
@@ -217,7 +217,7 @@ export function targetDrift(diff) {
// Every target of the shown scopes and what still waits on it, most waiting first:
// { known, list: [{ name, n }], scopes }. raw: { [scope]: { diff, targets } }; diff leaves out targets
// that share another's folder, so targets adds the configured names. diff counts skills and agents only, so a waiting MCP
// server, plugin or hook in items adds one to each target it waits on. known: a diff answered;
// server, plugin, hook or extra in items adds one to each target it waits on. known: a diff answered;
// scopes: the ones with a waiting target.
export function targetList(raw, scope = "all", items = []) {
const by = new Map();
@@ -235,7 +235,7 @@ export function targetList(raw, scope = "all", items = []) {
for (const name of raw[s]?.targets ?? []) if (!by.has(name)) by.set(name, 0);
}
for (const i of items) {
if (!(scope === "all" || i.scope === scope) || i.notice || !waitsForSync(i) || !["mcp", "plugins", "hooks"].includes(i.kind)) continue;
if (!(scope === "all" || i.scope === scope) || i.notice || !waitsForSync(i) || !["mcp", "plugins", "hooks", "extras"].includes(i.kind)) continue;
for (const r of previewTargets(i)) if (r.warn && by.has(r.name)) by.set(r.name, by.get(r.name) + 1);
}
return { known, scopes, list: [...by].map(([name, n]) => ({ name, n })).sort((a, b) => b.n - a.n || a.name.localeCompare(b.name)) };
@@ -243,6 +243,8 @@ export function targetList(raw, scope = "all", items = []) {
// A row Sync would act on: a waiting resource, or a hook notice with native changes.
export const waitsForSync = (i) => (i.notice ? Boolean(i.pending) : i.state === "sync" || i.state === "missing");
// A row that needs a person rather than a sync: a hook notice, or an extra whose source is gone.
export const needsLook = (i) => Boolean(i.notice) || i.state === "broken";
// The scopes Sync runs in for the shown scope: every one with a waiting row or a waiting target
// (a target can wait with no row left, as after an uninstall); with nothing waiting, the shown ones.
@@ -271,8 +273,9 @@ const plural = (n, word) => `${n} ${word}${n === 1 ? "" : "s"}`;
const andMore = (list) => (list.length <= 2 ? list.map((x) => x.name).join(" and ") : `${list[0].name}, ${list[1].name} and ${list.length - 2} more`);
// Overview's answer in two lines: { kind, headline, sub }, kind one of loading, failed, moving,
// waiting, ok. pending: rows Sync would act on; lag: targets with something waiting.
export function overviewAnswer({ loading, failed, error, moving, reading = [], incomplete = false, pending = 0, lag = [], total = 0, targets = 0 }) {
// waiting, look, ok. pending: rows Sync would act on; lag: targets with something waiting;
// broken: extras whose source is missing, which no sync fixes.
export function overviewAnswer({ loading, failed, error, moving, reading = [], incomplete = false, pending = 0, lag = [], total = 0, targets = 0, broken = 0 }) {
if (loading) return { kind: "loading", headline: "Reading skillshare", sub: "one moment" };
if (failed) return { kind: "failed", headline: "skillshare could not be read", sub: error ?? "" };
if (moving) return { kind: "moving", headline: lag.length ? `Syncing ${plural(lag.length, "target")}` : "Syncing", sub: lag.length ? andMore(lag) : "every target" };
@@ -282,6 +285,7 @@ export function overviewAnswer({ loading, failed, error, moving, reading = [], i
return { kind: "waiting", headline: lag.length ? `${plural(lag.length, "target")} need${lag.length === 1 ? "s" : ""} a sync` : `${plural(pending, "resource")} to sync`,
sub: pending ? `${plural(pending, "resource")} waiting${lag.length ? ` for ${andMore(lag)}` : ""}` : `waiting on ${andMore(lag)}` };
}
if (broken) return { kind: "look", headline: `${plural(broken, "extra")} need${broken === 1 ? "s" : ""} a look`, sub: broken === 1 ? "its source is missing, so a sync can't fix it" : "their sources are missing, so a sync can't fix them" };
return { kind: "ok", headline: "Everything is in sync", sub: `${plural(total, "resource")} · ${plural(targets, "target")}` };
}
@@ -289,16 +293,19 @@ export function overviewAnswer({ loading, failed, error, moving, reading = [], i
// inventories answer; diff/status affect sync confidence but not inventory counts.
export function resourceProgress(raw, scope = "all") {
const pending = new Set(), errors = [], unknown = new Set();
let available = false;
const kinds = { list: ["skills", "agents"], mcp: ["mcp"], plugins: ["plugins"], hooks: ["hooks"] };
let available = false, incomplete = false;
const kinds = { list: ["skills", "agents"], mcp: ["mcp"], plugins: ["plugins"], hooks: ["hooks"], extras: ["extras"], memory: ["extras"] };
for (const [s, one] of Object.entries(raw)) {
if (scope !== "all" && scope !== s) continue;
available ||= Object.keys(kinds).some((key) => one[key] != null);
for (const key of one.pending ?? []) pending.add(key);
for (const [key, message] of Object.entries(one.errors ?? {})) errors.push(`${s} ${key}: ${message}`);
for (const [key, names] of Object.entries(kinds)) if ((one.pending ?? []).includes(key) || one.errors?.[key]) for (const name of names) unknown.add(name);
// Memory notes never wait for a sync, so their read leaves sync states confirmed.
for (const key of one.pending ?? []) { pending.add(key); incomplete ||= key !== "memory"; }
for (const [key, message] of Object.entries(one.errors ?? {})) { errors.push(`${s} ${key}: ${message}`); incomplete ||= key !== "memory"; }
// A memory error marks the Extras count unknown only after notes have been read.
const failed = (key) => Boolean(one.errors?.[key]) && (key !== "memory" || one.memory != null);
for (const [key, names] of Object.entries(kinds)) if ((one.pending ?? []).includes(key) || failed(key)) for (const name of names) unknown.add(name);
}
return { pending: [...pending], errors, unknown, available, incomplete: Boolean(pending.size || errors.length) };
return { pending: [...pending], errors, unknown, available, incomplete };
}
// A machine card's remote line, and the targets that wait on it by name (max at most).
@@ -405,9 +412,39 @@ export function buildItems(scope, raw) {
item.state = !raw.hooks?.plan ? "unknown" : pending.length ? "sync" : item.disabled ? "off" : "ok";
items.push(item);
}
// An extra's target is named by the target whose skills folder shares its parent folder.
// Relative project paths start from the project folder; the first target by name wins a shared folder.
const segments = (path) => String(path ?? "").toLowerCase().split(/[\\/]+/).filter((s) => s && s !== ".");
const root = raw.root ? segments(raw.root) : null;
const homes = (raw.targetPaths ?? []).map((t) => ({ name: t.name, dir: segments(t.path).slice(0, -1) })).sort((a, b) => String(a.name).localeCompare(String(b.name)));
const owner = (path) => {
const abs = /^([a-z]:)?[\\/]/i.test(path);
if (!abs && !root) return path;
const p = abs ? segments(path) : [...root, ...segments(path)];
let best = null;
for (const { name, dir } of homes) {
if (dir.length && dir.length <= p.length && dir.every((s, i) => s === p[i]) && dir.length > (best?.n ?? 0)) best = { name, n: dir.length };
}
return best?.name ?? path;
};
for (const e of Array.isArray(raw.extras) ? raw.extras : []) {
const rows = (e.targets ?? []).map((x) => {
const how = [x.mode, x.as && `as ${x.as}`].filter(Boolean).join(" ");
return { name: owner(x.path), warn: !["synced", "no source"].includes(x.status), text: x.status === "synced" ? how || "in sync" : [x.status, how].filter(Boolean).join(" · ") };
});
// sourceMissing: the source itself is gone. A target also says "no source" when its files can't be listed.
const sourceMissing = e.source_exists === false, gone = sourceMissing || (e.targets ?? []).some((x) => x.status === "no source");
items.push({ key: `${scope}:extras:${e.name}`, kind: "extras", extra: e.file ? "file" : "folder", scope, name: e.name, label: e.name,
file: e.file, dir: e.source_dir, rows, sourceMissing, src: gone ? "source missing" : `${e.file || plural(e.file_count ?? 0, "file")} · ${plural(rows.length, "target")}`,
state: gone ? "broken" : rows.some((r) => r.warn) ? "sync" : "ok" });
}
for (const n of raw.memory?.notes ?? []) {
items.push({ key: `${scope}:extras:memory/${n.path}`, kind: "extras", extra: "note", scope, name: n.path, label: n.path,
file: n.path, dir: raw.memory.root, rows: [], src: "memory note", state: "ok" });
}
if (raw.pending || raw.errors) {
for (const item of items) {
const keys = item.kind === "skills" || item.kind === "agents" ? ["list", "diff", "status"] : [item.kind];
const keys = item.kind === "skills" || item.kind === "agents" ? ["list", "diff", "status"] : item.kind === "extras" ? [item.extra === "note" ? "memory" : "extras"] : [item.kind];
if (!item.notice && item.state !== "off" && keys.some((key) => raw.pending?.includes(key) || raw.errors?.[key])) {
item.cachedState = item.state;
item.state = "unknown";
@@ -498,7 +535,8 @@ export function eligibleTargets(item, one) {
// names: every target of the item's scope, for skills and agents (their rows name only the waiting ones).
export function previewTargets(item, names = []) {
let rows;
if (item.kind === "hooks") {
if (item.kind === "extras") rows = [...item.rows];
else if (item.kind === "hooks") {
const by = new Map((item.targets ?? []).map((n) => [n, { name: n, text: "in sync", warn: false }]));
for (const c of item.changes ?? []) if (c.target) by.set(c.target, { name: c.target, text: c.action === "unchanged" ? "in sync" : c.action, warn: !["unchanged", "inactive"].includes(c.action) });
rows = [...by.values()];
@@ -518,6 +556,12 @@ export const READ_SKILL = `cd "$1" 2>/dev/null || exit 3
find . -type f -not -path './.git/*' | sed 's|^\\./||' | sort | head -40
echo @@
head -c 60000 SKILL.md 2>/dev/null`;
// sh -c READ_EXTRA <name> <dir>: a folder extra's files as extras sync sees them, then as READ_SKILL.
// DiscoverExtraFiles (internal/sync/extras.go) skips every .git folder and every .metadata.json.
export const READ_EXTRA = `cd "$1" 2>/dev/null || exit 3
find . -type d -name .git -prune -o -type f ! -name .metadata.json -print | sed 's|^\\./||' | sort | head -40
echo @@
head -c 60000 SKILL.md 2>/dev/null`;
// sh -c READ_FILE <name> <path>: a file's first 60 kB.
export const READ_FILE = 'head -c 60000 "$1" 2>/dev/null';
@@ -608,7 +652,7 @@ export function sourceGroups(items) {
}
export function counts(items) {
const c = { all: 0, project: 0, global: 0, skills: 0, agents: 0, mcp: 0, plugins: 0, hooks: 0 };
const c = { all: 0, project: 0, global: 0, skills: 0, agents: 0, mcp: 0, plugins: 0, hooks: 0, extras: 0 };
for (const i of items) { if (!i.notice) { c.all++; c[i.scope]++; c[i.kind]++; } }
return c;
}
+24 -11
View File
@@ -9,7 +9,8 @@ you use. This panel puts it beside your agents in [Herdr](https://herdr.dev):
- **See what needs you.** Overview answers in one line, with one Sync button, a count of everything
in the source and a line to every target that shows which ones are waiting.
- **Read before you act.** Click any row to preview it: a skill's `SKILL.md` and files, an agent, an
MCP server's settings with secret values hidden, a hook, a plugin, and the targets each goes to.
MCP server's settings with secret values hidden, a hook, a plugin, an extra's file or folder, a
memory note, and the targets each goes to.
- **Fix it without leaving Herdr.** Update, sync, enable or disable, uninstall, or install from a URL; every install
is audited first, and a blocked one shows its findings before anything is written.
- **Ask your agent.** Hand an audit of any skill to the focused agent.
@@ -101,11 +102,15 @@ Read ~/.config/herdr-app/AGENTS.md, then update only the installed skillshare mo
On Windows, which has no `sh`, it runs through Git for Windows' `bin/sh.exe`.
- A folder with `.skillshare/config.yaml` or `skillshare/config.yaml` is a project; both
scopes show and the All · Project · Global switch appears beside the tabs.
- Per scope, independent detached reads run `list --all`, `diff`, `mcp list`, `plugin list` and
`hooks list` with `--json`. Each result appears as soon as it is ready; a slow plugin inventory
does not hold up other resources or the source's Git state. Refreshes keep existing rows visible.
- Per scope, independent detached reads run `list --all`, `diff`, `mcp list`, `plugin list`,
`hooks list`, `extras list` and `extras memory list` with `--json`. Each result appears as soon
as it is ready; a slow plugin inventory does not hold up other resources or the source's Git
state. Refreshes keep existing rows visible.
Pending or failed inventories show `…` instead of zero, and sync states remain unconfirmed until
the reads succeed. Read errors stay visible beside the available data; the next refresh retries.
the reads succeed; memory notes never wait for a sync, so their read is the exception: a failed
memory read leaves sync states confirmed. If the memory read fails before any notes have been
read, the Extras count is the extras already read; skillshare before 0.24 has no memory list. Read
errors stay visible beside the available data; the next refresh retries.
`check` and `check agents` run every 10 minutes. Git state comes from `git status` in the
source repository, because the CLI has no JSON for it.
- The install dialog reads canonical names and repository-relative paths from
@@ -126,14 +131,22 @@ Read ~/.config/herdr-app/AGENTS.md, then update only the installed skillshare mo
which version to keep for each file.
- A preview reads on the item's machine: a skill's file names (40 at most) and the first 60 kB of
the file shown, an agent's `.md`, or the MCP source file. Env, header and bearer-token values are
replaced before the dialog gets them, so it shows names only.
the file shown, an agent's `.md`, the MCP source file, an extra's file or a folder extra's file
names and one file, or a memory note. Env, header and bearer-token values are replaced before
the dialog gets them, so it shows names only.
- The map's target names come from `status --json` and `diff --json`. A target's count is what
`diff` reports for skills and agents, plus each MCP server, plugin or hook that waits on it.
`diff` reports for skills and agents, plus each MCP server, plugin, hook or extra waiting on it.
An extra's target is named by the target whose skills folder shares its parent folder; a
project's relative extras paths start from the project folder, and when targets share a folder
the first by name names it.
Overview lists only what needs you: what waits for a sync, what has an update, hook notices, and
machines that are behind once the Machines tab has read them. Library lists everything by kind,
in Need a look, Needs sync, Update available, In sync and Off; disabled rows are always under Off.
Overview lists only what needs you: what waits for a sync, what has an update, hook notices, extras
whose source is missing, and machines that are behind once the Machines tab has read them. Library
lists everything by kind, in Need a look, Needs sync, Update available, In sync and Off; disabled rows are always under Off.
Extras lists each file or folder extra and each memory note; an extra waits for a sync while a
target's status in `extras list` is not `synced`. A missing source is the exception: a sync can't
fix it, so that extra is under Need a look as "source missing", and with nothing waiting Overview
says how many extras need a look instead of "Everything is in sync".
For skills and agents, In sync switches between List and By source (the default), which folds
rows from the same repository, or local ones, into collapsible groups. A source with one row stays
a plain row, and a filter opens every group.
+12 -11
View File
@@ -1,6 +1,6 @@
# Herdr + skillshare
skillshare beside your agents. Herdr's default window gains a skillshare button in the tab bar and a panel beside the work area that shows which of your skills, agents, MCP servers, plugins and hooks need an update or a sync, in the focused space's project and in your global source. From the panel you update, sync, install from a URL with an audit first, enable or disable a skill or agent, uninstall, ask the focused agent to audit something, sync the source repository both ways, and check skillshare on every Herdr machine.
skillshare beside your agents. Herdr's default window gains a skillshare button in the tab bar and a panel beside the work area that shows which of your skills, agents, MCP servers, plugins, hooks and extras need an update or a sync, in the focused space's project and in your global source. From the panel you update, sync, install from a URL with an audit first, enable or disable a skill or agent, uninstall, ask the focused agent to audit something, sync the source repository both ways, and check skillshare on every Herdr machine.
![Herdr + skillshare](preview.png)
@@ -30,24 +30,25 @@ Left to right, everything as in Herdr's `main` layout, plus two blocks:
- a 44px header: the mark, "skillshare", a pill with the folder (or "global" outside a project) and the machine, which shortens with an ellipsis when the row runs out of room, an "Update panel" button when a newer skillshare release is published and nothing is running, the CLI version in `muted`, and a close button;
- Overview, Library and Machines tabs, the shown one underlined in `foreground`. At the row's right, a skillshare project gets an All · Project · Global switch that Overview and Library share; outside a project it says "Global". On Machines the same place says when the machines were last checked.
- Overview:
- a headline with its mark: "Reading skillshare", "Everything is in sync", "n targets need a sync" (or "n resources to sync" when only MCP servers, plugins or hooks wait), or "Syncing n targets"; a primary Sync button while something waits;
- the map: a row of five counts (Skills · Agents · MCP · Plugins · Hooks). Each opens Library on that kind, and turns `blocked` when that kind has something waiting. Under it, one 32px line runs down to each target: a status dot, the agent's mark, the name, and a check or "n to sync". It draws at most six lines, waiting targets first; targets that do not fit become a count ("+n more", "n others"). Resting the pointer on a count for 250ms opens a hover card (base `HoverCard`, `top_left`, so it hangs under the line; `anchor` names the card's corner, so `bottom_*` opens it upward over the map) that lists those targets as the lines they would have been, inset so its dots continue the column above. Target names come from `status --json` and `diff --json`; a target's count is what `diff` reports for skills and agents, plus each MCP server, plugin or hook that waits on it. A waiting line is dashed in `blocked` and flows while a sync runs.
- a headline with its mark: "Reading skillshare", "Everything is in sync", "n targets need a sync" (or "n resources to sync" when only MCP servers, plugins, hooks or extras wait), "n extras need a look" when nothing waits but an extra's source is missing, or "Syncing n targets"; a primary Sync button while something waits;
- the map: a row of six counts (Skills · Agents · MCP · Plugins · Hooks · Extras). Each opens Library on that kind, and turns `blocked` when that kind has something waiting. Under it, one 32px line runs down to each target: a status dot, the agent's mark, the name, and a check or "n to sync". It draws at most six lines, waiting targets first; targets that do not fit become a count ("+n more", "n others"). Resting the pointer on a count for 250ms opens a hover card (base `HoverCard`, `top_left`, so it hangs under the line; `anchor` names the card's corner, so `bottom_*` opens it upward over the map) that lists those targets as the lines they would have been, inset so its dots continue the column above. Target names come from `status --json` and `diff --json`; a target's count is what `diff` reports for skills and agents, plus each MCP server, plugin, hook or extra that waits on it. A waiting line is dashed in `blocked` and flows while a sync runs.
- the agent's mark is Herdr's own program icon, found by the target's name or its `<agent>-` prefix; `omp` and `universal` use the two colour marks in `icons/`, and anything else the generic agent icon;
- then only what needs you: "WAITING TO SYNC · n", "UPDATE AVAILABLE · n" with Update on each row, "HOOKS NEED A LOOK · n", and "MACHINES · n" once the Machines tab has read them.
- then only what needs you: "WAITING TO SYNC · n", "UPDATE AVAILABLE · n" with Update on each row, "NEED A LOOK · n" (hook notices, and extras whose source is missing), and "MACHINES · n" once the Machines tab has read them.
- Library:
- Skills · Agents · MCP · Plugins · Hooks tabs with counts (named hook entries, including pending cleanup; notices do not count);
- Skills · Agents · MCP · Plugins · Hooks · Extras tabs with counts (named hook entries, including pending cleanup; notices do not count);
- Extras rows: each extra from `extras list --json` (its file or file count, and its target count; it waits for a sync while a target's status is not `synced`; when its source is missing (`source_exists: false`, or a target's `no source`) it is under NEED A LOOK as "source missing") and each memory note from `extras memory list --json`;
- a filter field, a Sync button (primary while something waits) and a 30px install button;
- the list, the only part that scrolls: rows whose sync state is unknown, then "NEED A LOOK · n" (hook notices), "NEEDS SYNC · n" in `blocked`, "UPDATE AVAILABLE · n" in `accent` with Update all when there are several, "IN SYNC · n", and "OFF · n" for disabled rows. For skills and agents "IN SYNC" has a List · By source switch, By source by default and kept in `shared`: rows sharing a repository (a tracked repo, or host/owner/repo of the source URL, with github.com left out) or the local source fold under a collapsed row with a chevron, a `git` or `folder` icon, the source and a count. A source with one row stays a plain row, and a filter opens every group.
- the list, the only part that scrolls: rows whose sync state is unknown, then "NEED A LOOK · n" (hook notices, and extras whose source is missing), "NEEDS SYNC · n" in `blocked`, "UPDATE AVAILABLE · n" in `accent` with Update all when there are several, "IN SYNC · n", and "OFF · n" for disabled rows. For skills and agents "IN SYNC" has a List · By source switch, By source by default and kept in `shared`: rows sharing a repository (a tracked repo, or host/owner/repo of the source URL, with github.com left out) or the local source fold under a collapsed row with a chevron, a `git` or `folder` icon, the source and a count. A source with one row stays a plain row, and a filter opens every group.
- Each row is 46px: a dot (filled `accent`, `blocked` or `ansi2`; hollow `ansi1` when never synced or `muted` when disabled), the name, one short state, and a chevron. A row with an update also has Update. Clicking a row opens its preview; rows do not open in place.
- Machines: one card per Herdr machine. Its header has a status dot, the name, "this computer" and the version (a pill when a newer skillshare exists). Two lines follow in the map's grammar, Remote to Source and Source to its targets, each with its state at the right, and the targets that wait by name, three at most. The footer has Pull and sync, or Sync both ways when that machine has uncommitted or unpushed work and an upstream (a plain pull would refuse), "Update to …" when a newer skillshare exists, and the doctor's errors or warnings. Updating skillshare puts the spinner on "Updating…" in the version button; pulling/syncing puts it on the sync button. Other actions are disabled without a spinner while the machine is busy. While the first check runs, two card-shaped placeholders pulse.
- a 34px status line while work runs (work, installs included, runs one at a time per machine; machines run side by side), with a spinning ring in `working`, or a notice: a done notice clears after 4 s and a warning or error after 8 s, and a stopped pull keeps a "Review conflicts" bar;
- a 40px footer: the source state, such as "Source · n uncommitted · ↑n ↓n", "up to date" or "no remote" (`blocked` when it needs attention), and Sync both ways when the repository has an upstream.
- Initial loading draws the content's own shape: the map with empty counts and four lines, list rows, machine cards. Each pulses once every 1.2 s. Resource reads run independently per scope and appear as each finishes; Source reads independently too. Refreshes keep existing rows visible; previously actionable Overview rows move to a neutral "SYNC STATUS UNCONFIRMED" section until their reads succeed. Pending or failed inventory counts show `…`, not zero; target lines and cached rows remain unconfirmed while their reads are pending or failed, and Overview does not claim everything is in sync. Library names the reads still running. Errors stay visible beside available data and retry on the next refresh.
- Initial loading draws the content's own shape: the map with empty counts and four lines, list rows, machine cards. Each pulses once every 1.2 s. Resource reads run independently per scope and appear as each finishes; Source reads independently too. Refreshes keep existing rows visible; previously actionable Overview rows move to a neutral "SYNC STATUS UNCONFIRMED" section until their reads succeed. Pending or failed inventory counts show `…`, not zero; target lines and cached rows remain unconfirmed while their reads are pending or failed, and Overview does not claim everything is in sync. Memory notes are the exception, since they never wait for a sync: a failed `extras memory list` shows its error but leaves sync states confirmed. If the memory read fails before any notes have been read, the Extras count is the extras already read; skillshare before 0.24 has no memory list. Notes kept from an earlier read leave it at `…` until a read succeeds. Library names the reads still running. Errors stay visible beside available data and retry on the next refresh.
- Motion is Herdr's native kind: the status line's height slides (180 ms) so the list does not jump, a waiting line breathes and a syncing one flows, a dialog fades in and rises 8px (200 ms) and fades out (150 ms) before it closes, and buttons and rows show a pressed state.
- Dialogs open as Herdr overlays with `frame: "none"`, so each draws its own card: a 56px header (title, one line under it, an Esc keycap and a close button), the body, and a 54px footer with quiet actions at the left and one primary button at the right. They are: preview, install, hook change, enable or disable, uninstall, audit hand-off, source repository, sync both ways, pull conflicts, update skillshare, update the panel, command output.
- Preview (760×560) has one tab per question, so no pane shares its width:
- Document (Settings for an MCP server, Definition for a hook, About for a plugin): a skill's `SKILL.md` rendered as Markdown, with a file list at the left only when the skill has other files; an agent's file; an MCP server's transport, command, arguments and the names of its env, headers and token; a hook's description, agents and native files; a plugin's source and version.
- Targets n (Agents n for hooks and plugins): the item on top and a line down to each target, as on Overview.
- Document (Settings for an MCP server, Definition for a hook, About for a plugin): a skill's `SKILL.md` rendered as Markdown, with a file list at the left only when the skill has other files; an agent's file; an MCP server's transport, command, arguments and the names of its env, headers and token; a hook's description, agents and native files; a plugin's source and version; an extra's file, or a folder extra's files with `SKILL.md` or else the first one shown; a memory note. An extra whose source folder or file is gone (`source_exists: false`) says so, with no Try again.
- Targets n (Agents n for hooks and plugins): the item on top and a line down to each target, as on Overview. An extra's target is named by the target whose skills folder shares its parent folder, as the dashboard names it, or else by its path, and shows its mode and file name, or its status while it waits. A project's relative extras paths start from the project folder; when targets share a folder, the first by name names it. Memory notes have no Targets tab.
- Details, for skills and agents: the frontmatter as rows, and where the files are.
- A hook notice has no tabs: it shows what the notice says.
- Install shows its four steps (Source, Choose, Audit, Install) above the body.
@@ -61,8 +62,8 @@ Left to right, everything as in Herdr's `main` layout, plus two blocks:
- skills and agents that need a sync offer Diff;
- skills and agents offer Disable, or Enable when disabled (`skillshare disable` / `enable` with the entry's own path, `--kind agent` for an agent; the next sync applies it), Uninstall, and "Ask <agent> to audit…" when Herdr knows an agent: the one focused, or the last one focused;
- top-level declared hooks offer Enable, Disable and Remove;
- MCP and plugin previews have no actions; Sync handles them.
- A preview reads on the item's machine: the skill's file names (40 at most) and the first 60 kB of the file shown, an agent's `.md`, or the MCP source file `mcp list --json` names. Env, header and bearer-token values are replaced before the dialog gets them, so it shows names only.
- MCP, plugin and extras previews have no actions; Sync handles them.
- A preview reads on the item's machine: the skill's file names (40 at most) and the first 60 kB of the file shown, an agent's `.md`, the MCP source file `mcp list --json` names, an extra's file or a folder extra's file names and one file, or a memory note. Env, header and bearer-token values are replaced before the dialog gets them, so it shows names only.
- Hook conflicts block `sync --all` for every resource kind; resolve them in the CLI or dashboard before retrying.
- Sync, on Overview, syncs every scope that has something waiting in the scope the switch shows, and also runs `sync plugins` when a plugin waits. Sync in Library does the same, and with nothing waiting it syncs the shown scope again.
- The install button opens a URL dialog with recent sources:
+23 -6
View File
@@ -3,7 +3,7 @@
// and the tests pass a fake machine.
// io.job(args, { on, cwd, script }): skillshare (or a script of ours) run detached;
// io.run(args, { on, cwd }): a short read; io.sh(script, args, on): one exec of a script.
import { GIT_STATUS, PROJECT, READ_SKILL, READ_FILE, LATEST_RELEASE, releaseTag, parseJSON, failure, flag, parseGitStatus, driftFrom, targetDrift, splitFrontmatter, mcpServer } from "./model.js";
import { GIT_STATUS, PROJECT, READ_SKILL, READ_EXTRA, READ_FILE, LATEST_RELEASE, releaseTag, parseJSON, failure, flag, parseGitStatus, driftFrom, targetDrift, splitFrontmatter, mcpServer } from "./model.js";
const scopesOf = (project) => (project ? ["project", "global"] : ["global"]);
const at = (on, project, scope) => ({ on, cwd: scope === "project" ? project : null });
@@ -17,9 +17,10 @@ export async function findProject({ sh }, on, folders) {
// Each read publishes independently. Keep the previous values during refresh, but track
// pending and failed sections separately so a stale value never claims a fresh sync verdict.
export async function loadResources(io, on, project, network, progress = () => {}, previous = {}) {
const commands = { list: ["list", "--all"], diff: ["diff"], mcp: ["mcp", "list"], plugins: ["plugin", "list"], hooks: ["hooks", "list"], status: ["status"] };
const commands = { list: ["list", "--all"], diff: ["diff"], mcp: ["mcp", "list"], plugins: ["plugin", "list"], hooks: ["hooks", "list"], extras: ["extras", "list"], memory: ["extras", "memory", "list"], status: ["status"] };
const raw = {};
for (const scope of scopesOf(project)) raw[scope] = { ...previous[scope], pending: Object.keys(commands), errors: {}, took: {}, error: null };
// root: the project folder, which a project's relative extras paths start from.
for (const scope of scopesOf(project)) raw[scope] = { ...previous[scope], pending: Object.keys(commands), errors: {}, took: {}, error: null, root: scope === "project" ? project : null };
let git = null, version = null;
const snapshot = () => ({ raw: Object.fromEntries(Object.entries(raw).map(([scope, one]) => [scope, { ...one, pending: [...one.pending], errors: { ...one.errors }, took: { ...one.took } }])), git, version,
error: Object.entries(raw).flatMap(([scope, one]) => Object.entries(one.errors).map(([name, message]) => `${scope} ${name}: ${message}`)).join("\n") || null });
@@ -35,7 +36,7 @@ export async function loadResources(io, on, project, network, progress = () => {
if (r.code !== 0 || value == null || (name === "list" && !Array.isArray(value))) throw new Error(failure(r, `skillshare ${args.join(" ")}`));
if (name === "status") {
status = value;
Object.assign(one, { targets: names(value.targets), skillTargets: names((value.targets ?? []).filter((x) => x.skills_enabled !== false)), agentTargets: names(value.agents?.targets) });
Object.assign(one, { targets: names(value.targets), targetPaths: (value.targets ?? []).map((x) => ({ name: x.name, path: x.path })), skillTargets: names((value.targets ?? []).filter((x) => x.skills_enabled !== false)), agentTargets: names(value.agents?.targets) });
if (scope === "global") version = value.version ?? null;
} else one[name] = value;
} catch (e) {
@@ -96,10 +97,26 @@ export async function loadLatestRelease({ sh }) {
return releaseTag((await sh(LATEST_RELEASE)).stdout);
}
// What a preview shows beyond the row: a skill's files and SKILL.md, an agent's file, or an MCP
// server's settings (mcpPath is the MCP source file). { files, dir, meta, body } | { server } | { error }.
// What a preview shows beyond the row: a skill's files and SKILL.md, an agent's file, an MCP
// server's settings (mcpPath is the MCP source file), or an extra's files.
// { files, dir, meta, body } | { server } | { gone } | { error }; an extra's also names the file shown.
export async function loadPreview(io, on, project, item, mcpPath) {
if (item.kind === "mcp") return { server: mcpPath ? mcpServer((await io.sh(READ_FILE, [mcpPath], on)).stdout, item.name) : null };
if (item.kind === "extras") {
// A missing source has nothing to read, and reading again won't change that.
if (item.sourceMissing) return { gone: `${item.file ? `${item.dir}/${item.file}` : item.dir} is missing. Create it, or remove the extra.` };
if (item.extra !== "folder") return { files: [item.file], file: item.file, dir: item.dir, ...(await loadFile(io, on, item.dir, item.file)) };
// A folder lists only the files extras sync sends, and shows its SKILL.md, which READ_EXTRA
// already read, else its first file. A folder holds no SKILL.md as a rule, so READ_EXTRA
// ending non-zero is not an error here.
const r = await io.sh(READ_EXTRA, [item.dir], on), cut = r.stdout.indexOf("@@\n");
if (cut < 0) return { error: `${item.dir} could not be read.` };
const files = r.stdout.slice(0, cut).split("\n").filter(Boolean), text = r.stdout.slice(cut + 3);
if (text && !files.includes("SKILL.md")) files.unshift("SKILL.md");
if (!files.length) return { error: `${item.dir} has no files to show.` };
if (files.includes("SKILL.md")) return { files, file: "SKILL.md", dir: item.dir, ...splitFrontmatter(text) };
return { files, file: files[0], dir: item.dir, ...(await loadFile(io, on, item.dir, files[0])) };
}
const st = parseJSON((await io.run(["status", "--json", flag(item.scope)], at(on, project, item.scope))).stdout);
const base = item.kind === "agents" ? st?.agents?.source : st?.source?.path;
if (!base) return { error: "skillshare did not say where this source is." };
+25 -21
View File
@@ -11,7 +11,7 @@ import { v_flex, h_flex, InputState, Input, TextView, HoverCard } from "gpui-bas
import { exec, hc, run, spaces, agents, focused, machines, shared, setShared, theme, settings, layout, openOverlay, closeOverlay, nextCommand, readTextFile, knownAgents, props as blockProps } from "herdr";
import {
KINDS, SCOPES, DISCOVER, AUDIT,
parseJSON, lastLine, failure, flag, sourceLine, buildItems, shownRows, endedRequests, afterRead, afterChecks, hookArgs, toggleArgs, rowState, previewTargets, eligibleTargets, targetList, waitsForSync, syncScopes, overviewAnswer, resourceProgress, remoteLine, waitingNames, mapLanes, needsBothWays, filterItems, groupItems, sourceGroups, counts,
parseJSON, lastLine, failure, flag, sourceLine, buildItems, shownRows, endedRequests, afterRead, afterChecks, hookArgs, toggleArgs, rowState, previewTargets, eligibleTargets, targetList, waitsForSync, needsLook, syncScopes, overviewAnswer, resourceProgress, remoteLine, waitingNames, mapLanes, needsBothWays, filterItems, groupItems, sourceGroups, counts,
cloneUrl, installResult, newerVersion, panelUpdate, updateState, ago, auditMessage, parseDiscover, parseAudit,
} from "./model.js";
import { createRunner, withShell } from "./jobs.js";
@@ -494,13 +494,13 @@ export default class Skillshare extends View {
const failed = Boolean(this.error || progress.errors.length) && !progress.available && !progress.pending.length;
const byLabel = (a, b) => a.label.localeCompare(b.label);
const waiting = all.filter((i) => !i.notice && (i.state === "sync" || i.state === "missing")).sort(byLabel);
const updates = all.filter((i) => !i.notice && i.state === "update").sort(byLabel), notices = all.filter((i) => i.notice);
const updates = all.filter((i) => !i.notice && i.state === "update").sort(byLabel), notices = all.filter(needsLook);
const pending = [...waiting, ...notices.filter((i) => i.pending)];
const targets = targetList(this.raw, scope, this.items), lag = targets.list.filter((x) => x.n);
const busy = this.busyAt(ctx.on), moving = Boolean(busy) && /^Sync/.test(channel.textAt(ctx.on) ?? "");
const { kind: answer, headline, sub } = overviewAnswer({ loading, failed, error: this.error, moving, reading: progress.pending, incomplete: progress.incomplete, pending: pending.length, lag, total: kc.all, targets: targets.list.length });
const { kind: answer, headline, sub } = overviewAnswer({ loading, failed, error: this.error, moving, reading: progress.pending, incomplete: progress.incomplete, pending: pending.length, lag, total: kc.all, targets: targets.list.length, broken: all.filter((i) => i.state === "broken").length });
const mark = { loading: () => icon("ring", 20, t.muted).spin(900), failed: () => icon("alert", 20, t.ansi1), moving: () => icon("ring", 20, t.blocked).spin(900),
waiting: () => icon("alert", 20, t.blocked), ok: () => icon("check", 20, t.ansi2) }[answer]();
waiting: () => icon("alert", 20, t.blocked), look: () => icon("alert", 20, t.blocked), ok: () => icon("check", 20, t.ansi2) }[answer]();
const hot = new Set(pending.map((x) => x.kind));
const sync = () => request({ op: "sync", on: ctx.on, project: this.project, scopes: syncScopes(this.items, this.raw, scope), plugins: waiting.some((i) => i.kind === "plugins") });
const hero = v_flex().flex_none().px(14).py(16).gap(14).border_b(1).border_color(t.border)
@@ -518,11 +518,11 @@ export default class Skillshare extends View {
else {
const sections = [];
const group = (id, label, color, rows) => { if (rows.length) sections.push(this.groupHeader(t, id, `${label} · ${rows.length}`, color, null), ...rows); };
const unconfirmed = all.filter((i) => i.state === "unknown" && ["sync", "missing", "update"].includes(i.cachedState)).sort(byLabel);
const unconfirmed = all.filter((i) => i.state === "unknown" && ["sync", "missing", "update", "broken"].includes(i.cachedState)).sort(byLabel);
group("unconfirmed", "SYNC STATUS UNCONFIRMED", t.muted, unconfirmed.map((i) => this.row(t, i, showScope, ctx)));
group("waiting", "WAITING TO SYNC", t.blocked, waiting.map((i) => this.row(t, i, showScope, ctx)));
group("update", "UPDATE AVAILABLE", t.accent, updates.map((i) => this.row(t, i, showScope, ctx)));
group("notices", "HOOKS NEED A LOOK", t.muted, notices.map((i) => this.row(t, i, showScope, ctx)));
group("notices", "NEED A LOOK", t.muted, notices.map((i) => this.row(t, i, showScope, ctx)));
// Machines appear here once the Machines tab has read them; the panel does not check them unasked.
const behind = Object.values(this.machines).filter((m) => !m.checking && !m.error && !m.missing && (m.git?.behind || m.drift > 0));
group("machines", "MACHINES", t.muted, behind.map((m) => line(t, `machine-${m.label}`, dot(t.blocked), m.label,
@@ -540,7 +540,7 @@ export default class Skillshare extends View {
const all = this.items, scope = this.project ? this.scope : "global";
const kc = counts(filterItems(all, { scope, kind: null, query: "" }));
const listed = filterItems(all, { scope, kind: this.kind, query: this.query });
const groups = groupItems(listed), notices = listed.filter((i) => i.notice), unknown = listed.filter((i) => !i.notice && i.state === "unknown");
const groups = groupItems(listed), notices = listed.filter(needsLook), unknown = listed.filter((i) => !i.notice && i.state === "unknown");
const live = groups.ok.filter((i) => i.state !== "off"), off = groups.ok.filter((i) => i.state === "off");
const showScope = Boolean(this.project) && scope === "all";
@@ -657,7 +657,7 @@ export default class Skillshare extends View {
// A row is a name and one short state. Everything else, and every action, is in its preview.
row(t, item, showScope, ctx) {
const color = item.notice || item.diagnostic ? t.blocked : { update: t.accent, sync: t.blocked, missing: t.ansi1, ok: t.ansi2, off: t.muted }[item.state] ?? t.muted;
const color = needsLook(item) || item.diagnostic ? t.blocked : { update: t.accent, sync: t.blocked, missing: t.ansi1, ok: t.ansi2, off: t.muted }[item.state] ?? t.muted;
const update = item.state === "update" && !item.doing && (item.kind === "skills" || item.kind === "agents") && !this.busyAt(ctx.on)
? secondary(`update-${item.key}`, "Update", t, (_e, cx) => { cx.stop_propagation(); request({ op: "update", on: ctx.on, project: this.project, updates: [{ kind: item.kind, scope: item.scope, name: item.update, label: item.label }] }); }, { h: 24, px: 9, size: S().label })
: null;
@@ -825,7 +825,7 @@ export default class Skillshare extends View {
await asked; this.leaving = true; cx.notify();
await cx.sleep(150); closeOverlay(p.overlay);
});
if (p.role === "preview") { this.doc = null; this.file = null; this.pane = "main"; if (!p.item.notice && ["skills", "agents", "mcp"].includes(p.item.kind)) this.loadDoc(cx); }
if (p.role === "preview") { this.doc = null; this.file = null; this.pane = "main"; if (!p.item.notice && ["skills", "agents", "mcp", "extras"].includes(p.item.kind)) this.loadDoc(cx); }
if (p.role === "install") {
this.step = "url"; this.scope = p.scope ?? "global"; this.found = []; this.picked = new Set(); this.error = null; this.discovering = false;
this.dir = null; this.prog = null;
@@ -850,7 +850,7 @@ export default class Skillshare extends View {
const p = blockProps() ?? {};
this.doc = { loading: true };
cx.spawn(async (cx) => {
try { this.doc = await loadPreview(machineIO(cx), p.on, p.project, p.item, p.mcpPath); this.file = this.doc.files?.includes("SKILL.md") ? "SKILL.md" : this.doc.files?.[0] ?? null; }
try { this.doc = await loadPreview(machineIO(cx), p.on, p.project, p.item, p.mcpPath); this.file = this.doc.file ?? (this.doc.files?.includes("SKILL.md") ? "SKILL.md" : this.doc.files?.[0] ?? null); }
catch (e) { this.doc = { error: String(e?.message ?? e) }; }
cx.notify();
});
@@ -871,15 +871,15 @@ export default class Skillshare extends View {
// pane has to share its width with a list of something else.
renderPreview(t, p, close) {
const it = p.item, d = this.doc ?? {}, skillish = it.kind === "skills" || it.kind === "agents";
const kindName = { skills: "Skill", agents: "Agent", mcp: "MCP server", plugins: "Plugin", hooks: it.notice ? "Hooks" : "Hook" }[it.kind];
const color = it.notice ? t.blocked : { update: t.accent, sync: t.blocked, missing: t.ansi1, ok: t.ansi2, off: t.muted }[it.state] ?? t.muted;
const kindName = { skills: "Skill", agents: "Agent", mcp: "MCP server", plugins: "Plugin", hooks: it.notice ? "Hooks" : "Hook", extras: it.extra === "note" ? "Memory note" : "Extra" }[it.kind];
const color = needsLook(it) ? t.blocked : { update: t.accent, sync: t.blocked, missing: t.ansi1, ok: t.ansi2, off: t.muted }[it.state] ?? t.muted;
const tag = (text, c) => h_flex().h(22).px(9).flex_none().items_center().rounded(11).bg(t.selected).text_size(S().label).text_color(c).child(text);
const tags = [it.state === "update" ? tag(it.behind ? `Update available · ↓${it.behind}` : "Update available", t.accent) : null,
it.state === "sync" || it.state === "missing" ? tag("Needs sync", t.blocked) : null, it.state === "off" ? tag("Disabled", t.muted) : null];
it.state === "sync" || it.state === "missing" ? tag("Needs sync", t.blocked) : null, it.state === "off" ? tag("Disabled", t.muted) : null, it.state === "broken" ? tag("Source missing", t.blocked) : null];
const sub = [kindName, it.scope, it.root, it.notice || it.kind === "hooks" || it.kind === "mcp" ? null : it.src, p.on].filter(Boolean).join(" · ");
const targets = p.targets ?? [], waiting = targets.filter((r) => r.warn), whom = it.kind === "hooks" || it.kind === "plugins" ? "agent" : "target";
const panes = it.notice ? [] : [["main", { skills: "Document", agents: "Document", mcp: "Settings", hooks: "Definition", plugins: "About" }[it.kind]],
["targets", `${whom === "agent" ? "Agents" : "Targets"} ${targets.length}`], skillish ? ["details", "Details"] : null].filter(Boolean);
const panes = it.notice ? [] : [["main", { skills: "Document", agents: "Document", mcp: "Settings", hooks: "Definition", plugins: "About", extras: "Document" }[it.kind]],
it.extra === "note" ? null : ["targets", `${whom === "agent" ? "Agents" : "Targets"} ${targets.length}`], skillish ? ["details", "Details"] : null].filter(Boolean);
const pane = panes.some(([k]) => k === this.pane) ? this.pane : "main";
const quietNote = (text) => div().flex_none().text_size(S().label).text_color(t.muted).child(text);
@@ -894,6 +894,10 @@ export default class Skillshare extends View {
if (waitingFor) {
body = [scroll("pane", page([v_flex().gap(12).loop("opacity", PULSE)
.children([220, 520, 480, 340].map((w) => bone(t, w))).child(div().h(8)).children([160, 500, 420, 460, 260].map((w) => bone(t, w)))]))];
} else if (d.gone && pane !== "targets") {
// Nothing to retry: the source is missing until someone creates it or removes the extra.
body = [scroll("pane", v_flex().pt(110).gap(10).items_center().child(icon("alert", 22, t.blocked)).child(div().text_size(S().dialog).font_semibold().child("The source is missing"))
.child(div().px(40).text_size(S().secondary).text_color(t.muted).child(d.gone)))];
} else if (d.error && pane !== "targets") {
body = [scroll("pane", v_flex().pt(110).gap(10).items_center().child(icon("alert", 22, t.ansi1)).child(div().text_size(S().dialog).font_semibold().child("This could not be read"))
.child(div().px(40).text_size(S().secondary).text_color(t.muted).child(d.error)).child(secondary("retry", "Try again", t, (_e, cx) => this.loadDoc(cx))))];
@@ -903,13 +907,13 @@ export default class Skillshare extends View {
it.blocker ? quietNote("Resolve with the CLI or the dashboard. Sync validates again before it applies anything.") : null]))];
} else if (pane === "targets") {
// The Overview map's grammar, for this one thing: it on top, a line down to each place it goes.
const lane = (r, i) => mapLane(t, i === targets.length - 1, t.popover, syncLine(t, r.warn ? "wait" : "ok"), [dot(it.state === "unknown" ? t.muted : r.warn ? t.blocked : t.ansi2), agentIcon(t, r.name, 16),
const lane = (r, i) => mapLane(t, i === targets.length - 1, t.popover, syncLine(t, r.warn ? "wait" : "ok"), [dot(it.state === "unknown" || it.state === "broken" ? t.muted : r.warn ? t.blocked : t.ansi2), agentIcon(t, r.name, 16),
div().flex_1().min_w(0).truncate().font_medium().child(r.name),
r.text !== "in sync" ? div().flex_none().text_size(S().label).text_color(r.warn ? t.blocked : t.muted).child(r.text) : icon("check", 13, t.muted)]);
const said = it.state === "unknown" ? "Sync status unconfirmed" : it.state === "off" ? "Disabled, so it is not sent anywhere" : !targets.length ? `No ${whom}s yet` : waiting.length ? `${waiting.length} of ${plural(targets.length, whom)} waiting for a sync` : `In sync with ${plural(targets.length, whom)}`;
const how = { mcp: "Sync writes this server into each target's own MCP file.", hooks: "One definition. Sync writes each agent's native hook file.", plugins: "Each agent installs the plugin; skillshare keeps them the same." }[it.kind];
const said = it.state === "unknown" ? "Sync status unconfirmed" : it.state === "broken" ? "Source missing, so a sync can't send it" : it.state === "off" ? "Disabled, so it is not sent anywhere" : !targets.length ? `No ${whom}s yet` : waiting.length ? `${waiting.length} of ${plural(targets.length, whom)} waiting for a sync` : `In sync with ${plural(targets.length, whom)}`;
const how = { mcp: "Sync writes this server into each target's own MCP file.", hooks: "One definition. Sync writes each agent's native hook file.", plugins: "Each agent installs the plugin; skillshare keeps them the same.", extras: "Sync puts the extra's files in each target folder, in its mode." }[it.kind];
body = [scroll("pane", page([
h_flex().gap(8).items_center().child(it.state === "unknown" ? icon("alert", 16, t.muted) : waiting.length ? icon("alert", 16, t.blocked) : icon("check", 16, targets.length && it.state !== "off" ? t.ansi2 : t.muted)).child(div().text_size(S().dialog).font_semibold().child(said)),
h_flex().gap(8).items_center().child(it.state === "unknown" ? icon("alert", 16, t.muted) : waiting.length || it.state === "broken" ? icon("alert", 16, t.blocked) : icon("check", 16, targets.length && it.state !== "off" ? t.ansi2 : t.muted)).child(div().text_size(S().dialog).font_semibold().child(said)),
targets.length ? v_flex().pt(6)
.child(h_flex().h(52).px(14).gap(10).items_center().rounded(10).border_1().border_color(t.border).bg(t.chrome)
.child(dot(color, 9, it.state === "missing" || it.state === "off")).child(div().flex_1().min_w(0).truncate().font_semibold().child(it.label)).child(quietNote([kindName, it.scope].join(" · "))))
@@ -918,14 +922,14 @@ export default class Skillshare extends View {
} else if (pane === "details") {
body = [scroll("pane", page([d.meta?.length ? card(d.meta) : quietNote("This file declares no frontmatter."),
d.dir ? sectionLabel(t, "LOCATION") : null, d.dir ? monoBox(t, "where", d.dir) : null]))];
} else if (skillish) {
} else if (skillish || it.kind === "extras") {
const fileRow = (f) => div().id(`file-${f}`).h(28).mx(8).px(10).flex().flex_none().items_center().rounded(6).font_family(mono()).text_size(S().label)
.text_color(f === this.file ? t.foreground : t.muted).when(f === this.file, (el) => el.bg(t.selected)).when(f !== this.file, (el) => el.cursor_pointer().hover((s) => s.bg(t.hover)))
.on_click((_e, cx) => this.openFile(f, cx)).child(div().truncate().child(f));
const doc = d.plain ? monoBox(t, `doc-${this.file}`, d.body ?? "") : TextView.markdown(`doc-${this.file ?? it.key}`, d.body ?? "");
// Only a skill with more than its SKILL.md gets a file list; otherwise the document has the width.
body = [(d.files?.length ?? 0) > 1 ? div().id("files").w(196).h_full().flex_none().overflow_y_scrollbar().border_r(1).border_color(t.border)
.child(v_flex().py(10).gap(1).children(d.files.map(fileRow))) : null, scroll("pane", page([doc]))];
.child(v_flex().py(10).gap(1).children(d.files.map(fileRow))) : null, scroll("pane", page([it.kind === "extras" && d.meta?.length ? card(d.meta) : null, doc]))];
} else if (it.kind === "mcp") {
body = [scroll("pane", page([d.server?.length ? card(d.server) : quietNote("skillshare's MCP source has no settings for this server on this machine."),
quietNote("Secret values stay hidden. The preview shows names only.")]))];
+58 -14
View File
@@ -1,7 +1,7 @@
// What the panel shows, built from the skillshare CLI's JSON and git's porcelain output.
// No Herdr imports, so `node --test herdr/tests` runs it.
export const KINDS = [["skills", "Skills"], ["agents", "Agents"], ["mcp", "MCP"], ["plugins", "Plugins"], ["hooks", "Hooks"]];
export const KINDS = [["skills", "Skills"], ["agents", "Agents"], ["mcp", "MCP"], ["plugins", "Plugins"], ["hooks", "Hooks"], ["extras", "Extras"]];
export const SCOPES = [["all", "All"], ["project", "Project"], ["global", "Global"]];
// Long work runs detached, its output kept in a temp folder (out, err, code, pid) that the
@@ -217,7 +217,7 @@ export function targetDrift(diff) {
// Every target of the shown scopes and what still waits on it, most waiting first:
// { known, list: [{ name, n }], scopes }. raw: { [scope]: { diff, targets } }; diff leaves out targets
// that share another's folder, so targets adds the configured names. diff counts skills and agents only, so a waiting MCP
// server, plugin or hook in items adds one to each target it waits on. known: a diff answered;
// server, plugin, hook or extra in items adds one to each target it waits on. known: a diff answered;
// scopes: the ones with a waiting target.
export function targetList(raw, scope = "all", items = []) {
const by = new Map();
@@ -235,7 +235,7 @@ export function targetList(raw, scope = "all", items = []) {
for (const name of raw[s]?.targets ?? []) if (!by.has(name)) by.set(name, 0);
}
for (const i of items) {
if (!(scope === "all" || i.scope === scope) || i.notice || !waitsForSync(i) || !["mcp", "plugins", "hooks"].includes(i.kind)) continue;
if (!(scope === "all" || i.scope === scope) || i.notice || !waitsForSync(i) || !["mcp", "plugins", "hooks", "extras"].includes(i.kind)) continue;
for (const r of previewTargets(i)) if (r.warn && by.has(r.name)) by.set(r.name, by.get(r.name) + 1);
}
return { known, scopes, list: [...by].map(([name, n]) => ({ name, n })).sort((a, b) => b.n - a.n || a.name.localeCompare(b.name)) };
@@ -243,6 +243,8 @@ export function targetList(raw, scope = "all", items = []) {
// A row Sync would act on: a waiting resource, or a hook notice with native changes.
export const waitsForSync = (i) => (i.notice ? Boolean(i.pending) : i.state === "sync" || i.state === "missing");
// A row that needs a person rather than a sync: a hook notice, or an extra whose source is gone.
export const needsLook = (i) => Boolean(i.notice) || i.state === "broken";
// The scopes Sync runs in for the shown scope: every one with a waiting row or a waiting target
// (a target can wait with no row left, as after an uninstall); with nothing waiting, the shown ones.
@@ -271,8 +273,9 @@ const plural = (n, word) => `${n} ${word}${n === 1 ? "" : "s"}`;
const andMore = (list) => (list.length <= 2 ? list.map((x) => x.name).join(" and ") : `${list[0].name}, ${list[1].name} and ${list.length - 2} more`);
// Overview's answer in two lines: { kind, headline, sub }, kind one of loading, failed, moving,
// waiting, ok. pending: rows Sync would act on; lag: targets with something waiting.
export function overviewAnswer({ loading, failed, error, moving, reading = [], incomplete = false, pending = 0, lag = [], total = 0, targets = 0 }) {
// waiting, look, ok. pending: rows Sync would act on; lag: targets with something waiting;
// broken: extras whose source is missing, which no sync fixes.
export function overviewAnswer({ loading, failed, error, moving, reading = [], incomplete = false, pending = 0, lag = [], total = 0, targets = 0, broken = 0 }) {
if (loading) return { kind: "loading", headline: "Reading skillshare", sub: "one moment" };
if (failed) return { kind: "failed", headline: "skillshare could not be read", sub: error ?? "" };
if (moving) return { kind: "moving", headline: lag.length ? `Syncing ${plural(lag.length, "target")}` : "Syncing", sub: lag.length ? andMore(lag) : "every target" };
@@ -282,6 +285,7 @@ export function overviewAnswer({ loading, failed, error, moving, reading = [], i
return { kind: "waiting", headline: lag.length ? `${plural(lag.length, "target")} need${lag.length === 1 ? "s" : ""} a sync` : `${plural(pending, "resource")} to sync`,
sub: pending ? `${plural(pending, "resource")} waiting${lag.length ? ` for ${andMore(lag)}` : ""}` : `waiting on ${andMore(lag)}` };
}
if (broken) return { kind: "look", headline: `${plural(broken, "extra")} need${broken === 1 ? "s" : ""} a look`, sub: broken === 1 ? "its source is missing, so a sync can't fix it" : "their sources are missing, so a sync can't fix them" };
return { kind: "ok", headline: "Everything is in sync", sub: `${plural(total, "resource")} · ${plural(targets, "target")}` };
}
@@ -289,16 +293,19 @@ export function overviewAnswer({ loading, failed, error, moving, reading = [], i
// inventories answer; diff/status affect sync confidence but not inventory counts.
export function resourceProgress(raw, scope = "all") {
const pending = new Set(), errors = [], unknown = new Set();
let available = false;
const kinds = { list: ["skills", "agents"], mcp: ["mcp"], plugins: ["plugins"], hooks: ["hooks"] };
let available = false, incomplete = false;
const kinds = { list: ["skills", "agents"], mcp: ["mcp"], plugins: ["plugins"], hooks: ["hooks"], extras: ["extras"], memory: ["extras"] };
for (const [s, one] of Object.entries(raw)) {
if (scope !== "all" && scope !== s) continue;
available ||= Object.keys(kinds).some((key) => one[key] != null);
for (const key of one.pending ?? []) pending.add(key);
for (const [key, message] of Object.entries(one.errors ?? {})) errors.push(`${s} ${key}: ${message}`);
for (const [key, names] of Object.entries(kinds)) if ((one.pending ?? []).includes(key) || one.errors?.[key]) for (const name of names) unknown.add(name);
// Memory notes never wait for a sync, so their read leaves sync states confirmed.
for (const key of one.pending ?? []) { pending.add(key); incomplete ||= key !== "memory"; }
for (const [key, message] of Object.entries(one.errors ?? {})) { errors.push(`${s} ${key}: ${message}`); incomplete ||= key !== "memory"; }
// A memory error marks the Extras count unknown only after notes have been read.
const failed = (key) => Boolean(one.errors?.[key]) && (key !== "memory" || one.memory != null);
for (const [key, names] of Object.entries(kinds)) if ((one.pending ?? []).includes(key) || failed(key)) for (const name of names) unknown.add(name);
}
return { pending: [...pending], errors, unknown, available, incomplete: Boolean(pending.size || errors.length) };
return { pending: [...pending], errors, unknown, available, incomplete };
}
// A machine card's remote line, and the targets that wait on it by name (max at most).
@@ -405,9 +412,39 @@ export function buildItems(scope, raw) {
item.state = !raw.hooks?.plan ? "unknown" : pending.length ? "sync" : item.disabled ? "off" : "ok";
items.push(item);
}
// An extra's target is named by the target whose skills folder shares its parent folder.
// Relative project paths start from the project folder; the first target by name wins a shared folder.
const segments = (path) => String(path ?? "").toLowerCase().split(/[\\/]+/).filter((s) => s && s !== ".");
const root = raw.root ? segments(raw.root) : null;
const homes = (raw.targetPaths ?? []).map((t) => ({ name: t.name, dir: segments(t.path).slice(0, -1) })).sort((a, b) => String(a.name).localeCompare(String(b.name)));
const owner = (path) => {
const abs = /^([a-z]:)?[\\/]/i.test(path);
if (!abs && !root) return path;
const p = abs ? segments(path) : [...root, ...segments(path)];
let best = null;
for (const { name, dir } of homes) {
if (dir.length && dir.length <= p.length && dir.every((s, i) => s === p[i]) && dir.length > (best?.n ?? 0)) best = { name, n: dir.length };
}
return best?.name ?? path;
};
for (const e of Array.isArray(raw.extras) ? raw.extras : []) {
const rows = (e.targets ?? []).map((x) => {
const how = [x.mode, x.as && `as ${x.as}`].filter(Boolean).join(" ");
return { name: owner(x.path), warn: !["synced", "no source"].includes(x.status), text: x.status === "synced" ? how || "in sync" : [x.status, how].filter(Boolean).join(" · ") };
});
// sourceMissing: the source itself is gone. A target also says "no source" when its files can't be listed.
const sourceMissing = e.source_exists === false, gone = sourceMissing || (e.targets ?? []).some((x) => x.status === "no source");
items.push({ key: `${scope}:extras:${e.name}`, kind: "extras", extra: e.file ? "file" : "folder", scope, name: e.name, label: e.name,
file: e.file, dir: e.source_dir, rows, sourceMissing, src: gone ? "source missing" : `${e.file || plural(e.file_count ?? 0, "file")} · ${plural(rows.length, "target")}`,
state: gone ? "broken" : rows.some((r) => r.warn) ? "sync" : "ok" });
}
for (const n of raw.memory?.notes ?? []) {
items.push({ key: `${scope}:extras:memory/${n.path}`, kind: "extras", extra: "note", scope, name: n.path, label: n.path,
file: n.path, dir: raw.memory.root, rows: [], src: "memory note", state: "ok" });
}
if (raw.pending || raw.errors) {
for (const item of items) {
const keys = item.kind === "skills" || item.kind === "agents" ? ["list", "diff", "status"] : [item.kind];
const keys = item.kind === "skills" || item.kind === "agents" ? ["list", "diff", "status"] : item.kind === "extras" ? [item.extra === "note" ? "memory" : "extras"] : [item.kind];
if (!item.notice && item.state !== "off" && keys.some((key) => raw.pending?.includes(key) || raw.errors?.[key])) {
item.cachedState = item.state;
item.state = "unknown";
@@ -498,7 +535,8 @@ export function eligibleTargets(item, one) {
// names: every target of the item's scope, for skills and agents (their rows name only the waiting ones).
export function previewTargets(item, names = []) {
let rows;
if (item.kind === "hooks") {
if (item.kind === "extras") rows = [...item.rows];
else if (item.kind === "hooks") {
const by = new Map((item.targets ?? []).map((n) => [n, { name: n, text: "in sync", warn: false }]));
for (const c of item.changes ?? []) if (c.target) by.set(c.target, { name: c.target, text: c.action === "unchanged" ? "in sync" : c.action, warn: !["unchanged", "inactive"].includes(c.action) });
rows = [...by.values()];
@@ -518,6 +556,12 @@ export const READ_SKILL = `cd "$1" 2>/dev/null || exit 3
find . -type f -not -path './.git/*' | sed 's|^\\./||' | sort | head -40
echo @@
head -c 60000 SKILL.md 2>/dev/null`;
// sh -c READ_EXTRA <name> <dir>: a folder extra's files as extras sync sees them, then as READ_SKILL.
// DiscoverExtraFiles (internal/sync/extras.go) skips every .git folder and every .metadata.json.
export const READ_EXTRA = `cd "$1" 2>/dev/null || exit 3
find . -type d -name .git -prune -o -type f ! -name .metadata.json -print | sed 's|^\\./||' | sort | head -40
echo @@
head -c 60000 SKILL.md 2>/dev/null`;
// sh -c READ_FILE <name> <path>: a file's first 60 kB.
export const READ_FILE = 'head -c 60000 "$1" 2>/dev/null';
@@ -608,7 +652,7 @@ export function sourceGroups(items) {
}
export function counts(items) {
const c = { all: 0, project: 0, global: 0, skills: 0, agents: 0, mcp: 0, plugins: 0, hooks: 0 };
const c = { all: 0, project: 0, global: 0, skills: 0, agents: 0, mcp: 0, plugins: 0, hooks: 0, extras: 0 };
for (const i of items) { if (!i.notice) { c.all++; c[i.scope]++; c[i.kind]++; } }
return c;
}
+37 -5
View File
@@ -5,7 +5,7 @@ import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { findProject, loadResources, loadMachine, loadLatestRelease, loadPreview, loadFile } from "../skillshare/mods/skillshare/loader.js";
import { GIT_STATUS, READ_SKILL, READ_FILE, LATEST_RELEASE } from "../skillshare/mods/skillshare/model.js";
import { GIT_STATUS, READ_SKILL, READ_EXTRA, READ_FILE, LATEST_RELEASE } from "../skillshare/mods/skillshare/model.js";
// A fake machine answering by command: `jobs` and `runs` keyed by skillshare args joined by
// spaces, `scripts` by script. `seen` records each call's options.
@@ -21,7 +21,7 @@ function machine({ jobs = {}, runs = {}, scripts = {} } = {}) {
},
};
}
const resources = (flag) => Object.fromEntries([["list --all", []], ["diff", {}], ["mcp list", {}], ["plugin list", {}], ["hooks list", {}]].map(([cmd, value]) => [`${cmd} --json ${flag}`, { stdout: JSON.stringify(value) }]));
const resources = (flag) => Object.fromEntries([["list --all", []], ["diff", {}], ["mcp list", {}], ["plugin list", {}], ["hooks list", {}], ["extras list", []], ["extras memory list", { notes: [] }]].map(([cmd, value]) => [`${cmd} --json ${flag}`, { stdout: JSON.stringify(value) }]));
const emptyStatus = { stdout: "{}" };
test("the first folder skillshare treats as a project wins", (t) => {
@@ -94,7 +94,7 @@ test("global resources publish while the project's inventory is still reading",
test("each project resource runs in the project folder with its scope flag", async () => {
const { io, seen } = machine({ jobs: { ...resources("-p"), ...resources("-g") } });
await loadResources(io, "mini", "/work/app", false);
assert.equal(seen.length, 10);
assert.equal(seen.length, 14);
for (const call of seen) {
assert.equal(call.cwd, call.args.at(-1) === "-p" ? "/work/app" : null);
assert.equal(call.on, "mini");
@@ -116,12 +116,15 @@ test("a machine card counts targets that take skills and the source's git state"
assert.deepEqual([m.label, m.version, m.update, m.targets, m.git.behind], ["mini", "0.28.4", true, 1, 2]);
});
test("each scope's target names come from its own status", async () => {
const names = (...n) => ({ stdout: JSON.stringify({ targets: [...n.map((name) => ({ name })), { name: "off", skills_enabled: false }], agents: { targets: [{ name: n[0] }] } }) });
test("each scope's target names and folders come from its own status", async () => {
const names = (...n) => ({ stdout: JSON.stringify({ targets: [...n.map((name) => ({ name, path: `/${name}/skills` })), { name: "off", skills_enabled: false }], agents: { targets: [{ name: n[0] }] } }) });
const { io } = machine({ jobs: { ...resources("-p"), ...resources("-g") }, runs: { "status --json -g": names("claude", "codex"), "status --json -p": names("cursor") } });
const { raw } = await loadResources(io, null, "/work/app", false);
assert.deepEqual([raw.global.targets, raw.project.targets], [["claude", "codex", "off"], ["cursor", "off"]]);
assert.deepEqual([raw.global.skillTargets, raw.global.agentTargets, raw.project.agentTargets], [["claude", "codex"], ["claude"], ["cursor"]]);
assert.deepEqual(raw.project.targetPaths, [{ name: "cursor", path: "/cursor/skills" }, { name: "off", path: undefined }]);
// A project's relative extras paths start from its folder.
assert.deepEqual([raw.project.root, raw.global.root], ["/work/app", null]);
});
test("a skill's preview has its files and its document without the frontmatter", async () => {
@@ -156,6 +159,35 @@ test("another file of a skill is Markdown only when its name says so", async ()
assert.deepEqual(await loadFile(io, null, "/src/x", "run.sh"), { meta: [], body: "---\na: 1\n---\ntext", plain: true });
});
test("an extra's preview reads its file, or a folder extra's files and the first of them", async () => {
// A folder extra is listed as extras sync sees it (READ_EXTRA), not as a skill (READ_SKILL).
const { io } = machine({ scripts: { [READ_EXTRA]: { code: 1, stdout: "a.md\nb.md\n@@\n" }, [READ_SKILL]: { code: 1, stdout: ".metadata.json\na.md\nb.md\n@@\n" }, [READ_FILE]: { stdout: "# Rules\n" } } });
const file = await loadPreview(io, null, null, { kind: "extras", extra: "file", dir: "/src/agents", file: "AGENTS.md" });
assert.deepEqual([file.files, file.file, file.dir, file.body], [["AGENTS.md"], "AGENTS.md", "/src/agents", "# Rules\n"]);
const folder = await loadPreview(io, null, null, { kind: "extras", extra: "folder", dir: "/src/rules" });
assert.deepEqual([folder.files, folder.file, folder.body], [["a.md", "b.md"], "a.md", "# Rules\n"]);
// An empty folder and one that can't be opened say which.
const empty = machine({ scripts: { [READ_EXTRA]: { code: 1, stdout: "@@\n" } } });
assert.match((await loadPreview(empty.io, null, null, { kind: "extras", extra: "folder", dir: "/src/empty" })).error, /has no files/);
const closed = machine({ scripts: { [READ_EXTRA]: { code: 3 } } });
assert.equal((await loadPreview(closed.io, null, null, { kind: "extras", extra: "folder", dir: "/src/x" })).error, "/src/x could not be read.");
// A folder's SKILL.md comes from READ_EXTRA's own read, so nothing is read twice.
const reads = [];
const skill = machine({ scripts: { [READ_EXTRA]: { stdout: "AGENTS.md\nSKILL.md\n@@\n---\nname: r\n---\nSkill body\n" } } });
const sh = skill.io.sh;
skill.io.sh = (script, args, on) => { if (script === READ_FILE) reads.push(args[0]); return sh(script, args, on); };
const chosen = await loadPreview(skill.io, null, null, { kind: "extras", extra: "folder", dir: "/src/rules" });
assert.deepEqual([reads, chosen.file, chosen.meta, chosen.body], [[], "SKILL.md", [{ key: "name", value: "r" }], "Skill body\n"]);
});
test("a missing extra source is said with nothing to retry; a target's no source alone still reads", async () => {
const gone = await loadPreview(machine().io, null, null, { kind: "extras", extra: "file", dir: "/src/agents", file: "AGENTS.md", state: "broken", sourceMissing: true });
assert.equal(gone.error, undefined);
assert.match(gone.gone, /\/src\/agents\/AGENTS\.md is missing/);
const { io } = machine({ scripts: { [READ_FILE]: { stdout: "# Rules\n" } } });
assert.equal((await loadPreview(io, null, null, { kind: "extras", extra: "file", dir: "/src/agents", file: "AGENTS.md", state: "broken", sourceMissing: false })).body, "# Rules\n");
});
test("a skill with more files than the list holds still offers SKILL.md", async () => {
const { io } = machine({ runs: { "status --json -g": { stdout: JSON.stringify({ source: { path: "/src" } }) } }, scripts: { [READ_SKILL]: { stdout: "assets/a.png\n@@\nBody\n" } } });
assert.deepEqual((await loadPreview(io, null, null, { kind: "skills", scope: "global", rel: "x" })).files, ["SKILL.md", "assets/a.png"]);
+105 -2
View File
@@ -4,7 +4,7 @@ import { spawn, spawnSync } from "node:child_process";
import { mkdtempSync, mkdirSync, writeFileSync, readFileSync, readdirSync, existsSync, rmSync, utimesSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { parseGitStatus, sourceLine, driftFrom, targetDrift, buildItems, hookArgs, counts, groupItems, filterItems, sourceGroups, cloneUrl, installResult, newerVersion, parseDiscover, parseAudit, parsePreview, diffSides, mergeMetadata, START, ALIVE, SWEEP, rowState, previewTargets, splitFrontmatter, mcpServer, targetList, mapLanes, needsBothWays, READ_SKILL, eligibleTargets, syncScopes, overviewAnswer, resourceProgress, remoteLine, waitingNames, releaseTag, panelUpdate, updateState, PANEL_UPDATE, toggleArgs, optimistic, shownRows, endedRequests, afterRead, afterChecks, DISCOVER } from "../skillshare/mods/skillshare/model.js";
import { parseGitStatus, sourceLine, driftFrom, targetDrift, buildItems, hookArgs, counts, groupItems, filterItems, sourceGroups, cloneUrl, installResult, newerVersion, parseDiscover, parseAudit, parsePreview, diffSides, mergeMetadata, START, ALIVE, SWEEP, rowState, previewTargets, splitFrontmatter, mcpServer, targetList, mapLanes, needsBothWays, READ_SKILL, eligibleTargets, syncScopes, overviewAnswer, resourceProgress, remoteLine, waitingNames, releaseTag, panelUpdate, updateState, PANEL_UPDATE, toggleArgs, optimistic, shownRows, endedRequests, afterRead, afterChecks, DISCOVER, needsLook, waitsForSync, READ_EXTRA } from "../skillshare/mods/skillshare/model.js";
import { VERSION } from "../skillshare/mods/skillshare/version.js";
test("git status reads branch, ahead/behind and files", () => {
@@ -116,7 +116,7 @@ test("hook notices stay filtered but never inflate named entry or group counts",
const notices = items.filter((i) => i.notice);
assert.equal(notices.length, 1);
assert.equal(notices[0].pending, false);
assert.deepEqual(counts(notices), { all: 0, project: 0, global: 0, skills: 0, agents: 0, mcp: 0, plugins: 0, hooks: 0 });
assert.deepEqual(counts(notices), { all: 0, project: 0, global: 0, skills: 0, agents: 0, mcp: 0, plugins: 0, hooks: 0, extras: 0 });
assert.deepEqual(filterItems(items, { scope: "project", kind: "hooks", query: "conditional" }), notices);
assert.deepEqual(filterItems(items, { scope: "global", kind: "hooks", query: "conditional" }), []);
const warnings = buildItems("global", { hooks: { plan: { changes: [], warnings: ["conditional include", "Git version too old"] } } });
@@ -417,6 +417,99 @@ test("MCP and plugin rows name no targets", () => {
assert.deepEqual(items.map((i) => rowState(i, false)), ["changed", "changed"]);
});
test("extras and memory notes are rows; a target that is not synced waits, named by the target that shares its folder", () => {
const raw = {
extras: [
{ name: "agents", file: "AGENTS.md", source_dir: "/src/agents", file_count: 1, targets: [{ path: "C:\\Users\\me\\.claude", mode: "import", as: "CLAUDE.md", status: "synced" }] },
{ name: "rules", source_dir: "/src/rules", file_count: 2, targets: [{ path: "/home/me/.config/opencode/rules/", mode: "merge", status: "drift" }, { path: "/home/me/notes", mode: "copy", status: "synced" }] },
{ name: "gone", source_dir: "/src/gone", file_count: 0, targets: [{ path: "C:\\Users\\me\\.claude\\rules", mode: "merge", status: "no source" }] },
],
memory: { root: "/src/memory", notes: [{ path: "INDEX.md" }] },
targets: ["claude", "opencode"],
targetPaths: [{ name: "claude", path: "C:\\Users\\me\\.claude\\skills" }, { name: "opencode", path: "/home/me/.config/opencode/skills" }],
};
const items = buildItems("global", raw);
// A missing source is neither in sync nor waiting: sync can't fix it, so it needs a look.
assert.deepEqual(items.map((i) => [i.state, rowState(i, false), needsLook(i)]),
[["ok", "AGENTS.md · 1 target", false], ["sync", "changed", false], ["broken", "source missing", true], ["ok", "memory note", false]]);
assert.deepEqual(previewTargets(items[0]), [{ name: "claude", warn: false, text: "import as CLAUDE.md" }]);
assert.deepEqual(previewTargets(items[1]), [{ name: "opencode", warn: true, text: "drift · merge" }, { name: "/home/me/notes", warn: false, text: "copy" }]);
assert.deepEqual(previewTargets(items[2]), [{ name: "claude", warn: false, text: "no source · merge" }]);
assert.equal(counts(items).extras, 4);
assert.deepEqual([waitsForSync(items[2]), items[2].state], [false, "broken"]);
assert.deepEqual(groupItems(items).ok.map((i) => i.name), ["agents", "INDEX.md"]);
assert.deepEqual(targetList({ global: raw }, "all", items).list, [{ name: "opencode", n: 1 }, { name: "claude", n: 0 }]);
assert.deepEqual(buildItems("global", { ...raw, pending: ["extras"] }).map((i) => i.state), ["unknown", "unknown", "unknown", "ok"]);
});
test("an extra's target matches its target whether written relative, with other slashes, or in another case", () => {
const extra = (path) => ({ extras: [{ name: "rules", source_dir: "/src/rules", file_count: 1, targets: [{ path, mode: "merge", status: "synced" }] }] });
const name = (raw, paths, root = null, scope = "global") => previewTargets(buildItems(scope, { ...raw, targetPaths: paths, root })[0])[0].name;
const windows = [{ name: "claude", path: "C:\\Users\\Me\\.claude\\skills" }, { name: "universal", path: "C:\\Users\\Me\\.agents\\skills" }];
assert.equal(name(extra("c:/users/me/.claude/rules"), windows), "claude");
assert.equal(name(extra("C:\\Users\\Me\\.agents\\rules"), windows), "universal");
assert.equal(name(extra("C:\\Users\\Me\\notes"), windows), "C:\\Users\\Me\\notes");
// Project targets come from status as absolute paths; extras keep the config's relative ones,
// which start from the project folder.
const project = [{ name: "claude", path: "/work/app/.claude/skills" }, { name: "cursor", path: "/work/app/.cursor/skills" }];
assert.equal(name(extra(".claude/rules"), project, "/work/app", "project"), "claude");
assert.equal(name(extra("./.cursor/rules/"), project, "/work/app", "project"), "cursor");
assert.equal(name(extra("docs/rules"), project, "/work/app", "project"), "docs/rules");
// A folder whose name only looks like the end of a target's path is not that target's.
assert.equal(name(extra("app/.claude/rules"), project, "/work/app", "project"), "app/.claude/rules");
assert.equal(name(extra("docs/rules"), [{ name: "local", path: "/work/docs/skills" }], "/work/app", "project"), "docs/rules");
// Without a project folder a relative path stays as written.
assert.equal(name(extra(".claude/rules"), project), ".claude/rules");
// A Windows project folder, as Herdr reports it.
const win = [{ name: "claude", path: "C:\\Work\\App\\.claude\\skills" }];
assert.equal(name(extra(".claude/rules"), win, "C:\\Work\\App", "project"), "claude");
// The deepest shared folder wins: ~/.config/opencode over a target in ~/.config.
const nested = [{ name: "opencode", path: "/home/me/.config/opencode/skills" }, { name: "other", path: "/home/me/.config/skills" }];
assert.equal(name(extra("/home/me/.config/opencode/rules"), nested), "opencode");
assert.equal(name(extra(".config/opencode/rules"), nested, "/home/me", "project"), "opencode");
});
test("targets that share a folder name an extra's target the same way whatever order status lists them in", () => {
const raw = { extras: [{ name: "rules", source_dir: "/src/rules", file_count: 1, targets: [{ path: "/home/me/.agents/rules", mode: "merge", status: "drift" }] }] };
const shared = [{ name: "universal", path: "/home/me/.agents/skills" }, { name: "codex", path: "/home/me/.agents/skills" }];
for (const targetPaths of [shared, [...shared].reverse()]) {
const items = buildItems("global", { ...raw, targetPaths });
assert.equal(previewTargets(items[0])[0].name, "codex");
assert.deepEqual(targetList({ global: { targets: ["universal", "codex"] } }, "all", items).list, [{ name: "codex", n: 1 }, { name: "universal", n: 0 }]);
}
});
test("an extra whose source is gone needs a look even with no targets", () => {
const [gone] = buildItems("global", { extras: [{ name: "agents", file: "AGENTS.md", source_dir: "/src/agents", source_exists: false, file_count: 0, targets: [] }] });
assert.deepEqual([gone.state, gone.sourceMissing, needsLook(gone)], ["broken", true, true]);
// A target that reports no source while the source is there still breaks the extra, but its files can be read.
const [listed] = buildItems("global", { extras: [{ name: "rules", source_dir: "/src/rules", source_exists: true, file_count: 2, targets: [{ path: "/x", mode: "merge", status: "no source" }] }] });
assert.deepEqual([listed.state, listed.sourceMissing], ["broken", false]);
});
test("Overview does not call everything in sync while an extra's source is missing", () => {
assert.deepEqual(overviewAnswer({ total: 3, targets: 2, broken: 1 }), { kind: "look", headline: "1 extra needs a look", sub: "its source is missing, so a sync can't fix it" });
assert.equal(overviewAnswer({ broken: 2 }).headline, "2 extras need a look");
// Something Sync can fix comes first.
assert.equal(overviewAnswer({ pending: 1, broken: 1 }).kind, "waiting");
});
test("memory notes never wait for a sync, so a failed memory read leaves sync states confirmed", () => {
const one = (errors) => ({ global: { extras: [], memory: null, pending: [], errors } });
const memory = resourceProgress(one({ memory: "unknown extras subcommand: memory" }));
assert.equal(memory.incomplete, false);
assert.deepEqual(memory.errors, ["global memory: unknown extras subcommand: memory"]);
assert.equal(resourceProgress(one({ extras: "offline" })).incomplete, true);
assert.equal(resourceProgress({ global: { extras: [], pending: ["memory"], errors: {} } }).incomplete, false);
// The Extras count is the extras that were read, not "…" for good; a memory read still running holds it.
assert.equal(memory.unknown.has("extras"), false);
assert.equal(resourceProgress({ global: { extras: [], pending: ["memory"], errors: {} } }).unknown.has("extras"), true);
assert.equal(resourceProgress(one({ extras: "offline" })).unknown.has("extras"), true);
// Notes kept from an earlier read are not confirmed by a read that failed, so the count waits.
const stale = resourceProgress({ global: { extras: [], memory: { root: "/m", notes: [{ path: "a.md" }] }, pending: [], errors: { memory: "timed out" } } });
assert.deepEqual([stale.unknown.has("extras"), stale.incomplete], [true, false]);
});
// ---- Detached jobs (START, ALIVE) ----
// Starts a fake `skillshare` (body) the way the panel does, then ends the starting shell's
@@ -564,6 +657,16 @@ test("reading a skill lists its files, then SKILL.md, and fails on a missing fol
assert.equal(read(join(dir, "none")).status, 3);
});
test("reading a folder extra leaves out what extras sync skips: every .git folder and every .metadata.json", (t) => {
const dir = mkdtempSync(join(tmpdir(), "ss-extra-"));
t.after(() => rmSync(dir, { recursive: true, force: true }));
for (const d of [".git", "sub", join("sub", ".git")]) mkdirSync(join(dir, d));
for (const f of ["a.md", ".metadata.json", join(".git", "HEAD"), join("sub", "b.md"), join("sub", ".metadata.json"), join("sub", ".git", "config")]) writeFileSync(join(dir, f), "x");
const read = (d) => spawnSync("sh", ["-c", READ_EXTRA, "test", d], { encoding: "utf8" });
assert.equal(read(dir).stdout, "a.md\nsub/b.md\n@@\n");
assert.equal(read(join(dir, "none")).status, 3);
});
test("an MCP server declared only under a project root is still found", () => {
const yaml = "mcp:\n servers:\n other:\n command: x\n projects:\n ~/work/app:\n servers:\n local:\n command: node\n env:\n KEY: secret-1\n";
assert.deepEqual(mcpServer(yaml, "local"), [{ key: "command", value: "node" }, { key: "env", value: "KEY = ••••••••" }]);
+60
View File
@@ -3,6 +3,7 @@ import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
import { compileFunction } from "node:vm";
import { BUSY } from "../skillshare/mods/skillshare/channel.js";
import { buildItems, previewTargets } from "../skillshare/mods/skillshare/model.js";
// Render the actual view against a tiny UI tree, without starting Herdr or any CLI.
function element() {
@@ -150,3 +151,62 @@ test("machine upgrade spins only its update button and disables pull without a s
assert.equal("click" in update, false);
assert.equal("click" in pull, false);
});
test("an extra whose source is missing needs a look on Overview and in Library, and never waits for a sync", async () => {
const { view } = await panel();
view.kind = "extras";
view.raw = { global: { list: [], diff: { targets: [] }, targets: ["claude"], pending: [], errors: {},
extras: [{ name: "gone", source_dir: "/src/gone", file_count: 0, targets: [{ path: "/home/me/.claude/rules", mode: "merge", status: "no source" }] }] } };
view.rebuild();
const overview = label(view.renderOverview({}, view.ctx));
assert.match(overview, /NEED A LOOK/);
assert.doesNotMatch(overview, /HOOKS NEED A LOOK|WAITING TO SYNC|Everything is in sync/);
assert.match(overview, /1 extra needs a look/);
assert.match(overview, /gone/);
const library = label(view.renderLibrary({}, view.ctx));
assert.match(library, /NEED A LOOK · 1/);
assert.match(library, /source missing/);
assert.doesNotMatch(library, /IN SYNC|NEEDS SYNC/);
});
test("an extra whose source is missing stays on Overview while extras are read again, and when that read fails", async () => {
const { view } = await panel();
const extras = [{ name: "gone", source_dir: "/src/gone", file_count: 0, targets: [{ path: "/home/me/.claude/rules", mode: "merge", status: "no source" }] }];
for (const read of [{ pending: ["extras"], errors: {} }, { pending: [], errors: { extras: "extras list failed" } }]) {
view.raw = { global: { list: [], diff: { targets: [] }, targets: ["claude"], extras, ...read } };
view.rebuild();
const overview = label(view.renderOverview({}, view.ctx));
assert.match(overview, /SYNC STATUS UNCONFIRMED · 1/);
assert.match(overview, /gone/);
}
});
test("the preview of an extra whose source is missing says so in every tab, with nothing to retry", async () => {
const { view } = await panel({ role: "preview" });
const [item] = buildItems("global", { extras: [{ name: "gone", source_dir: "/src/gone", source_exists: false, file_count: 0, targets: [{ path: "/home/me/.claude/rules", mode: "merge", status: "no source" }] }] });
view.doc = { gone: "/src/gone is missing. Create it, or remove the extra." };
view.pane = "main";
const main = label(view.renderPreview({}, { item, targets: previewTargets(item) }, () => {}));
assert.match(main, /Source missing/);
assert.match(main, /The source is missing/);
assert.match(main, /\/src\/gone is missing/);
assert.doesNotMatch(main, /could not be read|Try again/);
view.pane = "targets";
const targets = label(view.renderPreview({}, { item, targets: previewTargets(item) }, () => {}));
assert.match(targets, /Source missing, so a sync can't send it/);
assert.doesNotMatch(targets, /In sync with/);
});
test("an extra's preview shows its frontmatter above the document, and highlights the file it shows", async () => {
const { view } = await panel({ role: "preview" }, { TextView: { markdown: element },
loadPreview: async () => ({ files: ["SKILL.md", "rules.md"], file: "rules.md", dir: "/src/rules", meta: [{ key: "paths", value: "src/**" }], body: "Body" }) });
const item = { kind: "extras", extra: "folder", key: "global:extras:rules", label: "rules", scope: "global", state: "ok", rows: [], dir: "/src/rules" };
const cx = { spawn: (fn) => fn(cx), notify: () => {} };
await view.loadDoc(cx);
await new Promise((resolve) => setTimeout(resolve, 0));
assert.equal(view.file, "rules.md");
view.pane = "main";
const text = label(view.renderPreview({}, { item, targets: [] }, () => {}));
assert.match(text, /paths/);
assert.match(text, /src\/\*\*/);
});
+3 -3
View File
@@ -57,9 +57,9 @@ A panel installed before this button existed has no update check. Copy `mods/ski
The panel follows the space Herdr shows. It runs skillshare on that space's machine, in the focused terminal's folder.
- **Overview** answers first: *Everything is in sync*, or how many targets need one, with a single Sync button. Under it, a count of each kind in the source and a line to every target show which ones are waiting. The rest of the tab lists only what needs you: what waits for a sync, what has an update, and hook notices. In a project with `.skillshare/config.yaml`, an All · Project · Global switch beside the tabs picks the scope.
- **Library** lists skills, agents, MCP servers, plugins and hooks, grouped into *Needs sync*, *Update available*, *In sync* and *Off* for disabled entries. For skills and agents, *In sync* groups entries from the same repository into collapsible rows; switch to List for a flat list.
- **Rows** open a preview. A skill shows its `SKILL.md` and files, an MCP server its settings with secret values hidden, and the preview's Targets tab shows the state per target. Skills and agents offer Update, Diff, Disable (or Enable for a disabled one; the next sync applies it), Uninstall, and *Ask &lt;agent&gt; to audit…*, which sends the item to the focused Herdr agent after you confirm. Top-level declared hooks offer Enable, Disable and Remove, each after confirmation; Sync applies the saved changes.
- **Overview** answers first: *Everything is in sync*, or how many targets need one, with a single Sync button. Under it, a count of each kind in the source and a line to every target show which ones are waiting. The rest of the tab lists only what needs you: what waits for a sync, what has an update, hook notices, and extras whose source is missing. In a project with `.skillshare/config.yaml`, an All · Project · Global switch beside the tabs picks the scope.
- **Library** lists skills, agents, MCP servers, plugins, hooks and extras (file and folder extras, and memory notes), grouped into *Needs sync*, *Update available*, *In sync* and *Off* for disabled entries. For skills and agents, *In sync* groups entries from the same repository into collapsible rows; switch to List for a flat list.
- **Rows** open a preview. A skill shows its `SKILL.md` and files, an MCP server its settings with secret values hidden, an extra its file or a folder's files, and the preview's Targets tab shows the state per target. Skills and agents offer Update, Diff, Disable (or Enable for a disabled one; the next sync applies it), Uninstall, and *Ask &lt;agent&gt; to audit…*, which sends the item to the focused Herdr agent after you confirm. Top-level declared hooks offer Enable, Disable and Remove, each after confirmation; Sync applies the saved changes.
- Hook counts include named entries and pending cleanup; diagnostic notices get rows of their own. Hook conflicts block syncing all resource kinds until resolved in the CLI or dashboard. If the plan cannot be read, entries show unknown sync status outside the groups.
- **Install** takes a repository URL. A repository with several skills shows a pick list. The panel clones it, runs [`skillshare audit`](/docs/reference/commands/audit) on the clone, and installs only when the audit passes. A blocked audit shows the findings, with *Install anyway* (`--force`) and *Ask &lt;agent&gt; to review…*.
- **Source** shows your source repository's state. Its dialog offers Pull, Commit and push, and Sync both ways. When a pull stops on files both machines changed, you pick a version per file from a side-by-side preview. `.metadata.json` merges per entry, the way [`skillshare pull`](/docs/reference/commands/pull) does.
@@ -57,9 +57,9 @@ Read ~/.config/herdr-app/AGENTS.md, then add this layout: herdr.dev/layouts/runk
パネルは Herdr が表示している space に追従し、その space のマシン上で、フォーカス中のターミナルのフォルダで skillshare を実行します。
- **Overview** は最初に答えを示します。「Everything is in sync」か、同期が必要なターゲットの数と、1 つの Sync ボタンです。その下には、source にある各種類の件数と各ターゲットへの 1 行が並び、どれが待機中かがわかります。タブの残りには、対応が必要なものだけを表示します。同期待ちのもの、更新があるもの、hooks の通知です。`.skillshare/config.yaml` のあるプロジェクトでは、タブの横にある All · Project · Global でスコープを選べます。
- **Library** は skills、agents、MCP サーバー、plugins、hooks を「Needs sync」「Update available」「In sync」に分け、無効な項目は「Off」にまとめて表示します。skills と agents では、「In sync」が同じリポジトリの項目を折りたためるグループにまとめます。List に切り替えると一覧表示になります。
- **行**を開くとプレビューが表示されます。skill では `SKILL.md` とファイル、MCP サーバーでは秘密の値を隠した設定が見られ、プレビューの Targets タブはターゲットごとの状態を示します。skills と agents には Update、Diff、Disable(無効なものには Enable。次の sync で反映されます)、Uninstall と「Ask &lt;agent&gt; to audit…」があり、確認後にその項目を Herdr でフォーカス中のエージェントに渡します。トップレベルで宣言された hooks には Enable、Disable、Remove があり、それぞれ確認後に保存され、Sync で適用されます。
- **Overview** は最初に答えを示します。「Everything is in sync」か、同期が必要なターゲットの数と、1 つの Sync ボタンです。その下には、source にある各種類の件数と各ターゲットへの 1 行が並び、どれが待機中かがわかります。タブの残りには、対応が必要なものだけを表示します。同期待ちのもの、更新があるもの、hooks の通知、ソースが見つからない extras です。`.skillshare/config.yaml` のあるプロジェクトでは、タブの横にある All · Project · Global でスコープを選べます。
- **Library** は skills、agents、MCP サーバー、plugins、hooks、extras(ファイルとフォルダーの extras、メモリノート)を「Needs sync」「Update available」「In sync」に分け、無効な項目は「Off」にまとめて表示します。skills と agents では、「In sync」が同じリポジトリの項目を折りたためるグループにまとめます。List に切り替えると一覧表示になります。
- **行**を開くとプレビューが表示されます。skill では `SKILL.md` とファイル、MCP サーバーでは秘密の値を隠した設定、extra ではそのファイルまたはフォルダー内のファイルが見られ、プレビューの Targets タブはターゲットごとの状態を示します。skills と agents には Update、Diff、Disable(無効なものには Enable。次の sync で反映されます)、Uninstall と「Ask &lt;agent&gt; to audit…」があり、確認後にその項目を Herdr でフォーカス中のエージェントに渡します。トップレベルで宣言された hooks には Enable、Disable、Remove があり、それぞれ確認後に保存され、Sync で適用されます。
- hooks の件数には名前付きエントリと削除待ちが含まれ、診断通知は専用の行で表示されます。hooks の競合は CLI またはダッシュボードで解決するまで全種類の同期をブロックします。プランを読み取れない場合、エントリは同期状態が不明としてグループ外に表示されます。
- **Install** はリポジトリ URL を受け取ります。複数の skills を含むリポジトリでは一覧から選べます。パネルはクローンに対して [`skillshare audit`](/docs/reference/commands/audit) を実行し、通過した場合だけインストールします。audit でブロックされると findings を表示し、「Install anyway」(`--force`)と「Ask &lt;agent&gt; to review…」を提示します。
- **Source** は source リポジトリの状態を表示します。ダイアログには Pull、Commit and push、Sync both ways があります。両方のマシンで変更されたファイルで pull が止まった場合は、左右の比較プレビューからファイルごとに残すバージョンを選べます。`.metadata.json` は [`skillshare pull`](/docs/reference/commands/pull) と同じくエントリごとにマージされます。
@@ -57,9 +57,9 @@ Read ~/.config/herdr-app/AGENTS.md, then add this layout: herdr.dev/layouts/runk
패널은 Herdr가 보여 주는 space를 따라가며, 그 space의 머신에서 포커스된 터미널의 폴더를 기준으로 skillshare를 실행합니다.
- **Overview**는 먼저 답을 보여 줍니다. "Everything is in sync"이거나, 동기화가 필요한 타깃의 수와 Sync 버튼 하나입니다. 그 아래에는 source에 있는 종류별 개수와 각 타깃으로 이어지는 줄이 있어 어느 타깃이 대기 중인지 알 수 있습니다. 탭의 나머지에는 처리가 필요한 것만 나열합니다. 동기화를 기다리는 항목, 업데이트가 있는 항목, hooks 알림입니다. `.skillshare/config.yaml`이 있는 프로젝트에서는 탭 옆의 All · Project · Global로 범위를 고릅니다.
- **Library**는 skills, agents, MCP 서버, plugins, hooks를 "Needs sync", "Update available", "In sync"로 나누고, 비활성화된 항목은 "Off"로 묶어 보여 줍니다. skills와 agents는 "In sync"에서 같은 저장소의 항목을 접을 수 있는 그룹으로 묶으며, List로 바꾸면 목록으로 보여 줍니다.
- **행**을 열면 미리보기가 나타납니다. skill은 `SKILL.md`와 파일을, MCP 서버는 비밀 값을 가린 설정을 보여 주고, 미리보기의 Targets 탭은 타깃별 상태를 보여 줍니다. skills와 agents에는 Update, Diff, Disable(비활성화된 항목은 Enable, 다음 sync에서 적용), Uninstall, 그리고 확인 후 해당 항목을 Herdr에서 포커스된 에이전트에 넘기는 "Ask &lt;agent&gt; to audit…"가 있습니다. 최상위에 선언된 hooks는 확인 후 Enable, Disable, Remove를 제공하며, 저장된 변경은 Sync로 적용합니다.
- **Overview**는 먼저 답을 보여 줍니다. "Everything is in sync"이거나, 동기화가 필요한 타깃의 수와 Sync 버튼 하나입니다. 그 아래에는 source에 있는 종류별 개수와 각 타깃으로 이어지는 줄이 있어 어느 타깃이 대기 중인지 알 수 있습니다. 탭의 나머지에는 처리가 필요한 것만 나열합니다. 동기화를 기다리는 항목, 업데이트가 있는 항목, hooks 알림, 소스가 없는 extras입니다. `.skillshare/config.yaml`이 있는 프로젝트에서는 탭 옆의 All · Project · Global로 범위를 고릅니다.
- **Library**는 skills, agents, MCP 서버, plugins, hooks, extras(파일·폴더 extras와 메모리 노트)를 "Needs sync", "Update available", "In sync"로 나누고, 비활성화된 항목은 "Off"로 묶어 보여 줍니다. skills와 agents는 "In sync"에서 같은 저장소의 항목을 접을 수 있는 그룹으로 묶으며, List로 바꾸면 목록으로 보여 줍니다.
- **행**을 열면 미리보기가 나타납니다. skill은 `SKILL.md`와 파일을, MCP 서버는 비밀 값을 가린 설정을, extra는 그 파일이나 폴더 안의 파일을 보여 주고, 미리보기의 Targets 탭은 타깃별 상태를 보여 줍니다. skills와 agents에는 Update, Diff, Disable(비활성화된 항목은 Enable, 다음 sync에서 적용), Uninstall, 그리고 확인 후 해당 항목을 Herdr에서 포커스된 에이전트에 넘기는 "Ask &lt;agent&gt; to audit…"가 있습니다. 최상위에 선언된 hooks는 확인 후 Enable, Disable, Remove를 제공하며, 저장된 변경은 Sync로 적용합니다.
- hooks 개수에는 이름이 있는 항목과 정리 대기 항목이 포함되며, 진단 알림은 별도의 행으로 표시됩니다. hooks 충돌은 CLI나 대시보드에서 해결할 때까지 모든 리소스의 동기화를 차단합니다. 계획을 읽을 수 없으면 항목은 그룹 밖에서 동기화 상태를 알 수 없음으로 표시됩니다.
- **Install**은 저장소 URL을 받습니다. skills가 여러 개인 저장소는 목록에서 고를 수 있습니다. 패널은 클론에 [`skillshare audit`](/docs/reference/commands/audit)을 실행하고 통과한 경우에만 설치합니다. audit에 막히면 findings와 함께 "Install anyway"(`--force`)와 "Ask &lt;agent&gt; to review…"를 보여 줍니다.
- **Source**는 source 저장소의 상태를 보여 주며, 대화상자에서 Pull, Commit and push, Sync both ways를 제공합니다. 두 머신이 모두 바꾼 파일 때문에 pull이 멈추면, 좌우 비교 미리보기에서 파일마다 남길 버전을 고릅니다. `.metadata.json`은 [`skillshare pull`](/docs/reference/commands/pull)과 같은 방식으로 항목별로 병합됩니다.
@@ -57,9 +57,9 @@ tab bar 会出现 **skillshare** 按钮,用来显示或隐藏面板。切换 s
面板跟随 Herdr 显示的 space,在该 space 的机器上、聚焦中 terminal 的文件夹里运行 skillshare。
- **Overview** 先给出答案:“Everything is in sync”,或者有多少个 target 需要同步,并提供一个 Sync 按钮。下面列出 source 中每种资源的数量,以及通向每个 target 的一行,可以看出哪些 target 在等待同步。标签页其余部分只列出需要你处理的内容:等待同步的、有更新的,以及 hooks 通知。在有 `.skillshare/config.yaml` 的项目中,标签页旁边的 All · Project · Global 可以切换 scope。
- **Library** 列出 skills、agents、MCP servers、plugins 和 hooks,分为“Needs sync”“Update available”“In sync”三组,已禁用的项目归入“Off”。对于 skills 和 agents,“In sync”会把同一个仓库的项目收进可折叠的分组;切换到 List 则显示为平铺列表。
- **行**会打开预览。skill 显示其 `SKILL.md` 和文件,MCP server 显示隐藏了密钥值的设置,预览的 Targets 标签页显示各 target 的状态。skills 和 agents 提供 Update、Diff、Disable(已禁用的则是 Enable;下次 sync 时应用)、Uninstall,以及“Ask &lt;agent&gt; to audit…”:确认后把该项交给 Herdr 中聚焦的 agent。顶层声明的 hooks 提供 Enable、Disable 和 Remove,每项都先确认;Sync 会应用保存的更改。
- **Overview** 先给出答案:“Everything is in sync”,或者有多少个 target 需要同步,并提供一个 Sync 按钮。下面列出 source 中每种资源的数量,以及通向每个 target 的一行,可以看出哪些 target 在等待同步。标签页其余部分只列出需要你处理的内容:等待同步的、有更新的、hooks 通知,以及源文件缺失的 extras。在有 `.skillshare/config.yaml` 的项目中,标签页旁边的 All · Project · Global 可以切换 scope。
- **Library** 列出 skills、agents、MCP servers、plugins、hooks 和 extras(文件和文件夹 extras,以及 memory 笔记),分为“Needs sync”“Update available”“In sync”三组,已禁用的项目归入“Off”。对于 skills 和 agents,“In sync”会把同一个仓库的项目收进可折叠的分组;切换到 List 则显示为平铺列表。
- **行**会打开预览。skill 显示其 `SKILL.md` 和文件,MCP server 显示隐藏了密钥值的设置,extra 显示其文件或文件夹中的文件,预览的 Targets 标签页显示各 target 的状态。skills 和 agents 提供 Update、Diff、Disable(已禁用的则是 Enable;下次 sync 时应用)、Uninstall,以及“Ask &lt;agent&gt; to audit…”:确认后把该项交给 Herdr 中聚焦的 agent。顶层声明的 hooks 提供 Enable、Disable 和 Remove,每项都先确认;Sync 会应用保存的更改。
- hooks 计数包含具名条目和待清理条目;诊断通知有单独的行。hooks 冲突会阻止所有资源同步,需先在 CLI 或仪表板中解决。无法读取计划时,条目会在分组外显示同步状态未知。
- **Install** 接受仓库 URL。包含多个 skills 的仓库会列出清单供你挑选。面板会先 clone,对 clone 运行 [`skillshare audit`](/docs/reference/commands/audit),通过才安装。audit 拦下时会显示 findings,并提供“Install anyway”(`--force`)和“Ask &lt;agent&gt; to review…”。
- **Source** 显示 source 仓库的状态,对话框提供 Pull、Commit and push 和 Sync both ways。pull 遇到两台机器都改过的文件时,可以从左右对照预览逐个文件选择要保留的版本。`.metadata.json` 会逐条合并,与 [`skillshare pull`](/docs/reference/commands/pull) 的做法相同。
@@ -57,9 +57,9 @@ tab bar 會出現 **skillshare** 按鈕,用來顯示或隱藏面板。切換 s
面板跟著 Herdr 顯示的 space 走,在該 space 的機器上、聚焦中 terminal 的資料夾裡執行 skillshare。
- **Overview** 先給出答案:「Everything is in sync」,或是有多少個 target 需要同步,並提供一個 Sync 按鈕。下面列出 source 中每種資源的數量,以及通往每個 target 的一列,可以看出哪些 target 在等待同步。分頁其餘部分只列出需要你處理的內容:等待同步的、有更新的,以及 hooks 通知。在有 `.skillshare/config.yaml` 的專案裡,分頁旁邊的 All · Project · Global 可以切換 scope。
- **Library** 列出 skills、agents、MCP servers、plugins 和 hooks,分成「Needs sync」、「Update available」、「In sync」三組,已停用的項目歸入「Off」。對於 skills 和 agents,「In sync」會把同一個 repo 的項目收進可收合的分組;切換到 List 則顯示為平鋪清單。
- **列**會開啟預覽。skill 顯示其 `SKILL.md` 和檔案,MCP server 顯示隱藏了機密值的設定,預覽的 Targets 分頁顯示各 target 的狀態。skills 和 agents 提供 Update、Diff、Disable(已停用的則是 Enable;下次 sync 時套用)、Uninstall,以及「Ask &lt;agent&gt; to audit…」:確認後把該項目交給 Herdr 中聚焦的 agent。頂層宣告的 hooks 提供 Enable、Disable 和 Remove,每項都先確認;Sync 會套用儲存的變更。
- **Overview** 先給出答案:「Everything is in sync」,或是有多少個 target 需要同步,並提供一個 Sync 按鈕。下面列出 source 中每種資源的數量,以及通往每個 target 的一列,可以看出哪些 target 在等待同步。分頁其餘部分只列出需要你處理的內容:等待同步的、有更新的、hooks 通知,以及來源遺失的 extras。在有 `.skillshare/config.yaml` 的專案裡,分頁旁邊的 All · Project · Global 可以切換 scope。
- **Library** 列出 skills、agents、MCP servers、plugins、hooks 和 extras(檔案和資料夾 extras,以及 memory 筆記),分成「Needs sync」、「Update available」、「In sync」三組,已停用的項目歸入「Off」。對於 skills 和 agents,「In sync」會把同一個 repo 的項目收進可收合的分組;切換到 List 則顯示為平鋪清單。
- **列**會開啟預覽。skill 顯示其 `SKILL.md` 和檔案,MCP server 顯示隱藏了機密值的設定,extra 顯示其檔案或資料夾中的檔案,預覽的 Targets 分頁顯示各 target 的狀態。skills 和 agents 提供 Update、Diff、Disable(已停用的則是 Enable;下次 sync 時套用)、Uninstall,以及「Ask &lt;agent&gt; to audit…」:確認後把該項目交給 Herdr 中聚焦的 agent。頂層宣告的 hooks 提供 Enable、Disable 和 Remove,每項都先確認;Sync 會套用儲存的變更。
- hooks 計數包含具名項目和待清理項目;診斷通知有獨立的列。hooks 衝突會阻止所有資源同步,需先在 CLI 或儀表板中解決。無法讀取計畫時,項目會在分組外顯示同步狀態未知。
- **Install** 接受 repository URL。含多個 skills 的 repository 會列出清單讓你挑選。面板會先 clone,對 clone 執行 [`skillshare audit`](/docs/reference/commands/audit),通過才安裝。audit 擋下時會顯示 findings,並提供「Install anyway」(`--force`)和「Ask &lt;agent&gt; to review…」。
- **Source** 顯示 source repository 的狀態,對話框提供 Pull、Commit and push 和 Sync both ways。pull 遇到兩台機器都改過的檔案時,可以從左右對照預覽逐檔挑選要保留的版本。`.metadata.json` 會逐筆合併,與 [`skillshare pull`](/docs/reference/commands/pull) 的做法相同。
+1 -1
View File
@@ -19,7 +19,7 @@ skillshare's source of truth is either the global configuration directory (`~/.c
| `ui/` | React 19 and Vite dashboard; its API client corresponds to `internal/server/` |
| `website/` | Docusaurus public documentation and marketing pages |
| `ai_docs/tests/` | Reproducible CLI E2E runbooks |
| `herdr/` | Herdr panel mod; it parses the CLI's `--json` output (`list`, `diff`, `check`, `status`, `mcp list`, `plugin list`, `hooks list`, `audit`), so changing those shapes means updating `herdr/skillshare/mods/skillshare/model.js` and `loader.js`; hook entries count separately from filtered diagnostic notices, and unnamed native changes retain pending Sync scope |
| `herdr/` | Herdr panel mod; it parses the CLI's `--json` output (`list`, `diff`, `check`, `status`, `mcp list`, `plugin list`, `hooks list`, `extras list`, `extras memory list`, `audit`), so changing those shapes means updating `herdr/skillshare/mods/skillshare/model.js` and `loader.js`; hook entries count separately from filtered diagnostic notices, and unnamed native changes retain pending Sync scope |
| `skills/skillshare/` | Built-in skill for skillshare users, not internal development instructions |
| `schemas/` | Public YAML/JSON schemas; inspect these when configuration shapes change |
| `scripts/`, `Makefile`, `mise.toml` | Build, test, devcontainer, and verification entry points |