Skip to content

Context Library: Skills app redesign for the new Workshop UI - #1330

Draft
maxwellpeterson wants to merge 27 commits into
mainfrom
mpeterson/skills-app-redesign
Draft

maxwellpeterson wants to merge 27 commits into
mainfrom
mpeterson/skills-app-redesign

Conversation

@maxwellpeterson

@maxwellpeterson maxwellpeterson commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Stacked on #1257 (base pjones/workshop-app-port); retarget to main once #1257 merges. #1257 ships the new Workshop UI with the Context Library's app as it is on main; this PR brings the Skills app's redesign for it, split out so it can be reviewed on its own.

What is here

  • packages/gatekeeper-context/app: the Skills app rebuilt on @gadgets/ui, for the new Workshop UI (skills, collections, files, sharing, upload, deep links through GatekeeperAppNavigation).
  • app-classic/: main's app, unchanged apart from small fixes, drawn in the old Workshop UI's frame. app/boot.ts picks one on load by the frame's name: the new UI names its gatekeeper-app frame NEXT_UI_FRAME_NAME (already in Workshop app: the reworked Workshop UI, behind the workshop-frontend-experimental flag #1257). Both designs are in the one bundle.
  • HierarchicalList moves from @gadgets/ui into app-classic/, its only user.
  • Server (src/), what the new app relies on:
    • every document write gets a revision; a skill move deletes the source only if every file is still the one copied, checked in the same transaction, and otherwise leaves it and says so;
    • moves transfer files in chunks of at most 8 MiB, staged at the destination (skillImports, skillImportFiles) and listed in one commit, so a skill above the 32 MiB RPC limit moves; staged files of a move that never committed are discarded after an hour;
    • deleting or moving a skill takes exactly its own files (skillFilesOf), with every SKILL.md, valid or not, bounding nested skills, as the app lists them;
    • the skills listing says which collections are Git-backed, and the app shows no edit, add, upload or move controls for them.

Review threads

The bot's findings on these files were fixed on #1257 before the split and resolved there. Not done: the final commit of a move still loads all staged bodies at once (bounded per RPC, not in memory).

Checks

pnpm lint, gatekeeper-context's tests and its type checks pass on this tree; CI runs the rest.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Preview: pr1330-mpeterson-sk-bcbd2365

https://pr1330-mpeterson-sk-bcbd2365-router.cloudflare-os-previews.workers.dev

Dashboard · deleted when this PR closes

const [name, setName] = useState('')
const [description, setDescription] = useState('')
// Their first, My skills, unless they have none yet, which the first skill makes.
const [collection, setCollection] = useState(collections[0]?.id ?? '')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep skills private unless the user picks a shared destination. The default here is the first collection the user owns, which can already be shared. Submitting without touching the picker sends its ID, bypassing the private-default path in SkillStore.add(), and the options only show titles. The implicit upload path has a related gap: SkillStore.#collectionFor() trusts its cached membership.shared, so an upload from a tab left open before My skills was shared still writes into it (confirmed against the store and its in-memory backend). Default to an explicit private option, label shared destinations, and check that an implicit destination is still unshared when the server writes to it.

useEffect(() => () => void store.reload(), [store])
return (
<div className="min-h-0 flex-1 bg-kumo-base">
<CollectionEditor collectionId={view.collectionId} selectedPath={view.path} onSelectPath={onSelectPath} backLabel={backLabel} onBack={onBack} onGone={onGone} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reset the document editor when the collection changes. The host pushes path changes without remounting the iframe, but this call lost the old key={collectionId}. If Back/Forward goes between two document URLs while a delete confirmation is open, CollectionEditor retains pendingDelete from the first collection while performDeletePath() uses the second collection's ID. Confirming can delete the same-named file in the wrong collection. Key the editor by view.collectionId, as the previous caller did.

this.#update()
return id
}
await this.#backend.renameContextSkill(place.collectionId, place.path, metadataName)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the same file membership for renaming as for viewing and moving. For a root SKILL.md, the new Files tab includes siblings such as notes.md, but the existing renameContextSkill() only relocates the manifest in that case. A rename leaves notes.md behind, so relative references break. In the opposite direction, renaming a non-root skill also moves independently listed nested skills, changing their IDs. Use skillFilesOf() for the rename initiated here so it moves exactly the files the user sees as part of the skill.

name={name}
you={member.displayName !== undefined}
role={label}
access={lastOwner ? undefined : <AccessMenu label={label} of="you" remove={{ label: 'Leave collection', onRemove: leave }} />}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restore confirmation before leaving from the share dialog. This menu item immediately calls leaveCollection(). For the sole remaining viewer or editor of an ownerless collection, leaving permanently deletes its documents, even if everyone can still view it (packages/gatekeeper-context/AGENTS.md: “it is deleted once its last grant goes, even if everyone can view it.”). The Settings tab already asks for confirmation and explains that consequence; use the same confirmation here.

{onOpenCollection && (
// Who has it is its collection's to say, which is where it is shared.
<SettingRow title="Collection" description={`It’s kept in ${collection?.title ?? 'a collection'}, and shared with whoever that is shared with.`}>
<Button onClick={() => onOpenCollection(skill.collectionId)}>Open collection</Button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protect drafts when opening the collection. Edit a file, switch to Settings, then click Open collection. That leaves SkillPane and drops its local drafts without the confirmation used by the breadcrumb. Coming back to the skill opens the saved version. Apply the same discard guard here or keep the draft across this navigation.

}
this.storage.transaction(() => {
if (!this.storage.skillImports.get(importId)) {
for (let started of Array.from(this.storage.skillImports.list())) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expire incomplete imports even if no other move arrives. If a move fails after staging a chunk but before calling commitContextSkillImport() (for example, a later source file changed), the only expiry check runs on the first chunk of a different import into this exact collection. With no further moves, the destination retains those unlisted copies indefinitely. Schedule expiry through the collection alarm and clean up immediately when the caller detects a failed transfer.

actions={addable
? [
{ label: 'Write a skill', icon: PencilSimpleIcon, variant: 'primary', onClick: () => setWriting(true) },
{ label: 'Upload files', icon: UploadSimpleIcon, onClick: () => filesRef.current?.click() },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let a folder be the first skill uploaded. When the collection has no skills, the toolbar with Upload a folder is hidden, and Upload files only targets the Markdown file input. A user with a SKILL.md bundle cannot import its supporting files here until a skill already exists. The library empty state has the same gap (SkillLibrary.tsx). Reuse the upload menu in both empty states.

@ask-bonk

ask-bonk Bot commented Dec 1, 2026

Copy link
Copy Markdown

Review: 7 findings.

All seven are in the inline review.

github run

@maxwellpeterson
maxwellpeterson force-pushed the mpeterson/skills-app-redesign branch from bfbe19e to 5bb66ae Compare December 1, 2026 22:16
onSave={async (tag) => {
if (anyUnsaved && (tag.trim() || undefined) !== skill.tag) return { saved: false, problem: unsavedFirst }
try {
await moving(() => skillStore.setTag(skill.id, tag))()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show who will get access before moving a private skill. SettingField saves on blur (useEditedField.ts:59), so typing an existing collection’s name and clicking away immediately moves the skill and all of its files. SkillStore.setTag() resolves an owned collection by title, even if it is shared with the whole deployment. Nothing in the field identifies the destination’s audience before the move. Use an explicit move action that shows the destination’s sharing status and asks the user to confirm moves that expand access.

if (!isSkillManifestPath(manifestPath)) throw new Error("Skill manifest filename must be SKILL.md.");
let manifest = this.storage.documents.get(manifestPath);
if (!manifest) throw new Error(`Document not found: ${manifestPath}`);
if (!this.storage.documents.get(manifestPath)) throw new Error(`Document not found: ${manifestPath}`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verify the target is a text manifest before deleting its files. This guard only checks the name and that a record exists. A binary root SKILL.md is not a skill according to isSkillManifestDocument(), but this call now deletes every document outside nested skills, whereas it previously deleted only the root file. I verified that skillFilesOf() selects an unrelated reference.md in that case. Use isSkillManifestDocument() on the stored record so invalid text drafts can still be deleted without treating a binary document as a skill.

: [manifestPath];
if (!paths.includes(manifestPath)) throw new Error(`Document not found: ${manifestPath}`);
await this.#deleteContextDocuments(paths);
return skillFilesOf(manifestPath, [...this.storage.documents.list(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep document bodies out of the source’s file inventory. This spread holds every body in the subtree before filtering nested skills, and a root SKILL.md scans the entire collection. A tiny root skill can therefore fail to move or delete because unrelated nested skills contain more than the 128 MB isolate limit. This happens before any transfer chunk or destination commit. Collect only paths, content types, revisions, and sizes as the storage iterator yields records, then read bodies only for the transfer batch.

* then delete the skill from.
*/
exportContextSkill(actorId: string, isAdmin: boolean, manifestPath: string): ContextSkillExport {
this.#assertWebWritable();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check collection access before reporting its storage type. The new move RPC accepts collection IDs, and exportContextSkill() and stageContextSkillImport() test #assertWebWritable() before the grant. An account that no longer has access to a collection can still distinguish a private Git-backed collection from a missing or inaccessible web collection by the error. packages/gatekeeper-context/AGENTS.md says the grants and everyoneCanView flag “are the sole authority”. Run #assertActorCanEdit() before the storage-type check in each new move step, as existing edit RPCs do.

if (!manifest) throw new Error('It’s no longer there.')
await this.#backend.putContextDocument(place.collectionId, place.path, {
description,
body: withMetadata(manifest.body, skillNameFromTitle(skill.name), description),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep the saved manifest name when changing only its description. describe() fetches the current SKILL.md, but replaces its name with the cached list title. If another editor changes name in the file while this page is open, updating the description silently restores the old name, even though the fresh read has the new one. Update only description in recognized frontmatter and use a fallback name only when repairing a manifest that has no usable name.

@ask-bonk

ask-bonk Bot commented Dec 1, 2026

Copy link
Copy Markdown

Review: 5 findings.

Posted five new findings in the inline review. The seven earlier threads remain open; the current head has the same file tree as the previously reviewed commit.

github run

maxwellpeterson and others added 22 commits December 1, 2026 15:02
The port of the reworked Workshop UI (packages/workshop-app), with the draft editor it uses
(packages/billow), the shared components it moved into @gadgets/ui, and the Skills app rebuilt
on them in gatekeeper-context. Rebased from pjones/workshop-app-port onto main with every
kernel change dropped: workshop-backend and workshop-shared are main's, as landed in #1270.

What the app had that main's kernel does not serve is cut or reshaped:
- Replies to a message (replyToSequence) are gone.
- The card beside a chat of what it has and can use (listChatArtifacts) is gone; what is listed
  beside a chat comes from the library and the conversation as loaded.
- Run pills in the chat that started a run, the runs menu by the composer and a run's way back
  to its parent (spawnedByChatId) are gone.
- A share link is redeemed by the open itself (openWorkspace(id, key)).
- Recent chats and what waits in a workspace read chat heads (working, waiting) and the
  per-gadget counts of WorkspaceSummary; the Automations page reads subscribeToWorkspaceHooks().
- A shared workspace whose chats are paused (chatAccessRequired) says so on its row.
- Messages are sent with ChatMessageOptions, attachments with a blob are read by readBlob(),
  and a gadget's page is given the host main defines, which keeps no focus.

gatekeeper-scheduler keeps its management app, as on main.
…os-ui cookie

Adds the workshop-app UI feature flag (replacing the placeholder) and the
cfos-ui=next cookie the two UIs use to switch between them. Where the
backend binds ASSETS (deployments that serve the SPA from the backend), a
page request carrying the cookie gets the new UI's page; everything else is
served from ASSETS unchanged. Without the binding nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…op-app flag

The old UI sets the cfos-ui=next cookie and reloads once the workshop-app
flag is on (at most once per tab); the new UI clears it and reloads once the
flag has been read as off, never on a failed read and never without the
cookie, so previews keep the new UI for everyone.

build:workshop-assets puts workshop-app's page beside workshop-frontend's
build as next.html, with its chunks under next-assets/, for a backend that
serves both from one assets directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Skills app's API gained listSkillCollections, which the search test ranks first.
…p cookie in the router

The backend's page picker was reachable in no deployment: the router answers pages from its own
assets before any worker runs. It moves to the router, which a preview now runs first for every
path over workshop-app's dist-workshop (both UIs), so turning the workshop-app UI flag on and off
switches a preview between them. workshop-backend is back to main's.
…s do

Restores #1291's backend page picker, which the previous commit wrongly removed: internal
deployments serve the Workshop's pages from the backend. A preview now does the same: the backend
binds ASSETS over workshop-app's dist-workshop and runs first for every path, and the router has
no assets, so it forwards everything to the backend. The router's copy of the picker is dropped.
The workshop-app UI flag is read through FLAGS, which no preview bound, so it was always off.
The app (cloudflare-os-previews) is in the previews account: apps are per account.
… go back

The old UI's profile menu offers "Try the new design" to a user the workshop-app flag is on for,
which sets the cfos-ui cookie and reloads; it no longer switches by itself. The new UI's account
menu offers "Use the classic design" where its page was served for the cookie, which clears it.
The choice is per browser. A user the flag is turned off for is still sent back.
motion 14.14 (from main) types a spring's mass as number | "auto", which the critically damped spring could not multiply by.
…new one

The Context Library's bundle holds both designs: main's app as app-classic/ (with HierarchicalList,
its only user), and the new one. app/boot.ts picks on load by the frame's window.name, which the new
UI's GatekeeperAppFrame sets to NEXT_UI_FRAME_NAME; the old UI sets none. Each design puts in its own
styles when started, so the other's do not apply. No gatekeeper interface changes.
…agship app, public files

- The backend serves the classic page to native sign-in handoffs whatever the UI cookie, and
  treats a path as an asset only by a known asset extension, so /library/templates/format.document
  gets the new UI.
- The preview backend binds the Flagship app named by PREVIEW_FLAGSHIP_APP_ID (a repo variable),
  and none without one.
- The assets build ID also hashes the files Vite copies from publicDir.
… and moves

- Follows the Workshop's address through GatekeeperAppNavigation, so a collection, file or skill
  link opens that page.
- A SKILL.md whose frontmatter fails to parse stays listed with its error, to be fixed in place.
- Opening a skill reads at most 16 files at once; moving to another collection lands at its root;
  New collection always makes a private one.
- Text typed while a file saves is kept; rename and move wait for unsaved edits to be saved.
…he classic switch

- Share links: a classic gadget link keeps #share on redirect; gadget links are copied in the
  /workspace/<id>?w=<g> form both UIs open; /blueprint/<id> is public again; /gatekeepers/<id>/<path>
  and /apps/<id>/<path> reach a page inside the app.
- Chat: worktree:// downloads and images render from a message's embeds; thumbnail reads are
  capped; attachments use the kernel's limits and stream; Always show thinking no longer reverses
  a trace's own choice; opening a step inside a trace keeps its place; the mascot names its toggle.
- Composer: links keep balanced parentheses; a format waits for the turn like files; a failed first
  send restores its connections; a deleted link drops its pending connection; undo keeps the format.
- Gadgets: a view-only recipient opens the snapshot (badge, refresh, no exports); historical diffs
  show committed text; approvals decided while loading stay out; standing approvals can be stopped
  from workspace settings; RpcGate signs nobody in after it is let go.
- The classic switch lands on the matching classic page and waits for unsent drafts and code edits.
- Error reports label template routes instead of their bearer id; URL host checks parse the URL.
…acking trim in skill names

- Both UIs keep the error-report session id under one sessionStorage key, so the classic one's
  Math.random fallback flowed into the new UI's reports; both now fall back to getRandomValues.
- skillNameFromTitle joins the alphanumeric runs instead of trimming dashes with a regex.
…re key

- A path is an asset file only at the top level with a dot, or under assets/, next-assets/,
  pdfjs/ or icons/; a Skills document link such as .../files/config.json gets the new UI.
- Switching to the classic UI carries #share=<key>, which the old UI redeems.
…one skill-file rule; Git collections read-only

- Each document write gets a revision; a move deletes the source only if every file is still the
  one copied, in the same transaction, and otherwise leaves it and says so.
- Moves send files in chunks of at most 8 MiB, staged at the destination and listed in one
  commit, so a skill above the 32 MiB RPC limit moves.
- deleteContextSkill deletes exactly the skill's own files (skillFilesOf), and nested skills are
  bounded by every SKILL.md, valid or not, as the Skills UI lists them.
- The skills listing says which collections are Git-backed; the Skills UI shows no edit, add,
  upload or move controls for them, and a move by a title two collections share is refused.
…ction stay private

- Use the classic design asks first when a draft, its files or code edits are unsent, as the
  automatic fallback waits for them.
- A skill added or uploaded with no collection goes to a private My skills, never a shared one.
…acked PR

- packages/gatekeeper-context is main's again: the Skills redesign, its classic copy and the
  server's move, delete and listing changes go to the PR stacked on this one.
- HierarchicalList stays in @gadgets/ui (`@gadgets/ui/hierarchical-list`) for main's Skills app.
- The new UI still names the frame it hosts gatekeeper apps in (NEXT_UI_FRAME_NAME); main's
  app ignores the name, and the stacked PR's reads it.
- The other half of the previous commit: main's Skills app is app/ again, so app-classic/ goes.
- list-skill-collections is the stacked Skills PR's; main's app has no such command.
- Gadget approvals: Always allow is left to the workspace's ordered drain; in restricted mode each request is approved on its own; the dock rereads bindings for requests from its chat and starts its subscription once; a gadget's View run opens its run.
- Templates list the connections their agents need (spawnerOnly), and the template store starts over for another account.
- Classic /admin?tab= and ?agent= links land on the right page; the classic switch reloads a same-address page; a first message being sent holds the page against leaving.
- A reconnected chat reads the messages between what it showed and the latest page.
- A link made a connection stays written where it was, so the message keeps its order.
- billow: edits made while an IME composes wait for the composition to end.
- setLink uses #1240's changeDefaultShareLink, keeping everyone the old link would narrow, so a failure leaves the old link as it was instead of two live links.
@maxwellpeterson
maxwellpeterson force-pushed the pjones/workshop-app-port branch from 562ebf8 to d797cfd Compare December 1, 2026 23:06
@maxwellpeterson
maxwellpeterson force-pushed the mpeterson/skills-app-redesign branch from 5bb66ae to c96326f Compare December 1, 2026 23:07
*/
async putFiles(id: string, files: SkillFile[]) {
const place = this.#place(id)
for (const file of files) await this.#write(place, file)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep an upload from overwriting a nested skill’s files. The parent’s Files tab excludes nested/notes.md when nested/SKILL.md exists, but uploading a folder containing that same relative path from the parent calls putContextDocument() on the child’s file and replaces it without warning. I verified this against SkillStore: the file was absent from the parent’s list but its stored body was overwritten. Check that each target path belongs to the selected manifest before writing the batch, and report paths that belong to another skill.

}))
files.push(...read.flat())
}
this.#files.set(id, inOrder(files))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore file reads superseded by a save or a newer open. Reopening a skill shows cached files while useSkill starts a background open(), so an editor can save while that read is still pending. I delayed an older read, saved a new body, then released the read: the store showed the old body after the save succeeded. That stale body can then become the starting point for the next edit. Have open() use a per-skill request generation and ignore superseded results. This is the frontend convention: “Effects that fetch or subscribe must clean up stale work and remain correct when restarted.”

const fromLabel = skillNameFromTitle(candidate.label)
const name = isValidSkillName(candidate.name) ? candidate.name : isValidSkillName(fromLabel) ? fromLabel : 'untitled-skill'
const description = candidate.description.trim() || `Instructions for ${humanizeSkillName(name)}.`
await this.#backend.createContextSkill(collectionId, `${name}/${MANIFEST}`, { description, body: writeSkillUploadMetadata(candidate.manifestBody, name, description) })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle upload name collisions without dropping the rest of the selection. If report/SKILL.md already exists, importing report.md rejects at this call and every later candidate is skipped. Two selected files that normalize to the same name have the same problem. The classic uploader uses buildNewSkillLocation() to allocate a free name and writes that name into the manifest. Reuse that behavior here and continue past individual failures so unrelated selected files can still import.

if (named[0]?.contentSource === 'git') throw new Error(`“${title ?? UNTAGGED}” is kept in Git, so skills are put in it through Git.`)
const into = await this.#collectionFor(title)
// Into the other collection's top: it may have none of the folders this one is in.
const path = await this.#backend.moveContextSkillToCollection(place.collectionId, place.path, into, '')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refresh both collections when a move fails after copying. moveContextSkillToCollection() can publish the destination copy and then reject because a source file changed; the collection-sharing test exercises exactly that outcome. Here the rejection skips reload(), so the error says the other collection has a copy while that collection’s Skills tab doesn’t show it. Reload on rejection too, while preserving the error and leaving the user on the source skill.

@ask-bonk

ask-bonk Bot commented Dec 1, 2026

Copy link
Copy Markdown

Review: 4 findings.

Posted four new findings in the inline review.

github run

- Unsaved gadget code is kept per account.
- Approvals stay individual until the workspace says whether it read restricted data.
- Owners, listed with no role, can open their gadgets' agent runs.
- billow maps an IME composition through each edit queued during it, in order.
- Switching to classic keeps a gatekeeper app's subpage.
@maxwellpeterson
maxwellpeterson force-pushed the mpeterson/skills-app-redesign branch from c96326f to 308376a Compare December 1, 2026 23:15
…sts do

- vitest's browser CDPSession type has no `send` without Playwright's augmentation, which would add Node globals to the browser TS project; feature-check it as ShareModal.browser.test.tsx does.
…ith safer skill moves and deletes

- app/ is the redesigned Skills app, built on @gadgets/ui; app-classic/ is main's app, drawn in
  the old Workshop UI's frame. app/boot.ts picks by the frame's name (NEXT_UI_FRAME_NAME).
- HierarchicalList leaves @gadgets/ui for app-classic/, its only user.
- Server: per-write revisions; moves check them before deleting the source and transfer in
  staged chunks of at most 8 MiB; delete and move take a skill's own files, with every SKILL.md
  bounding nested skills; the skills listing says which collections are Git-backed.
@maxwellpeterson
maxwellpeterson force-pushed the mpeterson/skills-app-redesign branch from 308376a to 71f6ee4 Compare December 1, 2026 23:21
const manifest = file.path === MANIFEST
return this.#backend.putContextDocument(place.collectionId, `${place.folder}${file.path}`, {
// What the skill is for, which the Context Library reads from `SKILL.md` too.
description: manifest ? descriptionOf(file.body) ?? '' : '',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preserve supporting documents’ descriptions on save. Editing weekly/notes.md in the Files tab sends an empty description even if the document already has one. I confirmed that calling SkillStore.saveFile() on a described Markdown file clears it; the backend replaces the stored record, and collection search uses that description for ranking. Preserve the current description for body-only edits, as the Documents editor does for a file without a description in its frontmatter.

const skillStore = useSkillStore()
const state = useSkillsState()
const narrow = useNarrowScreen()
const collection = state.status === 'ready' ? state.collections.find(({ id }) => id === collectionId) : undefined

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep existing collection links readable for everyone-viewable collections. A non-member following an existing /collections/<id> link now gets ‘Collection not found’ because this page only checks the viewer’s indexed library. The old route loaded metadata by ID under canReadCollection(), which allows this viewer. The Context Library guide says, ‘Everyone-viewable only grants read access … it never adds the collection to anyone’s library.’ Resolve a direct link with a live per-ID read when the collection is absent from the list.

<ConfirmMenu
label="Delete collection"
title={`Delete “${collection.title}”?`}
description={`${skills.length === 0 ? 'It has no skills.' : `${skillCount(skills.length)} ${skills.length === 1 ? 'is' : 'are'} deleted with it.`} This can’t be undone.`}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tell users that deleting a collection also deletes its other documents. A documents-only collection gets the confirmation ‘It has no skills. This can’t be undone.’ The same action erases every file on its Documents page. The existing Documents confirmation shows the total document count; use that count here too, or explicitly say that all documents will be permanently deleted.

logger.warn("failed to list a library collection's skills", {
event: "library.collection.skills.list.failed", collectionId: entry.id, error: err,
});
return null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Distinguish a failed read from a missing collection. A transient getSkillListing() failure is returned the same way as a live access denial. The app treats the resulting list as ready, so a direct link says ‘Collection not found’ and the home page can say ‘No collections yet,’ without offering a retry. The classic navigator tracks document-load failures separately and lets users retry. Return a partial-failure signal alongside successful listings so the app can offer a retry while still omitting collections the viewer can no longer access.

if (run !== this.#run) return
const read = listed.map((info) => {
const by = sharedBy(info)
const skills = skillsIn(info.documents).map(({ manifest }) => this.#skillOf(info, manifest, by, info.permissions.canEdit && info.contentSource !== 'git'))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build file inventories only when opening a skill. This list consumes only manifest, but skillsIn() rescans the collection’s full document list for each manifest to compute files, which is then discarded. Running these same scans for 2,000 skills with two supporting files each took about 1.2 seconds in Node; the iframe does this synchronously on every reload, including after edits. Filter for manifests here and call skillFilesOf() only for the requested manifest in open().

@ask-bonk

ask-bonk Bot commented Dec 1, 2026

Copy link
Copy Markdown

Review: 5 findings.

All five are in the inline review.

github run

...contents,
} satisfies ContextSkillCollection;
});
return listed.filter(collection => collection !== null);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bound the Skills listing response across collections. This sends every document summary, including non-skills, back as one Workers RPC result. I checked with local workerd: a response shaped like this with 1,100 documents and permitted 16,000-character descriptions fits for one collection, but two fail the 32 MiB RPC limit. Each collection is readable on its own, yet the new app fails to load the whole library. Return bounded pages of skill manifests and collection metadata; fetch the supporting-file summaries when a skill opens.

async setTag(id: string, tag: string | undefined): Promise<string> {
const place = this.#place(id)
const title = tag?.trim() || undefined
const named = this.#collections.filter((info) => isOwn(info) && info.title === (title ?? UNTAGGED))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Treat an empty Collection field as the private default. If the user shares My skills, the next implicit upload creates a second, unshared My skills. I reproduced that state with SkillStore, then cleared the Collection field on a skill in Reports: it rejects because it counts both collections, even though only one is eligible under #collectionFor(). Use the same private, web-managed eligibility for a blank field before checking for duplicate names, so users don’t have to rename a shared collection to untag a skill.

const place = this.#place(id)
const manifest = await this.#backend.getContextDocument(place.collectionId, place.path)
if (!manifest) throw new Error('It’s no longer there.')
await this.#backend.putContextDocument(place.collectionId, place.path, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reject descriptions that would disable a working skill. The inline description edit uses the generic document write, which accepts invalid manifests. I saved a 1,025-character description through SkillStore.describe(); the stored manifest then failed parseSkillManifest() with “Skill description must be at most 1024 characters.” The heading edit appears to succeed, but the skill drops out of the assistant’s commands. Validate the field against the manifest’s description limit before writing, while still allowing invalid drafts in the raw file editor.

<EditableTitle
multiline
value={skill.description}
onRename={(description) => void change('change it', () => skillStore.describe(skill.id, description))}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don’t let a file draft silently undo a saved description. Edit the instructions in SKILL.md without saving, then change the description in the heading and save the file draft. The heading saves to the same SKILL.md, but the retained draft still has the old frontmatter. I verified that describe() followed by saveFile() with that draft saves the instructions and silently restores the original description. Guard the heading edit while the manifest has unsaved changes, or reconcile the description into the draft.

)}
{markdown && !editing && (
<div className="rounded-3xl bg-kumo-tint px-5 py-4 text-base text-kumo-default">
{readable ? <Markdown onTint>{readable}</Markdown> : <p className="text-kumo-subtle">Nothing written yet.</p>}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep bundled images visible in skill previews. The previous skill row opened the document viewer, whose MarkdownImage resolves images such as ![Diagram](assets/diagram.png) against the collection. The new Preview and Files tabs pass that text to the shared Markdown renderer, whose URL filter drops the relative source; the image becomes alt text even though the bundle contains the file. Reuse the Documents viewer’s relative-image lookup here, or resolve those images from the skill’s loaded files. packages/ui/AGENTS.md: “Keep product data fetching, routing, RPC, permissions, and domain workflows in the consuming app.”

@ask-bonk

ask-bonk Bot commented Dec 1, 2026

Copy link
Copy Markdown

Review: 5 findings.

Posted all five as inline comments.

github run

maxwellpeterson added a commit that referenced this pull request Dec 2, 2026
…experimental flag (#1257)

The reworked Workshop UI (`packages/workshop-frontend-experimental`,
formerly `packages/workshop-app`), rebased onto `main` with every kernel
change dropped: its kernel half landed as #1270, and `workshop-backend`
/ `workshop-shared` here are `main`'s, apart from the UI gate below. The
branch as it was before the rebase is kept at
`pjones/workshop-app-port-pre-rebase`.

### What is here

- `packages/workshop-frontend-experimental`: the new app, with billow,
the draft editor its composer uses, in `src/billow/` (formerly its own
package, `packages/billow`).
- `packages/ui`: the shared components the app moved into `@gadgets/ui`.
`HierarchicalList` stays there for the Context Library's app.
- `packages/gatekeeper-context` is as on `main`: the new UI hosts the
Skills app unchanged. Its redesign for the new UI, with the server
changes it needs, is the stacked #1330.
- `packages/router`, `scripts/assets-build-id.ts`, both UIs'
stale-session code: `/api/version` also answers the build id of the
frontend the router serves, for the update notice. Where it answers none
(the backend serving the pages itself), the notice compares the page's
entry script with that of a fresh load of `/`.
- Previews serve both UIs from the backend, as internal deployments do,
and read the `workshop-frontend-experimental` flag from the Flagship app
named by the `PREVIEW_FLAGSHIP_APP_ID` repository variable
(`cloudflare-os-previews` in the previews account); with none set, the
preview binds no flag provider (`scripts/preview/staging-config.ts`,
`.github/workflows/preview.yml`).

`gatekeeper-scheduler` keeps its management app, as on `main`.

### Cut or reshaped to fit the kernel that landed

- **Replies to a message** (`replyToSequence`): removed, with the
scroll-to-message it was the only user of.
- **The card beside a chat** of what it has and can use
(`listChatArtifacts`): removed. What is listed beside a chat comes from
the library and the conversation as loaded.
- **Run parentage** (`spawnedByChatId`): the run pills in the chat that
started a run, the runs menu by the composer and a run's way back to its
parent are removed. The Agents pages and run status stay.
- **Share links**: redeemed by the open itself (`openWorkspace(id,
key)`); there is no separate redeem call.
- **Recent chats and what waits**: read from chat heads (`working`,
`waiting`) and `WorkspaceSummary.waiting`'s per-gadget counts. Recent
rows no longer name an agent, and the sidebar says gadgets and chats,
not agent runs.
- **Automations page**: reads `subscribeToWorkspaceHooks()`, subscribed
while the page is open.
- **Paused chats**: a shared workspace with `chatAccessRequired` set
shows a cue on its row.
- **Main drift**: messages are sent with `ChatMessageOptions`;
attachments with a blob are read by `readBlob()`; `needsApiToken` is
gone from the admin models page; the gadget host implements
`reportFocus` / `onNavigate` and keeps no focus.

### Switching between the old and new UI (from #1291, by @Maximo-Guk)

#1291's commits are cherry-picked: the UI flag (renamed here from
`workshop-app` to `workshop-frontend-experimental`), the `cfos-ui=next`
cookie, and `build:workshop-assets`. Where the backend serves the
Workshop's pages itself (`ASSETS` bound), a page request carrying the
cookie gets the new UI, except native sign-in handoffs
(`cfos_native_state` / `cfos_native_key`), which always get the classic
page; a path counts as an asset only by a known asset extension, so
dotted template ids are app routes. These are the only kernel lines in
this PR (`workshop-backend/src/ui-variant.ts`, four lines in
`server.ts`, `workshop-shared/src/feature-flags.ts`).

On top of that, the switch is the user's choice, per browser:
- A user the flag is on for stays in the old UI; its profile menu offers
**Try the new design**, which sets the cookie and reloads.
- The new UI's account menu offers **Use the classic design** wherever
its page was served for the cookie, which clears it and opens the
matching classic page (`/` where there is none).
- A user the flag is turned off for is sent back to the old UI, once
nothing unsent (a draft, files, code edits) would be lost.
- Links work across both: a gadget's share link is copied as
`/workspace/<id>?w=<gadget>#share=<key>`, which the old UI opens and the
new one redirects keeping `#share`; `/blueprint/<id>` stays public in
the new UI; old `/gatekeepers/<id>/<path>` links open that page in the
app.
- The new UI names the frame it hosts gatekeeper apps in
(`NEXT_UI_FRAME_NAME`), so that an app can draw a design for it;
`main`'s Skills app ignores the name, and #1330's reads it.

To try it on this PR's preview: the `workshop-frontend-experimental`
flag lives in the previews account's Flagship app
`cloudflare-os-previews` (on for the redesign group by email); add
yourself to its rule. A Flagship app that still has only the old
`workshop-app` flag serves the flag as off.

### Still needed in the kernel before this ships

Both were deferred in #1270's review as prerequisites:
- a backfill of workspace summaries and hooks for workspaces not opened
since the deploy (the app shows unknown as none);
- a byte budget for bounded `getChatHistory` pages, which this app is
the first to request.

### Review threads

Fixed in the latest commits: the bot's simple and bounded UI findings
(sharing and legacy links, CodeQL, chat embeds and attachments,
composer, gadget snapshots and standing approvals, the classic switch,
the page picker and previews). The page picker knows assets by directory
(so app deep links ending in a file name, like `.../files/config.json`,
get the new UI), and the classic switch keeps `#share=` and asks before
dropping unsent work. The Skills app findings were fixed before the
split and moved with it to #1330.

Also fixed, all on the frontend:
- Gadget approvals: **Always allow** is left to the kernel's ordered
drain; in restricted mode requests are approved one at a time; the dock
rereads bindings for requests from its chat and starts its subscription
once; a gadget's View run button opens the run.
- Templates count the connections their agents need (`spawnerOnly`), and
the template cache starts over for another account.
- Classic `/admin?tab=` and `?agent=` links land on the matching page;
the classic switch reloads when only the fragment differs; a first
message being sent keeps the unsent-work hold.
- A reconnected chat reads the messages between what it showed and the
latest page.
- A link made a connection stays written where it was, so the message
keeps its order.
- billow queues edits made during IME composition until it ends.
- Changing the share link between Can use and Can view is one server
step, through #1240's `changeDefaultShareLink`.
- Unsaved gadget code is kept per account; approvals stay individual
until the workspace says whether it read restricted data; owners can
open their gadgets' agent runs; billow maps a composition through each
queued edit in order; switching to classic keeps a gatekeeper app's
subpage.

Still open and deliberately deferred: save-attempt isolation in
`saveCode` (needs either a chat per save or a kernel ownership check),
and per-UI build IDs in `/api/version` for backend-served pages (the
update notices fall back to the entry script meanwhile).

---------

Co-authored-by: Maximo Guk <62088388+Maximo-Guk@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from pjones/workshop-app-port to main December 2, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gatekeeper Changes to a gatekeeper integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants