organize-prototype
Rename, move, duplicate, archive, restore or delete a prototype, preserving its permanent links and the original work.
SKILL.mdsrc/modules/prototypes/skills/organize-prototype/SKILL.md
GitHubOrganize a prototype
The prototypes README is the contract; read "Organizing prototypes", "meta.json" and "References follow renames and moves". Run yarn studio context src/prototypes/<key>/<folder> --json first: it reports the owner, the system, a pending rebuild and whether you may change it (canEdit). Only a prototype's owner or an Admin changes it; apply the platform's contributor scope and resource identity rules (moves keep IDs, copies get fresh ones).
When the studio is running, the person can do each of these from the prototype's … menu; prefer pointing them there for a single prototype. The menu goes through the dev server's file service, which checks permissions and repairs references.
Rename or move
- A prototype's address is its permanent ID (
meta.jsonstudioId), so renames and moves never break links. Never changestudioId. - Renaming in the studio changes
meta.jsontitleand renames the folder to match (slugifyd title). By hand: changetitle, then rename the folder; refuse if a prototype of that folder name already exists. - Moving files inside a prototype: the running dev server repairs relative imports, navigation paths, Markdown links and canvas links after a move it can identify (
References follow renames and moves). Check the result before replacing anything yourself, and don't apply the same rewrite twice. With the dev server stopped, update references yourself.meta.jsonorderlists paths inside the prototype; keep it in step. - Prototypes stay in their contributor's folder (
src/prototypes/<key>/).
Duplicate
- Prefer the studio's Duplicate: it copies the folder (skipping
.git,node_modulesand modules' hidden folders such as.comments, refusing symbolic links), gives the copy, each artifact and each named state fresh permanent IDs, points the copy's own permanent links at the copy, resetscreated, and makes an archived source's copy active. The original stays untouched. An Admin's copy of someone else's prototype goes to the Admin's own folder. - A different system makes a rebuild copy: the copy keeps its current
systemIdand getsmeta.jsonrebuild: { targetSystemId, sourcePrototypeId }. Rebuild it with build-prototype, in the copy only: read the target system'sAGENTS.md, move the system-dependent views andsystemIdtogether, and removerebuildonly when the migration is complete and checked. The copy's sidebar offers ready-made instructions. - By hand, leave modules' hidden folders (such as
.comments) behind and never reuse an ID: copy, then give every file its own new ID withyarn studio identify(remove the copied identity comments first).
Archive or restore
meta.json"status": "archived"sets the whole prototype aside; active is the default and is never written. There is no per-artifact status.- An archived prototype stays in the local studio, read-only, and is left out of the deployed site entirely (not listed, built or bundled). Links to it there show a placeholder, and the build warns about active files that link to it: resolve those warnings, or accept the placeholder.
- Restoring removes
status(andarchivedBySystemId). It is refused while the prototype's system is deleted (rebuild it with an available system first) or archived (restore the system first). - Prefer archiving when the person wants to set work aside. Delete only when asked.
Delete
Delete only when the person asks.
- Run
yarn studio delete-prototype src/prototypes/<key>/<folder>and show the person its preview: links from other prototypes and canvas and document references that would break, what modules keep in it (such as comments), untracked files and uncommitted changes that would be lost.--jsongives it as data. - Apply with
--yesonly after they confirm. The command deletes the folder for good (it is not moved to the trash) and a running studio updates by itself. If it reports that another program is using the folder, close that program and run it again; nothing was deleted. - Report the links it listed, for their owners to update.
The studio's own Delete moves the folder to the computer's trash (the Recycle Bin on Windows) instead.
Verify
Open the prototype by its permanent address, check its navigation and the links you kept, and run yarn studio identity-audit after copying or moving files by hand. Report preserved originals and any links left for others.