The bar is position: fixed with left: 50%, so its shrink-to-fit width is
capped at the space right of its left edge, half the viewport. Content
wider than that wrapped inside the fixed 46px height, as seen on the Pi
and OMP pending-changes bars. Size it to its content and cap it at the
viewport instead.
The pages added with the block modes covered what they write, not what
the review fixes made them do. The sharing guide still said sync
overwrites a modified target, which is wrong for a block: sync stops
until the edit is collected or the block is rewritten.
The guide, the extras reference and the built-in skill now cover the
block's Collect and Rewrite choices, block statuses, the target file
dialog, what a mode change removes, how restore treats a block, and
the cases a block target is refused. Common errors gains an Extras
section for the four new messages. The --mode help of extras init,
--add-target and the mode command listed only import among the
single-file modes; it now lists prepend and append too.
Refs #436
Two gaps found by the fifth Codex review of #451:
- A source line that reads as a block marker, such as an unfenced
end marker, was copied into the body, so the freshly written target
parsed as damaged and every later sync, collect and detach failed.
The block is now parsed back before writing, and a source whose block
would not read back as itself is refused.
- When a block had created the target and the user then added lines
outside it, switching to symlink or copy kept the "created" record,
so restoring the link later removed the file and the user's lines
with it. Those lines are now recorded as the restore point.
Refs #436
Four gaps found by the fourth Codex review of #451:
- The check that refuses a target linked to another extra's source ran
for import only, so a prepend or append target linked that way had
its block written straight into that source. It now runs for every
mode that edits the target in place.
- Switching a target with a damaged block to symlink or copy recorded
the damaged block as the user's restore point, so detaching later
brought it back. Recording the restore point now fails on a damaged
block.
- Appending to a file that ends inside an open code fence put the begin
marker inside that fence, so the next sync missed the block and
appended another. Such an append is refused. Separately, a block body
with an unclosed fence now ends at the end marker whose body matches
the block's hash, even when the user's own code follows.
- A second prepend block counted its sibling above it as misplacing it,
so each sync moved one ahead of the other. Placement now ignores other
managed blocks on the same side.
Refs #436
DELETE /api/repos/{name} now refuses a repo with uncommitted changes or
unreadable git status, and the Dashboard page never sent force, so those
repos could not be removed from it at all.
The two refusals force overrides now carry their own error code. The
page still sends the first request without force; on either code the
confirmation says why and retries with force only when the user
confirms. Other refusals, such as a linked folder that is itself a
skill, keep the plain error because force does not change them.
Refs #442
On main these two readers scanned SKILL.md line by line and returned at
the line they were looking for, keeping nothing. After the refactor they
first collected the whole frontmatter block, so a large block cost its
full size on every call even when name came first, and an unclosed one
cost the rest of the file. Sync, target naming and listing call them
once per skill or agent. Reported by Codex review on #457.
The per-line rule (which line opens and which closes the block) moves
into blockWalk, which locateFrontmatter and the new scanLenientBlock
both use, so the streaming path and the byte locator cannot drift.
ParseSkillName and ParseFrontmatterField stop at their key again; the
list and fields readers collect the block as they always did. Results
are unchanged for every entry point.
Refs #449
Five gaps found by the third Codex review of #451:
- Switching a target with a damaged block (a deleted end marker) to
import ignored the parse error and added the @ line, so the tool read
the stale block as well. The switch now fails until the block is
repaired.
- Detaching such a target reported success without touching the file,
so Assign dropped the connection and left the block with nothing
configured to remove it. Detach now returns the error.
- PlanAssign decided whether a non-import target could take several
files, and Assign chose each new file's mode, from the extras before
the files being detached were gone. Removing the only block holder
while adding two files therefore passed the plan, then gave both new
files a link, the second replacing the first. The plan now detaches
first and Assign applies the modes the plan validated.
- When the last block left a file it had created but the user had since
added lines to, the created record stayed, so a later link attach and
restore deleted the user's file. The attach record is cleared once no
managed block or import line remains.
- A source with a fence that never closes swallowed the block's own end
marker on the next parse, so a freshly written target read as
damaged. An open block's end marker now ends it when the fence never
closes.
Refs #436
TestGitRemoteHash_DefaultBranchUsesAuth puts an extensionless shell
script named git first on PATH. On Windows exec.LookPath only resolves
names with a PATHEXT extension, so the script is ignored and the real
git.exe probes github.com, which answers "repository not found" for the
made-up repository. The auth env is built without any platform branch,
so the product path is unaffected; only the test double cannot work
there. Skip it for the same reason the fake-git tests in
internal/install/source_fallback_test.go already do.
Refs #444
Rebuilding the path readers on the shared locator made them read the
whole SKILL.md into memory, where they used to scan line by line and
stop at the closing delimiter. They run once per skill or agent during
sync and listing, so a large body, or a large file with no frontmatter
at all, now cost its full size on every call.
readHead goes back to a bufio.Scanner and keeps the lines from the
opening delimiter to the closing one, nothing before and nothing after.
Reading through the real Scanner also replaces the code that imitated
its quirks (64 KiB line cap, one \r dropped per line); ReadSkillBody,
which needs the body, takes them from scanLines. An unclosed block is
still kept to the end of the file, as the list and fields readers always
did.
Review follow-ups in the same files: RewriteFrontmatterList no longer
copies the content to a string and back, ParseFrontmatterField's two
loops no longer share an index, and the tests share one file helper.
Results are unchanged for every entry point.
Refs #449
The mode picker stores the new mode before syncing, so the block and
import handlers saw the previous mode's output as the user's content:
copy → prepend kept the whole copied source beside the new block,
import → prepend kept the @ line, and prepend → import kept the block.
The tool then read the instructions twice, and detaching removed only
the new representation.
Entering a block mode now rebuilds a leftover copy from the attach-time
base (backing up an edited copy as a mode-switch drift, as import does)
and drops this extra's @ line; entering import mode drops this extra's
block, keeping a hand-edited one as a drift backup.
Refs #436
Review of the shared uninstall operation found that RemoveByNames still
matched a bare key: removing top-level "foo" pruned the legacy entry
"foo" with Group "frontend", which belongs to the installed
frontend/foo. Entries are now matched by their full path only.
Also from review: a dry run no longer runs git status for tracked
repos (it reports no git state), the unused Outcome.Removed is gone,
the two single-item handlers share one status mapping, and the CLI
reports a single target in one place instead of three flag checks.
Refs #442
The dashboard update of N tracked repos loaded the metadata store 2N times
under the server lock, and each load walks the whole source tree. The refresh
now returns before loading when the repo has no root SKILL.md, reports
whether it saved a change, and the server reloads its store only then,
through the existing reloadSkillsStore.
The CLI single-repo path tracked its output with two flags and a OnceFunc.
The caller hook now runs once for every outcome, so the spinner stop, the
discard warning and the pull summary live in one place and print in the same
order as before.
auditGateFailClosed rebuilt three of its messages by hand; they are
AuditGateError's own wording with another subject, so both now come from one
function.
Refs #443
The source view of a target's file showed the block markers as plain
comments, so which lines skillshare manages, and which block had been
edited by hand, took reading the markers. Each managed block is now
tinted, a block the target reports as modified in the warning tone, and
the dialog says what the block is or offers Collect and Reapply for the
edited one, as the row does.
Refs #436
Resolution.Run started a goroutine for every remote, even without
Parallel. The dashboard handlers run sequentially and rely on net/http
recovering a panic, which it only does on the request's goroutine, so a
panic while resolving a remote would have ended the server process
instead of failing one request, as it did before the resolution moved
into internal/check.
The sequential and the parallel path are now separate loops, so the
invariant is visible instead of being spread over three Parallel checks.
Refs #444
Review of the guidance move found no defect, but three things made the new
seam harder to read than it has to be:
- The plan and apply handlers nested the success path inside `if err == nil`
with one shared error write. They return early again, like the handlers
next to them.
- The handler derived the scope from IsProjectMode() while GuidanceInput
derived the same value from ProjectRoot. Scope() is exported so the status
response and the block inspection read one value.
- (*Server).memoryInstructions had become a one-line passthrough with a
single caller, so it is inlined.
GuidanceReader is now exported, so its doc states what the server always
guaranteed: at least one source, and Dest indexing one of them. The
ApplyGuidance and Config comments say what callers need to know, and the
architecture paragraph is rewrapped.
No behaviour change.
Refs #450
Review of the shared tracked-repo update found two regressions.
`install --track --update` lost "in tracked repository" from its message when
findings blocked and the rollback failed. The CLI builds its summary from
that phrase, so the old sentence is back, with the rollback part still coming
from AuditGateError.RollbackNote.
The dashboard dropped a failed metadata refresh without a trace, while the
CLI prints a warning. It is now logged.
trackedBlockMessage also gets a test: the dashboard offers Force Retry based
on its exact wording, and the server-level tests for the failed-rollback
branches went away with the old gate.
Refs #443
Four gaps in the managed-block modes, found by Codex review of #451:
- Switching a block target to symlink or copy recorded the restore point
from the file as it stood, block included, so restoring the target
later brought back instructions the user had removed. The restore
point now strips this extra's block, as it already stripped its
import line.
- Detaching a target whose block had been edited by hand dropped the
edit outright. The edited file is now kept as a drift backup first,
as an edited copy or link is.
- Fences were only tracked outside a block, so a source that quoted a
marker in a fenced example produced a target that read as damaged on
the next sync. Fences are tracked inside the block body too.
- Changing a synced target between prepend and append left the block
where the old mode had put it, since body and hash still matched. A
block in the other mode's place is moved.
Refs #436
The uninstall sequence (move-out check, dirty check, move to trash,
.gitignore cleanup, metadata prune) lived in the CLI and in three
dashboard handlers, and the copies had drifted: three different prune
rule sets, no dirty check on DELETE /api/repos, and no metadata prune
at all on DELETE /api/resources, which left the removed skill's entry
and target overrides in .metadata.json.
internal/uninstall now owns the sequence for resolved items. Callers
keep name resolution, prompts, output, HTTP status and oplog.
MetadataStore.RemoveByNames is the single prune rule set: an entry goes
when it is a removed path or lies below one, by key or by Group, plus
the tracked legacy group of a top-level repo.
Behaviour changes, all intended:
- DELETE /api/repos/{name} refuses a dirty tracked repo, or one whose
git status cannot be read, with 409 unless ?force=true.
- DELETE /api/repos/{name} refuses a followed link whose folder is
itself a skill, like every other uninstall path.
- DELETE /api/resources/{name} prunes the skill's metadata.
- Removing top-level "foo" no longer prunes "frontend/foo" (CLI), and
removing repo "_team" no longer prunes the untracked group "team"
(dashboard batch); both dropped metadata of skills still installed.
Refs #442
A target row showed only the path of the file the tool reads, so seeing
what a prepend or append block actually did to that file meant leaving
the tab for the target page. The path now opens a read-only dialog with
the same preview and source views, and a link to the target page for
editing. Riders keep a plain path: they have no file of their own.
Refs #436
Updating a tracked repo is a fail-closed sequence: check for uncommitted
changes, pull, audit what was pulled, reset to the pre-pull commit when the
audit blocks. The CLI had two copies of the pull flow, the dashboard a third,
and the audit gate existed four times (CLI, dashboard, and two in install).
The copies had drifted: the dashboard ignored a failed git status and never
refreshed root-skill metadata, and each copy worded a failed rollback on its
own.
update.TrackedRepo now owns the sequence and returns a structured result;
install.AuditGate is the only gate. internal/update is a new package because
internal/git already imports internal/install. The CLI keeps its spinner,
rows and the "Apply anyway?" prompt, passed in as one Confirm callback; the
dashboard turns the result into its JSON item.
Behaviour changes, all towards the stricter copy:
- the dashboard reports a failed git status as an error instead of pulling;
- the dashboard refreshes root-skill metadata after an update, like the CLI;
- a prompt that fails rolls the update back instead of leaving it applied;
- the rollback-failed and rollback-unavailable texts come from one place.
Accepted findings stay as they were (CLI honours and records them, the
dashboard does neither), now as the explicit AcceptedFindings input. The
"blocked and rolled back" texts are unchanged per caller because the
dashboard matches on them.
Refs #443
The dashboard's pull flow for tracked repos had no tests of its own, and the
CLI had none for uncommitted changes. Both flows are about to be replaced by
one shared operation, so their current results are pinned first: clean
update, blocked and rolled back, skip-audit, force not remembering findings,
dirty repos, and the pull error hint.
Refs #443
Each reader in internal/utils found the --- delimiters with its own
loop, under four different rules that were only visible by reading all
of them, and the list reader existed twice with a path copy and a bytes
copy that had drifted apart. A fix to one reader, like the mcp serve
fixes to the strict one, did not reach the others, and nobody could say
which rule an entry point followed without tracing it.
locateFrontmatter now does the locating for every reader, and the rule
is a frontmatterPolicy value: strictBlock, lenientBlock, bodyBlock and
rewriteBlock name the rules that exist and the entry points that use
them. The rules themselves are not unified; every entry point returns
what it returned before, including the bufio.Scanner quirks of the
readers that take a path (a line of 64 KiB or more ends the content,
one \r is dropped per line), which now live in scannable. The strict
reader still walks only to the closing delimiter and copies nothing.
Two more cases found by comparing old and new code on random input are
pinned: a block scalar on the last frontmatter line, and \r\r\n endings.
Refs #449
The prepend and append modes are a feature, so Release Please would
propose 0.26.0 for this batch. The maintainer wants it to ship as
0.25.1, so ask for that version.
Release-As: 0.25.1
The AGENTS.md tab and the instructions API only knew import, symlink
and copy, so a tool without @import could hold one shared file and had
to give up its own instruction file to do it.
The mode picker now lists prepend and append first among the modes that
keep the tool's own file, with import; symlink and copy stay blocked
once a target holds another shared file in a managed part. A target
whose file already holds a block defaults the next shared file to
prepend; the first connection keeps the link default the existing
tests and the memory guidance rely on. The row hint says the target
also uses the other files instead of claiming one replaces the other,
and the modified-state note, Collect and Reapply name the block rather
than the whole file, since only the block is read back or rewritten.
The connect and restore previews describe what a block does to the
target file.
Refs #436
Tools without an @import directive (codex, gemini, cursor) could only
take a shared instruction file as a symlink or copy, which replaces the
target's own file. Teams that want one shared AGENTS.md plus the user's
own notes in the same file had no way to express that.
prepend and append write the source into the target file as a managed
block fenced by skillshare:extra markers that carry the source path and
a content hash. Sync inserts the block once and then rewrites it in
place, status reports modified when the block body no longer matches
its hash, Collect copies the edited body back to the source, Reapply
rewrites the block from the source, and restore removes only the
block. Lines outside the block, and markers inside code fences, are
never touched. Several managed blocks (and an import line) may share
one target file; the connection validator only rejects a file when a
replacing mode (symlink, copy, merge) is involved.
Refs #436
The guidance rules (status ranking, mixed_modes, multiple_blocks, the plan
token, and check -> backup -> recheck -> write) were methods on *Server, so
they could only be exercised over HTTP with a configured server, and the
recheck after backup depended on callers using the right helper.
internal/memory now owns status, plan, and apply behind GuidanceStatus,
PlanGuidance, and ApplyGuidance. The server resolves targets, assignments,
shared extras, and project reach into a GuidanceInput, syncs shared copies
through a callback after each written file, and maps results to JSON. Only
ApplyGuidance reaches the write steps, so the recheck cannot be skipped.
Note creation and guidance creation shared a copied O_EXCL create with
delete-on-failure; both now use createExclusive. Each keeps its own
behaviour: notes still chmod to 0644, guidance still creates parents.
HTTP routes, shapes, status codes, and error codes are unchanged. The raw
write allowances follow the calls to their new functions.
Refs #450
The CLI, GET /api/check and the check stream each wrote out the same
sequence: group skills by URL and branch, ask the remote hash, skip the
tree fetch when every skill matches, otherwise compare tree hashes and
assign a status. A fix such as branch handling had to be made three
times, and the sequence could only be tested against real repositories.
internal/check now owns it as Plan and Resolution.Run, with the remote
hash source injected and a per-remote progress callback. The CLI
progress bar and the SSE counter are adapters on that callback; the JSON
handler passes none.
The callers disagreed in two places, and both behaviours are kept: the
dashboard reports a skill removed upstream as update_available where the
CLI says stale, and gives no source or version for a skill without a
remote. The server adapter narrows the result accordingly.
Refs #444
The CLI, GET /api/check and the check stream each carry their own copy of
the resolution sequence, and only its leaf helpers were tested. Pin what
each caller reports for every outcome, against local bare remotes, so the
copies can be merged without changing output.
Refs #444
The readers in internal/utils locate the --- delimiters under different
rules, so the same SKILL.md can give different answers depending on the
entry point. Before they are rebuilt on one locator, these cases record
each entry point's current result on the inputs where the rules differ
(indented or late delimiters, unclosed and empty blocks, trailing
spaces, CRLF, BOM, delimiters in the body) and on a line longer than the
bufio.Scanner cap that the path readers silently stop at.
Refs #449
The raw write ratchet listed the os calls of downloadFile,
giteaDownloadFile and cnbWriteBlob. Those now go through
writeDownloadedFile, so the list names that function instead, with the
same clone reason.
The GitHub, Gitea and CNB content API fallbacks wrote every file as
0644, so a skill's scripts lost their exec bit whenever sparse checkout
was not available. The APIs do not report the git mode, so a file that
starts with #! is now written as 0755; anything the kernel could run
directly carries one. The mode is set on both branches, because
O_TRUNC keeps the mode of a file that already existed.
Refs #439
Both schemas reject unknown keys, but plugins, cnb_hosts and
gitea_hosts were missing from both, the global schema also lacked
extras_source and log, and skillEntry had no kind, so editors flagged
valid configs. A test now compares the yaml tags of Config and
ProjectConfig with the schema properties.
Refs #438
Two handlers checked for a project's own config by statting
.skillshare/config.yaml directly, so a project created with
init -p --visible (directory skillshare/) was reported as not having
one, and the MCP page missed its override conflict. Both now ask
projectdir.Find, which the CLI already uses.
Refs #437
Keep bundled CommonJS converters working inside ESM projects. Show concise sync failures with expandable original diagnostics and clarify that the last-sync card covers skills and agents only.