docs: spec — templates create Cabinets, libraries extend them - #257
Open
oxedom wants to merge 2 commits into
Open
docs: spec — templates create Cabinets, libraries extend them#257oxedom wants to merge 2 commits into
oxedom wants to merge 2 commits into
Conversation
Splits the two catalogs on the action they perform: a Template creates a new Cabinet, a Library adds parts to an existing one. Kills the three-way "template" overload in code, adds empty-state discovery and a Templates sidebar entry, and extends preview to the Home carousel. Verification cut most of the draft. Registry preview already exists, import is already transactional, and the getting-started rename is production-breaking for too little value, so it is out of scope. The draft's "import into the empty Cabinet" decision is reversed: it would have let a failed download rm -rf the user's Cabinet. Adds ADR-0003 recording why the two catalogs are not merged into one Gallery. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The paragraph described how the directory rename would behave on user disks, which contradicts the section immediately above it stating the rename is out of scope. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Design spec only. No code changes. Lowest priority of the three current specs.
The taxonomy
Two catalogs look alike but do different things:
POST /api/registry/importscaffolds a new Cabinet. A bootstrap.POST /api/agents/library/[slug]/addcopies one part into an existing Cabinet. An extend.The boundary is the action, not the size of the thing. A single merged "Gallery" was considered and rejected: it hides the one distinction that matters at click time — does this create a Cabinet, or add to the one I'm in? See ADR-0003.
Today "template" means three different things in code and "getting started" means two.
Scope
templateoverload (resolveAgentTemplateDir→resolveLibraryAgentDir, response keys, and the four duplicateLibraryTemplatedeclarations collapsed to one export).RegistryTemplatekeeps its name — it's a genuine template.What verification cut
Most of the draft. Checked line-by-line against the code:
RegistryBrowserhas rendered a full org chart from/api/registry/[slug]since before this spec — the route already returnsagents[],jobs[],children[], and README. No manifest change needed. Only the Home carousel imports blind, so this work is a fraction of what was drafted.github-fetch.ts:109-112,import/route.ts:82-86). The draft's "possible bug" was wrong./api/agents/libraryhas three consumers, not two — the draft misseduse-agent-picker.ts:27.Cut from scope: the
resources/getting-startedrenameProduction-breaking for too little value:
prepare-electron-package.mjs:252hardcodes"getting-started", and itscopyDirectory(:133-141) opens withif (!(await pathExists(fromPath))) return;— a missing source is a no-op, not an error. So the rename produces a greenelectron:makethat ships a.seedwith no guide content. No build error, no test failure.:253copiesresources/example-cabinet-carousel-factory, which does not exist. It has been silently skipping for some time.The bigger bug found underneath (follow-up, not fixed here)
seedGettingStartedDiris already a no-op in every packaged build.PROJECT_ROOT = process.cwd()(runtime-config.ts:5) is not derived fromresourcesPath/__dirname,main.cjsspawns the standalone server with nocwd, and.next/standalonecontains noresources/. Packaged installs seed one guide at the data root via.seed; dev seeds one per Cabinet. Dev and production have silently diverged, and any CI test of the seeder passes while proving nothing about production. Filed as its own issue — and it's the prerequisite that would make the rename cheap later.A decision reversed
The draft said the tour-tail template path should "import into the empty Cabinet in place". That would let a failed download delete the user's Cabinet.
targetPathis a parent path that 409s on an existing dir, anddownloadRegistryTemplaterolls back withfs.rm(targetDir, { recursive: true, force: true })— safe only because that path is always newly created. The spec now requires a distinctintoPath, server-side emptiness checks, temp-dir staging with merge-on-success, and a rollback that can only touch the temp dir.Note
Depends on
CONTEXT.md, which lands via #256 (the onboarding spec).🤖 Generated with Claude Code